fix slow moving motor and start led color after controller pcb install

This commit is contained in:
interfisch 2020-06-27 13:42:22 +02:00
parent 23970ff6aa
commit 8d57a293d9
1 changed files with 8 additions and 8 deletions

View File

@ -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<leds.numPixels();i++){ //set color of all leds
leds.setPixelColor(i, leds.Color(100,100,100));
leds.setPixelColor(i, leds.Color(20,20,0));
}
leds.show();