# Gas station without pumps

## 2020 May 6

### Second video for electronics book

Filed under: Circuits course — gasstationwithoutpumps @ 13:26
Tags: , ,

I’ve just published my second video for my Applied Analog Electronics book.  It is pretty rough, but I hope that I’ll get better with practice.  This video is for §28.2 of the textbook (introducing inductors)

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited second take. The sun through the skylight is a bit too bright on my hair, so I might switch to doing videos in the evening.

## 2020 May 3

### Speed of signals in transmission lines

Filed under: Circuits course — gasstationwithoutpumps @ 20:40
Tags: , , ,

This post continues the previous one on transmission lines.  I ended that post with the input impedance for a transmission line loaded with $Z$ on the output being $\begin{bmatrix} \cos( \omega \sqrt{LC}) & j \sqrt{L/C} \sin(\omega \sqrt{LC}) \\ j \sqrt{C/L} \sin(\omega \sqrt{LC}) & \cos( \omega \sqrt{LC}) \end{bmatrix} \begin{bmatrix} Z\\1 \end{bmatrix}$, where $L$ and $C$ are the lumped inductance and capacitance of the line and the vector is interpreted as the numerator and denominator of a fraction.

If we plug in $\begin{bmatrix}1\\0\end{bmatrix}$ for a short-circuit load or $\begin{bmatrix}0\\1\end{bmatrix}$ for an open-circuit load, we get input impedances of $j \sqrt{L/C} \tan(\omega \sqrt{LC})$ and $1/( j \sqrt{C/L} \tan(\omega \sqrt{LC})$, respectively. The periodic pattern $\omega \sqrt{LC}= n \pi$ corresponds to $n$ roundtrips of a signal on the transmission line.

If we compute the inductance and capacitance of a transmission line from its geometry, we should be able to determine the speed of transmission in the line. For example, if the transmission line is a pair of parallel wires, each $w$ long, then the period corresponds to a wavelength of $\lambda=2 w$ and we can multiply the frequency by the wavelength to get the speed of propagation.

We can approximate the inductance of a pair of parallel wires of length $w$, radius $r$, and distance between centers $d$ as $L= \frac{\mu_0 w}{\pi}\ln(d/r)$, where $\mu_0$ is the magnetic constant $4 \pi 10^{-7} T m/A$. Similarly we can approximate the capacitance of the pair of parallel wires as $C= \frac{\pi \epsilon_0 \kappa w}{ \ln(d/r)}$, where $\kappa$ is the relative dielectric constant and $\epsilon_0$ is the permittivity of free space.

That gives us $\sqrt{LC} = w \sqrt{\mu_0 \kappa \epsilon_0}$, so that $1 = f (2w) \sqrt{\mu_0 \kappa \epsilon_0}$, or velocity is $f \lambda = 1/\sqrt{\mu_0 \kappa \epsilon_0}$. But $1/\sqrt{\mu_0 \epsilon_0}$ is the speed of light in a vacuum $c$, so the speed of propagation $f \lambda = c/\sqrt{\kappa}$, which is the standard result for the propagation of signals in a transmission line.

### Transmission lines

Filed under: Circuits course — gasstationwithoutpumps @ 13:20
Tags: , , ,

My book covers complex impedance of inductors and capacitors and looks a series and parallel circuits involving them—it even considers complicated non-linear models that have $(j \omega \;1\,s)^\alpha M$ components for modeling loudspeakers (with $\alpha\approx 0.6$) and electrodes (with $\alpha\approx -0.5$). But I don’t consider models of distributed inductance and capacitance, commonly called transmission lines.  For the low-frequency work we do in bioelectronics, these more sophisticated models are not needed.

Model of a transmission line using 3 LC elements. The transmission-line model takes the limit of N elements as N goes to infinity, with each L_i= L/N and each C_i = C/N.

But I’ve been thinking about them sometimes at night, doing the algebra in my head as a way to get to sleep, so I thought I would make a record of my thinking.  It is fairly easy to determine the impedance of an infinite transmission line, by looking at what happens if you add a single inductor and capacitor at the front:

Treating the infinite transmission line as a single unknown impedance Z, we can solve an equation with Z as both the input impedance and the load impedance.

We can write the input impedance as $Z = j\omega L + \frac{1}{1/Z_1 + j\omega C}$. If $Z_1$ is an infinite transmission line, then $Z_1=Z$ and we can simplify to the quadratic equation $Z^2 - j\omega L_1 Z - L_1/C_1 = 0$, which has solutions $Z= (j \omega L \pm \sqrt{-\omega^2 L_1^2 + 4 L_1/C_1})/2$. But we are taking the limit as $N\rightarrow \infty$ with $L_1=L/N$ and $C_1=C/N$, so this simplifies to just $Z= \pm \sqrt{L/C}$, which is the standard result for the impedance of transmission lines.

If we have a finite-length transmission line, but connect a load resistor to one end with resistance $R=\sqrt{L/C}$, matching the impedance of the transmission line, it looks at other end just like a resistor $R=\sqrt{L/C}$. But what happens if we attach a different load (say a short-circuit, an open-circuit, or an arbitrary impedance $Z$)?

I found it too difficult to do the algebra in my head for concatenating multiple LC units, until I remembered a trick I used in my very first paper (A proof of the isomorphism of wxyz-transformals and 2×2 integer matrices under multiplication. Computers and Mathematics with Applications, 7(5):425–430, 1981. scanned copy).  We can represent a fraction as a vector of the numerator and denominator, and multiply by 2×2 matrices to do simple transformations.  For example, if an impedance is represented as $\begin{bmatrix} Z\\1 \end{bmatrix}$, we can represent series connection as $\begin{bmatrix} 1&Z_s\\0&1\end{bmatrix} \begin{bmatrix} Z\\1 \end{bmatrix}$ and parallel connection as $\begin{bmatrix} 1&0\\1/Z_p&1\end{bmatrix} \begin{bmatrix} Z\\1 \end{bmatrix}$.  If we look at putting one of our LC units in front of Z, we get $\begin{bmatrix} 1-\omega^2 LC/N^2&j \omega L/N\\j \omega C/N&1\end{bmatrix} \begin{bmatrix} Z\\1 \end{bmatrix}$, and N of them is $\begin{bmatrix} 1-\omega^2 LC/N^2&j \omega L/N\\j \omega C/N&1\end{bmatrix}^N \begin{bmatrix} Z\\1 \end{bmatrix}$.

That doesn’t look simpler, until you rearrange to get $\left( I + \frac{1}{N} \begin{bmatrix} -\omega^2 LC/N&j \omega L\\j \omega C&0\end{bmatrix}\right)^N \begin{bmatrix} Z\\1 \end{bmatrix}$ and then take limits as $N\rightarrow \infty$ to get $\left( I + \frac{1}{N} \begin{bmatrix} 0&j \omega L\\ j \omega C&0\end{bmatrix}\right)^N \begin{bmatrix} Z\\1 \end{bmatrix}$.

We can make the mental math easier if we make the matrix a root of unity:

$\left( I + \frac{j \omega \sqrt{LC}}{N} \begin{bmatrix} 0&\sqrt{ L/C}\\ \sqrt{C/L}&0\end{bmatrix}\right)^N \begin{bmatrix} Z\\1 \end{bmatrix}$.  We can then use the well-known limit $\lim_{N\rightarrow\infty} (1+x/N)^N = e^x$, which works with matrices as well as it does with numbers.  We now have $e^{\left(j \omega \sqrt{LC} \begin{bmatrix} 0&\sqrt{ L/C}\\ \sqrt{C/L}&0\end{bmatrix}\right)}\begin{bmatrix} Z\\1 \end{bmatrix}$.

Because the square of our matrix is the identity matrix, the even powers accumulate on the diagonal and the odd powers accumulate in other two corners, so we can do exponentiation to get $\begin{bmatrix} \cos( \omega \sqrt{LC}) & j \sqrt{L/C} \sin(\omega \sqrt{LC}) \\ j \sqrt{C/L} \sin(\omega \sqrt{LC}) & \cos( \omega \sqrt{LC}) \end{bmatrix} \begin{bmatrix} Z\\1 \end{bmatrix}$.

We can do a simple sanity check by plugging in $Z= \sqrt{L/C}$, which yields $\begin{bmatrix}\sqrt{L/C} (\cos(\omega \sqrt{LC})+ j\ \sin(\omega \sqrt{LC})\\ \cos(\omega \sqrt{LC})+ j\ \sin(\omega \sqrt{LC}\end{bmatrix}$, which yields the input impedance $\sqrt{L/C}$, as desired for a transmission line with a matched load.

We can now plug in $\begin{bmatrix}1\\0\end{bmatrix}$ for a short-circuit load $Z=0$ or $\begin{bmatrix}0\\1\end{bmatrix}$ for an open-circuit load $Z=\infty$ to get input impedances of $j \sqrt{L/C} \tan(\omega \sqrt{LC})$ and $1/( j \sqrt{C/L} \tan(\omega \sqrt{LC})$, respectively.  At very low frequency ($\omega \ll 1/\sqrt{LC}$), where we would not normally use transmission-line models, we can use the approximation $\tan(x) \approx x$, which gives the low-frequency approximations $j \omega L$ for the short-circuit load, and $1/{j \omega C}$ for the open-circuit load, which are just the approximations we would use if we were doing lumped models of a loop of wire or a pair of unconnected wires.

It is even more interesting to see frequencies where the input impedance goes to 0 or to infinity, which correspond to the periods for reflections off the far end of the transmission line.  We should be able to use the formulas for capacitance between two long parallel wires and inductance of a loop of two long parallel wires to get the L and C values, and then use the periods to determine how fast waves travel in the transmission line.  I’ve not done those calculations yet, as I have not memorized the formula for inductance or capacitance of parallel wires, nor the values of the permittivity of free space and the magnetic constant.  Ignoring the values of the constants, I think that dimensions all work, with both inductance and capacitance proportional to the wire length and with everything cancelling except the relative dielectric constant $\latex{\kappa}$, the permittivity of free space, and the magnetic constant.  I should work it out more carefully, though, to make sure I get the standard result that the velocity in a transmission line is $c/\sqrt{\kappa}$.

Writing up this description of transmission lines probably took me about as long as working out the matrix equations in my head did (a few hours).

## 2020 May 2

### First video for electronics book

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

I’ve just published my first video for my Applied Analog Electronics book.  It is pretty rough, but I hope that I’ll get better with practice.  This video is for §28.1 of the textbook (introducing inductors), with some material from §28.3.  After I’ve done videos for most of the book, I’ll probably come back and redo this one.

I filmed the video using OBS (Open Broadcaster Software), because I found that the Visualizer software that IPEVO provides for their document camera is complete junk for recording (the audio and video tracks got 30 seconds out of sync in less than 10 minutes).  OBS also provides better handling of multiple windows and multiple cameras, so that I could start with a shot of the chapter heading in the book.  I’ll be using this capability more when do gnuplot demos, with multiple windows in the video at once. One thing that OBS seems to lack is keystone correction for the document camera—I have to be very careful about making sure that the camera is level and centered over the page.  I converted the OBS mkv output to mp4 with Handbrake, but it did not get any smaller, so I’m going to check on the next video whether youtube will accept the mkv output directly (I think that OBS is using encoders that youtube accepts).

I filmed this without editing, but it took me 6 takes to get a usable video.  If I keep the videos this short, it is easier to do a whole new take than to fuss with the video editor cutting and pasting different video clips. I think I’m best off filming at night with artificial light, as I haven’t been able to get good diffuse lighting during the day—I get too many shadows.

I think that for the next video, I’ll try putting my headshot in the upper right corner, so that I’ll be looking down at what I’m writing.

## 2020 April 1

### Document cameras becoming unavailable

Filed under: Circuits course — gasstationwithoutpumps @ 15:29
Tags: ,

I decided to get a document camera for making video mini-lectures, as I suspect we may be doing at least part of Fall quarter on-line.  Based on recommendations from colleagues, I decided to get the IPEVO VZ-R camera, which I ordered last night.  Delivery was predicted to be in 3–4 weeks (it would have been another week, if I’d opted for free delivery).  If I had been in a hurry, I could have ordered the same camera from an Ebay store for another \$75, with “free and fast” delivery by next week.

Both Amazon and Ebay stores seem to be out of stock today, so I probably ordered at the last possible moment.

Because I won’t have a document camera for another 3 weeks, I can’t start making videos right away, but I can set up my “studio” space, plan which topics I’ll talk about, and maybe even try writing some scripts. I’ll also have to get some colored calligraphy markers and practice writing and drawing with them, so that I don’t scrawl illegibly on my first few videos.

Just cleaning up the book room in the garage to be the studio space will be a 3-week project, as it will mean clearing a 20-year accumulation of materials from the top of my desk.  Clearing the floor and the sofa will take even more effort, as my wife has commandeered the book room for doing her job, so everything is covered with children’s books, book covers, due-date pockets, and the other paraphernalia of a children’s librarian.  We’ll also have to take turns using the desktop machine, as it is the only one with a big enough screen for video editing or even photo editing, and she needs it for her school-library blog as much as I do for creating mini-lectures.

I may end up having to get a second desktop computer and setting up the studio in the bedroom rather than the book room—that will take even more time to clean up. Though the accumulation is of shorter duration, it is denser and with fewer places to put things away.

« Previous PageNext Page »