对两轮自平衡小车进行分析,建立了对应的动力学模型,为后续的系统实现提供原理和方向。控制系统采用STM32F103C8T6作为主控芯片,利用MPU6050作为姿态传感器测量小车姿态角,通过卡尔曼滤波进行数据融合,获取姿态角的最优估计。通过PID控制算法输出合适的PWM波来控制电机的转速,构建双闭环控制来保持小车的平衡性,并且可以使用蓝牙模块连接手机进行遥控。经实验证明,该方法可以使小车具有良好的平衡性,能够有效控制小车的运行。
Abstract
In this paper,the analysis of the two-wheeled self-balancing trolley is carried out,the corresponding dynamic model is established,and the principle and direction for the subsequent system implementation are provided.The control system uses STM32F103C8T6 as the main control chip,uses MPU6050 as the attitude sensor to measure the attitude angle of the car,and performs data fusion through Kalman filtering to obtain the optimal estimation of the attitude angle.Then output the appropriate PWM wave through the PID control algorithm to control the speed of the motor,build a double closed-loop control to maintain the balance of the car,and can use the Bluetooth module to connect to the mobile phone for remote control.The experiment results show that this method can make the trolley have good balance and can effectively control the operation of the trolley.
关键词
PID /
卡尔曼滤波 /
两轮自平衡小车 /
STM32F103C8T6 /
MPU6050
Key words
PID /
Kalman filter /
two-wheeled self-balancing trolley /
STM32F103C8T6 /
MPU6050
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
参考文献
[1] 杨凌霄,李晓阳.基于卡尔曼滤波的两轮自平衡车姿态检测方法[J].计算机仿真,2014,31(6):406-409.
[2] 刘春阳,刘幸,杨曼,等.两轮自平衡小车的系统设计与实现[J].测控技术,2018,37(2):70-74.
[3] 王振运.基于RT-Thread和STM32的双轮自平衡机器人的设计与实现[D].太原:中北大学,2016.
[4] 王建平,卢杉,武欢欢.TB6612FNG在直流电机控制设计中的应用[J].电子设计工程,2010,18(6):65-67.
[5] 赵映川.编码器原理与应用分析[J].无线互联科技,2018,15(22):67-69,78.
[6] 邓洪明,贺勇,於小杰,等.卡尔曼滤波在无人机姿态中的应用研究[J].自动化技术与应用,2019,38(11):1-4.
[7] 沈跃杰,行鸿彦,王水璋.基于粒子群优化的串级模糊PID无人机飞行控制系统[J].电子测量技术,2022,45(1):96-103.