Friday, 31 May 2013

Controlling a Dish Antenna

Actuators and motor drives

One of the tasks we need to do with the Radio Astronomy project is steer the Dish Antenna. The two important parts of this are the hardware motor controller and the software to read position information fed back from the dish.

While I'm still thrashing out the hardware for the Azimuth 360 degree drive I thought I'd look at the Elevation drive for the dish. As I'm using a fairly standard 2.4 Meter C-Band dish and mounting hardware that came with the dish I'm going to use a linear actuator arm which are available from most good Satellite TV suppliers.

Actuator Base - Red reed switch on right
The actuator arm has a 24 inch travel from fully retracted to fully extended. Although it has a 36 volt rated motor I'm going to run it at 24 volts to reduce stress on the motor. I also have a concern with the electrical EMF noise from the motor brushes so I'm hoping a lower voltage will reduce this. I'm also trying to keep the current on the drive under 2 Amps which is my limit for the electronics driving the motor.

Linear actuator arms have two pairs of connections. One pair is the motor power and by swapping polarity of the power the motor can run forward or reverse. This lets us extend or retract the actuator. The other pair of contacts is a magnetic reed switch which is used to count revolutions of the motor drive. A pair of limit switches are also wired up with the motor power to cut off the motor when maximum or minimum positions of the actuator are reached. I intend to use the limit switch signals to tell when Zero Degrees and 90 Degrees are reached on the dish position.

To provide forward and reverse voltages to the actuator arm I am using a device called a 'H-Bridge'. This lets me turn on and off the power to the motor as well as reversing polarity. The controller for the dish aiming hardware is an Arduino Uno R3 that uses an Atmel micro-controller on a prototyping board. The board has plug in connection pins on the edge of the board allowing modular devices called 'Shields' to be plugged in for different tasks. One such Shield is a H-Bridge that is perfect for controlling power to the dish positioning system.

Arduino Uno R3

The H-Bridge shield is a dual output device using an L298 high current switch. With this we can use one output to drive the Elevation motor actuator arm and the other output to drive the Azimuth 360 degree motor.

From the Actuator arm the magnetic reed switch contacts will go back to an Input on the Arduino so we can measure how far in and out the arm has traveled. Using this method of Elevation positioning the Arduino will need to frequently reset the dish back to Zero Degrees by reading the limit switch output. It will also allow Pulse counting of the reed switch between Zero degrees and 90 degrees so the Arduino knows how many pulses to expect as it travels.

For our purposes one of the Automatic Calibration tasks when the system is powered up will be to run the dish from zero to 90 degrees to pre-determine the dish position. The same task will also occur for the Azimuth drive as the Arduino will need to determine the direction in degrees. Therefore we will also need limit switches at Zero degrees North and at 360 degrees North. Azimuth sensing may also be done with a magnetic sensor at the motor drive. More on that part in a later post.

L298 H-Bridge Motor Driver
In my next post we'll be looking at adding the Software Defined Radio USB stick to the Raspberry Pi and getting our computer hardware receiving radio signals.

If you have already jumped in with both feet and followed some of the links in previous posts you may already have your system receiving signals. Thats where it starts to get exciting and our Radio Astronomy Project really starts to take shape.


Rob Arrowsmith

Sunday, 26 May 2013

Receiving From The Stars. Radio Astronomy Station Part 3.

Assembling the Radio Hardware
I thought in this post I would concentrate on the computer side of the Radio Telescope. Many of the parts can readily be assembled and tested without too much mechanical work, in fact none at all.
We'll need our SDR USB stick that we bought on Ebay, our Raspberry Pi and a PC running Windows 7 (you may find it best to use a laptop or PC with an SD card slot that works properly with an SDHC High Capacity 8GB card).

For the benefit of those that might not be computer savvy I've gone into some detail in explaining how to install software in the Raspberry Pi. As this is the important part of the whole system it seems worth it to explain as much as I can.

Step 1. Setting up your Raspberry Pi.
Lets assume you have your new Raspberry Pi in its box. Its just arrived in the mail and you can't wait to see what it does. Mine came from RS Components in a raspberry colored plastic box and packed inside an antistatic bag.

You'll need a good quality 8 or 16GB SD card for your Raspberry Pi operating system. Some laptops come with SD card slots in them. Note that older laptops may not be able to use SD cards larger than 4GB. If yours is one of those then you can still fit everything into a 4GB card (just).

On your laptop head to and select the 'Downloads' link at the top of the page. Select the first option Raspbian Wheezy (direct download) which is probably best for our purposes and save to your laptop Desktop. This is currently a 470MB download so make sure you have a decent internet connection. Note that the download page has options for choosing a mirror site that may be closer to your location and may result in a faster download.

While you are downloading your copy of Raspbian Wheezy, go and get a copy of 'Win32DiskImager' as we need this to write to our SD card. Save the zip file for DiskImager (Windows may pop up a request bar asking if you want to download it). The DiskImager is only 5.7 MB so while we wait for Raspbian, right click on the file and open it. Extract it to the suggested folder. You should now have a new folder on your desktop with DiskImager files in it.

Once you have the Raspbian ZIP file on your desktop extract the folder inside the zip file by right-clicking and choose 'Extract Here'. The file in the download is an IMG file. This 'Image' file is intended to be written or 'burned' to a CD. For our purposes we need to instead write it to our SD card.
On your Windows PC desktop open the 'Computer' or 'MyComputer' icon. If you have your SD card plugged in it will show in this window. Double click the SD card. Some new cards come with 'Extras' in them. Delete all files on the SD card.

Open your DiskImager folder and start Win32DiskImager.exe.
Select your Raspbian Wheezy IMG file and select the SD card with the 'Device' selector. This will probably show up as E:/ or similar. Click on 'Write' and your Raspbian Wheezy Image file should be written to the SD card. The SD card is your 'Hard Drive' for your Raspberry Pi. When your Image is finished being written close DiskImager and eject the SD correctly by right clicking on the SD card in My Computer and selecting 'Eject'. This will close the SD card so files don't get corrupted.

Step 2. Starting your Raspberry Pi.
We now have our Raspberry Pi board and an SD Card with Raspbian Wheezy on it. Fit your SD card and connect a screen to either the Composite Video RCA socket or the HDMI Video port. Plug in a USB Keyboard and Mouse to the two Raspberry Pi USB sockets. Connect an Ethernet cable from the Raspberry Pi to a spare port on your Network Router.

A few points about power supplies. The Raspberry Pi is designed with a Micro USB (mobile phone standard) power connector. If you have a Phone charger just check that the charger will deliver at least 1 amp. Some will only supply 700mA which will probably not be enough. I use a Nokia charger that has 1200mA @ 5V written on it and seems to work well.

Connect your power supply. Fingers crossed and the red PWR led on the Raspberry Pi should light up followed a few seconds later by the other Leds. Your LCD screen should come up with the Raspberry Pi logo followed by a screen full of startup information. Eventually the 'Raspi-Config' window should open giving you several setup options. They are pretty self explanatory. When finished tab to Finish and the Pi should restart.
The default user name is 'pi' and the default password is 'raspberry'. This should be changeable in the Raspi-Config setup program.

Once you log in, type in 'startx' and the Raspberry Pi desktop should start up. Now the fun starts.
But I will save that for the next post.

If you have any issues with the above, look around and Google some answers. I'm happy to answer any queries at the end of this post.


Friday, 24 May 2013

Radio Astronomy Station. Part 2.

Radio Telescope Diagram.

The Radio Telescope consists of a Raspberry Pi computer and DVB TV receiver USB stick mounted in a box at the focal point of the Dish. The Raspberry Pi also communicates with an Arduino Uno mounted in a control box under the Dish to control the azimuth and elevation.

An ethernet cable and power cable run from the Dish back to the control room.
In the control room the main system PC has the Radio Eyes Telescope Control Program, SDR Radio Client and Skypipe digital chart recorder.

A remote operator runs the Radio Eyes program which allows the management of where and when the Dish should be active. The commands for pointing the Dish are then sent to the Telescope Control Program as a 'Task' for later activation.

The receiver connected to the Raspberry Pi can be commanded by the SDR Radio Client to monitor a particular frequency and the signal comes out of the PC audio out socket for monitoring through a local speaker. This audio is fed back into the PC for recording by the Skypipe software and plots the intensity of the received signal.

A remote operator can also log in and see a waterfall display of Frequency/Time/Intensity covering several Megahertz bandwidth.

SDR Receiver

This is the DVB TV receiver I bought on Ebay for less than $20.
Fortunately it has the correct RTL2832 and E4000 devices. Obviously the nifty little infra-red remote control isn't going to be of much use. It also came with a little antenna and magnetic base with cable and plug, also not a lot of use.

Raspberry Pi

The Raspberry Pi is now available in sufficient supply for them to be readily accessible through your local supplier. I bought two in November 2012 and they arrived just before Christmas. Perfect timing for the Holiday break.
I'd recommend getting hold of a Pi and the DVB receiver and getting these two devices working together. My previous post has a link to Peter Goodhalls web page with instructions for getting the Pi talking to the receiver.
You should then be able to remotely log in to your Pi and receive audio and control the Frequency and mode of reception.
I used my Android phone with an app called SDR Touch. This allows entry of the IP address of the Raspberry Pi so you can connect and receive audio.

In the next post I will show some results of the receiver and SDR client software and what we can do with our system so far.


An SDR Radio Telescope. Notes.

Useful Links for Radio Astronomy

I wanted to add some links to reading material that may be useful for anyone contemplating building their own Radio Telescope system.

The document that triggered my excitement regarding this project was one produced by Dr David Morgan in 2011 based on experiments he did with a Software Defined Radio USB Stick called a 'Fun Cube Dongle' that uses parts designed to receive Digital TV and Radio or 'DVB' broadcasts. You can access that document here

The next thing I needed was a way to test if I could get a receiver like the 'Fun Cube' working. I had a Raspberry Pi computer. I bought a DVB Digital TV USB receiver and put them together. The article that got it working was Peter Goodhalls web page on setting up the Raspberry Pi. You can read his page here.

I went looking for information on how to control a Dish Antenna. I knew I'd be using the Radio Eyes software package as the main control system. There's a standard for controlling Astronomical devices based on the ASCOM system of control protocols. Fortunately there's a web site for ASCOM.

I was having a tough time trying to get meaningful answers from the ASCOM site but after some more googling I found a site that has Optical Astronomy software and have kindly provided source code for implementing an ASCOM driver package. Skymap appear to have many different drivers for optical telescopes. There driver page is available here.

I hope the above information is useful and gives you an idea of what is involved.

As promised, the next blog entry will have a block diagram of what we're making.

Thursday, 23 May 2013

Radio Astronomy Station. Part 1.

Whats All This?
I've worked on a few big projects in my life. Mostly as a result of companies I've worked for. I'm not talking 'Death Star' sized projects but the kind of thing you can really get your teeth into and come out the other side feeling exhilarated and the sense of achievement.

I plan to cover the development of a Radio Astronomy station using pretty much off-the-shelf hardware so that capable readers of this blog could quite easily follow instructions and put one together themselves.

Radio Astronomy by the numbers
For the average tech type person this project will involve a number of steps.
  1. Set up a PC with Windows 7. Install the 'Radio Eyes' and 'Skypipe' Radio Astronomy applications. Install a 'Driver' program to talk to the positioning system. This computer will be located near the Dish.
  2. Set up a Raspberry Pi computer running 'Raspbian' operating system. Install the driver software to receive radio signals with it using a DVB USB stick that has an RTL2832 and E4000 devices in it.
  3. Program an Arduino Uno controller board with a Real Time Clock and a L298 H-Bridge motor driver to position the dish.
  4. Set up a C-Band 2.4 meter dish antenna with Elevation and Azimuth motors. Mount the Raspberry Pi and DVB Software Defined receiver at the dish focal point.

The blog is going to detail the above steps and the software for the system will be available free to download except for 'Radio Eyes' and 'Skypipe' which are available through RadioSky Publishing

Putting It Together
Look around for a good sized mesh type C-Band satellite dish. You can find them on Ebay quite cheaply. You'll probably want a good sized pole to mount the dish with as well. Maybe 75mm diameter and 2 meters in length. Depending where you mount this you'll want half a meter in the ground and concreted in. If the soil is soft you may want it deeper. Stability is of utmost importance. Think about adding struts if the pole moves at all.
You should end up with the dish mount at about head height. This makes it easier to work on. An actuator will be mounted under the dish in order to give elevation drive. This should be able to swing the dish from 0 degrees up to 90 degrees. Actuators can be driven with 12, 24 or 36 volts depending on the type available to you. Actuators have two motor wires, usually RED and BLACK. They will also have two sensor wires connected to a reed switch inside the actuator that 'pulses' as the actuator drives the arm in or out.

This is a picture of the 2.4 meter 'JoySky' dish that I am using.

In the next post I'll put up a block diagram of what I'm building so you can get a better idea of how it all goes together.

Cheers 'till then.