IMTQ: Lower Integration Time #552

Merged
muellerr merged 9 commits from imtq_lower_integration_time into develop 2023-04-03 15:43:31 +02:00
5 changed files with 38 additions and 20 deletions
Showing only changes of commit 958abadd65 - Show all commits

View File

@ -18,6 +18,10 @@ will consitute of a breaking change warranting a new major release:
- q7s-package: v2.4.0 - q7s-package: v2.4.0
## Added
- Version of thermal controller which performs basic control tasks.
## Fixed ## Fixed
- PTME was not reset after configuration changes. - PTME was not reset after configuration changes.
@ -26,6 +30,8 @@ will consitute of a breaking change warranting a new major release:
- Poll threshold configuration of the PTME IP core is now configurable via a parameter command - Poll threshold configuration of the PTME IP core is now configurable via a parameter command
and is set to 0b010 (4 polls) instead of 0b001 (1 poll) per default. and is set to 0b010 (4 polls) instead of 0b001 (1 poll) per default.
- EIVE system fallback and COM system fallback: Perform general subsystem handling first, then
event reception, and finally any new transition handling.
# [v1.42.0] 2023-04-01 # [v1.42.0] 2023-04-01
@ -100,7 +106,6 @@ will consitute of a breaking change warranting a new major release:
## Added ## Added
- Version of thermal controller which performs basic control tasks.
- The event `MEKF_RECOVERY` will be triggered in case the `MEKF` does manage to recover itself. - The event `MEKF_RECOVERY` will be triggered in case the `MEKF` does manage to recover itself.
- The persistent TM stores now have low priorities and behave like background threads now. This - The persistent TM stores now have low priorities and behave like background threads now. This
should prevent them from blocking or slowing down the system even during dumps should prevent them from blocking or slowing down the system even during dumps
@ -112,8 +117,6 @@ will consitute of a breaking change warranting a new major release:
## Changed ## Changed
- EIVE system fallback and COM system fallback: Perform general subsystem handling first, then
event reception, and finally any new transition handling.
- Rework FSFW OSALs to properly support regular scheduling (NICE priorities) and real-time - Rework FSFW OSALs to properly support regular scheduling (NICE priorities) and real-time
scheduling. scheduling.
- STR: Move datalink layer to `StrComHandler` completely. DLL is now completely hidden from - STR: Move datalink layer to `StrComHandler` completely. DLL is now completely hidden from
@ -137,7 +140,6 @@ will consitute of a breaking change warranting a new major release:
- Bugfix for STR: Some action commands wrongfully declined. - Bugfix for STR: Some action commands wrongfully declined.
- STR: No normal command handling while a special request like an image upload is active. - STR: No normal command handling while a special request like an image upload is active.
- RS485 data line was not enabled when the transmitter was switched on. - RS485 data line was not enabled when the transmitter was switched on.
>>>>>>> origin/develop
# [v1.39.0] 2023-03-21 # [v1.39.0] 2023-03-21

View File

@ -58,6 +58,7 @@ void ImtqPollingTask::handleMeasureStep() {
SerializeAdapter::serialize(&imtq::param::INTEGRATION_TIME_SELECT, cmdBuf.data() + 1, &dummy, SerializeAdapter::serialize(&imtq::param::INTEGRATION_TIME_SELECT, cmdBuf.data() + 1, &dummy,
cmdBuf.size(), SerializeIF::Endianness::LITTLE); cmdBuf.size(), SerializeIF::Endianness::LITTLE);
cmdBuf[3] = currentRequest.integrationTimeSel; cmdBuf[3] = currentRequest.integrationTimeSel;
cmdLen = 4;
ReturnValue_t result = performI2cFullRequest(replyBuf.data(), 5); ReturnValue_t result = performI2cFullRequest(replyBuf.data(), 5);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
comStatus = imtq::STARTUP_CFG_ERROR; comStatus = imtq::STARTUP_CFG_ERROR;
@ -67,7 +68,7 @@ void ImtqPollingTask::handleMeasureStep() {
comStatus = imtq::STARTUP_CFG_ERROR; comStatus = imtq::STARTUP_CFG_ERROR;
} }
if (replyBuf[4] != currentRequest.integrationTimeSel) { if (replyBuf[4] != currentRequest.integrationTimeSel) {
sif::error << "ImtqPollingTask: Integration time confiuration failed" << std::endl; sif::error << "ImtqPollingTask: Integration time configuration failed" << std::endl;
comStatus = imtq::STARTUP_CFG_ERROR; comStatus = imtq::STARTUP_CFG_ERROR;
} }
currentIntegrationTimeMs = currentIntegrationTimeMs =
@ -449,6 +450,7 @@ void ImtqPollingTask::clearReadFlagsWithTorque(ImtqRepliesWithTorque& replies) {
ReturnValue_t ImtqPollingTask::performI2cFullRequest(uint8_t* reply, size_t replyLen) { ReturnValue_t ImtqPollingTask::performI2cFullRequest(uint8_t* reply, size_t replyLen) {
int fd = 0; int fd = 0;
if (cmdLen == 0 or reply == nullptr) { if (cmdLen == 0 or reply == nullptr) {
sif::error << "ImtqPollingTask: Command lenght is zero or reply PTR is invalid" << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }

View File

@ -151,19 +151,25 @@ void ImtqHandler::doStartUp() {
} }
void ImtqHandler::doShutDown() { void ImtqHandler::doShutDown() {
updatePeriodicReply(false, imtq::cmdIds::REPLY_NO_TORQUE); if (internalState != InternalState::SHUTDOWN) {
updatePeriodicReply(false, imtq::cmdIds::REPLY_WITH_TORQUE); commandExecuted = false;
specialRequestActive = false; internalState = InternalState::SHUTDOWN;
firstReplyCycle = true; }
internalState = InternalState::NONE; if (internalState == InternalState::SHUTDOWN and commandExecuted) {
commandExecuted = false; updatePeriodicReply(false, imtq::cmdIds::REPLY_NO_TORQUE);
statusSet.setValidity(false, true); updatePeriodicReply(false, imtq::cmdIds::REPLY_WITH_TORQUE);
rawMtmNoTorque.setValidity(false, true); specialRequestActive = false;
rawMtmWithTorque.setValidity(false, true); firstReplyCycle = true;
hkDatasetNoTorque.setValidity(false, true); internalState = InternalState::NONE;
hkDatasetWithTorque.setValidity(false, true); commandExecuted = false;
calMtmMeasurementSet.setValidity(false, true); statusSet.setValidity(false, true);
setMode(_MODE_POWER_DOWN); rawMtmNoTorque.setValidity(false, true);
rawMtmWithTorque.setValidity(false, true);
hkDatasetNoTorque.setValidity(false, true);
hkDatasetWithTorque.setValidity(false, true);
calMtmMeasurementSet.setValidity(false, true);
setMode(_MODE_POWER_DOWN);
}
} }
ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t ImtqHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
@ -243,6 +249,11 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
// 6 ms integration time instead of 10 ms. // 6 ms integration time instead of 10 ms.
request.integrationTimeSel = 2; request.integrationTimeSel = 2;
expectedReply = imtq::cmdIds::REPLY_NO_TORQUE; expectedReply = imtq::cmdIds::REPLY_NO_TORQUE;
if (internalState == InternalState::SHUTDOWN) {
request.mode = acs::SimpleSensorMode::OFF;
} else {
request.mode = acs::SimpleSensorMode::NORMAL;
}
rawPacket = reinterpret_cast<uint8_t*>(&request); rawPacket = reinterpret_cast<uint8_t*>(&request);
rawPacketLen = sizeof(imtq::Request); rawPacketLen = sizeof(imtq::Request);
return returnvalue::OK; return returnvalue::OK;
@ -311,6 +322,9 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi
if (getMode() == _MODE_WAIT_OFF or getMode() == _MODE_WAIT_ON or getMode() == _MODE_POWER_DOWN) { if (getMode() == _MODE_WAIT_OFF or getMode() == _MODE_WAIT_ON or getMode() == _MODE_POWER_DOWN) {
return IGNORE_FULL_PACKET; return IGNORE_FULL_PACKET;
} }
if (internalState == InternalState::SHUTDOWN) {
commandExecuted = true;
}
if (remainingSize > 0) { if (remainingSize > 0) {
*foundLen = remainingSize; *foundLen = remainingSize;
*foundId = expectedReply; *foundId = expectedReply;

View File

@ -293,7 +293,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) {
// Just waiting for the main switch being set on // Just waiting for the main switch being set on
return; return;
} else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF or } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF or
mainSwitchState == PowerSwitchIF::SWITCH_UNKNOWN) { mainSwitchState == PowerSwitchIF::SWITCH_UNKNOWN) {
mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON);
heater.mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); heater.mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs());
heater.waitMainSwitchOn = true; heater.waitMainSwitchOn = true;

2
tmtc

@ -1 +1 @@
Subproject commit cef8d623c9fa11237fc8e51e5fd4dab750a5602b Subproject commit b72dad49a9c05a37c094a22d5fdaa15643b5ca7f