damiao motor driver init

This commit is contained in:
Zorua
2026-03-14 18:55:54 +08:00
committed by guoxy06
parent 082bf3199a
commit 9d4e103a01
4 changed files with 40 additions and 117 deletions

View File

@@ -79,12 +79,20 @@ void GimbalInit()
},
.speed_PID = {
.Kp = 50, // 50
.Ki = 350, // 350
.Ki = 175, // 350
.Kd = 0, // 0
.Improve = PID_Trapezoid_Intergral | PID_Integral_Limit | PID_Derivative_On_Measurement,
.IntegralLimit = 2500,
.MaxOut = 20000,
.MaxOut = 12000,
},
// .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]),
@@ -95,6 +103,7 @@ 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,
};