BXF Azimuth Rotator Controller

 

FrontPanel

I decided to build a new rotator controller to replace my Yaesu G400RC controller (but my design was made to work with virtually any rotator) to give me additional futures beyond the sole analogue position feedback of the G-400RC. I wanted the new design to be digital, have integrated PC control, hands off operation (pick your direction and then sit back) and have different modes of operation depending upon current operation style.  I had previously built a rotator PC interface but not a full blown rotator controller, however my original code covered most of what I wanted to do except the LCD hardware and user inputs.  This is a development in progress, since making it I’ve found I use the rotator controller differently to how I envisaged but I’ll cover that at the end.

2011-09-05 23.54.46

I built the rotator controller around the PICAXE-20X2 chip which is far the best chip in Revolution Educations range and can be used in almost any design.  It supports almost all PICAXE BASIC commands and has 16 hardware inputs/outputs, it also has loads of registers and code space.  After using the PICAXE-20X2 chip on other projects I got my head round some of the advanced commands and my own limitations from when I done my original rotator PC interface on the PICAXE-28X1 chip.

My original premise was to split the rotator controller into modes, mainly to test how I would use each one and after using it I redesigned the code to make it an all in one but the modes were:

  • Manual; standard control were the buttons change direction LEFT or RIGHT.

2011-08-14 13.38.03

  • Fast; this is like manual but the LEFT and RIGHT buttons move the desired heading faster than the physical rate of rotation and the antenna catches up.

2011-08-14 13.38.09

  • Preset; uses a dial (potentiometer) on the front panel to set a desired heading and the antennas track to that heading.

2011-08-14 13.37.50

  • PC Control, heading feedback to the PC works on all modes but setting the heading only works in Manual mode.  PC control also supports L for LEFT, R for RIGHT and S for STOP – this can be used also to interface to additional non PC [other BXF project] controllers.

2011-09-05 22.55.20

The PC protocol is based on Yaesu GS-232 and I’ve included support for AZ only (GS-232A) or AZ+EL (GS-232B), in the GS-232B all EL commands are ignored or answered with 0 degrees.

After deciding what I wanted from the new code I set about looking for a suitable rotator controller, or box, to house it into which I found in Friedricshafen in the guise of a KR-400 control box for EUR 30.  It had a nice big south stop analogue meter in it but that didn’t worry me as I planned to use a 4×20 LCD (which I had bought off eBay).  I cheated slightly by using a Wulfgang K107 LCD interface board (tech doc .pdf) to drive the LCD, this was for 2 reasons;

    1. It allows me to use serial to update the LCD instead of connecting all the parallel pins to the PIC so simplified the design, and
    2. The K107 LCD interface supports large character mode (as seen in the pictures) so allows me to use the full height of the LCD better (easier).

The final code doesn’t have modes but instead allows any input to move the rotator, I did drop the FAST mode as it was redundant and I didn’t use it much.  The use now is you press LEFT or RIGHT to move in the desired direction, spin the preset to take you to the preset direction or press PARK* to take you to a pre-defined heading.  Pressing LEFT, RIGHT or PARK at any point cancels the current movement and start the new one, so if I set the preset to 200 degrees and pressed PARK (which say was set to 120 degrees) then the rotator would cancel heading to 200 degrees and head to 120 degrees.  The same is for the PC input, any PC input to goto a direction would override any current movement and head to the new heading set by the PC input. The PC can read the antenna direction at any time which does not effect the antenna movement.

* At present there is only one input used as a predefined heading, which I call PARK and have set to 120 degree, Europe from my QTH.  The PICAXE-20X2 has 5 additional spare inputs in this project so it’s more than capable of having extra switches attached to these inputs and assigning them to additional presets in the code.

Outside The Case

There was not much modification required to the KR-400 box.  I added an extra button on the front for PARK, originally for changing mode and on the back a 9-way D-type connector which I use for my rotator wiring as it’s much easier to disconnect, also all my other rotators use the same plug so they are all interchangeable. I also added a USB-B port on the back for PC interfacing, internally this goes to a USB<>Serial interface.  Inside is where the main changes are.

RearPanel

CIMG7627

Inside The Case

The original circuit and meter in the box was of little use so the first thing I done was to remove both.  I left the transformer in along with the capacitor over the motor outputs which was also original, after that it was a new PCB with all the required circuitry and that was about it!

2011-07-10 21.04.32 2011-07-16 14.31.56 2011-07-16 15.40.32

2011-07-15 22.24.44  2011-07-15 18.01.56

Calibration

The rotator controller needs calibrated.  This is done in a simple way by either powering on the rotator controller holding the PARK button or if the MINOffset or DirCorrect EEPROM values are 0 (no values stored in EEPROM would be the case after programming). When in calibration mode the user is presented with step by step text based commands on the LCD to follow for calibration.  You only need to do the calibration once after which MINOffset and DirCorrect values are stored on EEPROM and recalled on each power up.

The steps for calibration require the rotator to be moved fully LEFT (CCW) to 0 degrees (north) so the feedback pot in the bell housing reports its minimum value (MINOffset).

2011-09-05 21.41.52

Pressing the PARK button saves this ADC value in EEPROM (MINOffset) which is then subtracted from ADC reads in the main code.

2011-09-05 21.43.12

We then go RIGHT to 360 degrees (north) and save this ADC value (DirCorrect) which is used for the correction factor.

2011-09-05 21.45.18

The ADC value is again saved in EEPROM when the PARK button is pressed.

2011-09-05 21.45.48

Let me explain using my values.  On my rotator 0 degrees (north) returns an ADC value of 22, this ADC value is subtracted from all other ADC reads in the code, the reason is 22 is 0 degrees so an ADC value of 32 would be 10 degrees (it’s not quite that linear but you get the idea).  We then goto 360 degree (north) which in my case is ADC 953.  ADC 953 is actually not yet right as we need to subtract the MINOffset value for the correct ADC for 0 to 360, we then need to convert to a correction factor.

To get the most accurate heading I sample the ADC value in the code 64 times.  I use 64 [times] as this then fills a 16 bit register when sampling the ADC at 10 bits without the chance of it overflowing.  The maximum ADC value at 10 bits is 1024 so 1024 * 64 = 65636.

As my max ADC value is 953 (remember my minimum value of 22) I need to subtracted this off so the real ADC value is 953 – MINOffset or 931.  It’s the value of 931 which is loaded into the register 64 times meaning the register value is stored as 931 * 64 = 59584.  I then divide this by 360 to get the correction factor. 59584/360 = 165.5.  In PIC code we can only divide by full numbers so I take into account if the decimal is greater than 0.5 and if so I add a number to the correction factor to make it closer to the real value, if my result was 165.4 I would then use 165 but as it is 165.5 I instead use 166.

This means if I have an ADC value from the rotator of 546, I first subtract 22 (MINOffset) from it, leaving me with 524 which is sampled 64 times giving a register value of 33536 (in reality the ADC value of 546 could vary slightly on each of the 64 reads, one of the reason we average so many).  I then divide 33536 by 166 (DirCorrect) and I get a heading of 202 degrees.

Did you follow?

Schematic

Download the schematic (uses ExpressSCH)

BXF_AZ_Rotator_Controller_v0.1

Pictures

CIMG7627 CIMG7624 2011-07-16 15.37.06

Code

Download the code

Old Design (PICAXE-28X1)

A long time back I decided I wanted PC control of my antennas, mainly for point and shoot, click on a heading in some PC software and start CQ’ing so that I wouldn’t have to think both about calling and antenna direction.  For this I ordered an LVB Tracker from AMSAT UK but before it arrived I thought I’d have a go at making one myself using PICAXE, it worked but it was crude!

I have a Yaesu G-400RC rotator which is the one with a round controller for the display and uses a comparator circuit to ‘match’ the heading of the controller display with that of the rotator itself, the problem is the comparator swings from –15v to +15v and is non-linear.  This meant interfacing to a PIC chip was possible (using an opamp) but as the voltage was non-linear it would not work so well.

My first attempt was using a PICAXE-28X1 chip which as good as a design it was I didn’t know PICAXE programming as much back then so didn’t fully utilise the chip, or code.  Instead of using the hardware serial (hserin) inputs, which allows serial reception in the background while the code executes, I used the normal ones and had to set a serial buffer timeout which would expire if no serial data was received, during this time all the code execution stopped.  Also due to my lack of familiarity of PICAXE code back then the code wasn’t really optimised, an example was lack of subroutines (Gosub) meaning there was lots of code repeated.  There was no calibration routine so working out the actual heading was left to the user to calculate and enter the correction values, for the ADC value, direct into the code. I’ve not reproduced the code here as it’s in my mind redundant and outdated.  But some of it was salvaged for this project.  What I did end up doing though was to take some of the ideas and features from this code and turned it into my LVB Extender design, an add-on for the LVB Tracker, which could send serial commands to the LVB Tracker giving added extra features and automation to rotator system without the need for a PC.

16 Comments

  1. Don Elvin

    Gav
    The link to the v2.0 code above seems to be broken. Am very interested in building your controller for the g-400 rotator.
    Regards
    Don G0INO

    Reply
    1. m1bxf (Post author)

      Hi Don,

      Thanks for the mail, the link in the comment at the bottom was indeed broken, however it was pointing at the same file as the link in the “Download the code” in the article. I’ve fixed it anyhow as it’s not right to have broken links for any reason.

      I hope you have success in building it.

      Gavin, M1BXF.

      Reply
  2. Slavek (OK2SLC)

    Thank you very much for sharing your know-how, especially perfectly annotated source code. Otherwise, I think that R7-R9 must pull down resistors (connected between GND and pin).

    Slavek, OK2SLC

    Reply
    1. m1bxf (Post author)

      Hello Slavek,

      Thanks for the comments. R7-9 are pull-up (to 5v) as the switches are connected to Ground when pressed.

      Reply
      1. Slavek (OK2SLC)

        Hallo Gav,
        hmm, but me it working only with pull down resistors (the switches are connected to +5V when pressed) because after power ON logical state H starting non-stop calibration proces. I have something wrong?

        Slavek, OK2SLC

        Reply
        1. Slavek (OK2SLC)

          appendix,
          For me this controller working only when at inputs are logical levels L (no pressed push-button – NC).

          (sorry, my English is not good 🙂

          Slavek, OK2SLC

          Reply
  3. Paul KK6BY

    I just want to say thanks for sharing your design. This is really in the spirit of ham radio. I plan on giving your circuit a shot since I have most of the part already and the same rotor.

    Thanks for sharing!!!

    Paul, KK6BY

    Reply
    1. m1bxf (Post author)

      Paul,

      Thanks for the kind words in support of my project(s). I’m right into the spirit of sharing within the hobbie and community and seeping people using, copying, modifying my projects, which is essential just my ideas on paper, is very satisfying.

      Let me know how you get on…

      Reply
  4. Stewart GM4AFF

    Hi Gavin,
    Thanks for the tweet. This is very nice. I’m afraid I’ve bought all the rotators I’m going to buy, and have to live with what I’ve got! Retro-fitting new controllers to the existing rotators is always an option (like the Green Heron concept). Thankfully yours would be a lot cheaper than Green Heron!
    Personally I don’t like digital rotator indicators (esp the 2051!). I like a circle with compass headings and a map on the background. A left and right button and a preset is also all I need. At 0500 on Sunday in CQ WW my brain simply can’t cope with anything more complicated than a picture, which is what a circle and pointer is really.
    73
    Stewart GM4AFF

    Reply
    1. m1bxf (Post author)

      Hi Stewart! Thanks for the comment. I have the original G400-RC controller still but don’t want to get rid of that. Making a controller box with say just a meter is simple enough, the RC type a little harder but fully agree with your take of being able to understand it at 4am in a contest 🙂

      Reply
  5. Jason (KD0MND

    I recently discovered picaxe, and I was wondering if I could use one to build a rotor interface since I can’t really afford to buy one. A quick Google search led me here. WOW that’s beautiful! Thank you so much for sharing this!

    Reply
    1. m1bxf (Post author)

      Hi Jason.

      Glad you like it. I’ve done some updates (added FAST and BREAK) and I’ll post the updated files soon. I’m also planning some PCBs as the interest so far has been high 🙂

      Reply
      1. Jason (KD0MND)

        Glad to hear it. I’ll buy one! I sent you a feedback message (a rather long-winded one, I might add) and I hope you have time to read it. I think this might be just what I need!

        Reply
        1. Jason (KD0MND)

          I ordered the LCD display yesterday. Got the LCD and the K107 control board as a bundle from wulfden. I’m going to build it into an old Hy-Gain rotor control box that I found in a scrap pile.

          Reply
  6. mike

    Hi Gavin – a few questions and possible amendments.
    A lot of us on VHF Don’t park our antennas at 0 or 180 deg so an amendment to suit would be nice -my zero is at 270 deg
    A lot of new rotators allow an overlap – again handy for VHF but not so at HF – hence a second change to allow greater than 360 – I get 410 deg out of mine (others can get 540) again its only down to the calc relationship to the display readings and taht can be based on a range of dac readings from the pot. ie dac < overlap (disp =sub 360) If result -ve add 360 to disp.

    Let me know if I can see the code – its a long time since i programmed but id like to help.

    Next as i use Az/el would it be possible to switch the display between 2 pics to show the readings of both and also control both from one rs232 – not sure if my electronics is u to understanding that

    Thanks again for a brilliant design and such a simple interface.

    Mike

    Reply
    1. m1bxf (Post author)

      Hi Mike,

      Thanks for your comment.
      – I did consider this but just wanted to get something done for the masses 🙂 I’ll look at how to add this offset into the code, it won’t be hard – will probably have a 0-360 which the code works with then a user ‘offset’ value for the display.
      – The overlap could be achieved in the calibration routine, where part of it is you set the max angle you want to point to and it saves that too.
      – Doing AZ and EL is again easy and we can reduce the character size on the display to show both, at that point it’s almost worth just going to a 20×2 LCD where line 1 is AZ and line 2 EL but this makes the characters smaller.
      – I have an AZ and EL controller I made after this one but I don’t integrate and LCD into as my circumstance didn’t require it but the code from this project can be easily added.

      Ok so a few nice updates needed… The code is available here: http://www.geekshed.co.uk/projectfiles/m1bxf_az_rotator_controller/code/BXF_Rotator_Interface_v2.0_010911.txt , you’ll need the PICAXE Programming Editor from here also: http://www.picaxe.com/Software/PICAXE/PICAXE-Programming-Editor/

      Gav, M1BXF.

      Reply

Leave a Reply

%d bloggers like this: