Rotor Control From Serial

17 Dec 2009

I'm trying to write an antenna rotor controller for my Dad who is a Ham Radio operator.  We're using a program called Nova for Windows that tracks the satellites and outputs rotor coordinates over a serial port.  Right now, I'm just trying to read the serial for the values.  I have a mobile lcd hooked up to view the output and I'm pointing Nova4Windows at the Mbed serial port.

I'm running into an issue of all my output basically being garbage.  I'm not sure what's going wrong.  A quick reference on the EasyCom I interface I'm using:

EASYCOMM I Standard
-------------------

The EasyComm 1 standard is a simple ASCII character based standard for
controling antennas and rotators.

The host PC issues a single line command as follows -:
AZaaa.a ELeee.e UPuuuuuuuuu UUU DNddddddddd DDD

The Az and El values (aaa.a and eee.e) are not fixed width.  They are in
degrees and include 1 decimal place.

The Up and Dn frequencies are in Hz.

UUU and DDD are the uplink and downlink mode.

So basically, I'm trying to read that line of characters to then later control the rotor.

I originally tried a simple

lcd.putc(pc.getc());

but that's where I'm getting just garbage on my lcd.  I'm somewhat of a newbie when it comes to C programming so any ideas someone might have, I would greatly appreciate it!

-Taylor

17 Dec 2009 . Edited: 17 Dec 2009

Taylor Smith wrote:

originally tried a simple lcd.putc(pc.getc()); but that's where I'm getting just garbage on my lcd.

Looks like a good approach, and suggest something is happening! Maybe check baudrates? The mbed Serial connection defaults to 9600 8N1.

Simon

17 Dec 2009

 

Simon Ford wrote:
Looks like a good approach, and suggest something is happening! Maybe check baudrates? The mbed Serial connection defaults to 9600 8N1.

Simon

You're a genius! After a little experimenting, it needed to be running at 4800 baud.

 

17 Dec 2009

Ok, so I've got the reading from satellite tracking program finished, now I'm going to look at interfacing with the rotor controller.  In looking at documentation, it reads out the current rotor position using a voltage from 2V-4.5V representing 1-180 degrees.  Again, I realize this is an extremely novice electronics question (I'm just a programmer who's trying to learn!), but what's the easiest way to get that in a range that the mbed could read and decipher.  If I remember right, the AnalogIn uses a range of 0-3.3v?

17 Dec 2009

I would try a voltage divider. This article offers some values that should work. You will of course need to calibrate it using the real data.