【正文】
2011年全國大學(xué)生電子設(shè)計競賽PWM控制直流電機(jī)轉(zhuǎn)速(A題)【高職組】2011年9月6日17摘 要 本設(shè)計主要要實現(xiàn)的功能是,通過直流電機(jī)PWM控制系統(tǒng),實現(xiàn)對直流電機(jī)的加速、減速以及電機(jī)的正轉(zhuǎn)、反轉(zhuǎn)和急停,并且可以調(diào)整電機(jī)的轉(zhuǎn)速,能夠很方便的實現(xiàn)電機(jī)的智能控制。主要采用直流電機(jī)PWM調(diào)速系統(tǒng)以AT89S52單片機(jī)為控制核心,由命令輸入模塊、LCD顯示模塊及電機(jī)驅(qū)動模塊組成。使用帶中斷的獨立式鍵盤作為命令的輸入,單片機(jī)在程序控制下,定時不斷給L298直流電機(jī)驅(qū)動芯片發(fā)送PWM波形H型驅(qū)動電路完成電機(jī)正、反轉(zhuǎn)和急??刂?,同時單片機(jī)不停的將PWM脈寬調(diào)制占空比送到LCD1602液晶來完成實時顯示。 關(guān)鍵詞:直流電機(jī);PWM;控制。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 dc motor driver chip L298 PWM waveform H drive circuit to plete the motor positive and reverse and stop control, meanwhile microcontroller of the PWM pulse width modulation duty cycle to the LCD1602 LCD to plete realtime display. Keywords: dc motor。 PWM. Control. 目 錄一 系統(tǒng)方案設(shè)計與分析 ……………………………………………41系統(tǒng)總體框圖 ………………………………………………………42方案論證與選擇 ……………………………………………………4 控制模塊的論證與選擇…………………………………………4 輸入模塊的論證與選擇…………………………………………4 …………………………………………5 傳感器的論證與選擇 …………………………………………53理論分析與計算 ……………………………………………………5 PWM調(diào)速原理 ……………………………………………………5 PWM調(diào)速方法……………………………………………………6二 硬件電路設(shè)計 ……………………………………………………61控制系統(tǒng) ……………………………………………………62驅(qū)動模塊 ……………………………………………………73顯示模塊 ……………………………………………………8三 軟件設(shè)計 ……………………………………………………91程序流程圖四 調(diào)試結(jié)果與分析……………………………………………………10五 元器件清單 ……………………………………………………12六 參考文獻(xiàn) ……………………………………………………12七 總結(jié) ……………………………………………………12附錄一:原理圖 ……………………………………………………13附錄二:源程序 ……………………………………………………14一 系統(tǒng)方案設(shè)計與分析1系統(tǒng)總體框圖本系統(tǒng)主要由控制模塊、顯示模塊、電機(jī)驅(qū)動模塊、傳感器模塊、電源模塊等組成,系統(tǒng)總體框圖如圖1所示。圖1 系統(tǒng)總體框圖2方案論證與選擇 控制模塊的論證與選擇方案一:采用嵌入式系統(tǒng)。特點是硬件結(jié)構(gòu)相對于AT80C51復(fù)雜,編程容易。價格低廉、 采用CMOS技術(shù)和RISC架構(gòu),低功耗(μA)、具有SLEEP(休眠)功能。AVR的一條指令執(zhí)行速度可達(dá)50ns (20MHz),而耗