continue thermal controller overheating
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2023-03-13 15:59:19 +01:00
parent 721a01409e
commit bf2d97bd60
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
11 changed files with 166 additions and 117 deletions

View File

@ -10,6 +10,7 @@
</envs>
</ADDITIONAL_GENERATION_ENVIRONMENT>
</configuration>
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" NO_GENERATOR="true" />
</configurations>
</component>
</project>

View File

@ -32,8 +32,13 @@ xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
CoreController::CoreController(object_id_t objectId)
: ExtendedControllerBase(objectId, 5), cmdExecutor(4096), cmdReplyBuf(4096, true), cmdRepliesSizes(128),
opDivider5(5), opDivider10(10), hkSet(this) {
: ExtendedControllerBase(objectId, 5),
cmdExecutor(4096),
cmdReplyBuf(4096, true),
cmdRepliesSizes(128),
opDivider5(5),
opDivider10(10),
hkSet(this) {
cmdExecutor.setRingBuffer(&cmdReplyBuf, &cmdRepliesSizes);
try {
sdcMan = SdCardManager::instance();
@ -318,7 +323,8 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
}
case (EXECUTE_SHELL_CMD): {
std::string cmd = std::string(cmd, size);
if(cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or shellCmdIsExecuting) {
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or
shellCmdIsExecuting) {
return HasActionsIF::IS_BUSY;
}
cmdExecutor.load(cmd, false, false);

View File

@ -1,6 +1,7 @@
#include "ThermalController.h"
#include <bsp_q7s/core/CoreDefinitions.h>
#include <eive/objects.h>
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/thermal/ThermalComponentIF.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/mgmLis3Helpers.h>
@ -14,7 +15,6 @@
#include <mission/devices/devicedefinitions/payloadPcduDefinitions.h>
#include <mission/devices/devicedefinitions/rwHelpers.h>
#include <objects/systemObjectList.h>
#include <eive/objects.h>
ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater)
: ExtendedControllerBase(objectId),
@ -65,8 +65,12 @@ ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater
}
ReturnValue_t ThermalController::initialize() {
auto result = ExtendedControllerBase::initialize();
return result;
auto* camSwitcher = ObjectManager::instance()->get<HasHealthIF>(objects::CAM_SWITCHER);
if (camSwitcher == nullptr) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
camId = camSwitcher->getCommandQueue();
return ExtendedControllerBase::initialize();
}
ReturnValue_t ThermalController::handleCommandMessage(CommandMessage* message) {
@ -992,7 +996,8 @@ void ThermalController::ctrlAcsBoard() {
if (chooseHeater(switchNr, redSwitchNr)) {
if (heaterHandler.checkSwitchState(switchNr)) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl;
sif::info << "ThermalController::ctrlHeater: Heater" << static_cast<int>(thermalComponent)
<< " OFF" << std::endl;
}
}
}
@ -1082,9 +1087,7 @@ void ThermalController::ctrlStr() {
sensors[2].second = sensorTemperatures.sensor_dro.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, strLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::STAR_TRACKER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::STAR_TRACKER, strTooHotFlag);
}
void ThermalController::ctrlIfBoard() {
@ -1121,8 +1124,11 @@ void ThermalController::ctrlObc() {
sensors[2].second = sensorTemperatures.tmp1075Tcs0.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcLimits);
if (componentAboveCutOffLimit) {
triggerEvent(OBC_OVERHEATING);
if (componentAboveUpperLimit and not obcTooHotFlag) {
triggerEvent(tcsCtrl::OBC_OVERHEATING);
obcTooHotFlag = true;
} else if (not componentAboveUpperLimit) {
obcTooHotFlag = false;
}
}
@ -1136,6 +1142,12 @@ void ThermalController::ctrlObcIfBoard() {
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits);
if (componentAboveUpperLimit and not obcTooHotFlag) {
triggerEvent(tcsCtrl::OBC_OVERHEATING);
obcTooHotFlag = true;
} else if (not componentAboveUpperLimit) {
obcTooHotFlag = false;
}
}
void ThermalController::ctrlSBandTransceiver() {
@ -1149,13 +1161,12 @@ void ThermalController::ctrlSBandTransceiver() {
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA,
sBandTransceiverLimits);
if (componentAboveCutOffLimit) {
float sensorTempAsFloat = sensorTemp;
SerializeIF::serialize()
triggerEvent(SYRLINKS_OVERHEATING, static_cast<u_int8_t>(sensorTemp)); //TODO: TEMP mitgeben
if (componentAboveUpperLimit and not syrlinksTooHotFlag) {
triggerEvent(tcsCtrl::SYRLINKS_OVERHEATING, tempFloatToU32());
syrlinksTooHotFlag = true;
} else if (not componentAboveUpperLimit) {
pcduSystemTooHotFlag = false;
}
}
void ThermalController::ctrlPcduP60Board() {
thermalComponent = PCDUP60_BOARD;
@ -1165,6 +1176,12 @@ void ThermalController::ctrlPcduP60Board() {
sensors[1].second = deviceTemperatures.temp2P60dock.value;
numSensors = 2;
ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduP60BoardLimits);
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32());
pcduSystemTooHotFlag = true;
} else if (not componentAboveUpperLimit) {
pcduSystemTooHotFlag = false;
}
}
void ThermalController::ctrlPcduAcu() {
@ -1175,8 +1192,7 @@ void ThermalController::ctrlPcduAcu() {
if (chooseHeater(switchNr, redSwitchNr)) {
bool sensorTempAvailable = true;
if (deviceTemperatures.acu.value[0] !=
INVALID_TEMPERATURE) {
if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) {
sensorTemp = deviceTemperatures.acu.value[0];
} else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) {
sensorTemp = deviceTemperatures.acu.value[1];
@ -1185,15 +1201,18 @@ void ThermalController::ctrlPcduAcu() {
} else if (sensorTemperatures.sensor_acu.isValid()) {
sensorTemp = sensorTemperatures.sensor_acu.value;
} else {
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
triggerEvent(tcsCtrl::NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
sensorTempAvailable = false;
}
if (sensorTempAvailable) {
ctrlHeater(switchNr, redSwitchNr, pcduAcuLimits);
}
}
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_HIGH);
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32());
pcduSystemTooHotFlag = true;
} else if (not componentAboveUpperLimit) {
pcduSystemTooHotFlag = false;
}
}
@ -1207,10 +1226,11 @@ void ThermalController::ctrlPcduPdu() {
sensors[2].second = sensorTemperatures.tmp1075Tcs0.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduPduLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_HIGH);
}else if(componentAboveOpUpperLimit){ //TODO: NOp bool
EventManagerIF::triggerEvent(objects::PCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_HIGH);
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32());
pcduSystemTooHotFlag = true;
} else if (not componentAboveUpperLimit) {
pcduSystemTooHotFlag = false;
}
}
@ -1226,9 +1246,7 @@ void ThermalController::ctrlPlPcduBoard() {
sensors[3].second = sensorTemperatures.sensor_plpcdu_heatspreader.value;
numSensors = 4;
ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits);
if (componentAboveCutOffLimit) {
triggerEvent(PLPCDU_OVERHEATING);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlPlocMissionBoard() {
@ -1242,12 +1260,7 @@ void ThermalController::ctrlPlocMissionBoard() {
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD,
plocMissionBoardLimits);
if (componentAboveCutOffLimit) {
triggerEvent(PLOC_OVERHEATING);
}
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLOC_MPSOC_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLOC_MPSOC_HANDLER, plocTooHotFlag);
}
void ThermalController::ctrlPlocProcessingBoard() {
@ -1261,9 +1274,7 @@ void ThermalController::ctrlPlocProcessingBoard() {
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD,
plocProcessingBoardLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLOC_MPSOC_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLOC_MPSOC_HANDLER, plocTooHotFlag);
}
void ThermalController::ctrlDac() {
@ -1276,9 +1287,7 @@ void ThermalController::ctrlDac() {
sensors[2].second = sensorTemperatures.sensor_ploc_heatspreader.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, dacLimits);
if (componentAboveOpUpperLimit){
//EventManagerIF::triggerEvent(objects::, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlCameraBody() {
@ -1291,9 +1300,19 @@ void ThermalController::ctrlCameraBody() {
sensors[2].second = sensorTemperatures.sensor_mpa.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, cameraLimits);
// if (componentAboveOpUpperLimit){
// EventManagerIF::triggerEvent(objects::, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
// }
if (componentAboveUpperLimit and not camTooHotOneShotFlag) {
triggerEvent(tcsCtrl::CAMERA_OVERHEATING, tempFloatToU32());
CommandMessage msg;
HealthMessage::setHealthMessage(&msg, HealthMessage::HEALTH_SET, HealthState::FAULTY);
ReturnValue_t result = commandQueue->sendMessage(camId, &msg);
if (result != returnvalue::OK) {
sif::error << "ThermalController::ctrlCameraBody(): Sending health message failed"
<< std::endl;
}
camTooHotOneShotFlag = true;
} else if (not componentAboveUpperLimit) {
camTooHotOneShotFlag = false;
}
}
void ThermalController::ctrlDro() {
@ -1306,9 +1325,7 @@ void ThermalController::ctrlDro() {
sensors[2].second = sensorTemperatures.sensor_mpa.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, droLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLPCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlX8() {
@ -1321,9 +1338,7 @@ void ThermalController::ctrlX8() {
sensors[2].second = sensorTemperatures.sensor_tx_modul.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, x8Limits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLPCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlTx() {
@ -1336,9 +1351,7 @@ void ThermalController::ctrlTx() {
sensors[2].second = sensorTemperatures.sensor_mpa.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, txLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLPCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlMpa() {
@ -1351,9 +1364,7 @@ void ThermalController::ctrlMpa() {
sensors[2].second = sensorTemperatures.sensor_tx_modul.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, mpaLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLPCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlHpa() {
@ -1366,12 +1377,7 @@ void ThermalController::ctrlHpa() {
sensors[2].second = sensorTemperatures.sensor_mpa.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, hpaLimits);
if (componentAboveCutOffLimit) {
triggerEvent(HPA_OVERHEATING);
}
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::PLPCDU_HANDLER, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
}
void ThermalController::ctrlScexBoard() {
@ -1384,9 +1390,7 @@ void ThermalController::ctrlScexBoard() {
sensors[2].second = sensorTemperatures.sensor_hpa.value;
numSensors = 3;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, scexBoardLimits);
if (componentAboveOpUpperLimit){
EventManagerIF::triggerEvent(objects::SCEX, ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH);
}
tooHotHandler(objects::SCEX, scexTooHotFlag);
}
void ThermalController::performThermalModuleCtrl() {
@ -1427,7 +1431,8 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr,
redSwitchNr)) { // TODO: muss der Heater dann wirklich abgeschalten werden?
if (heaterHandler.checkSwitchState(switchNr)) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Heater" << static_cast<u_int8_t>(switchNr) << " OFF" << std::endl; // TODO: printouts löschen
sif::info << "ThermalController::ctrlHeater: Heater" << static_cast<u_int8_t>(switchNr)
<< " OFF" << std::endl; // TODO: printouts löschen
}
}
}
@ -1445,11 +1450,11 @@ bool ThermalController::selectAndReadSensorTemp() {
thermalStates[thermalComponent].errorCounter++;
if (thermalComponent != RW and thermalComponent != ACS_BOARD) {
if (thermalStates[thermalComponent].errorCounter <= 3) {
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
triggerEvent(tcsCtrl::NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
}
} else {
if (thermalStates[thermalComponent].errorCounter <= 8) {
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
triggerEvent(tcsCtrl::NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
}
}
@ -1464,7 +1469,7 @@ bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch
redSwitchNrInUse = true;
} else {
heaterAvailable = false;
triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr);
triggerEvent(tcsCtrl::NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr);
}
} else {
redSwitchNrInUse = false;
@ -1474,17 +1479,16 @@ bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch
void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
struct TempLimits& tempLimit) {
componentAboveCutOffLimit = false;
componentAboveOpUpperLimit = false;
componentAboveUpperLimit = false;
// if Heater off
if (not heaterStates[switchNr].switchTransition) {
if (not heaterHandler.checkSwitchState(switchNr)) {
if (sensorTemp < tempLimit.opLowerLimit) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON);
sif::info << "ThermalController::ctrlHeater: Heater " << static_cast<u_int8_t>(thermalComponent) << " ON"
<< std::endl;
sif::info << "ThermalController::ctrlHeater: Heater " << static_cast<int>(thermalComponent)
<< " ON" << std::endl;
heaterStates[switchNr].switchTransition = true;
thermalStates[thermalComponent].heating = true;
// TODO: EVENT; aber heaterHandler erstellt schon event
} else {
thermalStates[thermalComponent].heating = false;
}
@ -1494,36 +1498,34 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers
if (thermalStates[thermalComponent].heating) {
if (sensorTemp >= tempLimit.opLowerLimit + TEMP_OFFSET) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Heater " << static_cast<u_int8_t>(thermalComponent) << " OFF"
<< std::endl;
sif::info << "ThermalController::ctrlHeater: Heater "
<< static_cast<int>(thermalComponent) << " OFF" << std::endl;
heaterStates[switchNr].switchTransition = true;
thermalStates[thermalComponent].heating = false;
}
} else {
// TODO: if >= opLimit -> Event; nicht für syrlinks
if (sensorTemp >= tempLimit.opUpperLimit) {
componentAboveOpUpperLimit = true;
auto tempTooHighHandler = [&](const char* whatLimit) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Reached CutOffLimit: Heater "
<< static_cast<u_int8_t>(thermalComponent) << " OFF" << std::endl;
sif::info << "ThermalController::ctrlHeater: Reached " << whatLimit << ": Heater "
<< static_cast<int>(thermalComponent) << " OFF" << std::endl;
heaterStates[switchNr].switchTransition = true;
if (heaterHandler.checkSwitchState(redSwitchNr)) {
heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF);
heaterStates[redSwitchNr].switchTransition = true;
}
};
if (sensorTemp >= tempLimit.nopUpperLimit) {
componentAboveUpperLimit = true;
tempTooHighHandler("NOP-Limit");
overHeatEventToTrigger = ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH;
} else if (sensorTemp >= tempLimit.opUpperLimit) {
componentAboveUpperLimit = true;
tempTooHighHandler("OP-Limit");
overHeatEventToTrigger = ThermalComponentIF::COMPONENT_TEMP_HIGH;
}
if (sensorTemp >= tempLimit.cutOffLimit) {
componentAboveCutOffLimit = true;
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Reached CutOffLimit: Heater "
<< thermalComponent << " OFF" << std::endl;
heaterStates[switchNr].switchTransition = true;
if (heaterHandler.checkSwitchState(redSwitchNr)) {
heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Reached CutOffLimit: RedundantHeater "
<< thermalComponent << " OFF" << std::endl;
heaterStates[redSwitchNr].switchTransition = true;
}
tempTooHighHandler("CutOff-Limit");
}
}
}
@ -1548,3 +1550,19 @@ void ThermalController::heaterTransitionControl() {
}
}
}
uint32_t ThermalController::tempFloatToU32() {
auto sensorTempAsFloat = static_cast<float>(sensorTemp);
uint32_t tempRaw = 0;
size_t dummyLen = 0;
SerializeAdapter::serialize(&sensorTempAsFloat, reinterpret_cast<uint8_t*>(&tempRaw), &dummyLen,
sizeof(tempRaw), SerializeIF::Endianness::NETWORK);
return tempRaw;
}
void ThermalController::tooHotHandler(object_id_t object, bool& oneShotFlag) {
if (componentAboveUpperLimit and not oneShotFlag) {
EventManagerIF::triggerEvent(object, overHeatEventToTrigger, tempFloatToU32());
oneShotFlag = true;
} else if (not componentAboveUpperLimit) {
oneShotFlag = false;
}
}

View File

@ -4,7 +4,7 @@
#include <fsfw/controller/ExtendedControllerBase.h>
#include <fsfw/devicehandlers/DeviceHandlerThermalSet.h>
#include <fsfw/timemanager/Countdown.h>
#include <mission/controller/controllerdefinitions/ThermalControllerDefinitions.h>
#include <mission/controller/controllerdefinitions/tcsCtrlDefs.h>
#include <mission/devices/devicedefinitions/Max31865Definitions.h>
#include <mission/devices/devicedefinitions/Tmp1075Definitions.h>
#include <mission/devices/devicedefinitions/susMax1227Helpers.h>
@ -97,15 +97,6 @@ class ThermalController : public ExtendedControllerBase {
uint32_t* msToReachTheMode) override;
private:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_CONTROLLER;
static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::MEDIUM);
static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(1, severity::MEDIUM);
static constexpr Event SYRLINKS_OVERHEATING = MAKE_EVENT(2, severity::HIGH);
static constexpr Event PLOC_OVERHEATING = MAKE_EVENT(3, severity::HIGH);
static constexpr Event OBC_OVERHEATING = MAKE_EVENT(4, severity::HIGH);
static constexpr Event HPA_OVERHEATING = MAKE_EVENT(5, severity::HIGH);
static constexpr Event PLPCDU_OVERHEATING = MAKE_EVENT(6, severity::HIGH);
static const uint32_t DELAY = 500;
static const uint32_t TEMP_OFFSET = 5;
@ -192,8 +183,18 @@ class ThermalController : public ExtendedControllerBase {
double sensorTemp = INVALID_TEMPERATURE;
ThermalComponents thermalComponent = NONE;
bool redSwitchNrInUse = false;
MessageQueueId_t camId = MessageQueueIF::NO_QUEUE;
bool componentAboveCutOffLimit = false;
bool componentAboveOpUpperLimit = false;
bool componentAboveUpperLimit = false;
Event overHeatEventToTrigger;
bool eBandTooHotFlag = false;
bool camTooHotOneShotFlag = false;
bool scexTooHotFlag = false;
bool plocTooHotFlag = false;
bool pcduSystemTooHotFlag = false;
bool syrlinksTooHotFlag = false;
bool obcTooHotFlag = false;
bool strTooHotFlag = false;
std::array<ThermalState, 30> thermalStates{};
std::array<HeaterState, 7> heaterStates{};
@ -252,6 +253,8 @@ class ThermalController : public ExtendedControllerBase {
void ctrlMpa();
void ctrlScexBoard();
void heaterTransitionControl();
uint32_t tempFloatToU32();
void tooHotHandler(object_id_t object, bool& oneShotFlag);
};
#endif /* MISSION_CONTROLLER_THERMALCONTROLLER_H_ */

View File

@ -5,9 +5,19 @@
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
#include "devices/heaterSwitcherList.h"
#include "eive/eventSubsystemIds.h"
namespace tcsCtrl {
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_CONTROLLER;
static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::MEDIUM);
static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(1, severity::MEDIUM);
static constexpr Event SYRLINKS_OVERHEATING = MAKE_EVENT(2, severity::HIGH);
static constexpr Event PLOC_OVERHEATING = MAKE_EVENT(3, severity::HIGH);
static constexpr Event OBC_OVERHEATING = MAKE_EVENT(4, severity::HIGH);
static constexpr Event CAMERA_OVERHEATING = MAKE_EVENT(5, severity::HIGH);
static constexpr Event PCDU_SYSTEM_OVERHEATING = MAKE_EVENT(6, severity::HIGH);
enum SetId : uint32_t {
SENSOR_TEMPERATURES = 0,
DEVICE_TEMPERATURES = 1,
@ -93,9 +103,10 @@ static const uint8_t ENTRIES_SUS_TEMPERATURE_SET = 12;
*/
class SensorTemperatures : public StaticLocalDataSet<ENTRIES_SENSOR_TEMPERATURE_SET> {
public:
SensorTemperatures(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SENSOR_TEMPERATURES) {}
explicit SensorTemperatures(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, SENSOR_TEMPERATURES) {}
SensorTemperatures(object_id_t objectId)
explicit SensorTemperatures(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, SENSOR_TEMPERATURES)) {}
lp_var_t<float> sensor_ploc_heatspreader =
@ -137,9 +148,10 @@ class SensorTemperatures : public StaticLocalDataSet<ENTRIES_SENSOR_TEMPERATURE_
*/
class DeviceTemperatures : public StaticLocalDataSet<ENTRIES_DEVICE_TEMPERATURE_SET> {
public:
DeviceTemperatures(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, DEVICE_TEMPERATURES) {}
explicit DeviceTemperatures(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, DEVICE_TEMPERATURES) {}
DeviceTemperatures(object_id_t objectId)
explicit DeviceTemperatures(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, DEVICE_TEMPERATURES)) {}
lp_var_t<float> q7s = lp_var_t<float>(sid.objectId, PoolIds::TEMP_Q7S, this);
@ -178,9 +190,11 @@ class DeviceTemperatures : public StaticLocalDataSet<ENTRIES_DEVICE_TEMPERATURE_
*/
class SusTemperatures : public StaticLocalDataSet<ENTRIES_SUS_TEMPERATURE_SET> {
public:
SusTemperatures(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SUS_TEMPERATURES) {}
explicit SusTemperatures(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, SUS_TEMPERATURES) {}
SusTemperatures(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, SUS_TEMPERATURES)) {}
explicit SusTemperatures(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, SUS_TEMPERATURES)) {}
lp_var_t<float> sus_0_n_loc_xfyfzm_pt_xf =
lp_var_t<float>(sid.objectId, PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, this);

View File

@ -3,3 +3,8 @@
CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF &pwrSwitcher,
power::Switch_t pwrSwitch)
: PowerSwitcherComponent(objectId, &pwrSwitcher, pwrSwitch) {}
void CamSwitcher::performFaultyOperation() {
if (not switcher.active() and switcher.getState() != PowerSwitcher::SWITCH_IS_OFF) {
switcher.turnOff();
}
}

View File

@ -8,6 +8,7 @@ class CamSwitcher : public PowerSwitcherComponent {
CamSwitcher(object_id_t objectId, PowerSwitchIF &pwrSwitcher, power::Switch_t pwrSwitch);
private:
void performFaultyOperation() override;
};
#endif /* MISSION_SYSTEM_OBJECTS_CAMSWITCHER_H_ */

View File

@ -51,7 +51,7 @@ void EiveSystem::performChildOperation() {
}
ReturnValue_t EiveSystem::initialize() {
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
auto* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "AcsSubsystem::initialize: Invalid event manager" << std::endl;
@ -67,6 +67,7 @@ ReturnValue_t EiveSystem::initialize() {
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
}
// TODO: manager->subscribeToEvent(eventQueue->getId(), )
return Subsystem::initialize();
}

2
thirdparty/lwgps vendored

@ -1 +1 @@
Subproject commit 52999ddfe5177493b96b55871961a8a97131596d
Subproject commit 22d865662eb7be6c9849275da9166f6b410f906a

2
tmtc

@ -1 +1 @@
Subproject commit a40c881b9fc292fe598204280db38720a784b71f
Subproject commit d8367f7e62a47516d7772c129c18ee8f7b07703b