# Gas station without pumps

## 2021 May 4

### Resonance with nonlinear impedances

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

My book uses nonlinear impedance $Z=(j\omega\;1\,s)^\alpha M$ for modelling loudspeakers and electrodes.  The loudspeaker models include an inductor-like component with $\alpha>0$ and the electrode models include a capacitor-like component with $\alpha<0$. Standard linear components are special cases of the nonlinear impedance: inductors have $\alpha=1$, resistors have $\alpha=0$, and capacitors have $\alpha=-1$.

This past week I was thinking about the resonance that I see in some loudspeakers around 4MHz, which can be modeled with a capacitor in parallel with the main nonlinear impedance.  How can I estimate the capacitance to get initial values for model fitting?  In general, when do I get resonance with two nonlinear impedances?

Although I initially looked at the capacitor case, I realized that the general case of two nonlinear impedances in series gives me simple math that I can easily generalize to special cases and to parallel connections, so let’s look at $Z=(j\omega\;1\,s)^\alpha M + (j\omega\;1s)^\beta N$.  The first thing to do is to replace $j$ by the polar form $e^{j\pi/2}$, getting $Z=e^{j \alpha\pi/2}(\omega\;1\,s)^\alpha M + e^{j \beta\pi/2}(\omega\;1s)^\beta N$.  The we can apply Euler’s formula to get the real and imaginary parts:

$\Re(Z) = \cos(\alpha\pi/2)(\omega\;1\,s)^\alpha M + \cos(\beta\pi/2)(\omega\;1s)^\beta N$.

$\Im(Z) = \sin(\alpha\pi/2)(\omega\;1\,s)^\alpha M +\sin(\beta\pi/2)(\omega\;1s)^\beta N$.

We will get resonance whenever the imaginary part goes to zero:

$0= (\omega\;1\,s)^{\alpha-\beta} M\sin(\alpha\pi/2) +N \sin(\beta\pi/2)$, or

$\omega = \left(\frac{ -N \sin(\beta\pi/2)}{M\sin(\alpha\pi/2)} \right)^{1/(\alpha-\beta)} s^{-1}$.

The special case of an inductor and a capacitor sets $\alpha=1$, $M = L / 1\,s$, $\beta = -1$, and $N= 1\,s/C$,  yielding $\omega= \left(\frac{N}{M}\right)^{1/2} s^{-1} = \sqrt{\frac{1}{LC}}$, which is the standard result.

We get a resonance whenever $\alpha$ and $\beta$ have opposite signs.

We can deal with parallel rather than series impedances by looking at the sum of admittances instead of the sum of impedances.  To get the admittances, the exponents $\alpha$ and $\beta$ get negated and the coefficients $M$ and $N$ inverted, giving us

$\omega = \left(\frac{ -M \sin(\beta\pi/2)}{N\sin(\alpha\pi/2)}\right)^{1/(\beta-\alpha)} s^{-1}$.

Note: this post is a much simpler analysis than last year’s in Resonance for non-linear impedance, because here I am just looking for where the phase goes to zero, rather than where the magnitude of impedance is minimized.

Update 2021 May 4: The two definitions of resonance I’ve used (minimum $|Z|$ and $\Im(Z)=0$) are not the same—I tried doing a parametric plot of the magnitude vs. the phase for one asymmetric example ($\alpha=0.6$ and $\beta=-0.2$) and saw that the minimum magnitude did not occur at 0°.  So I’ll need to think some more about what I want “resonance” to mean for nonlinear impedances.

## 2021 January 9

### One week into new quarter

We’re one week into the new quarter (10% of the way through!) and the course is going ok. Most of the students have finished the first-week lab, which consists of installing a lot of software and soldering headers onto a Teensy LC board.

The software they had to install was

Of course, each piece of software has its own installation idiosyncracies, different on Windows, macos, and Linux.  Some people even bumped into some problems because of running old versions of macos or Python (which were luckily cleared by upgrading to slightly newer versions).

The soldering was a bigger problem, because many students plugged in their cheap irons and left them on for a long time without tinning the tips.  The result was a sufficient build-up of corrosion that that they could not then tin the tips—even using a copper ChoreBoy scrubber to clean the tips didn’t help in some cases. In the in-person labs, I often spent most of the first week labs cleaning soldering iron tips that students had managed to mess up, but I can’t do that online.  This was not such a problem last quarter, as most of the students knew how to care for soldering irons from the first half of the course, but it may be a bigger problem this quarter, as most of the students have never touched a soldering iron before.  Some of the ones who are living here in town may be contacting the lab staff to see if they can get access to tip tinner or get some help cleaning their irons.  Those further away may be buying tip tinner on their own—I had not included it in kits, because I nad not expected so many to need it and it costs $8 apiece. Grading is going fairly well. My grading team and I have had two Zoom meetings so far (for Homeworks 1 and 2) and I graded Quiz 1 by myself, so we are keeping up with the grading. He have Homework 3 and Prelab 2a (there is no Prelab 1) both due Monday morning, and we’ll try getting them graded Monday night. We’re having to do most of our grading in the evening, because one of the graders is living in China, 15 time zones away, and none of us in California is an early morning person. In other news, I’ve finally finished clearing the blackberries and ivy from behind the garage (a project I started about 2 years ago). I’ll probably find some more when I cut back the kiwi vine (an annual winter project, in addition to frequent minor pruning during the summer). I think I either need to get some female kiwi vines and an arbor for them or uproot the male kiwi. There is really not much point to having just a male kiwi intent on taking over a big chunk of the yard. There are still a lot of blackberry roots out there that will sprout new vines. I’ll try uprooting them where I have access (not where they are coming through the cracks in the concrete), but I’ll probably have to do a monthly sweep of the yard to remove blackberries for the rest of my life in this house. ## 2020 October 28 ### Analog Discovery 2 power-supply noise Filed under: Circuits course — gasstationwithoutpumps @ 11:38 Tags: , , , Last night and this morning I spent some time investigating the noise on the power supplies of the Analog Discovery 2, because some students were having trouble with power-supply noise on their audio amplifiers (an inherent problem with biasing the microphone with just a bias resistor to the power supply). I looked at the positive supply set to +3.3V using oscilloscope Channel 1, and saw a fluctuation in voltage that was not too surprising for a switching power supply (though the switching frequency seemed ridiculously low). The power supply is specified to stay within 10mV of the desired voltage, and the voltage seemed to be doing that. I know that some switching power supplies shut themselves off under low-load conditions, to retain efficiency at the cost of adding low-frequency ripple to the output, so I tried running the power supply with different load resistors. I did the sampling at 400kHz and took FFTs of the signal (exponential averaging of RMS with weight 100, Blackman-Harris window). Here are the signals: The signals show quite a bit of oscillation without a load, but decreasing with increasing load. Here are the spectra from the Fourier transform (removing the DC spike): The spike around 57.2kHz is present with all loads and remains at the same frequency even if I change the sampling rate, so is probably the underlying frequency of the switching power supply. The rather large fluctuations in the audio range are probably the result of the power supply shutting itself off when there is low current draw. Drawing 10 mA is not quite enough to prevent this shutdown, but 27.5mA seems to be enough. So there seem to be at least three solutions for students having problems with power-supply noise: • Taking enough current from the power supply that the power supply doesn’t shut itself down. This is a rather fragile technique, as other sources of power-supply noise (such as noise injected by the power-amplifier stage in a later lab) will not be eliminated. • Using a transimpedance amplifier instead of a bias resistor to bias the mic. The bias-voltage input to the transimpedance amplifier can have a low-pass filter to keep it clean. • Putting a low-pass filter (with a small resistor and large capacitor) between the power supply and the bias resistor. The resistance of the filter adds to the resistance for the DC bias calculation, but not to the resistance for the i-to-v conversion. ## 2020 October 5 ### First Zoom lab Filed under: Circuits course,Uncategorized — gasstationwithoutpumps @ 20:25 Tags: , I had my first remote lab session today, using Zoom to supervise pairs of students working from home. It went more smoothly than I expected, but not perfectly. I had pre-assigned lab partners to groups using a CSV file, following the instructions at https://support.zoom.us/hc/en-us/articles/360032752671-Pre-assigning-participants-to-breakout-rooms. A couple minutes into the lab time, when most of the students had shown up, I opened the breakout rooms, and everyone managed to get into their rooms. Except those students who showed up late—they had to be manually assigned to their rooms, and of course they did not remember what group number they were in, so I had look for them in my list of email addresses (which was not easy, because the name they were showing on the screen might have no more than 1 letter in common with their email address). I wish that Zoom could remember the pre-assignment even for those who are late! Once I finally got everyone into their breakout rooms, I started going from room to room, looking over the shoulders of the students and asking if they had any questions. On the second or third room, the students couldn’t get screen sharing to work (though others had in other rooms). I tried setting all the screen sharing options, but nothing seemed to work. I left that group to answer a question in another room, which also turned out to be about screen sharing, but reactivating it for them worked! So I went back to the room that first had trouble, and reactivated screen sharing for them, and this time it worked. After that I mostly answered questions for a group until some other group asked for help, then I moved over and answered questions there. It was very similar to the experience I had with the live labs, except that it was hard to see their breadboards. Most of the questions were about setting up Waveforms on the Analog Discovery 2 to collect the data or about gnuplot scripts to plot and model the data. A couple of times students had to quit Zoom and re-enter, and I had to reassign them to their breakout rooms. It turns out that this can be done while in a breakout room, so I did not have to go back to the main room. Again, I wish Zoom could remember their assignments! There were a few times when I was free to float between breakout rooms, and I think I managed to touch base with each group at least once, but I’m not 100% sure of that. I was pretty burned out after 2 hours of being constantly “on”, but that is not so different from a usual lab session. I did not, however, feel like recording another video tonight. ## 2020 September 11 ### Edition 1.1 released today! Filed under: Circuits course — gasstationwithoutpumps @ 11:49 Tags: , , , , I finally released the new version of the textbook today! (https://leanpub.com/applied_analog_electronics). The book is only slightly longer than the previous edition: 659 pages 337 figures 14 tables 515 index entries 162 references The chapter on design report guidelines is available free as a separate publication: https://leanpub.com/design_report_guidelines At the same time as I released the new edition, I eliminated my COVID-19 sale, so the minimum price is now$7.99. I will still provide coupons for free copies to instructors who are considering using the textbook for a course.

I may have to do another version before January, as I have not checked the labs for BME 51A yet to see what modifications are needed for doing the labs at home. For example, I haven’t decided whether it is worth buying more blood-pressure cuffs and extra tubing, to have enough to ship one to everyone. I’ll probably have to give up on the drill-press instruction. I’d rather not skip the micrometer instruction, but that would mean buying a lot more micrometers, as we generally share 5 for the whole class.

One nice thing about selling through Leanpub is that purchasers get all future editions published through Leanpub as part of the price—the company is trying to encourage authors to publish book drafts through them, rather than waiting until the book is completely polished. That means that students who got earlier versions of the book will get this release for free, and anyone who buys now will get the benefit of future releases.

Next Page »