Merge remote-tracking branch 'origin/develop' into refactor_syrlinks
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-01-26 17:06:42 +01:00
commit bc2a8cba94
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
5 changed files with 95 additions and 17 deletions

View File

@ -10,8 +10,11 @@ list yields a list of all related PRs for each release.
# [unreleased]
Syrlinks PR: PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/353
## Fixed
- The `OBSW_SYRLINKS_SIMULATED` flag is set to 0 for for both EM and FM.
- MGM4 handling in ACS sensor processing: Bugfix in `mulScalar` operation
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/354
- Subsystem ID clash: CORE subsystem ID was the same as Syrlinks subsystem ID.
@ -21,23 +24,23 @@ list yields a list of all related PRs for each release.
- Startracker temperature set and PCDU switcher set are diagnostic now
- `SyrlinksHkHandler` renamed to `SyrlinksHandler` to better reflect that it does more than
just HK and is also responsible for setting the TX mode of the device.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/353
- `SyrlinksHandler`: Go to normal mode at startup.
- `SyrlinksHandler`: Go to startup immediately because the Syrlinks device should always be on
by default.
- `SyrlinksHandler`: Go to normal mode at startup.
## Added
Syrlinks PR: PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/353
- The Syrlinks handler has submodes for the TX mode now: RX Only (1), RX and TX default
datarate (2), RX and TX Low Rate (3), RX and TX High Rate (4) and TX Carrier Wave (5).
- The Syrlinks handler has submodes for the TX mode now: RX Only (0), RX and TX default
datarate (1), RX and TX Low Rate (2), RX and TX High Rate (3) and TX Carrier Wave (4).
The submodes apply for both ON and NORMAL mode. The default datarate can be updated using
a parameter command (domain ID 0 and unique ID 0) with value 0 for low rate and 1 for high rate.
- The Syrlinks handler always sets TX to standby when switching off
- The Syrlinks handler triggers a new TX_ON event when the transmitter was switched on successfully
and a TX_OFF event when it was switched off successfully.
- Startracker temperature set and PCDU switcher set are diagnostic now
- The CCSDS handler can accept mode commands now. It accepts ON and OFF commands. Furthermore
it has a submode for low datarate (1) and high datarate (2) for the ON command.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/352
# [v1.20.0] 2023-01-24

View File

@ -150,7 +150,7 @@ set(OBSW_ADD_SCEX_DEVICE
${INIT_VAL}
CACHE STRING "Add Solar Cell Experiment module")
set(OBSW_SYRLINKS_SIMULATED
${OBSW_Q7S_EM}
0
CACHE STRING "Syrlinks is simulated")
# ##############################################################################

View File

@ -37,21 +37,21 @@ class AcsParameters /*: public HasParametersIF*/ {
float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}};
float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}};
float mgm0hardIronOffset[3] = {19.89364, -29.94111, -31.07508};
float mgm1hardIronOffset[3] = {10.95500, -8.053403, -33.36383};
float mgm2hardIronOffset[3] = {15.72181, -26.87090, -62.19010};
float mgm0hardIronOffset[3] = {0.0, 0.0, 0.0};//{19.89364, -29.94111, -31.07508};
float mgm1hardIronOffset[3] = {0.0, 0.0, 0.0};//{10.95500, -8.053403, -33.36383};
float mgm2hardIronOffset[3] = {0.0, 0.0, 0.0};//{15.72181, -26.87090, -62.19010};
float mgm3hardIronOffset[3] = {0.0, 0.0, 0.0};
float mgm4hardIronOffset[3] = {0.0, 0.0, 0.0};
float mgm0softIronInverse[3][3] = {{1420.727e-3, 9.352825e-3, -127.1979e-3},
float mgm0softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{1420.727e-3, 9.352825e-3, -127.1979e-3},
{9.352825e-3, 1031.965e-3, -80.02734e-3},
{-127.1979e-3, -80.02734e-3, 934.8899e-3}};
float mgm1softIronInverse[3][3] = {{126.7325e-2, -4.146410e-2, -18.37963e-2},
{-127.1979e-3, -80.02734e-3, 934.8899e-3}};*/
float mgm1softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{126.7325e-2, -4.146410e-2, -18.37963e-2},
{-4.146410e-2, 109.3310e-2, -5.246314e-2},
{-18.37963e-2, -5.246314e-2, 105.7300e-2}};
float mgm2softIronInverse[3][3] = {{143.0438e-2, 7.095763e-2, 15.67482e-2},
{-18.37963e-2, -5.246314e-2, 105.7300e-2}};*/
float mgm2softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{143.0438e-2, 7.095763e-2, 15.67482e-2},
{7.095763e-2, 99.65167e-2, -6.958760e-2},
{15.67482e-2, -6.958760e-2, 94.50124e-2}};
{15.67482e-2, -6.958760e-2, 94.50124e-2}};*/
float mgm3softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
float mgm4softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
float mgm02variance[3] = {1, 1, 1};

View File

@ -21,6 +21,7 @@ CcsdsIpCoreHandler::CcsdsIpCoreHandler(object_id_t objectId, object_id_t ptmeId,
tcDestination(tcDestination),
parameterHelper(this),
actionHelper(this, nullptr),
modeHelper(this),
ptmeConfig(ptmeConfig),
gpioIF(gpioIF),
enTxClock(enTxClock),
@ -81,6 +82,11 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() {
return result;
}
result = modeHelper.initialize();
if (result != returnvalue::OK) {
return result;
}
VirtualChannelMapIter iter;
for (iter = virtualChannelMap.begin(); iter != virtualChannelMap.end(); iter++) {
result = iter->second->initialize();
@ -152,6 +158,10 @@ void CcsdsIpCoreHandler::readCommandQueue(void) {
if (result == returnvalue::OK) {
return;
}
result = modeHelper.handleModeCommand(&commandMessage);
if (result == returnvalue::OK) {
return;
}
CommandMessage reply;
reply.setReplyRejected(CommandMessage::UNKNOWN_COMMAND, commandMessage.getCommand());
commandQueue->reply(&reply);
@ -218,10 +228,12 @@ ReturnValue_t CcsdsIpCoreHandler::executeAction(ActionId_t actionId, MessageQueu
ReturnValue_t result = returnvalue::OK;
switch (actionId) {
case SET_LOW_RATE: {
submode = static_cast<Submode_t>(Submode::DATARATE_LOW);
result = ptmeConfig->setRate(RATE_100KBPS);
break;
}
case SET_HIGH_RATE: {
submode = static_cast<Submode_t>(Submode::DATARATE_HIGH);
result = ptmeConfig->setRate(RATE_500KBPS);
break;
}
@ -233,10 +245,16 @@ ReturnValue_t CcsdsIpCoreHandler::executeAction(ActionId_t actionId, MessageQueu
}
case EN_TRANSMITTER: {
enableTransmit();
if (mode == HasModesIF::MODE_OFF) {
mode = HasModesIF::MODE_ON;
}
return EXECUTION_FINISHED;
}
case DISABLE_TRANSMITTER: {
disableTransmit();
if (mode == HasModesIF::MODE_ON) {
mode = HasModesIF::MODE_OFF;
}
return EXECUTION_FINISHED;
}
case ENABLE_TX_CLK_MANIPULATOR: {
@ -339,6 +357,48 @@ void CcsdsIpCoreHandler::checkTxTimer() {
}
}
void CcsdsIpCoreHandler::getMode(Mode_t* mode, Submode_t* submode) {
*mode = this->mode;
*submode = this->submode;
}
ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) {
if (mode == HasModesIF::MODE_ON) {
if (submode != static_cast<Submode_t>(Submode::DATARATE_HIGH) and
submode != static_cast<Submode_t>(Submode::DATARATE_LOW)) {
return HasModesIF::INVALID_SUBMODE;
}
} else if (mode != HasModesIF::MODE_OFF) {
return returnvalue::FAILED;
}
*msToReachTheMode = 2000;
return returnvalue::OK;
}
void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
if (mode == HasModesIF::MODE_ON) {
enableTransmit();
if (submode == static_cast<Submode_t>(Submode::DATARATE_HIGH)) {
ReturnValue_t result = ptmeConfig->setRate(RATE_500KBPS);
if (result == returnvalue::OK) {
mode = HasModesIF::MODE_ON;
}
} else if (submode == static_cast<Submode_t>(Submode::DATARATE_LOW)) {
ReturnValue_t result = ptmeConfig->setRate(RATE_100KBPS);
if (result == returnvalue::OK) {
mode = HasModesIF::MODE_ON;
}
}
} else if (mode == HasModesIF::MODE_OFF) {
disableTransmit();
mode = HasModesIF::MODE_OFF;
}
modeHelper.modeChanged(mode, submode);
}
void CcsdsIpCoreHandler::announceMode(bool recursive) { triggerEvent(MODE_INFO, mode, submode); }
void CcsdsIpCoreHandler::disableTransmit() {
#ifndef TE0720_1CFA
gpioIF->pullLow(enTxClock);

View File

@ -1,6 +1,8 @@
#ifndef CCSDSHANDLER_H_
#define CCSDSHANDLER_H_
#include <fsfw/modes/HasModesIF.h>
#include <cstdint>
#include <unordered_map>
@ -21,6 +23,8 @@
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
#include "linux/ipcore/PtmeConfig.h"
enum class Submode : uint8_t { UNSET = 0, DATARATE_LOW = 1, DATARATE_HIGH = 2 };
/**
* @brief This class handles the data exchange with the CCSDS IP cores implemented in the
* programmable logic of the Q7S.
@ -32,6 +36,7 @@
*/
class CcsdsIpCoreHandler : public SystemObject,
public ExecutableObjectIF,
public HasModesIF,
public AcceptsTelemetryIF,
public AcceptsTelecommandsIF,
public ReceivesParameterMessagesIF,
@ -59,7 +64,14 @@ class CcsdsIpCoreHandler : public SystemObject,
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
ReturnValue_t initialize();
MessageQueueId_t getCommandQueue() const;
MessageQueueId_t getCommandQueue() const override;
// ModesIF
void getMode(Mode_t* mode, Submode_t* submode) override;
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override;
void startTransition(Mode_t mode, Submode_t submode) override;
void announceMode(bool recursive) override;
/**
* @brief Function to add a virtual channel
@ -126,6 +138,9 @@ class CcsdsIpCoreHandler : public SystemObject,
ParameterHelper parameterHelper;
ActionHelper actionHelper;
Mode_t mode = HasModesIF::MODE_OFF;
Submode_t submode = static_cast<Submode_t>(Submode::UNSET);
ModeHelper modeHelper;
MessageQueueId_t tcDistributorQueueId = MessageQueueIF::NO_QUEUE;