資源描述:
《基于Matlab simulink編程的Arduino閉環(huán)控制小車(chē).pdf》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、河南科技大學(xué)畢業(yè)設(shè)計(jì)(論文)基于Matlab/simulink編程的閉環(huán)控制小車(chē)上位機(jī)軟件設(shè)計(jì)摘要隨著科學(xué)技術(shù)的發(fā)展,直流電機(jī)的應(yīng)用越來(lái)越廣泛,驅(qū)動(dòng)與控制直流電機(jī)的方式方法也越來(lái)越多。計(jì)算機(jī)軟件與單片機(jī)技術(shù)也高度發(fā)展,越發(fā)成熟,目前計(jì)算機(jī)已經(jīng)能夠通過(guò)軟件實(shí)現(xiàn)與單片機(jī)的無(wú)縫對(duì)接。本設(shè)計(jì)就是一種基于PC軟件Matlab/simulink編程的閉環(huán)控制小車(chē)上位機(jī)軟件系統(tǒng),用于控制一輛小車(chē)。該小車(chē)由兩臺(tái)帶有編碼器的直流電機(jī)驅(qū)動(dòng),兩輪獨(dú)立驅(qū)動(dòng)。小車(chē)在閉環(huán)控制系統(tǒng)作用下,能夠遵循上位機(jī)指令運(yùn)動(dòng):前進(jìn),后退,加速,減速,轉(zhuǎn)彎,停止。Matlab/simulink和驅(qū)動(dòng)小車(chē)的單片機(jī)系統(tǒng)能夠
2、通過(guò)串口無(wú)縫對(duì)接,Matlab/simulink模型能夠在線(xiàn)監(jiān)測(cè)小車(chē)狀態(tài),并且可以能夠?qū)崟r(shí)整定控制系統(tǒng)參數(shù),對(duì)小車(chē)的運(yùn)行狀態(tài)進(jìn)行控制。本設(shè)計(jì)采用的電機(jī)是普通直流電機(jī),兩電機(jī)各帶有一個(gè)編碼器;采用的單片機(jī)為Avr單片機(jī)--ArduinoMega2560。單片機(jī)接受上位機(jī)指令,檢測(cè)電機(jī)編碼器脈沖。指令和反饋的實(shí)際值比較后,經(jīng)過(guò)PID控制算法的處理得到控制量,最后通過(guò)PWM方式,通過(guò)L298N控制電機(jī)旋轉(zhuǎn)。小車(chē)在閉環(huán)控制系統(tǒng)作用下,能夠遵循指令運(yùn)動(dòng)。關(guān)鍵詞:Matlab/simulink,直流電機(jī),PWM,PID反饋調(diào)節(jié),ArduinoMega2560單片機(jī)河南科技大學(xué)畢業(yè)設(shè)計(jì)(
3、論文)PCPROGRAMDESIGNOFTHECARWITHPIDCONTROLLBASEDONMATLAB/SIMULINKABSTRACTWiththedevelopmentoftechnology,DCmotor’sapplicationsgetsmoreandmoreextensive,andthewaystodriveandcontroltheDCmotorsbecomemore.PCprogramandthetechnologyofsinglechiphighlydeveloped,becomemoremature,soatthepresenttimePCcan
4、connectwithsinglechipwithoutgapthroughprogram.Thisdesignisakindofclosed-loopPCprogramsystembasedonMatlab/simulink,thatcontrolsasmallcar.ThecarisdrivebytwoDCmotorwithencoder,andthetwoDCmotorisdrivealone.ThecarcanmovefollowthecommandofPCundertheclosed-loopcontrolsystem:forward,back,speedup,s
5、lowdown,turn,andstop.ThesinglechipsystemdrivethecarcanconnectwithMatlab/simulinkwithoutgapthroughUSB,andMatlab/simulinkcanmonitorthestateofthecaronline,andcansetandcontroltheparametersofsystemrealtimetocontrolthemovestateofthecar.Inthisdesign,thenormalDCmotorsisused,twomotorseachwithanenco
6、der,theAVRsinglechipisused----ArduinoMega2560.ThesinglechipachievethecommandsofPC,monitorthepulsesofencoders.Thecommandscomparedwiththeactualvalue,thengetthecontrolvaluethroughPIDcontrol,finally,throughPWMcontroltheDCmotorswheelbyL298N.Thecarcanmovefollowthecommandsunderclosed-loopcontrols
7、ystem.KEYWORDS:Matlab/simulink,DCmotor,PWM,PIDfeedbackcontrol,ArduinoMega2河南科技大學(xué)畢業(yè)設(shè)計(jì)(論文)目錄前言..................................................................................................1第1章硬件介紹..............................................................