Friday, July 31, 2020

Investigation of quarter-wave folded balun operation

For a about a month, I've been trying to understand how the quarter-wave folded balun works. There are some explanations online, such as this one at Stack Exchange or this one at antenna-theory.com. There are many others as well.

I kinda sorta understand what those explanations are getting at, but I still felt like I didn't really understand what is going on. The explanations seem to rely on experience and intuition of people who have worked with these things. I don't have that that experience or intuition, so I tried modelling the situation to gain insight. All computations in this article are made with scikit-fem.

So what is a quarter-wave folded balun and what is it used for? In short, a balun is a device for converting single-ended signals to differential signals, and back again. Though, what exactly a single ended signal or a differential signal means differs from situation to situation. Talking about signal as voltage, then typically a single ended signal has two conductors, one of which carries the signal, while the other one is a reference level (like ground). In a differential signal one has three conductors (or just two, because of a caveat), in which one conductor carries a positive signal, one carries a negative signal and the third one is the reference. The caveat in this case is, that the reference level can be inferred as the average of the two signal levels, and the reference conductor is not strictly needed.

Coaxial cables are often used as feedlines for antennas. They have the nice feature, that when the currents in the coax are differential, i.e. the current in the shield is equal but opposite to the current in the inner conductor, and when the shield is at ground potential, then the eletromagnetic fields carrying the signal are entirely contained within the coax. This means that passing the cable near metals, or touching the cable by hand doesn't affect the signal it carries. If the currents are not balanced, though, then external fields are produced. These fields will interact with the surroundings, changing the signal carried. The fields also radiate, causing the coax itself to act as an antenna, changing the overall behavior of the system.

So how is it possible that the currents in the coax are not equal? I mean, where else could the current from the inner conductor go other than to the shield? Well, the currents can return through some other conductor, such as the ground. For instance, in the case of an antenna the currents will vanish into thin air and pass to ground through the radiation resistance. If the impedance to ground from the terminals of the antenna are equal, then driving the antenna differentially (with respect to ground) will result in an equal but opposite current in the terminals, and thus also in the feed line. However, since the coax shield needs to remain at ground potential to avoid an external electric field, it isn't possible to have the shield directly drive one side of a differential signal. This is where the balun steps in. The balun will take in a single-ended signal from the coax, and transform it into a differential signal, which is suitable for the load.

To begin the investigation, let's look at the bare coax setup below (figure modified from the work of Omegatron on Wikimedia Commons).

Baseline setup without the balun

The source is single ended, which feeds the inner conductor on the left side of the coaxial cable. The frequency from the source is 868 MHz. The source also has an output impedance of 50 ohms, which is the same as the coax characteristic impedance. The coaxial cable shield is connected to ground at the left side. The load is on the right side of the coaxial cable. It consists of two 25 ohm resistors: one is connected between the coaxial inner conductor and ground and the other is connected between the coaxial shield and ground. This load looks like a 50 ohm resistor for differential signals and like a 25 ohm resistor for single-ended signals. Further, to control stray capacitances and inductances, and to act as a reference, the cable is placed over a ground plane.

The situation is modeled as a multiconductor transmission line. You should check out my previous post about the subject, which is way more involved regarding the mathematics and modelling. The transmission line parameters were computed using FEM. Dimensions and materials used were those of RG-316 coax suspended 20 mm above the ground plane.

Simulating this configuration we notice that there is a significant dependence on the length of the coaxial cable. I don't think this comes as a huge surprise for anyone with experience with transmission lines and coaxial cables. It turns out, that by choosing the coax length properly, the load can be matched to the coax to get a very good power transfer. However, it doesn't seem possible to both match the load to the coax and prevent external fields.

As a first example at 860 mm length there is very poor matching of the load. No current is passing in the shield-side load resistor. This results in a large current imbalance between the conductors, and leads to large induced voltages in the shield. There are thus both large magnetic and electric fields external to the coax. Some quantitative parameters to characterize this situation:
  • Maximum common-mode current amplitude in coax: 14.47 mA
  • Maximum voltage amplitude in coax shield: 6.92 V
  • Common-mode current to load: 14.47 mA
  • SWR: 2.00
Voltage and current distribution in coax of length 860mm

The situation is quite different at 946mm length. Here current flows to the load from both the inner conductor and the shield, and the currents are approximately equal and opposite, which results in a mostly balanced current in the coaxial cable. However, the differential signal at the load is achieved through a voltage oscillation in the shield, which leads to a significant electric field external to the coax. The observed parameters at this situation are
  • Maximum common-mode current amplitude in coax: 1.05 mA
  • Maximum voltage amplitude in coax shield: 0.50 V
  • Common-mode current to load: 0.053 mA
  • SWR: 1.00
Voltage and current distribution in coax of length 946mm

Computing the monitored parameters over a range of coax lengths reveals a pattern, which repeats every half wavelength. We also observe, that there is no length which would get rid of the significant voltage in the shield. The best one can do is what is represented by the 946mm coax length case.

Observed parameters against coax length

Next, we'll look at the same situation with the quarter-wave folded balun. See the illustration below (figure again modified from the work of Omegatron on Wikimedia Commons).

Quarter-wave folded balun setup

The feed and load remain exactly as in the first case. What has changed, however, is the addition of a shorting stub, which connects the inner conductor of the coax to the shield of the coax. This shorting piece is made of the same type of coax, but doesn't have its inner conductor connected anywhere. This situation can be modelled as two multiconductor transmission lines connected at the shorting wire interface. We have a 2-conductor (plus ground) line on the left side and a 3-conductor (plus ground) line on the right side. At the interface, we require compatibility conditions of the voltages and currents:
  • Inner conductor voltage is continuous
  • Inner conductor current is continuous
  • Shield voltage is continuous
  • Left shield current = right shield current + shorting current
  • Shorting voltage equals shield voltage
The suitable shorting wire piece is approximately a quarter of a wavelength at the desired operating frequency (here 868 MHz), thus the reason for calling it a quarter-wave folded balun. However, the velocity in the inner of the coax and in the shorting wire are not the same. The shorting wire is surrounded in large by air, thus the velocity is close to the speed of light, whereas the inner has a velocity factor of about 0.7. A quarter wavelength at the speed of light is about 86 millimeters, while at velocity factor 0.7 it is about 60 millimeters. It is thus not immediately clear what the actual length for the shorting wire should be. To understand how the shorting length affects the performance, we can compute the same observed parameters for a sweep over the length.

Sweep over shorting length for a coax with overall length 860mm

Sweep over shorting length for a coax with overall length 946mm

The common mode currents and the shield voltage all decrease as the length of the shorting wire is decreased. However, at very short shorting lengths, the SWR becomes very bad. Though it seems that the design is quite forgiving when it comes to the exact shorting length. That is, we get a decent SWR over a large range of lengths. There is a trade-off, however, between achieving the best SWR and getting a lower common-mode current.

The optimal SWR of very close to unity is achieved with a shorting length of 61.5mm, which is slightly more than quarter wavelength at the coax propagation speed. At this shorting length, we observe the following parameters for the 860mm coax length:
  • Maximum common-mode current amplitude in coax: 0.17 mA
  • Maximum voltage amplitude in coax shield: 0.080 V
  • Common-mode current to load: 0.22 mA
  • SWR: 1.00
For 946mm, we observe the following:
  • Maximum common-mode current amplitude in coax: 0.016 mA
  • Maximum voltage amplitude in coax shield: 0.0077 V
  • Common-mode current to load: 0.040 mA
  • SWR: 1.00
Allowing for a slightly worse SWR and choosing the shorting length as 40mm gives considerably better common-mode behavior. At 860mm:
  • Maximum common-mode current amplitude in coax: 0.058 mA
  • Maximum voltage amplitude in coax shield: 0.028 V
  • Common-mode current to load: 0.080 mA
  • SWR: 1.32
And at 946mm:
  • Maximum common-mode current amplitude in coax: 0.0056 mA
  • Maximum voltage amplitude in coax shield: 0.0027 V
  • Common-mode current to load: 0.024 mA
  • SWR: 1.31
The correct shorting length is thus not at all clear. However, as long as the shorting length is sensible, the balun does seem to work as intended, reducing the coax common-mode current and shield voltage down to about one one-hundredth of just the bare coax. Now we just need to understand how it works.

The following are visualizations of system with a shorting length of 40mm.

Sweep of overall coax length with shorting length at 40mm
Voltage and current profiles in the system with 860mm coax length and 40mm shorting length
Voltage and current profiles in the system with 946mm coax length and 40mm shorting length

The following are computed with shorting length 61.5mm.

Sweep of overall coax length with shorting length at 61.5mm
Voltage and current profiles in the system with 860mm coax length and 61.5mm shorting length
Voltage and current profiles in the system with 946mm coax length and 61.5mm shorting length

At 61.5mm shorting length, the shorting wire appears to only interact very weakly with the inner conductor: almost no current is flowing through the connection between the inner and the shorting. This gives some insight to the operating mechanism of the balun. It shows that the inner conductor plays only a minor role in the operation, and the main interaction is between the shield and the shorting wire.

It seems to work by having the shorting wire and coax shield form a resonator through capacitive and inductive coupling. When current oscillates back and forth in the shorting-shield resonator, the voltage at the load end of the system oscillates differentially. This oscillation is sustained with only tiny kicks of current from the inner conductor. The closer the shorting length is to the quarter wavelength, the less of a kick is needed from the inner conductor and the closer to zero the shorting current is on the right. The oscillation voltage is differential with respect to the ground plane due to symmetry of the system.

Although the inner conductor is very loosely coupled with the resonator, all the energy in the resonator needs to still come from it. This is because the resonator is shorted at the left end, and while there is a lot of current flowing, the voltage there is zero. On the right end, however, the short-inner connection has a non-zero voltage and also nothing is preventing current from flowing. The only reason current is not flowing in the 61.5mm shorting length example is because the system is driven at the resonant frequency, any lower or higher and we'd see power transferring in and out during the cycle.

When feeding the system with a wave packet, we can observe the resonator starting and stopping oscillation. The following shows a Gaussian wave packet with a characteristic time of 1ns at 868MHz passing through a 946mm long coax with a 61.5mm shorting wire.


In the video, you can see the resonator picking up speed a bit slower than the wave packet would otherwise move, and also the resonator keeps going for a bit longer than the wave packet would. Though this these aren't as clearly visible in the video as I had hoped for.

To really see how the resonator ramps ups and down, let's take a closer look at the power driven to the resonator. This power is computed as the shorting wire voltage times shorting wire current conjugate at the right end. Plotted below is the power against time in the simulation shown in the video above. We see that when the oscillation is ramping up, there is a positive power transfer to the resonator, and when the oscillation is dying out, power is transferred from the resonator back to the coax.
Power to (from) the resonator as a function of time in the simulation shown earlier

To be honest, I still don't fully understand how the balun works. I do not have enough insight or intuition of the situation that I could come up with the design myself, and although I can show it working, I can't explain it in simple terms. In conclusion, it's all a bit of black magic and voodoo.

Wednesday, July 22, 2020

Coaxial cables as multiconductor transmission lines

When using coaxial cables, it is often assumed that all of the current passed through the inner conductor returns through the shield. This seems like a good assumption, since where else would the current go? It turns out, however, that if the conductors have a finite impedance to some third conductor (for example the ground), this will cause currents to pass to that third conductor and not necessarily return symmetrically through the coax. Such a situation may occur for instance when the coaxial cable is used to feed an antenna. The unbalanced currents (common mode currents) in the coax in turn cause the feedline itself to act as an antenna, and to radiate power unpredictably. Antennas are thus typically connected to the feedline through some form of balun, which presents itself as a large series impedance for any unbalanced currents.

There is a lot of discussion regarding unbalanced currents in coaxial cables on amateur radio forums, and Modern Antenna Design by Thomas A. Milligan quickly mentions three-wire transmission lines in their discussion of baluns. However, I haven't found any computational examples of what is going on in these situations. The following is my attempt at that.

Assume a coaxial cable running on top of a perfectly conducting ground plane. Assume also, that the cable isn't too far away from the plane, so that the fields between the coax and the ground plane can be considered to propagate in the TEM mode. This situation can be thought of as a multiconductor transmission line, with two signal conductors and a reference conductor. We can draw the equivalent circuit of a short line segment of length \(\Delta x\) as shown in the figure below.
Inductances \(L_1\) and \(L_2\) are the self-inductances of conductor 1, i.e. the inner conductor with return through the ground plane, and of conductor 2, i.e. the shield with return through the ground plane. The inductance \(L_{12}\) is the mutual inductance between the two signal-bearing conductors. The capacitances bear a similar nomenclature, and their meaning is more clear from the figure. However, note that the capacitance \(C_1\) from the inner conductor to the ground plane is zero, because the electric field would need to pass through the shield first.

In the limit of \(\Delta x \rightarrow 0\) we get the telegrapher's equations for the situation as
\( \begin{align} \frac{\partial V_1}{\partial x} &= -L_1 \frac{\partial I_1}{\partial t} - L_{12} \frac{\partial I_2}{\partial t} \\ \frac{\partial I_1}{\partial x} &= -C_{12} \frac{\partial V_1}{\partial t} + C_{12} \frac{\partial V_2}{\partial t} \\ \\ \frac{\partial V_2}{\partial x} &= -L_2 \frac{\partial I_2}{\partial t} - L_{12} \frac{\partial I_1}{\partial t} \\ \frac{\partial I_2}{\partial x} &= -(C_2 + C_{12}) \frac{\partial V_2}{\partial t} + C_{12} \frac{\partial V_1}{\partial t} \\ \end{align} \)

Equivalently in matrix form as
\( \begin{align} \frac{\partial \boldsymbol{I}}{\partial x} &= -\boldsymbol{C} \frac{\partial \boldsymbol{V}}{\partial t} \\ \frac{\partial \boldsymbol{V}}{\partial x} &= -\boldsymbol{L} \frac{\partial \boldsymbol{I}}{\partial t} \\ \end{align} \)
where \(\boldsymbol{V} = ( V_1, V_2 )\), \(\boldsymbol{I} = (I_1, I_2)\), while \(\boldsymbol{L}\) is the inductance matrix of the system and \(\boldsymbol{C}\) is the capacitance matrix of the system
\begin{align} \boldsymbol{L} &= \begin{pmatrix} L_1 & L_{12} \\ L_{12} & L_2 \end{pmatrix} \\ \boldsymbol{C} &= \begin{pmatrix} C_{12} & -C_{12} \\ -C_{12} & C_2 + C_{12} \end{pmatrix} \end{align}

With a bit of manipulation, we can derive a vector valued wave equation for the voltage as
\( \begin{align} \boldsymbol{L} \boldsymbol{C} \frac{\partial^2 \boldsymbol{V}}{\partial t^2} &= \frac{\partial^2 \boldsymbol{V}}{\partial x^2} \end{align} \)
This describes two waves propagating at velocities \(1/\sqrt{\lambda_1}\) and \(1/\sqrt{\lambda_2}\), where \(\lambda_1\) and \(\lambda_2\) are the eigenvalues of matrix \(\boldsymbol{L} \boldsymbol{C}\).

Determining the capacitance and inductance parameters requires solving the electrostatic and magnetostatic problems in the appropriate geometries. The approach I took, was to use FEM to compute the electric potential for the electrostatic problem, and the magnetic vector potential for the magnetostatic problem. Computing the capacitance is straightforward from relating the electric field energy of the FEM computation to the energy stored in a capacitor. That is, we have the electric field energy from FEM as
\( \begin{align} W = \int_\Omega \boldsymbol{E} \cdot \boldsymbol{D}\ \mathrm{d}x. \end{align} \)
On the other hand, we have the energy stored in a capacitor as
\( \begin{align} W = \frac{1}{2} CU^2. \end{align} \)
This is then simply computed for the two cases:
  1. inner conductor at potential \(V\), shield and ground at potential \(0\)
  2. inner conductor and shield at potential \(V\), ground at potential \(0\)
Computing the inductance also follows a similar idea, but there is some additional complication to compute the mutual inductance. The energy in the magnetic field is given by
\( \begin{align} W = \int_\Omega \boldsymbol{H} \cdot \boldsymbol{B}\ \mathrm{d}x. \end{align} \)
On the other hand, we have the energy stored in an inductor as
\( \begin{align} W = \frac{1}{2} LI^2. \end{align} \)
Here we have three different cases that need to be considered.
  1. Current \(I\) through inner conductor, current \(0\) through shield and current \(-I\) through ground plane.
  2. Current \(0\) through inner conductor, current \(I\) through shield and current \(-I\) through ground plane.
  3. Current \(I\) through inner conductor, current \(-I\) through shield and current \(0\) through ground plane.
The inductances \(L_1\) and \(L_2\) in the multiconductor transmission line are the inductance of the inner conductor with return through the ground plane and the inductance of the shield with return through the ground plane, respectively. They can thus be directly computed through the magnetic field energy of cases 1 and 2. The inductance \(L_{12}\), however, is the mutual inductance between the inner and outer conductors. To compute that, we need to consider case 3, where we connect the inner conductor to the shield at the far end. This is equivalent to connecting inductances \(L_1\) and \(L_2\) in series together complete with the mutual inductance. Since the currents are opposing, the mutual inductance acts to decrease the total inductance, and we can write the inductance of the series systems as
\( \begin{align} L_\mathrm{series} = L_1 + L_2 - 2 L_{12} \end{align} \)
Thus we can compute \(L_\mathrm{series}\), \(L_1\) and \(L_2\) from the magnetic field energy, and then solve the mutual inductance \(L_{12}\) from the above equation.

Computation domain for the parameters in the example
Placing a coax of roughly RG316 dimensions and materials over a groundplane at a height of 20mm gives the following values (note: the skin effect on the current distribution is not perfectly accounted for, that's a whole new can of worms).
\( \begin{align} L_1 & = 1023.02 \mathrm{nH}/\mathrm{m} \\ L_2 & = 800.58 \mathrm{nH}/\mathrm{m} \\ L_{12} & = 800.58 \mathrm{nH}/\mathrm{m} \\ C_2 & = 14.05 \mathrm{pF}/\mathrm{m} \\ C_{12} & = 105.05 \mathrm{pF}/\mathrm{m} \end{align} \)

Interestingly, the mutual inductance and the inductance of the shield evaluate as very nearly the same value. This means that the voltage induced in the shield due to changing differential currents is basically zero! This can't simply be a lucky coincidence, but I haven't yet worked out the details.

For a visualization of the results, below is a solution of the telegrapher's equations (again using FEM) for a cable length of 2.1 meters. On the left side, the inner conductor is driven with a time harmonic input of amplitude 1V oscillating at 210 MHz, while the shield is grounded. On the right side, the inner conductor is connected to the shield through a 47 ohm resistance. No connection to ground is made on the right side.
Contrary to intuition, the shield really does remain at ground potential! This is in fact exactly what I've observed every time I've tried to measure the potential on the coax shield.

So, what happens if we drive the shield at the left side and ground the inner conductor? On the right side, inner remains terminated to the shield through a 47 ohm resistance without any other connections.
Even in this case, the signal propagates mostly in the differential mode. Also, what is clearly visible here is that the wavelength in the shield is longer than in the inner conductor. The propagation velocity of the common mode signal is thus greater than the differential mode signal. This can also be determined from the eigendecomposition of matrix \(\boldsymbol{L} \boldsymbol{C}\). The eigenmodes in fact almost exactly correspond with the differential and common mode currents (another happy almost coincidence), and the corresponding propagation velocities are
\( \begin{align} v_1 & = 1/\sqrt{\lambda_1} \approx 0.690c \\ v_2 & = 1/\sqrt{\lambda_2} \approx 0.995c \end{align} \)
where \(c\) is the speed of light.

How about the initial motivation? What if there is a finite impedance from both conductors to ground? Some references say that it is unsymmetric impedance to ground that causes inbalance in the currents. I'm not sure what is meant exactly, but the following happens when both the inner and the shield are connected to ground through 23 ohm resistances, with no other connections on the right side. On the left side, the shield is grounded and the inner conductor is driven.
So even if the load is symmetric with respect to ground, it may cause common mode currents to flow in the coax. Also, since in such a situation the coax is not terminated at its characteristic impedance, the length of the cable will also affect the behavior.