【正文】
**************************************************************///中斷處理程序,實(shí)現(xiàn)輸出方波占空比控制///*************************************************************************timer_1() interrupt 3 using 1 ///定時(shí)器1中斷,使用寄存器組1{ TR1=0。 ///停止定時(shí) zc++。 ///中斷次數(shù)加1 ys++。 control()。 speedcan()。 TH1=0Xfa。 ///重裝定時(shí)初值 TL1=0X24。 TR1=1。}///*************************************************************************///脈寬控制程序,實(shí)現(xiàn)PWM的輸出///*************************************************************************control(){ if(zc==a) {ena=0。 } if(zc==15) { zc=0。 ena=1。 }}///*************************************************************************///顯示子函數(shù),顯示當(dāng)前電機(jī)的速度///*************************************************************************display(){ uchar i。 gw=speedbuf%10。 ///求速度個(gè)位值送各位顯示緩沖 sw=(speedbuf/10)%10。 ///求速度十位值送十位顯示緩沖 bw=(speedbuf/100)%10。 ///求速度百位值送百位顯示緩沖 qw=speedbuf/1000。 ///求速度千位值送千位顯示緩沖 for(i=0。i4。) ///循環(huán)選中數(shù)碼管的每一位 { P2=wm[i]。 if(i==0) ///顯示個(gè)位 { P0=zm[gw]。 delays()。 } else if(i==1) ///顯示十位 { P0=zm[sw]。 delays()。 } else if(i==2) ///顯示百位 { P0=zm[bw]。 delays()。 } else if(i==3) ///顯示千位 { P0=zm[qw]。 delays()。 } i++。 }}///*************************************************************************///讀速度值子函數(shù),從計(jì)數(shù)器0中讀計(jì)數(shù)值,經(jīng)過(guò)計(jì)算,求出當(dāng)前速度值///*************************************************************************speedcan(){ if(ys==500) { TR0=0。 ///停止計(jì)數(shù) speedbuf=((TH0*256+TL0)*8)/3。///讀計(jì)數(shù)器 ys=0。 TH0=0。 ///重裝計(jì)數(shù)初值 TL0=0。 TR0=1。 ///開(kāi)計(jì)數(shù)器 }}///*************************************************************************///延時(shí)子函數(shù)///*************************************************************************delays(){ uchar i。 for(i=80。i0。i)。}///*************************************************************************///鍵盤掃描子函數(shù),實(shí)現(xiàn)電機(jī)的方向 速度的控制///*************************************************************************key(){ uchar i。 P1=0xff。 ///拉高P1口的電平 i=P1。 ///讀P1口 if(i==0xfe) ///第一個(gè)鍵按下 { delays()。 ///延時(shí)去抖動(dòng) if(i==0xfe) ///再判斷按鍵是否按下 { in1=0。 ///電機(jī)順時(shí)針轉(zhuǎn)動(dòng) in2=1。 } } if(i==0xfd) ///第二個(gè)鍵是否按下 { delays()。 ///延時(shí)去抖動(dòng) if(i==0xfd) ///再判斷按鍵是否按下 { in1=1。 ///電機(jī)逆時(shí)針轉(zhuǎn)動(dòng) in2=0。 } } if(i==0xfb) ///第三個(gè)鍵是否按下 { delays()。 if(i==0xfb) { a=a+n。 ///速度加((慢速) if(a=15) a=15。 } } if(i==0xf7) { delays()。 if(i==0xf7) { if(a3) ///速度減(慢速) a=an。 else a=3。 } } if(i==0xef) { delays()。 if(i==0xef) { a=a+m。 ///速度加,(快速) if(a=15) a=15。 } } if(i==0xdf) { delays()。 if(i==0xdf) if(a3) ///速度減,(快速) a=am。 else a=3。} if(i==0xbf) { delays()。 if(i==0xbf) { in1=0。 ///停止轉(zhuǎn)動(dòng) in2=0。 } } if(i==0x7f) { delays()。 if(i==0x7f) a=5。 ///回到中間速度 } while(P1!=0xff)。 ///等待按鍵放下}2013屆畢業(yè)設(shè)計(jì)課題任務(wù)書(shū)院(系):電氣與信息工程學(xué)院 專業(yè):電氣工程及其自動(dòng)化 指導(dǎo)教師學(xué)生姓名課題名稱基于單片機(jī)的直流調(diào)速系統(tǒng)的設(shè)計(jì)內(nèi)容及任務(wù) 分析單片機(jī)對(duì)直流電機(jī)進(jìn)行速度測(cè)量應(yīng)用的基本原理,并用單片機(jī)產(chǎn)生PWM波來(lái)控制直流電機(jī)的可逆調(diào)速,從而實(shí)現(xiàn)了對(duì)普通直流電機(jī)的轉(zhuǎn)速測(cè)量和轉(zhuǎn)速調(diào)節(jié)。研究以單片機(jī)AT89S52和IR2110控制的直流電機(jī)脈寬調(diào)制調(diào)速系統(tǒng)。利用AT89S52芯片可以進(jìn)行低成本直流電動(dòng)機(jī)控制系統(tǒng)的設(shè)計(jì),并且能夠簡(jiǎn)化系統(tǒng)構(gòu)成、降低系統(tǒng)成本、增強(qiáng)系統(tǒng)性能、以滿足更多應(yīng)用場(chǎng)合的需要。擬達(dá)到的要求或技術(shù)指標(biāo)要求:(1)設(shè)計(jì)一個(gè)單閉環(huán)調(diào)速系統(tǒng),通過(guò)外接鍵盤及按鈕實(shí)現(xiàn)直流電機(jī)正轉(zhuǎn)、反轉(zhuǎn)及速度調(diào)節(jié)控制。(2)直流電機(jī)轉(zhuǎn)速調(diào)節(jié)范圍為3050轉(zhuǎn)/秒,實(shí)時(shí)測(cè)量電機(jī)的實(shí)際轉(zhuǎn)速,并要求在LED數(shù)碼管上顯示出來(lái)。(3)選擇可以構(gòu)成閉環(huán)系統(tǒng)的方案、選擇所需器件和模塊、以及IGBT管組成橋式斬波電路。(4)要求系統(tǒng)實(shí)現(xiàn)對(duì)電機(jī)的正轉(zhuǎn)、反轉(zhuǎn)、急停、加速、減速的控制,以及PWM的占空比在LED上的實(shí)時(shí)顯示。(5)對(duì)直流電機(jī)模型進(jìn)行PID控制分析。(6)對(duì)直流電機(jī)進(jìn)行MATLAB仿真和分析。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 don39。t 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 haven39。tappealedagainst the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation 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 plaining 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 pensation if you win the case. This is known as adamagesbased agreement. In England and Wales, your solicitor can39。t charge you more than 35% of your pensation if you win the case.If you are thinking about signing up for a damagesbased agreement, you should make sure you39。re 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 , click onnearest CAB.For more information about making a claim to an employment