the TCS subsystem does not work on the EM..
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-07-06 16:00:39 +02:00
parent ee4285075a
commit b7e4953126
Signed by: muellerr
GPG Key ID: 407F9B00F858F270
11 changed files with 55 additions and 18 deletions

View File

@ -168,5 +168,5 @@ void ObjectFactory::produce(void* args) {
HeaterHandler* heaterHandler;
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler);
createThermalController(*heaterHandler, true);
satsystem::init();
satsystem::init(true);
}

View File

@ -133,5 +133,5 @@ void ObjectFactory::produce(void* args) {
createMiscComponents();
createThermalController(*heaterHandler, false);
createAcsController(true, enableHkSets);
satsystem::init();
satsystem::init(false);
}

View File

@ -9,7 +9,11 @@ Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *co
: DeviceHandlerBase(objectId, comif, comCookie), set(this) {}
void Tmp1075Dummy::doStartUp() { setMode(MODE_ON); }
void Tmp1075Dummy::doShutDown() { setMode(MODE_OFF); }
void Tmp1075Dummy::doShutDown() {
PoolReadGuard pg(&set);
set.setValidity(false, true);
setMode(MODE_OFF);
}
ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
@ -50,4 +54,11 @@ ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDa
return OK;
}
ReturnValue_t Tmp1075Dummy::setHealth(HealthState health) {
if (health == FAULTY or health == PERMANENT_FAULTY) {
setMode(_MODE_SHUT_DOWN);
}
return DeviceHandlerBase::setHealth(health);
}
LocalPoolDataSetBase *Tmp1075Dummy::getDataSetHandle(sid_t sid) { return &set; }

View File

@ -26,6 +26,7 @@ class Tmp1075Dummy : public DeviceHandlerBase {
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
ReturnValue_t setHealth(HealthState health) override;
protected:
LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override;

View File

@ -1209,6 +1209,9 @@ void ThermalController::ctrlIfBoard() {
sensors[2].first = deviceTemperatures.mgm2SideB.isValid();
sensors[2].second = deviceTemperatures.mgm2SideB.value;
numSensors = 3;
if (not sensors[1].first) {
sif::debug << "TMP1075 IF Board not valid" << std::endl;
}
HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_1_PCDU_PDU, ifBoardLimits);
ctrlComponentTemperature(htrCtx);
// TODO: special event overheating + could go back to safe mode
@ -1249,12 +1252,19 @@ void ThermalController::ctrlObc() {
void ThermalController::ctrlObcIfBoard() {
thermalComponent = OBCIF_BOARD;
sensors[0].first = deviceTemperatures.q7s.isValid();
sensors[0].second = deviceTemperatures.q7s.value;
sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid();
sensors[1].second = sensorTemperatures.tmp1075Tcs0.value;
sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid();
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
if (not sensors[1].first) {
sif::debug << "TMP1075 TCS 0 not valid" << std::endl;
}
if (not sensors[2].first) {
sif::debug << "TMP1075 TCS 1 not valid" << std::endl;
}
numSensors = 3;
HeaterContext htrCtx(heater::HEATER_3_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits);
ctrlComponentTemperature(htrCtx);
@ -1363,6 +1373,12 @@ void ThermalController::ctrlPlPcduBoard() {
sensors[2].second = deviceTemperatures.adcPayloadPcdu.value;
sensors[3].first = sensorTemperatures.plpcduHeatspreader.isValid();
sensors[3].second = sensorTemperatures.plpcduHeatspreader.value;
if (not sensors[0].first) {
sif::debug << "TMP1075 PL PCDU 0 not valid" << std::endl;
}
if (not sensors[1].first) {
sif::debug << "TMP1075 PL PCDU 1 not valid" << std::endl;
}
numSensors = 4;
HeaterContext htrCtx(heater::HEATER_1_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits);
ctrlComponentTemperature(htrCtx);

View File

@ -31,12 +31,12 @@ void buildPtgInertialSequence(Subsystem& ss, ModeListEntry& eh);
static const auto OFF = HasModesIF::MODE_OFF;
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
void satsystem::init() {
void satsystem::init(bool commandPlPcdu1) {
auto& acsSubsystem = acs::init();
acsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& payloadSubsystem = payload::init();
payloadSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& tcsSubsystem = tcs::init();
auto& tcsSubsystem = tcs::init(commandPlPcdu1);
tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& comSubsystem = com::init();
comSubsystem.connectModeTreeParent(EIVE_SYSTEM);

View File

@ -5,7 +5,7 @@
namespace satsystem {
void init();
void init(bool commandPlPcdu1);
extern EiveSystem EIVE_SYSTEM;

View File

@ -10,8 +10,8 @@ TcsSubsystem satsystem::tcs::SUBSYSTEM(objects::TCS_SUBSYSTEM, 12, 24);
namespace {
// Alias for checker function
const auto check = subsystem::checkInsert;
void buildOffSequence(Subsystem& ss, ModeListEntry& eh);
void buildNormalSequence(Subsystem& ss, ModeListEntry& eh);
void buildOffSequence(Subsystem& ss, ModeListEntry& eh, bool commandPlPcdu1);
void buildNormalSequence(Subsystem& ss, ModeListEntry& eh, bool commandPlPcdu1);
} // namespace
static const auto OFF = HasModesIF::MODE_OFF;
@ -27,17 +27,17 @@ auto TCS_TABLE_NORMAL_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeL
auto TCS_TABLE_NORMAL_TRANS_0 = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 7>());
auto TCS_TABLE_NORMAL_TRANS_1 = std::make_pair((NML << 24) | 3, FixedArrayList<ModeListEntry, 2>());
Subsystem& satsystem::tcs::init() {
Subsystem& satsystem::tcs::init(bool commandPlPcdu1) {
ModeListEntry entry;
buildOffSequence(SUBSYSTEM, entry);
buildNormalSequence(SUBSYSTEM, entry);
buildOffSequence(SUBSYSTEM, entry, commandPlPcdu1);
buildNormalSequence(SUBSYSTEM, entry, commandPlPcdu1);
SUBSYSTEM.setInitialMode(OFF);
return SUBSYSTEM;
}
namespace {
void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {
void buildOffSequence(Subsystem& ss, ModeListEntry& eh, bool commandPlPcdu1) {
std::string context = "satsystem::tcs::buildOffSequence";
auto ctxc = context.c_str();
// Insert Helper Table
@ -67,7 +67,9 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::TMP1075_HANDLER_TCS_0, OFF, 0, TCS_TABLE_OFF_TRANS_1.second);
iht(objects::TMP1075_HANDLER_TCS_1, OFF, 0, TCS_TABLE_OFF_TRANS_1.second);
iht(objects::TMP1075_HANDLER_PLPCDU_0, OFF, 0, TCS_TABLE_OFF_TRANS_1.second);
// TMP PL PCDU 1 is damaged
if (commandPlPcdu1) {
iht(objects::TMP1075_HANDLER_PLPCDU_1, OFF, 0, TCS_TABLE_OFF_TRANS_1.second);
}
iht(objects::TMP1075_HANDLER_IF_BOARD, OFF, 0, TCS_TABLE_OFF_TRANS_1.second);
check(ss.addTable(TableEntry(TCS_TABLE_OFF_TRANS_1.first, &TCS_TABLE_OFF_TRANS_1.second)), ctxc);
@ -79,7 +81,7 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {
ctxc);
}
void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) {
void buildNormalSequence(Subsystem& ss, ModeListEntry& eh, bool commandPlPcdu1) {
std::string context = "satsystem::tcs::buildNormalSequence";
auto ctxc = context.c_str();
// Insert Helper Table
@ -105,7 +107,9 @@ void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::TMP1075_HANDLER_TCS_0, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
iht(objects::TMP1075_HANDLER_TCS_1, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
iht(objects::TMP1075_HANDLER_PLPCDU_0, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
// TMP PL PCDU 1 is damaged
if (commandPlPcdu1) {
iht(objects::TMP1075_HANDLER_PLPCDU_1, NML, 0, TCS_TABLE_OFF_TRANS_0.second);
}
iht(objects::TMP1075_HANDLER_IF_BOARD, NML, 0, TCS_TABLE_NORMAL_TRANS_0.second);
check(ss.addTable(TableEntry(TCS_TABLE_NORMAL_TRANS_0.first, &TCS_TABLE_NORMAL_TRANS_0.second)),
ctxc);

View File

@ -7,7 +7,7 @@ namespace satsystem {
namespace tcs {
extern TcsSubsystem SUBSYSTEM;
Subsystem& init();
Subsystem& init(bool commandPlPcdu1);
} // namespace tcs
} // namespace satsystem

View File

@ -15,6 +15,7 @@ Tmp1075Handler::~Tmp1075Handler() {}
void Tmp1075Handler::doStartUp() { setMode(MODE_ON); }
void Tmp1075Handler::doShutDown() {
sif::debug << "TMP1075: Going off" << std::endl;
communicationStep = CommunicationStep::START_ADC_CONVERSION;
PoolReadGuard pg(&dataset);
dataset.setValidity(false, true);
@ -140,5 +141,9 @@ ReturnValue_t Tmp1075Handler::setHealth(HealthState health) {
health != EXTERNAL_CONTROL) {
return returnvalue::FAILED;
}
return returnvalue::OK;
// Required because we do not have an assembly.
if (health == FAULTY) {
setMode(_MODE_SHUT_DOWN);
}
return DeviceHandlerBase::setHealth(health);
}

2
tmtc

@ -1 +1 @@
Subproject commit c48f04eed5152f319b217870292968fb67b763d4
Subproject commit 6d5bde40db69534a8cea923f96145bdeb62b79af