# STEREO/HET Housekeeping

> **Version 1.1**

# Raw Data to Engineering Units Conversion Algorithms

All offsets noted in this document are relative to the packet
definitions specified below which are produced by the HET flight
software and received by SEP Central. Please note that the offsets
defined in the HET housekeeping packet (ApId 598) will need to be
adjusted (add 26 to each offset since HET HK starts in byte 37) to
extract the correct housekeeping bytes from the SEP housekeeping packet
(ApId 577).

# Status and Singles Rate Packet (ApID: 591 (dec) 24f (hex)): 

  ---------- ----------- ------------------------------------------------
  Offset     Bytes       B-packet contents

  0          11          CCSDS header

  11         1           HET mode byte

  12         2           TBD

  14         2           Major frame number

  16         28          14 Single detector rates

  44         2           Last command number

  46         4           Last command ID

  50         14          Offsets for current selected channels (h1i
                         logain=0, h1i logain=1, h1o logain=0, h1o
                         logain=1, h2 logain=0, h2 logain=1, h3 logain=0,
                         h3 logain=1\... h6 logain=0, h6 logain=1)

  \* 64      7           h1i chip=0 addr, h1o chip=0 addr, h2 chip=1,
                         addr, h2 chip chip =1 addr..h6 chip=1 addr

  71         3           Status Bytes (TBD)

  74         100         50 sample H1-only PHs

  174        96          STIM PH events

  270        1           N stimulus events in packet

  271        1           Checksum
  ---------- ----------- ------------------------------------------------

\* offset 64 through offset 70 = H1i, H1o, H2, H3, H4, H5, and H6
channel index numbers (range 0 -31).

# Housekeeping Packet (ApID: 598 (dec) 256 (hex)):

  ---------- ----------- ------------------------------------------------
  Offset     Bytes       G-packet contents

  0          11          CCSDS header

  11         1           ADC Temp 1

  12         1           ADC Temp 2

  13         1           PHASIC 0 PH channel ID

  14         1           PHASIC 0 ADC Preamp

  15         2           PHASIC 0 high gain threshold

  17         2           PHASIC 0 low gain threshold

  19         2           PHASIC 0 leakage current DAC setting

  21         1           PHASIC 1 PH channel ID

  22         1           PHASIC 1 ADC Preamp

  23         2           PHASIC 1 high gain threshold

  25         2           PHASIC 1 low gain threshold

  27         2           PHASIC 1 leakage current DAC setting

  29         2           Error Flags (16 bits)

  31         2           Software version ID (16 bits)

  23         2           N invalid token

  35         2           N invalid trigger

  37         2           N lost raw events

  39         2           Major frame number

  41         3           Table checksum

  44         1           24-bit DAC value, bits 0:7 (PHASIC 0 DAC)

  45         1           24-bit DAC value, bits 8:15 (PHASIC 1 DAC)

  46         1           24-bit DAC value, bits 16:23 (un:4, mux:2,
                         rng1:1, rng0:1)

  47         5           Available (TBD)

  52         219         Not available for use

  271        1           Checksum
  ---------- ----------- ------------------------------------------------

**Temperature 1** conversion (degrees C):

39.4 \* tan (.0085 \* (offset 11, ApId 598) -- 116)) + 10

**Temperature 2** conversion (degrees C):

39.4 \* tan (.0085 \* (offset 12, ApId 598) -- 116)) + 10

Conversion for **PHASIC 0 ADC Preamp** (offset 14, ApId 598) and

> **PHASIC 1 ADC Preamp** (offset 22, ApId 598):

Preamp0 = 0.01953 \* (255 -- (offset 14, ApId 598))

Preamp1 = 0.01953 \* (255 -- (offset 22, ApId 598))

In order to determine the channel number index (range 0-6) for H1i, H1o,
H2, H3, H4, H5 and H6, you need to look at the 2 packets with ApIds 591
and 598 and do a comparison as follows:

H1i (0 channel index number): (offset 13, ApId 598) = (offset 64, ApId
591)

H1o (1 channel index number): (offset 13, ApId 598) = (offset 65, ApId
591)

H2 (2 channel index number): (offset 13, ApId 598) = ((offset 66, ApId
591)-16)

H3 (3 channel index number): (offset 13, ApId 598) = ((offset 67, ApId
591)-16)

H4 (4 channel index number): (offset 13, ApId 598) = ((offset 68, ApId
591)-16)

H5 (5 channel index number): (offset 13, ApId 598) = ((offset 69, ApId
591)--16)

H6 (6 channel index number): (offset 13, ApId 598) = ((offset 70, ApId
591)-16)

Use the following parameters in the formulas to convert the **PHASIC 0
leakage current DAC** (offset 19, ApId 598) and **PHASIC 1 leakage
current DAC** (offset 27, ApId 598):

K0 = 0.05859

K1 = 0.1172

N0 = 5 LSBs of PHASIC 0 leakage current DAC setting (offset 19, ApId
598)

N1 = 5 MSBs of PHASIC 0 leakage current DAC setting (offset 19, ApId
598)

N2 = 5 LSBs of PHASIC 1 leakage current DAC setting (offset 27, ApId
598)

N3 = 5 MSBs of PHASIC 1 leakage current DAC setting (offset 27, ApId
598)

Conversion for **PHASIC 0 leakage current DAC** setting (offset 19, ApId
598) for **H1i and H1o** channel index number (0 or 1 as determined in
the comparison formula given above for H1i and H1o):

N1 + (0.03906 \* N0) -- (K0 \* (50 -- offset 14, ApId 598))

Conversion for **PHASIC 1 leakage current DAC** setting (offset 27, ApId
598) for **H2 and H6** channel index number (2 or 6, as determined in
the comparison formula given above for H2 and H6):

N3 + (0.03906 \* N2) -- (K0 \* (50 -- offset 22, ApId 598))

Conversion for **PHASIC 1 leakage current DAC** setting (offset 27, ApId
598) for **H3, H4 and H5** channel index number (3, 4 or 5, as
determined in the comparison formula given above for H3, H4 and H5):

N3 + (0.03906 \* N2) -- (K1 \* (50 -- offset 22, ApId 598))