一种基于竞赛的两轮自平衡小车的设计
2014-10-14周牡丹陈庆利康若鹏陈泽坤
周牡丹+陈庆利+康若鹏+陈泽坤
摘 要: 介绍一种两轮自平衡智能小车控制系统的实现方案。该系统以MC9S12XS128单片机作为主控芯片,采用一组激光传感器进行路径检测,使用ENC?03MA陀螺仪与MMA7361加速度计进行小车直立自平衡检测,利用BTS7960芯片进行电机驱动,使用增量式编码器进行速度检测,借助滑动电阻器和液晶屏对参数进行调整与观测。在软件方面,结合PWM技术和PID控制技术对小车的两个直流电机的转速进行控制,可以实现两轮小车的动态自平衡快速寻迹运行。实践表明该设计达到了理想效果。
关键词: 自平衡智能小车; 两轮小车; 直立控制; 寻迹
中图分类号: TN710?34 文献标识码: A 文章编号: 1004?373X(2014)20?0070?04
Design of a two?wheel self?balanced vehicle for race
ZHOU Mu?dan, CHEN Qing?li, KANG Ruo?peng, CHEN Ze?kun
(Department of Electronic Engineering, TKK College, Xiamen University, Zhangzhou 363105, China)
Abstract: An implementation scheme of control system for two?wheel self?balanced intelligent vehicle is introduced in this paper. In the system, MC9S12XS128 is used as a master microcontroller, some laser sensors are used to detect the path, ENC?03MA gyroscope and MMA7361 accelerometer are used for upright self?balanced detection of the vehicle, the chip BTS7960 is employed to drive the motor, the incremental encoder are used for the speed detection, and sliding resistors and LCD screen are utilized to adjust and observe the parameters. The speed of the two DC motors in the vehicle is controlled with PWM technology and PID control technology, so as to achieve the dynamic self?balance and fast tracking of the vehicle.
Keywords: self?balanced intelligent vehicle; two?wheel vehicle; upright control; tracking
0 引 言
两轮自平衡小车系统与倒立摆系统相似,受控对象具有多变量、非线性、强耦合等特点,在两轮自平衡车的设计实现中必须着重解决系统的稳定性、快速性、跟随性等问题[1?2]。本文设计研究的两轮自平衡小车是“智能车”竞赛中的一种,要求在规定跑道上完成竞速的比赛,需要竞赛小车具备高度的稳定性和快速性,所以设计的重点是在保证两轮动态自动平衡的前提下尽可能地提高速度 [3?4]。在系统设计与实现中,不但要确保两轮小车的自动直立平衡,还需要考虑自动寻迹的转向控制,速度平稳控制等。本文就自平衡小车的硬件系统构成和单片机实现的软件设计方案进行详细介绍。
1 系统的硬件结构
自平衡小车的硬件系统主要由单片机模块、倾斜角度检测模块、电机驱动模块、激光路径检测模块、电机测速模块、电源模块及调试模块等组成。……
