基于单片机的自动往返小车设计(任务书,开题报告,论文8000字)
摘要
智能小车可以在感知方面模拟人的行为, 它是智能技术的一个试验场所。智能小车具有识别、判断、处理等能力。可以在恶劣的环境中探测、救援等。本设计正是基于智能小车的自动控制进行的研究。
本设计由六个模块构成,分别是单片机模块、黑线检测模块、L298N电机驱动模块、测速模块、显示模块和电源模块。电源模块给L298N模块供电,L298N中降压芯片把电压降到5V给单片机供电。单片机STC89C52模块作为核心来控制自动往返小车,L298N电机驱动模块用来控制小车的前进、后退、加速和减速。黑线检测模块检测路面的黑线,通过单片机STC89C52对输入的信号进行综合判别和处理,以动态显示的形式通过显示模块1602液晶显示屏显示小车检测到黑线的次数、行驶时间、行驶距离。测速模块用来测小车的行驶距离。本文从硬件电路的原理分析以及设计,软件编写的设计和调试等几个方面介绍了自动往返小车的设计过程。本文最后介绍了设计小车的过程中出现的问题和总结。
关键词: L298N控制电动机 光电检测 动态显示
Abstract
Smart car simulates human behavior in terms of perception , it is a testing ground for artificial intelligence technology. Smart car has intelligent mechanisms to identify, judge, handling, etc. It can be perceived and intelligence combined work under certain conditions, the detection Smart car broad application prospects in harsh environments, rescue, transport. This design is based on the Intelligent car automatic control system.
The design consists of six modules, which are single-chip modules, the black line detection module, L298N motor drive module, the speed module, display module and power module.The design uses the unipole slab machine named STC89C52 as the core to control the small autocar which can go back and forth automatically. And it is combined with the control-chip L298N to control the autocar’s precession, countermarch, acceleration and deceleration. It uses the integrated and infrared emission-and-receiver device to detect black lines on the pavement. It carries out comprehensive judgment and processing of input signal through the MCU STC89C52, and shows the times of detected black lines, travel time and travel distance in the form of a dynamic display made by the 1602 LED display. Travel distance is detected by a photoelectric encoder. This thesis focuses on the principle analysis and design of hardware circuit, the design and debugging of software and some other aspects of the design process of the small autocar. Finally, this thesis introduces the problems occurred during the process of designing the small autocar and the summary.
Keywords: Control motor L298N Photoelectric detection Dynamic display
目 录
摘要 I
Abstract II
目 录 III
第一章 绪论 1
1.1背景 1
1.2设计目标 1
1.3论文结构 2
第二章 硬件电路设计 3
2.1系统功能 3
2.2系统原理 3
2.3处理模块 4
2.4电源模块 6
2.5黑线检测模块 6
2.6L298N电机驱动模块 7
2.7测速模块 8
2.8显示模块 8
2.9本章小结 9
第三章 程序设计 10
3.1程序的总体设计 10
3.2 PWM调速程序的设计 12
3.3电机控制程序的设计 13
3.4测距程序的设计 14
3.5显示部分程序的设计 15
3.6本章小结 15
第四章 系统测试与结果 16
4.1小车整体电路图 16
4.2小车的硬件调试 16
4.3小车的测试 23
4.4调试中遇到的困难 25
第五章 总结 26
参考文献 27
|