From 8be769bf3f2e702e10cccb84b054ee7a22f7659a Mon Sep 17 00:00:00 2001 From: Zhou Chujie Date: Thu, 1 Feb 2024 21:43:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E7=9E=84=E6=B5=8B=E8=AF=95=E3=80=81?= =?UTF-8?q?=E4=BA=91=E5=8F=B0=E5=BA=95=E7=9B=98PID=E7=B2=97=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chassis/chassis.c | 10 +++++----- application/cmd/robot_cmd.c | 4 ++-- application/gimbal/gimbal.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) 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,