修复INS_Task双重循环NAN的问题,暂时关闭了急停模式

This commit is contained in:
NeoZng
2022-12-08 23:08:28 +08:00
parent fe85ae5a6e
commit 9f09002235
8 changed files with 101 additions and 94 deletions

View File

@@ -62,10 +62,14 @@ void ChassisInit()
.can_init_config.can_handle=&hcan2,
.controller_param_init_config = {
.speed_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
.current_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
},
.controller_setting_init_config = {

View File

@@ -26,12 +26,14 @@ void GimbalInit()
},
.controller_param_init_config = {
.angle_PID = {
.Kd = 10,
.Ki = 1,
.Kd = 2,
.Kd = 1,
.Ki = 0,
.Kd = 0,
},
.speed_PID = {
.Kd = 1,
.Ki = 0,
.Kd = 0,
},
.other_angle_feedback_ptr = &Gimbal_IMU_data->YawTotalAngle,
// 还需要增加角速度额外反馈指针
@@ -58,7 +60,9 @@ void GimbalInit()
.Kd = 2,
},
.speed_PID = {
.Kd = 1,
.Ki = 0,
.Kd = 0,
},
.other_angle_feedback_ptr = &Gimbal_IMU_data->Pitch,
// 还需要增加角速度额外反馈指针
@@ -71,8 +75,8 @@ void GimbalInit()
.close_loop_type = ANGLE_LOOP | SPEED_LOOP,
.reverse_flag = MOTOR_DIRECTION_REVERSE,
},
.motor_type = GM6020};
.motor_type = GM6020,
};
// 电机对total_angle闭环,上电时为零,会保持静止,收到遥控器数据再动
yaw_motor = DJIMotorInit(&yaw_config);
pitch_motor = DJIMotorInit(&pitch_config);

View File

@@ -28,16 +28,15 @@ void ShootInit()
.tx_id = 1,
},
.controller_param_init_config = {
.angle_PID = {
.Kd = 10,
.Ki = 1,
.Kd = 2,
},
.speed_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
.current_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
},
.controller_setting_init_config = {
@@ -56,16 +55,15 @@ void ShootInit()
.tx_id = 2,
},
.controller_param_init_config = {
.angle_PID = {
.Kd = 10,
.Ki = 1,
.Kd = 2,
},
.speed_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
.current_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
},
.controller_setting_init_config = {
@@ -90,13 +88,19 @@ void ShootInit()
.Kd = 2,
},
.angle_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
.speed_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
.current_PID = {
.Kp=1,
.Ki=0,
.Kd=0,
},
},
.controller_setting_init_config = {