I am reasonably confident (subject to testing and verification) that I can measure the magnitude and phase of the reflection coefficient to sufficient accuracy and narrow it to just two values. Knowing these, I can determine the location of the load on the Smith Chart to one of two points and by the frequency shift method discussed in the last section, down to one. With that information, per the analytical model, I can calculate the required matching impedances. To convert this impedances to real capacitor and inductor values, I also need to know the frequency. So, I will have add a frequency counter to the solution.
This page is repeat (summary) of the analytical model, but when I go to write the code, it is good to have all of the formulas in one place without all the proofs.
Measure the magnitude and phase of the reflection coefficient from the AD8302 device. Depending on the value of the phase use the frequency change method to estimate the true phase (I might have to build a look up table if the algorithm becomes too complicated).
From the magnitude and phase of the reflection coefficient, calculate the real and imaginary parts:
\begin{equation} \Gamma _{r}=\left | \Gamma \right |cos\theta \end{equation}
\begin{equation} \Gamma _{i}=\left | \Gamma \right |sin\theta\end{equation}
From the reflection coefficient calculate the normalized resistance and reactance:
\begin{equation}r_{0}=\frac{1-\left | \Gamma \right |^{2}}{1+\left | \Gamma \right |^{2}-2\Gamma _{r}}\end{equation} \begin{equation} x_{0}=\frac{2\Gamma _{i}}{1+\left | \Gamma \right |^{2}-2\Gamma _{r}}\end{equation}
Determine the region where the load is located. If in region 1, then:
\begin{equation}r> 1\ \ or \ \ x>0\ \ and\ \ r< \left | z \right |^{2}\end{equation}
If in region 2 then:
\begin{equation}g> 1\ \ or \ \ b<0\ \ and\ \ g< \left | y \right |^{2}\end{equation}
Build safeguards for the case when the load is on the unit resistance circle in the lower half of the Smith Chart or it is on the unit conductance circle in the upper half of the Smith Chart. In these cases, the first step of the matching network (parallel capacitor or series inductor respectively) are omitted.
If in region 1, calculate the intersection with the r = 1 circle:
\begin{equation}\Gamma _{r1} = \frac {1-g _{0}}{1+3g _{0}}\end{equation}
\begin{equation}\Gamma _{i1}=- \sqrt{\Gamma _{r1}-\Gamma _{r1} ^{2}}\end{equation}
From these calculate the resistance and reactance of the intersection just like for the load (above) and then:
\begin{equation}Bcomp = \frac {b _{1} - b _{0}}{Z _{0}}=\omega C=2 \pi f C\end{equation}
\begin{equation}Xcomp=x _{1}Z _{0}=\omega L=2 \pi f L\end{equation}
and put the capacitor equivalent to Bcomp in parallel with the load and the inductor equivalent to Xcomp in series with the load.
If in region 2, calculate the intersection with g = 1 circle:
\begin{equation}\Gamma _{r1} = \frac {r _{0}-1}{3r _{0}+1}\end{equation}
\begin{equation}\Gamma _{i1} = \sqrt{-\Gamma _{r1} - \Gamma _{r1} ^{2}}\end{equation}
From these calculate the resistance and reactance of the intersection just like for the load (above) and then:
\begin{equation} Xcomp = (x _{1}- x _{0})Z _{0}=\omega L=2 \pi f L\end{equation}
\begin{equation} Bcomp = \frac {b _{1}}{Z _{0}}=\omega C = 2 \pi f C\end{equation}
We add an inductor with the reactance value of Xcomp in series with the load and a capacitor with the susceptance value of Bcomp in parallel with the source.
In the case when the load is on the r = 1 circle, leave out the Bcomp step from region 1 approach and just apply the Xcomp from the same calculation. In the case when the load is on the g = 1 circle, lave out the Xcomp step from the region 2 approach and just apply the Bcomp step from the same calculation.
I need to measure frequency to convert the reactance and susceptance to actual inductance and capacitance. For this, I copied the K6JCA circuit except I modified it to work with a 3 volt Raspberry Pi Pico. Note that because we are dealing with RF, the 1 pF capacitor is doing all the hard work (it carries 10 times the resistor current). There is a detailed discussion of how to measure frequency up to 30 MHz using the Raspberry Pi Pico counters in the Software and Microcontroller (Part 8) of this blogpost. When I am done, I will also post the complete code to GitHub.
This is the easy part. To try some of these ideas before building the full scale product, I built the controller and the measurement circuits and prototyped the lower valued inductors and capacitors using a double sided copper board and the Dermal tool. Here is a picture of my second iteration (in the first iteration, the measurement circuits were had wired and I had ground potential difference challenges).
.jpeg)
The directional coupler is the four port network on the left. I have managed to maintain 70 dB of isolation (more or less since that is about the limit of my Nano VNA capability) between the power input and the reflected signal output. In the middle is the printed wiring board implementation of the Raspberry Pi Pico and the reflection coefficient (magnitude and phase), power and frequency measurement circuits. On the right are the 50, 100, 200, and 400 nH inductors and all the capacitors. After some experimentation, I managed to tune all my antennas, but I discovered another problem to be solved.
This was the first build:
The capacitance between these traces and the copper back was in the order of 500 pF which put some of these inductors into resonance (silly me). Off to the next iteration.
I eventually settled in the first picture with much smaller areas to minimize capacitance. In the process of fining a good solution, I had an interesting dialog with the Google Gemini, just like you would walk down the hall and talk to another engineer. The conversation went just like you would have it with a real person. It suggested lots of ideas that I had already considered and dismissed. But, it eventually suggested something I had not thought of. Grinding the back of the board to reduce capacitance like this:
It works quite well, but after some testing, I concluded that because it interferes with the return path of the current, it increases the inductance. Like many other things in engineering, it becomes a matter of compromise.
So, I went through a board layout and calculated the trace inductance and capacitance and modeled it. Here is the board layout:
Note that I added C69 and C70 in parallel with a relay to short them out in series with the load (very similar to Jeff K6JCAs approach) and also a 300 nH inductor in shunt with the load just in case I needed to neutralize the capacitance in region 1 (see the region definitions earlier). After much struggle with LT Spice and a software simulator that I built based on the prototype experience, I think I have a working concept of how the tuning algorithm would work with all the stray capacitance and inductance running around. Here is the LT Spice schematic of the above layout.
The gap on the right is for putting an inductor in series with the load resistor when the load in inductive (and taking out the capacitor). The 10 nH inductor in series with the switches is the inductance of the Omron miniature relays.
This is a list of the key characteristics of the tuning algorithm, as implemented in the software and will be used to set the L and C relays (though the exact value of the parameters will change).
- First, the location of the load on the Smith Chart is measured. But this is only the location as seen through the parasitic Ls and Cs.
- Then the actual location is calculated by backing out the parasitic effects and the region of the load (one or two) is determined. So far, I have found that there is no need to worry about region 3 (right on top of r = 1 circle in the lower half of the chart) and region 4 (right on top of the g = 1 circle in the upper half of the chart).
- Then the appropriate compensating capacitor relay (on the load or source side) is engaged.
- This will cause a shift in the location of the load as seen by the measurement circuit.
- If the new location is in between b high and low limits, the series capacitor is engaged.
- Then C (in region 1) and L (in region 2) is incrementally increased until a point just past the r = 1 in the lower half of the Smith Chart (in region 1) or a point just past the g = 1 circle in the upper half of the Smith Chart (in region 2) is reached. These limits are set in software.
- Then L (in region 1) or C (in region 2) is incrementally increased from 0 relay setting to 255 relay setting and the results are recorded in a list.
- Then the list is scanned for a minimum value and that is the final result.
The various regions discussed above are shown in the picture below.
.jpeg)
Before building the final hardware, I ran through the models and observed the following results (to be updated with the real product data when that is available). To avoid repeating the background data, I am running SWR values from 1.5 to 9.9 and reflection coefficient phase angles from 0 to 359 for a total of 3,240 data points.
- 80m band is easy. There are 6 data points above SWR of 1.6 (and only 183 above 1.5) and none above 2.0. I will call this a win so far.
- 40m band has 61 data points above SWR of 1.6 and they are mostly around the r = 1 circle and in high SWR regions (8 and 9.9). I can live with this.
- 30m band has 158 data points above the SWR of 1.6 (abut 5%) mostly at high SWR and around r = 1 circle. It also has 26 data points that the tuning algorithm overshot its upper limit (exceeded the defined band on the Smith Chart when approaching the r = 1 or g = 1 circle)
- 20m band is where trouble starts. It has 267 data points with SWR higher than 1.6 (8%) and 52 data points where the tuning algorithm over runs its limit. This is primarily due to the shunt parasitic capacitance which potentially can be neutralized by a shunt inductor, but I have to be careful since engaging the shunt inductor could steal most of the load power.
- 20m band with shunt inductor. Adding the inductor cuts the number of data points above 1.6 to 176 (5%) but it does not change the number of over runs.
- 17m band has 416 data points (13%) above SWR of 1.6 and 47 data points that over run.
- 17m band with shunt inductor: Adding the inductor cuts the data points with SWR above 1.6 by half to 208 (6%) The number of over runs remains the same at 47.
- 15m band has 315 data points with SWR above 1.6 (10%) and 106 over runs.
- 15m band with shunt inductor: Adding the shunt inductor reduces the number of data points above 1.6 SWR to 171 (5%). The number of over runs are 106.
- 12m band has 296 data points with SWR above 1.6 (9%) and 157 over runs
- 12m with shunt inductor: has 110 data points with SWR above 1.6 (3%) and 157 over runs
- 10m band has 489 data points above SWR of 1.6 (15%) and 127 over runs.
- 10m with shunt inductor: has 156 (5%) data points above SWR of 1.6 and 127 over runs.
The issue with the shunt inductor is that it can steal a lot of current from the load, especially at the mid range to lower frequencies. Fortunately, I don't need it in the lower bands. I can also play with the limits around r = 1 circle for better results. I will leave tweaking of the numbers to after when I have built the hardware.