improved moveControl

This commit is contained in:
2021-04-01 20:59:04 +02:00
parent fd44f84738
commit d9e64fbc4a
+11 -8
View File
@@ -22,18 +22,21 @@
#define BACKWARD 2 #define BACKWARD 2
//MotorControl config //MotorControl config
#define RUN_MOTOR_CONTROL_DELAY 300 // Normal 50 ? #define RUN_MOTOR_CONTROL_DELAY 20 // Normal 10
#define PWM_FREQ 16000 #define PWM_FREQ 16000
#define PWM_RES 8 #define PWM_RES 8
#define PWM_CHANNEL_M1 0 #define PWM_CHANNEL_M1 0
#define PWM_CHANNEL_M2 1 #define PWM_CHANNEL_M2 1
#define UPDATE_TIME 25 #define SPEED_STEPS 2 // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms
#define SPEED_STEPS 5 // A total of 20 levels ( 100 / SPEED_STEPS ) * UPDATE_TIME = 500ms #define PWM_MIN 120
#define PWM_MIN 150
#define PWM_MAX 245 // Max 98% of 2^PWM_RES #define PWM_MAX 245 // Max 98% of 2^PWM_RES
//Encoder config //Speedometer config
#define RUN_SPEEDOMETER_DELAY 500 // Normal 10 untested #define RUN_SPEEDOMETER_DELAY 30 // Normal 30 untested
#define ENC_FILTER 2400 #define ENC_FILTER 1023 // 1023 is max
#define ENC_STEPS 1024 #define ENC_STEPS 1024
#define WHEEL_DIAMETER 0.1263 //meter #define WHEEL_DIAMETER 0.1263 //meter
#define BUF_SIZE 40
//MoveControl config
#define RUN_MOVE_CONTROL_DELAY 600 // Normal 10 untested