damiao motor driver init_1

This commit is contained in:
Zorua
2026-03-15 12:52:05 +08:00
committed by guoxy06
parent 9d4e103a01
commit 4b17e1e193
7 changed files with 53 additions and 54 deletions

View File

@@ -66,7 +66,7 @@ void GimbalInit()
Motor_Init_Config_s pitch_config = {
.can_init_config = {
.can_handle = &hcan2,
.tx_id = 2,//2
.tx_id = 4,//2
},
.controller_param_init_config = {
.angle_PID = {
@@ -79,20 +79,12 @@ void GimbalInit()
},
.speed_PID = {
.Kp = 50, // 50
.Ki = 175, // 350
.Ki = 350, // 350
.Kd = 0, // 0
.Improve = PID_Trapezoid_Intergral | PID_Integral_Limit | PID_Derivative_On_Measurement,
.IntegralLimit = 2500,
.MaxOut = 12000,
.MaxOut = 20000,
},
// .current_PID = { // 添加current_PID配置
// .Kp = 0,
// .Ki = 0,
// .Kd = 0,
// .Improve = PID_Integral_Limit,
// .IntegralLimit = 5000,
// .MaxOut = 15000,
// },
.other_angle_feedback_ptr = &gimba_IMU_data->Pitch,
// 还需要增加角速度额外反馈指针,注意方向,ins_task.md中有c板的bodyframe坐标系说明
.other_speed_feedback_ptr = (&gimba_IMU_data->Gyro[0]),
@@ -103,7 +95,6 @@ void GimbalInit()
.outer_loop_type = ANGLE_LOOP,
.close_loop_type = SPEED_LOOP | ANGLE_LOOP,
.motor_reverse_flag = MOTOR_DIRECTION_NORMAL,
.feedback_reverse_flag = FEEDBACK_DIRECTION_REVERSE,
},
.motor_type = DM4310,
};