works better now
EIVE/eive-obsw/pipeline/pr-develop This commit looks good Details

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

View File

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