Cov txheej txheem:

Arduino Kab Follower Wallrides Chav Kawm Whiteboard: 8 Kauj Ruam (nrog Duab)
Arduino Kab Follower Wallrides Chav Kawm Whiteboard: 8 Kauj Ruam (nrog Duab)

Video: Arduino Kab Follower Wallrides Chav Kawm Whiteboard: 8 Kauj Ruam (nrog Duab)

Video: Arduino Kab Follower Wallrides Chav Kawm Whiteboard: 8 Kauj Ruam (nrog Duab)
Video: robot race. line follower robot with arduino program 2024, Kaum ib hlis
Anonim
Image
Image

Ua raws txoj kab hauv av yog qhov tho txawv heev!

Peb tau sim saib lub kaum ntse ntse sib txawv ntawm cov thwjtim kab thiab coj lawv mus rau lwm lub dav hlau - mus rau lub tsev kawm ntawv whiteboard.

Saib dab tsi tuaj ntawm nws!

Kauj Ruam 1: Koj Xav Tau Dab Tsi?

Yuav Sib Sau Li Cas? Sib dhos Chassis
Yuav Sib Sau Li Cas? Sib dhos Chassis

Rau ib tus neeg hlau sib tw:

Mechanics:

1 x 2WD miniQ Neeg Hlau chassis; Nws yog ntau lub platform ua haujlwm rau tsim cov neeg hlau uas muaj ob lub log yooj yim

2 x 6V Micro geared lub cev muaj zog nrog 1: 150 txo piv; Cov cuab yeej siv zog suav nrog lub miniQ neeg hlau platform muaj qhov sib piv ntawm 1:50 thiab nrawm heev. Lawv yuav tsum tau hloov los ntawm cov tshuab muaj zog piv txwv li nrog 1: 150 lossis siab dua iav piv. Qhov ntau dua qhov sib piv cov iav ua rau cov neeg hlau qeeb qeeb ntawm cov ntawv dawb tab sis tsis muaj sijhawm tsawg dua uas lub log txav mus

4 x Neodymium hlau nplaum; Koj xav tau 3mm tuab hlau nplaum nrog 12mm txoj kab uas hla (rau cov uas muaj cov duab puag ncig) lossis nrog rau 12mm sab (rau cov uas muaj cov duab plaub fab). Tsis tas li, cov hlau nplaum yuav tsum muaj lub qhov rau lub tshuab ntsia hlau nrog lub taub hau taub hau feem ntau rau M3 ib qho. Qee zaum cov chaw tsim khoom hais qhia lub zog ntawm cov hlau nplaum txuas. Nws yuav tsum yog nyob ntawm thaj tsam ntawm 2kg txog 2.4kg

Electronics:

1 x Arduino UNO; On-Board lub computer. Lub platform nrov tshaj plaws ua qauv

1 x Octoliner module; Qhov muag thiab taws teeb ntawm koj qhov kev sib tw bot. Octoliner yog kab kab txias uas suav nrog 8 qhov sib cais infrared sensors tswj ntawm I2C interface

1 x Lub cev tiv thaiv kab mob; Yuav luag txhua tus qauv haum rau koj. Kuv siv qhov sib piv no raws li L298p nti

1 x 2-cell 7.4V LiPo roj teeb; Nws tuaj yeem muab qhov loj tam sim no uas cov neeg tsav tsheb xav tau kom kov yeej kev nyiam ntawm cov hlau nplaum. Lub roj teeb 2-cell muaj qhov hluav taws xob ntau ntawm 7.4V txog 8.4V. Nws txaus rau 6V lub cev muaj zog thiab tus tsim hluav taws xob tswj hwm ntawm Arduino Board. Muaj peev xwm xaiv tau. Lub roj teeb muaj peev xwm, ntev dua tus neeg hlau tsav tab sis nco ntsoov tias lub roj teeb muaj peev xwm dhau tuaj yeem hnyav. Lub peev xwm hauv thaj tsam ntawm 800mAh txog 1300mAh yog qhov zoo tshaj

Lwm yam:

4 x Txiv neej-Poj niam xaim;

4 x M3 spacer lossis Txiv neej-Poj niam sawv ntsug nrog 10mm ntev;

3 x M3 spacer lossis Txiv neej-Poj niam sawv ntsug nrog 25mm ntev lossis ntau dua;

4 x M3x8 countersunk lub taub hau tiaj tus ntsia hlau;

1 x M3 Nylon ntsia hlau;

1 x M3 Nylon hex txiv ntoo;

Ib qho M3 ntsia hlau thiab hex txiv ntseej

Rau chav kawm:

Sib nqus whiteboard dai ntawm phab ntsa;

Tuab dub hlau nplaum Board cim;

Tshwj xeeb LiPo roj teeb them lossis ntau lub charger yog tias koj xav ua ntau tus neeg hlau thiab them lawv cais

Kauj Ruam 2: Yuav Ua Li Cas Sib Sau? Sib dhos Chassis

Thaum xub thawj, koj yuav tsum tau sib sau ua ke miniQ chassis platform ua ntej hloov lub cav los ntawm cov khoom siv uas muaj zog dua nrog rau 1: 150 iav piv. Tsis txhob hnov qab muab cov xov hlau txuas rau cov neeg tiv tauj lub cav!

Kauj Ruam 3: Yuav Ua Li Cas Sib Sau? Nruab Magnets

Yuav Sib Sau Li Cas? Nruab Magnets
Yuav Sib Sau Li Cas? Nruab Magnets

Nruab cov hlau nplaum ntawm lub miniQ platform. Siv M3x10 standoffs, M3x8 lossis M3x6 tiaj countersunk screws thiab M3 ceev. Yuav tsum tau teeb tsa qhov pom nyob hauv daim duab.

Qhov tseem ceeb!

Qhov ntev ntawm qhov sawv ntsug yuav tsum yog raws nraim 10 hli. Tom qab txhim kho cov hlau nplaum, sim lub platform ntawm lub whiteboard. Tag nrho plaub lub hlau nplaum yuav tsum nyob ib sab ntawm lub rooj sib nqus sib nqus thiab cov roj hmab log ntawm lub log ntawm lub miniQ platform yuav tsum tau thauj khoom ua ntej thiab muab qee qhov kev sib txhuam nrog lub rooj tsavxwm.

Manually txav neeg hlau hla lub rooj tsavxwm. Thaum caij tsheb, cov hlau nplaum yuav tsum tsis txhob tawm ntawm lub rooj tsavxwm. Yog tias muaj cov hlau nplaum tawm los nws txhais tau tias cov log tsheb roj hmab ntawm lub log thauj khoom ntau tshaj plaws. Hauv qhov no, nce 10mm nrug ntawm txhua qhov kev tawm tsam los ntawm 1 lossis 2 hli los ntawm kev ntxiv ib khub M3 ntxhua khaub ncaws thiab sim dua.

Kauj Ruam 4: Yuav Ua Li Cas Sib Sau? Ntxiv Electronics

Yuav Sib Sau Li Cas? Ntxiv Electronics
Yuav Sib Sau Li Cas? Ntxiv Electronics

Mount Arduino UNO Board ntawm lub platform siv M3x25 standoffs, M3 screws thiab M3 ceev. Tsis txhob siv qhov kev txiav tawm luv luv, tawm qee qhov chaw hauv qab Arduino pawg thawj coj saib rau xov hlau thiab roj teeb.

Txhim Kho Lub Cev Tsav Tsheb ntawm Arduino UNO Board.

Nruab Octoliner module. Nias nws tawm tsam lub platform siv nylon M3 ntsia hlau thiab txiv ntoo.

Qhov tseem ceeb!

Tsis txhob siv cov hlau txuas txuas rau Octoliner. Qee qhov kev teeb tsa ntawm lub rooj sib tsoo tawg tau muab muag thiab siv ua IO pins. Txhawm rau tiv thaiv kev luv luv, siv cov yas txuas, piv txwv li, nylon.

Kauj Ruam 5: Yuav Ua Li Cas Sib Sau? Thaiv

Yuav Sib Sau Li Cas? Thaiv
Yuav Sib Sau Li Cas? Thaiv

Txuas tag nrho cov khoom siv hluav taws xob raws li qhia hauv daim duab. Lub Octoliner module txuas nrog ntawm 4 xov hlau (GND, 5V, SDA, SCL) mus rau Arduino UNO. Txuas cov motors mus rau Motor shield. Lub roj teeb LiPo txuas nrog rau cov ntaub ntawv tiv tauj ntawm lub zog hluav taws xob sab nraud ntawm Lub Tshuab Tsav Tsheb ntxiv rau VIN tus pin ntawm Arduino board. Hloov chaw ntawm kev siv VIN tus pin, koj tuaj yeem siv 5.5 mm x 2.1 mm fais fab ntsaws ntawm lub rooj tsavxwm.

Qhov tseem ceeb!

Thaum siv Lub Tshuab Tiv Thaiv tsis xav tau xov hlau. Ob lub cev muaj zog raug tswj los ntawm 4 tus pin. 2 PWM pins yog lub luag haujlwm rau kev nrawm ntawm kev sib hloov thaum 2 DIR pins rau kev taw qhia ntawm kev sib hloov. Feem ntau, lawv twb tau txuas nrog tshwj xeeb Arduino Board pins thiab lawv cov lej lej yuav txawv nyob ntawm tus tsim cov ntaub thaiv npog. Piv txwv li, rau kuv Lub Cev Tsav Tsheb, cov lej yog D4 D5 (DIR thiab PWM rau thawj channel) thiab D7 D6 (DIR thiab PWM rau ob channel). Rau thawj Arduino Motor shield, tus lej xov tooj sib xws rau D12 D3 (DIR thiab PWM rau thawj channel) thiab D13 D11 (DIR thiab PWM rau tus thib ob channel).

Qhov tseem ceeb!

Hobby LiPo roj teeb tsis muaj thim rov qab polarity tiv thaiv Board! Kev ua yuam kev luv ntawm qhov ua tau zoo thiab tsis zoo yuav ua rau lub roj teeb tsis ua haujlwm lossis hluav taws kub tas li.

Kauj Ruam 6: Yuav Ua Haujlwm Li Cas? XOD

Txhawm rau ua ib qhov haujlwm rau cov neeg hlau sib tw no txawm tias yooj yim dua los dhos nws.

Hauv txhua qhov kuv cov haujlwm kuv siv XOD qhov muag pom ib puag ncig uas tso cai rau kuv los tsim Arduino cov phiaj xwm duab yam tsis tas sau kab ntawv. Ib puag ncig no yog qhov zoo tshaj plaws rau cov cuab yeej ceev prototyping lossis kawm programming algorithms. Ua raws XOD cov ntaub ntawv lub vev xaib kom nyeem ntxiv.

Txhawm rau tsim cov neeg hlau no, koj yuav tsum ntxiv ib lub tsev qiv ntawv amperka/octoliner rau hauv koj qhov chaw ua haujlwm XOD. Nws yog qhov tsim nyog rau kev ua haujlwm nrog yim-channel kab sensor.

Kauj Ruam 7: Yuav Ua Haujlwm Li Cas? Ib thaj

Yuav Ua Haujlwm Li Cas? Thaj
Yuav Ua Haujlwm Li Cas? Thaj

Qhov kev zov me nyuam yog ua raws lub hauv paus ntsiab lus ntawm PID-tswj kev ua haujlwm. Yog tias koj xav paub tias PID-tus tswj hwm yog dab tsi thiab nws ua haujlwm li cas koj tuaj yeem nyeem lwm tsab xov xwm ntawm cov ncauj lus no.

Ua tibzoo saib thaj ua rau thaj nrog cov program neeg hlau. Cia saib seb muaj cov node nyob ntawm nws thiab nws ua haujlwm li cas.

octoliner-kab

Nws yog qhov pib sai ntawm amperka/octoliner XOD lub tsev qiv ntawv uas sawv cev rau Octoliner module taug qab kab. Nws tso tawm "kab kev taug qab tus nqi" uas nyob hauv thaj tsam ntawm -1 txog 1. Tus nqi 0 qhia tau tias txoj kab nyob ntawm qhov chaw nruab nrab txheeb ze rau lub teeb pom kev deb ntawm lub Octoliner board (nruab nrab ntawm CH3 thiab CH4). Tus nqi -1 sib raug rau txoj haujlwm sab laug (CH0) thaum 1 mus rau sab xis (CH1). Ntawm khau raj ntawm qhov pib pib optocoupler sensors thiab teeb tsa lawv lub teeb ci thiab qhov tsis ua haujlwm zoo. Cov tswv yim rau qhov no yog I2C qhov chaw nyob ntawm lub cuab yeej (ADDR rau Octoliner board nws yog 0x1A) thiab kab kev taug qab tus nqi hloov pauv tus nqi (UPD), Kuv teeb nws tas li.

Cov kab taug qab qhov txiaj ntsig tau pub ncaj qha rau pid-controller node.

pid-maub los

Lub node no siv kev ua haujlwm ntawm PID-tus tswj hwm hauv XOD. Lub hom phiaj (TARG) tus nqi rau nws yog 0. Nws yog lub xeev thaum kab yog raws nraim ntawm qhov nruab nrab hauv qab tus neeg hlau. Yog tias txoj kab taug qab tus nqi yog 0, PID-maub los pib dua ntawm RST tus pin. Yog tias txoj kab taug qab tus nqi sib txawv los ntawm 0, PID-maub los hloov pauv nws siv Kp, Ki, Kd coefficients rau hauv lub cev muaj zog qhov nrawm. Cov txiaj ntsig coefficients tau raug xaiv ua kev sim thiab sib npaug rau 1, 0.2 thiab 0.5, feem. Qhov hloov pauv tshiab (UPD) ntawm PID-tus tswj hwm tau teeb tsa mus tas li.

Tus nqi ua tiav ntawm PID-tus tswj hwm tau muab rho tawm los ntawm 1 thiab ntxiv rau 1. Nws tau ua tiav los ua kom lub cev muaj zog sib txawv, kom ua rau lawv tig mus rau hauv cov lus qhia rov qab thaum txoj kab poob lawm. Tus nqi 1 hauv cov node no sawv cev rau qhov siab tshaj plaws ntawm lub cav. Koj tuaj yeem txo qhov nrawm los ntawm kev nkag mus rau tus nqi qis.

h-choj-dc-motor

Ob peb ntawm cov nodes no yog lub luag haujlwm rau kev tswj cov neeg hlau sab laug thiab sab xis. Ntawm no teeb tsa PWM thiab DIR tus lej tus nqi los ntawm qhov uas koj Lub Cev Tsav Tsheb ua haujlwm.

Nyem qhov thaj thiab sim koj qhov kev sib tw bot. Yog tias koj ua raws cov lus qhia hauv kev sib dhos, koj tsis tas yuav hloov thaj lossis kho PID-tus tswj. Cov teeb tsa tshwj xeeb yog qhov pom tau zoo heev.

Qhov kev kawm tiav tuaj yeem nrhiav tau hauv lub tsev qiv ntawv gabbapeople/whiteboard-race

Kauj Ruam 8: Qhia Tawm thiab Cov Lus Qhia

Pom zoo: