Merge pull request 'TCS Sanity Range' (#564) from tcs_sanity_range_check into develop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #564
This commit is contained in:
commit
7df3308717
@ -16,6 +16,11 @@ will consitute of a breaking change warranting a new major release:
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- TCS controller now does a sanity check on the temperature values: Values below -80 C or above
|
||||||
|
160 C are ignored.
|
||||||
|
|
||||||
# [v1.43.0] 2023-04-04
|
# [v1.43.0] 2023-04-04
|
||||||
|
|
||||||
- q7s-package: v2.4.0
|
- q7s-package: v2.4.0
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
@ -1560,9 +1565,11 @@ void ThermalController::ctrlComponentTemperature(HeaterContext& htrCtx) {
|
|||||||
}
|
}
|
||||||
resetSensorsArray();
|
resetSensorsArray();
|
||||||
}
|
}
|
||||||
bool ThermalController::selectAndReadSensorTemp() {
|
bool ThermalController::selectAndReadSensorTemp(HeaterContext& htrCtx) {
|
||||||
for (unsigned i = 0; i < numSensors; i++) {
|
for (unsigned i = 0; i < numSensors; i++) {
|
||||||
if (sensors[i].first and sensors[i].second != INVALID_TEMPERATURE) {
|
if (sensors[i].first and sensors[i].second != INVALID_TEMPERATURE and
|
||||||
|
sensors[i].second > SANITY_LIMIT_LOWER_TEMP and
|
||||||
|
sensors[i].second < SANITY_LIMIT_UPPER_TEMP) {
|
||||||
sensorTemp = sensors[i].second;
|
sensorTemp = sensors[i].second;
|
||||||
thermalStates[thermalComponent].errorCounter = 0;
|
thermalStates[thermalComponent].errorCounter = 0;
|
||||||
return true;
|
return true;
|
||||||
|
@ -91,6 +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 int16_t SANITY_LIMIT_LOWER_TEMP = -80;
|
||||||
|
static constexpr int16_t SANITY_LIMIT_UPPER_TEMP = 160;
|
||||||
|
|
||||||
ThermalController(object_id_t objectId, HeaterHandler& heater);
|
ThermalController(object_id_t objectId, HeaterHandler& heater);
|
||||||
|
|
||||||
@ -299,7 +301,7 @@ class ThermalController : public ExtendedControllerBase {
|
|||||||
void heaterCtrlTempTooHighHandler(HeaterContext& heaterContext, const char* whatLimit);
|
void heaterCtrlTempTooHighHandler(HeaterContext& heaterContext, const char* whatLimit);
|
||||||
|
|
||||||
bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr);
|
bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr);
|
||||||
bool selectAndReadSensorTemp();
|
bool selectAndReadSensorTemp(HeaterContext& htrCtx);
|
||||||
|
|
||||||
void ctrlAcsBoard();
|
void ctrlAcsBoard();
|
||||||
void ctrlMgt();
|
void ctrlMgt();
|
||||||
|
Loading…
Reference in New Issue
Block a user