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

Constituent: ltct     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LTC_control.c File Reference

Thermal Control public functions: intialization, telemetry, shutdown. More...

#include "PBS/TASK.h"
#include "PBS/WCT.h"
#include "PBS/MBA.h"
#include "PBS/RW.h"
#include "LTC/ltc.h"
#include "LTC/LTC_msgs.h"
#include "LTC/LTC_cmddefs.h"
#include "LTC/LTC_cmdxtrn.h"
#include "LTC/LTC_tlmdefs.h"
#include "IMM/RBM_pubdefs.h"
#include "FBS/FBS_pubrtos.h"
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_pubdefs.h"
#include "LEM/defs.h"
#include "LEM/encode.h"
#include "LEM/encode_structs.h"
#include "LEM/decode.h"
#include "LCBD/LCBD.h"
#include "MSG/MSG_pubdefs.h"
#include "CDM/CDM_pubdefs.h"
#include "CPU_DB/CPU_DB_pubdefs.h"
#include "LTC_DB/LTC_DB_schema.h"
#include "ltcPrivate.h"

Include dependency graph for LTC_control.c:


Functions

static unsigned int lockState (LTC_Wrk *tw, RW_key *key, LTC_Cntl_Modes old, LTC_Cntl_Modes new, const char *fnc)
 Walk round the state diagram.
static unsigned int LTC_StartItcFork (LTC_Wrk *tw)
 Start Thermal Control tasks (telecommand and fork queue).
static unsigned int LTC_Init (const LTC_DB_Schema *config)
static unsigned int LTC_InitCmdProc (LTC_Wrk *tw, unsigned short cmd_pkt_128, unsigned short cmd_pkt_256)
 Initialization for telecommand processing.
static unsigned int LTC_InitIO (LTC_Wrk *tw)
 Setup for asynchrous reading RIT and reservoir temperature sensors.
static void LTC_freeCmd (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx)
 Free a command buffer.
static unsigned LTC_InitTlm (LTC_Wrk *tw)
 Initialize telemetry structures.
static unsigned LTC_GetHeaterAddrs (LTC_Wrk *tw)
 Initialize SIB register addressess.
unsigned int LTC_initialize (void)
 Initializes and configures thermal control software.
static unsigned int LTC_AttachITCMem (LTC_Wrk *tw, unsigned short cmd_pkt_128, unsigned short cmd_pkt_256)
 Setup and attach memory for ITC.
unsigned int LTC_InitSmooth (LTC_Wrk *tw)
 Allocates and inits storage for smoothing filters.
void LTC_InitSensors (LTC_Wrk *tw)
 Sets initial values for LAT sensors.
void LTC_InitBuiltIn (LTC_Wrk *tw)
 Initialization for built-in constants.
unsigned int LTC_StartTask (void)
 Start Thermal Control processing.
unsigned int LTC_StopTask (void)
 Stop Thermal Control processing.
static void LTC_FreeMem (LTC_Wrk *tw)
 Free any allocated memory.
unsigned int LTC_shutdown (void)
 Release resources associated with LTC.
unsigned int LTC_GetTlm (LTC_DiagLTC_Tlm *tt)
 Retreive telemetry data.
unsigned int LTC_GetConfigFile (unsigned int *fid)
 Get LTC configuration file ID.
void LTC_cb_reset (unsigned short fmt, unsigned short len, const void *dat)
 Restore LTC operation after turbo reset.

Variables

LTC_FltDf LTC_thrmFltDf
 Smoothing filter definition for RIT/thermistor type sensor.
LTC_FltDf LTC_rtdFltDf
 Smoothing filter definition for RES/RTD type sensor.
short int LTC_thrmCnvTbl []
 Counts to temperature convertion table for RIT/thermistor type sensor.
short int LTC_rtdCnvTbl []
 Counts to temperature convertion table for RES/RTD type sensor.
LTC_DB_Schema LTC_defaultConfig
 Default LTC configuration values.
LTC_Wrk LTC_wrkStore
 Thermal control working storage.
LTC_WrkLTC_wrk = &LTC_wrkStore
 Reference to thermal control working storage.

Detailed Description

Thermal Control public functions: intialization, telemetry, shutdown.


Function Documentation

static unsigned int lockState LTC_Wrk tw,
RW_key *  key,
LTC_Cntl_Modes  old,
LTC_Cntl_Modes  new,
const char *  fnc
[static]
 

Walk round the state diagram.

Parameters:
tw (in) LTC control block
key (in) An RW key
old (in) State the control block must be in to transition
new (in) State to which the control block wishes to transition
fnc (in) Function name calling this inline
Returns:
A LTC MSG code.

unsigned int LTC_AttachITCMem LTC_Wrk tw,
unsigned short  cmd_pkt_128,
unsigned short  cmd_pkt_256
[static]
 

Setup and attach memory for ITC.

Parameters:
tw - LTC working storage.
cmd_pkt_128 - The number of 128 byte telecommand packets for LTC.
cmd_pkt_256 - The number of 256 byte telecommand packets for LTC.
Return values:
A LTC MSG code

void LTC_cb_reset unsigned short  fmt,
unsigned short  len,
const void *  dat
 

Restore LTC operation after turbo reset.

Parameters:
fmt (in) Format of global context data
len (in) Length of global context data
dat (in) Global context data

static void LTC_freeCmd ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned int  tx
[static]
 

Free a command buffer.

LTC_freeCmd() frees the command packets used to do the turbo reset.

static void LTC_FreeMem LTC_Wrk tw  )  [static]
 

Free any allocated memory.

Parameters:
tw - LTC working storage.

unsigned int LTC_GetConfigFile unsigned int *  fid  ) 
 

Get LTC configuration file ID.

Parameters:
fid Stores LTC master FOF file ID on return.
Return values:
A LTC MSG code.
Get the file ID value of the LTC master configuration file-of-files (FOF) which is currently in use. A value of '0' means that the built-in configuration is being used.

static void LTC_GetHeaterAddrs LTC_Wrk tw  )  [static]
 

Initialize SIB register addressess.

Parameters:
tw - LTC working storage.
Return values:
- A LTC MSG code.

unsigned int LTC_GetTlm LTC_DiagLTC_Tlm tt  ) 
 

Retreive telemetry data.

Parameters:
tt - Pointer to telemetry structure
Return values:
An LTC MSG code \ \ Telemetry block contents: \ \ Bytes Off Name Contents \ |------|-----|-------------|--------------------------------------------------| \ | 24 | 0 | snsrSel | Per HP, selected RIT and RES sensors. For each | \ | | | | sensor the connected HP and sensor type is given.| \ | | | | 2 bytes per heat pipe, one byte per sensor: | \ | | | | 4-bits for HP # and 4-bits for type (DSHP, | \ | | | | DSHP_R, XLHP, XLHP_R, RSVR, and RSVR_R) | \ |------|-----|-------------|--------------------------------------------------| \ | 12 | 24 | snsrStat | Per HP, input sensor status. | \ | | | | RIT/RES 4 bits each, 0-NOT_READ, 1-READ_GOOD | \ | | | | 2-READ_BAD, 3-BROKEN. One byte pad added. | \ |------|-----|-------------|--------------------------------------------------| \ | 2 | 36 | actvHp | Per HP, 1-active, 0-not active (ON or OFF) | \ |------|-----|-------------|--------------------------------------------------| \ | 144 | 38 | rawAdc | Per each of 72 possible primary and redundant | \ | | | | sensors, raw ADC values (12 bits) and (4 bits) | \ | | | | read status. Ordered by HP, i.e. 6 for HP0, 6 | \ | | | | for HP1,...,6 for HP11. | \ |------|-----|-------------|--------------------------------------------------| \ | 48 | 182 | temps | Per each HP, temperature values input to control | \ | | | | Smoothed and converted to celsius for RIT and | \ | | | | RES. Fixed point scaled values. First 12 are | \ | | | | for RIT and 2nd 12 for RES. | \ |------|-----|-------------|--------------------------------------------------| \ | 24 | 230 | ritLo | Low limit for RIT sensors, heat pipes 0 - 11 | \ |------|-----|-------------|--------------------------------------------------| \ | 24 | 254 | ritHi | High limit for RIT sensors, heat pipes 0 - 11 | \ |------|-----|-------------|--------------------------------------------------| \ | 24 | 278 | resLo | Low limit for reservoir sensors, HPs 0 - 11 | \ |------|-----|-------------|--------------------------------------------------| \ | 24 | 302 | resHi | High limit for reservoir sensors, HPs 0 - 11 | \ |------|-----|-------------|--------------------------------------------------| \ | 24 | 326 | dbDelta | Deadband delta limit, HPs 0 - 11 | \ |------|-----|-------------|--------------------------------------------------| \ | 2 | 350 | htrCmd | Bit for each HP reservoir heater command, 1 is | \ | | | | command to on and 0 commanded to off. The upper | \ | | | | bit (2**15) indicates commanding mode: 1 is | \ | | | | actively sending commands to heaters, and 0 is | \ | | | | calculating commands but not sending to heaters. | \ |------|-----|-------------|--------------------------------------------------| \ | 2 | 352 | htrReg | Bit for each SIB control heater bit, 1 is | \ | | | | commanded on and 0 commanded off. The upper | \ | | | | bit (2**15) indicates LTC run mode: 1 is running | \ | | | | and 0 is stopped. | \ |-----------------------------------------------------------------------------| \ |-----------------------------------------------------------------------------| \ | 354 | TOTAL BYTES | | \ `-----------------------------------------------------------------------------' \

static unsigned int LTC_Init const LTC_DB_Schema *  config  )  [static]
 

Parameters:
config - LTC_DB schema configuration values
Return values:
A LTC MSG code.
Initializes configuration structures from files contained in the on-board file system, and intializes LTC working storage. Assumes another task has intialized PBS and MSG. This function is called by and uses the stack space of the LAT application startup task.

void LTC_InitBuiltIn LTC_Wrk tw  ) 
 

Initialization for built-in constants.

Parameters:
tw - LTC working storage.

static unsigned int LTC_InitCmdProc LTC_Wrk tw,
unsigned short  cmd_pkt_128,
unsigned short  cmd_pkt_256
[static]
 

Initialization for telecommand processing.

Parameters:
tw - LTC working storage.
cmd_pkt_128 - The number of 128 byte telecommand packets for LTC.
cmd_pkt_256 - The number of 256 byte telecommand packets for LTC.
Return values:
0 - success, 1 - failure

unsigned int LTC_initialize void   ) 
 

Initializes and configures thermal control software.

Return values:
A LTC MSG code.

static unsigned int LTC_InitIO LTC_Wrk tw  )  [static]
 

Setup for asynchrous reading RIT and reservoir temperature sensors.

Parameters:
tw - LTC working storage.
Return values:
A LTC MSG code Sets up handle, command list and response list allocation for asynchronous reads of temperature sensor data from the PDU using LCB. An individual command list reads a single PDU group. LCB does not allow interuption of a command group. So another task such as housekeeping cannot break-in and corrupt the sensor readings for the group. The reading of sensor data is driven by the PDU table created from the Sensor Definition File. This file defines the hardware configuration (heat pipe, pdu, group, adc#).

void LTC_InitSensors LTC_Wrk tw  ) 
 

Sets initial values for LAT sensors.

Parameters:
tw - LTC working storage

unsigned int LTC_InitSmooth LTC_Wrk tw  ) 
 

Allocates and inits storage for smoothing filters.

Parameters:
tw - LTC working storage.
Return values:
A LTC MSG code.

static unsigned LTC_InitTlm LTC_Wrk tw  )  [static]
 

Initialize telemetry structures.

Parameters:
tw - LTC working storage.
Return values:
- A LTC MSG code

unsigned int LTC_shutdown void   ) 
 

Release resources associated with LTC.

Return values:
A LTC MSG code

static unsigned int LTC_StartItcFork LTC_Wrk tw  )  [static]
 

Start Thermal Control tasks (telecommand and fork queue).

Parameters:
tw - LTC working storage
Return values:
A LTC MSG code
Start LTC thermal control task and telecommand processing (ITC task).

unsigned int LTC_StartTask void   ) 
 

Start Thermal Control processing.

Return values:
A LTC MSG code.
Start LTC thermal control task and telecommand processing (ITC task).

unsigned int LTC_StopTask void   ) 
 

Stop Thermal Control processing.

Return values:
A LTC MSG code.
Stop LTC thermal control task and telecommand processing (ITC task).


Variable Documentation

LTC_DB_Schema LTC_defaultConfig
 

Default LTC configuration values.

This database is used if the LTC_DB module is not loaded.

There are two PDU tables. One for primary PDU and one for redundant PDU. Each record of these tables provides definitions for each temperature read from the PDU. It is ordered by PDU group for easy use when working with PDU hardware. The PDU group and ADC number for each sensor is built into this table. The sensors are associated with a heat pipe as defined by the hardware configuration.

short int LTC_rtdCnvTbl[]
 

Counts to temperature convertion table for RES/RTD type sensor.

Generated based on PDU/RTD circuit and vendor (Goodrich Model 0118MF) resistance-temperature relationship table.

LTC_FltDf LTC_rtdFltDf
 

Smoothing filter definition for RES/RTD type sensor.

Long moving average filter to handle the excessive noise from the RES sensor electronics.

short int LTC_thrmCnvTbl[]
 

Counts to temperature convertion table for RIT/thermistor type sensor.

Generated based on PDU/thermistor circuit and vendor (YSI 44900) resistance-temperature relationship table.

LTC_FltDf LTC_thrmFltDf
 

Smoothing filter definition for RIT/thermistor type sensor.

Default built-in RIT sensor filter definition.


Generated on Wed May 27 01:20:34 2009 by  doxygen 1.4.4