From 35abe8b52998431023a207ccc2755719bf219aa6 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Thu, 14 May 2026 15:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=B6=E4=BB=96=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=BE=85=E5=90=88=E3=80=91PID=E6=96=87=E4=BB=B6bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/BASE/Src/MSP/{msp_PID.c => msp_PID_1.c} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/{msp_PID.c => msp_PID_1.c} (98%) diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_PID.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_PID_1.c similarity index 98% rename from diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_PID.c rename to diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_PID_1.c index bd38ed1..9efa26f 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_PID.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_PID_1.c @@ -43,8 +43,8 @@ void GF_MSP_PID_Now_Der_adj_Com_Weld(double Current_Angle, double Desire_Angle_I /* 将角度归一化到 [-180, 180) */ static float normalize_angle(float angle) { - while (angle >= 180.0f) angle -= 360.0f; - while (angle < -180.0f) angle += 360.0f; + if (angle >= 180.0f) angle -= 360.0f; + else if (angle < -180.0f) angle += 360.0f; return angle; }