tune pid parameters

This commit is contained in:
interfisch 2020-05-03 13:35:41 +02:00
parent 8387291255
commit d53044a4e1
1 changed files with 5 additions and 5 deletions

View File

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