Commit 87662696 authored by ttwards's avatar ttwards
Browse files

Accuator basicly done, but has lots of problems to solve

parent d7c7e899
Loading
Loading
Loading
Loading
+33 −63
Original line number Diff line number Diff line
@@ -66,86 +66,56 @@
				can_device = <&can2>;
		};
	};
    motor {
    rm_motor {
		motor0: motor0{
			compatible = "dji,m3508";
			k_p = <100>;
			k_i = <10000>;
			k_d = <3000>;
			tx_addr = <0x200>;
			rx_addr = <0x201>;
			gear_ratio = <1900>;
			label = "Motor0";
			status = "okay";
			can_channel = <&canbus1>;
			controllers = <&angle_pid &speed_pid &torque_pid>;
			capabilities = [00 01 02];
		};

		// motor1: motor1{
		// 	compatible = "dji,gm6020";
		// 	k_p = <100>;
		// 	k_i = <10000>;
		// 	k_d = <3000>;
		// 	tx_addr = <0x1FF>;
		// 	rx_addr = <0x202>;
		// 	gear_ratio = <1900>;
		// 	label = "Motor0";
		// 	status = "okay";
		// 	can_channel = <&canbus1>;
		// };
	};

		motor1: motor1{
			compatible = "dji,m3508";
			k_p = <100>;
			k_i = <10000>;
			k_d = <3000>;
			tx_addr = <0x200>;
			rx_addr = <0x202>;
			gear_ratio = <1900>;
			label = "Motor0";
			status = "okay";
			can_channel = <&canbus1>;
		};

		motor2: motor2{
			compatible = "dji,m3508";
			k_p = <100>;
			k_i = <10000>;
			k_d = <3000>;
			tx_addr = <0x200>;
			rx_addr = <0x203>;
			gear_ratio = <1900>;
			label = "Motor0";
			status = "okay";
			can_channel = <&canbus1>;
		};

		motor3: motor3{
			compatible = "dji,m3508";
	pid {
		torque_pid: torque_pid {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = <100>;
			k_i = <10000>;
			k_d = <3000>;
			tx_addr = <0x200>;
			rx_addr = <0x204>;
			gear_ratio = <1900>;
			label = "Motor0";
			status = "okay";
			can_channel = <&canbus1>;
			k_i = <0>;
			k_d = <0>;
		};

		motor4: motor4{
			compatible = "dji,m3508";
		angle_pid: angle_pid {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = <100>;
			k_i = <10000>;
			k_d = <3000>;
			tx_addr = <0x200>;
			rx_addr = <0x205>;
			gear_ratio = <1900>;
			label = "Motor0";
			status = "okay";
			can_channel = <&canbus1>;
			k_i = <0>;
			k_d = <0>;
		};

		motor5: motor5{
			compatible = "dji,m3508";
		speed_pid: speed_pid {
			#controller-cells = <0>;
			compatible = "pid,single";
			k_p = <100>;
			k_i = <10000>;
			k_d = <3000>;
			tx_addr = <0x200>;
			rx_addr = <0x206>;
			gear_ratio = <1900>;
			label = "Motor0";
			status = "okay";
			can_channel = <&canbus1>;
			k_i = <0>;
			k_d = <0>;
		};
	};

};

&clk_lsi {
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@
# add_definitions(-D__ZEPHYR_SUPERVISOR__)

add_subdirectory_ifdef(CONFIG_MOTOR_M3508 motor)
add_subdirectory_ifdef(CONFIG_MOTOR_M3508 pid)
 No newline at end of file
+252 −141

File changed.

Preview size limit exceeded, changes collapsed.

+62 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
static const struct motor_driver_api motor_api_funcs = {
    .motor_get_speed = dji_get_speed,
    .motor_set_speed = dji_set_speed,
    .motor_set_torque = dji_set_torque,
    .motor_set_angle = dji_set_angle,
    .motor_get_torque = dji_get_torque,
};

Loading