Tuesday, August 9, 2022

500 Watt Antenna Tuner Part 6 - Matching Algorithm

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 Arduino.  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 Arduino Due counters in the Software and Microcontroller (Part 8) of this blogpost.  When I am done, I will also post the complete code to GitHub.


No comments:

Post a Comment