change pid values to be faster

This commit is contained in:
interfisch 2020-04-26 11:56:22 +02:00
parent 01f1a36196
commit 28ae775fc3
1 changed files with 6 additions and 6 deletions

View File

@ -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;