智能小车测速系统

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

智能仪表综合训练说明书内蒙古科技大学智能仪表综合训练设计说明书题目:智能小车测速系统设计学生姓名:学号:专业:测控技术与仪器班级:2009-1指导教师:孙采鹰讲师智能仪表综合训练说明书I摘要近年来,随着我国经济建设的高速发展,机动车辆拥有量也在急剧增长,交通事故也日益增多,车辆超速成为了越来越严重的问题。而我国生产的汽车、摩托车电机转速测量系统大多使用动圈式模拟测速。这种测量系统存在精度差、过载能力弱等缺点。本次的智能仪表综合训练的主要任务是设计一个智能小车,要求实现小车能够直走、通过光电传感器进行测速、通过PWM电路模块进行调速以及通过LCD1602液晶模块进行脉冲、速度、PWM的占空比三个参数的显示。控制板的设计以8位的STC89C52单片机为控制核心,驱动板则以L289N驱动芯片为核心,应用光电传感器和LCD液晶模块,成功的实现了小车的测速、调速和显示功能这三大功能。课题完成了光电传感器、单片机、控制板、驱动板选择,采购接口电路的设计和连接以传感器和电路的安装位置和方式的安排,并完成了整个硬件的安装工作。除此之外,还对整个控制软件进行设计和程序的编制以及程序的调试,并最终完成了软件和硬件的融合,基本实现了智能小车要求实现的预期的功能。关键词:智能小车;光电传感器;驱动芯片;LCD液晶模块;单片机智能仪表综合训练说明书II目录第一章绪论···················································································11.1问题的提出···········································································11.2设计思路···············································································2第二章方案论证··············································································32.1控制核心的选择及其简介··························································32.1.1STC89C52RC单片机简介··················································42.1.2小车控制板简介·····························································72.2小车驱动方式选择·································································102.3光电测速模块·······································································112.4LCD1602显示模块·································································12第三章系统硬件设计·······································································163.1车体结构及其驱动电路····························································163.2测速模块的设计····································································183.3PWM调速模块的设计·····························································213.3.1PWM硬件电路的设计·····················································223.3.2PWM电路的使用方式及连线············································23第四章系统软件的设计····································································254.1主程序的设计·······································································254.2测速模块程序的设计······························································264.3PWM调速模块程序的设计·······················································284.4LCD1602液晶显示程序的设计··················································28总结······························································································30参考文献························································································31附录1原理图·················································································32附录2源程序·················································································35附录3实物图·················································································41智能仪表综合训练说明书1第一章绪论1.1问题的提出当今世界,科学技术日新月异。传感器技术和自动控制正在飞速发展,机械、电气和电子信息已经不再明显分家,自动控制在工业领域中的地位已经越来越重要,“智能”这个词也已经成为了热门词汇。现在国外的自动控制和传感器技术已经达到了很高的水平,特别是日本,比如日本本田发明的机器人,其仿人双足行走已经做得十分的逼真了,而且还具有一定的学习能力,据说这机器人的智商已达到了6岁儿童的水平。作为机械行业的代表产品——汽车,其与电子信息产业的融合速度也显著提高,呈现出两个明显的特点:一是电子装置占汽车整体(特别是轿车)的价值量比例逐步提高,汽车将由以机械产品为主向高级的机电一体化方向发展,汽车电子产业也很可能成为依托整车制造业和用车提升配置而快速成为新的增长点:二是汽车开始向电子化、多媒体化和智能化方向发展,使其不仅作为一种代步工具、同时具有交通、娱乐、办公和通讯等多种功能。无容置疑,机电一体化人才的培养不论是在国外还是在国内,都开始重视起来,主要表现在大学生的各种大型的创新比赛,比如:亚洲广播电视联盟亚太地区机器人大赛、全国大学生“飞思卡尔”杯智能汽车竞赛等众多重要竞赛都能很好的培养大学生对机电一体化的兴趣与强化机电一体化的相关知识。所以作为机电一体化学生,必须加倍努力,为逐步赶上国外先进水平并超过之而努力。为了适应机电一体化的发展在汽车智能化方向的发展要求,提出简易智能小车的构想,目的在于:通过独立设计一辆具有简单智能化的简易小车,获得项目整体设计的能力,并掌握多通道多样化传感器综合控制的方法。所以立“基于单片机的智能小车测速设计”一题作为尝试。这项设计是以采购的小车为基础,采用16位STC89C52RC单片机作为控制核心,逐步实现测速、调速、显示这三大功能。本次设计主要解决问题是如何实现所要求的三大功能,最后完成硬件实物的组装,并编制相关程序,使其实现功能的融合,做出具有预先要求功能的实物。智能仪表综合训练说明书21.2设计思路本次设计的硬件框图如1-1图所示单片机STC89C52RCLCD1602液晶显示电机驱动板电机电源PMW调速测速1-1图这次的智能仪表综合训练是基于单片机的智能小车测速系统,这次设计所使用的测速传感器为光电测速传感器,在单位时间内计算脉冲的次数,然后再进行转换和处理即得到所测量的速度。通过PWM调速模块结合软件进行调速。通过Keil进行软件编程、编译、链接、调试以及用Proteus画图进行仿真,编出能够满足要求的程序。最后用STC-ISPV38A.exe把生成的16进制的文件下载到单片机即可。智能仪表综合训练说明书3第二章方案论证智能小车的总体结构如下:智能小车由各零部件组成,零部件主要有智能车底盘一个(直流减速电机1个,电机固定座1个,轮胎41个,有机玻璃板一块),单片机开发板1块,测速套装(模块+100线码盘)1套,BTS7960电机驱动模块1个,7.2V电池1块。本次设计通过光电传感器进行测速、PWM调速模块进行调速、LED数码管进行显示。具体原理是:把100线的光码盘安装在减速电机的转轴上,由于车轮也与减速电机的转轴连接,因此车轮与光码盘是同步的,它们具有相同的角速度。光码盘与光电传感器是配套使用的,光电传感器安装在光码盘的旁边。当电机转动时,光码盘也随之转动。光电传感器输出TTL电平,当光码码盘线数来决定。因此当光码盘转动时,光电传感器就会有脉冲输出。光电传感器脉冲输出端接在单片机的P32口,也就是接到了外部中断0上。通过外部中断服务在单位时间内进行脉冲数的计算。在本次设计中采用定时器T1进行1秒定时。在这1秒钟的时间内把测量到的脉冲数进行处理,转换成速度。调速部分需要硬件和软件结合。BTS7960驱动模块里有两个H型电桥,用来控制减速电机。有1个使能EN,有两个PWM控制端分别为pwm1和pwm2,用来控制电机的正转和反转及电机转速。EN常接高电平,当pwm1为高电平pwm2为低电平时电机正转,pwm1为低电平pwm2为高电平时,电机反转。本次设计的小车使用也很方便,只需打开一个开关按键,小车就跑起来。下面根据设计要求,针对各模块需要完成的功能,本着简单、实用、廉价、容易操作、稳定的原则,对各个模块进行充分理论分析和方案论证。2.1控制核心的选择及其简介本次设计的小车具有测速、调速以及参数显示的功能。由于需要实现的功能不多,因此用一般的51系列的单片机就可以实现,由此选择了STC89C52RC单片机。该单片机价格便宜、工作稳定、操作方便、功能齐全、性能稳定等优点深受广大单片机爱好者好评。2.1.1STC89C52RC单片机简介STC89C52是一种低功耗、高性能CMOS8位微控制器,具有8K在系统可编程Flash存储器。在单芯片上,拥有灵巧的8位CPU和在系统智能仪表综合训练说明书4可编程Flash,使得STC89C52为众多嵌入式控制应用系统提供高灵活、非常有效的解决方案。具有以下标准功能:8k字节Flash,512字节RAM,32位I/O口线,看门狗定时器,内置4KBEEPROM,MAX810复位电路,三个16位定时器/计数器,一个6向量2级中断结构,全双工串行口。另外STC89X52可降至0Hz静态逻辑操作,支持2种软件可选择节电模式。空闲模式下,CPU停止工作,允许RAM、定时器/计数器、串口、中断继续工作。掉电保护方式下,RAM内容被保存,振荡器被冻结,单片机一切工作停止,直到下一个中断或硬件复位为止。最高运作频率35MHz,6T/12T可选。特性方面:1.STC89C52RC单片机。2.8K字节程序存储

1 / 42
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功