Commit 7cbe1a42 authored by Wenxi Xu's avatar Wenxi Xu
Browse files

Added Temperature control for IMU

parent 573b526c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,5 +6,6 @@
# module options by going to Zephyr -> Modules in Kconfig.

rsource "drivers/Kconfig"
rsource "include/ares/Kconfig"
# rsource "lib/Kconfig"
+38 −36
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@
		zephyr,button = &user_button;
		zephyr,flash = &flash0;
		zephyr,canbus = &can1;
		zephyr,ccm = &ccm0;
		ares,pwm = &heater;
		ares,bias = &gyro_bias;
		sbus,uart = &usart3;
	};

@@ -48,6 +51,25 @@
	// 	};
	// };

	pwmleds: pwmleds {
		compatible = "pwm-leds";
		status = "okay";
		heater: heater {
			pwms = <&pwm10 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
		};
	};

	imu_temp_pid: imu_temp_pid {
		#controller-cells = <0>;
		compatible = "pid,single";
		k_p = "6000000";
		k_i = "5";
		k_d = "0.0000002";
		i_max = "100000000";
		out_max = "20000000.000000";
		offset = "6750000.000000";
	};

	buttons {
		compatible = "gpio-keys";
		user_button: button_0 {
@@ -69,6 +91,11 @@
		};
	};

	gyro_bias: gyro_bias {
		compatible = "gyro-bias";
		status = "okay";
		gyro-bias = "-0.000330", "-0.000053", "0.004050";
	};
};

&clk_lsi {
@@ -177,19 +204,15 @@ zephyr_udc0: &usbotg_fs {
	status = "okay";
};

// &timers1 {
// 	status = "okay";
// 	st,prescaler = <10000>;

// 	pwm1: pwm {
// 		status = "okay";
// 		pinctrl-0 = <&tim1_ch1_pe9
// 					&tim1_ch2_pe11
// 					&tim1_ch3_pe13
// 					&tim1_ch4_pe14>;
// 		pinctrl-names = "default";
// 	};
// };
&timers10 {
	status = "okay";
	st,prescaler = <10000>;
	pwm10: pwm {
		status = "okay";
		pinctrl-0 = <&tim10_ch1_pf6>;
		pinctrl-names = "default";
	};
};

// &adc1 {
// 	pinctrl-0 = <&adc_in4_pf6>;
@@ -234,24 +257,3 @@ zephyr_udc0: &usbotg_fs {
		int3-4-conf-io = <0x01>;
    };
};
 No newline at end of file

// &lptim1 {
// 	clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000008>,
// 		 <&rcc STM32_SRC_LSI LPTIM1_SEL(2)>;
// 	status = "okay";
// };

// &timers2 {
// 	status = "okay";
// };

// &timers5 {
// 	status = "okay";
// 	&pwm5 {
// 		status = "okay";
// 		pinctrl-0 = <&tim5_ch1_ph10
// 					 &tim5_ch2_ph11
// 					 &tim5_ch3_ph12>;
// 		pinctrl-names = "default";
// 	};
// };
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ toolchain:
  - gnuarmemb
  - xtools
ram: 192
flash: 512
flash: 1024
supported:
  - counter
  - gpio
+13 −4
Original line number Diff line number Diff line
@@ -13,9 +13,6 @@ CONFIG_HW_STACK_PROTECTION=n
# enable GPIO
CONFIG_GPIO=y

#CAN
CONFIG_CAN_DEFAULT_BITRATE=1000000

# Enable UART console
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
@@ -25,11 +22,14 @@ CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y

CONFIG_SPI=y
CONFIG_SPI_STM32_DMA=y

CONFIG_DMA=y

CONFIG_FPU=y

CONFIG_PWM=y

CONFIG_SENSOR=y
CONFIG_BMI08X=y
# CONFIG_BMI08X_ACCEL_TRIGGER_NONE is not set
@@ -45,3 +45,12 @@ CONFIG_BMI08X_GYRO_TRIGGER_NONE=n
CONFIG_BMI08X_GYRO_THREAD_PRIORITY=10
CONFIG_BMI08X_GYRO_THREAD_STACK_SIZE=2048
CONFIG_BMI08X_I2C_WRITE_BURST_SIZE=16

CONFIG_IMU_PWM_TEMP_CTRL=y

CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

CONFIG_FLASH_PAGE_LAYOUT=y
 No newline at end of file
+5 −1
Original line number Diff line number Diff line
@@ -18,3 +18,7 @@ add_subdirectory_ifdef(CONFIG_MOTOR_DM pid)
add_subdirectory_ifdef(CONFIG_ARES_SBUS transfer)

add_subdirectory_ifdef(CONFIG_CHASSIS chassis)

if(CONFIG_IMU_PWM_TEMP_CTRL AND NOT CONFIG_MOTOR_DJI AND NOT CONFIG_MOTOR_MI AND NOT CONFIG_MOTOR_DM)
    add_subdirectory(pid)
endif()
 No newline at end of file
Loading