Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,41 @@ ThermalManager::~ThermalManager() {}

void ThermalManager::run_handler(FwIndexType portNum, U32 context) {
Fw::Success condition;
Fw::ParamValid param_valid;

const F64 FACE_TEMP_LOWER_THRESHOLD = this->paramGet_FACE_TEMP_LOWER_THRESHOLD(param_valid);
const F64 FACE_TEMP_UPPER_THRESHOLD = this->paramGet_FACE_TEMP_UPPER_THRESHOLD(param_valid);
const F64 BATT_CELL_TEMP_LOWER_THRESHOLD = this->paramGet_BATT_CELL_TEMP_LOWER_THRESHOLD(param_valid);
const F64 BATT_CELL_TEMP_UPPER_THRESHOLD = this->paramGet_BATT_CELL_TEMP_UPPER_THRESHOLD(param_valid);

// Face temp sensors
for (FwIndexType i = 0; i < this->getNum_faceTempGet_OutputPorts(); i++) {
this->faceTempGet_out(i, condition);
F64 temperature = this->faceTempGet_out(i, condition);
if (temperature < FACE_TEMP_LOWER_THRESHOLD) {
this->log_WARNING_LO_FaceTemperatureBelowThreshold(i, temperature);
} else if (temperature > FACE_TEMP_LOWER_THRESHOLD + ThermalManager::DEBOUNCE_ERROR) {
this->log_WARNING_LO_FaceTemperatureBelowThreshold_ThrottleClear();
}
if (temperature > FACE_TEMP_UPPER_THRESHOLD) {
this->log_WARNING_LO_FaceTemperatureAboveThreshold(i, temperature);
} else if (temperature < FACE_TEMP_UPPER_THRESHOLD - ThermalManager::DEBOUNCE_ERROR) {
this->log_WARNING_LO_FaceTemperatureAboveThreshold_ThrottleClear();
}
}

// Battery cell temp sensors
for (FwIndexType i = 0; i < this->getNum_battCellTempGet_OutputPorts(); i++) {
this->battCellTempGet_out(i, condition);
F64 temperature = this->battCellTempGet_out(i, condition);
if (temperature < BATT_CELL_TEMP_LOWER_THRESHOLD) {
this->log_WARNING_LO_BatteryCellTemperatureBelowThreshold(i, temperature);
} else if (temperature > BATT_CELL_TEMP_LOWER_THRESHOLD + ThermalManager::DEBOUNCE_ERROR) {
this->log_WARNING_LO_BatteryCellTemperatureBelowThreshold_ThrottleClear();
}
if (temperature > BATT_CELL_TEMP_UPPER_THRESHOLD) {
this->log_WARNING_LO_BatteryCellTemperatureAboveThreshold(i, temperature);
} else if (temperature < BATT_CELL_TEMP_UPPER_THRESHOLD - ThermalManager::DEBOUNCE_ERROR) {
this->log_WARNING_LO_BatteryCellTemperatureAboveThreshold_ThrottleClear();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,56 @@ module Components {
@ Thermal Manager Component for F Prime FSW framework.
@ Orchestrates temperature sensor readings from 11 TMP112 sensors
passive component ThermalManager {
### Parameters ###
@ Parameter for face temperature lower threshold in °C
param FACE_TEMP_LOWER_THRESHOLD: F64 default -40.0 id 0

@ Parameter for face temperature upper threshold in °C
param FACE_TEMP_UPPER_THRESHOLD: F64 default 60.0 id 1

@ Parameter for battery cell temperature lower threshold in °C
param BATT_CELL_TEMP_LOWER_THRESHOLD: F64 default 5.0 id 2

@ Parameter for battery cell temperature upper threshold in °C
param BATT_CELL_TEMP_UPPER_THRESHOLD: F64 default 60.0 id 3
Comment on lines +5 to +16
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mikefly123 How does this range look?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look great to me! I will note though that on the Yearling satellites we consistently saw Face temperatures around -34C in eclipse, so I recommend throttling this event or adding some logic that will debounce it so we don't get too much spam.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At what temps did we start seeing issues with hairsat?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder on that actually! I would recommend changing that battery low temp threshold to something much more conservative, like 5C. If Lithium Ion batteries go below 0C they can still discharge but can suffer long term damage if you charge them at freezing temperatures.

As for the face temperatures, we still can generally read stalely down to -40C. Below that you start running into issues!


sync input port run: Svc.Sched

@ The number of face temperature sensors
constant numFaceTempSensors = 5

@ The number of battery cell temperature sensors
constant numBattCellTempSensors = 4

@ Port for face temperature sensors
output port faceTempGet: [numFaceTempSensors] Drv.temperatureGet

@ Port for battery cell temperature sensors
output port battCellTempGet: [4] Drv.temperatureGet
output port battCellTempGet: [numBattCellTempSensors] Drv.temperatureGet

@ Event for face temperature reading below threshold
event FaceTemperatureBelowThreshold(sensorId: U32, temperature: F32) \
severity warning low \
format "Face temperature below threshold: Sensor {} at {} °C" \
throttle 1

@ Event for face temperature reading above threshold
event FaceTemperatureAboveThreshold(sensorId: U32, temperature: F32) \
severity warning low \
format "Face temperature above threshold: Sensor {} at {} °C" \
throttle 1

@ Event for battery cell temperature reading below threshold
event BatteryCellTemperatureBelowThreshold(sensorId: U32, temperature: F32) \
severity warning low \
format "Battery cell temperature below threshold: Sensor {} at {} °C" \
throttle 1

@ Event for battery cell temperature reading above threshold
event BatteryCellTemperatureAboveThreshold(sensorId: U32, temperature: F32) \
severity warning low \
format "Battery cell temperature above threshold: Sensor {} at {} °C" \
throttle 1

###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
Expand All @@ -25,7 +65,22 @@ module Components {
@ Port for emitting events
event port logOut

@ Port for getting parameters
param get port prmGetOut

@ Port for setting parameters
param set port prmSetOut

@ Port for emitting text events
text event port logTextOut

@ Port for sending command registrations
command reg port cmdRegOut

@ Port for receiving commands
command recv port cmdIn

@ Port for sending command responses
command resp port cmdResponseOut
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ThermalManager final : public ThermalManagerComponentBase {
~ThermalManager();

private:
constexpr static F64 DEBOUNCE_ERROR = 3.0; //!< Debounce error value for temperature threshold events
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,43 @@ classDiagram
ThermalManagerComponentBase <|-- ThermalManager : inherits
```

## Parameters

| Name | Type | Description |
| ------------------------------ | ---- | ---------------------------------------------------------- |
| FACE_TEMP_LOWER_THRESHOLD | F64 | Lower temperature threshold in °C for face sensors |
| FACE_TEMP_UPPER_THRESHOLD | F64 | Upper temperature threshold in °C for face sensors |
| BATT_CELL_TEMP_LOWER_THRESHOLD | F64 | Lower temperature threshold in °C for battery cell sensors |
| BATT_CELL_TEMP_UPPER_THRESHOLD | F64 | Upper temperature threshold in °C for battery cell sensors |

## Port Descriptions
| Name | Type | Description |
|---|---|---|
| run | sync input | Scheduler port that triggers temperature data collection |
| faceTempGet | output | Array of ports [5] for getting temperature data from face sensors |
| battCellTempGet | output | Array of ports [4] for getting temperature data from battery cell sensors |
| timeCaller | time get | Port for requesting current system time |
| tlmOut | telemetry | Port for emitting telemetry |
| logOut | event | Port for emitting events |
| logTextOut | text event | Port for emitting text events |

| Name | Type | Description |
| --------------- | ------------ | ------------------------------------------------------------------------- |
| run | sync input | Scheduler port that triggers temperature data collection |
| faceTempGet | output | Array of ports [5] for getting temperature data from face sensors |
| battCellTempGet | output | Array of ports [4] for getting temperature data from battery cell sensors |
| timeCaller | time get | Port for requesting current system time |
| tlmOut | telemetry | Port for emitting telemetry |
| logOut | event | Port for emitting events |
| logTextOut | text event | Port for emitting text events |
| prmGetOut | param get | Port for getting parameters |
| prmSetOut | param set | Port for setting parameters |
| cmdRegOut | command reg | Port for sending command registrations |
| cmdIn | command recv | Port for receiving commands |
| cmdResponseOut | command resp | Port for sending command responses |

## Events

| Name | Description |
| ------------------------------------ | ---------------------------------------------------------------------------------- |
| FaceTemperatureBelowThreshold | Face temperature reading below threshold (Sensor ID and temperature in °C) |
| FaceTemperatureAboveThreshold | Face temperature reading above threshold (Sensor ID and temperature in °C) |
| BatteryCellTemperatureBelowThreshold | Battery cell temperature reading below threshold (Sensor ID and temperature in °C) |
| BatteryCellTemperatureAboveThreshold | Battery cell temperature reading above threshold (Sensor ID and temperature in °C) |

## Sequence Diagrams

```mermaid
sequenceDiagram
participant Scheduler
Expand All @@ -60,13 +85,16 @@ sequenceDiagram
```

## Requirements
| Name | Description | Validation |
|---|---|---|
| Face Temperature Collection | The component shall trigger data collection from connected face temperature sensors when run is called | Verify all connected face temperature output ports are called |

| Name | Description | Validation |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| Face Temperature Collection | The component shall trigger data collection from connected face temperature sensors when run is called | Verify all connected face temperature output ports are called |
| Battery Temperature Collection | The component shall trigger data collection from connected battery cell temperature sensors when run is called | Verify all connected battery cell temperature output ports are called |
| Periodic Operation | The component shall operate as a scheduled component responding to scheduler calls | Verify component responds correctly to scheduler input |
| Periodic Operation | The component shall operate as a scheduled component responding to scheduler calls | Verify component responds correctly to scheduler input |

## Change Log
| Date | Description |
|---|---|
| 2025-12-05 | Initial Thermal Manager component SDD |

| Date | Description |
| ---------- | --------------------------------------------------------------------- |
| 2026-03-30 | Add events for when temperature readings are above/below a threshold. |
| 2025-12-05 | Initial Thermal Manager component SDD |
Loading