【正文】
( 2)由于小車(chē)采用的是普通 DC 馬達(dá),所以小車(chē)的操控不是那么精準(zhǔn),執(zhí)行急轉(zhuǎn)彎時(shí)也不是很平穩(wěn),除非能在小車(chē)的底部多加幾個(gè)相同的光電傳感器。 根據(jù)以上介紹的設(shè)計(jì)方案,完成小車(chē)硬件電路上 PCB 模板的制作,各個(gè)元件的焊接以及軟件的調(diào)試與下載。由于操作簡(jiǎn)單,連接方便,它是研究和開(kāi)發(fā) ARM的最實(shí)用工具。當(dāng)小車(chē)運(yùn)行時(shí),黑色導(dǎo)航線(xiàn)應(yīng)一直恰好被控制在兩個(gè)主要傳感器 L1 和 R1 之間。圖像處理程序的任務(wù)就是識(shí)別黑白圖像上的點(diǎn)和過(guò)濾噪音,記錄與圖像有關(guān)的點(diǎn)位置,最后通過(guò)控制策略的運(yùn)算法則,實(shí)現(xiàn)小車(chē)沿著導(dǎo)航線(xiàn)的跟蹤和轉(zhuǎn)向。它耗能低,尺寸小,僅占一個(gè) I/O 端口。它里面的 PWM 生成模塊可 以通過(guò)編程設(shè)計(jì)來(lái)改變輸出矩形波的填充系數(shù),并從而改變馬達(dá)上的電壓,增強(qiáng)對(duì)馬達(dá)運(yùn)行速度的控制。實(shí)驗(yàn)結(jié)果證明,設(shè)計(jì)的智能小車(chē)操作平穩(wěn),跟蹤性能良好。 L2 and R2 are secondary sensors. The distance between the two ipsilateral sensors should nor be more than width of the black direction control. When the car is running, the black guide line is always kept right between the two primary sensors L1 and L2. When the car goes off the black line, the primary sensors detect it, and thus the ARM7 chip detect level jump and execute the preprepared correction program to navigate the car back onto the track. The secondary sensors are actually a backup for the primary. Once the car offsets the track for inertia, beyond the reach of detection of the primary probes, the secondary perform to correct the motion of the car, so as to ensure the reliability of tracking. 3 Design of software The software is developed in C language in Keil Uvision3 IDE, debugged and downloaded in JLink ARM emulator. JLink is a JTAG emulator which was brought out by SEGGER in USA to support emulation chips with ARM core. It works with IDEs such as IAREWARM, ADS, Keil, WINARM, and RealView, supports all ARM7/ARM9 core chips simulation, and seamlessly connects with various IDE by RDI interface. Easy to operate and to connect to, it is the most practical tool for study and development of ARM. The key for the design of software lies in the control process of tracking. The sensors are equipped with E3FDS10C4 integrated infrared probes with photoelectric switch. There are only three wires( power wire, ground wire, and signal wire) at the output pin of the module. Connect the signal wire to I/O port of ARM7 chip, and execute enquiry check. Low level will be detected for the black guide line, while high level for the white floor. According to the principles stated above, flows of the algorithm for control tracking of the car. Twostage control method is adopted to ensure the car’s adherence to the black guide line, and the effect is satisdied. 4 Debugging of the finished car Based on the design scheme presented above, finish making of PCB board for hardware circuit of the car, welding of ponents, and debugging and downloading of the software. Test the car for several times