【正文】
附錄1智能小車照片及總接線圖 附錄 2 系統(tǒng)程序 include define uchar unsigned char define uint unsigned int /*定義驅(qū)動(dòng)電路管腳 */ sbit INPUT1 = P1^0。 sbit SS4=P0^4。 } void CarBack() { INPUT1=0。 } void CarTurnRight() { INPUT1=1。 } void Delay() //定義蜂鳴器頻率響亮子程序 { unsigned int DelayTime=20200。 //蜂鳴器響亮 } else { CarGo()。 //頻率定時(shí)循環(huán)開時(shí) return。 INPUT3=0。 INPUT3=0。 sbit Near=P0^6。 sbit INPUT3 = P1^2。在本次設(shè)計(jì)的過 程中主要做了以下的工作: ( 1) 充分利用互聯(lián)網(wǎng)和圖書館強(qiáng)大資源庫(kù),借閱了大量的相關(guān)輔導(dǎo)資料 ,從而了解了智能小車和發(fā)展前景,以及前人研究的一些經(jīng)驗(yàn)和技術(shù),確定了本次設(shè)計(jì)的大體思路 ; ( 2)在大體思路的基礎(chǔ)上,繼續(xù)查閱大量資料,依次對(duì)各部分方案進(jìn)行確定,確定各部分芯片的型號(hào),熟悉各芯片的使用 ; ( 3)通過 protues 等軟件,對(duì)各部分的電路圖進(jìn)行設(shè)計(jì) ; ( 4)確定小車程序流程圖,對(duì)各模塊進(jìn)行編程 ; ( 5)對(duì)編寫的程序進(jìn)行調(diào)試,改進(jìn),必要時(shí)修改小車設(shè)計(jì)的方案 ; ( 6)通過 protues 仿真軟件對(duì)智能小車電路進(jìn)行仿真,通過仿真小車基本上能完成預(yù)計(jì)的功能 ; ( 7)對(duì)小車元器件進(jìn)行采購(gòu) ; ( 8)組裝,焊接,進(jìn)行硬件的反復(fù)調(diào)試,完成最總的設(shè)計(jì) 。 //頻率定時(shí)循環(huán)開時(shí) return。 INPUT3=0。 INPUT3=0。 sbit Near=P0^6。 sbit INPUT3 = P1^2。數(shù)據(jù)處理包括:數(shù)據(jù)的采集、數(shù)字濾波、標(biāo)度變換等。當(dāng)三極管 Q1和 Q4 導(dǎo)通時(shí),電流將從左至右流過電機(jī),從而驅(qū)動(dòng)電機(jī)按特定方向轉(zhuǎn)動(dòng)(電機(jī)周圍的箭頭指示為順時(shí)針方向)。 本設(shè)計(jì)中采用了 L298N 雙 H 橋電機(jī)驅(qū)動(dòng)模塊,以 L298N 作為 驅(qū)動(dòng) 核心 。 小車在白色地面行駛時(shí),紅外發(fā)射管發(fā)出的紅外信號(hào)被反射,接收管收到信號(hào)后,輸出端為低電平。 單片機(jī)由 口接收循跡模塊發(fā)出的路面檢測(cè)信號(hào),通過 口控制驅(qū)動(dòng)兩個(gè)直流電機(jī)。 電源電路: 向單片機(jī)供電。 1 腳和 15腳下管的發(fā)射極分別單獨(dú)引出以便接入電流采樣電阻,形成電流傳感信號(hào)。 其檢測(cè)距離在 6mm14mm。 ALE/PROG(Pin30):地址鎖存允許信號(hào) PSEN(Pin29):外部存儲(chǔ)器讀選通信號(hào) EA/VPP(Pin31):程序存儲(chǔ)器的內(nèi)外部選通,接低電平從外部程序存儲(chǔ)器讀指 令,如果接高電平則從內(nèi)部程序存儲(chǔ)器讀指令。這樣,當(dāng)一個(gè)電機(jī)轉(zhuǎn)另一個(gè)電機(jī)不轉(zhuǎn)時(shí)實(shí)現(xiàn)轉(zhuǎn)彎,由此可以輕松的實(shí)現(xiàn)小車坐標(biāo)不變的 90 度和 180 度的轉(zhuǎn)彎。 自主循跡小車是一種集環(huán)境探索、決策規(guī)劃、自動(dòng)行駛等功能于一體的機(jī)電系統(tǒng),其設(shè)計(jì)技術(shù)涉及機(jī)電、電子、傳感、計(jì)算機(jī)控制等多門學(xué)科知識(shí),尤其涉及許多當(dāng)今前沿領(lǐng)域的相關(guān)技術(shù)。 關(guān)鍵詞 :單片機(jī) ;自動(dòng)尋跡; TCRT5000; L298N; II The Design of Intelligent Car Based on Singlechip Microputer Abstract This article introduces the design and execution of intelligent tracking main function of the car is tracking the black line to realize auto driving stably and sending alarm signal when obstacle appears. The intelligent tracking car takes AT89S52 singlechip microputer as main control processor. Using TCRT5000 singlebeam infrared photoelectric sensor for route information detection device, and L298N constant voltage constantcurrent bridge driver IC for car driving chip to drive two DC motors to forward, reverse and stop, so that the car can run by planned pathway stably. When there is an obstacle is detected in front of the car, the car will stop and send alarm obstacles removed, the car will continued to tracking the black line. Keywords: Singlechip microputer; Autotracking; TCRT5000; L298N driver IC III 目 錄 1 緒論 ...................................................................... 5 智能小車的研究背景 .................................................... 5 智能小車的自主循跡概述 ................................................ 5 設(shè)計(jì)的思路和要實(shí)現(xiàn)的功能 .............................................. 5 2 系統(tǒng)總體方案和主要芯片介紹 ................................................ 6 系統(tǒng)總體方案 .......................................................... 6 車體設(shè)計(jì) .............................................