TCS Sanity Range #564

Merged
muellerr merged 3 commits from tcs_sanity_range_check into develop 2023-04-04 17:53:44 +02:00
2 changed files with 26 additions and 21 deletions
Showing only changes of commit 908927ed9f - Show all commits

View File

@ -988,14 +988,16 @@ void ThermalController::ctrlAcsBoard() {
sensors[4].first = sensorTemperatures.tcsBoard.isValid(); sensors[4].first = sensorTemperatures.tcsBoard.isValid();
sensors[4].second = sensorTemperatures.tcsBoard.value; sensors[4].second = sensorTemperatures.tcsBoard.value;
numSensors = 5; numSensors = 5;
if (selectAndReadSensorTemp()) { {
if (chooseHeater(switchNr, redSwitchNr)) {
HeaterContext htrCtx(switchNr, redSwitchNr, acsBoardLimits); HeaterContext htrCtx(switchNr, redSwitchNr, acsBoardLimits);
if (selectAndReadSensorTemp(htrCtx)) {
if (chooseHeater(switchNr, redSwitchNr)) {
checkLimitsAndCtrlHeater(htrCtx); checkLimitsAndCtrlHeater(htrCtx);
} }
resetSensorsArray(); resetSensorsArray();
return; return;
} }
}
resetSensorsArray(); resetSensorsArray();
// B side // B side
sensors[0].first = deviceTemperatures.gyro2SideB.isValid(); sensors[0].first = deviceTemperatures.gyro2SideB.isValid();
@ -1007,9 +1009,11 @@ void ThermalController::ctrlAcsBoard() {
sensors[3].first = sensorTemperatures.tcsBoard.isValid(); sensors[3].first = sensorTemperatures.tcsBoard.isValid();
sensors[3].second = sensorTemperatures.tcsBoard.value; sensors[3].second = sensorTemperatures.tcsBoard.value;
numSensors = 4; numSensors = 4;
if (selectAndReadSensorTemp()) {
if (chooseHeater(switchNr, redSwitchNr)) { {
HeaterContext htrCtx(switchNr, redSwitchNr, acsBoardLimits); HeaterContext htrCtx(switchNr, redSwitchNr, acsBoardLimits);
if (selectAndReadSensorTemp(htrCtx)) {
if (chooseHeater(switchNr, redSwitchNr)) {
checkLimitsAndCtrlHeater(htrCtx); checkLimitsAndCtrlHeater(htrCtx);
} }
} else { } else {
@ -1019,6 +1023,7 @@ void ThermalController::ctrlAcsBoard() {
} }
} }
} }
}
resetSensorsArray(); resetSensorsArray();
} }
@ -1546,7 +1551,7 @@ void ThermalController::performThermalModuleCtrl(const HeaterSwitchStates& heate
heaterTransitionControl(heaterSwitchStates); heaterTransitionControl(heaterSwitchStates);
} }
void ThermalController::ctrlComponentTemperature(HeaterContext& htrCtx) { void ThermalController::ctrlComponentTemperature(HeaterContext& htrCtx) {
if (selectAndReadSensorTemp()) { if (selectAndReadSensorTemp(htrCtx)) {
if (chooseHeater(htrCtx.switchNr, htrCtx.redSwitchNr)) { if (chooseHeater(htrCtx.switchNr, htrCtx.redSwitchNr)) {
checkLimitsAndCtrlHeater(htrCtx); checkLimitsAndCtrlHeater(htrCtx);
} }

View File

@ -31,8 +31,8 @@
* limit is exceeded to avoid reaching NOP limit * limit is exceeded to avoid reaching NOP limit
*/ */
struct TempLimits { struct TempLimits {
TempLimits(float opLowerLimit, float cutOffLimit, float opUpperLimit, TempLimits(float nopLowerLimit, float opLowerLimit, float cutOffLimit, float opUpperLimit,
float nopUpperLimit, float sanityUpperLimit) float nopUpperLimit)
: opLowerLimit(opLowerLimit), : opLowerLimit(opLowerLimit),
opUpperLimit(opUpperLimit), opUpperLimit(opUpperLimit),
cutOffLimit(cutOffLimit), cutOffLimit(cutOffLimit),
@ -91,8 +91,8 @@ class ThermalController : public ExtendedControllerBase {
public: public:
static const uint16_t INVALID_TEMPERATURE = 999; static const uint16_t INVALID_TEMPERATURE = 999;
static const uint8_t NUMBER_OF_SENSORS = 16; static const uint8_t NUMBER_OF_SENSORS = 16;
static constexpr uint16_t SANITY_LIMIT_LOWER_TEMP = -80; static constexpr int16_t SANITY_LIMIT_LOWER_TEMP = -80;
static constexpr uint16_t SANITY_LIMIT_UPPER_TEMP = 160; static constexpr int16_t SANITY_LIMIT_UPPER_TEMP = 160;
ThermalController(object_id_t objectId, HeaterHandler& heater); ThermalController(object_id_t objectId, HeaterHandler& heater);
@ -220,7 +220,7 @@ class ThermalController : public ExtendedControllerBase {
lp_var_t<float> tempAdcPayloadPcdu = lp_var_t<float>(objects::PLPCDU_HANDLER, plpcdu::TEMP); lp_var_t<float> tempAdcPayloadPcdu = lp_var_t<float>(objects::PLPCDU_HANDLER, plpcdu::TEMP);
// TempLimits // TempLimits
TempLimits acsBoardLimits = TempLimits(5-40.0, -40.0, 80.0, 85.0, 85.0); TempLimits acsBoardLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0);
TempLimits mgtLimits = TempLimits(-40.0, -40.0, 65.0, 70.0, 70.0); TempLimits mgtLimits = TempLimits(-40.0, -40.0, 65.0, 70.0, 70.0);
TempLimits rwLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0); TempLimits rwLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0);
TempLimits strLimits = TempLimits(-30.0, -20.0, 65.0, 70.0, 80.0); TempLimits strLimits = TempLimits(-30.0, -20.0, 65.0, 70.0, 80.0);