thermal control changes
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Irini Kosmidou 2023-01-04 17:30:17 +01:00
parent 73df54abb0
commit 23906047ec
2 changed files with 35 additions and 29 deletions

View File

@ -976,6 +976,7 @@ void ThermalController::copyDevices() {
} }
} }
/*
void ThermalController::ctrlAcsBoard() { void ThermalController::ctrlAcsBoard() {
ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, &acsBoardLimits); ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, &acsBoardLimits);
} }
@ -987,7 +988,7 @@ void ThermalController::ctrlMgt() {
chooseHeater(switchNr, redSwitchNr); chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) { if (heaterAvailable) {
chooseSensor(switchNr, sensorTemperatures.sensor_magnettorquer.value, chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_magnettorquer.value,
deviceTemperatures.mgt.value, sensorTemperatures.sensor_plpcdu_heatspreader.value, deviceTemperatures.mgt.value, sensorTemperatures.sensor_plpcdu_heatspreader.value,
sensorTemperatures.sensor_magnettorquer.isValid(), sensorTemperatures.sensor_magnettorquer.isValid(),
deviceTemperatures.mgt.isValid(), deviceTemperatures.mgt.isValid(),
@ -1010,7 +1011,7 @@ void ThermalController::ctrlStr() {
chooseHeater(switchNr, redSwitchNr); chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) { if (heaterAvailable) {
chooseSensor(switchNr, sensorTemperatures.sensor_startracker.value, chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_startracker.value,
deviceTemperatures.startracker.value, sensorTemperatures.sensor_dro.value, deviceTemperatures.startracker.value, sensorTemperatures.sensor_dro.value,
sensorTemperatures.sensor_startracker.isValid(), sensorTemperatures.sensor_startracker.isValid(),
deviceTemperatures.startracker.isValid(), sensorTemperatures.sensor_dro.isValid()); deviceTemperatures.startracker.isValid(), sensorTemperatures.sensor_dro.isValid());
@ -1028,7 +1029,7 @@ void ThermalController::ctrlIfBoard() {
chooseHeater(switchNr, redSwitchNr); chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) { if (heaterAvailable) {
chooseSensor(switchNr, sensorTemperatures.tmp1075IfBrd.value, chooseSensorOldVersion(switchNr, sensorTemperatures.tmp1075IfBrd.value,
sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgm2SideB.value, sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgm2SideB.value,
sensorTemperatures.tmp1075IfBrd.isValid(), sensorTemperatures.tmp1075IfBrd.isValid(),
sensorTemperatures.sensor_magnettorquer.isValid(), sensorTemperatures.sensor_magnettorquer.isValid(),
@ -1085,7 +1086,7 @@ void ThermalController::ctrlPlocProcessingBoard() {
chooseHeater(switchNr, redSwitchNr); chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) { if (heaterAvailable) {
chooseSensor(switchNr, sensorTemperatures.sensor_ploc_missionboard.value, chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_ploc_missionboard.value,
sensorTemperatures.sensor_ploc_heatspreader.value, sensorTemperatures.sensor_ploc_heatspreader.value,
sensorTemperatures.sensor_dac_heatspreader.value, sensorTemperatures.sensor_dac_heatspreader.value,
sensorTemperatures.sensor_ploc_missionboard.isValid(), sensorTemperatures.sensor_ploc_missionboard.isValid(),
@ -1105,7 +1106,7 @@ void ThermalController::ctrlDac() {
chooseHeater(switchNr, redSwitchNr); chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) { if (heaterAvailable) {
chooseSensor(switchNr, sensorTemperatures.sensor_dac_heatspreader.value, chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_dac_heatspreader.value,
sensorTemperatures.sensor_ploc_missionboard.value, sensorTemperatures.sensor_ploc_missionboard.value,
sensorTemperatures.sensor_ploc_heatspreader.value, sensorTemperatures.sensor_ploc_heatspreader.value,
sensorTemperatures.sensor_dac_heatspreader.isValid(), sensorTemperatures.sensor_dac_heatspreader.isValid(),
@ -1117,25 +1118,11 @@ void ThermalController::ctrlDac() {
} }
} }
} }
*/
void ThermalController::ctrlCameraBody() { void ThermalController::ctrlCameraBody() {
heater::Switchers switchNr = heater::HEATER_4_CAMERA; ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, sensorTemperatures.sensor_4k_camera, sensorTemperatures.sensor_dro, sensorTemperatures.sensor_mpa, &cameraLimits);
heater::Switchers redSwitchNr = heater::HEATER_6_DRO;
//chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) {
chooseSensor(switchNr, sensorTemperatures.sensor_4k_camera.value,
sensorTemperatures.sensor_dro.value, sensorTemperatures.sensor_mpa.value,
sensorTemperatures.sensor_4k_camera.isValid(),
sensorTemperatures.sensor_dro.isValid(), sensorTemperatures.sensor_mpa.isValid());
if (sensorTempAvailable) {
//ctrlHeater(switchNr, redSwitchNr, &cameraLimits);
}
}
} }
/*
void ThermalController::ctrlDro() { void ThermalController::ctrlDro() {
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &droLimits); ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &droLimits);
} }
@ -1159,7 +1146,7 @@ void ThermalController::ctrlHpa() {
void ThermalController::ctrlScexBoard() { void ThermalController::ctrlScexBoard() {
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, &scexBoardLimits); ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, &scexBoardLimits);
} }
*/
void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
struct TempLimits* tempLimit) { struct TempLimits* tempLimit) {
// Heater off // Heater off
@ -1183,7 +1170,6 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers
} }
void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) { void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) {
// Choose Heater
heaterAvailable = true; heaterAvailable = true;
if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) { if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) {
@ -1200,7 +1186,26 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch
} }
} }
void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorValue1, void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3) {
sensorTempAvailable = true;
if (sensor1.isValid()) {
sensorTemp = sensor1.value;
} else if (sensor2.isValid()) {
sensorTemp = sensor2.value;
} else if (sensor3.isValid()) {
sensorTemp = sensor3.value;
} else {
if (heaterHandler.checkSwitchState(switchNr)) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
}
//TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr);
sif::error << "ThermalController::chooseSensor: No valid Sensor found"<< std::endl;
sensorTempAvailable = false;
}
}
void ThermalController::chooseSensorOldVersion(heater::Switchers switchNr, float sensorValue1,
float sensorValue2, float sensorValue3, bool sensor1Valid, float sensorValue2, float sensorValue3, bool sensor1Valid,
bool sensor2Valid, bool sensor3Valid) { bool sensor2Valid, bool sensor3Valid) {
sensorTempAvailable = true; sensorTempAvailable = true;
@ -1222,12 +1227,12 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorVal
} }
void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr,
heater::Switchers redSwitchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3,
TempLimits* tempLimit) { TempLimits* tempLimit) {
chooseHeater(switchNr, redSwitchNr); chooseHeater(switchNr, redSwitchNr);
if (heaterAvailable) { if (heaterAvailable) {
// chooseSensor(); //TODO chooseSensor(switchNr, sensor1, sensor2, sensor3);
if (sensorTempAvailable) { if (sensorTempAvailable) {
ctrlHeater(switchNr, redSwitchNr, tempLimit); ctrlHeater(switchNr, redSwitchNr, tempLimit);

View File

@ -155,12 +155,13 @@ class ThermalController : public ExtendedControllerBase {
void copySus(); void copySus();
void copyDevices(); void copyDevices();
void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3,
TempLimits* tempLimit); TempLimits* tempLimit);
void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
struct TempLimits* tempLimit); struct TempLimits* tempLimit);
void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr);
void chooseSensor(heater::Switchers switchNr, float sensorValue1, float sensorValue2, void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3);
void chooseSensorOldVersion(heater::Switchers switchNr, float sensorValue1, float sensorValue2,
float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid); float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid);
void ctrlAcsBoard(); void ctrlAcsBoard();