|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
IMU heater module which can actuate a resistor heater through GPIO or IOMCU. More...
#include "imu_heater.h"#include "mcu_periph/sys_time.h"#include "modules/core/abi.h"#include "modules/imu/imu.h"#include "math/pprz_random.h"#include "modules/datalink/telemetry.h"Go to the source code of this file.
Macros | |
| #define | IMU_HEATER_TARGET_TEMP 45 |
| Default target temperature. | |
| #define | IMU_HEATER_P_GAIN 200.0 |
| Default heater kP gain. | |
| #define | IMU_HEATER_I_GAIN 0.3 |
| Default heater kI gain. | |
| #define | IMU_HEATER_GYRO_ID ABI_BROADCAST |
| Default heater gyro abi ID. | |
Functions | |
| static float | imu_heater_run (struct imu_heater_t *heater, float temp) |
| Calculate the IMU command percentage. | |
| static void | send_imu_heater (struct transport_tx *trans, struct link_device *dev) |
| Send the IMU heater message. | |
| static void | imu_heater_gyro_raw_cb (uint8_t sender_id, uint32_t stamp, struct Int32Rates *data, uint8_t samples, float rate, float temp) |
| void | imu_heater_init (void) |
| Initialize the heater Sets the default gains and resets the initial values. | |
| void | imu_heater_periodic (void) |
| High speed heater periodic This calculates the temperature average and in case of GPIO heater it will provide a heater output. | |
| void | imu_heater_periodic_10hz (void) |
| 10Hz IMU heater periodic This will run the control loop for the IMU heater and in case of an IOMCU will transmit the duty cycle to the IMU co-processor. | |
Variables | |
| struct imu_heater_t | imu_heater |
| Local variables and functions. | |
| static abi_event | imu_heater_abi_ev |
IMU heater module which can actuate a resistor heater through GPIO or IOMCU.
Definition in file imu_heater.c.
| #define IMU_HEATER_GYRO_ID ABI_BROADCAST |
Default heater gyro abi ID.
Definition at line 54 of file imu_heater.c.
Referenced by imu_heater_init().
| #define IMU_HEATER_I_GAIN 0.3 |
Default heater kI gain.
Definition at line 49 of file imu_heater.c.
Referenced by imu_heater_init().
| #define IMU_HEATER_P_GAIN 200.0 |
Default heater kP gain.
Definition at line 44 of file imu_heater.c.
Referenced by imu_heater_init().
| #define IMU_HEATER_TARGET_TEMP 45 |
Default target temperature.
Definition at line 39 of file imu_heater.c.
Referenced by imu_heater_init().
|
static |
Definition at line 104 of file imu_heater.c.
References imu_heater.
Referenced by imu_heater_init().
| void imu_heater_init | ( | void | ) |
Initialize the heater Sets the default gains and resets the initial values.
Main external functions.
Definition at line 127 of file imu_heater.c.
References DefaultPeriodic, imu_heater, imu_heater_abi_ev, IMU_HEATER_GYRO_ID, imu_heater_gyro_raw_cb(), IMU_HEATER_I_GAIN, IMU_HEATER_P_GAIN, IMU_HEATER_TARGET_TEMP, preflight_check_register(), register_periodic_telemetry(), and send_imu_heater().
| void imu_heater_periodic | ( | void | ) |
High speed heater periodic This calculates the temperature average and in case of GPIO heater it will provide a heater output.
The GPIO out is randomized to reduce the magnetometer influence.
Definition at line 163 of file imu_heater.c.
References gpio_clear(), gpio_set(), imu_heater, and rand_uniform().
| void imu_heater_periodic_10hz | ( | void | ) |
10Hz IMU heater periodic This will run the control loop for the IMU heater and in case of an IOMCU will transmit the duty cycle to the IMU co-processor.
Definition at line 180 of file imu_heater.c.
References imu_heater, imu_heater_run(), and iomcu_set_heater_duty_cycle().
|
static |
Calculate the IMU command percentage.
| heater | The heater to calculate the command for |
| temp | The current measured temperature |
Definition at line 204 of file imu_heater.c.
References imu_heater_t::gain_i, imu_heater_t::gain_p, get_sys_time_usec(), imu_heater_t::integrated, imu_heater_t::last_ts, and imu_heater_t::target_temp.
Referenced by imu_heater_periodic_10hz().
|
static |
Send the IMU heater message.
| trans | Transport structure to send |
| dev | Device to send the message over |
Definition at line 71 of file imu_heater.c.
References dev, and imu_heater.
Referenced by imu_heater_init().
| struct imu_heater_t imu_heater |
Local variables and functions.
Definition at line 58 of file imu_heater.c.
Referenced by imu_heater_gyro_raw_cb(), imu_heater_init(), imu_heater_periodic(), imu_heater_periodic_10hz(), and send_imu_heater().
|
static |
Definition at line 59 of file imu_heater.c.
Referenced by imu_heater_init().