第三届全国大学生“飞思卡尔”杯
智能汽车竞赛
技 术 报 告
附件C 基于AD采样的光电传感器阵在智
能车中的应用
学 校:南京航空航天大学 队伍名称:nail
参赛队员:尹亮亮 史经奎 郑昕昕
带队教师:孙永荣 刘剑慰
I
关于技术报告和研究论文使用授权的说明
本人完全了解第二届“飞思卡尔”杯全国大学生智能汽车邀请赛关保留、
使用技术报告和研究论文的规定,即:参赛作品著作权归参赛者本人,比赛组委会和飞思卡尔半导体公司可以在相关主页上收录并公开参赛作品的设计方案、技术报告以及参赛模型车的视频、图像资料,并将相关内容编纂收录在组委会出版论文集中。
参赛队员签名: 带队教师签名:
日 期:
摘 要
第三届“飞思卡尔杯”全国智能车大赛在全国范围内如火如荼的进行,从第一届开始,经过短短几年时间,大赛吸引了全国各地越来越多的学校组建队
II
伍参加比赛。
本文介绍了南京航空航天大学Snail队参加本届比赛的智能车系统的机械部分改造,软、硬件设计及控制策略。
该智能车系统采用组委会规定的标准车模,以飞思卡半导体公司生产的16位单片机MC9S12DG128 为核心控制器,在CodeWarrior IDE开发环境中进行软件开发。本系统综合了传感器检测,自动控制,信号处理,单片机,机械设计等技术,控制小车在大赛给定赛道上完成自主寻迹,并使智能车在绕赛道行驶两圈之后,自动停在距离起跑线三米以内的范围内。
系统采用光电传感器对赛道进行识别,对赛道上的黑、白两色进行采样,以适应不同的比赛环境;传感器与小车前轮同步转动,以加快过弯速度;采用PID算法稳定电机转速,使智能车加减速以及稳定性能达到最优;采用PD算法控制舵机转向,使小车能够稳定、快速寻线。此外,本系统还能够识别十字路口以及上下坡,并对此做出相应的反应。
关键字:智能车 光电传感器 PID
Abstract
The third session of the ―Freescale Cup‖ National University Smart car Competition is carrying on. There has been passed only few years since the first session of the competition hold, but more and more universities are coming to run prizes.
III
In this article, we present the smart car system designed by Nanjing University of Aeronautics and Astronautics. It includes the alteration of mechanism, the design of the hardware and the software, the technique of control and so on.
The 1/10 EP on-racing car is adopted as the smart car’s mechanism, This contest adopting the standard model car prescribed by the contest organization committee, using the 16-bit MCU MC9S12DG128 produced by Freescale Semiconductor Company as the core controller, developing under the CodeWarrior IDE. The system combines sensor technology, automatic control technology, signal processing technology, microprocessor technology and mechanism projecting technology. It can make car automatic drive along the runway. What’s more, when the smart car has driven along the runway twice, it could stop in 3 meters from the jumping-off line.
The system identifies the game road by a line of photoelectric sensor, which running with the front wheel of the smart car in order to accelerate when the smart car wheeling .The sensor sampling the black and white of the runway so as to adapt different environment. The system takes advantage of the PID arithmetic, which enables the model system to acquire better stability and capacity of instantaneous acceleration. Furthermore, it adopts the PD arithmetic to control the veer, to insure the agility and stabilization of the smart car.
What’s more, the system can identify the crossing and the slope, and make the reaction.
Key Word: Intelligent Vehicle Photoelectric Sensor PID
目 录
摘 要 ............................................................................................................................... II Abstract .......................................................................................................................... III 目 录 ....................................................................................................................... IV 第一章 引 言 ............................................................................................................... 1 第二章 系统总体方案设计及车模各项参数 ........................................................... 2
IV
2.1 2.2 2.3 2.4
系统总体框图 ................................................................................................... 2 系统的硬件参数 ............................................................................................... 3 车模外观 ........................................................................................................... 3 总结 ................................................................................................................... 4
第三章 机械结构的设计及调整 ................................................................................ 5 3.1 3.2 3.2.1 3.2.2 3.3 3.4
车模转向舵机机械结构的设计 ...................................................................... 5 部分模块的安装 ............................................................................................... 5 前排传感器的安装 .......................................................................................... 5 测速反馈模块的安装 ...................................................................................... 6 车模上的总体结构 .......................................................................................... 7 总结 ................................................................................................................... 8
第四章 光电传感器系统及信息处理 ........................................................................ 9 4.1 4.2 4.3 4.3.1 4.3.2 4.4 4.5 4.6
光电传感器工作原理 ...................................................................................... 9 光电传感器信号的采集 .................................................................................. 9 光电传感器信号的处理 ................................................................................ 10 参数自整定 ..................................................................................................... 11 跑车 ................................................................................................................. 11 基于光电传感器的起跑线识别方法 ........................................................... 11 基于光电传感器的上下坡识别方法 ........................................................... 12 总结 ................................................................................................................. 14
第五章 硬件电路设计 ............................................................................................... 15 5.1 5.1.1 5.1.2 5.1.3 5.2 5.3 5.4
电源管理模块 ................................................................................................. 15 5V电源 ........................................................................................................... 15 6.4V电源 ........................................................................................................ 16 1.25-5V可调电源 .......................................................................................... 16 电机驱动模块 ................................................................................................. 17 测速反馈模块 ................................................................................................. 17 总结 ................................................................................................................. 19
第六章 基于HCS12单片机系统的软件设计 ....................................................... 20
V