Add motor speed control

This commit is contained in:
root 2022-03-21 22:37:13 +00:00
parent 1a488065ac
commit 5d8df998ae
5 changed files with 138 additions and 44 deletions

View file

@ -15,6 +15,11 @@
#define MOTOR_MAX_DELTA_TIME_S 0.1L
#define MOTOR_FILTER_ALPHA 0.05L
#define MOTOR_FILTER_RESET_DELAY_US (1000 * 10)
#define MOTOR_SPEED_CONTROL_RESET_DELAY_S 0.01L
#define MOTOR_SPEED_CONTROL_LOOP_HZ 150
#define MOTOR_SPEED_CONTROL_KP 0.5L
#define MOTOR_SPEED_CONTROL_KI 5.0L
#define MOTOR_SPEED_CONTROL_KD 0.025L
#define LEFT_PORT 3
#define RIGHT_PORT 0