Wednesday, 10 July 2013

Part Six. Setting up the Dish Controller.

First Look at the Arduino

My Radio Astronomy project is slowly taking shape. The LCD shield for the Arduino Uno controller arrived today. I paid an extra $1.60 for express post from Hong Kong and it was here in three days. Amazing! It did have $28 Hong Kong dollars worth of stamps on it!

Over the last couple of days I've been putting together some preliminary software for the Arduino to communicate with the LCD shield and the L298 motor driver shield. Mostly its 'sample' code that is available for testing shields and makes it quick to run through some ideas I've got for the actual Dish Controller software.

So far it reads the six pushbuttons on the LCD shield and shows on the display which button has been pressed. I'm really pleased with the look of the display backlighting.

The stack of three boards together looks pretty cool although the L298 motor driver shield is covered by the LCD shield which makes it difficult to access the terminals for the motor power wiring. I think it may be best to bring out the wiring from the motor drive shield to a separate terminal block to give easy access for wiring back to the Azimuth and Elevation motors.

Here's a picture of the three boards stacked together. I've obtained a suitable IP66 diecast metal box for the Dish Controller and power supply to be located in. I was a bit concerned about the height of the stack of three boards but it appears there's enough room to mount it with clearance.

Some thought has gone into the power supply for the Dish Controller. I'm not happy using a switchmode power module, tempting as they are. For most people they are an off-the-shelf regulated power box but I suspect the amount of high frequency noise that would be generated by a switchmode box would be unacceptable and no amount of filtering or shielding could minimise it enough.

I've settled for a toroidal power transformer with 2 x 15 volt windings capable of about 1.6 amps each. This fits nicely at one end of the control box and should give adequate current to power the motors. As the L298 motor driver is limited to 2 amps and the Arduino is using Pulse Width Modulation to limit the power to the motors I think this should be sufficient.

The dimensions of the box are Width 146mm, Length 222mm Height 55mm (including the lid).

One of the tasks this box will also be needed for is providing power and junction wiring for the Raspberry Pi and SDR receiver module mounted at the focal point of the dish. A CAT5 network cable will run from our main computer to the Raspberry Pi through this Dish Controller box and a USB cable will run from the Raspberry Pi back to the Arduino as Dish Position commands will be coming from the Raspberry Pi.

I suck at diagrams.

In my next post I should have the power supply built up and providing power. The Arduino should also be doing some basic functions with controlling the Azimuth and Elevation motors.


Rob Arrowsmith.

Saturday, 6 July 2013

Radio Astronomy Station. Part 5.

Steering The Dish

Its been a busy few weeks in the workshop here. Researching hardware design criteria, cutting and drilling metalwork and general putting things together to see how they looked. 

So the next step in my Radio Telescope Station design has revolved around redesigning the mount for the 2.4 meter mesh dish so I can use the linear actuator I had purchased to move the dish from zero to 90 degrees elevation. The original dish mount was designed as a Polar mount with a single actuator to swing across the ecliptic where Geostationary satellites are located. This has meant changing and adding to the original mount to give the actuator full movement from zero to 90 degrees. Not an easy thing to do.

At the same time I've been looking at options to move the dish around horizontally from zero to 360 degrees. It turns out I have an old antenna rotator in my junk box that may be usable so I'm investigating how to drive it with the rest of the hardware I'm building. The big problem is whether the rotator can handle the weight and stress of the dish. I may even change the dish mount hardware to reduce the overall weight.

Using An Arduino

The other work has been centered on the dish controller electronics. In a previous post I'd mentioned about using the excellent and somewhat ubiquitous Arduino microcontroller platform in the form of the Arduino Uno. Designed as a modular platform the main board has two rows of connectors allowing other 'Shields' to be plugged in depending on the project needs.
Arduino Uno

In my case I'm using a Shield with a Motor Driver L298 to control two electric motors, one in the linear actuator for Elevation of the dish and one in a rotator for Azimuth position.

I had ordered two of the Arduino Motor Drive shields from a Hong Kong supplier through Ebay over six weeks ago and after repeated requests to find out where the goods were and why I hadn't received them I eventually had to put in a dispute with Paypal. It was only $20 for two boards but they quickly refunded the amount. If they ever arrive I'm sure I'll be quick to send them back the $20.

Motor Drive Shield
In the meantime, when it looked like the boards wouldn't arrive, I ordered two more from another supplier for $24 total. Not surprisingly they arrived in 9 days. Needless to say, got a five star rating. Buy from them through Ebay, its about 20% cheaper that way.

I've now managed to put together a pin connection chart for the Arduino.

Arduino Ports.

Arduino Ports
PB5/SCLK...13 Elevation Motor Direction
PB4/MISO...12 Azimuth Motor Direction
PB3/MOSI...11 PWMB - Elevation Motor Drive
PB2/SS........10 LCD Display Backlight Control
PB1/OC1.......9 LCD ENABLE
PB0/ICP.........8 LCD SELECT

PD7/AIN1......7 LCD 7\
PD6/AIN0..... 6 LCD 6 \ LCD 4 Bit Data Bus
PD5/T1......... 5 LCD 5 /
PD4/T0......... 4 LCD 4/
PD3/INT1..... 3 PWMA - Azimuth Motor Drive
PD2/INT0..... 2 Azimuth Pulse Counter
PD1/TXD....... 1 USB Serial Out
PD0/RXD....... 0 USB Serial In

PC5/AD5........Elevation Pulse Counter
PC4/AD4........Elevation switch 90 Degrees
PC3/AD3........Elevation switch 0 Degrees
PC2/AD2........Azimuth Limit Switch 360 Degrees
PC1/AD1........Azimuth Limit Switch 0 Degrees
PC0/AD0........LCD Keyswitch Analog Input

My Arduino hardware design includes a 16x2 LCD Display Shield that sits on top of the Motor Driver Shield. The great thing about this is the ability to get visual feedback when in field adjustments are being performed. The LCD shield also has some small pushbuttons connected through a resistive ladder to one of the A to D pins of the Arduino. Part of the software will be able to read button pushes to adjust UP/DOWN and LEFT/RIGHT control of the dish.

Ebay image of the LCD Shield
When the LCD shield arrives I can start testing the Arduino software.
So far I'm getting together a bunch of example code for the various parts of the controller.

In the next post we'll be looking at the software in some depth and how the dish position is adjusted. I might even have a preliminary enclosure design for the control hardware. There are a few nice IP66 rated waterproof boxes out there that I want to have a look at. I'm steering towards using one with a clear lid that lets me see the LCD Display while the system is in use. I also have control of the LCD backlighting so I can turn it off when not in maintenance mode.