From adb0aa79a709ff81ade7f8663a600e87031ec1ea Mon Sep 17 00:00:00 2001 From: George_Andreou Date: Fri, 27 Jun 2025 23:39:52 +0300 Subject: [PATCH] Update constants. Possibly the final one. --- pid-example/pid-example.ino | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pid-example/pid-example.ino b/pid-example/pid-example.ino index a120faf..1f47585 100644 --- a/pid-example/pid-example.ino +++ b/pid-example/pid-example.ino @@ -4,9 +4,9 @@ QTRSensors qtr; const uint8_t SensorCount = 8; uint16_t sensorValues[SensorCount]; -float Kp = 0.09; //set up the constants value -float Ki = 0.0009; -float Kd = 0.3; +float Kp = 0.085; //set up the constants value +float Ki = 0.00004; +float Kd = 0.65; int P; int I; int D; @@ -15,14 +15,14 @@ int lastError = 0; boolean onoff = false; //Increasing the maxspeed can damage the motors - at a value of 255 the 6V motors will receive 7,4 V -const uint8_t maxspeeda = 150; -const uint8_t maxspeedb = 150; +const uint8_t maxspeeda = 125; +const uint8_t maxspeedb = 125; const uint8_t basespeeda = 100; const uint8_t basespeedb = 100; // adding minspeed so it can reverse -const int minspeeda = -150; -const int minspeedb = -150; +const int minspeeda = -125; +const int minspeedb = -125; //Set up the drive motor carrier pins int mode = 8;