From d53044a4e1342650ff026e9241f2254b7102c4de Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 3 May 2020 13:35:41 +0200 Subject: [PATCH] tune pid parameters --- controller/mixercontroller_w5100_pio/src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controller/mixercontroller_w5100_pio/src/main.cpp b/controller/mixercontroller_w5100_pio/src/main.cpp index 6af1624..27eb0f0 100644 --- a/controller/mixercontroller_w5100_pio/src/main.cpp +++ b/controller/mixercontroller_w5100_pio/src/main.cpp @@ -128,20 +128,20 @@ int potidifference=0; //gets overwritten at start of each motorcheck //Motorcheck long last_motorcheck=0; -#define INTERVAL_MOTORCHECK 50 //check motor movement every x ms +#define INTERVAL_MOTORCHECK 25 //check motor movement every x ms //int poti_read_last=0; //int motor_vel=0; //analog read units per second //TODO: reintroduce into code or remove //#define MINIMUM_MOTORVEL 20 //minimum velocity motor should turn wenn active //#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.2; -float motorD=1; +float motorP=1.0; +float motorI=0.05; +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 200 //0 to 1024 +#define MOTOR_ANTIWINDUP_RANGE 100 //0 to 1024 //Motor starts moving at about speed=80 long last_potidifferenceLow=0;