Cov txheej txheem:

SnappyXO Precise Mover Robot: 6 Kauj Ruam
SnappyXO Precise Mover Robot: 6 Kauj Ruam

Video: SnappyXO Precise Mover Robot: 6 Kauj Ruam

Video: SnappyXO Precise Mover Robot: 6 Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
SnappyXO Precise Mover Robot
SnappyXO Precise Mover Robot

Ua rau koj tus neeg hlau Arduino mus ncaj nraim rau qhov tshwj xeeb nrug lossis ntswj mus rau lub kaum ntse ntse tshwj xeeb uas siv PreciseMovement Arduino lub tsev qiv ntawv.

Tus neeg hlau xav tau lub npas dov lossis sib npaug kom txo qis kev sib txhuam thaum sib ntswg.

www.pololu.com/product/954

Koj tuaj yeem qhia tus neeg hlau mus rau tom ntej mus rau qhov tshwj xeeb nrug lossis ntswj mus rau lub kaum ntse ntse tshwj xeeb. Qhov kev zov me nyuam txiav txim siab nws txoj haujlwm siv kev suav tuag. Txij li txoj haujlwm kwv yees tsuas yog siv lub log nrawm, kev nplua yuav ua rau muaj qhov yuam kev loj. Tus tsim qauv ntawm tus neeg hlau yuav tsum tau ceev faj kom txo qis kev pheej hmoo ntawm kev swb.

Qhov no tau sim ua haujlwm nrog SnappyXO neeg hlau.

Kauj Ruam 1: Hloov Chaw Qhia Ntawv

Cov ntawv qhia tau raug hloov mus rau nplooj ntawv hauv qab no. Phau ntawv qhia no tsis raug khaws cia ntxiv lawm.

sites.google.com/stonybrook.edu/premo

Kauj Ruam 2: Tsim SnappyXO Differential Drive Robot

Lub tsev qiv ntawv PreciseMovement uas peb yuav siv tsuas yog sib xws nrog cov neeg tsav tsheb sib txawv. Koj tuaj yeem xaiv siv lwm 2 lub log tsav neeg hlau.

Kauj Ruam 3: Txuas Cov Khoom Siv Hluav Taws Xob

Txuas Cov Khoom Siv Hluav Taws Xob
Txuas Cov Khoom Siv Hluav Taws Xob

Rau tus txheej txheem SnappyXO Optical Encoder:

D0 (encoder tso zis) -> Arduino Digital Pin

VCC -> Arduino 5V

GND -> GND

Tsav thiab Arduino Hwj chim:

Lub zog siv hluav taws xob yuav tsum txaus rau lub cav koj siv. Rau SnappyXO cov khoom siv, 4AA roj teeb tau siv rau lub zog tsav thiab 9V roj teeb rau lub zog Arduino. Nco ntsoov tias lawv txhua tus muaj GND ib txwm muaj.

Kauj ruam 4: Nruab PreciseMovement Arduino Library

Rub tawm:

github.com/jaean123/PreciseMovement-library/releases

Yuav ua li cas rau nruab Arduino Library:

wiki.seeedstudio.com/How_to_install_Arduino_Library/

Kauj ruam 5: Code

Arduino Txoj Cai:

create.arduino.cc/editor/whileloop/7a35299d-4e73-409d-9f39-2c517b3000d5/preview

Cov kev ntsuas no xav tau kev hloov kho. Lwm qhov tsis cim npe pom zoo ntawm tus lej tuaj yeem hloov kho kom ua tau zoo dua.

  • Txheeb xyuas thiab teeb tsa lub koob tsav hauv qab ARDUINO PINS.
  • Teeb LENGTH thiab RADIUS.

    • LENGTH yog qhov deb ntawm lub log sab laug mus rau lub log sab xis.
    • RADIUS yog lub vojvoog ntawm lub log.
  • Teem PULSES_PER_REV, uas yog tus lej ntawm cov mem tes tso tawm tus lej nkag rau ib lub kiv puag ncig.

    • Nco tseg qhov no txawv ntawm tus naj npawb ntawm cov pulses tus encoder tso tawm rau ib lub cav kiv puag ncig tshwj tsis yog cov encoders txuas nrog nyeem ncaj qha los ntawm lub log log.
    • PULSES_PER_REV = (pulses rau ib lub kiv puag ncig ntawm lub cev muaj zog ncej) x (iav piv)
  • Teeb STOP_LENGTH yog tias koj pom tias tus neeg hlau ua haujlwm ntau dhau tom qab txav mus los.

    Tus neeg hlau yuav nres thaum qhov kev kwv yees txoj haujlwm yog STOP_LENGTH deb ntawm lub hom phiaj. Yog li, STOP_LENGTH, yog qhov kev kwv yees nyob deb xav tau rau tus neeg hlau kom nres

  • PID tsis

    KP_FW: Qhov no yog qhov sib npaug ntawm kev txav mus los. Ua kom qhov no kom txog thaum tus neeg hlau mus ncaj. Yog tias koj tsis tuaj yeem tau txais nws mus ncaj los ntawm kev kho qhov no, tom qab ntawd kho vajtse yog qhov ua txhaum. (xws li lub log misalignment, thiab lwm yam)

    KP_TW: Qhov no yog qhov feem sib luag ntawm qhov sib zog txav PID. Tsuas yog pib los ntawm tus nqi qis thiab nce qhov no kom txog rau thaum nrawm nrawm, lossis nrawm nrawm ntawm cov neeg hlau thaum sib tw, nrawm nrawm, tab sis tsis ua rau muaj kev nrawm. Txhawm rau ua qhov kev soj ntsuam, koj tuaj yeem muaj tus neeg hlau hloov pauv los ntawm 0 txog 90 thiab rov qab los ntawm kev tso cov hauv qab no hauv lub voj ua haujlwm

Muab qhov no tso rau hauv lub voj kom qhib KP_FW:

mover.forward (99999);

Muab qhov no tso rau hauv voj los hloov ntawm 0 txog 90 kom qhib KP_TW:

mover.twist (90); // Twist 90 CW

ncua (2000);

mover.twist (-90) // Twist 90 CCW

ncua (2000);

Nco ntsoov tias txhawm rau txhawm rau txhawm rau nrawm nrawm ntawm lub kaum ntse ntse ntawm TARGET_TWIST_OMEGA, KI_TW kuj tseem yuav tsum tau kho dua vim tias tus tswj hwm sib npaug yuav tsis sib haum rau lub hom phiaj tseeb. Txawm li cas los xij, nws tsis yog qhov yuav tsum tau tig ntawm qhov nrawm nrawm. Lub nrawm nrawm tsuas yog xav tau qeeb txaus.

Kauj Ruam 6: Nws Ua Haujlwm Li Cas

Yog tias koj xav paub seb nws ua haujlwm li cas nyeem rau.

Kev txav mus rau tom ntej yog khaws ncaj nraim siv txoj kev ua raws txoj hauv kev ncaj ntawm txoj kab ncaj ncees.

Kev sib tw PID tswj kom ua kom nrawm nrawm nrawm ntawm TARGET_TWIST_OMEGA. Nco ntsoov tias qhov nrawm nrawm no yog qhov nrawm nrawm ntawm tag nrho cov neeg hlau tsis yog lub log. Tsuas yog siv tus tswj PID nkaus xwb thiab cov zis yog PWM sau nrawm ntawm ob sab laug thiab sab xis. Kev suav tuag yog ua tiav los xam lub kaum ntse ntse. Thaum lub kaum sab xis mus txog qhov yuam kev pib, tus neeg hlau nres.

Pom zoo: