Ground Station description

Figure 2. Munin Ground Station

Hardware

The hardware consists of :

Command and telemetry software

The loadCommandList.pl utility

This utility will transmit commands from the specified file to the Munin time queue. The uploading time will not exceed 1 minute.

Antenna and radio equipment control software

To be able to use the station software you need to install the following on your Linux system.

Below you will find a list of software developed at IRF.

Location of antenna and radio equipment control software

On the IRF computers, thor and tracker, the executables are is in the directory /home/munin/tracker/bin . The sources are below the /home/munin/tracker/src directory.

Installation

To compile the C sources you should do make in the appropriate directory followed by make install . The perl and bash scripts must be manually copied to the bin directory. The kernel module, parporttasks.o, has to be placed in the /lib/modules/kernel.version/misc directory and the depmod command has to be issued, (if you want the modprobe command to work). For specific installation information look at the README files in the source directories.

The RT parallel port driver

The RT parallel port driver is compiled with the Linux 2.0.36 kernel and version 1.1 of the RT-Linux distribution, (see above for reference to distribution location).

It will use the parallel port defined in the common.h file. The symbolic name LPT_PORT is used. The default address is 0x378.

For further details about driver function please look at the source code, parporttasks.c.

Before you start using the driver you will have to create the real-time fifos. Issue the following commands to create the fifos and enable write for all users.

mknod /dev/rtf1 c 63 1

mknod /dev/rtf2 c 63 2

mknod /dev/rtf3 c 63 3

chmod a+rw /dev/rtf?

Insert the module into the kernel and you are ready to rock.

insmod parporttasks

Enjoy !

The tracker utility

The tracker program outputs time,antenna azimuth and elevation, radio transmitter and receiver Doppler corrections. It is based on the publicly available SGP4 routines.

Note about SGP4:

The SGP4 algorithms calculate the position and velocity vectors for a satellite in the M1950 coordinate system. The implementation in C is based on the original Fortran version that was first published in the Spacetrack report no.3: Models for propagation of NASA Element Sets.

Before using the program you must assure that the satellite orbit elements file, containing the "NASA Two Line Element", is up-to date and placed in the /home/munin/tracker/tle directory, with the name munin.tle . Note also that this program has a few definitions in main.c which determine it's operation. Most notably are the definitions of the ground station location, up- and down-link frequencies. Other important definitions are

FREQ_STEP 100: Our radio equipment step size is 100 Hz.

VALID_PASS_EL_LIMIT 20: The antenna elevation has to be above this value before we consider this a valid passage.

TRACK_LIMIT 0.0: We will track the satellite until antenna elevation is below this value.

TURN_LIMIT 170.0: When antenna reaches this azimuth value it is time to turn it, we have reached the endpoint of rotor azimuth movement. This value is not used when the -R option is specified.

Usage

When you run the program with an illegal option like -h it will output usage information. It is possible to supply the start time of orbit prediction on the command line. If you don't supply the time the program will use the current time. Note: the supplied time must be the Unix time. Please have a look in the section called Examples for examples.

A description of command line options follows.

-a : output all information. Date, time, time, azimuth, elevation, receiver step correction, 4*(receiver frequency correction)/100, transmitter step correction,2*(transmitter frequency correction)/100.

-R : generate radio control file. This mode generates complete control file without any break for turning our slow antenna.

-s : print only next AOS/LOS of satellite.

-T n : use n seconds time resolution when calculating . If not specified a value of 2 will be used.

-v : be verbose. It outputs information for every calculation step.

Examples

To create an antenna control file for the nearest passage with a time resolution of 4 seconds, issue the following command.

tracker -T 4 > antenna.control

To create a radio control file for a passage 10 000 seconds from now with a time resolution of 1 second issue the following command.

NOW=`date +%s`;tracker -RT 1 `expr $NOW + 10000` > radio.control

The cmd_relay helper program

The cmd_relay program acts as an interface between the RT parallel port driver, parporttasks, and the expect script "radio.exp". It will read commands on the standard input and relay them to the driver trough the real-time fifo /dev/rtf3. Any reply from the driver is read from /dev/rtf1 and piped through standard output to the radio.exp script. For usage example please look at radio.exp code.

The nextPassage.pl utility

nextPassage.pl is a perl script which will aid you when you want to add new Munin passages. This script should be run as the user which is running the antenna and radio control software, in our case user munin.

It will use the tracker program to create control files for the antenna.exp and radio.exp scripts. For each passage it will add two entries in the Unix at queue for this user. The at commands will be responsible of starting the antenna.exp and radio.exp scripts at the correct time, (approximately 5 minutes before the passage). The script is currently configured to add a maximum of five passages. Note that the antenna.exp and radio.exp scripts will produce log files in the /tmp directory with the current nextPassage.pl configuration.

To change the configuration of how many passages that will be generated, edit the nextPassage.pl script. Look at the parameters $MAXPASS=5 and $timeSpan=604800.

$MAXPASS: determines how many passages will be generated if the timeSpan variable allows it.

$timeSpan: determines how many seconds into the future we will try to generate passages for.

Examples

To create passages for the defined time interval in the nextPassage.pl script do the following.

Become user munin by issuing command /bin/su - munin as user root.

nextPassage.pl

The antenna.exp expect script

This script is used for controlling the antenna movement. It reads the file specified on the command line, which was created by the tracker utility, and interprets the commands. It spawns the minicom communication program to do the communication with the trackbox. Note that the default configuration of minicom has to match the trackbox communication setup.

The trackbox is commanded to "host mode" by the script. When the current time is equal or greater than the time in the command file, the script transmits the azimuth and elevation to the trackbox. This continues until the end of command file. When the script is about to finish it parks the antenna and closes the minicom session.

Note: antenna.exp is normally run by at, which was issued from the nextPassage.pl utility.

The radio.exp expect script

This script is used for changing the frequencies of the radio equipment. It reads the file specified on the command line, which was created by the tracker utility, and interprets the commands. It spawns the cmd_relay program for doing the communication with the RT kernel module, parporttasks.

The "start parporttasks" command is sent to the kernel module. When the current time is equal or greater than the time in the command file, the script transmits the Doppler correction commands to the cmd_relay utility. This continues until the end of command file. When the script is about to finish it sends the "stop parporttasks" command and quits the cmd_relay application.

Note: radio.exp is normally run by at, which was issued from the nextPassage.pl utility.

Unix shell scripts and misc. programs

The clearAtQ.sh shell script

This little shell script removes all waiting commands in users at queue.

The change.time.pl perl script

This will take an antenna or radio control file and change the run time of the commands to 5 minutes into the future. This script is only used for debugging purposes. The result is printed on standard output.

The "new" at command

To solve a problem with the at command distributed with Slackware 3.4 I've installed a newer version of at in /usr/local/bin . This version was distributed with the Debian 2.1 release. The new at command, nat, is only used for adding the at commands to the system.