Cov txheej txheem:

UCL - Embedded - Xaiv thiab Qhov Chaw: 4 Kauj Ruam
UCL - Embedded - Xaiv thiab Qhov Chaw: 4 Kauj Ruam

Video: UCL - Embedded - Xaiv thiab Qhov Chaw: 4 Kauj Ruam

Video: UCL - Embedded - Xaiv thiab Qhov Chaw: 4 Kauj Ruam
Video: The Mystery Of The Sutton Hoo Anglo-Saxon Helmet | King Arthur's Britain | Timeline 2024, Hlis ntuj nqeg
Anonim
UCL - Embedded - Xaiv thiab Qhov Chaw
UCL - Embedded - Xaiv thiab Qhov Chaw

Cov lus qhia no yuav mus txawm li cas 2D xaiv thiab tso chav tsev thiab ua li cas rau nws.

Kauj ruam 1: Compunets

Compunets
Compunets

1 x Adrio Mega

2x stepper motors (peb siv JLB Stepper Motor, qauv 17H1352-P4130)

2x Stepper Motor Tsav Tus Tswj Xyuas Pawg Qauv L298N Dual H Choj DC Rau Arduino

1 x servo motor (Peb tsis muaj qhov me me ntawm qhov no)

3 x 10 k ohm resistors

2x Nylon Cov

1x12v fais fab mov

Ib co ntoo rau thav duab

Hlau

Kauj Ruam 2: Kev tsim kho

Kev tsim kho
Kev tsim kho
Kev tsim kho
Kev tsim kho
Kev tsim kho
Kev tsim kho

Thawj qhov thaum lub ntsej muag Kev Tsim Kho yog kom txiav txim siab qhov loj me thiab cov duab ntawm cov khoom khaws thiab tso mashine

Ua ntej peb tsim cov ntoo zoo. Peb tsim peb xaiv thiab tso tus ncej 50cm los ntawm 25cm los ntawm 30cm. Txhua yam tsuas yog tus thav duab, tus choj thiab nqa caj npab, tau tsim nrog lub lasercutter.

Nov yog qhov txuas rau txhua cov ntaub ntawv

Tom qab ntawd peb xav tau lub pulley system. Ntawm no peb mus nrog ob lub nplhaib 50mm thiab ib lub nplhaib 20mm. Tom qab ntawd peb muab daim kab xev nyob ib sab ntawm 20mm nrog qee cov kua nplaum. Tom qab ntawd peb nyem ob lub nplhaib 50mm ntawm ob sab ntawm lub nplhaib 20mm.

20 hli

50 hli

Tom qab ntawd peb yuav tsum tsim daim ntawv qhia swb rau ntawm caj npab. Ntawm no peb ua ob sab thiab ib lub phaj rov qab.

Uas tom qab ntawd tau glued hauv U daim ntawv. Tom qab ntawd peb txuas qhov ntawd rau tus choj.

Sab phaj

Rov qab phaj

Tam sim no cov ntu rau txav caj npab nce thiab nqis tau ua tiav. Peb yuav tsum txav nws rov qab los.

Thaum tsim qhov no peb ua kom ntseeg tau tias cov hniav sib koom ua ke. Yog li ob yam khoom tau tsim hauv tib qhov haujlwm.

Kauj ruam 3: Code

Code
Code
Code
Code
Code
Code

Cov txheej txheem yog yooj yim zoo nkauj thiab suav nrog 5 ntu

  1. Kev suav nrog Cov Tsev Qiv Ntawv thiab teeb tsa cov kev hloov pauv rau sab hauv thiab siv IO
  2. Load inputs rau Ram
  3. Sekvens, xaiv lub zog uas koj xav tau.
  4. Stepper/servo txoj haujlwm tswj
  5. Tso tawm rau ntiaj teb

Peb yuav nthuav dav piav qhia txhua ntu, tab sis nco ntsoov qhov no tsuas yog ib qho ntawm ntau qhov kev daws teeb meem.

1: Ua rau qhov tsis muaj teeb tsa peb suav nrog 2 lub tsev qiv ntawv peb xav tau rau txoj haujlwm no. Stepper thiab Servo. Siv cov tsev qiv ntawv suav nrog, txuag koj los ntawm kev kawm txhua yam ntxaws txog stepper thiab servo motors.

#suav nrog

#suav nrog

const int stepsPerRevolution = 200; // hloov qhov no kom haum cov naj npawb ntawm cov kauj ruam ib kiv puag ncig rau koj lub cav

// pib lub tsev qiv ntawv stepper ntawm tus pin 8 txog 11:

Stepper XStepper (cov kauj ruamPerRevolution, 22, 23, 24, 25); Stepper YStepper (cov kauj ruamPerRevolution, 28, 29, 30, 31); Servo tuav; // tsim cov khoom siv servo los tswj lub servo

tus Gripper yuav tsum tau muab txuas rau hauv qhov tsis muaj teeb tsa

void teeb () {// pib qhov chaw nres nkoj txuas: Serial.begin (9600); Griper.attach (9); // txuas cov servo ntawm tus pin 9 rau cov khoom siv servo

Tus so ntawm ntu no tsuas yog teeb tsa ntawm Qhov Hloov Pauv thiab Qhov Tsis Txaus Siab.

2: Thawj qhov hauv Void Loop yog thauj tag nrho cov khoom siv uas siv los hloov pauv. Qhov no ua tiav rau ob qho laj thawj. Thawj qhov laj thawj yog txwv CPU txoj haujlwm hnyav ntawm kev nyeem ntawv nkag. Qhov laj thawj thib ob, uas yog qhov tseem ceeb tshaj plaws, kom paub tseeb tias yog tias siv cov tswv yim siv ntau dua ib zaug, nws yuav muaj tus nqi zoo ib yam thoob plaws hauv kev tshuaj xyuas tag nrho. Qhov no ua rau sau txoj cai ib txwm yooj yim dua. Qhov no yog ib qho kev coj ua ntau hauv PLC lub cajmeem, tab sis nws kuj tseem siv rau kev tsim cov phiaj xwm.

// ------------------------- Tawm tswv yim rau RAM -------------------- Xend = digitalRead (34); Yend = digitalRead (35); Ena = digitalRead (36);

3: Hauv sekvens ib feem ntawm txoj cai, peb tsuas yog ua sekvens nrog Hloov thiab cov lus txib. Sekvens ib feem tsuas yog muab cov cim rau Txoj Haujlwm tswj ib feem ntawm cov cai. Qhov no tuaj yeem hloov kho tau yooj yim rau koj daim ntawv thov lossis siv ib yam nkaus.

4: Txoj haujlwm ntawm servo tsuas yog tswj los ntawm servo liberi, thiab yog tias nqe lus rau tuav tuav qhib thiab kaw.

Stepper Control yog qhov ua kom yuam kev me ntsis. Kev ua haujlwm piv rau Setpoint (Txoj haujlwm koj xav kom caj npab mus rau) thiab Txoj Haujlwm Tam Sim No. Yog tias txoj haujlwm tam sim no yog tus hlub, txoj haujlwm ntxiv rau txoj haujlwm thiab nug Stepper liberi ua haujlwm kom ua tau zoo. Qhov rov qab yog qhov tseeb rau txoj haujlwm siab. yog tias txoj haujlwm zoo ib yam li Setpoint, XinPos ntsis tau zaum siab, thiab tus nres nres.

// SP txuas ntxiv X

yog (XstepCountXsp thiab tsis yog Tsev) {

XstepCount = XstepCount-1; Xstep = -1; XinPos = 0; } yog (XstepCount == Xsp) {Xstep = 0; XinPos = 1; }

5: Ntxiv qhov kawg ntawm txoj cai lub cav tau tswj nrog lub zog liberi.

// -------------------- Output ---------------------- // nqis ib kauj ruam: XStepper.step (Xstep); // kauj ruam ib kauj ruam: YStepper.step (Ystep);

Griper.write (GripSp);

Kauj ruam 4: Ua Los Ntawm

casp6099 - Casper Hartung Christensen

rasm616d - Rasmus Hansen

Pom zoo: