diff --git a/application/chassis/chassis.c b/application/chassis/chassis.c index 39bf046..0bbd0b0 100644 --- a/application/chassis/chassis.c +++ b/application/chassis/chassis.c @@ -62,16 +62,16 @@ void ChassisInit() .can_init_config.can_handle = &hcan1, .controller_param_init_config = { .speed_PID = { - .Kp = 10, // 4.5 - .Ki = 0, // 0 - .Kd = 0, // 0 + .Kp = 17, // 4.5 + .Ki = 3, // 0 + .Kd = 0.02f, // 0 .IntegralLimit = 3000, .Improve = PID_Trapezoid_Intergral | PID_Integral_Limit | PID_Derivative_On_Measurement, .MaxOut = 12000, }, .current_PID = { - .Kp = 0.4, // 0.4 - .Ki = 0, // 0 + .Kp = 0.4f, // 0.4 + .Ki = 0.1f, // 0 .Kd = 0, .IntegralLimit = 3000, .Improve = PID_Trapezoid_Intergral | PID_Integral_Limit | PID_Derivative_On_Measurement, diff --git a/application/cmd/robot_cmd.c b/application/cmd/robot_cmd.c index 416f575..3937c50 100644 --- a/application/cmd/robot_cmd.c +++ b/application/cmd/robot_cmd.c @@ -172,9 +172,9 @@ static void RemoteControlSet() auto_aim(&aim_select, &trajectory_cal, vision_recv_data); - gimbal_cmd_send.yaw = trajectory_cal.cmd_yaw * 180 / PI; + gimbal_cmd_send.yaw = -trajectory_cal.cmd_yaw * 180 / PI; - gimbal_cmd_send.pitch = trajectory_cal.cmd_pitch * 180 / PI; + gimbal_cmd_send.pitch = -trajectory_cal.cmd_pitch * 180 / PI; float yaw_err = fabsf(trajectory_cal.cmd_yaw - gimbal_cmd_send.yaw); if (yaw_err <= 0.008) //3εΊ¦ diff --git a/application/gimbal/gimbal.c b/application/gimbal/gimbal.c index 7d29f37..900d6b0 100644 --- a/application/gimbal/gimbal.c +++ b/application/gimbal/gimbal.c @@ -26,9 +26,9 @@ void GimbalInit() }, .controller_param_init_config = { .angle_PID = { - .Kp = 30, // 8 + .Kp = 200, // 8 .Ki = 0, - .Kd = 1, + .Kd = 6, .DeadBand = 0.1, .Improve = PID_Trapezoid_Intergral | PID_Integral_Limit | PID_Derivative_On_Measurement, .IntegralLimit = 100,