limit for error events thermalcontroller + dummy beta
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
This commit is contained in:
parent
9b849d10e9
commit
e13636167f
@ -186,7 +186,8 @@ void scheduling::initTasks() {
|
|||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
|
|
||||||
PeriodicTaskIF* dummyTask = factory->createPeriodicTask(
|
PeriodicTaskIF* dummyTask = factory->createPeriodicTask(
|
||||||
"DUMMY_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
|
"DUMMY_TASK", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||||
|
dummyTask->addComponent(objects::THERMAL_TEMP_INSERTER);
|
||||||
scheduling::scheduleTmpTempSensors(dummyTask);
|
scheduling::scheduleTmpTempSensors(dummyTask);
|
||||||
scheduling::scheduleRtdSensors(dummyTask);
|
scheduling::scheduleRtdSensors(dummyTask);
|
||||||
dummyTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
dummyTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "Max31865Dummy.h"
|
#include "Max31865Dummy.h"
|
||||||
|
|
||||||
|
#include "fsfw/datapool/PoolReadGuard.h"
|
||||||
|
|
||||||
using namespace returnvalue;
|
using namespace returnvalue;
|
||||||
|
|
||||||
Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
||||||
@ -35,8 +37,12 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Max31865Dummy::setTemperature(float temperature) {
|
void Max31865Dummy::setTemperature(float temperature, bool valid) {
|
||||||
set.temperatureCelcius.value = temperature;
|
PoolReadGuard pg(&set);
|
||||||
|
if(pg.getReadResult() == returnvalue::OK) {
|
||||||
|
set.temperatureCelcius.value = temperature;
|
||||||
|
set.setValidity(valid, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; }
|
LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; }
|
||||||
|
@ -9,7 +9,7 @@ class Max31865Dummy : public DeviceHandlerBase {
|
|||||||
Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
||||||
Max31865Dummy(object_id_t objectId, CookieIF *comCookie);
|
Max31865Dummy(object_id_t objectId, CookieIF *comCookie);
|
||||||
|
|
||||||
void setTemperature(float temperature);
|
void setTemperature(float temperature, bool setValid);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MAX31865::PrimarySet set;
|
MAX31865::PrimarySet set;
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||||
|
|
||||||
|
#include "fsfw/datapool/PoolReadGuard.h"
|
||||||
|
|
||||||
P60DockDummy::P60DockDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
P60DockDummy::P60DockDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
||||||
: DeviceHandlerBase(objectId, comif, comCookie) {}
|
: DeviceHandlerBase(objectId, comif, comCookie) {}
|
||||||
|
|
||||||
@ -40,7 +42,7 @@ uint32_t P60DockDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { re
|
|||||||
|
|
||||||
ReturnValue_t P60DockDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
ReturnValue_t P60DockDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||||
LocalDataPoolManager &poolManager) {
|
LocalDataPoolManager &poolManager) {
|
||||||
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, new PoolEntry<float>({0}));
|
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, new PoolEntry<float>({10}, true));
|
||||||
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, new PoolEntry<float>({0}));
|
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, new PoolEntry<float>({10}, true));
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define DUMMIES_P60DOCKDUMMY_H_
|
#define DUMMIES_P60DOCKDUMMY_H_
|
||||||
|
|
||||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
|
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||||
|
|
||||||
class P60DockDummy : public DeviceHandlerBase {
|
class P60DockDummy : public DeviceHandlerBase {
|
||||||
public:
|
public:
|
||||||
@ -15,6 +16,8 @@ class P60DockDummy : public DeviceHandlerBase {
|
|||||||
virtual ~P60DockDummy();
|
virtual ~P60DockDummy();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
lp_var_t<float> temp1 = lp_var_t<float>(this, P60Dock::pool::P60DOCK_TEMPERATURE_1);
|
||||||
|
lp_var_t<float> temp2 = lp_var_t<float>(this, P60Dock::pool::P60DOCK_TEMPERATURE_2);
|
||||||
void doStartUp() override;
|
void doStartUp() override;
|
||||||
void doShutDown() override;
|
void doShutDown() override;
|
||||||
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
|
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
|
||||||
|
@ -9,12 +9,14 @@
|
|||||||
TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId,
|
TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId,
|
||||||
Max31865DummyMap tempSensorDummies_,
|
Max31865DummyMap tempSensorDummies_,
|
||||||
Tmp1075DummyMap tempTmpSensorDummies_)
|
Tmp1075DummyMap tempTmpSensorDummies_)
|
||||||
: SystemObject(objects::THERMAL_TEMP_INSERTER),
|
: SystemObject(objectId),
|
||||||
max31865DummyMap(std::move(tempSensorDummies_)),
|
max31865DummyMap(std::move(tempSensorDummies_)),
|
||||||
tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {}
|
tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {}
|
||||||
|
|
||||||
ReturnValue_t TemperatureSensorInserter::initialize() {
|
ReturnValue_t TemperatureSensorInserter::initialize() {
|
||||||
|
|
||||||
if (performTest) {
|
if (performTest) {
|
||||||
|
|
||||||
if (testCase == TestCase::COOL_SYRLINKS) {
|
if (testCase == TestCase::COOL_SYRLINKS) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -22,6 +24,17 @@ ReturnValue_t TemperatureSensorInserter::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
|
ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
|
||||||
|
if(not tempsWereInitialized) {
|
||||||
|
for(auto& rtdDummy: max31865DummyMap) {
|
||||||
|
rtdDummy.second->setTemperature(10, true);
|
||||||
|
}
|
||||||
|
for(auto& tmpDummy: tmp1075DummyMap) {
|
||||||
|
tmpDummy.second->setTemperature(10, true);
|
||||||
|
}
|
||||||
|
tempsWereInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ReturnValue_t result = max31865PlocHeatspreaderSet.read();
|
ReturnValue_t result = max31865PlocHeatspreaderSet.read();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
@ -38,3 +51,7 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
|
|||||||
*/
|
*/
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
ReturnValue_t TemperatureSensorInserter::initializeAfterTaskCreation() {
|
||||||
|
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
||||||
|
@ -14,6 +14,7 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject
|
|||||||
Tmp1075DummyMap tempTmpSensorDummies_);
|
Tmp1075DummyMap tempTmpSensorDummies_);
|
||||||
|
|
||||||
ReturnValue_t initialize() override;
|
ReturnValue_t initialize() override;
|
||||||
|
ReturnValue_t initializeAfterTaskCreation() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
ReturnValue_t performOperation(uint8_t opCode) override;
|
||||||
@ -23,6 +24,7 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject
|
|||||||
Tmp1075DummyMap tmp1075DummyMap;
|
Tmp1075DummyMap tmp1075DummyMap;
|
||||||
enum TestCase { NONE = 0, COOL_SYRLINKS = 1 };
|
enum TestCase { NONE = 0, COOL_SYRLINKS = 1 };
|
||||||
int iteration = 0;
|
int iteration = 0;
|
||||||
|
bool tempsWereInitialized = false;
|
||||||
bool performTest = false;
|
bool performTest = false;
|
||||||
TestCase testCase = TestCase::NONE;
|
TestCase testCase = TestCase::NONE;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "Tmp1075Dummy.h"
|
#include "Tmp1075Dummy.h"
|
||||||
|
|
||||||
|
#include "fsfw/datapool/PoolReadGuard.h"
|
||||||
#include "mission/devices/devicedefinitions/Tmp1075Definitions.h"
|
#include "mission/devices/devicedefinitions/Tmp1075Definitions.h"
|
||||||
|
|
||||||
using namespace returnvalue;
|
using namespace returnvalue;
|
||||||
@ -24,6 +25,11 @@ ReturnValue_t Tmp1075Dummy::scanForReply(const uint8_t *start, size_t len,
|
|||||||
ReturnValue_t Tmp1075Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
|
ReturnValue_t Tmp1075Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
void Tmp1075Dummy::setTemperature(float temperature, bool valid) {
|
||||||
|
PoolReadGuard pg(&set);
|
||||||
|
set.temperatureCelcius.value = temperature;
|
||||||
|
set.setValidity(valid, true);
|
||||||
|
}
|
||||||
void Tmp1075Dummy::fillCommandAndReplyMap() {}
|
void Tmp1075Dummy::fillCommandAndReplyMap() {}
|
||||||
uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; }
|
uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; }
|
||||||
ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
class Tmp1075Dummy : public DeviceHandlerBase {
|
class Tmp1075Dummy : public DeviceHandlerBase {
|
||||||
public:
|
public:
|
||||||
Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
||||||
|
void setTemperature(float temperature, bool setValid);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TMP1075::Tmp1075Dataset set;
|
TMP1075::Tmp1075Dataset set;
|
||||||
|
@ -150,6 +150,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) {
|
|||||||
objects::TMP1075_HANDLER_IF_BOARD,
|
objects::TMP1075_HANDLER_IF_BOARD,
|
||||||
new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy));
|
new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy));
|
||||||
|
|
||||||
|
|
||||||
new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies,
|
new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies,
|
||||||
tempTmpSensorDummies);
|
tempTmpSensorDummies);
|
||||||
}
|
}
|
||||||
|
@ -91,22 +91,23 @@ void ThermalController::performControlOperation() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t result = sensorTemperatures.read();
|
{
|
||||||
if (result == returnvalue::OK) {
|
PoolReadGuard pg(&sensorTemperatures);
|
||||||
copySensors();
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
sensorTemperatures.commit();
|
copySensors();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
result = susTemperatures.read();
|
PoolReadGuard pg(&susTemperatures);
|
||||||
if (result == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
copySus();
|
copySus();
|
||||||
susTemperatures.commit();
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
result = deviceTemperatures.read();
|
PoolReadGuard pg(&deviceTemperatures);
|
||||||
if (result == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
copyDevices();
|
copyDevices();
|
||||||
deviceTemperatures.commit();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
performThermalModuleCtrl();
|
performThermalModuleCtrl();
|
||||||
@ -1178,7 +1179,8 @@ void ThermalController::ctrlPcduAcu() {
|
|||||||
if (chooseHeater(switchNr, redSwitchNr)) {
|
if (chooseHeater(switchNr, redSwitchNr)) {
|
||||||
bool sensorTempAvailable = true;
|
bool sensorTempAvailable = true;
|
||||||
|
|
||||||
if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) { //TODO: war invalid aber Wert 0 stat 999
|
if (deviceTemperatures.acu.value[0] !=
|
||||||
|
INVALID_TEMPERATURE) { // TODO: war invalid aber Wert 0 stat 999
|
||||||
sensorTemp = deviceTemperatures.acu.value[0];
|
sensorTemp = deviceTemperatures.acu.value[0];
|
||||||
} else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) {
|
} else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) {
|
||||||
sensorTemp = deviceTemperatures.acu.value[1];
|
sensorTemp = deviceTemperatures.acu.value[1];
|
||||||
@ -1426,10 +1428,22 @@ bool ThermalController::selectAndReadSensorTemp() {
|
|||||||
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) {
|
||||||
sensorTemp = sensors[i].second;
|
sensorTemp = sensors[i].second;
|
||||||
|
errorCounters[thermalComponent] = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
|
|
||||||
|
errorCounters[thermalComponent] ++;
|
||||||
|
if(thermalComponent != rw and thermalComponent != acsBoard){
|
||||||
|
if (errorCounters[thermalComponent] <= 3){
|
||||||
|
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (errorCounters[thermalComponent] <= 8){
|
||||||
|
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1458,5 +1472,5 @@ void ThermalController::resetSensorsArray() {
|
|||||||
validValuePair.first = false;
|
validValuePair.first = false;
|
||||||
validValuePair.second = INVALID_TEMPERATURE;
|
validValuePair.second = INVALID_TEMPERATURE;
|
||||||
}
|
}
|
||||||
thermalComponent = none;
|
thermalComponent = NONE;
|
||||||
}
|
}
|
||||||
|
@ -34,31 +34,33 @@ struct TempLimits {
|
|||||||
float nopUpperLimit;
|
float nopUpperLimit;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ThermalComponents {
|
enum ThermalComponents: uint8_t {
|
||||||
none,
|
//TODO: Großbuchstaben
|
||||||
acsBoard,
|
NONE = 0,
|
||||||
mgt,
|
acsBoard = 1,
|
||||||
rw,
|
mgt = 2,
|
||||||
str,
|
rw = 3,
|
||||||
ifBoard,
|
str = 4,
|
||||||
tcsBoard,
|
ifBoard = 5,
|
||||||
obc,
|
tcsBoard = 6,
|
||||||
obcIfBoard,
|
obc = 7,
|
||||||
sBandTransceiver,
|
obcIfBoard = 8,
|
||||||
pcduP60Board,
|
sBandTransceiver = 9,
|
||||||
pcduAcu,
|
pcduP60Board = 10,
|
||||||
pcduPdu,
|
pcduAcu = 11,
|
||||||
plPcduBoard,
|
pcduPdu = 12,
|
||||||
plocMissionBoard,
|
plPcduBoard = 13,
|
||||||
plocProcessingBoard,
|
plocMissionBoard = 14,
|
||||||
dac,
|
plocProcessingBoard = 15,
|
||||||
camera,
|
dac = 16,
|
||||||
dro,
|
camera = 17,
|
||||||
x8,
|
dro = 18,
|
||||||
hpa,
|
x8 = 19,
|
||||||
tx,
|
hpa = 20,
|
||||||
mpa,
|
tx = 21,
|
||||||
scexBoard
|
mpa = 22,
|
||||||
|
scexBoard = 23,
|
||||||
|
NUM_ENTRIES
|
||||||
};
|
};
|
||||||
|
|
||||||
class ThermalController : public ExtendedControllerBase {
|
class ThermalController : public ExtendedControllerBase {
|
||||||
@ -173,9 +175,10 @@ class ThermalController : public ExtendedControllerBase {
|
|||||||
TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0);
|
TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0);
|
||||||
|
|
||||||
double sensorTemp = INVALID_TEMPERATURE;
|
double sensorTemp = INVALID_TEMPERATURE;
|
||||||
ThermalComponents thermalComponent = none;
|
ThermalComponents thermalComponent = NONE;
|
||||||
bool redSwitchNrInUse = false;
|
bool redSwitchNrInUse = false;
|
||||||
bool componentAboveCutOffLimit = false;
|
bool componentAboveCutOffLimit = false;
|
||||||
|
uint8_t errorCounters[32];
|
||||||
|
|
||||||
// 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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user