【正文】
四 總結(jié)采用單片機(jī)為核心,利用光電傳感器和紅外反射式傳感器作為探測(cè)系統(tǒng),設(shè)計(jì)了可以實(shí)現(xiàn)自動(dòng)尋線行走、自動(dòng)避障、報(bào)警以及遙控等功能的智能小車。三 統(tǒng)軟件設(shè)計(jì)本系統(tǒng)軟件采用模塊化結(jié)構(gòu),由主程序、初始化子程序、中斷子程序、延時(shí)子程序、按鍵發(fā)音子程序、按鍵掃描子程序構(gòu)成。為了識(shí)別一個(gè)完整的鍵信號(hào),必須對(duì)每一個(gè)編碼脈沖的寬度進(jìn)行測(cè)量,以判別接收到的脈沖是0還是1,利用單片機(jī)中的定時(shí)器/計(jì)數(shù)器來(lái)測(cè)量脈沖寬度。避障模塊主要有紅外反射式傳感器組成。但是這種方式受環(huán)境影響大,工作不穩(wěn)定。電機(jī)驅(qū)動(dòng)采用片集成電機(jī)驅(qū)動(dòng)芯片L298N。該芯片有兩個(gè)TTL/CMOS兼容電平的出入,具有良好的抗干擾性;兩個(gè)輸出端能之間驅(qū)動(dòng)電機(jī)的正反向運(yùn)動(dòng),它具有較大的電流驅(qū)動(dòng)能力,每通道能通過(guò)800mA的持續(xù)電流,~;同時(shí)它具有較低的輸出飽和壓降與靜態(tài)電流;內(nèi)置的鉗位二極管能釋放感性負(fù)載的反向沖擊電流,使它在驅(qū)動(dòng)繼電器、直流電機(jī)、步進(jìn)電機(jī)或開(kāi)關(guān)功率管的使用上安全可靠。當(dāng)傳感器檢測(cè)不到光時(shí),處于截止?fàn)顟B(tài),雙運(yùn)算放大器LM324輸出低電平給單片機(jī),由程序處理;若左路未檢測(cè)到光,則向左糾正方向;若右路未檢測(cè)到光,則向右糾正方向。本文采用的是簡(jiǎn)單實(shí)用的檢測(cè)方法,即紅外探測(cè)法。同樣由于開(kāi)關(guān)頻率高,若與快速響應(yīng)的電機(jī)相配合,系統(tǒng)可以獲得很寬的頻帶,因此快速響應(yīng)性能好,動(dòng)態(tài)抗擾能力強(qiáng)。這種方案能實(shí)現(xiàn)對(duì)電動(dòng)車的運(yùn)動(dòng)狀態(tài)進(jìn)行實(shí)時(shí)控制,控制,靈活可靠,精度高,可慢豬對(duì)系統(tǒng)的各項(xiàng)要求。本設(shè)計(jì)采用AT98C51單片機(jī)作為智能小車核心控制器。 if Fruit is met black line is absorbed ,and than the infrared cars receiving tube receiving less than signal . signal parative module design This part design USES a LM324 parator ,of sensor signal voltage received pare and amplified ,and will pare the results after Feed to the microcontroller ,used to detect sensor sensitivity ,diagram shown in figure 5 shows .When two sensors simultaneously detect light ,straight forward .When the sensor can’t detect light ,in cutoff state ,double LM324 operational amplifier output low level to microcontroller ,by program processing ,If left not detected light ,then left correct direction。 If the right has not been detected light ,then turn correct direction . motor control and driving module design Because use is double drive cars ,this part of the circuit must be able to output of two different voltage values ,respectively to controlling trolley right and left two motor drive ,the two of the wheel speed and direction of the same or different ,thus to control its advance and turning .In system design process ,use two L9110 chips to connect SCM and dc motor respectively .L9110 is for control and drive motor design two channels pushpull power amplifier applicationspecific integrated circuit device ,discrete circuits in monolithic IC integrated such that the peripheral equipments in lower cost and the whole machine can carry on sexual high .The core slice two a TTL/CMOS and let electricity flat lose into ,have good antijamming ,two output terminal can pick flooding dynamic electric machine straight to the shipment of positive reverse move and it has had a big electricity flow flooding dynamic can force ,each call way can pass over 800mA continuous current ,peak current capacity of ~OA 。本系統(tǒng)以單片機(jī)為控制核心,實(shí)現(xiàn)電動(dòng)機(jī)的前進(jìn)、退、左轉(zhuǎn)和右轉(zhuǎn)功能。直流調(diào)速系統(tǒng)采用脈寬調(diào)速系統(tǒng),其主電路采用脈寬調(diào)制式變換器,簡(jiǎn)稱PWM變換器。根據(jù)以上綜合比較,以及本設(shè)計(jì)中受控電機(jī)的容量和直流電機(jī)調(diào)速的發(fā)展方向,本設(shè)計(jì)采用了H型單極型可逆PWM變換器進(jìn)行調(diào)速。紅外探測(cè)法,即利用紅外線在不同顏色的物理表面具有不同的反射性質(zhì)的特點(diǎn)。由于采用的是雙驅(qū)動(dòng)的小車,這部分電路必須能夠輸出兩個(gè)不同的電壓值,分別去控制小車的左、右兩個(gè)驅(qū)動(dòng)電機(jī),使小車的兩個(gè)車輪的轉(zhuǎn)速和方向相同或不同,從而來(lái)控制它的前進(jìn)和轉(zhuǎn)彎。循跡小車系統(tǒng)以常見(jiàn)的AT89C51單片機(jī)為核心,輔以較簡(jiǎn)單的元器件和電路設(shè)計(jì),在順利完成循跡功能的前提下,又充分考慮到了成本、外觀等問(wèn)題,因此小車的大部分電路有手工焊接完成。L298N是ST公司的產(chǎn)品,內(nèi)部包含4通道邏輯驅(qū)動(dòng)電路,是一種二相和四相電機(jī)的專用驅(qū)動(dòng)器,即內(nèi)含二個(gè)H橋的高電壓大電流雙全橋式驅(qū)動(dòng)器,接受標(biāo)準(zhǔn)TTL邏輯電平信號(hào),可驅(qū)動(dòng)46v、2A以下的電機(jī)。本文實(shí)際采用的是RPR220型反射式傳感器制作的循跡模塊。紅外反射式傳感器由1個(gè)紅外發(fā)射管(發(fā)射器)和1個(gè)光電二