works better now
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-03-15 16:19:37 +01:00
parent 364342855d
commit 8201a4140a
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 20 additions and 12 deletions

View File

@ -17,7 +17,7 @@
#include <objects/systemObjectList.h> #include <objects/systemObjectList.h>
// Enabling this should trigger a special event which in turn should trigger a system reaction. // Enabling this should trigger a special event which in turn should trigger a system reaction.
#define LOWER_SYRLINKS_UPPER_LIMITS 1 #define LOWER_SYRLINKS_UPPER_LIMITS 0
ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater) ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater)
: ExtendedControllerBase(objectId), : ExtendedControllerBase(objectId),
@ -67,11 +67,6 @@ ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater
susSet11(objects::SUS_11_R_LOC_XBYMZB_PT_ZB) { susSet11(objects::SUS_11_R_LOC_XBYMZB_PT_ZB) {
resetSensorsArray(); resetSensorsArray();
#if LOWER_SYRLINKS_UPPER_LIMITS == 1
sBandTransceiverLimits.cutOffLimit = 0;
sBandTransceiverLimits.opUpperLimit = 0;
sBandTransceiverLimits.nopUpperLimit = 0;
#endif
} }
ReturnValue_t ThermalController::initialize() { ReturnValue_t ThermalController::initialize() {
@ -91,6 +86,7 @@ void ThermalController::performControlOperation() {
#if OBSW_THREAD_TRACING == 1 #if OBSW_THREAD_TRACING == 1
trace::threadTrace(opCounter, "TCS Task"); trace::threadTrace(opCounter, "TCS Task");
#endif #endif
switch (internalState) { switch (internalState) {
case InternalState::STARTUP: { case InternalState::STARTUP: {
initialCountdown.resetTimer(); initialCountdown.resetTimer();
@ -99,6 +95,7 @@ void ThermalController::performControlOperation() {
} }
case InternalState::INITIAL_DELAY: { case InternalState::INITIAL_DELAY: {
if (initialCountdown.hasTimedOut()) { if (initialCountdown.hasTimedOut()) {
sif::info << "Starting thermal control operations" << std::endl;
internalState = InternalState::READY; internalState = InternalState::READY;
} }
return; return;
@ -110,6 +107,14 @@ void ThermalController::performControlOperation() {
break; break;
} }
if(cycles == 50) {
#if LOWER_SYRLINKS_UPPER_LIMITS == 1
sBandTransceiverLimits.cutOffLimit = 0;
sBandTransceiverLimits.opUpperLimit = 0;
sBandTransceiverLimits.nopUpperLimit = 0;
#endif
}
{ {
PoolReadGuard pg(&sensorTemperatures); PoolReadGuard pg(&sensorTemperatures);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
@ -143,6 +148,7 @@ void ThermalController::performControlOperation() {
} }
performThermalModuleCtrl(); performThermalModuleCtrl();
cycles++;
} }
ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
@ -1217,7 +1223,7 @@ void ThermalController::ctrlSBandTransceiver() {
triggerEvent(tcsCtrl::SYRLINKS_OVERHEATING, tempFloatToU32()); triggerEvent(tcsCtrl::SYRLINKS_OVERHEATING, tempFloatToU32());
syrlinksTooHotFlag = true; syrlinksTooHotFlag = true;
} else if (not componentAboveUpperLimit) { } else if (not componentAboveUpperLimit) {
syrlinksTooHotFlag = true; syrlinksTooHotFlag = false;
} }
} }
void ThermalController::ctrlPcduP60Board() { void ThermalController::ctrlPcduP60Board() {
@ -1541,8 +1547,8 @@ void ThermalController::checkLimitsAndCtrlHeater(heater::Switchers switchNr,
componentAboveUpperLimit = false; componentAboveUpperLimit = false;
auto tempTooHighHandler = [&](const char* whatLimit, bool heaterIsOn) { auto tempTooHighHandler = [&](const char* whatLimit, bool heaterIsOn) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::checkLimitsAndCtrlHeater: Reached " << whatLimit << ": Heater " sif::info << "ThermalController::checkLimitsAndCtrlHeater: Exceeded " << whatLimit << ": "
<< static_cast<int>(thermalComponent) << " OFF" << std::endl; "Heater for component " << static_cast<int>(thermalComponent) << std::endl;
heaterStates[switchNr].switchTransition = true; heaterStates[switchNr].switchTransition = true;
if (heaterIsOn) { if (heaterIsOn) {
heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF);

View File

@ -97,7 +97,7 @@ class ThermalController : public ExtendedControllerBase {
uint32_t* msToReachTheMode) override; uint32_t* msToReachTheMode) override;
private: private:
static const uint32_t DELAY = 500; static const uint32_t INIT_DELAY = 3000;
static const uint32_t TEMP_OFFSET = 5; static const uint32_t TEMP_OFFSET = 5;
@ -196,11 +196,13 @@ class ThermalController : public ExtendedControllerBase {
bool obcTooHotFlag = false; bool obcTooHotFlag = false;
bool strTooHotFlag = false; bool strTooHotFlag = false;
bool rwTooHotFlag = false; bool rwTooHotFlag = false;
uint32_t cycles = 0;
std::array<ThermalState, 30> thermalStates{}; std::array<ThermalState, 30> thermalStates{};
std::array<HeaterState, 7> heaterStates{}; std::array<HeaterState, 7> heaterStates{};
// Initial delay to make sure all pool variables have been initialized their owners // Initial delay to make sure all pool variables have been initialized their owners.
Countdown initialCountdown = Countdown(DELAY); // Also, wait for system initialization to complete.
Countdown initialCountdown = Countdown(INIT_DELAY);
#if OBSW_THREAD_TRACING == 1 #if OBSW_THREAD_TRACING == 1
uint32_t opCounter = 0; uint32_t opCounter = 0;