北华大学毕业设计(论文)
摘 要
两轮自平衡小车是移动机器人的一个重要分支,具有体积小、运动灵活、可零半径转弯等诸多优点。并且相对于传统的四轮车,两轮车在直立行走、导航方面对硬件设计、软件开发以及系统调试等提出了更高的要求。
本文设计了一种基于视觉导航的两轮自平衡小车系统,并实现了小车的直立行走、自主寻迹两大功能。系统用飞思卡尔十六位微处理器XS128作为核心控制单元,通过增加各种传感器并编写相应程序以完成平衡控制,速度控制,转向控制和自主寻迹四大任务。
本设计通过对倒立摆动力学模型的分析,得到小车平衡的条件。利用陀螺仪和加速度计获得车体的倾角和角速度,并进行互补滤波,对倾角进行PD控制实现小车的基本直立;通过光电编码器得到车子的速度,通过转向陀螺仪得到转向角速度,对速度进行PI控制,将转速控制信号与平衡控制信号叠加加载到后轮两电机上,实现小车的静止和直立行走;用摄像头获得道路图像信息,进行图像预处理,提取出路径中心线,获得小车的方向偏差控制量,通过对方向控制量和转向角速度进行PD 控制来调节左右两轮的差速实现小车的转向和自主寻迹。本设计利用了串口调试上位机对系统进行实时调试。实践证明,该两轮自平衡车具有很好的静态平衡性能和动态性能,并能在道路上自主寻迹,流畅转弯,且该系统能有效地抵抗外部扰动。
关键词:视觉导航;自平衡;倒立摆;互补滤波;上位机
- 1 -
北华大学毕业设计(论文)
Abstract
Two-wheeled self -balancing vehicle is an important branch of the mobile robot, with a small, flexible movement, can zero turning radius, and many other advantages. And relative to the traditional four cars, two-wheelers in the upright walking, navigation hardware design, software development and system debugging and put forward higher requirements.
This paper has designed a two wheeled self-balanced intelligent car system based on visual navigation, and finally achieved the goal that the car could walk upright stably and run along the racing track. Freescale sixteen microprocessor systems MC9S12XS128 as the core control unit, by adding a variety of sensors and to prepare appropriate procedures to complete the balance control, speed control, steering control and autonomous tracking of the four tasks.
Through this design inverted pendulum dynamics modeling, analog get the car balanced conditions. Then, this system uses gyroscopes and accelerometers to measure the dip angle and angular velocity of the car, and utilizing Complementary Filter to fuse dip angle and angular velocity. PD control inclination is achieved on the basic car upright. Then the design uses photoelectric encoders to obtain the speed of two wheels and steering angular velocity. The speed is controlled by PI controller. The car could keep stationary and upright by combining the speed control signal and dip angle control signal together. The design uses a CCD image sensor to obtain current image information. Through image processing, extracting the track centerline and getting the direction migration information, we get the direction signal, the system could steer and tracing along the road independently by using PD controller. This design develops PC serial debugging host computer for system’s parameters to debug. Practice has proved that the two-wheeled self-balancing vehicle with a good balance of static and dynamic properties, and can be self-tracking on the road, smooth cornering. And the system can effectively resist external perturbations.
Keywords: Visual Navigation; Self-balancing; Inverted Pendulum; Complementary Filter; PC
- 2 -
北华大学毕业设计(论文)
目 录
摘 要 .................................................................................................................................. 1 Abstract ..................................................................................................................................... 2 引 言 .................................................................................................................................. 1 1 视觉导航自平衡小车简介 ................................................................................................. 2
1.1 系统概述.................................................................................................................... 2 1.2 国内外两轮自平衡机器人技术的发展现状 ......................................................... 3
1.2.1 国外的发展 ..................................................................................................... 3 1.2.2 国内的发展 ..................................................................................................... 4 1.3 两轮自平衡机器人技术的发展趋势及前景 ......................................................... 5 2 方案设计与论证 .................................................................................................................. 6
2.1 系统设计.................................................................................................................... 6 2.2 传感器的选择 ........................................................................................................... 6
2.2.1 姿态传感器的选择 ........................................................................................ 6 2.2.2 导航方式及寻迹传感器的选择 ................................................................... 7 2.3 方案论证.................................................................................................................... 8
2.3.1 平衡控制的方案论证 .................................................................................... 8 2.3.2 后轮测速的方案论证 .................................................................................... 9
3 系统原理分析 .................................................................................................................... 10
3.1 直立行走任务分解 ................................................................................................. 10 3.2 小车直立控制 ......................................................................................................... 10 3.3 小车速度控制 ......................................................................................................... 13 3.4 小车转向控制 ......................................................................................................... 14 3.5 小车视觉导航 ......................................................................................................... 15 4 硬件设计 ............................................................................................................................ 17
4.1 系统硬件组成 ......................................................................................................... 17
- 1 -
北华大学毕业设计(论文)
4.2 系统各模块的设计 ................................................................................................. 17
4.2.1 主控单元模块............................................................................................... 17 4.2.2 电源模块 ....................................................................................................... 19 4.2.3 视觉导航模块............................................................................................... 22 4.2.4 倾角测量模块............................................................................................... 23 4.2.5 电机驱动模块............................................................................................... 25 4.2.6 测速模块 ....................................................................................................... 27
5 软件设计和算法实现 ....................................................................................................... 28
5.1 开发环境介绍 ......................................................................................................... 28 5.2 系统整体流程 ......................................................................................................... 30 5.3 图像处理算法的设计 ............................................................................................. 32
5.3.1 图像模拟信号采集 ...................................................................................... 32 5.3.2 边沿检测提取算法 ...................................................................................... 34 5.3.3 图像滤波 ....................................................................................................... 37 5.4 互补滤波算法的设计 ............................................................................................. 39 5.5 系统控制算法的设计 ............................................................................................. 41
5.5.1 PID控制算法 ................................................................................................ 41 5.5.2 平衡控制算法............................................................................................... 43 5.5.3 转向控制算法............................................................................................... 45
6 系统调试与参数整定 ....................................................................................................... 48
6.1 串口调试.................................................................................................................. 48
6.1.1 串口调试工具............................................................................................... 48 6.1.2 无线串口调试上位机 .................................................................................. 48 6.2 图像采集调试 ......................................................................................................... 49 6.3 姿态参数整定 ......................................................................................................... 50
6.3.1 角度参数的整定 .......................................................................................... 50 6.3.2 速度参数整定............................................................................................... 50 6.3.3 方向参数整定............................................................................................... 51
- 2 -
北华大学毕业设计(论文)
结 论 ................................................................................................................................ 52 参 考 文 献 .......................................................................................................................... 53 附录A 附录B
摄像头信号采集模块原理图 ............................................................................. 55 MC9S12XS128最小系统原理图 ...................................................................... 56
致 谢 ................................................................................................................................ 57
- 3 -
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于视觉导航的两轮自平衡小车系统论文在线全文阅读。
相关推荐: