基于多传感器的自动驾驶机器小车设计与控制
首先,在信息化与智能化高度集中的21世纪,人类已经不再满足简单的车身服务系统,通过高速的处理器和高性能的微机系统以及一系列的集成化传感器系统设计出了一系列的智能化系统用来模拟人大脑的一部分机能,可以通过先对一系列外部物体信息的收集,从而通过微机的处理,自己决策出动作的指令。 这样可以减少人大脑的一部分工作,而且让行车变得更加的简单化和安全化(这就是不断的加强的辅助驾驶系统)。
本文阐述了基于C52单片机的智能小车的控制过程。本设计中的智能小车控制过程如下:(1)安装电机的驱动模块L298N,控制电机正反转及速度;(2)根据红外对管TCRT5000对路面黑白线分析,反馈高低电平,通过C52单片机完成循线;(3)根据红外感应管感反馈高低电平,实现避障;(4)码盘,计数传对射器经过对光电发射和接收器件读取,获取四组正弦波信号,得到脉冲数测得速度,也可用来调节小车转弯的角度;(5)现采用两个蓝牙模块(HC-07兼容HC-06)之间的通讯实现小车的无线控制,当感知到小车经过时,蓝牙主机模块实时的发送红绿灯的状态来控制小车行驶。本设计采用STC89C52RC单片机设计控制过程,软件选用C程序,电路结构简单,容易实现,可靠性高。
关键词:循迹 避障 蓝牙通讯 码盘计数传感器 智能小车 M00040
The design and control of automatic driving robot based on multi sensor
Abstract
First, as the information and intelligence is highly concentrated in twenty-first century, people no longer meet the simple vehicle service system, a series of intelligent system was designed through high speed processor and high performance microcomputer system and a series of integrated sensor system , to simulate parts of the brain function through the information collection of a series of external objects and computer processing, then carry on the order automatically. This can reduce a part of the brain’s work, and make the driving easier and safer(This is the auxiliary driving system which is continuing strengthen).
This paper describes the control process of the intelligent car based on C52 single-chip microcomputer. The intelligent car control process in the design are as follows: (1) driving module L298N mounted motor, control motor positive inversion and speed; (2) according to the infrared analysis of tube TCRT5000on the surface of black and white lines, the feedback level, through the C52MCU on line; (3) according to the infrared induction pipe feedback level, to achieve obstacle avoidance; (4) encoder, counting retransmission of ejector through the optical transmitting and receiving devices to read, get four groups of sine wave signal, pulse number of measured velocity, can also be used to adjust the car turning point; (5) the two Bluetooth module (HC-07 compatible HC-06) wireless control. Communication realization of the car, when he felt the car passed, Bluetooth host module real-time transmission of traffic lights to control the car running state. This design uses STC89C52RC micro controller design of process control, software using C program, the circuit structure is simple, easy to implement, high reliability.
Key Words: Tracking; obstacle avoidance; Bluetooth; encoder counting sensor; smart car
目录 查看完整请+Q:351916072获取
1.绪论..........................................................................................................................1
1.1国内外智能驾驶现状..........................................................................................1
1.2智能小车设计意义以及发展前景......................................................................1
2.智能小车主控单元..............................................................................................3
2.1. 整体机构............................................................................................................3
2.2. 主控制部分........................................................................................................4
2.2.1CPU介绍........................................................................................................4
2.2.2CPU功能........................................................................................................5
2.3.智能小车电机驱动单元......................................................................................6
2.3.1 驱动单元L298N介绍..................................................................................6
2.3.2直流电机的驱动原理和实物图...................................................................6
3.多传感器系统设计..............................................................................................8
3.1智能小车循迹控制系统设计..............................................................................8
3.1.1循迹介绍.......................................................................................................8
3.1.2循迹原理及电路图.......................................................................................8
3.1.3小车三路循迹算法设计..............................................................................9
3.2智能小车避障控制系统设计............................................................................11
3.2.1避障介绍.....................................................................................................11
3.2.2避障原理及相关电路图.............................................................................12
3.2.3避障控制系统算法设计.............................................................................13
3.3码盘和计数对射传感器控制转角系统设计..................................................14
3.3.1码盘和计数对射传感器介绍.................................................................14
3.3.2码盘和计数对射传感器原理及电路图.................................................14
3.3.3码盘和计数对射传感器控制小车避障路线算法设计.............................14
3.4智能小车蓝牙控制系统设计 ....................................................................... 17
3.4.1蓝牙介绍.....................................................................................................17
3.4.2两个蓝牙模块实现数据传输的实现.........................................................18
3.4.3蓝牙控制算法设计.....................................................................................20
4.自动驾驶路面设计及相应控制策略……...................................................23
4.1路面设计…………………………………………...……………......…….......23
4.2控制策略………………………………………….....………......…......……...23
5.实验设计……......................................................................................................25
5.1元器件功能测试…………………………………......………..................…....25
5.2小车整体物理实验的设计(结合路面)…….........……..................……….…28
5.2.1小车电机调速.............................................................................................29
5.2.2小车结合运行平台的实验设计.................................................................32
6.实验讨论……......................................................................................................33
6.1单片机循迹小车和真正智能驾驶的区别……………….....................……...33
6.2红绿灯的检测系统……………………………………...............…...………..33
6.3智能小车避障系统讨论………………………………..……..........…...…….34
6.4未来展望………………………………………............………..........………..34
7.结论……................................................................................................................36
8.参考文献……......................................................................................................37
附录……..................................................................................................................38
附录A 小车整体原理图……....................................................................38
附录B 程序…….........................................................................................39
致谢……................................................................................................................54
1.时钟电路
STC89C52内部有一个振荡器,引脚RXD输入,TXD输出。可以通过内外两种方式产生时钟信号。内部方式如图2-3(a)所示,在RXD和TXD两端连接了能产生自激振荡的定时元件,改变电容值大小可以改变频率。外部方式的时钟电路如图2-3(b)所示,RXD接地,TXD接外部的振荡器,在保证一定的脉宽的同时必须采用低于12MHZ的方波信号。片内时钟发生器把振荡频率两分频,产生一个两相时钟P1和P2来供给单片机使用
避障原理及相关电路图
为了提升该小车检测障碍物的精确度,系统选用了发射和接收为一体的反射式的红外光电传感器--JY043W,作为检测障碍物的传感器。因为红外线具有极强的反射能力,应用广泛,所以采用专门的红外发射管和接收管可以有效地防止系统周围可见光的干扰,提高该系统的抗干扰能力。对于同一小车所碰见的障碍物,发射管发出相同强弱的光,然而由于接收管接收到的光强不同,因而输出的电压的值大小也不同;必需给定一个基准电压,然后通过对不同输出电压值的大小进行对比,那么电路的输出分为高低电平,基准电压的调整如原理图所示,上面有一个可调电阻,调节可调电阻来改变基准电压。当传感器检测到有障碍时,会有红外光被反射回,使光敏三极管导通,因此致使输出为高电平,反之则输出低电平,这样不仅使得系统硬件电路得到简化,而且信号处理速度得到提升,原理图,如图3-6所示。
蓝牙主方程序:
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit key1=P3^4;
sbit key2=P3^5;
sbit key3=P3^6;
sbit key4=P3^7;
/********************************************
初始化函数
*********************************************/
void init()
{
TMOD=0x20; //定时器1的工作方式2,8位初值自动重装的8位定时器/计数器
TH1=0xfd; //T1定时器装初值
TL1=0xfd; //T1定时器装初值
TR1=1; //启动定时器1
REN=1; //允许串行口接收数据
SM0=0; //设定串口工作方式1
SM1=1; //同上
EA=1; //开总中断
ES=1; //开串口中断
}查看完整请+Q:351916072获取
本文阐述了基于C52单片机的智能小车的控制过程。本设计中的智能小车控制过程如下:(1)安装电机的驱动模块L298N,控制电机正反转及速度;(2)根据红外对管TCRT5000对路面黑白线分析,反馈高低电平,通过C52单片机完成循线;(3)根据红外感应管感反馈高低电平,实现避障;(4)码盘,计数传对射器经过对光电发射和接收器件读取,获取四组正弦波信号,得到脉冲数测得速度,也可用来调节小车转弯的角度;(5)现采用两个蓝牙模块(HC-07兼容HC-06)之间的通讯实现小车的无线控制,当感知到小车经过时,蓝牙主机模块实时的发送红绿灯的状态来控制小车行驶。本设计采用STC89C52RC单片机设计控制过程,软件选用C程序,电路结构简单,容易实现,可靠性高。
关键词:循迹 避障 蓝牙通讯 码盘计数传感器 智能小车 M00040
The design and control of automatic driving robot based on multi sensor
Abstract
First, as the information and intelligence is highly concentrated in twenty-first century, people no longer meet the simple vehicle service system, a series of intelligent system was designed through high speed processor and high performance microcomputer system and a series of integrated sensor system , to simulate parts of the brain function through the information collection of a series of external objects and computer processing, then carry on the order automatically. This can reduce a part of the brain’s work, and make the driving easier and safer(This is the auxiliary driving system which is continuing strengthen).
This paper describes the control process of the intelligent car based on C52 single-chip microcomputer. The intelligent car control process in the design are as follows: (1) driving module L298N mounted motor, control motor positive inversion and speed; (2) according to the infrared analysis of tube TCRT5000on the surface of black and white lines, the feedback level, through the C52MCU on line; (3) according to the infrared induction pipe feedback level, to achieve obstacle avoidance; (4) encoder, counting retransmission of ejector through the optical transmitting and receiving devices to read, get four groups of sine wave signal, pulse number of measured velocity, can also be used to adjust the car turning point; (5) the two Bluetooth module (HC-07 compatible HC-06) wireless control. Communication realization of the car, when he felt the car passed, Bluetooth host module real-time transmission of traffic lights to control the car running state. This design uses STC89C52RC micro controller design of process control, software using C program, the circuit structure is simple, easy to implement, high reliability.
Key Words: Tracking; obstacle avoidance; Bluetooth; encoder counting sensor; smart car
目录 查看完整请+Q:351916072获取
1.绪论..........................................................................................................................1
1.1国内外智能驾驶现状..........................................................................................1
1.2智能小车设计意义以及发展前景......................................................................1
2.智能小车主控单元..............................................................................................3
2.1. 整体机构............................................................................................................3
2.2. 主控制部分........................................................................................................4
2.2.1CPU介绍........................................................................................................4
2.2.2CPU功能........................................................................................................5
2.3.智能小车电机驱动单元......................................................................................6
2.3.1 驱动单元L298N介绍..................................................................................6
2.3.2直流电机的驱动原理和实物图...................................................................6
3.多传感器系统设计..............................................................................................8
3.1智能小车循迹控制系统设计..............................................................................8
3.1.1循迹介绍.......................................................................................................8
3.1.2循迹原理及电路图.......................................................................................8
3.1.3小车三路循迹算法设计..............................................................................9
3.2智能小车避障控制系统设计............................................................................11
3.2.1避障介绍.....................................................................................................11
3.2.2避障原理及相关电路图.............................................................................12
3.2.3避障控制系统算法设计.............................................................................13
3.3码盘和计数对射传感器控制转角系统设计..................................................14
3.3.1码盘和计数对射传感器介绍.................................................................14
3.3.2码盘和计数对射传感器原理及电路图.................................................14
3.3.3码盘和计数对射传感器控制小车避障路线算法设计.............................14
3.4智能小车蓝牙控制系统设计 ....................................................................... 17
3.4.1蓝牙介绍.....................................................................................................17
3.4.2两个蓝牙模块实现数据传输的实现.........................................................18
3.4.3蓝牙控制算法设计.....................................................................................20
4.自动驾驶路面设计及相应控制策略……...................................................23
4.1路面设计…………………………………………...……………......…….......23
4.2控制策略………………………………………….....………......…......……...23
5.实验设计……......................................................................................................25
5.1元器件功能测试…………………………………......………..................…....25
5.2小车整体物理实验的设计(结合路面)…….........……..................……….…28
5.2.1小车电机调速.............................................................................................29
5.2.2小车结合运行平台的实验设计.................................................................32
6.实验讨论……......................................................................................................33
6.1单片机循迹小车和真正智能驾驶的区别……………….....................……...33
6.2红绿灯的检测系统……………………………………...............…...………..33
6.3智能小车避障系统讨论………………………………..……..........…...…….34
6.4未来展望………………………………………............………..........………..34
7.结论……................................................................................................................36
8.参考文献……......................................................................................................37
附录……..................................................................................................................38
附录A 小车整体原理图……....................................................................38
附录B 程序…….........................................................................................39
致谢……................................................................................................................54
1.时钟电路
STC89C52内部有一个振荡器,引脚RXD输入,TXD输出。可以通过内外两种方式产生时钟信号。内部方式如图2-3(a)所示,在RXD和TXD两端连接了能产生自激振荡的定时元件,改变电容值大小可以改变频率。外部方式的时钟电路如图2-3(b)所示,RXD接地,TXD接外部的振荡器,在保证一定的脉宽的同时必须采用低于12MHZ的方波信号。片内时钟发生器把振荡频率两分频,产生一个两相时钟P1和P2来供给单片机使用
避障原理及相关电路图
为了提升该小车检测障碍物的精确度,系统选用了发射和接收为一体的反射式的红外光电传感器--JY043W,作为检测障碍物的传感器。因为红外线具有极强的反射能力,应用广泛,所以采用专门的红外发射管和接收管可以有效地防止系统周围可见光的干扰,提高该系统的抗干扰能力。对于同一小车所碰见的障碍物,发射管发出相同强弱的光,然而由于接收管接收到的光强不同,因而输出的电压的值大小也不同;必需给定一个基准电压,然后通过对不同输出电压值的大小进行对比,那么电路的输出分为高低电平,基准电压的调整如原理图所示,上面有一个可调电阻,调节可调电阻来改变基准电压。当传感器检测到有障碍时,会有红外光被反射回,使光敏三极管导通,因此致使输出为高电平,反之则输出低电平,这样不仅使得系统硬件电路得到简化,而且信号处理速度得到提升,原理图,如图3-6所示。
蓝牙主方程序:
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit key1=P3^4;
sbit key2=P3^5;
sbit key3=P3^6;
sbit key4=P3^7;
/********************************************
初始化函数
*********************************************/
void init()
{
TMOD=0x20; //定时器1的工作方式2,8位初值自动重装的8位定时器/计数器
TH1=0xfd; //T1定时器装初值
TL1=0xfd; //T1定时器装初值
TR1=1; //启动定时器1
REN=1; //允许串行口接收数据
SM0=0; //设定串口工作方式1
SM1=1; //同上
EA=1; //开总中断
ES=1; //开串口中断
}查看完整请+Q:351916072获取
版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/jxgc/zdh/5025.html