# Gas station without pumps

## 2021 September 16

### Last to-do note in book done

Filed under: Circuits course — gasstationwithoutpumps @ 10:46
Tags: , , , , , ,

I’ve finally removed the last to-do note from the text book. This one was an explanation of the threshold voltage for FETs as the transition between the subthreshold conduction, where the on-resistance has exponential behavior with $V_{gs}$ and the on-region, where it is roughly constant.

I don’t like copying graphs from datasheets for the textbook, so I needed to measure the values myself to make a plot. My first attempt, using the PMV20XNE nFETs that we used for the past few years in class, was a failure.  The typical on-resistance is only 23mΩ, which is too small for the crude measuring setups and low currents that I could get with the Analog Discovery 2.  I ended up mainly measuring the resistance of the test setup, with errors larger than the value I was trying to measure, so I couldn’t even subtract off the short-circuit measurement.

I tried again with a low-power nFET (a 2N7000), using a constant load resistor of 150Ω (so the maximum power dissipation in the ¼-W resistor would be $(5V)^2/150\Omega = 167mW$).

I controlled with the gate voltage with waveform generator, and measured both the drain-source voltage and the drain current. I used the oscilloscope tool and averaged both within a sweep and across many sweeps to reduce noise.

Because the Analog Discovery 2 has only 2 measurement channels, I had to manually copy the measurements into a file for gnuplot, as there was no way to record the waveform generator output with the measurements in a single file (well, there might be with the scripting capabilities of Waveforms 3, but I’ve not explored them much).

I noticed some pretty large offsets when measuring small voltages, so I did open-circuit and short-circuit measurements and used them to subtract off offsets (with the understanding that the current for the open circuit would be about 150µA, because of the 1MΩ impedance of the Channel 1 measuring the open-circuit voltage).

The corrections make a big difference at the low end, where on-resistance is comparable to the resistance of the measurement instrument and test currents are tiny. The correction at the high end is smaller, but still noticeable. The transition from the exponential behavior of subthreshold conduction to the on-region is pretty clear. (Click to enlarge)

Now all I have to do for the next release of the book is do the standard final checks (page breaks, spell checks, and URL checks).  This will probably take me another week.

## 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