wosp UoSAT-1/2 Whole Orbit Survey Plotter for the SPECTRUM 48k or 128k USER'S GUIDE ============ N.P. Taylor (G4HLX) 46 Hunters Field Stanford in the Vale Faringdon Oxon. SN7 8LX Program and explanatory material Copyright (C)1987 N.P. Taylor 1. INTRODUCTION --------------- The WOSP (Whole Orbit Survey Plotter) program is designed to decode the 1200 baud transmissions of the UoSAT-1/OSCAR-9 and UoSAT-2/OSCAR-11 satellites (referred to hero as UO-9 and UO-11) when these are sending whole orbit data (WOD) dumps. The received data is processed and displayed as graphs of the analogue values versus time. The program is a companion to the SUDD program, which decodes text transmissions and standard telemetry frames from UO-9 and UO-11 (and also SPIX which displays CCD images from UO-9). WOSP does, however, operate independently as a stand-alone program. Since users are likely to be already receiving other data from the UoSATs (probably using SUDD), it is assumed in this guide that they are familiar with techniques of reception of UoSAT signals on 145.825 MHz FM. Operation of WOSP is highly automated - once data has been received and decoded, the program will identify the channel numbers included in the survey (whenever possible) and present the titles of these to the user in order to select one to be plotted. The program finds the times covered by the received data (which may be all or any part of a complete survey) and chooses suitable K and Y axis with convenient annotations, and then rapidly plots on the graph all received data for the chosen channel which has satisfied the checksum test. 2. WHAT IS WHOLE ORBIT DATA? ---------------------------- Both UO-9 and UO-11 produce measurements from a variety of sensors in the spacecraft. There are 60 values in each case, and these are the telemetry "analogue channels" numbered 0 to 59 which appear in the standard telemetry frames (as decoded by the SUDD program). These include spacecraft operational data such as battery voltage and charging current as well as the output from experimental modules such as radiation detectors. In addition to the real-time transmission of this data at approximately 5 second intervals, the satellite on-board computer can store the data for a few selected channels over a period of one or more complete orbits. This recorded data, representing the variation of the selected quantities over the (typically) several-hour period, is then transmitted on the general data beacon (145.825 MHz) using the normal 1200 baud ASCII format, in one complete dump. This is the so-called Whole Orbit Data (WOD). If you receive a WOD dump and display it as text (using SUDD) it will appear as a solid block of hexadecimal numbers. Each line of this block represents a separate sample of the selected channels. they are at 5.28 second intervals on UO-9 and at 4.84 second intervals on UO-11. The last two characters of each line are part of a checksum procedure that can be used to verify that the data in that line has been received correctly. The WOSP program performs the checksum test and simply ignores lines for which the test fails. Up to ten telemetry channels can he selected as part of a WOD survey - these are decided by the University of Surrey and programmed from the UoSAT Command Station as part of the DIARY process. The numbers of the channels included in a given survey are encoded in the first line of the WOD dump ("line 0"). WOSP will find and use this information to identify the channels, if line 0 is present in the received data (which it will not be, for example, if you started receiving part-way through a dump). This information is also included in plain test form (e.g. "SURVEY INCLUDES CHANS 1.2.3.") amongst the DIARY messages, where the date and time that the survey commenced will also be given. Additionally, the weekly news bulletin from each satellite often announces the schedule of WOD surveys (including channel numbers) for the coming week. 3. USING WOSP ------------- To decode received data the audio signal from the FM receiver, is fed to the Spectrum "EAR" socket at a similar level to that used when loading programs. Some experimentation with the audio level used may be necessary. It is recommended that the signal is recorded on tape at the time of reception and actually decoded afterwards. This will be essential for users of Spectrum 128K Plus 2 computers, on which there is no ear socket. The recorded signals on cassette should be replayed in the Plus 2's internal datacorder. The signal will be demodulated by WOSP (see section 4.1.2) and the received data will be stored in a buffer which can hold up to 9417 bytes (characters). After this it can be processed to produce graphs on the screen - these can also be copied to a printer if it is suitably interfaced. After seeing the complete graph on the screen it is possible to select a smaller portion of it to be expanded and plotted to show more detail - this is done simply by specifying the upper and lower time limits of the portion required. After decoding the data it is possible to save the buffer contents on tape, microdrive or Opus disc. This may later be loaded again for plotting. It is also possible to load a data file which has been decoded and saved using the SUDD program, although this is less efficient because WOSP makes better use of the available space in the buffer in the particular case of the WOD data. Of course, one has to be sure that the type of data being fed into WOSP is indeed a WOD dump. Looking at the data using SUDD will reveal what type of data has been received (this is one reason for recording the signal on cassette tape), and with practice you will be able to recognize the particular sound of a WOD transmission. If you try to decode something that is not a WOD dump, the buffer will probably not fill up, because WOSP is selective about what it stores in the buffer (see section 4.1.2). Ultimately. if you try to plot a graph when there is no valid WOD data in the buffer. WOSP will simply tell you so. On the other hand it is only necessary that there is some WOD data present - anything else will be ignored - so it is safe to decode a random portion of received data of unknown content in the hope that it includes some WOD. 4. DETAILED INSTRUCTIONS ------------------------ To load the program from tape use the command LOAD "WOSP" or lust LOAD "". Users of Spectrum 128 or 128k Plus 2 computers can load the program in either 48K or 128K mode. The BASIC program and machine code loads in several parts, at the end of which the main option "menu" will be displayed. All selections of options in WOSP are made by pressing a single key corresponding to a choice from those offered on such a menu. 4.1 Main Menu ------------- The selections on this menu offer the principal steps in decoding and plotting data. These are listed in the order in which they will often be used. A description of the function of each option follows: 4.1.1 "S" - select satellite ---------------------------- There are important differences between the data sent by UO-9 and UO-11: firstly the tones used to encode the data are inverted on UO-11 compared to UO-9. secondly each satellite has a different set of 60 analogue channels (with separate calibration equations), and finally the checksum test for WOD data varies between the two. It is therefore essential that WOSP Is expecting data from the correct satellite before starting. The choice is made by pressing "S". Each press toggles between UO-9 and UO-11, as clearly shown on the display. If you choose the wrong one, results will be rather unpredictable, but it should be obvious that something is wrong! (e.g. demodulating will produce large numbers of parity and framing errors). 4.1.2 "D" - demodulate ---------------------- This option initiates the demodulating process, during which audio input fed to the "ear" socket (or replayed on the internal datacorder in the Spectrum 128K Plus 2) is decoded and stored in the 9417 byte buffer. While this is happening a number of things will be seen on the screen (which will be familiar to SUDD users). The border shows a pattern similar to that obtained when loading programs from tape. The "front panel" display shows four "lights" - a "mark" and "space" light to indicate when those tones are being detected, plus "parity" and "framing" error lights which show that a received byte has failed these tests (even parity is expected, and a correctly framed byte has 1 start and 2 stop bits). The mark and space lights should flicker continually during demodulation, while the error lights should ideally remain off. If the parity and framing error lights do show, it normally indicates a noisy signal; if they are flickering most of the time either the signal is very noisy, the wrong satellite is selected (see section 4.1.1). or the satellite is sending some other type of data (e.g. DCE data on UO-11, which has no parity check). A small error rate will not prevent a valid plot from being produced, since WOSP will ignore received data which fails the checksum test - provided some of the data is correct, a graph should be produced. Also displayed is a bar "gauge" which shows how such space in the buffer has been used. Each vertical tick represents 1K byte of storage, the rightmost one the end of the buffer. WOSP is selective about the data it stores in the buffer in order to conserve space and compress the maximum amount of WOD data into the available store. The only received characters which are put in the buffer are valid hexadecimal digits and carriage return/ line feed characters. WOD transmissions generally contain a lot of 'idle' bytes which are sent while the satellite on-board computer is preparing the next WOD line. Much space is saved by ignoring these characters, and if you are familiar with SUDD, the buffer bar gauge in WOSP will seem to advance rather more slowly than you are used to. This optimal use of the buffer does mean, however, that WOSP cannot be used for decoding other types of data from the UoSATs, and if the data being fed in is a text transmission, the buffer gauge will hardly move at all (only the occassional character is stored). This also means that while data may be transfered from SUDD to WOSP (via tape or microdrive save / load), rather less useful data will be fitted into the buffer that way and it does not make sense to transfer data the other way, i.e. from WOSP to SUDD. The demodulating sequence is terminated either by the buffer becoming full or by pressing the break key (once). The total number of received bytes, with a count of parity and framing erors will then be shown, and pressing any key will return to the main menu. 4.1.3 "P" - plot ---------------- The "P" selection tells the program to start preparing a plot. Initially it looks through the entire data buffer searching for valid WOD lines, and counts the number of telemetry channels present in those. It then searches for a WOD line 0 (see section 2) in order to identify the numbers of the channels included in the survey (it does all this in a fraction of a second). Let us suppose that it sucessfully finds this information, then a selection menu is displayed showing the numbers and titles of the channels included. To select a channel to be plotted from this list (which will be at least one, but no more than ten. long), use the up and down cursor keys (keys 7 and 6 on older rubber-keyed Spectrum models), until the selection arrow is next to your chosen channel, and press ENTER. Pressing "R" instead will return to the main menu. Sometimes, in UO-11 surveys, channel(s) in the range 60 - 67 may be included; these are not conventional analogue values, but contain the 96 "status points". It does not make sense to try to plot these and WOSP will not let you select these. They are included in WOD surveys occassionally so that UoSAT Project staff can observe operational data, for example to see when the magnetorquer was fired during spacecraft attitude manoeuvres. Before continuing, let us consider what happens if WOSP is not able to find WOD line 0 amongst the data in the buffer. It knows how many channels there are, but cannot identify them. It will therefore ask the user to identify them by inputting, one at a time, the appropriate channel numbers. As noted before (section 2), you can find this information in the DIARY messages sent before or after the WOD dump, or from the general news bulletin when a schedule for the following week is given. Either way, once the list of available channels is shown and you have selected one of them by moving the selector arrow and pressing ENTER, the graph will be displayed. WOSP automatically chooses suitable axes - the vertical one to cover the maximum possible range for the selected channel, in whatever physical units are appropriate, and the horizontal one in suitable time steps (in seconds, minutes or hours as appropriate) to cover the entire range of times found in the received data. These are the elapsed times since the start of the survey (the date and time of which is also given in the DIARY messages). The plotted data may, of course, contain gaps if part of the survey was not received properly. In general WOSP will simply use a time scale extending from the lowest to the highest times found In the buffer and then plot all the valid data that it can find. The received data may therefore be any arbitrary portion of a survey, but beware that extremely short sections (of only a few WOD lines) may cause the program to malfunction. When the plot is complete (which takes a few seconds), four options are given on the bottom line of the screen. One of these is "R", which will return to the charnel selection menu so that you can select another one for plotting, if desired. The other options are described in section 4.2. 4.1.4 "T" - tape or microdrive save and load -------------------------------------------- A further menu is displayed when this option is invoked, enabling the current buffer contents to be saved to cassette tape or microdrive, or previously saved data to be loaded into the buffer (replacing any data which is already there). Saving or loading to tape is achieved with options "S" and "L", in both cases a filename will be asked for, which may be null (just press enter) for loading, causing the next file found on the tape to be loaded. Options "M" and "D" are the equivalent for microdrive save and load, and again a filename will be required - this is assumed to be on drive no. 1. This microdrive option should also operate for Opus disc systems. The "R" option returns to the main menu. The tape or microdrive load options may be used to load a file of data which has been saved by the similar options in the SUDD program, if desired. As noted before, however (section 4.1.2), SUDD will not fit as much WOD data into the buffer as can be achieved by using WOSP itself for the demodulation. 4.1.5 "E" - erase buffer contents --------------------------------- The number of bytes of data currently in the buffer is displayed at the bottom of the main menu screen. If the buffer is not full, and "D" for demodulate is selected, the new data received will be appended to that already in the buffer. To empty the buffer first, the "E" option can be used, which will erase all data currently stored. To guard against accidental loss of data, the program will ask for confirmation before actually deleting the buffer contents. 4.2 Options after plotting a graph ---------------------------------- When a graph has been displayed, four options are offered at the foot of the screen. These are: 4.2.1 "G" - grid lines ---------------------- Each press of "G" adds or removes a set of grid lines on the graph. These are drawn at the position of the axis tick marks which WOSP has chosen. 4.2.2 "C" - copy to printer --------------------------- This option copies the currently displayed graph to an attached printer. This will only work if the printer is connected in such a way that the BASIC command COPY is obeyed normally. A ZX Printer or Alphacom 32 (or equivalent) is suitable, or an Epson-compatible printer connected to the RS232 port on a 128K Spectrum (provided 128K mode is being used). Various other add-on interfaces for the Spectrum support the COPY command for full size printers, but the ZX Interface 1 does not. See also section 6.1 regarding initializing other interface types. 4.2.3 "E" - expand ------------------ This useful facility enables a portion of the displayed graph to be expanded to be seen in greater detail. Pressing "E" will cause the program to request the lower and upper time limits for the portion of the graph to be expanded. For reference the time range for the entire existing plot is shown, and your selected times should, of course, lie within this range. Times input here should be in units of seconds, minutes or hours as indicated. WOSP will then display a new graph covering just the specified time interval, with the time axis re-drawn accordingly. The vertical axis will have changed also - to show the maximum detail, the program chooses a new axis range which just includes the highest and lowest values during the specified time. Because of this feature, it is sometimes useful to use the Expand facility but specify the entire time range of the original plot, to just expand the vertical axis. After each plot the same options are given, so that the expand option can be used repeatedly for the same set of data to show different time ranges. 4.2.4 "R" - return ------------------ This simply returns to the channel selection menu, enabling a further choice to be made. 5. COPYING WOSP TO TAPE, MICRODRIVE OR OPUS ------------------------------------------- The WOSP program is copyright, but you are free to make a back-up copy for your own use, or to transfer the program to microdrive or Opus disc. This is achieved simply by pressing the SYMBOL SHIFT and "6" keys together when the main menu is displayed. This will bring up another short menu offering Tape or Microdrive saves, which will occur automatically when the appropriate selection is made. The microdrive save (which is to drive no. 1), will also work with Opus disc systems. In either case, three flies are saved: WOSP, the BASIC program; WOSPC1, the main section of machine code (length 1847 bytes, starting at address 63689); and WOSPC2, more code (length 12646, starting at 39299) which has been produced from a BASIC source using the HiSoft BASIC Compiler. To re-load the saved program, simply LOAD "WOSP" or LOAD *"m";1;"WOSP", which will also automatically load the other two files. 6. MISCELLANEOUS INFORMATION ---------------------------- 6.1 Printer initialization -------------------------- If you are using a printer (which must obey the COPY command - see section 4.2.2), and it or the interface needs some commands to initialize it, these may be added to the BASIC program using any line numbers in the range 2 - 99. This will ensure that the commands are executed at the start of each WOSP run. To make the changes, load WOSP as normal, press BREAK, add the required statements, and then RUN. You may then save the modified program using the procedure explained in section 5. 6.2 Re-starting WOSP after a break ---------------------------------- During demodulation, the BREAK key has the special function of halting the decoding process (without exiting from the program). During the plotting sequence (i.e. after selecting "P" on the main menu) the BREAK key Is inoperative. At other times, it will halt the program in the normal way. If this, or any error condition, has caused WOSP to stop, it can be simply restarted with the RUN command, which will bring up the main menu, normally without losing any of the data that was in the buffer before the break. 6.3 Sample data --------------- The second side of the WOSP cassette tape contains a sample recording of signals from UO-11, including a WOD survey. This can be used to gain familiarity with the features of the program before trying "real" received data.