# Gas station without pumps

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

## 2015 April 26

Friday’s lecture went fairly well.

There were a few questions at the beginning of class, one of which lent itself well to my talking about choosing different models for the same phenomenon and using the simplest model that worked for the design being done.  In this case it was about the relaxation oscillator using a 74HC14N Schmitt trigger and where the constraints on the feedback resistor came from.  I told them about some more detailed models we could do of the Schmitt trigger, including input capacitance (max value on the data sheet), input leakage current (not specified, but probably fairly small, under 1µA), and output resistance (which would get added to the feedback resistance).  I’ll have to incorporate some of those ideas into the book, when I rewrite those chapters this summer—the hysteresis lab needs the most rework of anything so far this quarter.

After the questions I mainly talked about polarizable and non-polarizable electrodes developing the R +  (R||C) + half-cell model of an electrode that they will be fitting (without the half cell) in labs this week.

This weekend’s grading was a bit painful, and I’m probably going to have to spend all of Monday’s lecture filling in gaps in their prior education that I had not anticipated.  Some holes also became apparent from e-mail questions I got from students over the weekend.

I’ll try to gather the common problems here, so that I can use the list as lecture notes tomorrow.

• There were a lot of REDO grades for errors on schematics.  I hate giving REDO (since it doubles my grading load), but I told students at the beginning of the quarter that any error on the schematics was an automatic REDO.  I plan to stick to that, despite the pain for both me and the students, because they have to develop the habit of double and triple checking their non-redundant documents (schematics, PCR primers, …).  Sloppy documentation is a serious problem in engineering and too many faculty and graders have been perpetuating the myth that the almost right idea is good enough.  I’m particularly harsh on students who change kHz into Hz or pF into nF.  Off-by-a-factor-of-1000 is not good enough!  The most extreme case so far is someone who specified a capacitor as being in the gigafarads (they’d typed 109 instead of 10-9). A factor of 1,000,000,000,000,000,000 off is not the sort of thing one can ignore.  I also get annoyed by students who randomly pick a unit (H when they need Ω, or Ω when they need Hz), as if all units were just decorations to please a teacher, with no real meaning to them
• Frequency is 1/period.  For the relaxation oscillator, they do two charge/discharge calculations to get the period as a multiple of RC (though many blindly copied one of the formulas for just the charge time without understanding it, and assumed it was the period). But even after computing the charging time students blindly used  2πf = 1/(RC) as a magic incantation.  That formula was relevant for the corner frequency of RC filters, but has nothing to do with the oscillation frequency of the relaxation oscillator.
• The capacitance calculation being done in the prelab was for the capacitance of a finger touch to the touch plate, but a lot of students claimed that it was the calculation to determine the size of the ceramic capacitor.  Only a couple of groups bothered to explain the connection between the two capacitances. I think I need to rewrite the prompts in the book to force the values to be more different, so that students have to think which capacitance they are talking about.
• I find that students often talk about “the voltage” or “the capacitance” as if there was only one in their circuit, and when asked which one they are talking about are completely mystified—to them invoking the magic word is all that can be expected of them—actually knowing what it refers to is unreasonable.
• Students in general were doing too much ritual magic. They would put down a formula they thought was relevant (often copying it incorrectly), then claim that from that formula they got some number for their design.  Often the formula was not relevant, or additional assumptions needed to be made (like choosing arbitrary values for some variables).  At the very least, there was some substantial algebra to be done to convert the formula into a usable form.  Some students claimed that Wolfram alpha gave them the solution (when there was not enough information to solve for the variable they wanted a value for).  Basically, I’m a bit angry at the students for trying to bullshit their way through the assignment. One pair of students said quite honestly that they did not know how to do a computation and got the value they used from the students at the next bench.  I gave them bonus points, and I’ll help them figure out how to do the computation they were having trouble with—I have no problems with students not knowing how to do something new and somewhat tricky, but I do have trouble with students deliberately looking dishonest and stupid by writing bullshit.
• The computation that the honest students had trouble with is one that many students had trouble with, so I’ll go over it in class.  I gave the students a derivation of a formula for the charging time of the capacitor in the relaxation oscillator, but I didn’t have time to step them through the derivation.  It seems like most of the class can’t read math, since many just copied the final formula without reading the text that said it was the time to charge the capacitor.  There was an exercise immediately afterwards asking students to compute the time to discharge the capacitor, but this exercise was added to the book after the students had done their prelab exercises, so they didn’t bother to look at the exercise. What they needed to do for the lab was to add the charge and discharge times (which are not quite the same) to get the period.
• I need to remind the students that they are turning in design reports, not lab reports.  I’m not looking for fill-in-the-blank worksheets, but descriptions of how they designed and tested their circuits.  Omitting the design steps is omitting the most important part of the report!
• I gave the students three models to fit to the data, and showed them how to do the fits for two of the models in Wednesday’s lecture.  There wasn’t time to get to the third model, so I just told them to use the same technique as the second model, but with the different formula.  Most of the class never bothered to fit the third model (the only one that really fits the data well)—if I didn’t do all the work for them in lecture, then they weren’t going to generalize even a tiny bit to do it themselves.
• A lot of students did not do a good job of fitting the models, because they fit the data with linear scaling, rather than with log scaling as I had shown them.  This is a fairly subtle point (errors on a linear y axis are differences, but on a log y axis are ratios), so I’ll review it in class.
• I  think that some students don’t have any idea when one would use a log-log plot, a log-linear plot, a linear-log plot, or a linear-linear plot.  I thought that was covered in precalculus, but I guess not. So tomorrow I’ll present the idea that the only curve most people understand visually is a straight line, so one wants to choose axis scaling so that the expected relationship is a straight line.  Linear plots are for linear (or affine) models, log-log plots are for power laws, log-linear are for exponentials, and linear-log are for logarithmic relationships.  I’ll put a general straight line on each and derive the form of the function that matches that straight line.
• The purpose of the Tuesday lab was to collect data and model the loudspeaker with a few parameters.  But many students neglected to report those parameters in their design reports!  They produced a plot and fitted models to it, but nowhere on the plot, in the figure caption, or in the main body (in decreasing order of usefulness) did they report what the parameter values were that the fit produced.  For students who are so focussed on answer getting that they neglect to explain how they came up with their answers, this seems like a strange omission.
• For the Thursday lab, no one did back calculations from their observed frequencies to estimate the capacitance of the 74HC14N input, of the untouched touch plate, or even of the touch itself, to see whether their observations were consistent with their design predictions. One group of students claimed to have done sanity checks, but I don’t believe them, as they also reported oscillations around 20Hz, instead of 20kHz.
• For the prelab, it seems that a lot of students computed $R + \omega L$ instead of $| R + j \omega L|$, though most got it right in the gnuplot scripts for the lab itself.  I have to remind students that $|A+B| \neq |A|+|B|$.
• On the typesetting front, I’m making some progress on getting students to put their plots in as figures with captions, though way too many are still referring to “the plot below” rather than to “Figure 3″.  I’m also having some difficulty getting them to be sure to refer to all the figures in the main body text.  A lot of times they’ll toss in a handful of plots with no reference to them at all.
• On the opposite side of the coin, I have to teach them that equations are properly part of a sentence, generally as a noun phrase, and are not standalone sentences.  When there is an explanation of variables after a formula (“where A is this, and B is that”), the where-clauses are still part of the same sentence.
• Some other little things to tell them:
• The word “significant” should be reserved for its technical meaning of “statistical significance”—very unlikely to have occurred by chance according to the specified null model. It should not be used in the normal English way to mean “big”, “important”, or “something I like”.
• To get gnuplot to produce smooth curves when there are sharp changes in function, it is necessary to do set samples 3000 to compute the function at more points than the small default number.
• Students have been misusing the word “shunt” for any resistor. Properly, it is a low resistance used to divert current from some other part of the circuit—in our designs, it is the resistor being used to sense current and change it into voltage. I wonder if I should switch terms and talk about a “sense” resistor, though “shunt” is the standard term for ammeters.
• A minor pet peeve of mine: I hate the word “utilize”. I have yet to see a context in which “use” does not do the same job better.

## 2015 April 23

### Very long couple of days

Yesterday and today have been draining.

Yesterday, I had three classes each 70 minutes long: banana slug genomics, applied electronics for bioengineers, and a guest lecture for another class on protein structure.  I also had my usual 2 hours of office hours, delayed by half an hour because of the guest lecture.

The banana-slug-genomics class is going well.  My co-instructor (Ed Green) has done most of the organizing and has either arranged guest lectures or taught classes himself. This week and part of next we are getting preliminary reports from the 5 student groups on how the assemblies are coming.  No one has done an assembly yet, but there has been a fair amount of data cleanup and prep work (adapter removal, error correction, and estimates of what kmer sizes will work best in the de Bruijn graphs for assembly).  The data is quite clean, and we have about 23-fold coverage currently, which is just a little low for making good contigs.   (See https://banana-slug.soe.ucsc.edu/data_overview for more info about the data.) Most of the data is from a couple of lanes of HiSeq sequencing (2×100 bp) from 2 libraries (insert sizes around 370 and 600) , but some is from an early MySeq run (2×300bp), used to confirm that the libraries were good before the HiSeq run.  In class, we decided to seek a NextSeq run (2×250bp), either with the same libraries or with a new one, so that we could get more data quickly (we can get the data by next week, rather than waiting 2 or 3 weeks for a HiSeq run to piggyback on).  With the new data, we’ll have more than enough shotgun data for making the contigs.  The mate-pair libraries for scaffolding are still not ready (they’ve been failing quality checks and need to be redone), or we would run one of them on the NextSeq run.  We’ll probably also do a transcriptome library (in part to check quality of scaffolding, and in part to annotate the genome), and possibly a small-RNA library (a UCSC special interest).

The applied electronics lecture had a lot to cover, because the material on hysteresis that was not covered on Monday needed to be done before today’s lab, plus I had to show students how to interpret the 74HC15N datasheet for the Schmitt trigger, as we run them at 3.3V, but specs are only given for 2V, 4.5V, and 6V.  I also had to explain how the relaxation oscillator works (see last year’s blog post for the circuit they are using for the capacitance touch sensor).

Before getting to all the stuff on hysteresis, I had to finish up the data analysis for Tuesday’s lab, showing them how to fit models to the measured magnitude of impedance of the loudspeakers using gnuplot.  The fitting is fairly tricky, as the resistor has to be fit in one part of the curve, the inductor in another, and the RLC parameters for the resonance peak in yet another.  Furthermore, the radius of convergence is pretty small for the RLC parameters, so we had to do a lot of guessing reasonable values and seeing if we got convergence.  (See my post of 2 years ago for models that worked for measurements I made then.)

After the overstuffed electronics lecture, I had to move to the next classroom over and give a guest lecture on protein structure.  For this lecture I did some stuff on the chalk board, but mostly worked with 3D Darling models. When I did the guest lecture last year, I prepared a bunch of PDB files of protein structures to show the class, but I didn’t have the time or energy for that this year, so decided to do it all with the physical models.  I told students that the Darling models (which are the best kits I’ve seen for studying protein structure) are available for check out at the library, and that I had instructions for building protein chains with the Darling models plus homework in Spring 2011 with suggestions of things to build.  The protein structure lecture went fairly well, but I’m not sure how much students learned from it (as opposed to just being entertained).  The real learning comes from building the models oneself, but I did not have the luxury of making assignments for the course—nor would I have had time to grade them.

Speaking of grading, right after my 2 hours of office hours (full, as usual, with students wanting waivers for requirements that they had somehow neglected to fulfill), I had a stack of prelab assignments to grade for the hysteresis lab.  The results were not very encouraging, so I rewrote a section of my book to try to clarify the points that gave the students the most difficulty, adding in some scaffolding that I had thought would be unnecessary.  I’ve got too many students who can’t read something (like the derivation of the oscillation frequency for a relaxation oscillator on Wikipedia) and apply the same reasoning to their slightly different relaxation oscillator.  All they could do was copy the equations (which did not quite apply).  I put the updated book on the web site at about 11:30 p.m., emailed the students about it, ordered some more inductors for the power-amp lab, made my lunch for today, and crashed.

This morning, I got up around 6:30 a.m. (as I’ve been doing all quarter, though I am emphatically not a morning person), to make a thermos of tea, and process my half-day’s backlog of email (I get 50–100 messages a day, many of them needing immediate attention). I cycled up to work in time to open the lab at 10 a.m., then was there supervising students until after 7:30 pm. I had sort of expected that this time, as I knew that this lab was a long one (see Hysteresis lab too long from last year, and that was when the hysteresis lab was a two-day lab, not just one day).  Still, it made for a very long day.

I probably should be grading redone assignments today (I have a pile that were turned in Monday), but I don’t have the mental energy needed for grading tonight.  Tomorrow will be busy again, as I have banana-slug genomics, a visiting collaborator from UW, the electronics lecture (which needs to be about electrodes, and I’m not an expert on electrochemistry), and the grad research symposium all afternoon. I’ll also be getting another stack of design reports (14 of them, about 5 pages each) for this week’s lab, to fill up my weekend with grading. Plus I need to update a couple more chapters of the book before students get to them.

## 2015 April 21

### Loudspeaker lab went well

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

I’m falling behind in my blogging about the applied electronics class, and so the notes on the lectures may be a bit skimpy.

Last Friday, I had several topics:

• Some metacognition talk about answer-getting vs problem solving, with an emphasis on the descaffolding (removing the detailed what-to-do instructions and worksheets) that needed to happen as undergrads, and how too many of their classes had not been doing it, so I had to descaffold them faster than was really optimal.  I warned them that this would be uncomfortable.
• Test equipment as part of the circuit. One of the main points of the lab they had just completed the day before was to make them aware that test equipment (like oscilloscopes) become part of the circuit that they are testing, and can affect that circuit. I’d not made that clear in the book (there is a chapter that needs a massive rewrite this summer), so I spent some time in class on the idea.
• Inductors.  I didn’t do much with magnetic fields, but I did give them $V= L \frac{dI}{dt}$ and derived the impedance $j \omega L$.  There was an unplanned digression about transformers, in response to a question. I did have students give me the impedance of a resistor in series with an inductor, which they had to plot vs. frequency as one of their pre-lab assignments over the weekend.
• Loudspeakers. I showed them a labeled diagram of a loudspeaker, and the magnetic field near the voice coil. I reminded them of the EMF right-hand rule, and showed them how current through the voice coil would push the voice coil up or down (in the orientation of the pictures).
• I then quickly went over measuring the magnitude of impedance with a frequency generator and a pair of  AC voltmeters. This is almost identical to the lab they just did for DC characterization of a microphone, but I would have liked to spend more time on it.

The students did a prelab exercise over the weekend, but I forgot to tell them to do the prelab exercise for Thursday’s lab as well as Tuesday’s, so I had to tell them that in class on Monday (assigning it for Wednesday).

Monday’s lecture was supposed to cover several topics, but I didn’t get to them all:

• feedback on the previous week’s design report.  This took far too long, in part because I went over some fundamentals—I’m not sure, based on their writing, that all the class understands the difference between voltage and current. I introduced the hydraulic analogy (voltage=pressure difference and current=flow), but I’m sure that there are still several who think of both voltage and current as some incomprehensible measure of “electricity”.
• Another fundamental that came up as a result of the report is what a “model” is.  Too many people had been trying to stick voltmeters into the middle of the model for the loudspeaker.  I think that the physics classes are doing a poor job of getting students to think in terms of models, but I’ll do what I can to remedy the deficit.
• I also spent some time on writing fundamentals, like who the audience is for a design report, and that the document must be written for someone who does not have the book or the assignments.  Students are so used to fill-in-the-blank answers that they often don’t get the idea of a self-contained report—but that is what they will have to create as engineers, so they need to start learning how to do it. I had a full page of notes on feedback for the students, much of it specific to the writing assignment I was returning.
• I went over how to determine the shunt resistor for the current measurements in the loudspeaker lab. I was surprised to find out that most had never heard of a geometric mean and had no idea that it was the appropriate way to average numbers when errors were measured by ratios not by differences. I’m not sure that the idea came across well, because I had not anticipated having to teach them that part of high school algebra (silly me—they’ve needed to be retaught everything else they should have learned in high-school algebra, so I should have known that they would never have heard of geometric means).
• I never did get to the main topic for the day: hysteresis.  I’ll have to cover both model fitting and hysteresis on Wednesday, though I’d only originally planned to do model fitting.  Fitting the models for the loudspeaker is a bit tricky, since the main R and L values have to be fitted away from the resonance peak, then the resonance peak needs to be fitted on just that region. I hope that there is enough time on Wednesday to cover hysteresis and relaxation oscillators as well as the model fitting.

Lab today went fairly smoothly.  Everyone managed to get good data from 3Hz to 1MHz, with lots of data around the resonance peak, so they have good data for fitting models to.  There were three problem loudspeakers: Two had bad insulation-displacement connectors on the ends of cables to the loudspeakers.  They didn’t fail as open circuits, but as about 70Ω resistances that remained fairly stable until the wire was jostled.  This meant that the students had inconsistent results that were hard to debug. I think that the cheap connectors were slightly oversized for the wire, so that there was not a gas-tight connection and some corrosion had formed between the wire and the connector.  I finally managed to figure out what was going on for one of the groups, and a little while later applied the same thinking to another group.  Unfortunately, it was getting rather late by then, so that group only got one of their two loudspeakers characterized—they’ll probably try to finish up on Thursday, after doing the next lab.

The third problem loudspeaker behaved normally as far as resistance was concerned, but its resonant peak was nowhere near where it was supposed to be.  Instead of a resonance at 137Hz (as reported on the data sheet), it was out around 700Hz—way too high for a mid-range loudspeaker.

Incidentally, I was wrong about which loudspeakers the staff had bought this year—they got the 15W midrange speaker rather than the slightly cheaper 5W one, so we don’t need to worry about burning out loudspeakers on the power-amp lab.

## 2014 June 22

### Loudspeaker relaxation oscillator

Filed under: Circuits course — gasstationwithoutpumps @ 18:56
Tags: , ,

Yesterday I played around a little with a hysteresis oscillator (relaxation oscillator) using a loudspeaker as the feedback device, rather than a resistor, as shown in the schematic below:

Hysteresis oscillator with loudspeaker for feedback. Changing the value of C1 should produce different frequencies. I used 3.3v from the KL25Z board as my power supply.

I was hoping that I could get the oscillator to resonate at a predictable frequency, based on the gain or the phase shift of the voltage divider consisting of the loudspeaker and the capacitor. Of course, a relaxation oscillator that relies on the hysteresis of a Schmitt trigger is emphatically not a linear circuit, and there is no reason to think that using a loudspeaker instead of a resistor for the feedback element will simplify anything.

I did have a few questions:

• Would it oscillate? (I saw no reason it shouldn’t.)
• At what frequency would it oscillate? Was there any relationship to the gain or phase shift of the loudspeaker and C1 voltage divider?
• How stable was the frequency?
• Would it be loud enough to hear on the loudspeaker?

Before even wiring up the circuit, I ran some gnuplot scripts with my model of the loudspeaker to see what the gain and phase of the voltage divider would be:

Gain from the voltage divider, with different C1 values. Note that I’ve also added a line for an RC low-pass voltage divider, for comparison.

Phase change from the voltage divider, with different C1 values. Again I’ve added a line for an RC low-pass voltage divider, for comparison.

Note that the loudspeaker+capacitor provides a bigger phase change at high frequency and a faster rolloff in gain than an RC filter would. I was hoping that the resonant peaks at high frequency might capture the oscillator and provide a moderately stable output.

To avoid load on the oscillator from a multimeter (used to measure frequency) or oscilloscope, I buffered the output with a couple more Schmitt triggers.

C1 frequency
electrolytic measured with Fluke 8060A
470µF  27Hz
220µF  50–55Hz
47µF  265–285Hz
33µF  375–406Hz
4.7µF  3077–3401Hz
ceramic measured with Fluke 8060A
4.7µF  2.56–2.66kHz
0.1µF  116–122kHz
ceramic measured with Bitscope oscilloscope
47nF  245kHz
22nF  286kHz
10nF  587kHz
2.2nF  1.1MHz

The frequencies were not stable, but shifted unpredictably within a fairly wide range. The Fluke 8060A meter is not capable of frequency measurements above about 100kHz, so I used the FFT on the Bitscope USB oscilloscope for the higher frequencies. For the Bitscope measurements, I took whichever frequency seemed to come up most often—usually the lowest frequency.

The audio-range frequencies 27Hz to 3.4kHz were clearly audible on the loudspeaker (even annoying at the higher frequencies), and the fluctuations in frequency were audible also—they are not an artifact of the measuring equipment.

Looking at the input and output of the oscillating Schmitt trigger for a moderately large capacitor is instructive:

The green trace is the input to the Schmitt trigger—it seems to be a fairly clean triangle wave.
The yellow trace is the output—it jumps when the inverter switches, but the current limitation of the Schmitt trigger seems to keep it from being a square wave.
C1 was 33µF here, and the timebase is 2ms/div.

The current limitation on the Schmitt trigger output seems to be the controlling factor here, so we should be modeling this as a current source and capacitor, with the feedback impedance being irrelevant until it gets large enough that the Schmitt trigger output is voltage-limited instead of current-limited.

I tested this by replacing the loudspeaker by a 22Ω resistor, and got a very similar result (though without the voltage spikes from switching the loudspeaker inductance):

The nearly constant difference between the input and the output (across the 22Ω resistor) indicates nearly constant current flow.

If we look at the voltage across the resistor, we can measure the current:

The current through the 22Ω resistor is about ±18mA, though it isn’t quite as constant as I had thought from the previous plot. (This plot is 200mV/division, so about 9.11mA/division.)

With a 3.9Ω feedback resistor, I again see waveforms consistent with a ±18.5mA current limit (dropping gradually to ±15mA before it switches to the other phase). I can get the same triangle wave at the input if I use a wire for the feedback, with the output only a few mV different from the input (for a wire resistance equivalent to about 130mΩ). The period is about the same also, indicating that the current is what is determining the charging time of the capacitor, not the feedback resistor.

With a 200Ω feedback resistor, I see a little current limitation just as the output switches, but it becomes voltage-limited soon after. The period increases, as we would expect when the voltage limitation reduces the current.

So the loudspeaker in the feedback loop was not very interesting—it was behaving much like any other low-impedance feedback. At least, that is what is happening with low frequencies, where the loudspeaker is reasonably modeled as an 8Ω resistor.

With a 10nF capacitor and a 22Ω feedback resistor the oscillator oscillates at 1.27MHz, but with the loudspeaker only at 589kHz, so the loudspeaker is behaving more like a large impedance at these frequencies.  The output with the 22Ω resistor is a triangle wave, but with the loudspeaker is a square wave (with a little high frequency ringing).  I can’t see these frequencies well on the Bitscope oscilloscope, so I had to switch to my analog Kikusui COS5060 60MHz oscilloscope.  With 47Ω and no oscilloscope load, I get a frequency around 965kHz, with 22Ω around 1.13MHz, with 81Ω around 768kHz,  with 100Ω 687kHz, with 120Ω around 613kHz, with 150Ω around 526kHz, and with the loudspeaker around 590kHz.  So the loudspeaker is behaving like a 125–130Ω impedance around 590kHz, which is consistent with the measurements made of the loudspeaker impedance around that frequency. Similarly with a 3.3nF capacitor, I get 150Ω 1.23MHz, 180Ω 1.1MHz, 200Ω 1.03MHz, 220Ω 972 kHz, and loudspeaker 987kHz.  The output waveforms with the 220Ω or loudspeaker as feedback are fairly good square waves, so the oscillator feedback is voltage limited, not current limited.

So it looks like the simple analysis of the oscillator as being either a current-limited or a voltage limited output suffices for modeling the relaxation oscillator—the phase changes don’t seem to matter much, just how fast the capacitor charges or discharges, which depends mainly on the magnitude of the impedance.

Incidentally, the fluctuations in frequency for the oscillator occur with the resistors and the loudspeaker alike, and so don’t seem to be due to any physical or electrical properties of the loudspeaker.  They also occur with both electrolytic and ceramic capacitors.

Next Page »