Cov txheej txheem:

Arduino L293D Tsav Tsav Tsheb Shield Tutorial: 8 Kauj Ruam
Arduino L293D Tsav Tsav Tsheb Shield Tutorial: 8 Kauj Ruam

Video: Arduino L293D Tsav Tsav Tsheb Shield Tutorial: 8 Kauj Ruam

Video: Arduino L293D Tsav Tsav Tsheb Shield Tutorial: 8 Kauj Ruam
Video: Драйвер двигателей L293D, Подключение к Arduino 2024, Hlis ntuj nqeg
Anonim
Arduino L293D Tsav Tsav Tsheb Shield Tutorial
Arduino L293D Tsav Tsav Tsheb Shield Tutorial

Koj tuaj yeem nyeem qhov no thiab ntau lwm yam kev qhia zoo kawg ntawm ElectroPeak lub vev xaib raug cai

Txheej txheem cej luam

Hauv qhov kev qhia no, koj yuav kawm paub yuav ua li cas tsav DC, stepper thiab servo motors siv Arduino L293D lub cev tsav tsheb.

Yam Koj Yuav Kawm:

  • Cov ntaub ntawv dav dav txog DC motors
  • Taw qhia rau L293D lub cev tiv thaiv kab mob
  • Tsav DC, Servo & Stepper motors

Kauj Ruam 1: Tsav Tsheb & Tsav Tsheb

Tsav Tsheb & Tsav Tsheb
Tsav Tsheb & Tsav Tsheb

Cov motors yog ib feem sib cais tsis tau ntawm ntau qhov kev tsim kho neeg hlau thiab hluav taws xob thiab muaj ntau hom sib txawv uas koj tuaj yeem siv nyob ntawm lawv daim ntawv thov. Nov yog qee cov ntaub ntawv hais txog ntau hom motors:

DC Motors: DC lub cev muaj zog yog hom cav uas tuaj yeem siv tau rau ntau daim ntawv thov. Peb tuaj yeem pom nws hauv tsheb tswj chaw taws teeb, neeg hlau, thiab lwm yam Lub tshuab no muaj cov qauv yooj yim. Nws yuav pib dov los ntawm kev siv qhov ntsuas hluav taws xob kom raug rau nws qhov kawg thiab hloov nws cov lus qhia los ntawm kev hloov pauv qhov hluav taws xob. DC lub cev muaj zog nrawm yog tswj ncaj qha los ntawm kev siv hluav taws xob. Thaum Cov qib hluav taws xob tsawg dua qhov siab tshaj qhov ua tau zoo, qhov nrawm yuav txo qis.

Stepper Motors: Hauv qee qhov haujlwm xws li 3D tshuab luam ntawv, tshuab luam ntawv thiab tshuab CNC peb yuav tsum paub lub cav tig cov kauj ruam kom raug. Hauv cov xwm txheej no, peb siv Stepper motors. Stepper lub cev muaj zog yog lub tshuab hluav taws xob uas faib kev sib hloov puv rau hauv cov lej sib npaug. Tus nqi ntawm kev sib hloov ntawm ib kauj ruam yog txiav txim siab los ntawm lub cev muaj zog qauv. Cov motors no muaj qhov raug siab heev.

Servo Motors: Servo motor yog DC lub cev yooj yim nrog txoj haujlwm tswj kev pabcuam. Los ntawm kev siv servo koj yuav tuaj yeem tswj tus nqi ntawm kev sib tsoo thiab txav nws mus rau txoj haujlwm tshwj xeeb. Lawv feem ntau muaj qhov me me thiab yog qhov kev xaiv zoo tshaj plaws rau cov neeg hlau caj npab.

Tab sis peb tsis tuaj yeem txuas cov tshuab no rau microcontrollers lossis cov tswj hwm xws li Arduino ncaj qha txhawm rau tswj hwm lawv vim tias lawv xav tau ntau dua tam sim no dua li microcontroller tuaj yeem tsav tau yog li peb xav tau cov tsav tsheb. Tus neeg tsav tsheb yog ib qho kev sib tshuam sib txuas ntawm lub cev muaj zog thiab chav tswj hwm kom yooj yim rau kev tsav tsheb. Drives tuaj ntau hom sib txawv. Hauv cov lus qhia no, koj kawm ua haujlwm ntawm L293D lub cev tiv thaiv kab mob.

L293D ntaub thaiv npog yog pawg tsav tsheb raws L293 IC, uas tuaj yeem tsav 4 DC lub cev muaj zog thiab 2 tus neeg tsav tsheb lossis Servo lub cev muaj zog tib lub sijhawm.

Txhua cov channel ntawm cov qauv no muaj qhov siab tshaj tam sim no ntawm 1.2A thiab tsis ua haujlwm yog tias qhov hluav taws xob ntau dua 25v lossis tsawg dua 4.5v. Yog li ceev faj nrog xaiv lub cav kom raug raws li nws qhov muaj nuj nqis thiab qhov tam sim no. Rau ntau qhov tshwj xeeb ntawm daim thaiv no cia peb hais txog kev sib raug zoo nrog Arduini UNO thiab MEGA, kev tiv thaiv hluav taws xob thiab cua sov ntawm lub cev muaj zog thiab tshem tawm kev sib txuas hauv qhov xwm txheej ntawm qhov hluav taws xob tsis zoo.

Kauj Ruam 2: Yuav Siv Li Cas Arduino L293D Tsav Tsheb Tsav Tsheb?

Yuav Siv Li Cas Arduino L293D Tsav Tsheb Tsav Tsheb?
Yuav Siv Li Cas Arduino L293D Tsav Tsheb Tsav Tsheb?

Thaum siv daim thaiv no 6 analog Pins (uas tuaj yeem siv ua tus pin ib yam nkaus), tus pin 2 thiab tus pin 13 ntawm arduino yog pub dawb.

Hauv kev siv Servo lub cev muaj zog, tus pin 9, 10, 2 tau siv.

Hauv kev siv DC lub cev muaj zog, tus pin 11 rau #1, tus pin 3 rau #2, tus pin 5 rau #3, tus pin 6 rau #4 thiab tus pin 4, 7, 8 thiab 12 rau txhua tus ntawm lawv tau siv.

Thaum siv Stepper lub cev muaj zog, tus pin 11 thiab 3 rau #1, tus pin 5 thiab 6 rau #2 thiab tus pin 4, 7, 8 thiab 12 rau txhua tus ntawm lawv tau siv.

Koj tuaj yeem siv cov pins dawb los ntawm kev txuas txuas.

Yog tias koj tab tom thov cais cov khoom siv hluav taws xob rau Arduino thiab ntaub thaiv npog, xyuas kom tseeb tias koj tau txuas lub jumper ntawm daim ntaub thaiv.

Kauj Ruam 3: Tsav DC Tsav

Tsav DC Tsav
Tsav DC Tsav

#suav nrog

Lub Tsev Qiv Ntawv koj xav tau los tswj lub cav:

AF_DCMotor lub cev muaj zog (1, MOTOR12_64KHZ)

Txheeb xyuas DC lub cav koj siv.

Thawj qhov kev sib cav sawv cev rau tus naj npawb ntawm cov motors hauv daim ntaub thaiv thiab qhov thib ob yog sawv cev rau kev tswj lub cev muaj zog nrawm. Qhov kev sib cav zaum thib ob tuaj yeem yog MOTOR12_2KHZ, MOTOR12_8KHZ, MOTOR12_8KHZ, thiab MOTOR12_8KHZ rau cov motors naj npawb 1 thiab 2, thiab nws tuaj yeem yog MOTOR12_8KHZ, MOTOR12_8KHZ, thiab MOTOR12_8KHZ rau cov motors naj npawb 3 thiab 4. thiab yog tias tsis yog lawm

motor.setSpeed (200);

Txhais lub cev muaj zog ceev. Nws tuaj yeem teeb tsa los ntawm 0 txog 255.

void voj () {

motor.run (FORWARD);

ncua (1000);

motor.run (rov qab);

ncua (1000);

motor.run (tso tawm);

ncua (1000);

}

Muaj nuj nqi motor.run () qhia meej txog lub cev muaj zog li cas. Qhov xwm txheej tuaj yeem yog FORWARD, BACKWARD, thiab RELEASE. Kev tso tawm yog tib yam li tus nres tab sis nws yuav siv qee lub sijhawm kom txog thaum lub cav nres tag.

Nws raug pom zoo kom siv lub 100nF capacitor rau txhua lub tshuab pins kom txo suab nrov.

Kauj Ruam 4: Tsav Servo Tsav

Tsav Tsav Servo Tsav
Tsav Tsav Servo Tsav

Arduino IDE lub tsev qiv ntawv thiab cov piv txwv tsim nyog rau kev tsav tsheb Servo lub cev.

#suav nrog

Lub tsev qiv ntawv koj xav tau rau kev tsav tsheb Servo motor

Servo tswj;

Txheeb xyuas qhov khoom siv Servo motor.

void teeb tsa () {

myservo.attach (9);

}

Txiav txim tus pin txuas rau Servo. (Tus pin 9 rau sevo #1 thiab tus pin 10 rau servo #2)

void voj () {

myservo.write (nqi);

ncua (15);

}

Txiav txim siab tus nqi ntawm kev sib hloov lub cev muaj zog. Nruab nrab ntawm 0 txog 360 lossis 0 txog 180 raws li lub cev muaj zog.

Kauj Ruam 5: Tsav Stepper Tsav

Tsav Stepper Tsav
Tsav Stepper Tsav

#suav nrog <AFMotor.h>

Txiav txim siab lub tsev qiv ntawv koj xav tau

AF_Stepper lub cev muaj zog (48, 2);

Txheeb xyuas Stepper lub cev muaj zog yam khoom. Thawj qhov kev sib cav yog lub cav daws teeb meem theem. (piv txwv li, yog tias koj lub cev muaj qhov ntsuas pom tseeb ntawm 7.5 deg/kauj ruam, nws txhais tau tias lub cev muaj zog daws teeb meem yog. Qhov kev sib cav zaum thib ob yog tus lej ntawm Stepper lub cev muaj zog txuas nrog daim ntaub thaiv.

teeb tsa tsis muaj dabtsis () {motor.setSpeed (10);

motor.onestep (FORWARD, SINGLE);

lub cev.release ();

ncua (1000);

}

lub voj void () {motor.step (100, FORWARD, SINGLE);

motor.step (100, rov qab, TSEEB);

motor.step (100, FORWARD, DOUBLE); motor.step (100, Rov qab, DOUBLE);

motor.step (100, mus tom ntej, INTERLEAVE); motor.step (100, Rov qab, INTERLEAVE);

motor.step (100, mus rau tom ntej, MICROSTEP); motor.step (100, Rov qab, MICROSTEP);

}

Txiav txim siab lub cev muaj zog nrawm hauv rpm.

Thawj qhov kev sib cav yog tus naj npawb ntawm cov kauj ruam xav tau txav mus, qhov thib ob yog txiav txim siab kev taw qhia (FORWARD lossis BACKWARD), thiab qhov kev sib cav zaum thib peb txiav txim siab hom theem: SINGLE (Qhib ib lub kauj), DOUBLE (Qhib ob coils rau ntau lub zog), INTERLEAVED (Kev hloov pauv tas li ntawm cov coils los ntawm ib mus rau ob thiab hloov pauv mus rau ob npaug qhov tseeb, txawm li cas los xij, qhov no, qhov nrawm yog ib nrab), thiab MICROSTEP (Hloov cov kauj ruam tau ua tiav qeeb rau qhov tseeb dua. Hauv qhov no, lub zog qis dua). Yog lub neej ntawd, thaum lub tshuab nres txav, nws tswj hwm nws cov xwm txheej.

Koj yuav tsum siv lub cav ua haujlwm.release () tso lub cav.

Kauj Ruam 6: Yuav Arduino L293D Tsav Tsheb Tsav Tsheb

Yuav Arduino L293D Shield los ntawm ElectroPeak

Kauj Ruam 7: Lwm Yam Haujlwm:

  • L293D: Theory, Diagram, Simulation & Pinout
  • Tus Pib Phau Ntawv Qhia Kom Tswj Cov Tsav Tsheb los ntawm Arduino & L293D

Kauj Ruam 8: Zoo Li Peb ntawm FaceBook

Yog tias koj pom cov ntawv qhia no muaj txiaj ntsig thiab txaus siab thov nyiam peb hauv facebook.

Pom zoo: