tune pid parameters
This commit is contained in:
parent
8387291255
commit
d53044a4e1
|
@ -128,20 +128,20 @@ int potidifference=0; //gets overwritten at start of each motorcheck
|
||||||
|
|
||||||
//Motorcheck
|
//Motorcheck
|
||||||
long last_motorcheck=0;
|
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 poti_read_last=0;
|
||||||
//int motor_vel=0; //analog read units per second //TODO: reintroduce into code or remove
|
//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 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
|
//#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
|
//long last_motorTooSlow=0; //typically 0
|
||||||
|
|
||||||
float motorP=2.0;
|
float motorP=1.0;
|
||||||
float motorI=0.2;
|
float motorI=0.05;
|
||||||
float motorD=1;
|
float motorD=-1;
|
||||||
float potidifference_integral=0;
|
float potidifference_integral=0;
|
||||||
//#define MOTORI_ANTIWINDUP 100 //maximum value for (potidifference_integral*motorI). time depends on INTERVAL_MOTORCHECK
|
//#define MOTORI_ANTIWINDUP 100 //maximum value for (potidifference_integral*motorI). time depends on INTERVAL_MOTORCHECK
|
||||||
#define MOTOR_ANTIWINDUP
|
#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
|
//Motor starts moving at about speed=80
|
||||||
|
|
||||||
long last_potidifferenceLow=0;
|
long last_potidifferenceLow=0;
|
||||||
|
|
Loading…
Reference in New Issue