From 28ae775fc36e29f6bd8edeef1b5eef8a663f5909 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 26 Apr 2020 11:56:22 +0200 Subject: [PATCH] change pid values to be faster --- controller/mixercontroller_w5100_pio/src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/controller/mixercontroller_w5100_pio/src/main.cpp b/controller/mixercontroller_w5100_pio/src/main.cpp index f9407e3..f876016 100644 --- a/controller/mixercontroller_w5100_pio/src/main.cpp +++ b/controller/mixercontroller_w5100_pio/src/main.cpp @@ -94,8 +94,8 @@ uint8_t motorspeed=0; #define DEADZONE_POTI 10 //maximum allowed error. stop when reached this zone #define POT_MIN 45 //minimum value pot can reach #define POT_MAX 950 //maximum value pot can reach -#define POTIFILTER 0.8 //0 to 1. 1 means old value stays forever -#define MAX_MOTOR_PWM 192 //0 to 255. Maximum pwm to output +#define POTIFILTER 0.6 //0 to 1. 1 means old value stays forever +#define MAX_MOTOR_PWM 255 //0 to 255. Maximum pwm to output int poti_set; //set value, initial value will be read from poti int poti_read=0; //read value from poti @@ -122,14 +122,14 @@ long last_motorcheck=0; //#define MOTOR_FAILTIME 500 //in ms. if motor did not turn fox x amount of time at least with MINIMUM_MOTORVEL an error will initiate //long last_motorTooSlow=0; //typically 0 -float motorP=2.0; -float motorI=0.1; +float motorP=4.0; +float motorI=0.5; float potidifference_integral=0; -#define MOTORI_ANTIWINDUP 90 //maximum value for (potidifference_integral*motorI). time depends on INTERVAL_MOTORCHECK +#define MOTORI_ANTIWINDUP 200 //maximum value for (potidifference_integral*motorI). time depends on INTERVAL_MOTORCHECK //Motor starts moving at about speed=80 long last_potidifferenceLow=0; -#define DEADZONETIMEUNTILREACHED 500 //time [ms] poti read value has to be inside of deadzone to set reachedposition flag (and stop regulating) +#define DEADZONETIMEUNTILREACHED 250 //time [ms] poti read value has to be inside of deadzone to set reachedposition flag (and stop regulating) //error boolean motorerror=false;