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

## 2020 June 9

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

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

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