Based on the Design of the STM32 Self-Balancing Trolley
摘要
Taking the STM32F103C8T6 chip of Cortex-M3 core as the main control unit of the CPU, a coding device is placed on the wheel to detect the actual position, speed, and direction data of the wheel, the angular velocity value and acceleration amount of the body are detected by using the six-axis gyroscope and accelerometer MPU6050 module, and the angle is obtained by triangulation of the obtained acceleration value, and then combined with the Kalman filter algorithm to combine the angle with the angular velocity value of the gyroscope data to obtain the final vehicle inclination. Finally, the proportional differential controller is used to realize the self-balancing control of the two-wheeler. The entire control process is realized by cascade PID, and the TB6612 chip is used to adjust the duty cycle of the PWM output to change the motor speed. Finally, through the adjustment and optimization of control parameters, the self-balancing of the trolley is realized (Eason and Sneddon in Phil Trans Roy Soc London A247:529–551, 1955).