IServo: ungayisebenzisa kanjani i-servo motor ne-Arduino

servo, servo motor

Uma ufuna ukusebenzisa ifayela le- servo motor, noma i-servo, nge I-Arduino, kulesi sihloko uzofunda ukuthi yini oyidingayo ukuze uqalise. Sesibonile kwezinye izindatshana ukuthi yini edingekayo ukuze siyisebenzise motors kagesi, ama-stepper motors, kanye neminye imiqondo edingekayo ukuqonda ukusebenza kwalolu hlobo lwedivayisi, njenge-athikili eku- I-PWM.

Manje, ungangeza enye into entsha ye-elektroniki ku- uhlu lwedivayisi ihlaziyiwe nokuthi ungahamba ukuhlanganisa amaphrojekthi wakho we-DIY ukwengeza ukusebenza okusha.

Yini i-servo?

servo

Un bhekimushu, noma i-servo elula, iyimoto ye-elekthronikhi enokufana nama-DC motor ajwayelekile, kepha inezinto ezithile ezizenza zikhetheke. Kulokhu, inamandla okubamba isikhundla esikhonjisiwe, okuthile okungavunyelwe izinjini zikagesi.

Ngakolunye uhlangothi, i-servo nayo ingakwazi lawula ngokunembile ijubane lokujikeleza, ngenxa yochungechunge lwamagiya angaphakathi nohlelo oluvumela ukulawula okungcono kakhulu kunalokho okungenziwa kwezinye izinhlobo zama-motors.

Lezi zici zenza ukuthi zithakazelise ngokukhethekile izinhlelo zokusebenza amarobhothi, noma amanye amadivayisi lapho kudingeka khona ukulawula ukunyakaza nendawo, njengephrinta, noma imoto elawulwa kude. Kulolu hlobo lwemoto elawulwa ngomsakazo kunenjini ejwayelekile yokushayela imoto, kanye ne-servo yesiteringi, ongalawula ngayo ijika ngokunembile.

Umehluko phakathi kwe-stepper motor ne-servo motor

UNema 17

Uma uzibuza umehluko phakathi kweservo motor kanye ne-stepper motor, Iqiniso ukuthi bangadideka, ngoba esitimeleni sokuhamba, noma esinyathelweni, ukuzungeza nakho kungalawulwa ngokunembile, futhi izinhlelo zokusebenza zifana kakhulu ne-servo. Esikhundleni salokho, kunomehluko othile.

Futhi ngukuthi ama-servomotors ngokuvamile asebenzisa i- odonsa bomhlaba abangajwayelekile, kanti ama-stepper motors asebenzisa odonsa abashibhile futhi abajwayelekile. Ngakho-ke, i-servo ingafinyelela ukuthuthukiswa okuphezulu kwe-torque, ngaphandle kokuhlala kuhlangene. Ngakho-ke, amandla okuphenduka azobe ephakeme kakhulu.

Izici zobuchwepheshe

Noma kunini lapho uthenga i-servo, kufanele ubheke ishidi lezobuchwepheshe noma i-datasheet. Ngaleyo ndlela, uzoqinisekisa ukuthi izici zobuchwepheshe inayo, kepha futhi nemingcele ongayibeka kuyo, njengamandla, amandla, umthwalo omkhulu, i-torque, njll. Khumbula ukuthi imodeli ngayinye ingahluka kakhulu.

Isibonelo, uma ubheka okukodwa okuthandwa kakhulu, iMicro Servo 9G SG90 ifemu eyaziwa ngeTower Pro, khona-ke uzoba nezici ezithile ezingajwayelekile, yize uhlelo nokuxhunyaniswa kwamamodeli kucishe kufane futhi konke okushiwo lapha kuyasiza kunoma ngubani.

Endabeni yale modeli, kuyimoto esezingeni eliphakeme, ene-angle yokujika evumela i- shanela phakathi kuka -90 no-90º, okungukuthi, ukuphenduka okuphelele kuka-180º. Isinqumo ongasizuza siphezulu kakhulu, ngakho-ke uzokwazi ukuqhubekela phambili kancane kancane. Isibonelo, ngokulinganiselwa kwesiginali ye-PWM ye- Arduino UNO, ungathola nokuthuthuka kusuka ebangeni kuye ebangeni.

Ngokunjalo, isiginali ye-PWM nayo izobeka omunye umkhawulo, futhi iyinombolo yezikhathi lapho isikhundla ngasinye singashintsha khona ngeyunithi ngayinye yesikhathi. Isibonelo, ngoba ama-pulses asebenza phakathi kuka-1 no-2 ms no Izinkathi ezingama-20 ms (50Hz), khona-ke i-servo ingahamba kanye njalo kuma-20 ms.

Ngaphezu kwalokho, izoba nesisindo sama-gramu ayi-9 futhi, ngaphandle kwalokho isisindo nosayizi ohlangene, ingakhula i-torque noma i-torque engu-1.8 kg / cm nge-4.8v. Lokho kungenxa yesethi yegiya layo le-POM.

Ekugcineni, usuvele uyazi ukuthi, kuya ngalokho ofuna ukukufeza, kuzofanele ukhethe imodeli eyodwa noma enye, ukuze ibe izici ezidingekayo kuphrojekthi yakho. Lokho wukuthi, akufani nokuthi ufuna imoto ukuhambisa umthwalo X, kunoyedwa we-XX ...

Ungayithenga kuphi i-servo

bhekimushu

Uma ufuna ukuqala ukusebenzisa lolu hlobo lwe-servomotor, ungaluthola lushibhile ezitolo eziningi ezikhethekile, futhi ungaluthola naku-inthanethi e-Amazon. Isibonelo, nazi izibonelo ze- imikhiqizo enconyiwe lokho kungakuthakazelisa:

Zonke zine-twist enhle kakhulu ye-twist, kepha yehluke kakhulu ku-torque umuntu ngamunye angayibekezelela. Ngifakiwe amamodeli amathathu ahlukene. Okwangaphambili, futhi okushibhile, kunganela izinhlelo eziningi zokusebenza. Kepha uma udinga eyodwa enamandla amakhulu kwezinye izinhlelo zokusebenza, unama-25 nama-35, asevele ephawuleka impela ...

Ukuhlanganiswa ne-Arduino

arduino servo
Njengoba ukwazi ukubona esithombeni ngenhla, i-servo ixhuma kalula ku-Arduino. Inezintambo ezintathu kuphela, ongazixhuma ngale ndlela:

  • Okubomvu nge-5V
  • Mnyama nge-GND
  • Ophuzi ngepini ye-Arduino PWM, kuleli cala nge -9.

Ukuze uhlele umdwebo wokuqala ukusebenzisa lezi zinhlobo zezinjini, unezinketho eziningi. Kepha, okokuqala nje, ukuqala, kufanele engeza umtapo wezincwadi we-Arduino IDE ukushayela lolu hlobo lwama-servo motors:

  1. Vula i-Arduino IDE.
  2. Iya kuhlelo.
  3. Ngemuva kwalokho Faka Umtapo Wezincwadi.
  4. Servo

Ngokuqondene ne ikhodi emfushane, kungaba lula kanjalo lapho i-servo izodlula ezikhundleni zayo ime ku-0º, 90º no-180º:

//Incluir la biblioteca del servo
#include <Servo.h>
 
//Declarar la variable para el servo
Servo servoMotor;
 
void setup() {
  // Iniciar el monitor serie
  Serial.begin(9600);
 
  // Iniciar el servo para que use el pin 9 al que conectamos
  servoMotor.attach(9);
}
 
void loop() {
  
  // Desplazar a la posición 0º
  servoMotor.write(0);
  // Esperar 1 segundo
  delay(1000);
  
  // Desplazar a la posición 90º
  servoMotor.write(90);
  // Esperar 1 segundo
  delay(1000);
  
  // Desplazamos a la posición 180º
  servoMotor.write(180);
  // Esperar 1 segundo
  delay(1000);
}

Manje uma ufuna ihambise kusuka ezingeni iye ezingeni, khona-ke kuzoba kanjena:

// Incluir la biblioteca servo
#include <Servo.h>
 
// Declarar la variable para el servo
Servo servoMotor;
 
void setup() {
  // Iniciar la velocidad de serie
  Serial.begin(9600);
 
  // Poner el servo en el pin 9
  servoMotor.attach(9);
 
  // Iniciar el servo en 0º
  servoMotor.write(0);
}
 
void loop() {
 
  // Los bucles serán positivos o negativos, en función el sentido del giro
  // Positivo
  for (int i = 0; i <= 180; i++)
  {
    // Desplazar ángulo correspondiente
    servoMotor.write(i);
    // Pausa de 25 ms
    delay(25);
  }
 
  // Negativo
  for (int i = 179; i > 0; i--)
  {
    // Desplazar el ángulo correspondiente
    servoMotor.write(i);
    // Pausa e 25 ms
    delay(25);
  }
}


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Yiba ngowokuqala ukuphawula

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.