基于FPGA的智能小车系统
摘 要
在科学探索和紧急抢险中经常会遇到对一些危险或人类不能直接到达的地域的探测,这些就需要用小车来完成。而小车在复杂地形中行进时自动是一项必不可少也是最基本的功能。因此,自动系统的研发就应运而生。自动小车就是基于这一系统开发而成的。随着科技的发展,对于未知空间和人类所不能直接到达的地域的探索逐步成为热门,这就使小车的自动有了重大的意义。自动小车可以作为地域探索小车和紧急抢险小车的运动系统,让小车在行进中自动避过障碍物。
本文提出了一种经济实用的智能小车系统设计方法,采用了小车底盘作为载体、直流电机作为执行元件、红外传感器作为检测元件、FPGA作为主控芯片、L298N作为驱动芯片和稳压电源芯片完成了检测电路设计、主控电路设计、电机驱动电路设计、稳压电路设计等硬件设计和制作,并对系统进行了仿真和综合调试,解决了一系列的难题,成功实现了自动功能。
关键词:智能小车系统,红外传感器,FPGA,L298N,PWM调速
Intelligent car system based on FPGA
ABSTRACT
In the course of scientific exploration and emergency rescue, we often encounter the exploration of dangerous or inaccessible areas, which need to be carried out by car. And the car in the complex terrain moving automatically is an essential and the most basic function. Therefore, the research and development of automatic system emerges as the times require. Automatic car is based on this system is developed. With the development of science and technology, the exploration of unknown space and regions that can not be directly reached by human beings has gradually become a hot topic, which makes the automatic car have great significance. The automatic car can be used as the sports system of the regional exploration car and the emergency car, so that the car is moving. To avoid obstacles automatically.
In this paper, an economical and practical design method of intelligent car system is presented. The vehicle chassis is used as the carrier, the DC motor as the executive element, the infrared sensor as the detection element, and the FPGA as the main control chip. L298N is used as the driver chip and the voltage regulator chip to complete the design of the detection circuit, the main control circuit, the motor drive circuit, the voltage regulator circuit and so on. The simulation and comprehensive debugging of the system are carried out. A series of difficult problems have been solved and the automatic function has been successfully realized.
Key words: Intelligent trolley system, infrared sensor, FPGA, L298N, PWM speed regulation
目 录
前 言 1
第1章 系统总体方案设计 4
§1.1 系统任务描述 4
§1.2 控制系统要求 4
§1.3 方案设计与论证 4
§1.3.1 小车载体选择 4
§1.3.2 主控制器选择 5
§1.3.3 传感器选择 5
§1.3.4 电机驱动选择 6
§1.3.5 稳压电源选择 7
§1.3.6 智能小车系统最终方案 7
§1.4 系统总体设计 8
§1.4.1 系统组成 8
§1.4.2 系统工作原理 8
§1.5 本章小结 9
第2章 硬件设计 10
§2.1 主控电路设计 10
§2.1.1 FPGA硬件结构简介 10
§2.1.2 最小应用系统设计 12
§2.2 电机驱动电路的设计 15
§2.2.1 智能小车系统驱动电机的要求 15
§2.2.2 直流电机调速原理 16
§2.2.3 L298N电机驱动原理 17
§2.3 障碍物检测电路设计 22
§2.4 报警电路设计 23
§2.5 稳压电源电路设计 24
§2.6 系统整体电路设计 25
§2.7 本章小结 26
第3章 软件设计简介 27
§3.1 主程序模块 27
§3.1.1 程序控制设计 27
§3.1.2 主程序流程图 27
§3.2 初始化模块 29
§3.3 延时模块 29
§3.4 中断模块 29
§3.5 报警模块 29
§3.6 驱动模块 29
§3.7 本章小结 30
第4章 系统的仿真与调试 31
§4.1 仿真步骤 31
§4.2 系统调试 31
§4.2.1 硬件调试 31
§4.2.2 软件调试 32
§4.2.3 联合调试 32
§4.3 本章小结 32
结 论 33
参考文献 34
致 谢 35
附 录 36