basic implementation for passive cooling
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
9d1d62aee0
commit
26a9dce0a0
@ -37,6 +37,7 @@ uint32_t AcuDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return
|
||||
|
||||
ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES, new PoolEntry<float>(3));
|
||||
localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES,
|
||||
new PoolEntry<float>({10.0, 10.0, 10.0}, true));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ uint32_t SyrlinksDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { r
|
||||
|
||||
ReturnValue_t SyrlinksDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<float>({10}, true));
|
||||
localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<float>({10}, true));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -972,7 +972,7 @@ void ThermalController::ctrlAcsBoard() {
|
||||
numSensors = 4;
|
||||
if (selectAndReadSensorTemp()) {
|
||||
if (chooseHeater(switchNr, redSwitchNr)) {
|
||||
ctrlHeater(switchNr, redSwitchNr, acsBoardLimits);
|
||||
checkLimitsAndCtrlHeater(switchNr, redSwitchNr, acsBoardLimits);
|
||||
}
|
||||
resetSensorsArray();
|
||||
return;
|
||||
@ -990,14 +990,14 @@ void ThermalController::ctrlAcsBoard() {
|
||||
numSensors = 4;
|
||||
if (selectAndReadSensorTemp()) {
|
||||
if (chooseHeater(switchNr, redSwitchNr)) {
|
||||
ctrlHeater(switchNr, redSwitchNr, acsBoardLimits);
|
||||
checkLimitsAndCtrlHeater(switchNr, redSwitchNr, acsBoardLimits);
|
||||
}
|
||||
} else {
|
||||
if (chooseHeater(switchNr, redSwitchNr)) {
|
||||
if (heaterHandler.checkSwitchState(switchNr)) {
|
||||
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
|
||||
sif::info << "ThermalController::ctrlHeater: Heater" << static_cast<int>(thermalComponent)
|
||||
<< " OFF" << std::endl;
|
||||
sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater"
|
||||
<< static_cast<int>(thermalComponent) << " OFF" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1023,7 +1023,11 @@ void ThermalController::ctrlMgt() {
|
||||
}
|
||||
|
||||
void ThermalController::ctrlRw() {
|
||||
// TODO: better solution?
|
||||
Event eventToTrigger = 0;
|
||||
bool oneIsAboveLimit = false;
|
||||
|
||||
std::array<uint32_t, 4> sensorTemps{};
|
||||
|
||||
// RW1
|
||||
thermalComponent = RW;
|
||||
sensors[0].first = sensorTemperatures.sensor_rw1.isValid();
|
||||
@ -1036,6 +1040,11 @@ void ThermalController::ctrlRw() {
|
||||
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
||||
numSensors = 4;
|
||||
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
||||
sensorTemps[0] = tempFloatToU32();
|
||||
if (componentAboveUpperLimit) {
|
||||
oneIsAboveLimit = true;
|
||||
eventToTrigger = overHeatEventToTrigger;
|
||||
}
|
||||
|
||||
// RW2
|
||||
thermalComponent = RW;
|
||||
@ -1049,6 +1058,13 @@ void ThermalController::ctrlRw() {
|
||||
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
||||
numSensors = 4;
|
||||
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
||||
sensorTemps[1] = tempFloatToU32();
|
||||
if (componentAboveUpperLimit) {
|
||||
oneIsAboveLimit = true;
|
||||
if (eventToTrigger != ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH) {
|
||||
eventToTrigger = overHeatEventToTrigger;
|
||||
}
|
||||
}
|
||||
|
||||
// RW3
|
||||
thermalComponent = RW;
|
||||
@ -1062,6 +1078,13 @@ void ThermalController::ctrlRw() {
|
||||
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
||||
numSensors = 4;
|
||||
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
||||
sensorTemps[2] = tempFloatToU32();
|
||||
if (componentAboveUpperLimit) {
|
||||
oneIsAboveLimit = true;
|
||||
if (eventToTrigger != ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH) {
|
||||
eventToTrigger = overHeatEventToTrigger;
|
||||
}
|
||||
}
|
||||
|
||||
// RW4
|
||||
thermalComponent = RW;
|
||||
@ -1075,6 +1098,23 @@ void ThermalController::ctrlRw() {
|
||||
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
||||
numSensors = 4;
|
||||
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
||||
sensorTemps[3] = tempFloatToU32();
|
||||
if (componentAboveUpperLimit) {
|
||||
oneIsAboveLimit = true;
|
||||
if (eventToTrigger != ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH) {
|
||||
eventToTrigger = overHeatEventToTrigger;
|
||||
}
|
||||
}
|
||||
|
||||
if (oneIsAboveLimit and not rwTooHotFlag) {
|
||||
EventManagerIF::triggerEvent(objects::RW1, eventToTrigger, sensorTemps[0]);
|
||||
EventManagerIF::triggerEvent(objects::RW2, eventToTrigger, sensorTemps[1]);
|
||||
EventManagerIF::triggerEvent(objects::RW3, eventToTrigger, sensorTemps[2]);
|
||||
EventManagerIF::triggerEvent(objects::RW4, eventToTrigger, sensorTemps[3]);
|
||||
rwTooHotFlag = true;
|
||||
} else if (not oneIsAboveLimit) {
|
||||
rwTooHotFlag = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ThermalController::ctrlStr() {
|
||||
@ -1100,6 +1140,7 @@ void ThermalController::ctrlIfBoard() {
|
||||
sensors[2].second = deviceTemperatures.mgm2SideB.value;
|
||||
numSensors = 3;
|
||||
ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits);
|
||||
// TODO: special event overheating + could go back to safe mode
|
||||
}
|
||||
|
||||
void ThermalController::ctrlTcsBoard() {
|
||||
@ -1112,6 +1153,7 @@ void ThermalController::ctrlTcsBoard() {
|
||||
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
|
||||
numSensors = 3;
|
||||
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits);
|
||||
// TODO: special event overheating + could go back to safe mode
|
||||
}
|
||||
|
||||
void ThermalController::ctrlObc() {
|
||||
@ -1205,7 +1247,7 @@ void ThermalController::ctrlPcduAcu() {
|
||||
sensorTempAvailable = false;
|
||||
}
|
||||
if (sensorTempAvailable) {
|
||||
ctrlHeater(switchNr, redSwitchNr, pcduAcuLimits);
|
||||
checkLimitsAndCtrlHeater(switchNr, redSwitchNr, pcduAcuLimits);
|
||||
}
|
||||
}
|
||||
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
|
||||
@ -1402,9 +1444,9 @@ void ThermalController::performThermalModuleCtrl() {
|
||||
ctrlTcsBoard();
|
||||
ctrlObc();
|
||||
ctrlObcIfBoard();
|
||||
// ctrlSBandTransceiver();
|
||||
ctrlSBandTransceiver();
|
||||
ctrlPcduP60Board();
|
||||
// ctrlPcduAcu();
|
||||
ctrlPcduAcu();
|
||||
ctrlPcduPdu();
|
||||
ctrlPlPcduBoard();
|
||||
ctrlPlocMissionBoard();
|
||||
@ -1424,15 +1466,16 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr,
|
||||
TempLimits& tempLimit) {
|
||||
if (selectAndReadSensorTemp()) {
|
||||
if (chooseHeater(switchNr, redSwitchNr)) {
|
||||
ctrlHeater(switchNr, redSwitchNr, tempLimit);
|
||||
checkLimitsAndCtrlHeater(switchNr, redSwitchNr, tempLimit);
|
||||
}
|
||||
} else {
|
||||
if (chooseHeater(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::checkLimitsAndCtrlHeater: Heater"
|
||||
<< static_cast<int>(thermalComponent) << " OFF"
|
||||
<< std::endl; // TODO: printouts löschen
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1476,17 +1519,19 @@ bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch
|
||||
}
|
||||
return heaterAvailable;
|
||||
}
|
||||
void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
|
||||
struct TempLimits& tempLimit) {
|
||||
void ThermalController::checkLimitsAndCtrlHeater(heater::Switchers switchNr,
|
||||
heater::Switchers redSwitchNr,
|
||||
struct TempLimits& tempLimit) {
|
||||
componentAboveCutOffLimit = false;
|
||||
componentAboveUpperLimit = false;
|
||||
// if Heater off
|
||||
if (not heaterStates[switchNr].switchTransition) {
|
||||
if (not heaterHandler.checkSwitchState(switchNr)) {
|
||||
// TODO: check NOP limit and maybe trigger fdir
|
||||
if (sensorTemp < tempLimit.opLowerLimit) {
|
||||
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON);
|
||||
sif::info << "ThermalController::ctrlHeater: Heater " << static_cast<int>(thermalComponent)
|
||||
<< " ON" << std::endl;
|
||||
sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater "
|
||||
<< static_cast<int>(thermalComponent) << " ON" << std::endl;
|
||||
heaterStates[switchNr].switchTransition = true;
|
||||
thermalStates[thermalComponent].heating = true;
|
||||
} else {
|
||||
@ -1498,7 +1543,7 @@ 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 "
|
||||
sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater "
|
||||
<< static_cast<int>(thermalComponent) << " OFF" << std::endl;
|
||||
heaterStates[switchNr].switchTransition = true;
|
||||
thermalStates[thermalComponent].heating = false;
|
||||
@ -1506,8 +1551,8 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers
|
||||
} else {
|
||||
auto tempTooHighHandler = [&](const char* whatLimit) {
|
||||
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
|
||||
sif::info << "ThermalController::ctrlHeater: Reached " << whatLimit << ": Heater "
|
||||
<< static_cast<int>(thermalComponent) << " OFF" << std::endl;
|
||||
sif::info << "ThermalController::checkLimitsAndCtrlHeater: Reached " << whatLimit
|
||||
<< ": Heater " << static_cast<int>(thermalComponent) << " OFF" << std::endl;
|
||||
heaterStates[switchNr].switchTransition = true;
|
||||
if (heaterHandler.checkSwitchState(redSwitchNr)) {
|
||||
heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF);
|
||||
@ -1550,7 +1595,7 @@ void ThermalController::heaterTransitionControl() {
|
||||
}
|
||||
}
|
||||
}
|
||||
uint32_t ThermalController::tempFloatToU32() {
|
||||
uint32_t ThermalController::tempFloatToU32() const {
|
||||
auto sensorTempAsFloat = static_cast<float>(sensorTemp);
|
||||
uint32_t tempRaw = 0;
|
||||
size_t dummyLen = 0;
|
||||
|
@ -164,6 +164,8 @@ class ThermalController : public ExtendedControllerBase {
|
||||
TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 130.0);
|
||||
TempLimits obcLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0);
|
||||
TempLimits obcIfBoardLimits = TempLimits(-65.0, -40.0, 80.0, 85.0, 125.0);
|
||||
// Limits to test commading to RX Only
|
||||
// TempLimits sBandTransceiverLimits = TempLimits(-40.0, -25.0, 0.0, 0.0, 5.0);
|
||||
TempLimits sBandTransceiverLimits = TempLimits(-40.0, -25.0, 35.0, 40.0, 65.0);
|
||||
TempLimits pcduP60BoardLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0);
|
||||
TempLimits pcduAcuLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0);
|
||||
@ -195,6 +197,7 @@ class ThermalController : public ExtendedControllerBase {
|
||||
bool syrlinksTooHotFlag = false;
|
||||
bool obcTooHotFlag = false;
|
||||
bool strTooHotFlag = false;
|
||||
bool rwTooHotFlag = false;
|
||||
std::array<ThermalState, 30> thermalStates{};
|
||||
std::array<HeaterState, 7> heaterStates{};
|
||||
|
||||
@ -225,7 +228,8 @@ class ThermalController : public ExtendedControllerBase {
|
||||
|
||||
void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr,
|
||||
TempLimits& tempLimit);
|
||||
void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits& tempLimit);
|
||||
void checkLimitsAndCtrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
|
||||
TempLimits& tempLimit);
|
||||
bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr);
|
||||
bool selectAndReadSensorTemp();
|
||||
|
||||
@ -253,7 +257,7 @@ class ThermalController : public ExtendedControllerBase {
|
||||
void ctrlMpa();
|
||||
void ctrlScexBoard();
|
||||
void heaterTransitionControl();
|
||||
uint32_t tempFloatToU32();
|
||||
uint32_t tempFloatToU32() const;
|
||||
void tooHotHandler(object_id_t object, bool& oneShotFlag);
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,6 @@ 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);
|
||||
|
@ -4,11 +4,13 @@
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <mission/acsDefs.h>
|
||||
#include <mission/comDefs.h>
|
||||
#include <mission/controller/controllerdefinitions/tcsCtrlDefs.h>
|
||||
|
||||
EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {
|
||||
auto mqArgs = MqArgs(getObjectId(), static_cast<void*>(this));
|
||||
auto mqArgs = MqArgs(SubsystemBase::getObjectId(), static_cast<void*>(this));
|
||||
eventQueue =
|
||||
QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
@ -67,16 +69,37 @@ ReturnValue_t EiveSystem::initialize() {
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
// TODO: manager->subscribeToEvent(eventQueue->getId(), )
|
||||
manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::SYRLINKS_OVERHEATING));
|
||||
manager->subscribeToEvent(eventQueue->getId(),
|
||||
event::getEventId(tcsCtrl::PCDU_SYSTEM_OVERHEATING));
|
||||
manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::OBC_OVERHEATING));
|
||||
|
||||
return Subsystem::initialize();
|
||||
}
|
||||
|
||||
void EiveSystem::handleEventMessages() {
|
||||
EventMessage event;
|
||||
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK;
|
||||
result = eventQueue->receiveMessage(&event)) {
|
||||
for (ReturnValue_t status = eventQueue->receiveMessage(&event); status == returnvalue::OK;
|
||||
status = eventQueue->receiveMessage(&event)) {
|
||||
switch (event.getMessageId()) {
|
||||
case EventMessage::EVENT_MESSAGE:
|
||||
switch (event.getEvent()) {
|
||||
case tcsCtrl::SYRLINKS_OVERHEATING: {
|
||||
CommandMessage msg;
|
||||
ModeMessage::setCmdModeMessage(msg, com::RX_ONLY, 0);
|
||||
ReturnValue_t result =
|
||||
commandQueue->sendMessage(childrenMap[objects::COM_SUBSYSTEM].commandQueue, &msg);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "EiveSystem: Commanding COM to RX_ONLY failed" << std::endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tcsCtrl::OBC_OVERHEATING:
|
||||
case tcsCtrl::PCDU_SYSTEM_OVERHEATING: {
|
||||
commandSelfToSafe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe "
|
||||
@ -86,3 +109,14 @@ void EiveSystem::handleEventMessages() {
|
||||
}
|
||||
}
|
||||
}
|
||||
void EiveSystem::commandSelfToSafe() {
|
||||
if (fallbackCommandCd.hasTimedOut()) {
|
||||
CommandMessage msg;
|
||||
ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, 0);
|
||||
ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "EiveSystem: Commanding EIVE-System to SAFE failed" << std::endl;
|
||||
}
|
||||
fallbackCommandCd.resetTimer();
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,14 @@ class EiveSystem : public Subsystem {
|
||||
EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
||||
|
||||
private:
|
||||
MessageQueueIF* eventQueue = nullptr;
|
||||
Countdown fallbackCommandCd = Countdown(30000);
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
void performChildOperation() override;
|
||||
void announceMode(bool recursive) override;
|
||||
void handleEventMessages();
|
||||
|
||||
MessageQueueIF* eventQueue = nullptr;
|
||||
void commandSelfToSafe();
|
||||
};
|
||||
|
||||
#endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user