diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b2ef0c..9c1319d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ change warranting a new major release: # [unreleased] +## Changed + +- Igrf13 model vector now outputs as uT instead of nT +- Changed timings for `AcsPst` +- Added values for MGM sensor fusion + +## Fixed +- Fixed values for GYR sensor fusion + # [v1.27.2] 2023-02-14 Reaction Wheel handling was determined to be (quasi) broken and needs to be fixed in future release diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index c572e21a..9e67176a 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -57,14 +57,17 @@ static constexpr uint32_t MAX_STORED_CMDS_TCP = 150; namespace acs { -static constexpr uint32_t SCHED_BLOCK_1_SENSORS_MS = 15; -static constexpr uint32_t SCHED_BLOCK_2_ACS_CTRL_MS = 40; -static constexpr uint32_t SCHED_BLOCK_3_ACTUATOR_MS = 45; +static constexpr uint32_t SCHED_BLOCK_1_SUS_READ_MS = 15; +static constexpr uint32_t SCHED_BLOCK_2_SENSOR_READ_MS = 30; +static constexpr uint32_t SCHED_BLOCK_3_ACS_CTRL_MS = 45; +static constexpr uint32_t SCHED_BLOCK_4_ACTUATOR_MS = 50; // 15 ms for FM -static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_SENSORS_MS) / 400.0; -static constexpr float SCHED_BLOCK_2_PERIOD = static_cast(SCHED_BLOCK_2_ACS_CTRL_MS) / 400.0; -static constexpr float SCHED_BLOCK_3_PERIOD = static_cast(SCHED_BLOCK_3_ACTUATOR_MS) / 400.0; +static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_SUS_READ_MS) / 400.0; +static constexpr float SCHED_BLOCK_2_PERIOD = + static_cast(SCHED_BLOCK_2_SENSOR_READ_MS) / 400.0; +static constexpr float SCHED_BLOCK_3_PERIOD = static_cast(SCHED_BLOCK_3_ACS_CTRL_MS) / 400.0; +static constexpr float SCHED_BLOCK_4_PERIOD = static_cast(SCHED_BLOCK_4_ACTUATOR_MS) / 400.0; } // namespace acs diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 7e4cafeb..e017021e 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -193,102 +193,102 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg if (cfg.scheduleAcsBoard) { if (enableAside) { // A side - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); } if (enableBside) { // B side - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); } } @@ -616,19 +616,19 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::GET_READ); } - thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::acs::SCHED_BLOCK_2_PERIOD, 0); + thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::acs::SCHED_BLOCK_3_PERIOD, 0); if (cfg.scheduleImtq) { // This is the torquing cycle. - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); } @@ -711,94 +711,94 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg if (cfg.scheduleRws) { // this is the torquing cycle - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_4_PERIOD, DeviceHandlerIF::GET_READ); } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 35e316f1..f68b10cf 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -73,9 +73,9 @@ class AcsParameters : public HasParametersIF { {-0.007534, 1.253879, 0.006812}, {-0.037072, 0.006812, 1.313158}}; - float mgm02variance[3] = {1, 1, 1}; - float mgm13variance[3] = {1, 1, 1}; - float mgm4variance[3] = {1, 1, 1}; + float mgm02variance[3] = {pow(3.2e-7, 2), pow(3.2e-7, 2), pow(4.1e-7, 2)}; + float mgm13variance[3] = {pow(1.5e-8, 2), pow(1.5e-8, 2), pow(1.5e-8, 2)}; + float mgm4variance[3] = {pow(1.7e-6, 2), pow(1.7e-6, 2), pow(1.7e-6, 2)}; } mgmHandlingParameters; struct SusHandlingParameters { @@ -779,9 +779,9 @@ class AcsParameters : public HasParametersIF { /* var = sqrt(sigma), 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 * sqrt(2), 2), // RND_x = 3.0e-3 deg/s/sqrt(Hz) rms - pow(3.0e-3 * sqrt(2), 2), // RND_y = 3.0e-3 deg/s/sqrt(Hz) rms - pow(4.3e-3 * sqrt(2), 2)}; // RND_z = 4.3e-3 deg/s/sqrt(Hz) rms + 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 gyr13variance[3] = {pow(11e-3, 2), pow(11e-3, 2), pow(11e-3, 2)}; uint8_t preferAdis = true; } gyrHandlingParameters; diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index b902593f..8cda84d6 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -1,10 +1,3 @@ -/* - * ActuatorCmd.cpp - * - * Created on: 4 Aug 2022 - * Author: Robin Marquardt - */ - #include "ActuatorCmd.h" #include diff --git a/mission/controller/acs/Igrf13Model.cpp b/mission/controller/acs/Igrf13Model.cpp index 63992010..3f844434 100644 --- a/mission/controller/acs/Igrf13Model.cpp +++ b/mission/controller/acs/Igrf13Model.cpp @@ -20,6 +20,7 @@ Igrf13Model::~Igrf13Model() {} void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, const double altitude, timeval timeOfMagMeasurement, double* magFieldModelInertial) { + double magFieldModel[3] = {0, 0, 0}; double phi = longitude, theta = gcLatitude; // geocentric /* Here is the co-latitude needed*/ theta -= 90 * PI / 180; @@ -100,12 +101,8 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, magFieldModelInertial[2] = magFieldModel[0] * sin(gcLatitude) - magFieldModel[1] * cos(gcLatitude); - double normVecMagFieldInert[3] = {0, 0, 0}; - VectorOperations::normalize(magFieldModelInertial, normVecMagFieldInert, 3); - - magFieldModel[0] = 0; - magFieldModel[1] = 0; - magFieldModel[2] = 0; + // convert nT to uT + VectorOperations::mulScalar(magFieldModelInertial, 1e-3, magFieldModelInertial, 3); } void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) { diff --git a/mission/controller/acs/Igrf13Model.h b/mission/controller/acs/Igrf13Model.h index ea2c1044..187adde7 100644 --- a/mission/controller/acs/Igrf13Model.h +++ b/mission/controller/acs/Igrf13Model.h @@ -47,7 +47,6 @@ class Igrf13Model /*:public HasParametersIF*/ { // Coefficient wary over year, could be updated sometimes. void updateCoeffGH(timeval timeOfMagMeasurement); // Secular variation (SV) - double magFieldModel[3]; void schmidtNormalization(); private: