From 4f6f12217c5cb714fea63ed383fdfbaa15ce166f Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 5 May 2023 10:58:57 +0200 Subject: [PATCH 01/19] fixed variances of ADIS sensors --- mission/controller/acs/AcsParameters.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 9600ca7e..badc47af 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -781,9 +781,9 @@ class AcsParameters : public HasParametersIF { /* var = sigma^2, sigma = RND*sqrt(freq), following values are RND^2 and not var as freq is * assumed to be equal for the same class of sensors */ - float gyr02variance[3] = {pow(3.0e-3, 2), // RND_x = 3.0e-3 deg/s/sqrt(Hz) rms - pow(3.0e-3, 2), // RND_y = 3.0e-3 deg/s/sqrt(Hz) rms - pow(4.3e-3, 2)}; // RND_z = 4.3e-3 deg/s/sqrt(Hz) rms + float gyr02variance[3] = {pow(4.6e-3, 2), // RND_x = 3.0e-3 deg/s/sqrt(Hz) rms + pow(4.6e-3, 2), // RND_y = 3.0e-3 deg/s/sqrt(Hz) rms + pow(6.1e-3, 2)}; // RND_z = 4.3e-3 deg/s/sqrt(Hz) rms float gyr13variance[3] = {pow(11e-3, 2), pow(11e-3, 2), pow(11e-3, 2)}; uint8_t preferAdis = false; float gyrFilterWeight = 0.6; From e78d458f06b780b17d0bea8fe17fb1c3690504fa Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 5 May 2023 11:00:46 +0200 Subject: [PATCH 02/19] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc320982..5449853f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ will consitute of a breaking change warranting a new major release: 16505 type. - Host build is working again. Added reduced live TM helper which schedules the PUS and CFDP funnel. +- The variance for the ADIS GYRs now represents the used `-3` version and not the `-1` version # [v2.0.5] 2023-05-11 From 1166c66c8c049661be67a89529d6cebf3eff935e Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 19 Apr 2023 15:31:45 +0200 Subject: [PATCH 03/19] added config values for testing --- fsfw | 2 +- mission/acs/gyroAdisHelpers.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 5eb9ee8b..258f0d33 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5eb9ee8bc1e6f8640cbea46febd11e4b92241881 +Subproject commit 258f0d331329d67e13eec9d7f4053fd269e3f9b6 diff --git a/mission/acs/gyroAdisHelpers.h b/mission/acs/gyroAdisHelpers.h index 09f0aa1e..c8a28369 100644 --- a/mission/acs/gyroAdisHelpers.h +++ b/mission/acs/gyroAdisHelpers.h @@ -92,6 +92,9 @@ static constexpr size_t SENSOR_READOUT_SIZE = 20 + 2; static constexpr uint32_t ADIS_DATASET_ID = READ_SENSOR_DATA; static constexpr uint32_t ADIS_CFG_DATASET_ID = READ_OUT_CONFIG; +static constexpr uint16_t FILT_CTRL = 0x0000; +static constexpr uint16_t DEC_RATE = 0x0013; + enum GlobCmds : uint8_t { FACTORY_CALIBRATION = 0b0000'0010, SENSOR_SELF_TEST = 0b0000'0100, From 23625b24963dc2a3d7fd85b47bfbcb6568f7e948 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 31 May 2023 09:53:13 +0200 Subject: [PATCH 04/19] move 2 pool variables --- mission/power/gsDefs.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mission/power/gsDefs.h b/mission/power/gsDefs.h index d42cabd2..00bdf589 100644 --- a/mission/power/gsDefs.h +++ b/mission/power/gsDefs.h @@ -404,6 +404,11 @@ class PduCoreHk : public StaticLocalDataSet<9> { /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ lp_var_t battMode = lp_var_t(sid.objectId, pool::PDU_BATT_MODE, this); lp_var_t temperature = lp_var_t(sid.objectId, pool::PDU_TEMPERATURE, this); + + /** Measured VCC */ + lp_var_t vcc = lp_var_t(sid.objectId, pool::PDU_VCC, this); + /** Measured VBAT */ + lp_var_t vbat = lp_var_t(sid.objectId, pool::PDU_VBAT, this); }; class PduConfig : public StaticLocalDataSet<32> { @@ -451,11 +456,6 @@ class PduAuxHk : public StaticLocalDataSet<36> { PduAuxHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} - /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, pool::PDU_VCC, this); - /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, pool::PDU_VBAT, this); - /** Output converter enable status */ lp_vec_t converterEnable = lp_vec_t(sid.objectId, pool::PDU_CONV_EN, this); From f4523c8396e1d3684079e3d5b26c9afb948cba12 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 31 May 2023 10:39:56 +0200 Subject: [PATCH 05/19] that should fix some issues --- mission/power/GomspaceDeviceHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/power/GomspaceDeviceHandler.cpp b/mission/power/GomspaceDeviceHandler.cpp index 89fca8ee..c20ac4e9 100644 --- a/mission/power/GomspaceDeviceHandler.cpp +++ b/mission/power/GomspaceDeviceHandler.cpp @@ -595,8 +595,8 @@ ReturnValue_t GomspaceDeviceHandler::parsePduHkTable(PDU::PduCoreHk& coreHk, PDU for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { coreHk.voltages[idx] = as(packet + 0x12 + (idx * 2)); } - auxHk.vcc.value = as(packet + 0x24); - auxHk.vbat.value = as(packet + 0x26); + coreHk.vcc.value = as(packet + 0x24); + coreHk.vbat.value = as(packet + 0x26); coreHk.temperature = as(packet + 0x28) * 0.1; for (uint8_t idx = 0; idx < 3; idx++) { From 6a2d5b81612defbb79089977e6f4da25487575aa Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 6 Jun 2023 16:02:11 +0200 Subject: [PATCH 06/19] well this doesnt work --- linux/acs/AcsBoardPolling.cpp | 89 ++++++++++++++++++++++++++++- linux/acs/AcsBoardPolling.h | 3 + mission/acs/GyrAdis1650XHandler.cpp | 12 ++-- mission/acs/GyrAdis1650XHandler.h | 2 +- mission/acs/acsBoardPolling.h | 11 ++-- mission/acs/gyroAdisHelpers.cpp | 11 ++++ mission/acs/gyroAdisHelpers.h | 2 + 7 files changed, 118 insertions(+), 12 deletions(-) diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index e525bf53..38bf4351 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -113,6 +113,7 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send if (req->mode != adis.mode) { if (req->mode == acs::SimpleSensorMode::NORMAL) { adis.type = req->type; + adis.decRate = req->cfg.decRateReg; // The initial countdown is handled by the device handler now. // adis.countdown.setTimeout(adis1650x::START_UP_TIME); if (adis.type == adis1650x::Type::ADIS16507) { @@ -376,6 +377,81 @@ void AcsBoardPolling::gyroL3gHandler(GyroL3g& l3g) { } } +ReturnValue_t AcsBoardPolling::writeAdisReg(SpiCookie& cookie) { + ReturnValue_t result = returnvalue::OK; + int retval = 0; + // Prepare transfer + int fileDescriptor = 0; + std::string device = spiComIF.getSpiDev(); + UnixFileGuard fileHelper(device, fileDescriptor, O_RDWR, "SpiComIF::sendMessage"); + if (fileHelper.getOpenResult() != returnvalue::OK) { + return spi::OPENING_FILE_FAILED; + } + spi::SpiModes spiMode = spi::SpiModes::MODE_0; + uint32_t spiSpeed = 0; + cookie.getSpiParameters(spiMode, spiSpeed, nullptr); + spiComIF.setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed); + cookie.assignWriteBuffer(cmdBuf.data()); + cookie.setTransferSize(2); + + gpioId_t gpioId = cookie.getChipSelectPin(); + MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; + uint32_t timeoutMs = 0; + MutexIF* mutex = spiComIF.getCsMutex(); + cookie.getMutexParams(timeoutType, timeoutMs); + if (mutex == nullptr) { + sif::warning << "GyroADIS16507Handler::spiSendCallback: " + "Mutex or GPIO interface invalid" + << std::endl; + return returnvalue::FAILED; + } + + size_t idx = 0; + spi_ioc_transfer* transferStruct = cookie.getTransferStructHandle(); + uint64_t origTx = transferStruct->tx_buf; + uint64_t origRx = transferStruct->rx_buf; + for (idx = 0; idx < 2; idx++) { + result = mutex->lockMutex(timeoutType, timeoutMs); + if (result != returnvalue::OK) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "AcsBoardPolling: Failed to lock mutex" << std::endl; +#endif + return result; + } + // Pull SPI CS low. For now, no support for active high given + if (gpioId != gpio::NO_GPIO) { + gpioIF.pullLow(gpioId); + } + + // Execute transfer + // Initiate a full duplex SPI transfer. + retval = ioctl(fileDescriptor, SPI_IOC_MESSAGE(1), cookie.getTransferStructHandle()); + if (retval < 0) { + utility::handleIoctlError("SpiComIF::sendMessage: ioctl error."); + result = spi::FULL_DUPLEX_TRANSFER_FAILED; + } +#if FSFW_HAL_SPI_WIRETAPPING == 1 + comIf->performSpiWiretapping(cookie); +#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ + + if (gpioId != gpio::NO_GPIO) { + gpioIF.pullHigh(gpioId); + } + mutex->unlockMutex(); + + idx += 2; + transferStruct->tx_buf += 2; + transferStruct->rx_buf += 2; + if (idx < 4) { + usleep(adis1650x::STALL_TIME_MICROSECONDS); + } + } + transferStruct->tx_buf = origTx; + transferStruct->rx_buf = origRx; + cookie.setTransferSize(0); + return returnvalue::OK; +} + ReturnValue_t AcsBoardPolling::readAdisCfg(SpiCookie& cookie, size_t transferLen) { ReturnValue_t result = returnvalue::OK; int retval = 0; @@ -455,15 +531,20 @@ void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) { ReturnValue_t result; acs::SimpleSensorMode mode = acs::SimpleSensorMode::OFF; bool mustPerformStartup = false; + uint16_t decRate = 0; { MutexGuard mg(ipcLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); mode = gyro.mode; + decRate = gyro.decRate; mustPerformStartup = gyro.performStartup; } if (mode == acs::SimpleSensorMode::OFF) { return; } if (mustPerformStartup) { + adis1650x::prepareWriteRegCommand(adis1650x::DEC_RATE_REG, decRate, cmdBuf.data(), + cmdBuf.size()); + writeAdisReg(*gyro.cookie); uint8_t regList[6]; // Read configuration regList[0] = adis1650x::DIAG_STAT_REG; @@ -491,13 +572,19 @@ void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) { gyro.replyResult = returnvalue::FAILED; return; } + uint16_t decRateReadBack = (rawReply[10] << 8) | rawReply[11]; + if (decRateReadBack != decRate) { + sif::warning << "AcsPollingTask: DEC rate configuration failed. Read " << decRateReadBack + << ", expected " << decRate << std::endl; + gyro.replyResult = returnvalue::FAILED; + } MutexGuard mg(ipcLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); gyro.ownReply.cfgWasSet = true; gyro.ownReply.cfg.diagStat = (rawReply[2] << 8) | rawReply[3]; gyro.ownReply.cfg.filterSetting = (rawReply[4] << 8) | rawReply[5]; gyro.ownReply.cfg.rangMdl = (rawReply[6] << 8) | rawReply[7]; gyro.ownReply.cfg.mscCtrlReg = (rawReply[8] << 8) | rawReply[9]; - gyro.ownReply.cfg.decRateReg = (rawReply[10] << 8) | rawReply[11]; + gyro.ownReply.cfg.decRateReg = decRateReadBack; gyro.ownReply.cfg.prodId = prodId; gyro.ownReply.data.sensitivity = adis1650x::rangMdlToSensitivity(gyro.ownReply.cfg.rangMdl); gyro.performStartup = false; diff --git a/linux/acs/AcsBoardPolling.h b/linux/acs/AcsBoardPolling.h index 794c9c47..5b4d0390 100644 --- a/linux/acs/AcsBoardPolling.h +++ b/linux/acs/AcsBoardPolling.h @@ -37,6 +37,7 @@ class AcsBoardPolling : public SystemObject, struct GyroAdis : public DevBase { adis1650x::Type type; + uint16_t decRate; Countdown countdown; acs::Adis1650XReply ownReply; acs::Adis1650XReply readerReply; @@ -84,6 +85,8 @@ class AcsBoardPolling : public SystemObject, void gyroAdisHandler(GyroAdis& gyro); void mgmLis3Handler(MgmLis3& mgm); void mgmRm3100Handler(MgmRm3100& mgm); + // This fumction configures the register as specified on p.21 of the datasheet. + ReturnValue_t writeAdisReg(SpiCookie& cookie); // Special readout: 16us stall time between small 2 byte transfers. ReturnValue_t readAdisCfg(SpiCookie& spiCookie, size_t transferLen); }; diff --git a/mission/acs/GyrAdis1650XHandler.cpp b/mission/acs/GyrAdis1650XHandler.cpp index c61187ce..27e8dc75 100644 --- a/mission/acs/GyrAdis1650XHandler.cpp +++ b/mission/acs/GyrAdis1650XHandler.cpp @@ -26,11 +26,11 @@ void GyrAdis1650XHandler::doStartUp() { breakCountdown.setTimeout(adis1650x::START_UP_TIME); commandExecuted = true; } - if (breakCountdown.hasTimedOut()) { - updatePeriodicReply(true, adis1650x::REPLY); - setMode(MODE_ON); - internalState = InternalState::NONE; - } + } + if (internalState == InternalState::STARTUP_DONE) { + updatePeriodicReply(true, adis1650x::REPLY); + setMode(MODE_ON); + internalState = InternalState::NONE; } } @@ -61,6 +61,8 @@ ReturnValue_t GyrAdis1650XHandler::buildTransitionDeviceCommand(DeviceCommandId_ return NOTHING_TO_SEND; } *id = adis1650x::REQUEST; + adisRequest.cfg.decRateReg = adis1650x::DEC_RATE; + internalState = InternalState::STARTUP_DONE; return preparePeriodicRequest(acs::SimpleSensorMode::NORMAL); } case (InternalState::SHUTDOWN): { diff --git a/mission/acs/GyrAdis1650XHandler.h b/mission/acs/GyrAdis1650XHandler.h index 5d906f61..308d472b 100644 --- a/mission/acs/GyrAdis1650XHandler.h +++ b/mission/acs/GyrAdis1650XHandler.h @@ -48,7 +48,7 @@ class GyrAdis1650XHandler : public DeviceHandlerBase { bool warningSwitch = true; - enum class InternalState { NONE, STARTUP, SHUTDOWN }; + enum class InternalState { NONE, STARTUP, STARTUP_DONE, SHUTDOWN }; InternalState internalState = InternalState::STARTUP; bool commandExecuted = false; diff --git a/mission/acs/acsBoardPolling.h b/mission/acs/acsBoardPolling.h index 90f0f19c..9f794fb0 100644 --- a/mission/acs/acsBoardPolling.h +++ b/mission/acs/acsBoardPolling.h @@ -8,11 +8,6 @@ namespace acs { -struct Adis1650XRequest { - SimpleSensorMode mode; - adis1650x::Type type; -}; - struct Adis1650XConfig { uint16_t diagStat; uint16_t filterSetting; @@ -22,6 +17,12 @@ struct Adis1650XConfig { uint16_t prodId; }; +struct Adis1650XRequest { + SimpleSensorMode mode; + adis1650x::Type type; + Adis1650XConfig cfg; +}; + struct Adis1650XData { double sensitivity = 0.0; // Angular velocities in all axes (X, Y and Z) diff --git a/mission/acs/gyroAdisHelpers.cpp b/mission/acs/gyroAdisHelpers.cpp index 0f41b058..5dd3a217 100644 --- a/mission/acs/gyroAdisHelpers.cpp +++ b/mission/acs/gyroAdisHelpers.cpp @@ -52,3 +52,14 @@ double adis1650x::rangMdlToSensitivity(uint16_t rangMdl) { } } } + +void adis1650x::prepareWriteRegCommand(uint8_t regStart, uint16_t val, uint8_t* outBuf, + size_t maxLen) { + if (maxLen < 4) { + return; + } + outBuf[0] = regStart | adis1650x::WRITE_MASK; + outBuf[1] = val & 0Xff; + outBuf[2] = (regStart + 1) | adis1650x::WRITE_MASK; + outBuf[3] = (val >> 8) & 0xff; +} diff --git a/mission/acs/gyroAdisHelpers.h b/mission/acs/gyroAdisHelpers.h index c8a28369..00fda595 100644 --- a/mission/acs/gyroAdisHelpers.h +++ b/mission/acs/gyroAdisHelpers.h @@ -16,6 +16,8 @@ enum class BurstModes { }; size_t prepareReadCommand(const uint8_t* regList, size_t len, uint8_t* outBuf, size_t maxLen); +void prepareWriteRegCommand(uint8_t regStart, uint16_t val, uint8_t* outBuf, size_t maxLen); + BurstModes burstModeFromMscCtrl(uint16_t mscCtrl); double rangMdlToSensitivity(uint16_t rangMdl); From 72b5567f73ee1370503fbd6796edc2e2d89d25b3 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 7 Jun 2023 09:17:49 +0200 Subject: [PATCH 07/19] not that it matters --- mission/acs/gyroAdisHelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/acs/gyroAdisHelpers.cpp b/mission/acs/gyroAdisHelpers.cpp index 5dd3a217..5c1446cc 100644 --- a/mission/acs/gyroAdisHelpers.cpp +++ b/mission/acs/gyroAdisHelpers.cpp @@ -59,7 +59,7 @@ void adis1650x::prepareWriteRegCommand(uint8_t regStart, uint16_t val, uint8_t* return; } outBuf[0] = regStart | adis1650x::WRITE_MASK; - outBuf[1] = val & 0Xff; + outBuf[1] = val & 0xff; outBuf[2] = (regStart + 1) | adis1650x::WRITE_MASK; outBuf[3] = (val >> 8) & 0xff; } From f4c9a4bda22edd0df6fc60f6a2bab612499853f3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 7 Jun 2023 11:38:02 +0200 Subject: [PATCH 08/19] fix for indexing --- linux/acs/AcsBoardPolling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index 38bf4351..811c6a72 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -410,7 +410,7 @@ ReturnValue_t AcsBoardPolling::writeAdisReg(SpiCookie& cookie) { spi_ioc_transfer* transferStruct = cookie.getTransferStructHandle(); uint64_t origTx = transferStruct->tx_buf; uint64_t origRx = transferStruct->rx_buf; - for (idx = 0; idx < 2; idx++) { + for (idx = 0; idx < 4; idx++) { result = mutex->lockMutex(timeoutType, timeoutMs); if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 From a110bf32aa25d36284b28550e1c3e2548c8aaa5b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 7 Jun 2023 11:46:23 +0200 Subject: [PATCH 09/19] another small fix --- linux/acs/AcsBoardPolling.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index 811c6a72..1ba55357 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -410,7 +410,7 @@ ReturnValue_t AcsBoardPolling::writeAdisReg(SpiCookie& cookie) { spi_ioc_transfer* transferStruct = cookie.getTransferStructHandle(); uint64_t origTx = transferStruct->tx_buf; uint64_t origRx = transferStruct->rx_buf; - for (idx = 0; idx < 4; idx++) { + for (idx = 0; idx < 4; idx += 2) { result = mutex->lockMutex(timeoutType, timeoutMs); if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -439,7 +439,6 @@ ReturnValue_t AcsBoardPolling::writeAdisReg(SpiCookie& cookie) { } mutex->unlockMutex(); - idx += 2; transferStruct->tx_buf += 2; transferStruct->rx_buf += 2; if (idx < 4) { From 4bcfb8f5a2c9a14f8fcc8fd5f903eead54e8d0b6 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 7 Jun 2023 14:13:32 +0200 Subject: [PATCH 10/19] still doesnt work --- linux/acs/AcsBoardPolling.cpp | 3 +++ mission/acs/GyrAdis1650XHandler.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index 1ba55357..727e8405 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -572,6 +572,8 @@ void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) { return; } uint16_t decRateReadBack = (rawReply[10] << 8) | rawReply[11]; + sif::debug << "AcsPollingTask: DEC rate configuration. Read " << decRateReadBack + << ", expected " << decRate << std::endl; if (decRateReadBack != decRate) { sif::warning << "AcsPollingTask: DEC rate configuration failed. Read " << decRateReadBack << ", expected " << decRate << std::endl; @@ -589,6 +591,7 @@ void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) { gyro.performStartup = false; gyro.replyResult = returnvalue::OK; } + sif::debug << "hello world 2" << std::endl; // Read regular registers std::memcpy(cmdBuf.data(), adis1650x::BURST_READ_ENABLE.data(), adis1650x::BURST_READ_ENABLE.size()); diff --git a/mission/acs/GyrAdis1650XHandler.cpp b/mission/acs/GyrAdis1650XHandler.cpp index 27e8dc75..6f447178 100644 --- a/mission/acs/GyrAdis1650XHandler.cpp +++ b/mission/acs/GyrAdis1650XHandler.cpp @@ -26,9 +26,9 @@ void GyrAdis1650XHandler::doStartUp() { breakCountdown.setTimeout(adis1650x::START_UP_TIME); commandExecuted = true; } + updatePeriodicReply(true, adis1650x::REPLY); } if (internalState == InternalState::STARTUP_DONE) { - updatePeriodicReply(true, adis1650x::REPLY); setMode(MODE_ON); internalState = InternalState::NONE; } From 06c5344d8a44b0cd73209c1fc649ca6713a5622a Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 7 Jun 2023 15:14:03 +0200 Subject: [PATCH 11/19] this might actually work --- linux/acs/AcsBoardPolling.cpp | 1 - mission/acs/GyrAdis1650XHandler.cpp | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index 727e8405..b8539a8f 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -591,7 +591,6 @@ void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) { gyro.performStartup = false; gyro.replyResult = returnvalue::OK; } - sif::debug << "hello world 2" << std::endl; // Read regular registers std::memcpy(cmdBuf.data(), adis1650x::BURST_READ_ENABLE.data(), adis1650x::BURST_READ_ENABLE.size()); diff --git a/mission/acs/GyrAdis1650XHandler.cpp b/mission/acs/GyrAdis1650XHandler.cpp index 6f447178..fe10c214 100644 --- a/mission/acs/GyrAdis1650XHandler.cpp +++ b/mission/acs/GyrAdis1650XHandler.cpp @@ -15,7 +15,7 @@ GyrAdis1650XHandler::GyrAdis1650XHandler(object_id_t objectId, object_id_t devic } void GyrAdis1650XHandler::doStartUp() { - if (internalState != InternalState::STARTUP) { + if (internalState == InternalState::NONE) { internalState = InternalState::STARTUP; commandExecuted = false; } @@ -24,12 +24,13 @@ void GyrAdis1650XHandler::doStartUp() { if (not commandExecuted) { warningSwitch = true; breakCountdown.setTimeout(adis1650x::START_UP_TIME); + updatePeriodicReply(true, adis1650x::REPLY); commandExecuted = true; } - updatePeriodicReply(true, adis1650x::REPLY); } if (internalState == InternalState::STARTUP_DONE) { setMode(MODE_ON); + commandExecuted = false; internalState = InternalState::NONE; } } @@ -62,7 +63,6 @@ ReturnValue_t GyrAdis1650XHandler::buildTransitionDeviceCommand(DeviceCommandId_ } *id = adis1650x::REQUEST; adisRequest.cfg.decRateReg = adis1650x::DEC_RATE; - internalState = InternalState::STARTUP_DONE; return preparePeriodicRequest(acs::SimpleSensorMode::NORMAL); } case (InternalState::SHUTDOWN): { @@ -93,6 +93,9 @@ ReturnValue_t GyrAdis1650XHandler::scanForReply(const uint8_t *start, size_t rem getMode() == _MODE_POWER_DOWN) { return IGNORE_FULL_PACKET; } + if (internalState == InternalState::STARTUP) { + internalState = InternalState::STARTUP_DONE; + } *foundLen = remainingSize; if (remainingSize != sizeof(acs::Adis1650XReply)) { return returnvalue::FAILED; From 410fd1c4258b9b50441b2c3de50551fdbeff9663 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 8 Jun 2023 09:11:24 +0200 Subject: [PATCH 12/19] final setting of dec rate filter --- mission/acs/gyroAdisHelpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/acs/gyroAdisHelpers.h b/mission/acs/gyroAdisHelpers.h index 00fda595..f360db76 100644 --- a/mission/acs/gyroAdisHelpers.h +++ b/mission/acs/gyroAdisHelpers.h @@ -95,7 +95,7 @@ static constexpr uint32_t ADIS_DATASET_ID = READ_SENSOR_DATA; static constexpr uint32_t ADIS_CFG_DATASET_ID = READ_OUT_CONFIG; static constexpr uint16_t FILT_CTRL = 0x0000; -static constexpr uint16_t DEC_RATE = 0x0013; +static constexpr uint16_t DEC_RATE = 0x00C7; enum GlobCmds : uint8_t { FACTORY_CALIBRATION = 0b0000'0010, From cab20a8c77ffee4b827b66ba95b5a58f814d37f3 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 8 Jun 2023 09:55:46 +0200 Subject: [PATCH 13/19] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a779c491..f0bb2574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ will consitute of a breaking change warranting a new major release: # [v3.0.0] to be released +- eive-fsfw: v3.0.0 + ## Changed - Adapt EM configuration to include all GomSpace PCDU devices except the ACU. For the ACU @@ -63,6 +65,8 @@ will consitute of a breaking change warranting a new major release: - IMTQ HK sets - IMTQ dummy now handles power switch - Added some new ACS parameters +- Enabled decimation filter for the ADIS GYRs +- Enabled second low-pass filter for L3GD20H GYRs ## Fixed From d90ccd62f88c225588e530e3b0e9d321bfa5da47 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 12:47:07 +0200 Subject: [PATCH 14/19] bump changelog and tmtc --- CHANGELOG.md | 2 ++ tmtc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17ac5d5d..6a7f07cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ will consitute of a breaking change warranting a new major release: # [v3.0.0] to be released +- `eive-tmtc` version v4.0.0 + ## Changed - Adapt EM configuration to include all GomSpace PCDU devices except the ACU. For the ACU diff --git a/tmtc b/tmtc index 6182369e..8804a4e8 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6182369e4f40872c5c26e59be25d5fa79339176a +Subproject commit 8804a4e8e9fce1d45fcf62314affb791114d1517 From 6ef593d8f39a7712c5723b3423e4d46626825992 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 13:04:16 +0200 Subject: [PATCH 15/19] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 258f0d33..3a702295 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 258f0d331329d67e13eec9d7f4053fd269e3f9b6 +Subproject commit 3a70229510c017099ff2d43533e19d41f2030d81 From c1f8512b013eb4f5b0946cc49ec993dd5fcceb13 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 13:10:29 +0200 Subject: [PATCH 16/19] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a2af1ca..937df112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ will consitute of a breaking change warranting a new major release: only be used to cancel a transfer. - Handling of multiple RWs in the ACS Controller is improved and can be changed by parameter commands. +- Moved PDU `vcc` and `vbat` variable from auxiliary dataset to core dataset. ## Added From 18ba3a711a967ee8b74d9409a56a67fca8709af7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 13:11:50 +0200 Subject: [PATCH 17/19] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 3a702295..9a4bf510 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3a70229510c017099ff2d43533e19d41f2030d81 +Subproject commit 9a4bf5100642301be10689d94ce969d517a6abc4 From 6c1dfafb2eeaa6eecb5b56380b9d5ac6f703fa57 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 13:13:05 +0200 Subject: [PATCH 18/19] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a2af1ca..b77cb6de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ will consitute of a breaking change warranting a new major release: ## Fixed +- CFDP low level protocol bugfix. Requires `fsfw` update and `tmtc` update. - Compile fix if SCEX is compiled for the EM. - Set up Rad Sensor chip select even for EM to avoid SPI bus issues. - Correct ADIS Gyroscope type configuration for the EM, where the 16507 type is used instead of the From bd7f28152a0f223c58687f30d49d455aff60fa88 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 13:42:16 +0200 Subject: [PATCH 19/19] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 9a4bf510..5322de05 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9a4bf5100642301be10689d94ce969d517a6abc4 +Subproject commit 5322de059916efcf874b10ccc766b46e53d2470b