From 8d57a293d9d79bba829e19a09c1eb156f7da181b Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 27 Jun 2020 13:42:22 +0200 Subject: [PATCH] fix slow moving motor and start led color after controller pcb install --- .../mixercontroller_w5100_pio/src/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/controller/mixercontroller_w5100_pio/src/main.cpp b/controller/mixercontroller_w5100_pio/src/main.cpp index 17d7ced..ec8beea 100644 --- a/controller/mixercontroller_w5100_pio/src/main.cpp +++ b/controller/mixercontroller_w5100_pio/src/main.cpp @@ -104,8 +104,8 @@ int _motormove; #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.5 //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 @@ -135,17 +135,17 @@ 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=1.0; -float motorI=0.05; +float motorP=2.0; +float motorI=0.1; float motorD=-1; float potidifference_integral=0; //#define MOTORI_ANTIWINDUP 100 //maximum value for (potidifference_integral*motorI). time depends on INTERVAL_MOTORCHECK #define MOTOR_ANTIWINDUP -#define MOTOR_ANTIWINDUP_RANGE 100 //0 to 1024 -//Motor starts moving at about speed=80 +#define MOTOR_ANTIWINDUP_RANGE 150 //0 to 1024 +//Motor starts moving at about speed=80 (without filter caps) long last_potidifferenceLow=0; -#define DEADZONETIMEUNTILREACHED 250 //time [ms] poti read value has to be inside of deadzone to set reachedposition flag (and stop regulating) +#define DEADZONETIMEUNTILREACHED 100 //time [ms] poti read value has to be inside of deadzone to set reachedposition flag (and stop regulating) //Menu system @@ -174,7 +174,7 @@ void setup() { leds.begin(); leds.clear(); for(uint8_t i=0;i