毕业设计-基于单片机的红外传感器的自动寻迹智能小车设计 精品 - 图文

更新时间:2023-03-11 08:43:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

东北大学秦皇岛分校毕业设计(论文) 第 I 页

毕业设计(论文)

基于红外传感器的自动寻迹智能小车设计

系 别 专 业 班级学号 姓 名 指导教师

东北大学秦皇岛分校毕业设计(论文) 第 II 页

基于红外传感器的自动寻迹智能小车设计

摘 要

介绍了一种自动寻迹智能车的设计,研究了采用红外反射式光电传感器作为路径采集模块实现自动寻迹的软硬件设计方法。系统采用Freescale 16 位单片机MC9S12DG128 为核心控制器,利用12个红外光电传感器构成的光电传感器阵列采集路面信息,单片机获得传感器采集的路面信息和车速信息,经过分析后控制智能车的舵机转向,同时对直流电机进行调速,从而实现智能车沿给定的黑线快速平稳地行驶。介绍了光电传感器的寻迹原理,讨论了光电传感器排列方法、布局等对寻迹结果的影响及速度和转向控制的PID算法的研究和参数整定。

关键字:光电传感器,寻迹,路径识别,PWM,PID

东北大学秦皇岛分校毕业设计(论文) 第 III 页

Design of autonomous tracing smart car based on infrared sensors

Author:Xue Changliang

Tutor:Gu Deying

Abstract

A design of autonomous tracing system in intelligent vehicle is introduced. The software and hardware design method which realizes the autonomous tracing using the infrared Reflective photoelectric sensors as the path recognition module is researched. The system employs Freescale HCS series 16 bit single-chip microcomputer MC9SDG128 as its main controller and an array of photoelectric sensors for recognizing the path information. Single-chip Microcomputer energizes the PWM signal to steer and control the speed of the DC electric motor according to the analysis of the path and speed information from sensors. Consequently, this intelligent vehicle can track the black-guide-line automatically and move forward following the line quickly and smoothly. The autonomous tracing principle of photoelectric sensor is presented. The effects of sensor s’ array method, overall arrangement on the autonomous trace are discussed. And the use of PID algorithm in speed and steering control.

Key words : photoelectric sensor ,autonomous tracing, path recognition, PWM,PID

东北大学秦皇岛分校毕业设计(论文) 第 IV 页

目 录

第1章 绪论 ............................................................. 1

1.1 课题的研究背景 ........................................................................................................ 1 1.2 国内外智能车的研究现状 ........................................................................................ 1 1.3 本文内容及结构安排 ................................................................................................ 3 第2章 红外传感器的寻迹原理及布局对寻迹的影响 ........................... 4

2.1 红外传感器寻迹原理 ................................................................................................ 4 2.2 传感器布局对路径识别的影响 ................................................................................ 6

2.2.1 布局相关参数 .................................................................................................. 6 2.2.2 一字型与八字型布局研究 .............................................................................. 6

第3章 智能车机械结构的调整 ............................................. 9

3.1 赛车参数 .................................................................................................................... 9 3.2 舵机安装方式调整 .................................................................................................. 10 3.3 前轮定位 .................................................................................................................. 10

3.3.1 主销后倾角 .................................................................................................... 10 3.3.2 主销内倾角 .................................................................................................... 11 3.3.3 前轮外倾角 .................................................................................................... 12 3.3.4 前轮前束 ........................................................................................................ 13 3.4 重心位置 .................................................................................................................. 13 3.5 齿轮传动间距调整 .................................................................................................. 14 3.6 后轮差速机构调整 .................................................................................................. 14 第4章 系统硬件设计 .................................................... 15

4.1 S12控制核心 ........................................................................................................... 16 4.2 电源管理模块 .......................................................................................................... 17

4.2.1 单片机稳压电源电路设计 ............................................................................ 17 4.2.2 舵机电源模块设计 ........................................................................................ 19 4.3 电机驱动模块 .......................................................................................................... 20 4.4 速度检测模块 .......................................................................................................... 23 4.5 路径识别模块 .......................................................................................................... 25 第5章 系统软件设计 .................................................... 27

5.1 系统的模块化结构 .................................................................................................. 28

5.1.1 时钟初始化 .................................................................................................... 28 5.1.2 串口初始化 .................................................................................................... 28 5.1.3 AD初始化 ..................................................................................................... 29 5.1.4 PWM初始化 .................................................................................................. 30 5.2 路径信息处理 .......................................................................................................... 32 5.3 数字滤波算法 .......................................................................................................... 33 5.4 小车控制算法 .......................................................................................................... 35

5.4.1 PID算法 ......................................................................................................... 37 5.4.2 舵机控制 ........................................................................................................ 39 5.4.3 电机控制 ........................................................................................................ 39

本文来源:https://www.bwwdw.com/article/2eww.html

Top