【正文】
,c。 } /*************左轉(zhuǎn)函數(shù) **********************/ void left() { t1 =55。 //左電機(jī)繼續(xù) } /*******中斷服務(wù)子程序 *******/ void timer0(void) interrupt 1 { p10=!p10。 //右電機(jī) pwm else Right_moto_pwm=0。 init()。 //夾緊延時(shí) right1()。 DelayMS(500)。//此處延時(shí)時(shí)間需調(diào)整 Left_moto_stop。xiachuan) { run()。 // run()。 left()。 Right_moto_stop。 ET1=1。 if(num1=t1) Left_moto_pwm=1。 //左電機(jī)繼續(xù) } void right1() { t1 =60。 } /*********后退函數(shù) ************/ void back() { t1 =40。 sbit zuochuan=P0^7。 時(shí)右電機(jī)前轉(zhuǎn) define Right_moto_back {IN3=0,IN4=1。該模塊采用串行接口與主處理器進(jìn)行通信,接口線數(shù)量大 幅度減少,包括地和電源信號(hào)線共有 8 支,傳輸速率高達(dá) 4bps,可全速寫入顯示數(shù)據(jù),無等待時(shí)間。占用太單片機(jī) IO 口顯示信息量少,占用太多 的程序資源。 電機(jī)驅(qū)動(dòng)模塊 根據(jù)題目中的要求,電機(jī)的速度不會(huì)很快,普 通的電機(jī)很難滿足要求,而直流減速電機(jī)可以滿足此要求。39。 Abstract This design uses STC89C52 microcontroller as the main controller chip, with wooddetection module, liquid crystal display, power supply module, in order to realize the automatic control of automatic guided robot. Handling robot in the process of moving through the infrared detection technology to sense the block position, and then transmitted to the STC89C52 microcontroller, control the direction of movement to change the robot PWM processed by the single chip, and then by controlling the servo manipulator to realize the catch block. In addition the design can be displayed through the display module for each run time. 目 錄 1 系統(tǒng)方案 的設(shè)計(jì)、比較與論證 ........................................................... 錯(cuò)誤 !未定義書簽。 ...............................................................................................7 機(jī) 械 手 工 作 模 塊 的 設(shè)計(jì) 錯(cuò)誤 ! 未 定 義 書簽。分別向單片機(jī)和電機(jī)單獨(dú)供電,實(shí)現(xiàn)了控制電路電源和單片機(jī)電源隔離,避由免了電源供電時(shí)電機(jī)啟停產(chǎn)生的大電流對單片機(jī)和其他模塊的影響。 圖 3 電機(jī)驅(qū)動(dòng)電路 紅外避障模塊 方案一: TK20 黑白線檢測傳感器。運(yùn)行時(shí)間應(yīng)力求最短(從合上電源開關(guān)開始計(jì)時(shí))。} //P0^0 P0^1 接 IN1 IN2 當(dāng) P3_4=0,P3_5=1。 //此參數(shù)調(diào)節(jié)上限值 uchar PWM2_MAX=100。i) for (j=110。 t2 =40。amp。 TH0=(a/256)。DelayMS(480)。 while(chuan) { back()。 } } if(shangchuan==0) { run()。 //buzu 390 while(zuochuanamp。xiachuan) { run()。 Left_moto_stop。 //消抖 } DelayMS(50)。 Right_moto_stop。 EA=1。 else c=20210