From 46f1bd51914faac028150fd300806be13207fc26 Mon Sep 17 00:00:00 2001 From: DanTheMan-byte Date: Fri, 28 Nov 2025 18:38:03 -0600 Subject: [PATCH] changes to PID --- .../org/firstinspires/ftc/teamcode/tests/ShooterTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tests/ShooterTest.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tests/ShooterTest.java index 385086e..ad74f2e 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tests/ShooterTest.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/tests/ShooterTest.java @@ -59,6 +59,9 @@ public class ShooterTest extends LinearOpMode { double stamp = 0.0; + public static double kP = 0.01; // small proportional gain (tune this) + public static double maxStep = 0.2; // prevents sudden jumps + MultipleTelemetry TELE; @Override @@ -138,10 +141,10 @@ public class ShooterTest extends LinearOpMode { if (powPID > 1.0){ powPID = 1.0; } - double feed = kF * parameter; // Example: vel=2500 → feed=0.5 + double feed = kF * vel; // Example: vel=2500 → feed=0.5 // --- PROPORTIONAL CORRECTION --- - double error = parameter - velocity; + double error = vel - velo1; double correction = kP * error; // limit how fast power changes (prevents oscillation)