# Gas station without pumps

## 2013 June 25

### LC resonance

Filed under: home school — gasstationwithoutpumps @ 20:17
Tags: , , ,

Since the inductors looked ok in Fitting L and R values, I decided to check the capacitors and the LC tank circuit using the same technique. That is, I put the device under test (DUT) in series with a 100Ω resistor, fed the output of the Bitscope Pocket Analyzer function generator into pair, and measured the RMS voltages across the DUT and across the resistor with a Fluke 8060A multimeter.

This is supposed to be a 4.7µF capacitor, but seems to be a bit low.  It looks like a pretty pure capacitance, though, with no series (0Ω) or parallel (∞Ω) resistance. I only did the full set of measurements for one capacitor, but I checked a few values in the middle of the frequency range for the other, and it seems to have about the same capacitance.

I then made a tank circuit like the one in the Colpitts oscillator, with the AIUR-06-221 inductor in parallel with a pair of the (nominally) 4.7µF capacitors in series.  This should resonate at $\frac{1}{2 \pi \sqrt{LC}}$= 7kHz, with L=220µH and C=2.35µF.

The LC tank resonates at about the expected frequency (7.4kHz instead of 7kHz), but to model the data well, I had to add series resistors for both the inductor and the capacitor.  The series resistor for the inductor seems a little low and the inductance a little high, and the series resistance for the capacitor quite high, but trying to fit four parameters to the rather limited data makes errors like these probable.

It is certainly the case that the LC tank is resonating at the expected frequency, so now all I have to figure out is why the 180˚ phase changes that determine the oscillator frequency and that I measured with an external oscillator (in Colpitts LC oscillator) are not at or near the resonant frequency.

## 2013 June 24

### Fitting L and R values

Filed under: home school — gasstationwithoutpumps @ 23:54
Tags: , ,

I decided to measure the two inductors that were confusing me in Colpitts LC oscillator, using the same method I’ve used before to model loudspeakers, that is, applying a known frequency sine wave to the unknown inductor in series with a known resistor, and measuring the RMS voltage across the inductor and across the resistor.

I decided to use the Bitscope Pocket Analyzer’s built-in function generator, rather than the external one I used before, because it is easier to set the frequency precisely, so I did not have to keep switching my Fluke 8060A multimeter between voltage and frequency measurement.  For the big inductor, I used a 100Ω resistor (measured at 100.64Ω), while for the AIUR-06-221 inductor I used a 1Ω resistor (measured at 0.98Ω).  To prevent overloading the function generator, I added another 100Ω resistance in series with the AIUR inductor+1Ω load, so the voltages measured for the AIUR inductor were pretty small.

My son helped me take some of the measurements, which was pretty boring, in part because it often took the Fluke multimeter 30–60 seconds to stabilize after changing what was being measured.

I computed the magnitude of the impedance of the unknown device as $\frac{V_L}{V_R} R$, and fit the function $| R+ 2 \pi f L j |$ to the resulting impedance values.

The AIUR-06-221 inductor data sheet claims that it is 220µH and 0.252Ω, with ±10% tolerance. My measurements come pretty close to those specs—certainly within tolerance.  The standard error of the fit is about 2.3% for the resistance and 1.5% for the inductance.
The top 4 frequencies were not included in the fit, because the voltages across the 1Ω resistor were getting too small for reliable measurement. Increasing the resistor size to 22Ω could help a little, but the multimeter starts having trouble at high frequencies even with large enough voltages.

The top 4 frequencies for the large inductors were not used, again because the voltages across the resistor were too small to measure reliably.
This curve could be pushed to higher frequencies by using a larger series resistor (say 10kΩ instead of 100Ω).  I added some extra points at the lowest frequencies to try to get a better estimate of the series resistance, since the corner frequency is around 32Hz.  The asymptotic standard error of the fit is 1.2% for inductance and 2.3% for the resistance.

These measurements are consistent with the data sheet for the AIUR-06-221 inductor, and consistent with the L/R time constant measurement for the big inductor.

I still don’t understand why the Colpitts oscillator and the phase-shift measurements were indicating a different inductance.  Maybe I need to check the capacitor values (I did check the markings on the capacitors, tiny as they were).

## 2013 June 23

### Colpitts LC oscillator

Filed under: home school — gasstationwithoutpumps @ 19:07
Tags: , , ,

I wanted to try a different way of estimating the inductance of the large coil that we used for the L/R time constant lab.  In that lab, we had fitted an exponential to the current curve after a step change in the voltage, and gotten an estimate of L=0.41H, with a series resistance of 78.5Ω, but the resistance measurement was not quite compatible with the DC resistance measurement of 69.71Ω.  (The DC measurements are different each time I report them, because I’m using different connection wires, and the flexible breadboard wires have significant resistance.  With the connection wire resistance removed, the DC resistance of the coil is about 68.82Ω.)

Op-amp-based LC oscillator using the Colpitts oscillator design.

I expected the oscillator to oscillate at the frequency of the LC tank, when the gain was set high enough to meet the Barkhausen stability criterion, that the loop gain be one and the phase shift be 0 (or an integer multiple of 2π).

The frequency of oscillation should be determined by $(2 \pi f)^2 = \frac{1}{LC}$,

I built the circuit with two different inductors, one the AIUR-06-221 inductor, which from the spec sheet has an inductance of 220µH and a series resistance of 0.252Ω, the other the large unknown inductor.

• With the 220µH AIUR-06-221 inductor and the 2 4.7µF capacitors in series, the resonant frequency should be 7kHz. What I actually measured for the oscillator was 9024Hz (with R3 at 1kΩ, not 3.9kΩ), which is way off from what I expected.  The gain needed from the inverting amplifier was –16.6, so the tank feedback circuit had a loss of about 24.4dB. The frequency is dependent on the gain setting: with the gain set so high that the output was very clipped, the frequency was around 8881Hz, while with the gain set barely high enough to get oscillation, the frequency was 9080Hz.
• With the large inductor, I measured 229±2Hz, with R3=3.9kΩ and a gain of about –15.6 (23.9dB).  Scaling the known inductance of the 220µH inductor by the square of the frequency ratio implies that the large inductor is about 0.34H (not 0.41H).

I don’t understand why the frequencies are so far off from what I expected. I don’t see how to analyze the circuit to get the observed frequency—the phase shift of the feedback network is not particularly dependent on the gain of the amplifier, even if I include the input impedance of the amplifier in the analysis.  The op amp spec sheet makes a big deal about the phase not shifting even when the output is clipped, and I’m definitely observing a 180˚ phase shift in the feedback network at the oscillator frequency.  Perhaps I need to remove the tank circuit from the oscillator, and drive it with an external sine wave, to see how the phase shift varies with frequency, and compare that to my calculations using gnuplot.

I tried putting a sine wave into the 1kΩ resistor plus LC tank, and measuring the sine wave.  I used the Bitscope USB oscilloscope both to produce the sine wave and to observe it.  By using the XY plot and tweaking the frequency, I found a 180˚ phase shift at 9020Hz, which is consistent with how the oscillator behaved at moderate gains.  With the large inductor, I get the 180˚ phase shift around 225Hz, again fairly consistent with the behavior of the oscillator.  I confirmed that this was not an artifact of the Bitscope by observing the same signals on my Kikusui Cos5060 analog scope.   The frequency at which the phase shift was 180˚ varied slightly at different times (possibly temperature dependent?)—for the 220µH inductor, it was 9kHz±30Hz.

When I use an external oscillator, I see the 180˚ phase shift and peak in the output amplitude at 12.7kHz, not at 9kHz.    Now I’m even more confused.

One possible cause of confusion is that my external oscillator has a large DC offset.  When I add a 220µF DC-blocking capacitor, the resonance is around 8.6–8.8kHz, almost consistent with the oscillator behavior.  But when I use the DC blocking capacitor to decouple the Bitscope sine wave source, I  get the resonance initially at 7.6kHz, gradually rising to 8.4kHz.  If I use the external oscillator with the DC-blocking capacitor, but briefly short the inductor to rezero the big capacitor, I again get a resonance around 8.4kHz.

Would adding a DC component to the signal change the inductance of a ferrite-core inductor? I suspect so, due to changes in the distribution of magnetic domains in the ferrite—but that much??  The 220µH inductor would have to behave like a 150µH inductor to get the observed frequencies, unless all my thinking is messed up.  I’m now trying to think up a way I could test this: perhaps providing an adjustable DC bias to the tank circuit and measuring the inductance by change in the resonant frequency?  I think I’ll post this as is and hope for another post later.

Note: the CircuitlLab schematics now come with a “Thanks for using the free edition …” chunk of text at the bottom. I could have cut this off easily enough, but see no harm in advertising their service, which I’ve been using for about a year.  I had been wondering how they were going to monetize the service, but now I know—the free service now puts up obnoxious “please upgrade” messages every few minutes and blocks you from doing further work for a minute.  Their why-upgrade? page explains:

CircuitLab has been our primary project over the past two years, and we’ve been honored to deliver our user-friendly and high quality product without charge over this time. We are so excited to be able to offer you this continually improving software for a small monthly fee. Though we know this may take some of our loyal users as a surprise, we look forward to your continued support as we develop CircuitLab into everything we’ve always imagined it could be!

While I would not mind buying the circuit lab software, I’ve never been fond of the “small monthly fee” model, especially as their “small fee” is $5 a month for Hacker Lite, the equivalent of their old free service with no commercial use allowed, up to$100 a month for the “Platinum Service”, which includes commercial use, beta testing of new features, and priority support.  Given that I’ve had very few circuits that were actually simulatable with their simulator (they don’t handle oscillators well and their op amp models have stability problems), and they don’t have all the parts I need (they don’t have Schmitt triggers, instrumentation amps, or phototransistors; their  microphones are non-simulatable; and they don’t have parameters for the MCP6002 op amps I use), it isn’t clear to me that the schematic editor alone is worth $5/month or$49/year.  I may be looking for another schematic capture system (the Eagle schematics are too ugly to be a viable alternative).  I wonder if CircuitLab has any way to get the schematics out of their system into some other schematic representation (or vice versa).  Having a closed system was ok as long as it was free, but I would not want to invest money as well as time in something that I could not use on my own later. I already have 105 circuits in their system, and it would be nice to be able to have a backup copy on my own machine.

## 2013 June 18

### L/R time constant lab

Filed under: Data acquisition,home school — gasstationwithoutpumps @ 00:28
Tags: ,

In our home-school physics today, we tried modifying the RC time constant lab to look at inductors instead of capacitors.

The basic idea was simple: put an inductor and resistor in series, switch the voltage between two levels, and monitor the current.

Circuit for looking at current through inductor after step-wise change at Vin.

The equations for Vout are simple:
$V_{\mbox{out}}(t) = R I(t)$
$V_{\mbox{in}}(t) - V_{\mbox{out}}(t) = L \frac{dI(t)}{dt}$

If we start out with 0 current and have an upward step of Vin to Vmax, we have the solution
$V_{\mbox{out}}(t) = V_{\mbox{max}} (1 - e^{-R/L t})$

Initially, we wanted to use one of the 220µH inductors that I had bought for the circuits class, but the L/R time constant is too short to be easily measured with the Arduino data logger—with a resistor large enough to avoid shorting the power supply in the steady state (say, 47Ω) the time constant would be only about 5µs, and we need a time constant of 5msec or more, so we’re a factor of 1000 too low.

Coil used for speed of sound lab and as inductor for L/R time constant.

I do have one larger inductor: the one that my wife found on the street and which I used previously as a sensor for the speed of sound lab. I had previously estimated that inductor as about 0.5H, but I’d forgotten that estimate when we did the measurements today, so we did a little trial and error to get reasonable resistor sizes (47Ω, 10Ω, and 100Ω were all eventually used).

Rise in current (as seen by rise in output voltage across 47Ω resistor).

The maximum Arduino output of 413 is compatible with a DC resistance of (1024-413)* R/413 = 69.5Ω for the inductor, close to the 68.3Ω we measured in Dec 2011. The inductance of 0.177H also seems fairly reasonable, though lower than my previous estimates.

I also realized that I did the analysis of the L/R time constant wrong, since I did not include the DC resistance of the coil, which is substantial (measured, along with the wires to it, at 70.31Ω). This changes the equations to

$V_{\mbox{out}}(t) = R I(t)$
$V_{\mbox{in}}(t) - V_{\mbox{out}}(t) = L \frac{dI(t)}{dt} + R_{\mbox{ind}} I(t)$

If we start out with 0 current and have an upward step of Vin to Vmax, we have the solution
$V_{\mbox{out}}(t) = V_{\mbox{max}} (1 - e^{-t (R+R_{\mbox{ind}})/L})$

With this correction, the estimated value of the inductance is 0.445H.

We did not get a reliable fall time measurement in the first set of measurements, probably because the time it took for the mechanical switch to go from 5V to 0V was too long.  We tried again with the output of Schmitt trigger as Vout, instead of a mechanical switch. Since the 74HC14N chips only deliver about 24mA, I put 5 of the Schmitt triggers in parallel.  Furthermore, to avoid problems with switch bounce, I put a low-pass RC filter between the mechanical switch and the Schmitt-trigger input (R=1kΩ, C=4.7µF, for a 4.7msec time constant). Without the low-pass filter, I sometimes got a bounce visible on the Schmitt-trigger output.

With a smaller resistance (10Ω) to get better time resolution, we took another set of measurements, getting good curves for both rising and falling edges:

Rising edge with a 10Ω series resistance. Note that the input voltage is not a simple step—there is apparently another 10Ω or so of source impedance when pulling up Vin, resulting in an IR drop at Vin, though no such effect was visible when pulling Vin down.

The falling edge resulted in a similar estimated value for L, even though the transition of Vin was very sharp on the downward edge (<1ms), so there was no evidence for extra source resistance on downward transitions.

I trust the falling edges more than the rising ones (because of the non-step nature of the input rising edge), so 0.372H is currently my best estimate of the inductance of the coil.  I think we want to make some more measurements with larger resistance values, so that the resistance of the wiring has less effect.  I think that we can get a sufficiently good estimate of the time constant even if it is only 1/3 as long as the current one, which should allow a total resistance around 240Ω, or a load resistance up to 170Ω.

We tried again with a 100Ω load, then tried finding a resistance for the source, wiring, and inductor that gave a consistent value for the inductance with either load.  I found this resistance by fitting the R/L time constants to the falling edges, then solving the pair of linear equations:

$10+R_{\mbox{ind}} = L / \tau_{10}$

$100+R_{\mbox{ind}} = L / \tau_{100}$

The solution turned out to be 78.5Ω and 0.41H.  I believe that to be a fairly good estimate of the inductance of the coil, but the resistance includes source and wiring resistance other than just the 70.31Ω DC resistance measured with my multimeter (and even that included some wiring resistance, since it was measured at the breadboard, not at the coil).

Fit for falling edge with 100Ω load, using the larger estimate of 78.5Ω for the series resistance of the inductor.

We’ll want to do more experiments with inductors, to validate this inductance estimate, and to measure the inductance of the 220µH inductor using other means.

« Previous Page