Yuav Ua Li Cas Txuas Cov Xov Tooj Txhuam Rau Arduino

Cov txheej txheem:

Yuav Ua Li Cas Txuas Cov Xov Tooj Txhuam Rau Arduino
Yuav Ua Li Cas Txuas Cov Xov Tooj Txhuam Rau Arduino

Video: Yuav Ua Li Cas Txuas Cov Xov Tooj Txhuam Rau Arduino

Video: Yuav Ua Li Cas Txuas Cov Xov Tooj Txhuam Rau Arduino
Video: Coj Phom Mus Tua Lub Qhov Tsua Muaj Khoom Zoo, Tim Li Cas Tiag 2024, Kaum ib hlis
Anonim

Raws li koj paub, lub tshuab hluav taws xob muaj peb yam tseem ceeb: tus sau khoom, stepper thiab servo drives. Hauv tsab xov xwm no, peb yuav saib txoj kev sib txuas lub tshuab tsav tsheb mus rau Arduino uas siv lub tshuab tsav raws li L9110S nti lossis zoo ib yam

Lub cev muaj zog tsav raws L9110S nti
Lub cev muaj zog tsav raws L9110S nti

Tsim nyog

  • - Arduino;
  • - ib lub computer ntiag tug nrog Arduino IDE ib puag ncig kev loj hlob;
  • - lub cev muaj zog tsav L9110S lossis zoo sib xws;
  • - cov tsheb fais fab;
  • - txuas xov hlau.

Cov Lus Qhia

Kauj ruam 1

Koj tsis tuaj yeem txuas ncaj qha lub tshuab hluav taws xob mus rau Arduino pins: muaj kev pheej hmoo ntawm hlawv tus pin uas lub cev muaj zog txuas nrog. Yuav kom muaj kev nyab xeeb txuas cov tshuab hluav taws xob sib txawv rau Arduino, yuav tsum tau muaj kev tsav hluav taws xob hauv tsev los yog kev lag luam tsav tsheb. Muaj ntau yam tsav tsheb sib txawv. Cov hom nquag muaj HG788, L9110S, L293D, L298N thiab lwm yam. Lub cev muaj zog muaj lub zog ua rau lub cev, lub cev muaj zog, thiab ua tus tswj. Hauv tsab xov xwm no, peb yuav siv cov tshuab tsav tsheb raws li L9110S microcircuit. Cov laug cam feem ntau yog tsim los txhawb cov kev sib txuas ntawm ntau lub cav. Tab sis rau kev ua qauv qhia, peb yuav tau los ntawm ib qho.

Ntau yam tsav tsheb tsav
Ntau yam tsav tsheb tsav

Kauj ruam 2

Cov tsheb yooj yim tshaj plaws yog cov txhuam hniav. Cov motors no tsuas muaj ob txoj kev tiv tauj. Ua raws li qhov polarity ntawm qhov voltage siv rau lawv, qhov kev taw qhia ntawm kev sib hloov ntawm lub cev muaj zog hloov, thiab qhov ntau ntawm qhov siv voltage pauv qhov hloov ceev.

Peb txuas lub cev muaj zog raws li daim duab txuas nrog. Lub zog ntawm tus tsav lub cev muaj zog yog 5 V los ntawm Arduino, txhawm rau tswj lub nrawm ntawm lub cev muaj zog, cov neeg tswj tau txuas nrog rau Arduino pins uas txhawb PWM (pulse dav tes taws los piav).

Daim duab txuas rau Arduino lub cev muaj zog
Daim duab txuas rau Arduino lub cev muaj zog

Kauj ruam 3

Cia peb sau cov duab kos los tuav lub cev tsav tsheb. Cia peb tshaj tawm ob qhov kev khi rau cov ceg uas tswj lub cev muaj zog, thiab ib qho pauv rau khaws cia tus nqi ceev. Peb yuav hloov tus nqi ntawm cov kuj tsis paub meej Ceev mus rau lub chaw nres nkoj serial thiab yog li hloov qhov ceev thiab kev coj ntawm kev sib hloov ntawm lub cev muaj zog.

Qhov nrawm tshaj qhov ceev - ntawm qhov siab tshaj tus nqi hluav taws xob uas lub tshuab tsav tau muab. Peb tuaj yeem tswj kev nrawm ntawm kev sib hloov los ntawm muab cov kev ntsuas siab hauv qhov nruab nrab ntawm 0 txog 5 volts. Txij li thaum peb siv digital pins nrog PWM, qhov ntsuas hluav taws xob rau lawv yog tswj los ntawm cov lus txib ntawm analogWtirte (tus pin, tus nqi), qhov twg tus pin yog tus lej ntawm tus pin uas peb xav kom teeb tsa lub voltage, thiab tus nqi sib cav yog coefficient proportional rau tus nqi voltage, noj qhov tseem ceeb hauv qhov ntau ntawm 0 (tus xov tooj voltage yog xoom) txog 255 (tus pin hluav taws xob yog 5 V).

Txhuam lub cev muaj zog tiv thaiv kos duab
Txhuam lub cev muaj zog tiv thaiv kos duab

Kauj ruam 4

Thauj cov duab kos rau hauv Arduino nco. Cia peb qhib nws. Lub cav tsis hloov. Txhawm rau teeb tsa qhov kev sib hloov nrawm, tus nqi nruab nrab ntawm 0 txog 255 yuav tsum raug xa mus rau qhov chaw nres nkoj serial. Cov kev taw qhia kev sib hloov yog txiav txim siab los ntawm lub cim ntawm tus lej.

Txuas nrog kev siv cov davhlau ya nyob twg mus rau qhov chaw nres nkoj, xa tus lej "100" - lub cav yuav pib tig ntawm qhov nrawm. Yog tias peb muab "rho tawm 100", ces nws yuav pib tig ntawm qhov qub ceev ntawm txoj kev rov qab.

Pom zoo: