# Gas station without pumps

## 2020 July 3

### Twelfth video for electronics book

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

I’ve just published my twelfth video for my Applied Analog Electronics book.  This video is for §34.2, which is the first part of Lab 10, and shows how to solder the FETs onto a breakout board.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited 3rd take. The first take stopped before I did any soldering, because I had forgotten to get blue tape out. The second take was complete, but had garbled sound for the intro and exit music, because I had the mic on while playing the sound, so I got a delayed superimposed sound.

I spent most of yesterday composing the 7 seconds of sound, because it has been a long time since I composed anything or used Finale Notepad. I’m not very happy with Finale Notepad, since it no longer runs on Macs (and so I had to use the “Barbie” laptop), and you can’t record the sound nor print the sheet music (it is deliberately crippled to induce you to buy the full-featured Finale). I got frustrated trying to produce the sound using online MIDI-to-MP3 converters, and ended up looking for another solution. I found MuseScore, which is freeware that runs on macs. I could import the music XML file that I had exported from Finale Notepad, and produce the sound using it—it even has a simple mixer panel that let me change the volume of the different instruments to get a slightly better balance and control the reverberation. I did have to edit the final sound with Audacity, in order to get the initial fade in. If I need to compose another short piece, I’ll try to do the whole thing in MuseScore, since it has more of what I need than Finale Notepad does.

I would upload the audio here, but wordpress.com only allows that if you have a paid plan, which I’ve been too cheap to do—you can hear the music on the YouTube link.

This video is the second one in this series using a green screen, and I’m still having problems with the lighting on my green screen not being uniform enough for OBS—even at night with only artificial light. The chroma key in OBS is nowhere near as easy to use as virtual backgrounds in Zoom. I have found some tricks to make adjusting the key color a little easier, but nothing that really handles the shadows and uneven lighting caused by wrinkles in the green-screen fabric.

## 2020 June 19

### Eleventh video for electronics book

Filed under: Circuits course — gasstationwithoutpumps @ 21:01
Tags: , , ,

I’ve just published my eleventh video for my Applied Analog Electronics book.  This video is for part of §27.2, which is the first part of Lab 7, DC characterization of an electret microphone.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited seventh take. Earlier takes had problems with the order of presentation, technical problems with the green screen, technical problems with the interaction with the Analog Discovery 2, or just stumbles in saying what I intended.

This video is the first one in this series using a green screen, but I found that the lighting on my green screen is not uniform enough for OBS, particularly in a daylit room—I ended up having to do the recording at night so that I could use only artificial light. The chroma key in OBS is nowhere near as easy to use as virtual backgrounds in Zoom.  You can see some problems with the green screen even in the thumbnail shot.

## 2020 June 9

### Error in video

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

After posting Resonance for non-linear impedance today, I realized that there was a small error in the most recent video (Tenth video for electronics book).  In particular, the estimation formula  was incorrect for the initial value for C2 based on the resonant frequency of the non-linear inductor-like component of the voice coil in parallel with the capacitor C2.  It used the average of the two roots of the quadratic equation for $u$ in Resonance for non-linear impedance, rather than just the more positive root.

This error is unimportant for two reasons:

• The initial value of C2 only needed to be close enough for the fitting algorithm to converge.
• I didn’t use that estimate of C2 in any case, but used the simpler estimate based on a single data point on the downward slope that corresponded to where C2 dominated the impedance.

The corrected code is fairly simple:

cp(alpha,beta) = cos(pi*(alpha-beta)/2)
U(alpha,beta) = (-(alpha+beta)*cp(alpha,beta) + sqrt((alpha+beta)**2*cp(alpha,beta)**2 - 4*alpha*beta))/(2*alpha)
N = (2*pi*f_peak)**(1+alpha)*M/U(alpha,-1)
C2_a = 1./N


This method produces an estimate that is closer to the final value after fitting than the simple estimator I used in the video.

### Resonance for non-linear impedance

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

In modeling loudspeakers and electrodes, my book uses a non-linear impedance $(j \omega\; 1\,s)^\alpha M$, where $-1 \le \alpha \le 1$ is unitless, and $M$ is in ohms.  This two-parameter component generalizes the standard passive components, as $\alpha=0$ gives resistors (with $M=R$), $\alpha=1$ gives inductors (with $M= L/1\,s$) and $\alpha=-1$ gives capacitors (with $M= 1\,s/C$).

This week I was thinking about resonance from a combination of an inductor-like component and a capacitor and more generally from two non-linear impedances with different exponents.  If we put two in series, we have an impedance $Z = (j\omega\;1\,s)^\alpha M + (j\omega\;1\,s)^\beta N$. To figure out where there are peaks or dips in the the magnitude of the impedance, it is easiest to look at $|Z|^2 = Z Z^*$, and let $w = \omega \; 1s$, to simplify the writing.

$|Z|^2 = Z Z^*$

$= (w^\alpha M)^2 + (w^\beta N)^2 + (j w)^{\alpha+\beta}M N ( (-1)^\alpha + (-1)^\beta)$

$= (w^\alpha M)^2 + (w^\beta N)^2 + (j w)^{\alpha+\beta}M N ( (j^{-2\alpha} + j^{-2\beta})$

$= (w^\alpha M)^2 + (w^\beta N)^2 +w^{\alpha+\beta}M N ( (j^{\beta -\alpha} + j^{\alpha-\beta})$

$= (w^\alpha M)^2 + (w^\beta N)^2 +2 w^{\alpha+\beta}M N ( \cos(\frac{\pi(\alpha-\beta)}{2}))$

We can first look for places where the magnitude goes to zero—are any of them for real values of $\omega$?  If we let $u=w^{\alpha-\beta} M/N$, so that $\omega = w/1\,s = (u N/M)^{1/(\alpha-\beta)} / 1\,s$, then

$|Z|^2 = (w^\beta N)^2 \left( u^2 + 2 \cos(\frac{\pi(\alpha-\beta)}{2}) u +1 \right)$

and the magnitude is zero if

$u = - \cos(\frac{\pi(\alpha-\beta)}{2}) \pm j \sin(\frac{\pi(\alpha-\beta)}{2})$,

which is real if $\alpha-\beta$ is an even integer.  The only ones of interest are ±2, which correspond to the standard LC resonance with $\alpha=1$ and $\beta=1$, and give us the usual formula for resonance: $\omega = (LC)^{-1/2}$.

More generally, we can look for a minimum of the magnitude of the impedance that is not zero, by taking the derivative with respect to $\omega$ or $w$ and setting it to zero:

$\frac{d (ZZ^*)}{d w} = \frac{1}{w}\left(2\alpha (w^\alpha M)^2 + 2\beta(w^\beta N)^2 + 2 (\alpha+beta) w^{\alpha+\beta} M N \cos(\frac{\pi(\alpha-\beta)}{2}) \right)$

Setting that to zero and changing variable again gives us $0 = \alpha u^2 + (\alpha+\beta)\cos(\frac{\pi(\alpha-\beta)}{2}) u + \beta$, which gives us the solution

$u = \frac{- (\alpha+\beta)\cos(\frac{\pi(\alpha-\beta)}{2}) \pm \sqrt{(\alpha+\beta)^2 \cos^2(\frac{\pi(\alpha-\beta)}{2}) - 4\alpha\beta}}{2\alpha}$.

The simplest case is the symmetric one, with $\beta = - \alpha$, which gives us $u = \pm 1$or $\omega =(N/M)^{1/(2\alpha)}/ 1\,s$.  This generalizes the standard LC resonance, with the standard result $\omega = (LC)^{1/2}$.

If $\alpha$ and $\beta$ have the same sign, then $u$ is not real and so there is no resonance (except in the trivial case $\alpha=\beta$, in which case we have a simple non-linear impedance $(j\omega)^\alpha (M+N)$ and still no resonance).

As the two exponents get further apart, the resonance gets more pronounced:

## 2020 June 7

### Tenth video for electronics book

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

I’ve just published my tenth video for my Applied Analog Electronics book.  This video is for part of §29.2.2—fitting models for loudspeakers.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited first take. This is my longest video yet in the series.

Next Page »