ISIS iMTQ API¶
Core¶
Command Response Flags
-
RESP_NEW¶
First time retrieving this response.
-
RESP_IVA_X¶
X-axis measurement might be invalid.
-
RESP_IVA_Y¶
Y-axis measurement might be invalid.
-
RESP_IVA_Z¶
Z-axis measurement might be invalid.
Enums
-
enum KADCSStatus¶
ADCS function return values.
Values:
-
enumerator ADCS_OK¶
-
enumerator ADCS_ERROR¶
Generic error.
-
enumerator ADCS_ERROR_CONFIG¶
Configuration error.
-
enumerator ADCS_ERROR_NO_RESPONSE¶
No response received from subsystem.
-
enumerator ADCS_ERROR_INTERNAL¶
An error was thrown by the subsystem.
-
enumerator ADCS_ERROR_MUTEX¶
Mutex-related error.
-
enumerator ADCS_ERROR_NOT_IMPLEMENTED¶
Requested function has not been implemented for the subsystem.
-
enumerator ADCS_OK¶
-
enum KIMTQStatus¶
iMTQ Return Values Error codes which may be returned in the imtq_resp_header.status byte of a response message
Values:
-
enumerator IMTQ_OK¶
-
enumerator IMTQ_ERROR¶
Generic error.
-
enumerator IMTQ_ERROR_BAD_CMD¶
Invalid command.
-
enumerator IMTQ_ERROR_NO_PARAM¶
Parameter missing.
-
enumerator IMTQ_ERROR_BAD_PARAM¶
Parameter invalid.
-
enumerator IMTQ_ERROR_MODE¶
Command unavailable in current mode.
-
enumerator IMTQ_ERROR_RESERVED¶
(Internal reserved value)
-
enumerator IMTQ_ERROR_INTERNAL¶
Internal error.
-
enumerator IMTQ_OK¶
Functions
-
KADCSStatus k_adcs_init(char *bus, uint16_t addr, int timeout)¶
Initialize the ADCS interface.
- Parameters
bus – [in] I2C bus device name
addr – [in] I2C address
timeout – [in] Watchdog timeout in seconds
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
void k_adcs_terminate(void)¶
Terminate the ADCS interface.
-
KADCSStatus k_imtq_watchdog_start(void)¶
Start a thread to kick the iMTQ’s watchdog at an interval of
(timeout/3)
seconds (timeout
specified ink_adcs_init
)- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_watchdog_stop(void)¶
Stop the watchdog thread.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_reset(void)¶
Reboot the iMTQ.
Note
All configuration options will be reset to their default values
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_adcs_passthrough(const uint8_t *tx, int tx_len, uint8_t *rx, int rx_len, const struct timespec *delay)¶
Pass a command packet directly through to the ADCS.
Useful for executing commands which have not been implemented in either the generic or specific ADCS APIs.
- Parameters
tx – [in] Pointer to command packet to send
tx_len – [in] Size of command packet
rx – [out] Pointer to storage for command response
rx_len – [in] Expected length of command response
delay – [in] Time to wait inbetween sending the command packet and requesting a response
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus kprv_imtq_transfer(const uint8_t *tx, int tx_len, uint8_t *rx, int rx_len, const struct timespec *delay)¶
Send an iMTQ request and fetch the response.
- Parameters
tx – [in] Pointer to data to send
tx_len – [in] Length of data to send
rx – [out] Pointer to buffer for response data
rx_len – [in] Length of data to read for response
delay – [in] Delay between sending data to the iMTQ and reading the response. A value of
NULL
indicates that the default should be used.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
static inline KIMTQStatus kprv_imtq_check_error(uint8_t status)¶
Extract the return code in a response status byte.
- Parameters
status – [in] A imtq_resp_header.status byte returned in a response message structure
- Returns
Converted KIMTQStatus value
Variables
-
pthread_mutex_t imtq_mutex¶
System mutex to preserve iMTQ command/response ordering.
-
struct imtq_resp_header¶
- #include <imtq.h>
Response header structure.
Public Members
-
uint8_t cmd¶
Command which produced this response.
-
uint8_t status¶
Status byte.
Contains command response flags, like RESP_IVA_X, and a return code which can be extracted with kprv_imtq_check_error
-
uint8_t cmd¶
-
struct imtq_axis_data¶
- #include <imtq.h>
Generic structure for data relating to the axes.
-
struct adcs_orient¶
-
struct adcs_spin¶
Configuration¶
Magnetometer Configuration Parameter Codes
-
MTM_SELECT¶
Select MTM to use for measurement.
0 - Internal, 1 - External
-
MTM_INTERNAL_TIME¶
Integration time selection for idle mode MTM measurements.
Refer to Table 3-10 of the iMTQ User Manual for more information
-
MTM_EXTERNAL_TIME¶
Integration time selection for idle mode MTM measurements.
Refer to Table 3-10 of the iMTQ User Manual for more information
-
MTM_INTERNAL_MAP_X¶
iMTQ axis to which the MTM x-axis is mapped
-
MTM_INTERNAL_MAP_Y¶
iMTQ axis to which the MTM y-axis is mapped
-
MTM_INTERNAL_MAP_Z¶
iMTQ axis to which the MTM z-axis is mapped
-
MTM_EXTERNAL_MAP_X¶
iMTQ axis to which the MTM x-axis is mapped
-
MTM_EXTERNAL_MAP_Y¶
iMTQ axis to which the MTM y-axis is mapped
-
MTM_EXTERNAL_MAP_Z¶
iMTQ axis to which the MTM z-axis is mapped
-
MTM_MATRIX_R1_C1¶
MTM raw -> corrected correction matrix (Row 1, Column 1)
-
MTM_MATRIX_R1_C2¶
MTM raw -> corrected correction matrix (Row 1, Column 2)
-
MTM_MATRIX_R1_C3¶
MTM raw -> corrected correction matrix (Row 1, Column 3)
-
MTM_MATRIX_R2_C1¶
MTM raw -> corrected correction matrix (Row 2, Column 1)
-
MTM_MATRIX_R2_C2¶
MTM raw -> corrected correction matrix (Row 2, Column 2)
-
MTM_MATRIX_R2_C3¶
MTM raw -> corrected correction matrix (Row 2, Column 3)
-
MTM_MATRIX_R3_C1¶
MTM raw -> corrected correction matrix (Row 3, Column 1)
-
MTM_MATRIX_R3_C2¶
MTM raw -> corrected correction matrix (Row 3, Column 2)
-
MTM_MATRIX_R3_C3¶
MTM raw -> corrected correction matrix (Row 3, Column 3)
-
MTM_BIAS_X¶
MTM raw -> corrected correction bias vector (X-axis value)
-
MTM_BIAS_Y¶
MTM raw -> corrected correction bias vector (Y-axis value)
-
MTM_BIAS_Z¶
MTM raw -> corrected correction bias vector (Z-axis value)
Current/Temperature Measurement Configuration Parameter Codes
-
ADC_COIL_CURRENT_BIAS_X¶
X-axis voltage bias for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_BIAS_Y¶
Y-axis voltage bias for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_BIAS_Z¶
Z-axis voltage bias for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_MULT_X¶
X-axis pre-multiplier for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_MULT_Y¶
Y-axis pre-multiplier for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_MULT_Z¶
Z-axis pre-multiplier for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_DIV_X¶
X-axis post-divider for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_DIV_Y¶
Y-axis post-divider for coil current ADC -> engineering value conversion.
-
ADC_COIL_CURRENT_DIV_Z¶
Z-axis post-divider for coil current ADC -> engineering value conversion.
-
ADC_COIL_TEMP_BIAS_X¶
X-axis voltage bias for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_BIAS_Y¶
Y-axis voltage bias for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_BIAS_Z¶
Z-axis voltage bias for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_MULT_X¶
X-axis pre-multiplier for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_MULT_Y¶
Y-axis pre-multiplier for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_MULT_Z¶
Z-axis pre-multiplier for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_DIV_X¶
X-axis post-divider for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_DIV_Y¶
Y-axis post-divider for coil temperature ADC -> engineering value conversion.
-
ADC_COIL_TEMP_DIV_Z¶
Z-axis post-divider for coil temperature ADC -> engineering value conversion.
Detumble Configuration Parameter Codes
-
DETUMBLE_FREQUENCY¶
Control frequency of the detumble mode control loop.
Values: 1, 2, 4, or 8 Hz
-
BDOT_GAIN¶
B-Dot algorithm gain when converting from B-Dot to dipole.
Value should be negative
-
MTM_FILTER_SENSITIVITY¶
Adaptive sensitivity of low-pass filter applied to calibrated MTM measurements during detumble mode.
-
MTM_FILTER_WEIGHT¶
Adaptive weight of low-pass filter applied to calibrated MTM measurements during detumble mode.
Dipole to Current Conversion Configuration Parameter Codes
-
COIL_AREA_X¶
X-axis area of the coil used to calculate the dipole from the current flowing through the coil.
-
COIL_AREA_Y¶
Y-axis area of the coil used to calculate the dipole from the current flowing through the coil.
-
COIL_AREA_Z¶
Z-axis area of the coil used to calculate the dipole from the current flowing through the coil.
-
COIL_CURRENT_LIMIT¶
Maximum total coil current allowed for dipole generation (excluding idle current consumption)
Current to Actuation-percentage Conversion Configuration Parameter Codes
-
CURRENT_FEEDBACK_ENABLE¶
Current feedback control.
0 - Open-loop temperature-compensated, 1 - Software-based closed-loop
-
CURRENT_FEEDBACK_GAIN_X¶
X-axis feedback gain of the proportional difference controller.
-
CURRENT_FEEDBACK_GAIN_Y¶
Y-axis feedback gain of the proportional difference controller.
-
CURRENT_FEEDBACK_GAIN_Z¶
Z-axis feedback gain of the proportional difference controller.
-
CURRENT_MAP_TEMP_T1¶
Current-map profile temperature 1 (lowest)
-
CURRENT_MAP_TEMP_T2¶
Current-map profile temperature 2.
-
CURRENT_MAP_TEMP_T3¶
Current-map profile temperature 3.
-
CURRENT_MAP_TEMP_T4¶
Current-map profile temperature 4.
-
CURRENT_MAP_TEMP_T5¶
Current-map profile temperature 5.
-
CURRENT_MAP_TEMP_T6¶
Current-map profile temperature 6.
-
CURRENT_MAP_TEMP_T7¶
Current-map profile temperature 7 (highest)
-
CURRENT_MAX_X_T1¶
X-axis maximum current at temperature 1.
-
CURRENT_MAX_X_T2¶
X-axis maximum current at temperature 2.
-
CURRENT_MAX_X_T3¶
X-axis maximum current at temperature 3.
-
CURRENT_MAX_X_T4¶
X-axis maximum current at temperature 4.
-
CURRENT_MAX_X_T5¶
X-axis maximum current at temperature 5.
-
CURRENT_MAX_X_T6¶
X-axis maximum current at temperature 6.
-
CURRENT_MAX_X_T7¶
X-axis maximum current at temperature 7.
-
CURRENT_MAX_Y_T1¶
Y-axis maximum current at temperature 1.
-
CURRENT_MAX_Y_T2¶
Y-axis maximum current at temperature 2.
-
CURRENT_MAX_Y_T3¶
Y-axis maximum current at temperature 3.
-
CURRENT_MAX_Y_T4¶
Y-axis maximum current at temperature 4.
-
CURRENT_MAX_Y_T5¶
Y-axis maximum current at temperature 5.
-
CURRENT_MAX_Y_T6¶
Y-axis maximum current at temperature 6.
-
CURRENT_MAX_Y_T7¶
Y-axis maximum current at temperature 7.
-
CURRENT_MAX_Z_T1¶
Z-axis maximum current at temperature 1.
-
CURRENT_MAX_Z_T2¶
Z-axis maximum current at temperature 2.
-
CURRENT_MAX_Z_T3¶
Z-axis maximum current at temperature 3.
-
CURRENT_MAX_Z_T4¶
Z-axis maximum current at temperature 4.
-
CURRENT_MAX_Z_T5¶
Z-axis maximum current at temperature 5.
-
CURRENT_MAX_Z_T6¶
Z-axis maximum current at temperature 6.
-
CURRENT_MAX_Z_T7¶
Z-axis maximum current at temperature 7.
Read-Only Configuration Parameter Codes
-
HW_CONFIG¶
iMTQ hardware configuration.
0 - Internal config, 1 - External config
-
WATCHDOG_TIMEOUT¶
I2C watchdog timeout interval in seconds.
Value of 0 indicates the watchdog is disabled
-
SLAVE_ADDRESS¶
iMTQ’s I2C address
-
SOFTWARE_VERSION¶
iMTQ’s software version.
v[second byte].[third byte].[fourth byte]; first byte is ignored
Functions
-
KADCSStatus k_adcs_configure(const JsonNode *config)¶
Configure the ADCS.
- Parameters
config – [in] ADCS configuration structure
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_imtq_get_param(uint16_t param, imtq_config_resp *response)¶
Get the current value of a configuration parameter.
- Parameters
param – [in] ID of parameter value to fetch
response – [out] Pointer to storage for response message. Returns the current value of the parameter.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_set_param(uint16_t param, const imtq_config_value *value, imtq_config_resp *response)¶
Set the value of a configuration parameter.
- Parameters
param – [in] ID of parameter to update
value – [in] Pointer to new parameter value
response – [out] Pointer to storage for response message. Returns the updated value of the parameter. If successful, the new value should match the requested value.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_reset_param(uint16_t param, imtq_config_resp *response)¶
Reset the value of a configuration parameter to its default.
- Parameters
param – [in] ID of parameter value to reset
response – [out] Pointer to storage for response message. Returns the new value of the parameter.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
union imtq_config_value¶
- #include <imtq-config.h>
Configuration value storage union Using a union allows one common variable type to be used for all configuration functions.
Public Members
-
int8_t int8_val¶
Storage for signed single-byte values.
-
uint8_t uint8_val¶
Storage for unsigned single-byte values.
-
int16_t int16_val¶
Storage for signed byte-pair values.
-
uint16_t uint16_val¶
Storage for unsigned byte-pair values.
-
int32_t int32_val¶
Storage for signed four-byte values.
-
uint32_t uint32_val¶
Storage for unsigned four-byte values.
-
float float_val¶
Storage for IEEE754 single-precision floating point values (four bytes)
-
int64_t int64_val¶
Storage for signed eight-byte values.
-
uint64_t uint64_val¶
Storage for unsigned eight-byte values.
-
double double_val¶
Storage for IEEE754 double-precision floating point values (eight bytes)
-
int8_t int8_val¶
-
struct imtq_config_resp¶
- #include <imtq-config.h>
Message structure returned by all get/set/reset configuration requests.
Public Members
-
imtq_resp_header hdr¶
Response message header.
-
uint16_t param¶
Echo of requested parameter ID.
-
imtq_config_value value¶
Current value of requested parameter.
-
imtq_resp_header hdr¶
Operations¶
Typedefs
-
typedef uint16_t adcs_mode_param¶
Parameter for
k_adcs_set_mode
For the iMTQ, exclusively used to specify the duration when entering DETUMBLE mode
-
typedef JsonNode *adcs_test_results¶
Pointer to self-test results JSON structure created by
k_adcs_run_test
Enums
-
enum ADCSTestType¶
Self-Test Axis Options.
Values:
-
enumerator TEST_ALL¶
Test all axes.
-
enumerator TEST_X_POS¶
Test positive x-axis.
-
enumerator TEST_X_NEG¶
Test negative x-axis.
-
enumerator TEST_Y_POS¶
Test positive y-axis.
-
enumerator TEST_Y_NEG¶
Test negative y-axis.
-
enumerator TEST_Z_POS¶
Test positive z-axis.
-
enumerator TEST_Z_NEG¶
Test negative z-axis.
-
enumerator TEST_ALL¶
Functions
-
KADCSStatus k_adcs_noop(void)¶
Execute ADCS no-op command.
Note
This function might not be implemented for all ADCSs.
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_reset(KADCSReset type)¶
Reset the ADCS.
Note
This function might not be implemented for all ADCSs
- Parameters
type – [in] Type of reset to perform (hard, soft, etc)
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_set_mode(ADCSMode mode, const adcs_mode_param *params)¶
Set the ADCS’s operating mode.
Note
See specific ADCS API documentation for available modes
- Parameters
mode – [in] Operating mode to change to
params – [in] Pointer to optional parameters which may be needed to configure the new operational mode
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_run_test(ADCSTestType test, adcs_test_results buffer)¶
Run an ADCS self-test.
Note
This function might not be implemented for all ADCSs. See specific ADCS API documentation for available self-tests.
- Parameters
test – [in] Type of self-test to run
buffer – [out] (Pointer to) structure which the test-results should be copied to
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_imtq_cancel_op(void)¶
Switch to idle mode and cancel any ongoing actuation.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_start_measurement(void)¶
Start a 3-axis measurement of the magnetic field using the MTM.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_start_actuation_current(imtq_axis_data current, uint16_t time)¶
Turn on the coils by current.
- Parameters
current – Axes current values in [10-4 Am2]
time – Amount of time coils should remain at the specified levels, in milliseconds. If time is zero, the coils will stay on until another command capable of changing the coils’ states/levels is run.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_start_actuation_dipole(imtq_axis_data dipole, uint16_t time)¶
Turn on the coils by desired dipole.
Note
If the specified values exceed the coils’ capabilities, the dipole will be scaled. The resulting values can be retrieved with k_imtq_get_dipole.
- Parameters
dipole – Axes dipole values in [10-4 Am2]
time – Amount of time coils should remain at the specified levels, in milliseconds. If time is zero, the coils will stay on until another command capable of changing the coils’ states/levels is run.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_start_actuation_PWM(imtq_axis_data pwm, uint16_t time)¶
Turn on the coils by PWM duty cycle.
- Parameters
pwm – Axes PWM duty cycles in [0.1%]. Max single-axis value: 1000 (100%)
time – Amount of time coils should remain at the specified levels, in milliseconds. If time is zero, the coils will stay on until another command capable of changing the coils’ states/levels is run.
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_start_test(ADCSTestType axis)¶
Start axis self-test.
Use k_imtq_get_test_results_single or k_imtq_get_test_results_all to check the output
- Parameters
axis – Axis to test. Should be a ADCSTestType value (use TEST_ALL to text each axis sequentially)
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_start_detumble(uint16_t time)¶
Switch to detumble mode.
- Parameters
time – Length of time to spend in detumble mode (seconds)
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
Data Requests¶
Self-Test Error Byte Flags
-
TEST_ERROR_I2C¶
I2C Failure.
-
TEST_ERROR_SPI¶
SPI Failure (MTM connectivity)
-
TEST_ERROR_ADC¶
ADC Failure (current/temp measurement)
-
TEST_ERROR_PWM¶
PWM Failure (coil actuation)
-
TEST_ERROR_TC¶
System Failure.
-
TEST_ERROR_MTM¶
MTM values outside of expected range.
-
TEST_ERROR_COIL¶
Coil currents outside of expected range.
Typedefs
-
typedef uint32_t adcs_power_status¶
System uptime returned by
k_adcs_get_power_status
-
typedef imtq_axis_msg imtq_coil_current¶
Coil currents in [10-4 A] returned by k_imtq_get_coil_current.
-
typedef imtq_axis_msg imtq_coil_temp¶
Coil temperatures in [oC] returned by k_imtq_get_coil_temps.
-
typedef imtq_axis_msg imtq_dipole¶
Commanded actuation dipole in [10-4 Am2] returned by k_imtq_get_dipole.
Enums
Functions
-
KADCSStatus k_adcs_get_power_status(adcs_power_status *data)¶
Get the ADCS’s power status.
- Parameters
data – [out] Pointer to storage for returned system uptime. If the value is zero, then the ADCS is offline.
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_get_mode(ADCSMode *mode)¶
Get the ADCS’s current operating mode.
- Parameters
mode – [out] Pointer to storage which the mode value should be copied to
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_get_orientation(adcs_orient *data)¶
Get the ADCS’s current orientation.
Note
This function might not be implemented for all ADCSs.
- Parameters
data – [out] Pointer to storage for returned data.
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_get_spin(adcs_spin *data)¶
Get the ADCS’s current spin.
Note
This function might not be implemented for all ADCSs.
- Parameters
data – [out] Pointer to storage for returned data.
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_adcs_get_telemetry(ADCSTelemType type, JsonNode *buffer)¶
Read ADCS telemetry values.
Note
See specific ADCS API documentation for available telemetry types
- Parameters
type – [in] Telemetry packet to read
buffer – [out] (Pointer to) structure which data should be copied to
- Returns
KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus k_imtq_get_system_state(imtq_state *state)¶
Get iMTQ system state.
- Parameters
state – [out] Pointer to storage for state data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_raw_mtm(imtq_mtm_msg *data)¶
Get raw data values from MTM.
Measurement units are in [7.5 * 10-9 T], as documented in the XEN1210 datasheet
Note
The k_imtq_start_measurement function must have been called in order for this function to be able to retrieve data
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_calib_mtm(imtq_mtm_msg *data)¶
Get calibrated data values from MTM.
Measurement units are in [10-9 T]
Note
The k_imtq_start_measurement function must have been called in order for this function to be able to retrieve data
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_coil_current(imtq_coil_current *data)¶
Get coil currents.
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_coil_temps(imtq_coil_temp *data)¶
Get coil temperatures.
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_dipole(imtq_dipole *data)¶
Get commanded actuation dipole.
Note
Only applies to coil actuations started with k_imtq_start_actuation_dipole. Can also be used in detumble mode to retrieve the latest actuation dipole
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_test_results_single(imtq_test_result_single *data)¶
Get results from a single-axis self-test.
The test can be started with k_imtq_start_test
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_test_results_all(imtq_test_result_all *data)¶
Get results from an all-axes self-test.
The test can be started with k_imtq_start_test by specifying TEST_ALL
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_detumble(imtq_detumble *data)¶
Get detumble data.
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_raw_housekeeping(imtq_housekeeping_raw *data)¶
Get the housekeeping data of the iMTQ as raw ADC values.
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus k_imtq_get_eng_housekeeping(imtq_housekeeping_eng *data)¶
Get the housekeeping data of the iMTQ in interpreted engineering units.
- Parameters
data – [out] Pointer to storage for data
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus kprv_adcs_get_status_telemetry(JsonNode *buffer)¶
Get the current system status and add it to the telemetry JSON.
- Parameters
buffer – [out] Pointer to telemetry JSON structure
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus kprv_adcs_get_nominal_telemetry(JsonNode *buffer)¶
Get the current system measurements and add them to the telemetry JSON.
- Parameters
buffer – [out] Pointer to telemetry JSON structure
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
KADCSStatus kprv_adcs_get_debug_telemetry(JsonNode *buffer)¶
Get the current system configuration and last self-test results and add them to the telemetry JSON.
- Parameters
buffer – [out] Pointer to telemetry JSON structure
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
void kprv_adcs_process_test(JsonNode *parent, imtq_test_result test)¶
Add a self-test result to the requested JSON structure.
- Parameters
parent – [out] Pointer to JSON structure results should be added to
test – [in] Self-test results to be parsed into JSON
- Returns
KADCSStatus
ADCS_OK
if OK, error otherwise
-
struct imtq_state¶
- #include <imtq-data.h>
iMTQ system state data returned by k_imtq_get_system_state
-
struct imtq_mtm_data¶
- #include <imtq-data.h>
MTM measurements data structure.
-
struct imtq_mtm_msg¶
- #include <imtq-data.h>
MTM measurement returned by k_imtq_get_raw_mtm and k_imtq_get_calib_mtm.
Public Members
-
imtq_resp_header hdr¶
Response message header.
-
imtq_mtm_data data¶
MTM measurement data.
Units dependent on function used
-
uint8_t act_status¶
Coils actuation status during measurement.
0 - Not actuating, 1 - Actuating
-
imtq_resp_header hdr¶
-
struct imtq_axis_msg¶
- #include <imtq-data.h>
Generic structure for messages relating to the axes.
-
struct imtq_test_result¶
- #include <imtq-data.h>
Self-test step result structure.
Public Members
-
imtq_resp_header hdr¶
Response message header.
-
uint8_t error¶
Return code for the step.
-
uint8_t step¶
Axis being tested.
-
imtq_mtm_data mtm_raw¶
Raw MTM data in [7.5*10-9 T] per count.
-
imtq_mtm_data mtm_calib¶
Calibrated MTM data in [10-9 T].
-
imtq_axis_data coil_current¶
Coil currents in [10-4 A].
-
imtq_axis_data coil_temp¶
Coil temperatures in [oC].
-
imtq_resp_header hdr¶
-
struct imtq_test_result_single¶
- #include <imtq-data.h>
Self-test single-axis result structure returned by k_imtq_get_test_results_single.
Public Members
-
imtq_test_result init¶
Measurements before actuation.
-
imtq_test_result step¶
Measurements during actuation of requested axis.
-
imtq_test_result final¶
Measurements after actuation.
-
imtq_test_result init¶
-
struct imtq_test_result_all¶
- #include <imtq-data.h>
Self-test all-axes result structure returned by k_imtq_get_test_results_all.
Public Members
-
imtq_test_result init¶
Measurements before actuation.
-
imtq_test_result x_pos¶
Measurements during actuation of positive x-axis.
-
imtq_test_result x_neg¶
Measurements during actuation of negative x-axis.
-
imtq_test_result y_pos¶
Measurements during actuation of positive y-axis.
-
imtq_test_result y_neg¶
Measurements during actuation of negative y-axis.
-
imtq_test_result z_pos¶
Measurements during actuation of positive z-axis.
-
imtq_test_result z_neg¶
Measurements during actuation of negative z-axis.
-
imtq_test_result final¶
Measurements after actuation.
-
imtq_test_result init¶
-
struct imtq_detumble¶
- #include <imtq-data.h>
Detumble data returned by k_imtq_get_detumble.
Public Members
-
imtq_resp_header hdr¶
Response message header.
-
imtq_mtm_data mtm_calib¶
Calibrated MTM data in [10-9 T].
-
imtq_mtm_data mtm_filter¶
Filtered MTM data in [10-9 T].
-
imtq_mtm_data bdot¶
B-Dot in [10-9 T*s-1].
-
imtq_axis_data dipole¶
Commanded actuation dipole in [10-4 Am2].
-
imtq_axis_data cmd_current¶
Command current in [10-4 A].
-
imtq_axis_data coil_current¶
Coil currents in [10-4 A].
-
imtq_resp_header hdr¶
-
struct imtq_axis_data_raw¶
- #include <imtq-data.h>
Generic structure for raw ADC data relating to the axes.
-
struct imtq_housekeeping_raw¶
- #include <imtq-data.h>
Housekeeping data (raw ADC values) returned by k_imtq_get_raw_housekeeping.
Public Members
-
imtq_resp_header hdr¶
Response message header.
-
uint16_t voltage_d¶
Digital supply voltage.
-
uint16_t voltage_a¶
Analog supply voltage.
-
uint16_t current_d¶
Digital supply current.
-
uint16_t current_a¶
Analog supply current.
-
imtq_axis_data_raw coil_current¶
Coil currents.
-
imtq_axis_data_raw coil_temp¶
Coil temperatures.
-
uint16_t mcu_temp¶
MCU temperature.
-
imtq_resp_header hdr¶
-
struct imtq_housekeeping_eng¶
- #include <imtq-data.h>
Housekeeping data (engineering values) returned by k_imtq_get_eng_housekeeping.
Public Members
-
imtq_resp_header hdr¶
Response message header.
-
uint16_t voltage_d¶
Digital supply voltage in [mV].
-
uint16_t voltage_a¶
Analog supply voltage in [mV].
-
uint16_t current_d¶
Digital supply current in [10-4 A].
-
uint16_t current_a¶
Analog supply current in [10-4 A].
-
imtq_axis_data coil_current¶
Coil currents in [10-4 A].
-
imtq_axis_data coil_temp¶
Coil temperatures in [oC].
-
int16_t mcu_temp¶
MCU temperature in [oC].
-
imtq_resp_header hdr¶