第三屆技術(shù)報告南郵沖浪者_第1頁
第三屆技術(shù)報告南郵沖浪者_第2頁
第三屆技術(shù)報告南郵沖浪者_第3頁
第三屆技術(shù)報告南郵沖浪者_第4頁
第三屆技術(shù)報告南郵沖浪者_第5頁
已閱讀5頁,還剩44頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、第三屆“飛”大學智能汽車邀請技術(shù)第三屆“飛”大學智能汽車邀請技術(shù)學I &)*+,- &)*+,-GHKH 2.1,!-2.2GHKH 2.1,!-2.23.1 3.2 3.3 ZHR_HR5.15.25.35.45.55.6+6.16.26.36.6Hf6.16.26.36.6HfYhjlHnoT3qu11.1i11.2AD*6+),-_aby67/0MdHCS12u:;?#Pd7aKb-1Hc -*6+),-_aby67/0MdHCS12u:;?#Pd7aKb-1Hc - 1 2、 機械結(jié)構(gòu)設(shè)3流2、 機械結(jié)構(gòu)設(shè)3流程設(shè)- 2 PDF 文件使用 ctory三智能車發(fā)展歷1、最初形三智能車發(fā)展

2、歷1、最初形態(tài)(如圖 - 3 vwZxyPz?FqKMbc?PdTO:exLF=Pf:$g(h-Hz0PvwZxyPz?FqKMbc?PdTO:exLF=Pf:$g(h-Hz0PA,M-.K/09Ma1Z #N/?Rj5#I#/0;ZN;*FMI0r6A-PIJ/45MNvoa Hz - 4 (1)。(3)(1)。(3)1/2(5)(6)四機械設(shè)計部- 5 合舵機豎放左右左后輪測右后輪1、 路徑檢測紅外傳感器的安-合舵機豎放左右左后輪測右后輪1、 路徑檢測紅外傳感器的安- 6 PDF 文件使用 ctory 試用版本創(chuàng)建 電主2、 起跑線檢測紅外傳2、 起跑線檢測紅外傳感器的安71.71.50%

3、3、舵機的安- 7 4定- 4定- 8 15、電池的安6、主板15、電池的安6、主板的固- 9 7、 測速電機的7、 測速電機的安33887- 10*R1HNOjR2940*R1HNOjR2940p# 2940 yvI8#vDcdeNOyMmn7B?oN#O,tuQHYN, pM5zIMZ9n,AD4HEGHIMUbZ5z-z,!deK7XU|AKYMADO4ez-=c;*5bcMEFIhJ,c; Wz-z*Kdr*sMmn=Yo,e*KH*s 5H- 16AD線以及白板所獲得的 AD1234567可以看到,第六個紅外傳感器采回的是黑線的 AD 值,而其它的傳感器采回的是白70.在確定舵機的偏

4、轉(zhuǎn)角的時候可以對對管設(shè)定權(quán)值來設(shè)定偏轉(zhuǎn)角,假設(shè)舵機的控制函數(shù)為 Direction(char angel),其中傳遞的形參的范圍為 AD線以及白板所獲得的 AD1234567可以看到,第六個紅外傳感器采回的是黑線的 AD 值,而其它的傳感器采回的是白70.在確定舵機的偏轉(zhuǎn)角的時候可以對對管設(shè)定權(quán)值來設(shè)定偏轉(zhuǎn)角,假設(shè)舵機的控制函數(shù)為 Direction(char angel),其中傳遞的形參的范圍為 110190,七個紅外采回的 AD 值分別放在left2,left1,mid,right1,right2,right3angel=150+(right3-left3)/4+(right2-left2

5、)/6+ ( right1 - left ) / 86電調(diào)節(jié)方。七調(diào)試過程及數(shù)據(jù)分的參數(shù)整定過(1I,DP(2PPI- 17PDF 文件使用 ctory 試用版本創(chuàng)建 (3(4KSW=YdA,p1mnNopT fPj2H*3H u(3(4KSW=YdA,p1mnNopT fPj2H*3H u4H xRG|i5H4?e(014140W2e%PdMNO,F-=W_xyMz91nuU-hJb 81,m-,(;e7l),t1u-t2u9:#.HCS12#f89/. .t7uHCS1289/- 19%PdMNO,F-=W_xyMz91nuU-hJb 81,m-,(;e7l),t1u-t2u9:#.HCS

6、12#f89/. .t7uHCS1289/- 191H#include /* common defines and macros #include /* derivative LINK_INFO unchar unsigned DIR_MID -ON_LINE /*AD d;1H#include /* common defines and macros #include /* derivative LINK_INFO unchar unsigned DIR_MID -ON_LINE /*AD d;midl midr - 20;/; typedef d ATD struct mid ; type

7、def struct controler Controler void Delay100us( unchar time ) /+nvoid Delay100ms( unchar time ) /+n/*LCDy Init_LCD( void ) _unchar( unchar number, unchar x, unchar y ) ;/; typedef d ATD struct mid ; typedef struct controler Controler void Delay100us( unchar time ) /+nvoid Delay100ms( unchar time ) /

8、+n/*LCDy Init_LCD( void ) _unchar( unchar number, unchar x, unchar y ) /elm iZUbunchar_char( char number, unchar x, unchar y ( number, unchar x, unchar y ) /elm - 21iZUbvoid _(number, unchar x, unchar y ) ( void ) Moto( speed ) Direction( unchar dir ;/*ADvoid Init_ATD( void ) /ADvoid D( d* atdget )

9、/NwADInit_IO( void ) /q I/O _My Control_dir( ATD atdget, unchar* dir ) ; IJ ATD Init_Control( void ) (con_speed ) void iZUbvoid _(number, unchar x, unchar y ) ( void ) Moto( speed ) Direction( unchar dir ;/*ADvoid Init_ATD( void ) /ADvoid D( d* atdget ) /NwADInit_IO( void ) /q I/O _My Control_dir( A

10、TD atdget, unchar* dir ) ; IJ ATD Init_Control( void ) (con_speed ) void speed( char void Sci0Open( void ) void Sci0Write( unsigned char chSend ) unsigned char Sci0Read( ) /*EEPROM;- 22(volatile)EER_PROTECTED_WRONG (-EER_PARAMETER_WRONG (-S(-S Init_ATD( void ) Init_ATD( void PORTB_BIT5 = 0 ATD0CTL2

11、|= Delay100us( 5 (volatile)EER_PROTECTED_WRONG (-EER_PARAMETER_WRONG (-S(-S Init_ATD( void ) Init_ATD( void PORTB_BIT5 = 0 ATD0CTL2 |= Delay100us( 5 ;=;=;=;D( ATD* atdget - 23while( ( );atdget-=ATD0DR0H atdget-=atdget-=atdget-midr atdget-midl atdget-=atdget-=atdget-=ATD0CTL2 &= 0 x7F #define LCD_POR

12、T /LCDWky#define LCD_CON while( ( );atdget-=ATD0DR0H atdget-=atdget-=atdget-midr atdget-midl atdget-=atdget-=atdget-=ATD0CTL2 &= 0 x7F #define LCD_PORT /LCDWky#define LCD_CON /LCDt_mode Clear Off0 x08 Poist On - 24Init_LCD( void ) Is_busy( void mand( cmd ) Write_data( unchar data_w ) Display_one_cha

13、r( unchar unchar x, unchar )void _unchar( unchar number, unchar x, y) miZUbuncharvoid _char( char number, unchar x, unchar );void ( number, unchar x, y);/elm iZUbvoid _(number, unchar x, unchar y ;Init_LCD( void DDRB |= ;DDRA |= ;LCD_PORT = ;LCD_CON = ;)Init_LCD( void ) Is_busy( void mand( cmd ) Wri

14、te_data( unchar data_w ) Display_one_char( unchar unchar x, unchar )void _unchar( unchar number, unchar x, y) miZUbuncharvoid _char( char number, unchar x, unchar );void ( number, unchar x, y);/elm iZUbvoid _(number, unchar x, unchar y ;Init_LCD( void DDRB |= ;DDRA |= ;LCD_PORT = ;LCD_CON = ;);Delay

15、100us( 5 ) );Off ;) On ) -25void Is_busy( void DDRA 0 x00 &= |= /PORTA;/PORTBRS,R/W,E 口設(shè)定為 0, while LCD_PORT );&= ;DDRA 0 xFF /PORTAvoid Is_busy( void DDRA 0 x00 &= |= /PORTA;/PORTBRS,R/W,E 口設(shè)定為 0, while LCD_PORT );&= ;DDRA 0 xFF /PORTA/PORTALCD_PORT ;令mand( )Delay100us( 5 ) Is_busy() LCD_PORT= LCD_

16、CON LCD_CON ;cmd ;/PORTBRS,R/W, E0, Delay100us( 5 ;0.5/將ELCD_CON LCD_PORT - 26Write_data( )Delay100us( 5 ;Is_busy( LCD_PORT= LCD_CON ;0 xEa ;LCD_CON = 0 x11 Delay100us( 5 LCD_CON&=Write_data( )Delay100us( 5 ;Is_busy( LCD_PORT= LCD_CON ;0 xEa ;LCD_CON = 0 x11 Delay100us( 5 LCD_CON&=0 xEF LCD_PORT = /

17、PORTBRS,R/W,E1,00.5/將E;void Display_one_char( if( x 16 | x 2 | y 0 y = 1 if( 2 = y ) x+=0 x40;x = x + mand( ; /向液晶輸出數(shù)據(jù)Write_data( data_w - 27_unchar( number, unchar x, y)unchar i unchar num 3 x = ( x - 1 ) * ;num = / -= num 0 * 100 1= number / 2= number - num 1 * i=0; i 3; i + Display_one_char( num

18、i + 48, x, y x + Display_one_char( , x, y ) _unchar( number, unchar x, y)unchar i unchar num 3 x = ( x - 1 ) * ;num = / -= num 0 * 100 1= number / 2= number - num 1 * i=0; i 3; i + Display_one_char( num i + 48, x, y x + Display_one_char( , x, y ) _char( number, unchar x, unchar y unchar i unchar num

19、 x = ( x - 1 * 4 if( number 0 number = -( number ) Display_one_char( -, x, y ) - 28x + Display_one_char( , x, y ) x + num = number / -= num 0 * 100 1= number / 2= number - num 1 i=0; i 3; i + Display_one_char( i + x, x + ( number, y)i num x + Display_one_char( , x, y ) x + num = number / -= num 0 *

20、100 1= number / 2= number - num 1 i=0; i 3; i + Display_one_char( i + x, x + ( number, y)i num num = / 10000 -= 10000 num 0 num = / 1000 -= num 1 * 1000 num = number / 100 -= num 2 * 100 num = number / 10 - 29num 4 = number - num 3 * 10 x = ( x - 1 ) * 6 for( i = 0; i 5; i + Display_one_char( num i

21、+ 48, x, y ;x + Display_one_char( , x, y ) _(number, unchar x, y)unchar i unchar num 5 x = ( x - 1 ) * 9 if( number 0 number = -( number ) Display_one_char( -, x, y ) x + num = / 10000 -= 10000 num 0 num 4 = number - num 3 * 10 x = ( x - 1 ) * 6 for( i = 0; i 5; i + Display_one_char( num i + 48, x,

22、y ;x + Display_one_char( , x, y ) _(number, unchar x, y)unchar i unchar num 5 x = ( x - 1 ) * 9 if( number 0 number = -( number ) Display_one_char( -, x, y ) x + num = / 10000 -= 10000 num 0 num = / 1000 -= num 1 * 1000 num = number / 100 -= num 2 * 100 num = number / 10 num = number - num 3 * 10 -

23、30for( i = 0; i 5; i + Display_one_char( num i + 48, x, y ;x + Display_one_char( x, y ) ( ) Moto( ) Direction( );void E 0 x00 =0 x20 M2D3= ;/T)v-Wfor( i = 0; i = )/ if( speed SPD_FMAX )/ speed = SPD_FMAX =0 =speed / if( speed =u130170tDIR_RMAXPDIR_LMAXP/uuFMdiruDirection( unchar dir ic pre_dir = DIR

24、_MID if( dir pre_dir DTY23 = DIR_RMAX + ;Delay100us( 5 ) else if( dir =u130170tDIR_RMAXPDIR_LMAXP/uuFMdiruDirection( unchar dir ic pre_dir = DIR_MID if( dir pre_dir DTY23 = DIR_RMAX + ;Delay100us( 5 ) else if( dir DIR_RMAX dir = if( dir DIR_LMAX dir = DIR_LMAX DTY23 = dir ;#define i - 33Ui =0 E 3 =

25、0, 0, 0 (con_speed i = con_speed - now_speed =(Ei-Ei-1)2)+Ei-Ei-1+(Ui =0 E 3 = 0, 0, 0 (con_speed i = con_speed - now_speed =(Ei-Ei-1) 3 ) + ( E i 6 ) +(Ei-(Ei-11)+E- 2 ) / = + dU i - E -1;i - E ;Moto( ( )Ui ) 6H.char conspeed void Init_Control( )TIOS = ;/PTPT_myPT_My - 34= 0 / PT = ;/T)v-WnOu7P)vnF

26、u4TIE 0 x07 /PT1 PT2 PT3y = ;PT_My T1= ;TCNT = ;=/PT0oW2500t2500 4V10000V 0.01=;/PT1oW 125004PH0.05=;= 0 / PT = ;/T)v-WnOu7P)vnFu4TIE 0 x07 /PT1 PT2 PT3y = ;PT_My T1= ;TCNT = ;=/PT0oW2500t2500 4V10000V 0.01=;/PT1oW 125004PH0.05=;/ PT2oW625004PH0.25cli CODE_SEG NEAR_SEG errupt _Control( )sic speedtim

27、es = ;sspeed_sum 0;temp_speed 32 = 0 - -if( 0 ( PORTK_BIT2 ) speed = else 1 = ( PORTK_BIT2 ) speed = - 1 0 x01 TC0 +=2500 if( 0 = ( % 5 ) flag CODE_SEG CODE_SEG NEAR_SEG errupt 9 Dir_Control( void if( 0 ( PORTK_BIT2 ) speed = else 1 = ( PORTK_BIT2 ) speed = - 1 0 x01 TC0 +=2500 if( 0 = ( % 5 ) flag

28、CODE_SEG CODE_SEG NEAR_SEG errupt 9 Dir_Control( void ATD atdget unchar dir asm sei Init_ATD( ) D( &atdget ) Control_dir( atdget, &dir - 36Direction( dir ) TC1 += 12500 T1 |= 0 x02 conspeed = 10 flag = 1 asm cli CODE_SEG CODE_SEG NEAR_SEG errupt 10 )1 |= 0 x04 TC2 += 62500 CODE_SEG 7H,-Controler ctr

29、l dir_cal = 0 void Control_dir( ATD )sic unchar l_or_r = 0 unchar =0;Direction( dir ) TC1 += 12500 T1 |= 0 x02 conspeed = 10 flag = 1 asm cli CODE_SEG CODE_SEG NEAR_SEG errupt 10 )1 |= 0 x04 TC2 += 62500 CODE_SEG 7H,-Controler ctrl dir_cal = 0 void Control_dir( ATD )sic unchar l_or_r = 0 unchar =0;=

30、0;=0;=0;- 37char differ_mid = 0 char adder = 0 if(atdget.left2ON_LINE|atdget.left1ON_LINE| atdget.midl ON_LINE )is_on_linechar differ_mid = 0 char adder = 0 if(atdget.left2ON_LINE|atdget.left1ON_LINE| atdget.midl ON_LINE )is_on_line=1; l_or_r = 1 ;else if( atdget.right2 ON_LINE | atdget.midr ON_LINE

31、 )ON_LINE l_or_r = =;1 if( is_on_line differ_mid =-;atdget.midl - atdget.midr if( differ_side3 = 3 = -differ_side3 - 38= 3 if( = 3 = -;= 3 if( = 3 if( = 3 = -;= 3 if( = 3 = -;= 3 if( differ_mid 0 =-differ_mid = 3 = -differ_mid = 3 - 39;differ_mid *= ctrl.mid if( 4 PORTE 1);1);2);differ_mid, 2, );add

32、er=differ_side3+differ_side2+differ_side1+differ_midif( adder 0 ;differ_mid *= ctrl.mid if( 4 PORTE 1);1);2);differ_mid, 2, );adder=differ_side3+differ_side2+differ_side1+differ_midif( adder 0 dir_cal -= adder dir_cal += adder *dir = DIR_MID + ;!l_or_r *dir +=5 l_or_r - 40*dir = DIR_LMAX *dir = DIR_

33、RMAX if( 3 = PORTE is_on_line, 2);1);8H#define Num ;differ_mid Num unchar temp extern Controler ;/ unchar count *dir = DIR_LMAX *dir = DIR_RMAX if( 3 = PORTE is_on_line, 2);1);8H#define Num ;differ_mid Num unchar temp extern Controler ;/ unchar count Init_LCD( ) ( ) Init_IO( ) Init_Control( ) PORTB=

34、 0 x00 - -_unchar( 255, 1);ctrl.mid 1;=2 =3 for( ; ; atdget unchar dir ;differ_mid Init_ATD( ) D( &atdget ;Control_dir( atdget, );Direction( ) =-;=-;=-;differ_mid atdget.midr - atdget.midl temp = & 0 x0F switch( _unchar( 255, 1);ctrl.mid 1;=2 =3 for( ; ; atdget unchar dir ;differ_mid Init_ATD( ) D( &atdget ;Control_dir( atdget, );Direction( ) =-;=-;=-;differ_mid atdget.midr - atdget.midl temp = & 0 x0F switch( )case 0 _unchar( 1 ) _unchar( atdget.left2, 2, 1 ) - 42_unchar( atdget.left1, 1, 2 ) atdget.midl, 2, );break case 1 atdget.right3, 1);atd

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論