this is going to be annoying
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-11-16 17:33:19 +01:00
parent 311d03e680
commit 33bd5cb63a
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 36 additions and 19 deletions

View File

@ -7,7 +7,8 @@
TemperatureSensorsDummy::TemperatureSensorsDummy() TemperatureSensorsDummy::TemperatureSensorsDummy()
: ExtendedControllerBase(objects::RTD_0_IC3_PLOC_HEATSPREADER), : ExtendedControllerBase(objects::RTD_0_IC3_PLOC_HEATSPREADER),
max31865Set(this, MAX31865::MAX31865_SET_ID) { max31865PlocHeatspreaderSet(objects::RTD_0_IC3_PLOC_HEATSPREADER, MAX31865::MAX31865_SET_ID),
max31865PlocMissionboardSet(objects::RTD_1_IC4_PLOC_MISSIONBOARD, MAX31865::MAX31865_SET_ID) {
ObjectManager::instance()->insert(objects::RTD_1_IC4_PLOC_MISSIONBOARD, this); ObjectManager::instance()->insert(objects::RTD_1_IC4_PLOC_MISSIONBOARD, this);
ObjectManager::instance()->insert(objects::RTD_2_IC5_4K_CAMERA, this); ObjectManager::instance()->insert(objects::RTD_2_IC5_4K_CAMERA, this);
ObjectManager::instance()->insert(objects::RTD_3_IC6_DAC_HEATSPREADER, this); ObjectManager::instance()->insert(objects::RTD_3_IC6_DAC_HEATSPREADER, this);
@ -37,6 +38,8 @@ ReturnValue_t TemperatureSensorsDummy::initialize() {
} }
} }
max31865PlocHeatspreaderSet.temperatureCelcius = 20.0;
max31865PlocMissionboardSet.temperatureCelcius = 20.0;
return returnvalue::OK; return returnvalue::OK;
} }
@ -48,18 +51,18 @@ void TemperatureSensorsDummy::performControlOperation() {
iteration++; iteration++;
value = sin(iteration / 80. * M_PI) * 10; value = sin(iteration / 80. * M_PI) * 10;
ReturnValue_t result = max31865Set.read(); ReturnValue_t result = max31865PlocHeatspreaderSet.read();
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl; sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl;
} }
max31865Set.rtdValue = value - 5; max31865PlocHeatspreaderSet.rtdValue = value - 5;
max31865Set.temperatureCelcius = value; max31865PlocHeatspreaderSet.temperatureCelcius = value;
if ((iteration % 100) < 20) { if ((iteration % 100) < 20) {
max31865Set.setValidity(false, true); max31865PlocHeatspreaderSet.setValidity(false, true);
} else { } else {
max31865Set.setValidity(true, true); max31865PlocHeatspreaderSet.setValidity(true, true);
} }
max31865Set.commit(); max31865PlocHeatspreaderSet.commit();
} }
ReturnValue_t TemperatureSensorsDummy::initializeLocalDataPool( ReturnValue_t TemperatureSensorsDummy::initializeLocalDataPool(
@ -78,10 +81,11 @@ ReturnValue_t TemperatureSensorsDummy::initializeLocalDataPool(
LocalPoolDataSetBase* TemperatureSensorsDummy::getDataSetHandle(sid_t sid) { LocalPoolDataSetBase* TemperatureSensorsDummy::getDataSetHandle(sid_t sid) {
sif::debug << "getHandle" << std::endl; sif::debug << "getHandle" << std::endl;
switch (sid.ownerSetId) { if (sid.objectId == objects::RTD_0_IC3_PLOC_HEATSPREADER) {
case MAX31865::MAX31865_SET_ID: return &max31865PlocHeatspreaderSet;
return &max31865Set; } else if (sid.objectId == objects::RTD_1_IC4_PLOC_MISSIONBOARD) {
default: return &max31865PlocMissionboardSet;
} else {
return nullptr; return nullptr;
} }
} }

View File

@ -23,7 +23,8 @@ class TemperatureSensorsDummy : public ExtendedControllerBase {
private: private:
int iteration = 0; int iteration = 0;
float value = 0; float value = 0;
MAX31865::Max31865Set max31865Set; MAX31865::Max31865Set max31865PlocHeatspreaderSet;
MAX31865::Max31865Set max31865PlocMissionboardSet;
void noise(); void noise();
}; };

View File

@ -102,6 +102,8 @@ void ThermalController::performControlOperation() {
copyDevices(); copyDevices();
deviceTemperatures.commit(); deviceTemperatures.commit();
} }
// TODO: Heater control
} }
ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,

View File

@ -8,6 +8,12 @@
#include <mission/devices/devicedefinitions/SusDefinitions.h> #include <mission/devices/devicedefinitions/SusDefinitions.h>
#include <mission/devices/devicedefinitions/Tmp1075Definitions.h> #include <mission/devices/devicedefinitions/Tmp1075Definitions.h>
struct TempLimits {
TempLimits(float lowerLimit, float upperLimit) : lowerLimit(lowerLimit), upperLimit(upperLimit) {}
float lowerLimit;
float upperLimit;
};
class ThermalController : public ExtendedControllerBase { class ThermalController : public ExtendedControllerBase {
public: public:
static const uint16_t INVALID_TEMPERATURE = 999; static const uint16_t INVALID_TEMPERATURE = 999;
@ -75,6 +81,8 @@ class ThermalController : public ExtendedControllerBase {
SUS::SusDataset susSet10; SUS::SusDataset susSet10;
SUS::SusDataset susSet11; SUS::SusDataset susSet11;
TempLimits eBandLimits = TempLimits(10.0, 20.0);
// 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); Countdown initialCountdown = Countdown(DELAY);

View File

@ -102,12 +102,13 @@ class SensorTemperatures : public StaticLocalDataSet<ENTRIES_SENSOR_TEMPERATURE_
lp_var_t<float> sensor_startracker = lp_var_t<float> sensor_startracker =
lp_var_t<float>(sid.objectId, PoolIds::SENSOR_STARTRACKER, this); lp_var_t<float>(sid.objectId, PoolIds::SENSOR_STARTRACKER, this);
lp_var_t<float> sensor_rw1 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_RW1, this); lp_var_t<float> sensor_rw1 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_RW1, this);
lp_var_t<float> sensor_dro = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_DRO, this);
lp_var_t<float> sensor_scex = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_SCEX, this); lp_var_t<float> sensor_scex = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_SCEX, this);
lp_var_t<float> sensor_tx_modul = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TX_MODUL, this);
// E-Band module
lp_var_t<float> sensor_dro = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_DRO, this);
lp_var_t<float> sensor_mpa = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_MPA, this);
lp_var_t<float> sensor_x8 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_X8, this); lp_var_t<float> sensor_x8 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_X8, this);
lp_var_t<float> sensor_hpa = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_HPA, this); lp_var_t<float> sensor_hpa = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_HPA, this);
lp_var_t<float> sensor_tx_modul = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TX_MODUL, this);
lp_var_t<float> sensor_mpa = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_MPA, this);
lp_var_t<float> sensor_acu = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_ACU, this); lp_var_t<float> sensor_acu = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_ACU, this);
lp_var_t<float> sensor_plpcdu_heatspreader = lp_var_t<float> sensor_plpcdu_heatspreader =
lp_var_t<float>(sid.objectId, PoolIds::SENSOR_PLPCDU_HEATSPREADER, this); lp_var_t<float>(sid.objectId, PoolIds::SENSOR_PLPCDU_HEATSPREADER, this);

View File

@ -41,6 +41,7 @@ class HeaterHandler : public ExecutableObjectIF,
public SystemObject, public SystemObject,
public HasActionsIF { public HasActionsIF {
friend class ThermalController; friend class ThermalController;
public: public:
static const uint8_t INTERFACE_ID = CLASS_ID::HEATER_HANDLER; static const uint8_t INTERFACE_ID = CLASS_ID::HEATER_HANDLER;
@ -60,7 +61,7 @@ class HeaterHandler : public ExecutableObjectIF,
virtual ~HeaterHandler(); virtual ~HeaterHandler();
protected: protected:
ReturnValue_t switchHeater(heater::Switchers heater, ReturnValue_t onOff); ReturnValue_t switchHeater(heater::Switchers heater, ReturnValue_t onOff);
ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t performOperation(uint8_t operationCode = 0) override;