John's homebrew pages


Satellite tracking and antenna control

The recent (21 November 2013) launch of the FUNcube-1 (AO-73) satellite had me getting organised a week or so beforehand. I had made a couple of successful attempts to listen to amateur satellites before, using a hand held antenna, so thought there should be a good chance of success with FUNcube. I was particularly interested in getting the telemetry data acquisition going, along with the submission to the data warehouse, as there are a few satellites doing this now.

It was a bit of a saga - the FUNcube software was basically only available for Windows, not Linux (or Mac). So I dug out my Windows XP machine which is kept going for this sort of event. I found I needed to spend quite a bit of time getting it updated (it doesn't usually get connected to the web!) and getting the .NET software installed so that the FUNcube software would work. There were some issues with the Windows XP version too - so I did some last minute testing with the developers to help get it going - all good fun.

Anyway all was ready in time, and although I didn't (I don't think) hear anything from the satellite on the first orbit, I managed to acquire 51 frames of data on the second orbit:

Screenshot

I've subsequently sumbitted a few more from the first day or two, but have decided that I really need to get organised properly to be a satellite groundstation - and for making QSOs through the satellites, automatic tracking (and even automatic Doppler correction on the transceiver) would be a great bonus. So I decided I need to build a controlled altitude-azimuth antenna mount - and the azimuth part of it will be car-toppable so I can use it for microwave contacts!

So here's the story what I'm doing to get going.

System in use

Dell Optiplex GX280 - P4 2.8GHz, 500Mb
Windows XP Professional SP3 (updated to November 2013), .NET Framework 4 Extended

For getting the satellite predictions I installed the Orbitron software V3.71 from Sebastian Stoff. This obtains up-to-date orbital elements if allowed online, and has the ability to feed other software with the information required for tracking and Doppler correction.

To feed data into the FUNcube data warehouse I installed the FUNcube telemetry dashboard from the downloads section on the FUNcube website. This worked well once the initial bugs had been sorted by the development team - to whom many thanks are due.

I used by Yaesu FT-817 as the receiver (145.935MHz) and a home brew DK5ZB 5 element Yagi antenna. The antenna was hand held, and needed frequent rotation to follow the polarization of the signal, as well as pointing in roughly the right direction.

Antenna tracking system design

There are a few examples of existing systems on the web, but as I like to home brew I needed to start from scratch. The mechanical system and PIC controller will not be too difficult (I have bought two very cheap electric screwdrivers to provide the drive for the two axes), and most of the effort will go into the software. The PIC side of this should be fairly straightforward, but I have not done a lot of PC programming - most of my experience is of large scale software on big Unix systems!

I looked at what had already been done with the Orbitron software, but not many examples came up in response to my Googling. There is code on Sebastian Stoff's Orbitron site in Pascal, but I don't have a Pascal compiler (and it's years since I wrote any Pascal). There's also CX6DD's WispDDE client which will work with Orbitron, and Visual Basic sources are provided but I want the flexibility of having my own system, and keeping it simple. There's also an Orbitron interface from VK5DJ but again this involves Pascal (or using it "as is"). Since I'm a great fan of open source software (Linux based, especially) I wanted to use Python for my programming.

That's where I got a little bit stuck. Orbitron uses the Microsoft DDE (dynamic data exchange) mechanism to transfer the required information. This is a very old mechanism, but still works even on Windows XP. There is, however, not much documentation available on exactly how to use the Python DDE interface.

I had initially installed Python 3.3 (as the current version), but discovered a snag. Orbitron needs the interface program (described as a "driver") to exist as a Windows .exe program, so I needed to generate a .exe from the Python code. There is of course a tool to do this, called py2exe, but it runs in Python 2.7 - so I had to install Python 2.7 from the Python organisation website.

You also, of course, need the appropriate Python for Windows package (for Python 2.7) installed, so that all the Windows interface stuff is there. I haven't yet set up a windowing interface yet, but plan to do that in due course using tkinter.

Some initial tests at the Python command prompt had shown that the DDE mechanism was starting up correctly with Orbitron, but that I couldn't get any data back - I had to have the .exe available so that Orbitron would send out its data. So I put the code in a file and ran the py2exe mechanism. First, here's the simple Python code to connect to Orbitron and obtain a line of tracking data every second:

#testDDE
#GM8OTI 13Dec13
 
import win32ui
import dde
import time
 
# initialise the DDE system
s = dde.CreateServer()
s.Create("testDDE")
 
# start a conversation 
c = dde.CreateConversation(s)
 
# connect to Orbitron, using link topic "Tracking"
c.ConnectTo("Orbitron","Tracking")
 
# check the connection status
connect_status = c.Connected()
print connect_status
 
# loop and display the data obtained from Orbitron on screen
for i in range(100):
  time.sleep( 1 )   # sleep for 1 second each time round
  schars = c.Request("TrackingData")   # get the link item data
  print i, schars
 
else:
  s.Shutdown()
 
exit()

Next, here's the code needed for the py2win conversion - the procedure is fully documented on the page linked above.

from distutils.core import setup
import py2exe
 
setup(console=['testDDE.py'])

That's nice and simple! You just run setup.py with the argument "py2exe" at the Python command prompt.

Then the .exe location needs to be placed in the appropriate section in the Orbitron configuration file (see the "read_me.txt" in the "MyDDE" documentation from Sebastian Stoff), and it's all ready to go.

It's best to use Orbitron with the main window visible (rather than full screen), so that you don't have to minimise the Orbitron window to see the window created when your "driver" is started. Start the "driver" from Orbitron's "Rotor/Radio" tab, and it should all happen!

Here's a screenshot showing my "testDDE" driver running and displaying data for the FUNcube-1 satellite:

Screenshot

With the software to use the DDE communication method now working nicely, it should not be too difficult to get the required information parsed out and pushed out on the serial port to the PIC antenna controller - still to be designed and built!