已阅读5页,还剩13页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
单片机项目实验报告单片机项目报告智能小车控制 班级:自动化21091姓名:邸维汉 刘会丽 石钱坤学号:102010330420101032152010103122目录一、 前言二、 方案设计与论证1) 控制器模块选取2) 电机模块选取3) 电机驱动器模块选取4) 电源模块选取三、 硬件设计1) 主控系统2) 电机模块3) 电机驱动模块4) 电源模块5) 按键模块四、 软件设计1) 直行设计2) 转弯设计3) 调速设计五、 调试中存在的问题六、 参考文献一、前言:随着汽车工业的迅速发展,关于汽车的研究也就越来越受人关注。全国电子大赛和省内电子大赛几乎每次都有智能小车这方面的题目,全国各高校也都很重视该题目的研究。可见其研究意义很大。本设计就是在这样的背景下提出的,指导教师已经有充分的准备。本题目是结合科研项目而确定的设计类课题。我们设计的智能电动小车该具有圆形运行、三角形运行、矩形运行和三者一起运行的功能。都是运行一循环自动停车。根据题目的要求,确定如下方案:在现有玩具电动车的基础上,加了四个按键,实现对电动车的运行轨迹的启动,并将按键的状态传送至单片机进行处理,然后由单片机根据所检测的各种按键状态实现对电动车的智能控制。这种方案能实现对电动车的运动状态进行实时控制,控制灵活、可靠,精度高,可满足对系统的各项要求。本设计采用stc89c52单片机。以stc89c52为控制核心,利用按键的动作,控制电动小汽车的轨迹。实现四种运行轨迹。stc89c52是一款八位单片机,它的易用性和多功能性受到了广大使用者的好评。二、方案设计与论证1) 控制器模块选取我们采用stc公司的stc89s52单片机作为主控制器,stc公司的单片机内部资源比起atmel公司的单片机来要丰富的多,它在5v供电情况下,最多支持80m晶振、且内部有512b的ram数据存储器、片内含8k空间的可反复擦些1000次的flash只读存储器、1k的eeprom、8个中断源、4个优先级、3个定时器、32个io口、片机自带看门狗、双数据指针等。但是不兼容atmel。从方便使用的角度考虑,我们选择了此方案2) 电机模块选取采用普通直流电机。直流电机运转平稳,精度有一定的保证。直流电机控制的精确度虽然没有步进电机那样高,但完全可以满足本题目的要求。通过单片机的pwm输出同样可以控制直流电机的旋转速度,实现电动车的速度控制。并且直流电机相对于步进电机价格经济。3) 电机驱动器模块选取采用电机驱动芯片l298n。l298n为单块集成电路,高电压,高电流,四通道驱动,可直接的对电机进行控制,无须隔离电路。通过单片机的i/o输入改变芯片控制端的电平,即可以对电机进行正反转,停止的操作,非常方便,亦能满足直流减速电机的大电流要求。调试时在依照芯片手册,用程序输入对应的码值,能够实现对应的动作。4) 电源模块选取在本系统中,需要用到的电源有单片机的5v,l298n芯片的电源5v和电机的电源7-15v。所以需要对电源的提供必须正确和稳定可靠。用9v的锌电源给前、后轮电机供电,然后使用7805稳压管来把高电压稳成5v分别给单片机和电机驱动芯片供电。因此为了方便,这里我们采用12v电源给电机供电,再用7805转换成5v电源给单片机使用。三、硬件设计小车采用四轮驱动,一侧的前后两个车轮共用一个电机驱动,另外两个前后轮共用一个驱动,调节左右车轮转速从而达到控制转向的目的。按键模块单片机最小系统l298n电源模块电机模块系统结构框图 实物连接:3.2、电机驱动模块l298n驱动直流电机,它靠两个引脚控制一个电机的运动。小车采用四轮驱动,小车两侧的电机短接起来各接到l298n的一个输出端。通过调制两边轮子的转速或正反转来达到控制小车转向的目的。芯片引脚和功能如图1,驱动电路如图2。en a(b)in1(in3)in2(in4)电机运行情况hhl正转hlh反转h同in2(in4)同in2(in4)快速停止lxx停止将l298n的in0、1、2、3,接到p1.0到p1.3上,ena、enb接到p3.2、p3.3。3.3、电机模块电机模块采用4块电机同时驱动,这里将同一侧电机短接接到l298n的一个输出端。3.4、电源模块采用两片7805电压稳压5v后给单片机系统和其他芯片供电供电,但缺点是压降过大,消耗的功率过大,发热量过大。3.5、 按键模块本系统添加4个按键,用来选择控制小车。并接于p2.0到p2.3口上。四、软件设计是否有键按下?开始 检测按下哪个键?运行三角形运行圆形运行矩形ny总体流程图运行以上3个轨迹s1按下s2按下s3按下s4按下4.1、小车直行设计:若要求小车直走,这需要给4个电机正转命令。根据l298n芯片手册en a(b)in1(in3)in2(in4)电机运行情况hhl正转hlh反转h同in2(in4)同in2(in4)快速停止lxx停止这里将p1=0xfa。4.2、小车转弯设计:若要求小车转弯,需要给一侧电机正转,一侧电机反转或者不旋转。这样将p1=0xf8或者p1=0xf9.4.3、小车调速设计:若要求车调速,只需用pwm来控制l298n的ena和enb就可以对小车进行调速。这里我使用定时器t0的工作模式2自动重装。并赋初值th0=0xf6;tl0=0xf6;u产生高频脉冲。c语言源代码实现:#includet#define uchar unsigned char#define uint unsigned intvoid trigon(uint ,uint ,uint ,uint ,uint ,uint);void round(uint ,uint);void rectangle(uint, uint, uint, uint, uint ,uint, uint, uint);void delay(uint k);void pwma(uchar n);void pwmb(uchar n);uchar keys();sbit p3_2=p32;sbit p3_3=p33;void main()uchar key;tmod=0x12;ea=1;et0=1;et1=1;th0=0xf6;tl0=0xf6;th1=(65536-50000)/256;tl1=(65536-50000)%256;tr0=1;tr1=1;p2=0xff;while(1)jump=0;key=keys(); / c稳定运行 d转向 e稳定运行 f转向 g稳定运行 h转向 if(key=0xfe)/ c d e f g h trigon(30,5,30,10,30,16); if(key=0xfd)round(13,70); / c稳定运行 d转向 e稳定运行 f转向 g稳定运行 h转向 i稳定运行 j转向if(key=0xfb)/ c d e f g h i jrectangle(30,4,30,4,30,4,30,16);if(key=0xf8)trigon(30,5,30,10,30,16);jump=0;delay(1000);round(13,70);jump=0;delay(1000);rectangle(30,4,30,4,30,4,30,16);void timer0() interrupt 1num0+;void timer1() interrupt 3num1+;th1=(65536-50000)/256;tl1=(65536-50000)%256;void trigon(uint c,uint d,uint e,uint f,uint g,uint h)uint aa,bb,cc,dd,ee;aa=c+d;bb=aa+e;cc=bb+f;dd=cc+g;ee=dd+h;delay(3000);num1=0;num0=0;while(!jump& key!=0)if(num1=1) / 正转稳定运行p1=0xfa;pwmb(70);pwma(70);if(num1c+1)&num1(aa+1)&num1(bb+1)&num1(cc+1)&num1(dd+1)&num1ee) /停止num1=0;num0=0;p1=0xf0;jump=1;p3_2=0;p3_3=0;key=0;void pwma(uchar n)if(num0=100)num0=0;五、 调试中出现的问题1 转向时间需要慢慢调,时间长,旋转弧度大;时间短,旋转弧度小。2 直行时,由于每个电机的性能不一样,导致两侧占空比一样时,小车会存在转弯,这样需要微调占空比。六、 参考文献1 楼然苗,李光飞. 51系列单片机设计实例.北京航空航天大学出版社2 何希才. 常用集成电路应用实例.电子工业出版社3 王静霞 单片机应用技术(c语言版) 电子工业出版社 g an employment tribunal claiemployment tribunals sort out disagreements between employers and employees.you may need to make a claim to an employment tribunal if: you dont agree with the disciplinary action your employer has taken against you your employer dismisses you and you think that you have been dismissed unfairly.for more information about dismissal and unfair dismissal, seedismissal.you can make a claim to an employment tribunal, even if you haventappealedagainst the disciplinary action your employer has taken against you. however, if you win your case, the tribunal may reduce any compensation awarded to you as a result of your failure to appeal.remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are complaining about happened. if your application is received after this time limit, the tribunal will not usually accept i.if you are worried about how the time limits apply to you, take advice from one of the organisations listed underfurther help.employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation.most people find making a claim to an employment tribunal challenging. if you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the organisations listed underfurther help.if you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your compensation if you win the case. this is known as adamages-based agreement. in england and wales, your solicitor cant charge you more than 35% of your compensation if you win the case.if you are thinking about signing up for a damages-based agreement, you should make sure youre clear about the terms of the agreement. it might be best to get advice from an experienced adviser, for example, at a citizens advice bureau. to find your nearest cab, including those that give advice by e-mail, click onnearest cab.for more information about making a claim to an employment tribunal, seeemployment tribunals.the (lack of) air up there watch mcayman islands-based webb, the head of fifas anti-racism taskforce, is in london for the football associations 150th anniversary celebrations and will attend citys premier league match at chelsea on sunday.i am going to be at the match tomorrow and i have asked to meet yaya toure, he told bbc sport.for me its about how he felt and i would like to speak to him first to find out what his experience was.uefa hasopened disciplinary proceedings against cskafor the racist behaviour of their fans duringcitys 2-1 win.michel platini, president of european footballs governing body, has also ordered an immediate investigation into the referees actions.cska said they were surprised and disappointed by toures complaint. in a statement the russian side added: we found no racist insults from fans of cska.age has reached the end of the beginning of a word. may be guilty in his seems to passing a lot of different life became the appearance of the same day; may be back in the past, to oneself the paranoid weird belief disillusionment, these days, my mind has been very messy, in my mind constantly. always feel oneself should go to do something, or write something. twenty years of life trajectory deeply shallow, suddenly feel something, do it.一字开头的年龄已经到了尾声。或许是愧疚于自己似乎把转瞬即逝的很多个不同的日子过成了同一天的样子;或许是追溯过去,对自己那些近乎偏执的怪异信念的醒悟,这些天以来,思绪一直很凌乱,在脑海中不断纠缠。总觉得自己自己似乎应该去做点什么,或者写点什么。二十年的人生轨迹深深浅浅,突然就感觉到有些事情,非做不可了。the end of our life, and can meet many things really do?而穷尽我们的一生,又能遇到多少事情是真正地非做不可?during my childhood, think lucky money and new clothes are necessary for new year, but as the advance of the age, will be more and more found that those things are optional; junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, suddenly found that isnt really grow up, it seems is not so important; then in high school, think dont want to give vent to out your inner voice can be in the high school children of the feelings in a period, but was eventually infarction when graduation party in the throat, later again stood on the pitch he has sweat profusely, looked at his thrown a basketball hoops, suddenly found himself has already cant remember his appearance.童年时,觉得压岁钱和新衣服是过年必备,但是随着年龄的推进,会越来越发现,那些东西根本就可有可无;初中时,以为要有一场暗恋才意味着真正的成长,但三年过去后,自己心平气和的写同学录的时候,突然就发现是不是真正的成长了,好像并没有那么重要了;然后到了高中,觉得非要吐露出自己的心声才能为高中生涯里的懵懂情愫划上一个句点,但毕业晚会的时候最终还是被梗塞在了咽喉,后来再次站在他曾经挥汗如雨的球场,看着他投过篮球的球框时,突然间发现自己已经想不起他的容颜。originally, this world, can produce a chemical reaction to an event, in addition to resolutely, have to do, and time.原来,这个世界上,对某个事件能产生化学反应的,除了非做不可的坚决,还有,时间。a persons time, your ideas are always special to clear. want, want, line is clear, as if nothing could shake his. also once seemed to be determined to do something, but more often is he backed out at last. dislike his cowardice, finally found that there are a lot of love, there are a lot of miss, like shadow really have been doomed. those who do, just green years oneself give oneself an arm injection, or is a self-righteous spiritual.一个人的时候,自己的想法总是特别地清晰。想要的,不想要的,界限明确,好像没有什么可以撼动自己。也曾经好像已经下定了决心去做某件事,但更多的时候是最后又打起了退堂鼓。嫌恶过自己的怯懦,最终却发现有很多缘分,有很多错过,好像冥冥之中真的已经注定。那些曾经所谓的非做不可,只是青葱年华里自己给自己注射的一支强心剂,或者说,是自以为是的精神寄托罢了。at the moment, the sky is dark, the air is fresh factor after just rained. suddenly thought of blue plaid shirt; those were broken into various shapes of stationery; from the corner at the beginning of deep friendship; have declared the end of the encounter that havent start planning. those years, those days of do, finally, like youth, will end in our life.此刻,天空是阴暗的,空气里有着刚下过雨之后的清新因子。突然想到那件蓝格子衬衫;那些被折成各种各样形状的信纸;那段从街角深巷伊始的友谊;还有那场还没有开始就宣告了终结的邂逅计划那些年那些天的非做不可,终于和青春一样,都将在我们的人生中谢幕。baumgartner the disappointing news: mission aborted. r plays an important role in this mission. starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. the balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. it will climb higher than the tip of mount everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.the supersonic descent could happen as early as sunda.the weathethe balloon will slowly drift to the edge of space at 120,000 feet ( then, i would assume, he will slowly step out onto something resembling an olympic diving platform.below, the earth becomes the concrete bottom of a swimming pool that he wants to land on, but no
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年专利代理人考试真题及答案
- 2025年档案员考试试题及答案
- 2025年幼儿园保健医生培训试题及答案
- 面试官指南社群健康助理员初级岗位评估维度与问题设计
- 项目风险管理识别评估-应对风险
- 碳排放管理体系运行有效性自我评估报告
- 数字营销经理中级广告策略及投放方案
- 宠物殡葬礼仪师中级心理疏导及哀伤辅导技巧
- 炼钢工面试学习进度跟踪
- 殡仪服务员技能鉴定无纸化考试题库建设方案
- 人才培养方案修订汇报
- 【好题汇编】2023-2025年高考物理真题分类汇编 专题 机械振动与机械波(有解析)
- 2025年甘肃省兰州市中考英语试卷(含答案)
- 2025消化内镜室护士护理应知应会考核试题及答案
- 牙科种植与修复病例的多学科联合治疗
- 2025年党纪学习教育应知应会100条(含答案)【收藏学习】
- 冠心病防治科普知识
- 建筑工程企业管理案例
- 师承确有专长考试中药学功效表格记忆
- Unit1YouandMe单元知识清单-人教版七年级英语上册
- 2025年图书管理员职称考试试题及答案
评论
0/150
提交评论