Automatic Magnetic Loop Tuner – Rotary Encoder

The rotary encoder is the most expensive part of the automatic magnetic loop tuner. It’s a little more expensive than the Teensy 3.2. Those of Bourns cost around 23,21 euro VAT excl. for the 64 ppr version without an incorporated push button. 64 ppr is the lowest resolution you should look for. If you go lower than 64 ppr you’ll have to turn around the encoder many times before you get to the desired stepper position for the right capacity.


Bourns EM14A0D-B28-L064N rotary encoder

You could always look for rotary encoders with a higher resolution. In the software you can define how many pulses need to pass before the stepper motor makes a micro step.
// File: ML.h
// Definitions for Rotary Encoder and Pushbuttons
#define ENC_MENURESDIVIDE 8 // Encoder resolution reduction when in Menu;
#define ENC_TUNERESDIVIDE 1 // Encoder resolution reduction when turning;

The ENC_MENURESDIVIDE variable is used to limit the scrolling speed in the menus. When using a 128 ppr encoder, use 16, with a 64 ppr encoder choose 8.
The ENC_TUNERESDIVIDE variable is used to determine the stepper motor response. When using a 128 ppr encoder use 2, with a 64 ppr encoder use 1.

This translates into the following: one full (360°) turn of the rotary encoder results in 8 menu steps or 64 micro-steps.

On AliExpress you can find 400 ppr rotary encoders for less than 10 euro. Since we know our math, we only need to changes the ENC_MENURESDIVIDE and ENC_TUNERESDIVIDE variables to respectively 50 and 6 (or 7), to use this cheaper alternative. These 400 ppr rotary encoders are a lot bigger than the 64 ppr Bourns rotary encoders. Functionally they will do just fine, but you need to take into account the extra space that the rotary encoder will occupy in your project box.


400 ppr rotary encoder bought on AliExpress

Automatic Magnetic Loop Tuner – Region 1 SSB Fieldday

CQ field day, CQ field day, this is ON5IA/P.

The proof of the pudding is in the eating, as they say, so what better way to test the Automatic Magnetic Loop Tuner than to participate in a field day?

The weather forecasts looked promising so I decided to subscribe myself for the Region 1 SSB field day of September 2017. The rules for the field day are simple: you’ll have to setup a portable station, and you can only start with the setup 24 hours before the beginning of the contest. In our case we didn’t even need that much time. One hour before the contest, we unloaded the magnetic loops and installed them. A thick plastic tube was hammered in the grass, and the magnetic loop foot was shoved into it. We attached the coax- and the stepper motor steering-cable, hooked them to the radio, attached the batteries and we were QRV. There were still 30 minutes left before the start of the contest.

After configuring the automatic magnetic loop tuner, we still had 25 minutes left HI HI.

As we wanted to test the automatic tuning capabilities of our tuner, we actually never called CQ. Fixing yourself to one frequency and calling CQ for an hour will not learn you anything with regards to the automatic tuning possibilities, of loop controller. Instead we started at the bottom of the band and scrolled up until we reached the first OM calling CQ. When the contact was made and the signal report and numbers were exchanged, we moved to the next OM. When we reached the top of the band, we scrolled down again and picked all the stations we didn’t hear the first pass.
As the time passed, band conditions changed. When we moved up and down twice, we switched band. We applied the same tactics on each band. It’s not a great contest tactic, but we did not participate in the field day to win the first price, but to test our automatic magnetic loop tuner. The tuner did a fabulous job. We only had a hiccup once, when the mechanical coupling between the stepper motor and the capacitor broke loose.

We subscribed to the 12 hours open all band category, so we were obliged to take our times off. Here again, we didn’t plan them tactically to win the contest, but to strengthen our inner man. We had a tasty BBQ and a great sleep. Next day we continued our testing. When we reached 120 contacts our pre-printed logbook was full and we called it a day. 45 minutes later, everything was packed as if the field day never took place.

When I entered the log, it became clear we were short in number of QSO’s and multipliers. We ended up on the 5th place of five…

But these were only the claimed scores!

When final results were known, we moved up two places to the 3rd place. Yeah, that’s a bronze medal.

I found it remarkable that some stations lost so may claimed QSO’s so I started to calculate the ratio between claimed and final scores.
BOOOM, gold medal for ON5IA/P!

With a correctness of 96,67% we had the best claimed/final-ratio. This can be understood in two ways: 1 we are superbe operators, or 2 our magnetic loop antennas gave us the big advantage of having less QRM and a better readability.
Let’s assume the second option 😉

This test made me conclude that the magnetic loop antenna is indeed a very good antenna if you don’t have much place to put op a big tower, or if you live in an environment with a lot of QRM. You can have as much fun as all other OM’s and you don’t even need to skip the contests. That is, if you have a solution for the biggest drawback of the magnetic loop antenna: it’s small bandwidth due to the high Q factor. And we have this solution: the automatic magnetic loop tuner!

Automatic Magnetic Loop Tuner – First QSO

On the 15th of March last year, we were ready to test our final product. The Automatic Magnetic Loop Tuner was fully assembled, programmed and connected to the antenna and transceiver. Time to turn the VFO around and see if we can make some contacts.

Imagine following situation: 15th of March 2017, 21:00 UCT, 20m band, no sunspots that day. One OM is alone in the workplace, the other OM is getting some stuff from the shack elsewhere in the house. When the second OM returns to the workplace, the first OM tells him he made a contact with K2GAV, Theodor from Connecticut, 5800 km away from their location. The signal report was 57

On top of that, the antenna setup is the one from the picture below. Inside the workplace, 1m apart from an aluminum garage door, steel beams in the roof.

Magnetic Loop And Automatic Magnetic Loop Tuner

I don’t have to explain to you the disbelieve of the second OM, who immediately grabs the mike and calls for K2GAV. K2GAV returns but the signal is getting weaker. A new contact is made, however this time with a report of 56. This antenna setup, the timing and the conditions were all but ideal, yet we managed to make a DX contact! This proves that the Magnetic Loop antenna is an ideal antenna for people with little space to put a big antenna. You don’t need to say your favorite hobby goodbye if you have to move to an apartment.

Long live the magnetic loop antenna and the Automatic Magnetic Loop Tuner!

Automatic Magnetic Loop Tuner – Assembly

The PCB is soldered, we did the metal work and the paint job on the project box. Now we are going to assemble it further and finish the Automatic Magnetic Loop Tuner. The only thing we need to do before we put the switches, screen and connectors in the project box and connect them to the PCB, is to solder the connection wires.

Afscherming swr brug

For these wires I used Dupont wires, with female connectors of 2, 3, 4 or two times 6 pins. The one with two times 6 pins does not really exist, you have to make it yourself. For this I took a rainbow color multi cable Dupont wire. Removed the single female connectors and replaced them with 6 pin Dupont connectors.

10sets-70cm-4-Pin-Female-to-Female-Jumper-Wire-Dupont-Cable-for-3d-Printer-Endstops-Main[1]

30cm-40pcs-in-Row-Dupont-Cable-30cm-2-54mm-1pin-1p-1p-Female-to-Female.jpg_640x640[1]

Use some shrink tube to make sure all connections are well insulated and will not cause a short circuit.
When done, it’s only a matter of connecting the right switch to the right header on the PCB. Check the electrical diagram to know the function of each switch.

Automatic Magnetic Loop Tuner

When everything is connected, you might want to tie together some wires to tidy things up. Your project will certainly look better and not like a rats nest of wires. Put the lid on the box, fasten the screws and your Automatic Magnetic Loop Tuner is ready to be used.

Magnetic loop tuner

Automatic Magnetic Loop Tuner – Metalwork

Now it’s time to put the soldering iron down for a while and pick up our metal working tools. Our little project needs a box to live in. Although not a real beauty, we used the same project box Loftur is using. The Hammond 1411QU.

If you have some extra cash to spend you can go and find much more professional looking boxes, laser cut and engraved. When doing this project with your club (and thus in need of several boxes), I strongly recommend considering this option. Hand Drilling, cutting and filing the project box is feasible if you only need to do it once. Making 10 of these boxes by hand can be another of your hobbies, but not mine. When ordering custom made boxes in quantities above 10, you can still get them at a reasonable price.

In our case, we did the drilling, cutting and filing with a simple drill, a dremel alike multi tool and an ordinary file.

Boren

Vijlen

Slijpen

We didn’t mind the scratches as we would paint it afterwards anyway. Another advantage of custom made, laser cut and powder coated, or ionized painted cases is that the paint job will not easily come off. Using spray paint is not an issue if you put the Automatic Magnetic Loop Controller in your shack and keep it there. I took mine already on several trips, showing it off at other ham radio clubs while presenting this magnificent project. Not that I don’t like it anymore, or that it would not perform as before, but it got its battle marks.

Automatic magnetic loop tuner enclosure.

Automatic Magnetic Loop Tuner – SWR Bridge In A RF Shielded Box

Since we are dealing with RF we have to keep it away from all other components and equipment in our shack. The only thing you want to generate or pick-up RF with is your antenna. In our case a magnetic loop antenna.

The purpose of the SWR Bridge, or tandem match, is to measure the difference between the forwarded and reflected power. To do that, we have to place the SWR Bridge between our antenna and our transceiver. Idealy this should be done as close as possible to the antenna. This however, is not very practical, as you won’t be able to read the values on the screen.

That’s why its placed inside the automatic magnetic loop controller unit and also why we need to create a shield that will keep the RF inside the SWR Bridge box.

To be able to measure the differences between forward and reflected power, we need to connect the SWR Bridge to the Teensy, pad A10 and A11. If we would just drill two holes in the tinned box and wired the SWR Bridge directly to the Teensy, the RF could still escape and cause trouble in our tuner or even in the shack. By using feed through capacitors, we can connect the SWR Bridge to the Teense and measure both forward and reflected power, while still keeping the RF in the shielded box.

Let’s zoom in on the electric diagrams, the source code and the PCB design to know how the SWR Bridge must be connected to the Automatic Magnetic Loop Controller PCB’s. This implies both Loftur as mine PCB designs.

Sontheimer Bridge. 200 W version.

From the ML.h file:
// AD inputs for Forward and Reflected Power (SWR measurement)
const int Pfwd = A10;
const int Pref = A11;

Looking at the SWR Bridge, or Sontheimer Bridge, it’s fairly easy to understand. Connect your transceiver to RF In, connect the antenna to RF Out. On the other side of the board we have FWD (pin 1), GND (pin 2) and REF (pin 3). This is the part where we need to keep attention. On the PCB the pinout position is different for GND and REF.

Connect SWR Bridge pin 1 (FWD) with pin 1 on the PCB, SWR Bridge pin 2 (GND) with pin 3 on the PCB and SWR Bridge pin 3 (REF) with pin 2 on the PCB. After our signals went through some resistors and capacitors, they can be connected via another 3 pin header to the Teensy 3.2 pads A10 and A11. Pin 1 (FWD) is connected to Teensy pad A10, and pin 2 (REF) to Teensy pad A11.

SWRBridgeBox

Automatic Magnetic Loop Tuner – SWR Bridge

While reading the frequency from the radio, and having the “antenna characteristics” in the tuner’s memory, there is no real need for a SWR bridge to be used.
However, we can add a basic power/SWR-meter and auto-tune function if we do so. For this SWR bridge, Loftur proposed to use a Tandem Match over a Bruene Bridge.

He wrote the following in his Automatic Magnetic Loop Controller BOM and building instructions:

A Tandem Match coupler may be a bit more accurate than a Bruene Bridge, however it is more difficult to achieve very good
isolation between the Forward and Reverse outputs, as this is dependent on how similar the two transformers are. On the other
hand, this is not intended to be a super-precision instrument, the below circuit is certainly as good as the average HAM grade
Power/SWR meter.

The picture here below is a partially finished kit from KitsAndParts.com with the adaptation proposed by Loftur
Swr bridge

Modifications to the kit from Kits and Parts:
20 turns wound on the two ferrite cores. This will make the meter suitable for 100W (power dissipation in R1 and R2 is 0.25W max
at 100W), should be able to handle 200W SSB without upgrading the resistors to 1/2W type.
R3 and R4 are shorted, C1 and C2 are exchanged to 4.7nF capacitors (example: Digikey 445-4746-ND) to speed up the response of
the outputs. This is necessary for fast SWR tuning. C3 and C4 are omitted.
Note the different order of the pins at the J1 connec tor, when compared with the VSWR sense connector on the Controller PCB.

Resistor values R15, R16 and R17, R18 on Controller PCB:
For a useful range of 0.5 – 200W, R15 and R16 on the Controller PCB should be 18 kohm 1/4W (example: Digikey 18KQBK-ND) and
R17, R18 should be 22 kohm 1/4W (example: Digikey 22KQBK-ND).

Due to the number of components that needed to be replaced or tossed away, and since there was some interest from other OM’s of our club, I designed a SWR Bridge kit with the correct components and sufficient copper wire for the 20 turns per toroid. Since the calibration resistors are omitted from this design, it’s important to make the toroids as equal as possible. A small deviation is not an issue. The tuner will tune to the lowest SWR point. Even if the reading is a bit off, the antenna will still be tuned to the minimum SWR.

SWR Bridge Kit
Drop me an email at on5ia@uba.be if you are interested in this SWR kit especially made for the Automatic Magnetic Loop Tuner.

Automatic Magnetic Loop Tuner – Soldering Components

When all components were delivered, it was time to put them all together. The effort I spent writing custom references for all components, at the time of ordering, was well worth it. Now each bag of components like resistors, capacitors and trimpotmeters was labeled with the correct reference name for the project (R1, R2, C1, U1, etc..).

Automatic Magnetic Loop Tuner

My two friends were armed with a soldering iron, and I was providing them the ammunition in the form of electronic components.

Automatic Magnetic Loop Tuner

Here we are soldering the 14 pin female headers for the Teensy 3.2.

Automatic Magnetic Loop Tuner

Automatic Magnetic Loop Tuner

Check twice, solder once. Each component that was soldered to the PCB was checked. We had to be sure all values were correct and within the tolerance. It might seem like a bit of overkill, but faulty components do exist. One project almost failed because of a faulty resistor. If we didn’t check it upfront, we would have lost a lot of time debugging our project.

Automatic Magnetic Loop Tuner

The finished product of the day. We made 3 of these PCB’s in 4 hours time. That’s definitely not a speed record, but when you are having fun with friends, who cares about the time.

Automatic Magnetic Loop Tuner – Bill of materials (BOM)

First thing we did on our first project meeting was having a look at the BOM. What components do we need to build this automatic magnetic loop tuner, and are they easy to find.

It seemed Loftur did a great job listing all the parts and most of them could be ordered at DigiKey, Mouser or eBay. It would be only later in this project I found out huge savings could be done if some parts were ordered at AliExpress.

I was soon appointed as logistics manager and started sourcing and ordering all the needed parts.

Following parts are worth to spend a few words on:

LCD screen
Display
If there is only one item of this project you should buy on AliExpress, it’s this 20x4A LCD display. Using the search function you can easily find this screen for less than $3. For Europeans it can be even more advantageous when the exchange rate of the dollar is low. You can pick the one without the IIC/I2C Serial Interface Adapter Module as for this project you won’t need it.

Stepper motor
Stepper motor
My advice is to buy the motor only when you know what type of capacitor you’ll use for your magnetic loop antenna. For a air variable capacitor you might need extra resolution, for a vacuum variable capacitor you might need extra torque. Both can be achieved by using a stepper motor with a reduction gear. However, be careful with to much torque, you might end up damaging your vacuum capacitor if your end stop settings are not set correctly.

Stepper motor driver chip / module
Here you have several options. Option one is Allegro , since it is this ic that Loftur’s used in his electrical diagram and PCB design. However, there are two other options to make the stepper motor do it’s magical micro-stepping. The A4988 and the DRV8825. Loftur wrote the code in such a way it can be easily modified to take into account the type of ic or stepper module you are using. You only need to comment and uncomment some lines of code and recompile.

Screen bezel
If you want your automatic magnetic loop tuner to be a nice looking piece of equipment, this screen bezel is a must. Strangely enough, there seems to be only one manufacturer in the world who can provide these little simple, plastic and lexan, screen bezels. At 3,5 dollar each, they are not expensive, but the shipping costs will make you think twice. On top of that, it’s coming from the USA, which is a huge red flag for the Belgian Customs, who are very keen in making sure you pay your import duties. At the end, more than 50% of the total cost is tax. Not only because of the 21% VAT, but especially due to the forfait of 12 euro for “handling cost”.

PBC by Loftur
Automatic magnetic loop tuner PCB.
As none of the three of us wanted to etch the schematics on a copper prototype board, we just ordered the 5 first controller PCB via Loftur.

SWR bridge
SWR Bridge Kit
In the beginning, you want to be sure, that what you are making will work. So to play on the safe side, you copy what others have been done before. To incorporate the SWR auto tune function into the automatic magnetic loop controller, Loftur proposed to use a SWR Bridge kit from KitsAndParts.com and make some adjustments to it. So that’s what we did for the first automatic magnetic loop controllers. Later I made my own PCB’s based on the Sontheimer Bridge design. You can read that story here.

Rotary encoder

We all know rotary encoders and we love them. It’s the big round knob on our radio we like to spin around to scroll over the band to spot that new DX or SOTA. For the magnetic loop controller you can’t just use any encoder. It has to be an encoder that has sufficient resolution to be usable for this project. In some configurations each encoder pulse is equal to a 1/8 step, so if your capacitor needs to be adjusted a few steps, you’ll have to turn the knob several times around if it has not enough pulses per rotation. We are using an encoder with 64ppr, Loftur is using a 128 encoder in his automatic magnetic loop controller. Cheaper 400 ppr alternatives can be found on AliExpress, but you have to taken into account the much bigger size. More detailed info here: Rotary Encoder.

Teensy 3.2
Teensy 3.2
This little arduino compatible device is the hart of the automatic magnetic loop controller. It is where the processing power and memory storage is coming from. They cost about the same as the rotary encoders. If you are lucky you can find cheaper compatible devices on AliExpress, but then you are not sure if they will work. As a matter of experiment, I bought two and they seem to be doing the job fine. You can save a few euro if you buy the Teensy version without the pins already attached. Soldering 28 pins can be done in two minutes, and since we are soldering anyway, why wouldn’t we do this ourselves?

Previous Chapter: Automatic Magnetic Loop Tuner – The Beginning
Next Chapter: Automatic Magnetic Loop Tuner – Soldering Components