MagLoop Auto-Tuner

Automatic Tuner for Magnetic Loop Antennas

Public Chat
Similar projects worth following
Magnetic Loop Antennas are cool for size constraints, but suffer from low bandwidth. An automatic tuner could solve that problem by re-tuning the antenna whenever the frequency is changed on the radio.

MagLoop Tuner does exactly that, by having a set of calibrated values and estimating the variable capacitor position for each frequency change.

It can be either directly connected to a radio by CAT or controlled by a PC.

It is designed to be built with off the shelf components and just a bit of soldering.

Current status: experimenting with firmware.


The build

The build consists of an Arduino Uno, a proto shield, a TMC2130 and a Stepper motor. The rest are wires, connectors and case.

TMC2130 stepper driver supports Stall detection.

Alternative, more advanced stepper drivers: TMC2209 or TMC2226.

General overview

Arduino is connected to either the Radio via CAT, or computer controlled (probably will come up with a ESP8261 setup to control via network). The arduino firmware constantly checks the current frequency and if it changes, will estimate the stepper position for best SWR. No relays are involved, so there is no gaps in receive or transmit.

Operating principle

When Arduino is first connected, it will give the Stepper a command to home - to find the zero position, by rotation CCW until a stall is detected. This will be position zero. 

For calibration, operator will use a computer (at least in the first versions) to enter a position, and measure with a SWR meter, until the perfect position is found for the beginning of the band, and then for the end of the band. These values will be hardcoded in the arduino firmware.

After calibration is done, a different firmware will be written, with the hardcoded positions for each band. When operating, connected to a Radio via CAT, arduino firmware will read the current frequency, will look it up in the saved values and then will estimate the required stepper position, by a linear estimation. ex:

  • current freq: 7.060 MHz
  • hard coded values: 
    • @ 7.000 MHz stepper = 3180
    • @ 7.200 MHz steppe r= 3600
  • calculated position = 3180 + (3600-3180)/200*60 = 3306

Linear approximation proved incorrect with my antenna, but the error is acceptable for current setup. Will have to gather more data points to figure out an approximate function that yields more accurate results.

Planned final version

Final version will be a single fimware where the calibration can be done by connecting a radio via CAT and a SWR meter, and no computer. By stepping in increments.

Outstanding questions and problems

  • Perfect homing - currently achieved 70% success rate, and 30% off frequency but only 1 Stepper full step. For my antenna, at 7MHz, that is +/- 7khz, and abt .25 SWR

  • 1 × Arduino Uno
  • 1 × TMC2130 Stepper driver. It comes in many flavors, chose one that doesn't have headers pins on top if you want to use my enclosure
  • 1 × Arduino Proto Shield The type of proto shield you can see in the photos. Preferably without the top header pins soldered
  • 1 × Nema 17 stepper motor, model 17HS4023 Any model will work, but you'll have to adjust STALL_VALUE in code
  • 2 × 3.5 audio jack with 4 poles If you want to use my enclosure, make sure they have a smaller diameter then 8.5mm and can be screwed. I ordered these ones:

View all 6 components

  • Coding..

    Radu Pascal02/19/2022 at 16:35 0 comments

    Decided to post an update on the project. It's still alive. It's still in progress.

    So I decided to park "homing" problems until I have an overall functional setup. But, I am trying to figure out the code. I really wanna take that setup for a SOTA.

    If anyone wants to have a look of the code in progress, the github repo is here:

    The overall principle of operation:

    • if you start the board with "the button" pressed, it goes into calibration. 
    • the stepper will go from 0 to 3 rotations, in 50 micro steps increments
    • whenever you short press, it moves 
    • you have to have a meter connected to the antenna, and the tuner to the radio. if the antenna is calibrated for a frequency of interest, you enter the frequency with lowest SWR on the radio, and 1sec press the button, to save that as datapoint, the stepper moves to next position
    • if you're done with calibration values for the band, long press (2sec) to save the calibration values to EEPROM, stepper will reset to 0, and you can calibrate for another band
    • if you're done, press reset button
    • if not in calibration mode, it will read calibration data points, and try to find data points for the given frequency

    more or less... work in progress.

  • Sunday thoughts

    Radu Pascal02/13/2022 at 08:22 0 comments

    I gathered more data points, and there is something I can't explain on 7MHz band on my MagLoop. Incrementing in fixed steps, does not provide a linear increase in the tuned frequency (as I mentioned in a number of places). But it doesn't behave like an exponential function as I initially thought. It's more as if it has a dip at a certain point(s):

    From 6.770MHz to 7MHz, the increase is linear. I didn't bother to measure the upper side.

    I gathered data points for 14MHz:

    Surprise surprise, this one seems to have a linear response. Also it has a wider frequency change, for the same steps (compared to the 7MHz band). Note: my MagLoop requires plugging a capacitor for 7MHz band, and unplugging it for 14MHz.


    I don't see how I can find a function for that. Will keep linear estimation, but probably will store multiple data point as part of calibration. That should give a good enough result.

    The measurements were done with RigExpert AA-55. It should be fairly accurate, at least I trust it 100 times more than the nanoVNA.

    Also a sneak peak at the enclosure (it's not perfect, but it works, so I'll consider that final):

  • Almost usable

    Radu Pascal02/12/2022 at 09:22 0 comments

    After making a few tweaks to the firmware, this morning, I managed to get 70% success rate at homing. And even the 30% was only 1 full step (stepper) error. That translated in spot on 70%, and about ~7KHz off tuning for the rest 30%. (after 20 iterations)

    Now I'm convinced that I have a homing issue that I need to investigate further. I'm pretty certain that's an artefact of how steppers work. The error is always 1 full step, and I managed to deduce that by confirming that my RigExpert AA-55 was reporting either lowest SWR on 7.000 or ~6.993KHz. That 7KHz difference is exactly 16 micro steps, or 1 full step in my current setup. I am guessing that the motor lands either on the right side or left side of the step after homing, as there is some flexibility in the mount.

    Can that be fixed? I'm not sure at the moment. The 3d printers don't have that problem as they don't care finding the absolute repeatable 0 (well.. except in some conditions), they just need a common reference for a printing session.

    Another source of error is the play in the variable capacitor. I did manage to measure it as being a fixed (at least for 7MHz band). If I move CW and then back to the same position CCW, there is a 4KHz offset. This can be calibrated an compensated in the firmware (in some future iteration).

    Finally, about the linear estimation. Here is a graphic of estimated position, vs best measured position in steps of 50. I need to repeat in smaller steps and wider band, to get enough steps to figure out what function to apply to get better position estimation.

  • Changing the approach

    Radu Pascal02/08/2022 at 10:25 0 comments

    A few weeks ago I realised that there might be an easier way then to have a antenna analyzer circuit. What if the antenna, for a frequency, is always tuned in the same position of the variable capacitor?

    Playing with my magloop yielded exactly that result. Even by changing slightly the geometry, it would still be tuned in the same position of the variable capacitor.

    That simplifies the problem greatly. You can pre-record best stepper position for a few frequencies in a band, and then derive all intermediary positions.

    PoC done, and now I'm making the build which I'll publish, with steps, when I'm done.

View all 4 project logs

  • 1
    Break-out board

    Things you'll need in this step:

    • Soldering station (and accessories for soldering)
    • Break-out board
    • a big capacitor for VCC for the stepper driver
    • some wire
    • 2 female header pins 8x1
    1. Solder the female header pins on the breakout board, so that you can easily swap stepper drivers. Tip: put the stepper driver in the pins, and then turn over the break-out board so that it rests on the stepper driver.
    2. Assuming you're using the TMC2130, solder jumper wires, underneath the break out board, so that you'll connect the stepper driver to arduino pins:
      1. GND -> GND
      2. VIO -> 5V
      3. GND -> GND
      4. VIN -> Vin
      5. Dir -> D9
      6. Step -> D8
      7. SDO -> D12
      8. CS -> D10
      9. SCK -> D13
      10. SDI -> D11
      11. En -> D7

View all instructions

Enjoy this project?



crun wrote 02/13/2022 at 03:35 point

My magloop is very prone to detuning by slight mechanical changes.  

Perhaps an approach is to use deltas , so you can have a fine tune control, then when you change F, it does a delta not an absolute position change, so the new frequency is also in tune.

  Are you sure? yes | no

Radu Pascal wrote 02/13/2022 at 07:35 point

that's something I do intend on implementing. but I'm curious of what magloop you have?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates