{$cfg_webname}
主页 > 电子信息 > 单片机 >

基于STM32的两轮自平衡小车

来源:56doc.com  资料编号:5D27072 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D27072
资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 帮助
资料介绍

基于STM32的两轮自平衡小车(论文12800字)
摘要
随着科学技术的进步,交通工具正逐渐朝着环保、节能、娱乐、便捷性的方向发展,而自平衡车因其绿色环保且便于出行,受到了人们越来越多的关注。
本文就此提出了一个以STM32为主控芯片的双轮平衡车的控制系统方案。我设计的两轮车是左右对称,自然状态下是不能直立的,需要通过编程获取姿态信息,再通过相关公式及双闭环的控制算法得到PWM脉波输出,以此控制电机实现平衡。平衡车的核心控制器采用STM32,它和直流电机驱动模块、电源模块、姿态检测模块和遥控等模块组成整个硬件系统。平衡车软件系统主要实现对各传感器的数据采集和融合滤波,采用双闭环PID控制算法实现对车辆直立状态的维持和运行速度的实时控制,实现车体的平衡。
测试结果表明,本文设计的控制系统达到了开始的预期要求,再根据调试的情况对参数做了改善,基本达到最终的设计要求。
关键词:双轮平衡车控制系统  STM32  MPU6050  PID算法

Abstract
With the advance of science and technology, transport is stepping towards energy conservation, environmental protection, convenient and entertaining direction. Since the first balancing robot Segway was invented,because of the environmental protection and convenience of the balancing car,it has been of great concern more and more.
this article mainly introduces the balance of the two-wheeled balancing vehicle control system design scheme. the structure of two-wheelers are arranged symmetrically, it can’t remain upright in the natural state. So it’s required to get information of posture through programming, and then output PWM pulse width through the double-loop control algorithm and correlation equation to adjust the output control of the motor rotion and speed, thus the two-wheelers could be balanced. the STM32 is the core controller, on the basis of interface circuit board of increasing the hardware system, including DC motor control module, power management module, the attitude angle feedback module, man-machine interaction module. The balancing-car software system is to get each sensor data and fusion filtering, and achieving the state of the upright vehicle and maintain real-time control speed through dual closed-loop PID control algorithm, finally it could be balanced.
Testing results show that the designing control system achieve basic requirments. then according to results of debugging, the situation of the whole system has be modified, finally it meet the design requirements.
Key Words:Control system of two-wheeled vehicle;STM32;MPU6050;PID control algorith

 

基于STM32的两轮自平衡小车


目录
摘要    I
Abstract    II
第一章  绪论    1
1.1 平衡车概述    1
1.2 国内外对两轮平衡车的研究现状    1
1.3 课题的研究内容与目的    2
1.4 下文章节结构    3
第二章  平衡车的平衡原理    4
2.1 两轮平衡车任务分解    4
2.2 小车平衡控制    4
2.3 本章小结    5
第三章  平衡车控制系统硬件设计    6
3.1 控制系统硬件总体设计方案    6
3.2 MPU6050模块设计    7
3.2.1 MPU6050芯片    7
3.2.2 MPU6050的硬件设计    7
3.3 电机及其驱动模块    8
3.3.1 电机及上面的编码器    8
3.3.2 电机驱动芯片硬件设计    9
3.4 电源模块设计    10
3.5 主控制器STM32F103ZE    11
3.5.1 STM32简介    12
3.5.2 STM32串口参数分析与设计    13
3.5.3 STM32中断参数分析与设计    14
3.6 蓝牙模块设计    15
3.7 本章小节    16
第四章  平衡车控制系统软件设计    17
4.1 控制系统软件总体设计方案    17
4.2 模块初始化及部分程序详解    18
4.2.1 GPIO口的初始化    18
4.2.2 串口的初始化    18
4.2.3 I2C初始化    19
4.2.4 MPU6050的初始化    21
4.2.5 MPU6050-DMP数字运算处理    22
4.3 控制算法设计    22
4.3.1 姿态角控制    23
4.3.2 速度控制    23
4.3.3 PID参数整定步骤    24
4.4 本章小节    24
第五章  双轮平衡小车的系统调试    25
5.1 上位机及姿态传感器调试    25
5.2 直立控制调试    27
5.3 速度控制调试    27
5.4 方向控制调试    28
5.5 本章小节    28
参考文献    29
致谢    30

推荐资料