                     UoSAT SPACECRAFT DATA SHEET

                        UNIVERSITY OF SURREY
                      Guildford, Surrey GU2 5XH
                 Tel: 0483-509143    FAX: 0483-34139

        TELEMETRY ON THE UOSAT-3 PACSAT COMMUNICATIONS EXPERIMENT

Telemetry is used to monitor the state of experiments and housekeeping 
subsystems onboard satellites.  In particular, it measures voltages,
currents, temperatures and the status of digital switches.

The UoSAT-3 PCE transmits telemetry in AX.25 UI frames at 9600 bps.  A 
"packet" of telemetry is wholly contained in the information field of a
single UI frame.  Each packet contains a timestamp indicating when the
samples were taken, the data samples (including additional information
detailed below), and a CRC.  Although AX.25 UI frames are protected by their
own CRC, the additional CRC is provided to verify the link between the TNC
used to receive the UI frames and the computer used to display or analyse the
telemetry.  Thus the telemetry packet format is:

<timestamp> <data> [<data>...] <crc>

All of this is contained WITHIN the AX.25 UI frame information field.  
The information field will not exceed 256 bytes in length.

In addition to the fields contained in the telemetry packet, the receiving 
process must maintain a <channel> variable.  The use of this variable becomes
clear below.

BINARY DATA FORMAT

BYTE ORDER

All multi-byte values are stored least significant byte first.  Where bits
are numbered, bit 0 is the least significant bit of a byte or multi-byte
value.

TIMESTAMP

The <timestamp> is a 4-byte, unsigned integer representing the number of 
seconds since 0000 UTC January 1, 1970.  This is the UNIX standard time, and 
is also the format for times under the draft ANSI C standard.

DATA

Each <data> item is a 2-byte, unsigned integer, with internal encoding as 
follows:

bits 0  - 11     A 12-bit <value> field
bits 12 - 15     A 4-bit <type> field

The <type> field tells the receiver how to interpret the <value> field, and 
what other action to take.  The following <type> items are defined:

       bit
    15 14 13 12       Interpretation and Action
    -- -- -- --       --------------------------
     0  0  1  0       <value> is a channel number.
                      Initialise <channel> variable to <value>.

     0  0  0  1       <value> is the telemetry sample for current <channel>.
                      Do not increment <channel> after processing <value>.

     0  0  0  0       <value> is the telemetry sample for current <channel>.
                      Increment <channel> after processing <value>.

All other types are currently undefined and should be ignored.

The first <data> item in a telemetry packet will always be of type 0010, to 
initialise the channel variable.

CRC

The cyclic redundancy check is provided as protection against errors on the 
link between the receiving TNC and the computer which is processing the 
telemetry.  It is the XMODEM CRC algorithm encoding all bytes, from the first
byte of the <timestamp> to the last <data> byte.

ADDRESS and PID

We are currently transmitting these frames with an AX.25 Protocol 
Identification byte of 0xf0.  The source address is UOSAT3-11 and the 
destination address is TLM-0.  The source SSID -11 is used to allow telemetry
to be filtered using the LCALLS feature of a TAPR-type TNC.  To see other 
packets but not telemetry, use:

cmd:LCALLS uosat3-11


EXPLANATION and EXAMPLES

In the examples, assume that the <timestamp> is 2638d6ce hexidecimal. (From 
here on, hexadecimal numbers are indicated by a leading 0x.)

You will see that this packet format allows us to efficiently encode the most
common type of telemetry "frame" - e.g. a frame in which we begin with
channel 0 and increment through the channel numbers.  In this case, the
packet starts out with:

0x2638d6ce    /* timestamp                                 */
0x2000        /* <type>=0010, <value>=0                      */
              /* so set your channel variable to 0             */

It then proceeds with the data for each channel, with the <type> bits 
indicating "increment" (0000). For example, if channel 0 is at a value of 
0x496 and channel 1 is at 0x003, we have:

0x2638d6ce    /* timestamp                                     */
0x2000        /* set your channel variable to 0                */
0x0496        /* value of channel 0 is 496 and increment channel to 1 */
0x0003        /* value of channel 1 is 003 and increment channel to 2 */

Etc.

However, on UoSAT-3 (as on UO-11) we have some "submultiplexed channels". 
The primary example is channel number 15. Every 12 times channel 15 is read
it returns voltages for each of the 10 battery cells and two 0 values for 
synchronisation.  Ideally we would have the PCE read the channel 12 times for
each telemetry packet and transmit all 12 values.  This is why the "display 
but don't increment" <type> (0001) is defined.  So, now, in our frame we have

0x2000        /* set your channel variable to 0                  */
0x0496        /* value of channel (0) and increment channel to 1 */
0x0001        /* value of channel (1) and increment channel to 2 */
 ...          /* 13 other <data> items with "increment" type.    */
 ...          /* leaving the channel variable at 15              */
0x10nn        /* first submultiplexed battery cell sample        */
0x10nn        /* second submultiplexed battery cell sample       */
 ...          /* and so on, until the last of the 12 samples,    */
0x00nn        /* which is of "increment type.                    */

We can also "jump over" any unwanted channels in the frame by inserting 
<type> values to "set your channel variable".  This is done on UO-14 to skip 
the blank channel numbers between analogue telemetry channels and digital 
status points.

So we have a flexible and efficient encoding system which does not require
the transmission of every channel number, yet permits submultiplexing and
channel number jumping.  In the case of UO-14, where the native telemetry
samples are 12-bits, we have "wasted" only 4 bits per channel on supervisory
information to arrive at this flexibility.

SAMPLE FRAME

A hex dump of the data in a telemetry packet from the UO-14 engineering model
is reproduced below.  It includes use of all features: 3 "set channel 
variable" entries (one at the beginning of the frame and 2 to jump over 
unwanted channels), 12 consecutive samples of channel 15 and 56 other
samples.  The CRC is also correct.

      CE D6 38 26 00 20 00 00 16 02 37 00 07 00
CF 01 CF 01 CF 01 08 02 00 00 49 02 CB 00 2A 00
CF 01 CF 01 F4 01 33 12 32 12 30 12 2B 12 29 12
27 12 22 12 24 12 00 10 00 10 3A 12 34 02 00 00
6D 00 81 02 34 00 CF 01 CF 01 C8 01 81 01 54 01
2C 00 C7 01 04 03 CF 01 CF 01 CF 01 E6 01 B0 00
03 01 36 01 5D 01 6A 01 A1 01 CB 01 28 20 00 00
00 00 00 00 00 00 8F 01 FB 01 10 02 55 02 DD 00
40 20 80 00 00 08 02 00 80 00 12 08 83 00 10 04
08 08 00 08 AB A8 


THE ABOVE FRAME, COMPLETELY DECODED

CE D6 38 26           TIME: 2628d6ce

Input     Type           Value     Action
-----     ----------      -----     -----------------
0020      2    set       000       set channel to 0
0000      0    inc       000       data for chan 0
1602      0    inc       216       data for chan 1
3700      0    inc       037       data for chan 2
0700      0    inc       007       data for chan 3
CF01      0    inc       1cf       data for chan 4
CF01      0    inc       1cf       data for chan 5
CF01      0    inc       1cf       data for chan 6
0802      0    inc       208       data for chan 7
0000      0    inc       000       data for chan 8
4902      0    inc       249       data for chan 9
CB00      0    inc       0cb       data for chan 10
2A00      0    inc       02a       data for chan 11
CF01      0    inc       1cf       data for chan 12
CF01      0    inc       1cf       data for chan 13
F401      0    inc       1cf       data for chan 14
3312      1    nop       2cc       data for chan 15      (Cell 2)
3212      1    nop       232       data for chan 15      (Cell 3)
3012      1    nop       230       data for chan 15      (Cell 4)
2B12      1    nop       22b       data for chan 15      (Cell 5)
2912      1    nop       229       data for chan 15      (Cell 6)
2712      1    nop       227       data for chan 15      (Cell 7)
2212      1    nop       222       data for chan 15      (Cell 8)
2412      1    nop       224       data for chan 15      (Cell 9)
0010      1    nop       000       data for chan 15      (Synch.)
0010      1    nop       000       data for chan 15      (Synch.)
3A12      1    nop       23A       data for chan 15      (Cell 0)
3402      0    inc       234       data for chan 15      (Cell 1)
0000      0    inc       000       data for chan 16
6D00      0    inc       06D       data for chan 17
8102      0    inc       281       data for chan 18
3400      0    inc       034       data for chan 19
CF01      0    inc       1CF       data for chan 20
CF01      0    inc       1CF       data for chan 21
C801      0    inc       1C8       data for chan 22
8101      0    inc       181       data for chan 23
5401      0    inc       154       data for chan 24
2C00      0    inc       02C       data for chan 25
C701      0    inc       1C7       data for chan 26
0403      0    inc       304       data for chan 27
CF01      0    inc       1CF       data for chan 28
CF01      0    inc       1CF       data for chan 29
CF01      0    inc       1CF       data for chan 30
E601      0    inc       1E6       data for chan 31
B000      0    inc       0B0       data for chan 32
0301      0    inc       103       data for chan 33
3601      0    inc       136       data for chan 34
5D01      0    inc       15D       data for chan 35
6A01      0    inc       16A       data for chan 36
A101      0    inc       1A1       data for chan 37
CB01      0    inc       1CB       data for chan 38
2820      2    set       028       set channel to 40     (Skip 39)
0000      0    inc       000       data for chan 40
0000      0    inc       000       data for chan 41



Input     Type           Value     Action
-----     ----------      -----     -----------------
0000      0    inc       000       data for chan 42
0000      0    inc       000       data for chan 43
8F01      0    inc       18f       data for chan 44
FB01      0    inc       1fb       data for chan 45
1002      0    inc       210       data for chan 46
5502      0    inc       255       data for chan 47
DD00      0    inc       0dd       data for chan 48
4020      2    set       040       set channel to 64

Channels 64 and above are status channels, each containing 12 status bits.

8000      0    inc       080       data for chan 64
0008      0    inc       800       data for chan 65
0200      0    inc       002       data for chan 66
8000      0    inc       080       data for chan 67
1208      0    inc       812       data for chan 68
8300      0    inc       083       data for chan 69
1004      0    inc       410       data for chan 70
0808      0    inc       808       data for chan 71
0008      0    inc       800       data for chan 72

ABA8                     a8ab      XMODEM CRC VALUE

XMODEM CRC

The XMODEM CRC receive checking is defined using the following C code:

unsigned short crc;              /* global crc register.              */
crc = 0;                         /* clear crc register                */
for (all received data bytes)
    gen_crc(rx_byte);            /* crc the incoming data bytes       */
gen_crc(1st_crc_byte);           /* crc the incoming first crc byte   */
if(gen_crc(2nd_crc_byte))        /* crc the incoming second crc byte  */
        bad_crc();               /* non-zero crc reg. is an error     */
else
        good_crc();              /* zero crc is a good packet.        */

/* Function to take a byte and run it into the XMODEM crc generator.  */
/* Uses a global CRC register called "crc".                           */
gen_crc(data)
char data;
{
    int y;
    crc ^= data << 8;
    for(y=0; y < 8; y++)
        if( crc & 0x8000)
            crc = crc << 1 ^ 0x1021;
        else
            crc <<= 1;
    return crc;
}

Further information on generation of XMODEM CRC via more efficient byte-wise 
methods can be found in BYTE Magazine,  September 1986, pp. 115-124.

TELEMETRY INTERPRETATION

ANALOGUE CHANNELS.

Replace N in the equation with the sensor value from the received telemetry.

Channel         Name                   Equation
------- ------------------------------ --------
   0    Array +X Curr. (mA)            (N * 1.80388)+0.649398
   1    Array Volts (V)                (N * 0.0560561)-0.183998
   2    +5V  Current (mA)              (N * 3.20354)-29.6648
   3    +14V Current (mA)              (N * 4.454)-87.93
   4    -X Array Temp. (Deg C)         (N * -0.3)+95.1
   5    PCE CPU Temp. (Deg C)          (N * -0.3)+95.1
   6    Transmitter Temp (Deg C)       (N * -0.3)+95.1
   7    Tx. 0 Output (V eqvxxxxxxxx)   (N * 0.005)+0
   8    Array -X Curr. (mA)            (N * 1.76691)-10.6721
   9    +10V Voltage (V)               (N * 0.014268)+0
  10    -10V Current (mA)              (N * 0.142022)-7.63663
  11    Battery Current (mA)           (N * 2.8863)+0
  12    +X Array Temp. (Deg C)         (N * -0.3)+95.1
  13    Battery Temp. (Deg C)          (N * -0.3)+95.1
  14    Tx. 1 Output (V eqv)           (N * 0.005)+0
  15    Batt Cell Volt. (V)            (N * 0.0023502)+0
  16    Array +Y Curr. (mA)            (N * 1.75297)-0.806367
  17    +10V Current (mA)              (N * 0.142735)+0.371105
  18    -10V Voltage (V )              (N * -0.016609)+0
  19    PCM Input Curr. (mA)           (N * 2.23267)-1.17377
  20    -Y Array Temp. (Deg C)         (N * -0.3)+95.1
  21    OBC 1802 Temp. (Deg C)         (N * -0.3)+95.1
  22    Nav. Mag X (uT)                (N * 0.115)-57.7543
  23    Nav. Mag Z (uT)                (N * 0.1103)-55.478
  24    Nav. Mag Y (uT)                (N * -0.113)+57.7359
  25    Array -Y Curr. (mA)            (N * 1.7854)-10.5338
  26    +5V  Voltage (V)               (N * 0.0073268)+0
  27    Battery Voltage (V)            (N * 0.0176724)-0.1033
  28    Boom Motor Temp. (Deg C)       (N * -0.3)+95.1
  29    +Y Array Temp. (Deg C)         (N * -0.3)+95.1
  30    ADCS Box Temp. (Deg C)         (N * -0.3)+95.1
  31    MagTorq +/- Mag. (V)           (N * 0.005)+0
  32    Boom Deployment (m)            (N * 0.01818)-1.109
  33    Eng. 2 (V)                     (N * 0.005)+0
  34    Rx. 1 Strength (V)             (N * 0.005)+0
  35    Rx. 2 Strength (V)             (N * 0.005)+0
  36    Eng. 1 (V)                     (N * 0.005)+0
  37    Rx. 1 Discrimin. (kHz)         (N * 0.02315)-12.96
  38    Rx. 2 Discrimin. (kHz)         (N * 0.02315)-11.57
  39    TDE/CPE (V)                    (N * 0.005)+0
  40    RAMUNIT Bank 0 (mA)            (N * 1)+0
  41    RAMUNIT Bank 1 (mA)            (N * 1)+0
  42    RAMUNIT Bank 2 (mA)            (N * 1)+0
  43    RAMUNIT Bank 3 (mA)            (N * 1)+0
  44    PCE CPU Curr. (mA)             (N * 0.416155)-0.024982
  45    BCR DAC Voltage (V)            (N * 0.005)+0
  46    Rx. 1 AFC (V )                 (N * 0.005)+0
  47    Earth Detector (V )            (N * 0.005)+0
  48    Rx. 2 AFC (V )                  (N * 0.005)+0



DIGITAL STATUS POINTS

Digital status bits are found in channels 64 - 72.  Each of the channel
values from the received telemetry will contain 12 status bits.  Status bit
0 is the most significant bit in telemetry value 64, status bit 11 is the
least significant bit in telemetry value 64, status bit 12 is the most
significant bit in telemetry value 65, and so on.


STATUS BIT  000000000011111111112222222222...
            012345678901234567890123456789...

TLM BIT     1100000000001100000000001100000...    
            1098765432101098765432101098765...

TLM CHANNEL |-----64----|-----65----|---66-...


Bit   Meaning                   1                    0          
----- ------------------------- -----                -----
  0   Downlink                  On                   Off   
  1   PCE Downlink keying       On                   Off          
  2   1802 load                 WaitL                WaitH        
  3   Digital MUX Bit 2 =       1                    0            
  4   Spare Demod               FSK                  AFSK         
  5   Magnetorquer Power +5V    On                   Off          
  6   Pyros                     Enable               Disable      
  7   BCR 1 DAC Enable          On                   Off          
  8   Command MUX Bit 0 =       1                    0            
  9   VLSI Chip Select          1                    0            
 10   Uplink Multiplexer DASH0  Enable               Disable      
 11   SPARE DASH0               Enable               Disable      
 12   Downlink Select           1                    0            
 13   RAMDISK power             On                   Off          
 14   1802 boot                 Addr0000             Addr8000     
 15   Digital MUX Bit 1 =       1                    0            
 16   Rx 1 Demod                FSK                  AFSK         
 17   Magnetorquer Power -10V   On                   Off          
 18   Pyros                     Fire                 NoFire       
 19   BCR 2 DAC Enable          On                   Off          
 20   Command MUX Bit 1 =       1                    0            
 21   Telemetry reset           Reset                Run          
 22   Uplink Mutliplexer DASH1  Enable               Disable      
 23   SPARE DASH1               Enable               Disable      
 24   Downlink Frequency        VITA                 435.070      
 25   Bank 0                    On                   Off          
 26   1802 Prom/Ram             RAM                  ROM          
 27   Digital MUX Bit 0 =       1                    0            
 28   Rx 2 Demod                FSK                  AFSK         
 29   Magnetorquer Str          1                    0            
 30   Boom Power +14V           On                   Off          
 31   EUD Power                 On                   Off          
 32   Command MUX Bit 2 =       1                    0            
 33   Telemetry RAT select      1802                 PCE          
 34   1802 DASH0                Enable               Disable      
 35   DASH Rx/TLM MUX Bit 0     1                    0            
 36   Downlink Power            High                 Low          
 37   Bank 1                    On                   Off          
 38   1802 EDAC                 Disable              Enable       
 39   Audio MUX Bit 2 =         1                    0            



Bit   Meaning                   1                    0          
----- ------------------------- -----                -----
 40   Downlink Select           DASH0                SPARE0       
 41   Magnetorquer B4           1                    0            
 42   Boom                      Enabled              Disabled     
 43   PCE EDAC                  Enable               Disable      
 44   Serial Command Watchdog   Reset                Run          
 45   Telemetry dwell select    DASH0                DASH1        
 46   1802 DASH1                Enable               Disable      
 47   DASH Rx/TLM MUX Bit 1     1                    0            
 48   PCE CPU power             On                   Off          
 49   Bank 2                    On                   Off          
 50   CPE/TDE Power             On                   Off          
 51   Audio MUX Bit 1 =         1                    0            
 52   Downlink Select           SPARE1               DASH1        
 53   Magnetorquer B3           1                    0            
 54   Boom Extend               Moving!              Off          
 55   PCE ROM                   Hi                   Low          
 56   1802 DMA Select Bit 0     1                    0            
 57   Telemetry frame counter   Inhibit              Advance      
 58   PCE DASH0                 Enable               Disable      
 59   SPARE PROM Select         Hi                   Low          
 60   Rx 1 AFC                  On                   Off          
 61   Bank 3                    On                   Off          
 62   CPE Code                  Copy 1               Copy 0       
 63   Audio MUX Bit 0 =         1                    0            
 64   Telemetry Power           On                   Off          
 65   Magnetorquer B2           1                    0            
 66   Boom Retract              Moving!              Off          
 67   TDE Mode                  Read                 Measure      
 68   1802 DMA Select Bit 1     1                    0            
 69   Telemetry dwell read      On                   Off          
 70   PCE DASH1                 Enable               Disable      
 71   SPARE Reset               Run                  Reset        
 72   Rx 2 AFC                  On                   Off          
 73   1802 power                On                   Off          
 74   CPE Code                  Bootloader           CPE          
 75   Rx 1 Frequency            VITA                 145.975      
 76   Nav Mag Power             On                   Off          
 77   Magnetorquer B1           1                    0            
 78   Redundant PCM             Toggle               Toggle       
 79   SPARE Computer Power      On                   Off          
 80   Telemetry Mode            Serial               RAT          
 81   Telemetry dwell write     On                   Off          
 82   CPE/TDE DASH0             Enable               Disable      
 83   SPARE EDAC                Disable              Enable       
 84   PCE Reset                 Run                  Reset        
 85   1802 Reset                ClearL               ClearH       
 86   CPE Reset                 Reset                Run          
 87   Rx 2 Frequency            VITA                 145.900      
 88   Magnetorquer Power +14V   On                   Off          
 89   Magnetorquer B0           1                    0            
 90   BCR Select                Toggle               Toggle       
 91   Downlink Mode             Sync                 Asynch       
 92   Telemetry Rate            9600                 1200         
 93   Telemetry VLSI Power      On                   Off          
 94   CPE/TDE DASH1             Enable               Disable      
 95   SPARE CPU Speed Select    4 Mhz                1 MHz        
 96   1802 'Q' output           1                    0            
 97   Pyros                     Not Fired            Fired        
 98   BCR Selected              B                    A            
 99   Batteries                 Discharge            Charge       
100   PCM Selected              B                    A            

CONCLUSION

AMSAT-UK sells a program called DTLM.EXE for the IBM PC which decodes and 
displays this telemetry format as well as the format transmitted by the
UoSAT-2 FORTH Diary.

Your comments are solicited - especially relating to any errors in this 
document.  Address them to 

The UoSAT Unit
University of Surrey
Guildford, Surrey 
GU2 5XH

United Kingdom telephone:     0483-509143          Fax: 0483-34139
International telephone:     +44 483 509143        Fax: +44 483 34139
Internet:                     k8ka@tomcat.gsfc.nasa.gov
