From 10c7da1107db9b2df834fe1279cf825630e371d5 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 29 May 2025 13:45:28 +0300 Subject: [PATCH] update pid default parameters --- controller/fw/embed/src/config.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/controller/fw/embed/src/config.cpp b/controller/fw/embed/src/config.cpp index 5084cf0..ceda4b6 100644 --- a/controller/fw/embed/src/config.cpp +++ b/controller/fw/embed/src/config.cpp @@ -45,13 +45,15 @@ void setup_foc(MagneticSensorAS5045 *encoder, BLDCMotor *motor, motor->foc_modulation = FOCModulationType::SpaceVectorPWM; // PID Configuration - motor->PID_velocity.P = 0.75f; - motor->PID_velocity.I = 20.0f; - motor->LPF_velocity.Tf = 0.005f; + motor->PID_velocity.P = 0.5f; + motor->PID_velocity.I = 2.0f; + motor->PID_velocity.D = 0.0f; + + motor->LPF_velocity.Tf = 0.01f; motor->P_angle.P = p; motor->P_angle.I = i; motor->P_angle.D = d; - motor->LPF_angle.Tf = 0.001f; + motor->LPF_angle.Tf = 0.02f; // Motor limits motor->velocity_limit = 40; // Speed limit in rad/s (382 rpm)