【正文】
接通和斷開(kāi)電源并且根據(jù)需要改變一個(gè)周期內(nèi)“接通”和“斷開(kāi)”時(shí)間的長(zhǎng)短。圖3 L298NL298N是ST公司生產(chǎn)的一種高電壓、大電流電機(jī)驅(qū)動(dòng)芯片。輸入,接受控制器送出的串行數(shù)據(jù)和控制信號(hào),偏壓(V1∽V6)。本設(shè)計(jì)中采用了定頻調(diào)寬方式,在這種工作方式下電動(dòng)機(jī)在運(yùn)轉(zhuǎn)時(shí)比較穩(wěn)定,并且采用單片機(jī)采用PWM脈沖的軟件實(shí)現(xiàn)上比較方便。附錄一:原理圖附錄二:源程序 /* 名稱:獨(dú)立按鍵控制直流電機(jī)調(diào)速 內(nèi)容:對(duì)應(yīng)的電機(jī)接口需用杜邦線連接到l298電機(jī)控制端 使用5V12V 小功率電機(jī)皆可*/include //包含頭文件,一般情況不需要改動(dòng),頭文件包含特殊功能寄存器的定義sbit DCOUT = P3^4。count=0。 //總中斷打開(kāi) ET0=0。 DelayUs2x(245)。 if(PWM_ON!=0) //如果開(kāi)啟時(shí)間是0 保持原來(lái)狀態(tài) DCOUT = 1。 //定時(shí)器中斷打開(kāi) } if(k5==0)//停止 { IN1=0。 if(k2==0)//反轉(zhuǎn) { IN1=0。 //ms級(jí)延時(shí)//unsigned char KeyScan(void)。五 元器件清單 LCD16021100nF電容AT89S521二極管40071k排阻1DS18B201L298N17805直流小電機(jī)1uf30pF電容10uf10K電阻Led六 參考文獻(xiàn)【1】黃智偉 電路設(shè)計(jì) 北京:北京航空航天大學(xué)出版社 2011【2】【3】閆曉金 單片機(jī)應(yīng)用技能 北京:電子工業(yè)出版社2010【4】李全利 單片機(jī)原理及其應(yīng)用技術(shù) 北京:高等教育出版社 2001【5】【6】. 2002年2月趙【7】[M].合肥:合肥工業(yè)大學(xué)出版社,2005【8】劉鯤 孫春亮單片機(jī)C語(yǔ)言入門[M].北京:人民郵電出版社,2008 七 總結(jié)這個(gè)設(shè)計(jì)的幾大模塊比較明確,在編寫程序時(shí),我選擇先編寫出每一個(gè)模塊,讓每一個(gè)模塊實(shí)現(xiàn)其基本的功能,然后再逐步合并模塊,來(lái)實(shí)現(xiàn)設(shè)計(jì)的要求。在調(diào)速時(shí),IN1與IN2引腳一個(gè)為低電平,一個(gè)為高電平,,產(chǎn)生驅(qū)動(dòng)電機(jī)的PWM信號(hào)??蓞⒖枷聢D表:電機(jī)旋轉(zhuǎn)方 式控制端IN1控制端IN2控制端IN3控制端IN4輸入PWM信號(hào)改 變脈寬可調(diào)速調(diào)速端A調(diào)速端BM1正轉(zhuǎn)高低//高/反轉(zhuǎn)低高//高/停止低低//高/M2正轉(zhuǎn) //高低/高反轉(zhuǎn) //低高/高停止低低 / //高3顯示模塊LCD1602顯示模塊如圖4所示。二 硬件電路設(shè)計(jì) 1 控制系統(tǒng) 單片機(jī)80C51如圖2所示。綜合以上三種方案,本設(shè)計(jì)選擇方案二。特點(diǎn)是耗電少、壽命長(zhǎng)、成本低、故障少、可視距離遠(yuǎn),但其只能顯示數(shù)字,字母。方案二:采用AT80C51系統(tǒng)。abstractThis design mainly in order to realize the function is, through the dc motor PWM control system, the implementation of the dc motor speed, motor and reducer, move forward, reverse and stop, and can adjust the speed of the motor, can easily realize the intelligent control of the machine. Mainly adopts dc motor PWM speed regulation system AT89S52 single chip microputer as control core, by the mand input module, LCD display module and motor drive module. Using independent type keyboard with interruption as mand input, single chip microputer under program control, timing, constantly send