From 3f2727464bad798e4e8dde627c184dc7f25e5b6e Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:03:43 -0400 Subject: [PATCH] initial pidf tunings --- lib/Romi32U4Motors/src/Romi32U4MotorTemplate.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Romi32U4Motors/src/Romi32U4MotorTemplate.h b/lib/Romi32U4Motors/src/Romi32U4MotorTemplate.h index afdb82a..ac56a29 100644 --- a/lib/Romi32U4Motors/src/Romi32U4MotorTemplate.h +++ b/lib/Romi32U4Motors/src/Romi32U4MotorTemplate.h @@ -25,14 +25,17 @@ protected: volatile CTRL_MODE ctrlMode = CTRL_DIRECT; // TODO: After you tune your motors, set the gains here. - float Kp = 1; - float Ki = 0; + float Kp = 2.50; + float Ki = 0.03; float Kd = 0; - float Kf = 0; + float Kf = 3.00; // Used to keep track of the target speed, in counts / interval. float targetSpeed = 0; + // maximum accelration in counts/interval + float TRAPEZOIDAL_RAMP_RATE = 0; + /** * This is the speed of the motor, in "encoder counts / encoder interval". * The encoder interval is set in Robot::InitializeMotorControlTimer.