Gas station without pumps

2018 February 25

Weekend off!

Filed under: Uncategorized — gasstationwithoutpumps @ 15:43
Tags: , , , ,

I had only 2 hours of grading to do this weekend (but next weekend will make up for that, with more than 30 hours of grading), so I got a chance to do some other things for a change:

• Buy groceries at Trader Joe’s.  (“Groceries” is misleading here, as I generally view Trader Joe’s as a beverage store—I bought soy milk, mineral water, hard cider, beer, port, and whiskey, plus cereal, chocolate, and prunes.  I don’t drink whiskey or mineral water and my wife doesn’t drink port or soy milk, but the cider and beer are for both of us.)
• Do a protein structure prediction for a microbiology colleague.  I no longer use my own tools for protein-structure prediction, as they have succumbed to the changes in C++ and operating systems, so that they can no longer be compiled or run.  I’ve also not maintained the template library for several years.  Because the only predictions I get asked to make these days are ones for which there are good templates, I just use HHpred and Modeller on-line.  For that sort of prediction, they are quick and do an adequate job.  The goal of this prediction was to get a good guess of binding-site residues for a chemosensor, to guide site-directed mutagenesis.  Unfortunately, the available structures did not have ligands bound, and for most of them no one knows what the real ligand is anyway, so I had to make guesses based on the structure without solid evidence for how ligands bind to them.
• Check whether the nFET and pFET we’ll be using next quarter have small enough gate capacitances to be driven directly from a comparator, or whether we’ll still need to use 74AC04 inverters as digital amplifiers.  We could probably just barely get away with using the comparators, but the chips end up running rather warm, so I’m still going to recommend using the digital amplifier.   One inverter for both the nFET and pFET gate seems to be fine, though—the rise and fall time is short enough that we don’t need to use a separate inverter for each gate.
• Review courses for the Committee on Courses of Instruction meeting tomorrow—I only had 13 courses to review this time, and I’d already looked at half of them.

I still have this evening—maybe I’ll repot the free live Christmas tree my wife picked up yesterday.  We gave our old one away in January, because it was getting pot bound and we did not want to transfer it to a larger pot—the current one was as heavy as we could haul up the steps.  The new one is tiny, but should last us several years before it gets to be too big.  Today might also be a good day to put the Christmas ornaments back in the attic—we’ll probably have to rebox some of them, as Marcus (our kitten) has shredded some of the boxes.)

2015 April 27

Ideas for improving hysteresis lab

Filed under: Circuits course — gasstationwithoutpumps @ 08:38
Tags: , , , , ,

The hysteresis lab was the least successful one so far this year.  Students got the designs done and built, but they learned less than they could have from the lab (too much copying of “answers” without understanding) and the lab took too long for the time allotted.

I’m considering going back to a 2-day hysteresis lab, but expanding the lab slightly to include using an nFET to control a loudspeaker (probably with a series resistor to limit current to 500mA). Adding the nFET as a low-side switch would be a useful thing for them to know about (it is a standard arrangement for controlling heating elements, solenoids, and other devices in lab equipment), and would prepare them better for the class-D power-amp lab.

The problem here is that a good oscillation frequency for a touch sensor uses a small capacitor (hence a high frequency), while a good oscillation frequency for the loudspeaker is much lower (200Hz–4kHz).  I can have them add an external capacitor (resulting in little or no touch sensitivity) when driving the loudspeaker, or I can have them build two oscillators: a high-frequency one and a low-frequency one.

I’d want to redesign the board they solder the hysteresis oscillator on to make room for the nFET and loudspeaker connections,  plus giving them more holes for connecting up unused pins on the 74HC14N chip.  This will probably make the board bigger than 2.5cm×5cm, raising the price by 50¢.  They’d need an extra nFET in their kits (another 40¢) and perhaps another screw terminal (80¢).  An extra buck or two for the parts is no big deal, as the lab fee is already larger than what the students are getting, though the extra cost for having to use UC-approved vendors may be eating up most of the “excess” fees.

The lab could be split between the breadboard and the soldering phases, with students who are behind still completing the breadboarding in the second lab.

One question I’ve not resolved is how to reschedule the labs so that there is room for a 2-day hysteresis lab.  Is there any lab that currently takes 2 days that can be squished to 1 day (with less damage than squishing the hysteresis lab)?  How do I keep the reports on schedule so that I can grade over the weekend?

2014 June 4

Random topics in class today

Filed under: Circuits course — gasstationwithoutpumps @ 19:20
Tags: , , , , ,

Since students have started on their last lab, there is no more material that I have to cover, so I threw today’s lecture open for questions.  I had prepared some material on Wien-bridge oscillators, in case no one had any questions, but we filled the time with stuff they were confused about from earlier in the quarter.  In roughly the order I covered them, we talked about

• FETs. I showed the cross-sections of nFETs and pFETs, explained the “back gate” or substrate connection and why it was tied to the source on the power FETs. I also talked about the flyback diodes and why they are needed when driving inductive loads.  This also gave me an opportunity to talk about how ignition coils on cars work.
• PWM. I redid a lecture that had not gone over well the first time, talking about how the rectangular voltage pulses turn into up and down ramps for current in an inductive load, and how duty cycle gets converted to current level.  I still think I could do a better job of the PWM talk, but the students were feeling better about understanding how their class-D amplifiers worked.
• I also introduced H-bridges for DC motor speed control, and showed how PWM could control the motor to turn forward or backward at different average current levels.
• A student asked about how the gain in theirpreamp affected thefinal output loudness, so I redrew a part of the comparator function from their lab handout:

Example of comparator output comparing a slow signal from a preamp and a fast triangle wave to get a pulse-width modulated wave.

I then showed how a small signal centered at the same voltage as the triangle wave would produce a 50% duty cycle, with only small fluctuations from 50% as the signal went up or down.

• Finally, I reviewed sampling and aliasing, explaining where the beat patterns they saw in their lab came from.  I think I need to provide more on that earlier in the quarter, as they did not seem to get as much from the sampling and aliasing lab as I had hoped.

Tomorrow is the last lab (unless students request extra time in the lab to redo something next week), and I expect all the students to finish their EKG soldering.  I did remember to suggest that everyone solder a board, so that they could have one to demo to people, but we’ll see how many takers there are tomorrow.

On Friday, I’ll once again take questions, but I’ll still have the Wien-bridge oscillator to present if they don’t have anything to ask.

2014 May 30

Class-D amplifier lab done, EKG block diagrams begun

Filed under: Circuits course — gasstationwithoutpumps @ 21:08
Tags: , , , , ,

Yesterday’s lab ran long (as expected), because students had not gotten enough done in Tuesday’s lab.  But everyone in the lab did get a working class-D power amplifier.  Several also managed to measure the turn on and turn off times for the comparators driving the FETs, though that required some hands-on guidance in using the digital scopes (setting the trigger level to the FET threshold voltage, then looking to see how long the rise or fall was before reaching the trigger level.  As expected, everyone had chosen values that made the pFETs turn on and off quickly, but it was difficult to get the nFETs to turn off quickly.  I don’t know whether anyone managed to equal turn on and turn off times for the nFET (they turned on fairly fast), but several groups managed to keep their FETs cool.  Even those with warm FETs did not dissipate so much in them that they got dangerously hot.

I’ll be reading the design reports over the weekend, and I’ll see whether the students really understood PWM or not.  I suspect that about half the groups understood what they were doing well enough, and the other half got part of the ideas.  There should be time on Monday to review the idea of PWM and to explain again why it is a good choice for efficient power delivery, particularly for inductive loads.

Today, I returned the quiz 2s redone as homework.  Students did fairly well on them as homework (range 18.5 to 31.5 out of 36, up from 7 to 17 on the timed quiz).  The biggest difficulty was with the last problem, which asked them to design a simple amplifier, giving both a block diagram and a schematic.  A lot of students did not understand the question as I phrased it, perhaps because I had not been clear enough earlier in the quarter about what a block diagram means and how to use it.

Students have not yet internalized the idea of something having inputs and outputs, and a block diagram being a refinement of an I/O spec into I/O specs for subunits.  I may need to use that language more explicitly earlier next year. I’m thinking also that I need to add more text to the lab handouts next year and refer to them as a draft textbook rather than as lab handouts.  How many pages do I have so far?

handout pages
01-thermistor  11
02-microphone  9
03-hysteresis  11
04-electrodes  7
05a-loudspeaker  8
03b-sampling  7
06-audio-amp  6
07-pulse-monitor  11
08-pressure-sensor  8
09-power-amp  13
10-EKG  5
total  100

One hundred pages is a bit short for a textbook, but there is a lot of explanatory material still missing (most of which I provided in class or in lab). If I worked on it diligently over the summer, I could probably create a book with most of what the students need that would be around 200 pages. Do I have the energy to turn this into a textbook? Is it worth the effort?

After going over the block diagram of the quiz problem, I helped the students develop an EKG block diagram.They did get to the realization that the unknown but potentially large DC offset from the EKG electrode half cells limits the gain that they can ask from the first stage of the EKG, and that they’ll have to high-pass filter and add more gain.  The design is similar to their pressure sensor instrumentation amp, but the gain needs to be higher (1000 to 1500, rather than 100 to 250), and the pressure sensor amplifier had to go down to DC, so did not include a high-pass filter.

I was a little worried that I may have suggested too high a lower end for the passband (0.1Hz to 40Hz).  They’ll get less baseline drift with a 0.5Hz cutoff instead of 0.1Hz.  My EKG designs have used 0.05Hz—88.4Hz and 1.0Hz–7.2Hz for the blinky EKG.  Both worked ok, but I now think that the 7.2Hz cutoff is too low (it was adequate for blinking an LED, but not for recording the waveform).  Since I did not have much problem with a 0.05Hz corner frequency, I think they’ll be ok with a 0.1Hz one.  The blinky EKG circuit has an adjustable gain (needed to make the R spike large enough to light the LED), but it is probably better to have a fixed gain.

It would be really nice if they could finish the EKG on Tuesday, since the annual undergraduate poster symposium is scheduled for the same time as the Thursday lab, and I always like to spend an hour or so looking at the posters.

2014 May 24

Class-D amplifier lecture 2

Filed under: Circuits course — gasstationwithoutpumps @ 17:41
Tags: , , , , ,

Yesterday, in the last lecture before the long weekend (hence before they start wiring their Class-D power amplifiers), I covered three topics:

• open-collector outputs.  I had hoped to avoid that this year by switching to the TLC3702 comparators, but I couldn’t get the TLC3702 comparators to work with the FETs, so I went back to using the LM2903 comparators that the students got in their parts kits.  Because I had already cut the open-collector information from the lab handout, I had to cover it in lecture, and I’ll have to write an addendum to the handout today.
• LC filters for the loudspeaker.  This was a pretty rushed job.  I didn’t even have time to get them to derive the LC filter behavior with no load (the standard voltage divider formula $\frac{Z_{down}}{Z_{up}+Z_{down}}$ becomes $\frac{1/(j \omega C)}{j\omega L + 1/(j \omega C)}=\frac{1}{1-\omega^2 LC}$, which goes to infinity at $\omega=1/\sqrt{LC}$ and 0 at DC and infinite frequency.  Instead I pointed them to a gnuplot script that they needtomodify to see how much power the LC filter delivers to the loudspeaker at different frequencies, with different choices of capacitor (no choices for them on the inductor—it is a 220µH 0.252Ω AIUR-06-221 inductor).

LC filter and loudspeaker model used for sizing the capacitor in the gnuplot script. The students need to replace the loudspeaker model with the one that they created in an earlier lab. I think that next year I may use a much simpler loudspeaker model in the script, so that I can tell whether the students have replaced the model or not.

The output of the gnuplot script looks something like this:

Output of the gnuplot script. Note that too small a capacitor results in a spike near 61kHz and nowhere near enough suppression of the 50kHz–100kHz PWM frequency. Too large a capacitor results in a big boost in gain around 3.8kHz, which would a different sort of problem. Click