# Gas station without pumps

## 2019 May 10

### Inductive spikes

Filed under: Circuits course — gasstationwithoutpumps @ 22:04
Tags: , , , ,

One of the labs in my textbook Applied Analog Electronics asks students to look at the inductive spikes created by switching a nFET on and off with a loudspeaker as a load:

A 5V pulse signal to Gn will turn the nFET on.

My students were very confused when they tried the experiment, because they got a different result:

What the students got at the nFET drain went a little above 5V, but did not have the enormous inductive spike they expected.

Of course, I lied to you a little about what their circuit was—they were working with half-H-bridge boards that they had soldered:

The half H-bridge boards have a pFET and capacitor on them, as well as an nFET.

The pFET was left unconnected, so the circuit was really the following:

The gate and pFET source were left floating in the student setups.

So what difference does the pFET make? Well, with the gate floating and staying near 0V, the pFET turns on when the pFET source voltage gets high enough, allowing the capacitor to charge.

The pFET source gets up to about 7.2–7.3V, and the time constants for the capacitor and loudspeaker are long enough that the capacitor looks like a power supply (not changing voltage much on this time scale), so that the body diode of the pFET snubs the inductive spike at about a diode drop above the pFET source voltage.

So how did I miss this problem when I did my testing before including the lab in the book? One possibility is that I left out the bypass capacitor—without it you get the expected spike. But I know I had included the capacitor on my half-H-bridge boards—I had to solder up a board without the bypass capacitor specially last night, in order to get the “expected” plot in the first plot of this post.  I think what happened is that when I had done my tests, I had always connected the pFET gate to the pFET source, to ensure that the pFET stayed off, but when I wrote the book, I forgot that in the instructions. Here are the plots of the board with the pFET gate and source tied together (both floating), both floating separately, and with the them both tied to 5V:

With the pFET gate and source tied together, the circuit behaves as expected, with large inductive spikes if the pFET source is floating, but snubbed to a diode drop above 5V if the source is tied to 5V.

The pFET source voltage gets quite high when the pFET gate and source are tied together to keep the FET off, but they are not tied to the power rail:

Because the pFET never turns on, the body diode and capacitor acts as a peak detector, and the capacitor charges until the leakage compensates for the charge deposited on each cycle, around 33.7V, snubbing the inductive spike at about 37V (more than a diode drop above, but the duration is short).

This summer and fall, when I’ll be working on the next edition of the book, I’ll be sure to improve the instructions for the FET lab!

## 2017 November 13

### Large inductor revisited

Filed under: Robotics — gasstationwithoutpumps @ 16:03
Tags: , ,

I had the idea today that I could make an even simpler track wire detector if I used a larger inductor to get more signal before amplification.  I only have one inductor larger than the 10mH inductor provided in the mechatronics course, so I decided to try it, though it is much too large and heavy for use on the robot—I wanted to see whether I would get an improvement by using a large inductor, before I bought one and waited for it.

The first thing to do was figure out how big an inductance it has.  I had done a few measurements of it over four years ago, but I was not very satisfied with the results then, so I measured it again today using a 0.1% 1kΩ reference resistor and the impedance meter of the Analog Discovery 2 (with short and open compensation).  I got values consistent with previous measurements:

The inductance is not fixed with frequency, but is around 370mH.

I paired the inductor with a 68pF capacitor to make a resonant tank:

The best-fit curve does not match the parameters measured separately for the inductor and capacitor.
I also have no idea what the spike around 29kHz is.

I tried detecting the track wire with this tank, rather than the 10mH||43nF that I’d used before, and I got larger signals, at least 3 times larger, but not 10–100 times larger as I had hoped.  Still, it might we worth buying some 100mH inductors to get a stronger initial signal than with the 10mH inductors that I have.  (The 370mH inductor is way too heavy for the robot.)

I’ll still need some amplification before the peak detector, and I probably will want to mount the detector so that it deploys outside the initial bounding box of the robot—perhaps on a ramp that lets the balls roll down into the target.  As far as I can tell from eye-balling it, though, a ramp would only work if the ball storage goes all the way to the top of the 11″ cube that contains the robot, but then I don’t see how I can hit the higher target.

So I think I’ll have to put the AT-M6 firing lower down, at the 3.5″ bumper level, and shoot upwards a little bit, which probably means an accelerator wheel.  I have some little motors that I could probably run at 6V for the wheel.  I’d probably want to put a FET in series so that I could keep the motor off most of the time, and just spin it up before firing (I think that the motors are intended to be 3V motors, and running them continuously at 6V would kill them).

I’ve gotten a lot less done on the mechatronics project today than I’d hoped—I thought I already had some bigger inductors that I could use to build the complete trackwire detector, but it seems like I’ll have to order them.  I need to order some bumper switches anyway.  I’m thinking of Omron VX-016-1C23 roller switches ($4.50 from Digikey) or Honeywell V7-2S17D8-201 ($2.95 from Jameco).  Neither one is the cheapest roller switch from either distributor, but they seem to be the cheapest ones with gold contacts for low-current switching.  Omron warns that their regular switches may be unreliable for “microloads”, and they only spec them for 160mA or more at 5V, while the low-current switches are rated down to 1mA.  Since intermittent failures are really hard to debug, I’ll go with the switches designed for low currents.

I’ll probably end up spending extra for the switches from Digikey, not because they are better, nor even that their data sheet is better (though it is), but because Digikey has cheap 100mH inductors and Jameco doesn’t seem to.

Since my electronics work for today wasted a lot of time without any tangible result, and I’ve had no new insights on how to do the mechanical design, I’d better switch to doing some programming—I still need to port the ES framework to the Teensyduino environment!

## 2016 December 19

### Impedance of inductors and parasitic impedance of oscilloscope

Filed under: Data acquisition — gasstationwithoutpumps @ 01:04
Tags: , , , ,

Because the Analog Discovery 2 makes doing impedance spectroscopy so easy, I decided to do a quick check of my inductors to plot their impedance, checking the series resistance in the process.  This was just going to be a short interruption to my day of working on my book, but it ended up taking up most of the day, because I got interested in seeing whether I could determine the characteristics of the scope inputs that were limiting the performance at higher frequencies.

Here was the data I started with, after converting the dB scale to |Z|. I used a 20Ω resistor in order to get reasonably large voltages at both ends of the frequency sweep. With a larger resistor, the low-frequency measurement across the inductor was too noisy, because the voltages were so small.

The data looks fine up to 1MHz, but above that is a resonant peak, probably from the capacitance of the oscilloscope and the wiring to it.

I tried modeling the oscilloscope inputs as capacitors, but that resulted in way too sharp a spike at the resonance to match the data, so I tried a resistor in series with a capacitor. Initially, I tried modeling both channels identically, but I got better fits when I used a different model for each channel:

The resistor in series with the capacitance of the scope limits the sharpness of the resonance peak. Channel 1 was measuring the voltage across the 20Ω resistor, and Channel 2 was measuring the voltage across the inductor, so the setup is more sensitive to the Channel 2 parameters than to the Channel 1 parameters. I don’t really believe that the Channel 1 parameters fit here are correct.

It might be interesting to swap which channel is connected to which device, and see whether the R+C models still fit well, but I’ve not got the time for that tonight.   I did have some earlier data (from playing with resistor sizes) and I fit the oscilloscope models to it:

The fits here suggest some difference between the channels, but not as radical a difference as the previous plot. The 62kΩ sense resistor, though not good for determining the DC resistance of the inductor, does give a good handle on the parasitic impedance of the oscilloscope channels.

## 2014 April 29

### Inductors and loudspeakers

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

On Monday I gave a little pep talk about the quiz before returning them.  I also assigned the students to redo the entire quiz  as homework due Friday, saying that we’d already gone over most of the material in class, so there wasn’t much point in my showing them again—they needed to do it themselves.  (Engineering is not a spectator sport!)

After returning the stuff I’d graded over the weekend, I talked to them about inductors doing a rather hand-wavy derivation of $V = L \frac{dI}{dt}$.  There is much more detail in this week’s lab handout, but I’ve found that students in the circuits class do not seem to be able to absorb much information in written form—a shame really, since that is how most of their future learning is going to have to happen.  I fear that most of them are going stop learning the moment they leave college, and then they’ll be stuck with obsolete knowledge and no way to remedy the problem within five years.

I also talked about loudspeakers: how they work and what the impedance vs. frequency curves look like.  They’ll be gathering data for their own loudspeakers today, so I wanted them to be aware of the existence of the resonance peak and the need to gather a lot of data around the peak in order to model it.

I did talk to them about the basic $R+ j\omega L$ curve for any inductor (with R due to the resistance of the wire), and about the resonance peak from the mass+spring harmonic oscillator that is the voice coil, cone, and suspension.  I derived the frequency of an L||C resonant circuit (by computing the impedance and seeing where it went to infinity), and gave  a rather hand-wavy explanation of the effect of adding a resistor in parallel.

## 2013 June 27

### Inductance of large inductor summarized

Filed under: home school — gasstationwithoutpumps @ 11:25
Tags: , , , ,

This post summarizes my inductance measurements, some of which I did with my son, some independently.

The goal was to determine the inductance of the large inductor that my wife found lying in the street and that I’ve used for a few things in the physics class with my son (like the Speed of sound lab).

Our first measurement used the Arduino data logger to measure an L/R time constant. Using a Schmitt trigger to clean up a mechanical switch output, we measured the voltage across a series resistor (hence the current) for step inputs (both upward and downward).  The upward steps were not useful, as internal resistance of the Schmitt-trigger inverter meant that the step was not clean—the voltage drooped as the current went up. The downward step did not have this problem. The inductance and resistance of the coil were determined by making measurements with both a 10Ω and a 100Ω external resistor, and fitting exponential time constants to the downward steps.  This gave a pair of linear equations in L and R to solve: $L=(R+10\Omega)T_{10}$ and $L=(R+100\Omega)T_{100}$.  From these equations I got estimates of 78.5Ω and 0.410H. Note that the resistance includes all the wiring resistance, which was substantial, as I was using flexible jumper wires that are not made from copper and have a high resistance.

The next successful measurement again used a series connection of the unknown inductor and a 100Ω resistor, but the stimulus was a sine wave, rather than a step.  I measured the RMS voltage across the resistor and across the inductor for several different frequencies, and fit an L+R model to the magnitude of the impedance as a function of frequency: $|R + j 2 \pi f L| = V_{L}/V_{100\Omega} 100\Omega$.  With this method, I measured the inductance and resistance as 0.369H and 73Ω.  I also tested an AIUR-06-221 inductor (nominally 220µH and 0.252Ω) with a 1Ω current-measuring resistor and got 229µH and 0.258Ω.

Once I finally figured out that DC bias changes capacitance of ceramic capacitors enormously, I managed to get a Colpitts oscillator to work. I should be able to use the frequencies of oscillation with the small inductor and with the large inductor to get an estimate of the inductance of the large inductor.  With the center of the Colpitts tank at virtual ground, the AIUR-06-221 inductor oscillates at 7691Hz and the large one at 180.04 Hz  (both after a few minutes of warmup, as the frequency changes initially).  The ratio of the inductances should be the square of the ratio of the frequencies, that is $L = \mbox{220E-6 H} (7691/180.04)^2 = 0.401 \mbox{H}$, or 0.418H, if we use 229µH as the inductance of the AIUR-06-221. Note that this measurement depends on knowing the inductance of the small inductor, but does not require knowing the capacitance of the ceramic capacitors—just that the capacitance is the same for either inductor.

These oscillator measurements and the step-response measurements are consistent, but the modeling of the magnitude of impedance from the voltage measurements at different frequencies seems a bit out of line with them.  The problem may have been that the current-measuring resistor was small, so that the voltage measurements were small.  Perhaps I need another series of measurements with a 10kΩ current-measuring resistor, which should allow a better estimate of L (though not a good estimate of R). I tried again using a 10kΩ resistor and a frequency range from 320Hz to 15kHz, and got a fit for L=0.349H, the lowest estimate so far!

I’m not sure what the problem is with the measurements using the external sine wave.  Perhaps I should do another set using a different function generator, as the Bitscope Pocket analyzer produces pretty bad harmonic distortion at the higher frequencies.  I tried with the Elenco FG-500 function generator (which also has bad harmonic distortion, but different) from about 70Hz to about 16kHz, and got a fit for 0.356H.  This is similar to the measurements I got with the Bitscope function generator.

So, I’m left with a discrepancy that I can’t explain:  measurements of  0.35H for the sine-wave excitation and 0.41H for the L/R step and the Colpitts LC oscillator.

Next Page »