Automatic Magnetic Loop Tuner – Arduino 1.8.11 & Teensyduino 1.50

I just installed the latest version of Arduino: 1.8.11 and Teensyduino 1.50.

When compiling the latest version ML_v409 I got the the following error:

ML_v409:1287: error: 'class ADC' has no member named 'setSamplingSpeed'
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED); // Sampling speed, ADC_VERY_LOW_SPEED, ADC_LOW_SPEED, ADC_MED_SPEED, ADC_HIGH_SPEED or ADC_VERY_HIGH_SPEED

Apparently something changed in the ADC.h library so we need to change the following code:

// Set up the two separate ADCs for synchronous read at 12 bit resolution and lowest possible measurement speed (minimal noise)

adc->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED, ADC_1);
adc->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
adc->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED, ADC_1);
adc->setResolution(12);
adc->setResolution(12, ADC_1);
adc->setAveraging(16);
adc->setAveraging(16, ADC_1);

  to this:

 // Set up the two separate ADCs for synchronous read at 12 bit resolution and lowest possible measurement speed (minimal noise)
adc->adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
adc->adc1->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
adc->adc0->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
adc->adc1->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
adc->adc0->setResolution(12);
adc->adc1->setResolution(12);
adc->adc0->setAveraging(16);
adc->adc1->setAveraging(16);

Then recompile again and you are good to go!
This info was also already shared in the LoopController group on Groups.io

73 de ON5IA
Frederik

Automatic Magnetic Loop Tuner – New Firmware Available

Loftur TF3LJ/VE2LJX released a new firmware version for the Automatic Magnetic Loop Tuner. You can find it at the bottom of his web page: https://sites.google.com/site/lofturj/to-automatically-tune-a-magnetic-loop-antenna

Firmware version 4.09 fixes stepper motor hiccups that might occur when you move the stepper motor a lot at high speed forward or backwards.

The PCB’s I designed earlier for the DRV8825 or A4988 stepper motor drivers are compatible with this new firmware. I recommend upgrading to this new version if you are using one of mine PCB designs. In the rare case where you would encounter issues, you can always revert back to firmware version 4.08.

Automatic Magnetic Loop Tuner – Smaller Enclosure Finished

When our first batch of automatic magnetic loop tuners was finished, I started looking for another enclosure. One that was sturdier, better looking and cheaper. I ended up looking on AliExpress and found this aluminium box. After some measuring, drilling and filing I test fitted the components.

I quickly understood this enclosure would be a very tight fit. Using the bulkier rotary encoder together with the larger tin box for the SWR bridge was not possible. In parallel, we started working on our second batch of automatic magnetic loop tuners, and I needed the buttons and screen bezel to finish another tuner. Having no spare screen bezel any more and in need of extra internal space, I ditched the screen bezel idea and let the LCD come out of the enclosure. It wasn’t even looking that bad.

Automatic Magnetic Loop Controller

Yet, the little extra space I gained on the inside of the enclosure was still not enough to fit the SWR bridge in it’s RF shielded tin box. I had to go and find a smaller box, which I did on a local ham fair.

SWR Bridge
SWR Bridge in small enclosure

The SO-239 connectors were also replaced by SMA connectors. These are also a lot easier to mount as you only need to drill one round hole.

SWR Bridge

When I made the A4988/DRV8825 version of the automatic magnetic loop tuner PCB, I made it exactly 100mm wide. This way it fits nicely in the PCB slot in the aluminium box. When the PCB is positioned completely to the left against the tin box of the SWR bridge, there is plenty of room for the rotary encoder on the right. The rotary encoder is positioned between the power button and the fuse and serial connector.

Automatic Magnetic Loop Tuner

When the box is closed and the power is switched on it looks very nice πŸ˜‰

Automatic Magnetic Loop Tuner

The knob on the rotary encoder is a full aluminium knob which you can find here on AliExpress.

Automatic Magnetic Loop Tuner – IC-7300 setup

The Automatic Magnetic Loop Tuner can be used with a variety of transceivers, from the most common brands like Yaesu, Elecraft, Kenwood and of course Icom.

I recently acquired an IC-7300 and since many ham’s love and own this radio, I’ll quickly show you what settings you need to enter to make it “talk” with the Automatic Magnetic Loop Tuner.

First, we do the setup on the IC-7300. On the transceiver, push the menu button. Next press the “SET” button on the touchscreen.

Select “Connectors” and “CI-V” in the two following screens.

In the CI-V menu, following options must be set accordingly:

  • CI-V Baude Rate: 19200
  • CI-V Address: 94h 
  • CI-V Transceive: OFF
  • CI-V USB->REMOTE Transceive Address: 94h
  • CI-V Output (for ANT): OFF
  • CI-V USB Port: Unlink from [REMOTE]
  • CI-V USB Baud Rate: 19200
  • CI-V USB Echo Back: ON

Now we switch to the Automatic Magnetic Loop Tuner and press the Menu / Enact button for more than 1 second. Select the “Radio Type” menu item.

Choose for ICOM CI-V Poll in the Transceiver Type menu.

The value will be saved in the memory and you’ll return back to the Config Menu. Now select “ICOM CI-V Addr” and set the value to 94.

Next, we set the Serial Port Signals to TTL and the Serial Data Rate to 19200 b/s.

Exit, the menu, and if everything went well, now your Automatic Magnetic loop tuner follows the VFO of your IC-7300, and you can use the auto-tune function to set the radio in transmit mode and let the tuner hunt for an acceptable SWR.

Automatic Magnetic Loop Tuner – Smaller Enclosure Green Display

I was trying to fit the automatic magnetic loop tuner into a smaller enclosure. It was only a partial success.

Automatic Magnetic Loop Controller

There is plenty of space for the display and buttons on the front, but I have to choose between the SWR bridge or the rotary encoder. This, however, is not an option. They both need to be present in the automatic magnetic loop tuner. So the only possibility I see for the moment is to look for a smaller box to accommodate the SWR bridge. If I can’t find a smaller box for the SWR bridge, I’ll probably have to stick with the larger Hammond enclosures.

I also used a green display instead of the blue ones I usually use. What’s your favourite colour?

How Are PCB’s Made?

There are about 10 working days between finishing the PCB design in Eagle and the reception of the finished product at my doorstep. I have always wondered how the Sontheimer bridge PCB and the A4988 PCB were manufactured.

Scotty Allen from Strange Parts went on a factory tour and made a pretty extensive video about the production process of a PCB. If you have 26 minutes of time, check out his youtube video below. (If you have less time you can fast forward some parts πŸ˜‰ )

Automatic Magnetic Loop Tuner – Another Soldering Session

I took some time to solder another PCB for an Automatic Magnetic Loop Tuner. I made some pictures of the final result which I would like to share with you.

This is a view from the top of a populated PCB. The Teensy 3.2 and the A4988 stepper module are not yet installed. This loop controller won’t need the end stop feature. Therefor D2, D3, R25, R26, C19, C20, C21, C22, T3 and the 3 pin header for the end stop connector, are not installed.

C1 is located underneath the Teensy 3.2. This capacitor can be soldered upright. There is plenty of space, so no need to lay it flat on the board.

Populated PCB for Automatic Magnetic Loop Tuner

Here we have both the Teensy 3.2 and the A4988 stepper module installed. Note that a jumper is placed over JP1, but that JP2 is left open. JP1 connects “Sleep” and “Reset”. JP2 is for future use. When using a DRV8825 stepper module it gives us the possibility to connect the unused Teensy 3.2 pin 19 with pin MS3 of the DRV8825. With some additional programming to the software, this could enable the 1/32 step stepper resolution. This however has not yet been programmer, nor tested.

Populated PCB for Automatic Magnetic Loop Tuner

If there is one thing I would change to this board it’s the re-positioning of the LM7805 voltage regulator. The ground plane in facing inward which makes it difficult to attach a heat-sink. This can be solved easily by bending the legs of the LM7805 so the ground will face upwards, or by connecting it from the underside of the PCB and connecting the ground to the metal enclosure the whole PCB will be put in.

Populated PCB for Automatic Magnetic Loop Tuner

On this last picture, you can see capacitor C1 has plenty of space and is enjoying the company and security of the Teensy 3.2 πŸ˜‰

Populated PCB for Automatic Magnetic Loop Tuner

Automatic Magnetic Loop Tuner – Printed Circuit Board (PCB)

Using the original schematic as a starting point, I reworked the electrical diagram and incorporated an A4988/DRV8825 module.

You can download a pdf file of the reworked schematic here: MagLoopTuner.pdf

Automatic magnetic loop controller PCB

The two jumpers in the schematic deserve a little explanation:
JP1 connects the sleep and reset pins of the A4988/DRV8825 module board. I’ve seen schematics where these pins are soldered together, but I preferred to use a jumper. This way you have the possibility to add a reset switch, or if you think it’s not needed, just bridge the two contacts.
JP2 was incorporated for future use. It connects the unused pin 19 of the Teensy 3.2 with pin MS3 of the A4988/DRV8825 module. Without this connection, the maximum resolution of the magnetic loop controller is a 1/8th step. With some extra coding, we could drive the stepper motor as precise as 1/16th step (with the A4988) or even 1/32th step (with the DRV8825). This coding is not yet done, and I’m also not sure if this fine stepping is useful for this project, but I thought it was a nice idea to experiment with it. So for now, you can leave JP2 open.

If you are not using end-stop switches, then there is no need for D2, D3, R25, R26, C19, C20, C21, C22 and T3.

Depending on the type or brand of the rotary encoder, the A or B phase can be reversed. However, VCC and G must always be respected. You can check the correct wiring of A and B when you scroll through the menu. Turning the rotary encoder clockwise must increase the menu option, the steps and the frequency. When this is correctly done, you can start checking the wiring of the stepper motor. In order for the backlash and auto-tune function to work correctly, the capacity must go down when you turn the rotary encoder clockwise.

Don’t need the SWR / power meter function? Then you don’t need R15, R16, R17, R18, C25, C26 and R20, R21 and R22 (and their corresponding switches) either.

Please check Loftur’s project page for a more detailed explanation, the BOM and building instructions: https://sites.google.com/site/lofturj/to-automatically-tune-a-magnetic-loop-antenna

For any inquiries or questions about the PCB, please send an email to on5ia@uba.be. Add my email address in your contacts to prevent my response email from landing in your spam folder.