基于stm32单片机两轮平衡车【字数:16233】

随着新型信息技术的发展,机动车越来越普遍,这就使道路负荷增加,交通时常瘫痪,早晚高峰问题日益突出。同时,汽车尾气造成的环境问题也日趋严重。于是人们开始寻找一种便携的交通工具,而此时低能耗、无污染、轻便快捷的二轮自平衡车进入人们的视线,并且迅速成为备受大家青睐的新式交通工具。因此本文重点对二轮自平衡小车进行研究。本次设计研究了一个二轮小车模型,通过采用STM32单片机为控制核心,MPU6050姿态采集传感器测量小车倾角,TB6612FNG电机驱动来驱动电机正反转,通过蓝牙模块实现小车与人之间建立联系,来实现小车的自平衡功能。软件部分,将MPU6050姿态采集传感器采集到的倾角进行卡尔曼滤波,通过PID算法控制电机的方向和转速,实现小车的自平衡。通过实际调试,小车可以完成自平衡和自动跟随功能,但尚有不足,需要完善。
目 录
一、绪论 2
(一)研究背景及意义 2
(二)国外研究现状 3
(三)国内研究动态 4
(四)本文主要研究内容 5
二、小车的控制原理及结构 5
(一)二轮自平衡车控制原理 5
(二)小车自平衡基本原理 5
(三)小车力学模型的建立 7
(四)小车的机械结构 8
(五)小车整体结构 8
(六)小车供电系统 9
(七)本章小结 9
三、二轮自平衡车硬件设计 10
(一)系统整体硬件框图 10
(二)系统整体组成 10
(三)主控制电路 10
(四)供电电路 11
(五)MPU6050姿态传感器 12
(六)TB6612FNG驱动模块 14
(七)GB37电机 15
(八)蓝牙模块 16
(九)超声波模块 17
(十)本章小结 18
四、二轮自平衡车软件算法 18
(一)自平衡车总体控制流程 18
(二)MPU6050采集姿态信息 18
(三)加速度测量分析 18
(四)陀螺仪测量分析 21
(五)滤波器设计 23
 *好棒文|www.hbsrm.com +Q: ^351916072^ 
六)互补滤波融合算法 23
(七)卡尔曼滤波简介 24
(八)卡尔曼滤波原理 24
(九)滤波器设计 26
(十)PID算法 26
(十一)PID算法简介 26
(十二)PID控制理论 27
(十三)PID参数整定 27
(十四)本章小结 28
五、软件设计 29
(一)程序设计 29
(二)软件开发环境 29
(三)主程序 29
(四)姿态采集子程序 30
(五)滤波程序 31
六、实物测试 32
(一)本章小结 34
七、结论 34
参考文献 36
附录1 总原理图 38
附录2 源代码 39
Abstract: With the development of new information technology, motor vehicles are becoming more and more common, which makes the road load increases, traffic is often paralyzed, sooner or later peak problems become increasingly prominent. At the same time, the environmental problems caused by automobile exhaust are becoming more and more serious. So people began to find a portable means of transport, and at this time lowpower, pollutionfree, light and fast twowheel selfbalancing car into the peoples attention, and quickly become much favored by the new means of transport. Therefore, this paper focuses on the second round of selfbalancing car to study.
This design has studied a twowheel car model, through the use of STM32 microcontroller as the control core, MPU6050 attitude sensor to measure the car tilt, TB6612FNG motor drive to drive the motor is reversing, through the Bluetooth module to establish contact between the car To achieve the cars selfbalancing function.
Software part, The MPU6050 tilt sensor is filtered by Kalman filter, and the PID algorithm is used to control the direction and speed of the motor to realize the self balancing of the car.
Through the actual debugging, the car can complete the selfbalancing and automatic follow function, but there are still insufficient, need to improve.

版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/dzxx/txgc/240.html

好棒文