mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-01 04:46:51 +08:00
[imu] Add heater and temperature options (#2929)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</description>
|
||||
</doc>
|
||||
<dep>
|
||||
<depends>spi_master,imu_common</depends>
|
||||
<depends>spi_master,imu_common,intermcu_iomcu,imu_heater</depends>
|
||||
<provides>imu</provides>
|
||||
</dep>
|
||||
<autoload name="imu_nps"/>
|
||||
@@ -46,6 +46,12 @@
|
||||
<define name="CUBE_IMU3_SPI_SLAVE_IDX" value="$(CUBE_IMU3_SPI_SLAVE_IDX)"/>
|
||||
<define name="USE_$(CUBE_IMU3_SPI_SLAVE_IDX)"/>
|
||||
|
||||
<!-- Configure the heater (ICM20602) -->
|
||||
<define name="IMU_HEATER_GYRO_ID" value="IMU_CUBE2_ID"/>
|
||||
<define name="IMU_HEATER_TARGET_TEMP" value="55.0"/>
|
||||
<define name="IMU_HEATER_P_GAIN" value="50.0"/>
|
||||
<define name="IMU_HEATER_I_GAIN" value="0.07"/>
|
||||
|
||||
<file name="invensense2.c" dir="peripherals"/>
|
||||
<file name="mpu60x0.c" dir="peripherals"/>
|
||||
<file name="mpu60x0_spi.c" dir="peripherals"/>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE module SYSTEM "module.dtd">
|
||||
|
||||
<module name="imu_heater" dir="imu">
|
||||
<doc>
|
||||
<description>
|
||||
IMU Heater through a resistor or IO co-processor
|
||||
</description>
|
||||
<define name="IMU_HEATER_TARGET_TEMP" value="55." description="Target temperature" unit="Celcius"/>
|
||||
<define name="IMU_HEATER_P_GAIN" value="200." description="kP gain for the heater" unit="%/degC"/>
|
||||
<define name="IMU_HEATER_I_GAIN" value="0.3" description="kI gain for the heater"/>
|
||||
<define name="IMU_HEATER_GYRO_ID" value="ABI_BROADCAST" description="Gyro ABI id for the temperature measurement"/>
|
||||
<define name="IMU_HEATER_ACCEL_ID" description="Accel ABI id for the temperature measurement"/>
|
||||
<define name="IMU_HEATER_GPIO" description="Heater GPIO port for resistor activation"/>
|
||||
<define name="IMU_HEATER_GPIO_PIN" description="Heater GPIO pin for resistor activation"/>
|
||||
<define name="INTERMCU_IOMCU" description="Heater IOMCU communication enabled"/>
|
||||
</doc>
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_settings NAME="IMU Heater">
|
||||
<dl_setting var="imu_heater.target_temp" min="-1" step="0.1" max="70" shortname="target_temp" param="IMU_HEATER_TARGET_TEMP"/>
|
||||
<dl_setting var="imu_heater.gain_p" min="0" step="0.1" max="500" shortname="gain_p" param="IMU_HEATER_P_GAIN"/>
|
||||
<dl_setting var="imu_heater.gain_i" min="0" step="0.01" max="10" shortname="gain_i" param="IMU_HEATER_I_GAIN"/>
|
||||
</dl_settings>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
<header>
|
||||
<file name="imu_heater.h"/>
|
||||
</header>
|
||||
<init fun="imu_heater_init()"/>
|
||||
<periodic fun="imu_heater_periodic()"/>
|
||||
<periodic fun="imu_heater_periodic_10hz()" freq="10"/>
|
||||
<makefile target="!sim|nps|fbw">
|
||||
<file name="imu_heater.c"/>
|
||||
</makefile>
|
||||
</module>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE module SYSTEM "module.dtd">
|
||||
|
||||
<module name="intermcu_iomcu" dir="intermcu">
|
||||
<doc>
|
||||
<description>
|
||||
InterMCU communication with the ardupilot IO co-processor
|
||||
</description>
|
||||
<configure name="INTERMCU_PORT" value="UART6" description="UART used for IO mcu communication"/>
|
||||
<configure name="INTERMCU_BAUD" value="B1500000" description="UART baud rate"/>
|
||||
</doc>
|
||||
<dep>
|
||||
<depends>uart</depends>
|
||||
</dep>
|
||||
<header>
|
||||
<file name="iomcu.h"/>
|
||||
</header>
|
||||
<makefile target="!sim|nps|fbw">
|
||||
<configure name="INTERMCU_PORT" default="UART6" case="upper|lower"/>
|
||||
<configure name="INTERMCU_BAUD" default="B1500000"/>
|
||||
<define name="INTERMCU_LINK" value="$(INTERMCU_PORT_LOWER)"/>
|
||||
<define name="USE_$(INTERMCU_PORT_UPPER)"/>
|
||||
<define name="$(INTERMCU_PORT_UPPER)_BAUD" value="$(INTERMCU_BAUD)"/>
|
||||
<define name="INTERMCU_IOMCU" value="true"/>
|
||||
|
||||
<file name="iomcu.c"/>
|
||||
</makefile>
|
||||
</module>
|
||||
Reference in New Issue
Block a user