GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LTC / V6-1-0

Constituent: ltct     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LTC_ltc.c File Reference

Thermal Control readout and control algorithm functions. More...

#include "string.h"
#include "stdlib.h"
#include "LTC/LTC_msgs.h"
#include "PBS/WUT.h"
#include "PBS/TOV.h"
#include "PBS/TOC.h"
#include "CCSDS/CCSDS_pkt.h"
#include "LEM/defs.h"
#include "LEM/encode.h"
#include "LEM/encode_structs.h"
#include "LEM/decode.h"
#include "IMM/FPM_pubdefs.h"
#include "ITC/ITC_pubdefs.h"
#include "LCBD/LCBD.h"
#include "MSG/MSG_pubdefs.h"
#include "ltcPrivate.h"

Include dependency graph for LTC_ltc.c:


Functions

static unsigned int LTC_LcbRspCB (LTC_Wrk *tw, LCBD_xcb *xcb)
 LCB callback to process responses from reads of PDU registers.
static void LTC_freeCmd (ITC_QueueItem *qitem, unsigned int status, LTC_Wrk *tw, void *prm1, void *prm2)
static void LTC_freeTelem (ITC_QueueItem *qitem, unsigned int status, LTC_Wrk *tw, void *prm1, void *prm2)
static unsigned int LTC_CnvSmthSnsrs (LTC_Wrk *tw, LTC_HeatPipe *hp, LTC_SnsrType sTyp)
 Converts sensor values to smoothed temperature for a heat pipe.
static int LTC_IsGoodTemps (const LTC_HeatPipe *hp)
 Check goodness of collected temperature values for this heat pipe.
static void LTC_CalcHtrOnOff (LTC_Wrk *tw, const int h)
 Calculate on or off commands for a HP reservoir heater.
static signed int LTC_EstTmp (const LTC_Temperature *tmp)
 Estimates temperature for next cycle.
static signed int LTC_Smooth (LTC_Temperature *tmp)
 Returns smoothed value for temperature.
static void LTC_CnvAdcToTmp (LTC_Sensor *snsr, LTC_Temperature *tmp)
 Converts sensor values to temperature for given heat pipe.
unsigned short GetADCBits (const unsigned int *pduR, const int adc)
 Get 12-bit ADC values from PDU register given ADC number.
static void LTC_CmdHtrs (LTC_Wrk *ltcW)
 Issue "on" or off commands to HP reservoir heaters.
static void LTC_SndTlm (LTC_Wrk *tw)
 Collect, format and send telemetry for LTC.
unsigned int LTC_ProcPduRsp (LTC_Wrk *tw, LTC_CntlProc_Prm *rb, const LTC_rl *rl)
 Callback to process responses from asynchrous reads of PDU registers.
void LTC_ReadSensors (LTC_Wrk *tw)
 Start cycle of LTC control - issue LCB commands.
WUT_cb_status LTC_WkUp (void *p, WUT_tmr *wut)
 Wake up LTC for another processing cycle and restart wake timer.

Detailed Description

Thermal Control readout and control algorithm functions.


Function Documentation

unsigned short GetADCBits const unsigned int *  pduR,
const int  adc
 

Get 12-bit ADC values from PDU register given ADC number.

Parameters:
pduR - PDU register bits (96 bits or 3 x 32)
adc - adc number relative to this register (0 - 7)
Byte Offsets 0 1 2 3 4 5 6 7 8 9 0 11 12

8-----8-----8-----8-----8-----8-----8-----8-----8-----8-----8-----8-----8 | | | | | | | | | | | | | | | | | | | | | | | | | --mbz-^-m^----6---^----5---^----4---^---3----^---2----^---1----^----0---- ADC Numbers Byte ADC# OffSet Operation ---- ------ --------- 6 1 0xFFF 5 3 >>4 4 4 0xFFF 3 6 >>4 2 7 0xFFF 1 9 >>4 0 10 0xFFF

static void LTC_CalcHtrOnOff LTC_Wrk tw,
const int  h
[static]
 

Calculate on or off commands for a HP reservoir heater.

Parameters:
tw - LTC working storage.
h - Heat pipe index.

static void LTC_CmdHtrs LTC_Wrk ltcW  )  [static]
 

Issue "on" or off commands to HP reservoir heaters.

Parameters:
ltcW - LTC working storage.

void LTC_CnvAdcToTmp LTC_Sensor snsr,
LTC_Temperature tmp
[static]
 

Converts sensor values to temperature for given heat pipe.

Parameters:
snsr - Heat pipe sensor record.
tmp - Heat pipe temperature.
A consistency check is made that the sensor value has not exceeded the maximum change limit in one LTC interval.

unsigned int LTC_CnvSmthSnsrs LTC_Wrk tw,
LTC_HeatPipe hp,
LTC_SnsrType  sTyp
[static]
 

Converts sensor values to smoothed temperature for a heat pipe.

Parameters:
tw - LTC working storage.
hp - Heat pipe record to get smoothed celsius temperature.
sTyp - Sensor type.
Return values:
A LTC MSG code.
The sensor defintion in snsr provides the hp and sensor type which specifies the sensor per the hardware configuration as given in the Sensor Definition File. The final converted and smoothed tempeature is stored in the the temp array pointed to by hp. The temp array contains the RIT and reservoir tempeatures that feed the control algorithm.

signed int LTC_EstTmp const LTC_Temperature tmp  )  [static]
 

Estimates temperature for next cycle.

Parameters:
tmp - Heat pipe temperature structure.
Estimates temperature for next cycle using last good raw temperature.

static void LTC_freeCmd ITC_QueueItem *  qitem,
unsigned int  status,
LTC_Wrk tw,
void *  prm1,
void *  prm2
[static]
 

Free memory after sending ITC command packets.

Parameters:
qitem The memory buffer.
status Status of telemetry.
tw LTC control structure.
prm1 Completion callback paramter 1.
prm2 Completion callback paramter 2.

static void LTC_freeTelem ITC_QueueItem *  qitem,
unsigned int  status,
LTC_Wrk tw,
void *  prm1,
void *  prm2
[static]
 

Free memory after sending ITC telemetry packets.

Parameters:
qitem The memory buffer.
status Status of telemetry.
tw LTC control structure.
prm1 Completion callback paramter 1.
prm2 Completion callback paramter 2.

static int LTC_IsGoodTemps const LTC_HeatPipe hp  )  [static]
 

Check goodness of collected temperature values for this heat pipe.

Parameters:
hp - Heat pipe data structure.
The smoothing filters for the RIT and reservoir temperature sensors may not have enough back values so the temperature readings will be noisy, and not suitable for commanding the heaters. The length of filters may be (probably not) different for each sensor type (RIT or reservoir) and heat pipe.

static unsigned int LTC_LcbRspCB LTC_Wrk tw,
LCBD_xcb *  xcb
[static]
 

LCB callback to process responses from reads of PDU registers.

Parameters:
tw - LTC working storage.
xcb - LCBD control block.
Return values:
'0'. 

unsigned int LTC_ProcPduRsp LTC_Wrk tw,
LTC_CntlProc_Prm rb,
const LTC_rl rl
 

Callback to process responses from asynchrous reads of PDU registers.

Parameters:
tw - LTC working storage.
rb - Response processing block.
rl - A pointer to the LTC PDU response data.
Return values:
A LTC MSG code.

void LTC_ReadSensors LTC_Wrk tw  ) 
 

Start cycle of LTC control - issue LCB commands.

Parameters:
tw - LTC working storage
The command lists are already built (LTC_InitIO) during initialization. This logic sends each command list to the LCB queue were they are executed. As responses are generated, the callback LTC_LcbRspCB is executed which in turn executes LTC_ProcPduRsp to process the sensor data.

static void LTC_Smooth LTC_Temperature tmp  )  [static]
 

Returns smoothed value for temperature.

Parameters:
tmp - Temperature record for heat pipe.

static void LTC_SndTlm LTC_Wrk tw  )  [static]
 

Collect, format and send telemetry for LTC.

Parameters:
tw - LTC working storage.

WUT_cb_status LTC_WkUp void *  p,
WUT_tmr *  wut
 

Wake up LTC for another processing cycle and restart wake timer.

Parameters:
p - LTC Working storage.
wut - LTC wake up timer.


Generated on Thu Jun 14 07:02:51 2007 by  doxygen 1.4.4