To successfully complete the design of the Automated Antenna Tuner (AAC) while meeting the
before explained design constraints, the approach being used must be outlined in this section. As
such, this section discusses different approaches to the methods involved in the design and
operation of the device, as well as the decisions made regarding both methods and critical
3.1 System Overview
The AAC is a stand alone unit meant to be utilized with MFJ’s loop antenna. The unit is
transmitted into by an amateur radio transmitter. The inputted signal induces a voltage in the RF
coupler subsystem. A signal from the RF coupler is rectified and used to measure the frequency
at which the radio is being operated. From the RF coupler the voltage is measured by a
microcontroller and used to determine the forward and reflected power levels. The voltage is also
used to determine the standing wave ratio (SWR) of the system. If the SWR is outside an
acceptable level, the microcontroller sends a pulse to a motor-controlled variable plate capacitor,
causing a change in impedance of the load, or the antenna. Once the SWR is within an acceptable
range, the variable capacitor will maintain its current position giving the system the best possible
efficiency. The following diagram, Figure 3.1, illustrates the overall operation of the AAC.
Figure 3.1: System Overview
The following sections describe the hardware subsystems used in operation of the AAC. Figure
3.2 is a representation of the final design of the AAC.
Figure 3.2: Physical model
3.2.1 Power Supply
The antenna controller’s external power supply must provide 12VDC for the antenna and 5 VDC
for the microprocessor. Maintaining a consistent voltage to controller’s subsystems ensures the
subsystems operate safely and correctly. The external power supply is a power adapter that
converts 120VAC from a standard wall outlet to a 12VDC for use with electronics. The
following outlines the internal power supply requirements of the device.
The design constraints specify the antenna motor requires 12VDC to tune the variable plate
capacitor. To comply, the voltage supplied to the motor must be constrained. An increase in
current to 20mA at maximum torque corresponds to a 4V increase in the supply voltage. To
safely stay below 4V, a tolerance of 1V was chosen.
The controller must use a microprocessor to calculate forward and reverse power, frequency,
SWR, and to control the digital display and the antenna. The microprocessor supplied by the
manufacturer is the PIC18F2520. This microprocessor requires a supply voltage between 4.2 and
5.5VDC . The internal power supply must provide the microprocessor 5VDC 300mV.
5VDC is a standard output for voltage regulators so it is a reasonable choice. The 300mV
tolerance allows for a 20mV cushion for the microprocessor’s requirements.
3.2.2 Standing Wave Ratio
In a transmission system it is important to transfer the maximum amount of power from the
transmitter to the antenna. To achieve maximum power transfer, the antenna’s impedance must
equal the impedance of the transmitter. When these impedances are not equal, a portion of the
transmitted signal is reflected back from the antenna towards the transmitter . A standing
wave is produced by the superposition of a forward traveling wave and the reflected traveling
wave. This standing wave must be minimized for maximum power transfer. The standing wave
can be quantized at any point on a transmission line by forming a ratio of the voltage maximum to
the adjacent voltage minimum . This ratio is the SWR at one location on the transmission line.
To predict the SWR along a long transmission line that is assumed to be lossless, a reflection
coefficient, Γ , must be found. The reflection coefficient is found by dividing the reflected
voltage by the forward voltage at any point along the transmission line. This is shown in
Equation (1) below.
From Γ , the SWR can be calculated for the transmission system as shown below in Equation (2).
SWR = (2)
The AAC’s tuning procedure tunes the antenna so that a minimum SWR is achieved.
3.2.3 Measurement of SWR
Since the AAC uses the calculation of SWR to tune an external antenna, a method for measuring
the forward and reflected voltages along the transmission line was needed. Indirect measurement
and direct measurement methods for measuring these voltages were considered. Indirect
measurement uses an inductor to sample the forward and reflected voltage in a small portion of
the transmission line. Direct measurement places a resistive voltage divider network in series with
the transmission line to sample the forward and reflected voltage.
The effects on the transmission line, the measurement circuit’s frequency dependency, and the
outputs of the measurement circuits were considered for both methods as shown in Table 3.1.
The indirect measurement method introduces no new impedance to the transmission system. If
an impedance were to be introduced it would have to be accounted for in the tuning process so
that maximum power would be transferred. The direct measurement method does, however,
introduce impedance to the transmission system. The frequency dependency of the measurement
circuit was considered because the measurement circuit should not have to be tuned to the
operating frequency by the AAC’s user. The direct measurement method would require the user
to tune the circuit to achieve an accurate forward and reflected voltage. The indirect method
produces accurate voltages throughout the frequency range of the transmission system. Both
methods would forward and reflected voltages.
Table 3.1: Comparison of SWR Measurement Techniques
Effect on transmission Frequency Dependency Output
Indirect method None Independent Representative
Direct method Introduces impedance Dependent Representative
The indirect method for measuring forward and reflected voltages was chosen because it has no
effect on the transmission line and it has no frequency dependency.
3.2.4 Antenna Motor Control
The antenna will be tuned by turning a variable plate capacitor. To turn the plates of the capacitor
a 12V, 1 RPM DC motor is used. The controller must supply the motor with the 12V when the
antenna needs to be tuned. During tuning, the antenna motor’s nominal current is 10mA. At the
variable capacitor’s physical limits the torque increases to a maximum. As a result of the increase
in torque, the current reaches maximum levels at 15mA.
The microprocessor cannot provide 12V for the DC motor. Therefore, a circuit must be
implemented that provides the required voltage for the motor that is controlled by the
microprocessor. An H-bridge circuit can provide a large range of voltages along with sufficient
current to turn the motor. The H-bridge circuit is controlled by the microprocessor using pulse
width modulation. This provides the required voltage and current to the antenna motor while
allowing the microprocessor to control the tuning procedure.
The Texas Instruments (TI) SN754410 and the National Semiconductor (NS) LMD18200 were
the H-bridges considered. Table 3.2 below illustrates the comparisons made between the two
Table 3.2: H-bridge Comparison.
Maximum Current Maximum Voltage Current Sense Circuit
TI SN754410 1 Amp Up to 36 Volts No
NS LMD18200 3 Amp Up to 55 Volts Yes
The NS LMD18200 was chosen primarily because of the current sense circuit. This functionality
allows the microprocessor to turn the H-bridge off when current levels are above the maximum
levels that the motor should draw. The current levels will only exceed maximum levels during
fault a condition. Turning the H-bridge off will prevent further damage to the motor. Both H-
bridges considered are sufficient for output voltage and current constraints; however, the NS
LMD18200’s limitations provide a larger range to meet the requirements of future
3.2.5 Liquid Crystal Display (LCD)
The two LCDs we researched were the WH-1602B-GGE and the WH-1602B-NGB. Both LCDs
are the same size, price and are supplied by the manufacturer; however the WH1602B-GGE
features a green backlight. We chose the WH-1602B-GGE for ease of reading the display in both
low and high light conditions.
Both LCDs meet our size constraint. The dimensions of the LCDs are shown in Table 3.3. Along
with the cross-needle analog meter, the face of the AAC will be within the 4”x7” allowed.
Table 3.3: WH-1602B-GGE Dimensions
Item Standard Value (mm)
Module Dimension 80.0 x 36.0
Viewing Area 66.0 x 16.0
Mounting Hole 75.0 x 31.0
Character Size 2.96 x 5.56
The LCDs are capable of displaying up to thirty-two characters on two rows. This is adequate for
displaying the frequency, forward and reflected powers along with the appropriate units and
spacing as we specified in our design constraints.
3.2.6. Frequency Counting
Frequency counters are components that calculate the number of events occurring in a defined
period of time. In this case, the frequency counter measures the oscillations of radio frequencies.
Frequency counters combine data gathered from a counter, which tallies the number of
oscillations in a given time period, with an oscillator, which provides the time base as shown in
Frequency(f) = Counted Pulses / Time (sec) Hz (3)
Generally, frequency counters count how many oscillations occur during one second. Figure 3.3
is a block diagram of a digital frequency meter. Here, we can see the combination of the pulse
counter and the timer.
Figure 3.3: Block Diagram of a Digital Frequency Meter 
One method for transforming a given signal into one that can be counted by our frequency
counter is heterodyning. Heterodyning is the process of mixing two different waveforms to get
two new waveforms: the sum and difference of the two waveforms. This process is used for
demodulation, modulation, and for putting a signal in a useful frequency range. Heterodyning is
based on the trigonometric identity seen in Formula 4. The left-hand side represents the two
sinusoidal waves of different frequencies mixing, while the right-hand side shows the two
resulting waveforms; one being the difference of the two frequencies, the other being the sum .
Another way to retrieve a countable signal from the radio signal is the direct method. This
method uses two diodes to rectify the signal which allows the peaks to be much more easily
counted over the set period of time. We will be using this method to transform our signal so that it
Half wave rectification is the process of selecting either the positive or negative half of an AC
wave and blocking the unwanted half with a diode. This can be seen in Figure 3.4.
Figure 3.4: Half Wave Rectification
Full wave rectifiers can use two diodes, sometimes more, to convert the input waveform into all
positive or all negative output. This can be seen in Figure 3.5, where two diodes are used to
rectify the input wave into all positive output. We chose method in the AAC.
Figure 3.5: Two-Diode Full Wave Rectifier 
The Automated Antenna Controller uses Microchip’s PIC18F2520 microcontroller. The PIC18
has more features and capabilities than the other microcontroller, PIC16, offered by our customer
MFJ, Inc. Table 3.4 shows some of the advantages of the PIC18 processor over the PIC16
processor. One of the most noticeable advantages of the PIC18 is the onboard memory size. This
allows the programmer to be flexible when writing code for the specific microcontroller. Table
3.4 also shows more interrupt sources that are available in the PIC18 over the PIC16, and these
are valuable and very useful while programming a real time system. Another clear advantage of
the PIC18, are more than double input channels to the on board analog to digital converter. The
PIC18 will make use of many of its nice features such as the 10-bit analog to digital converter
(ADC), interrupts, timers, and Capture/Compare/PWM modules.
Table 3.4: Advantages of PIC18 vs. PIC16
Operating Program Data Interrupt Timers Capture/PWM
Frequency Memory Memory Sources Modules ADC
PIC18 40 MHz 32768 1536 19 4 2 10 input
bytes bytes channels
PIC16 20 MHz 8K 368 11 3 2 5 input
bytes bytes channels on
The ADC will be used to calculate the forward power and reflected power from the directional
coupler small signal output. The capture and compare modules will be used along with timers and
interrupts to calculate the operating frequency of the radio transceiver connected to the
Automated Antenna Controller. The operating frequency signal is generated from the directional
coupler and is passed as an input to the microcontroller as a small voltage sawtooth wave with the
same frequency as the operating frequency. The microcontroller will also use the Pulse Width
Modulation (PWM) module to control the motor that rotates the variable plate capacitor, which
changes the impedance of the antenna, thus changing the SWR.
Microchip MPlab IDE will be used to build the microcontroller project, and the Microchip C-18
C compiler will be used to compile the project code. The PicKit2 will be used to program the
microcontroller via In Circuit Serial Programming (ICSP). Debugging will be done by using the
UART tool in the PicKit2 programming application.
The following sections provide details of the software components for the AAC. The software
controls the data transfer to the LCD module, calculations for the forward power, reflected power,
SWR, as well as the motor rotating the variable capacitor inside of the loop antenna.
3.3.1 State Machine Diagram
The Figure 3.6 shows the state machine decision process the AAC will follow to meet the design
Figure 3.6: System State Diagram
3.3.2 Usage Cases
This section outlines use case diagrams for interaction between the user and the AAC. Figure 3.7
and Figure 3.8 show “sunny day” and “rainy day” usage diagrams respectively.
Figure 3.7: Ideal User Interaction
Figure 3.7 shows an ideal interaction between the user and system. First the user presses the
power on button and the user must transmit through the unit to sense all the signals coming from
the directional coupler. Secondly, the control unit will sense the forward power, reflected power,
and operating frequency. Then the control unit calculates an appropriate 3:1 or below SWR
constraint and displays these values on the LCD. The user has a choice to try minimize the SWR
by using the slow tune up/down buttons on the control unit at this point. Finally, the user decides
to tune up or tune down and presses the button. The control unit responds accordingly and change
the value of the SWR displayed on the LCD.
Figure 3.8: Non-Ideal user Interaction
Figure 3.8 shows a non-ideal interaction between the user and the system. First the user powers
on the control unit and transmits RF through the control unit. If the constraint of 3:1 SWR fails to
be met the control unit will display a message that “Can not meet acceptable range”. After
reading this message the user can decide to reset the control unit or change the operating
frequency of the radio, which may prove better results than a 3:1 SWR ratio.
3.3.3 Power Measurement
The AAC will be required to measure and display the power levels of both the forward and
reflected variety. From the representative voltages that are coming from the RF coupler, the unit
will determine the RF power being transmitted into the device. The device will also measure the
amount of power being reflected from the antenna to the device and transmitter. MFJ currently
uses a simple look-up table to determine the power values. The representative voltages are set to
read a maximum value adjusted by using potentiometers. The representative voltage of the
maximum power level is programmed to be equal the maximum value the unit can handle. Any
representative voltages between the maximum and minimum will be assigned to the equivalent
3.3.4 SWR Measurement
Through an analysis of representative voltages, the SWR can be determined using the
aforementioned equations 1 and 2. If a known voltage of 5 volts forward and 0.4 volts reflected,
the gamma value from equation 1 is 0.08. The SWR is then calculated to be 1.17 using equation
2. The representative voltages coming off the DC coupler are forward power (FWD) and
reflected power (REF). The voltages will be measured by using the integrated analog-to-digital
converter (ADC) of the microcontroller. From the voltages, the microcontroller will be
programmed to determine the reflection coefficient (Γ) by use of Equation (1). From the
reflection coefficient, the SWR will be determined by using Equation (2). The determined SWR
will be displayed on the LCD module for precise display.
3.3.5 Frequency Counting
The PIC18F2520 has two capture, compare, pulse width modulation (PWM) modules (CCPs).
Each of the modules can be used as a 16-bit capture register, a 16-bit compare register or a PWM
Master/Slave duty cycle register . We will be using the modules as capture and compare
registers to calculate the frequency.
When the first module is defined as a capture register and the second as a compare register, the
compare register can reset either the first or third timer, depending on which base time is used.
This could cause issues if the base timer for the capture register is changed by the compare
While in capture mode, the CCPRxH:CCPRxL register pair captures the TMR1 or TMR3 16-bit
register value when there is an event on the corresponding CCPx pin. An event can be every
rising edge, every falling edge, every 4th rising edge, or every 16th rising edge. One of these
events can be selected by the mode select bits. As a capture occurs, the interrupt request flag bit
(CCPxIF) is set. The software must reset this flag bit. If a new capture takes place before the old
value is read, it will be overwritten by the new value. To prevent any false captures from being
generated when the capture mode is changed, we will keep the CCPxIE interrupt enable bit clear.
We will also clear the interrupt flag bit following any changes in operating modes .
Compare mode constantly causes the 16-bit CCPRx register to be compared to the timer register
pair value. The CCPx pin is set so that it is driven high, driven low, toggled, or remains
unchanged when the two register values match. The mode select bits (CCPxM<3:0>) determine
which of these actions are taken in such an event. The interrupt flag bit is also set during this
time. The special events trigger can also be set so that the timer will be reset when an event
occurs. The TRIS Output Enable allows for data to be sent out the CCP1 and CCP2 pins.
 “PIC18F2420/2520/4420/4520 Datasheet”, 2008. Microchip Technology Inc. pg 326.
 “The Effects of VSWR on Transmitted Power”, 2006. [Online]. Available:
http://www.antennex.com/preview/vswr.htm. [Accessed] October 12, 2009.
 “VSWR Measurement”, September 9, 2009. [Online]. Available:
http://vk1od.net/transmissionline/VSWR/VSWRMeter.htm. [Accessed] September 1,
 http://www.ikalogic.com/freq_meter.php. [Online]. [Accessed] October 13, 2009.
 http://en.wikipedia.org/wiki/Heterodyne. [Online]. [Accessed] October 13, 2009.
 http://en.wikipedia.org/wiki/Rectifier. [Online]. [Accessed] October 29, 2009
m%2Fpdf-datasheets%2FDatasheets-40%2FDSA-795854.pdf. [Online]. [Accessed]
October 12, 2009.
 http://www.ece.msstate.edu/courses/ece3724/main/lectures/chap8_parport.pdf. [Online].
[Accessed] October 13, 2009.
 “SN754410 Quadruple Half-H Driver Datasheet”, 1995. Texas Instruments Inc.
 “LMD18200 3A, 55V H-Bridge Datasheet”, 1999. National Semiconductor Inc.