IServo: uyisebenzisa njani i-servo motor kunye neArduino

servo, servo iimoto

Ukuba ufuna ukusebenzisa servo motor, okanye servonge Arduino, kweli nqaku uza kufunda into oyifunayo ukuze uqalise. Sele sibonile kwamanye amanqaku ukuba yeyiphi na into ekufuneka siyisebenzisile iimoto zombane, Iimoto ezihamba ngaphandle, kunye nezinye iikhonsepthi eziyimfuneko ukuqonda ukusebenza kolu hlobo lwesixhobo, njenge inqaku PWM.

Ngoku, unokongeza enye into entsha ye-elektroniki kuyo uluhlu lwezixhobo ihlalutyiwe kwaye ungahamba ukudibanisa iiprojekthi zakho ze-DIY ukongeza ukusebenza okutsha.

Yintoni i-servo?

servo

Un umncedisi, okanye i-servo ngokulula, yimoto ye-elektroniki enokufana kwiinjini eziqhelekileyo zeDC, kodwa ngezinye izinto ezizenza zikhetheke. Kule meko, inesakhono sokubamba isikhundla esibonisiweyo, into engavunyelwa ziinjini zombane.

Kwelinye icala, i-servo nayo inako ukulawula ngokuchanekileyo isantya sokujikeleza, enkosi kuthotho lwegiya zangaphakathi kunye nenkqubo evumela ulawulo olungcono kakhulu kunokwenziwa kwezinye iintlobo zeemoto.

Ezi zinto zenza umdla ngakumbi izicelo iirobhothi, okanye ezinye izixhobo apho kufuneka khona ukulawula ukuhamba kunye nokuma, njengomshicileli, okanye imoto elawulwa kude. Kolu hlobo lwemoto elawulwa ngonomathotholo kukho imoto eqhelekileyo yokuqhuba imoto, kunye neservo yokuqhuba, onokuthi ulawule ngokuchanekileyo.

Umahluko phakathi kwe-stepper motor kunye ne-servo motor

UNoma 17

Ukuba uyabuza Umahluko phakathi kwemoto ye-servo kunye ne-stepper motor, inyani kukuba banokudideka, kuba kwi-stepper motor, okanye kwi-stepper, ujikelezo lunokulawulwa ngokuchanekileyo, kwaye izicelo ziyafana kakhulu ne-servo. Endaweni yokuba kukho umahluko.

Kwaye kukuba ii-servomotors zihlala zisebenzisa iimagnethi ezinqabileyo zomhlaba, ngelixa ii-motor stepper zisebenzisa iimagnethi ezingabizi kakhulu kwaye ziqhelekile. Ke ngoko, i-servo inokufikelela kuphuhliso oluphezulu lwe-torque, ngaphandle kokuhlala kuhambelana. Ke ngoko, ukujika kwamandla kuya kuba phezulu kakhulu.

Iimpawu zobugcisa

Nanini na xa uthenga i-servo, kuya kufuneka unxibelelane nephepha lobuchwephesha okanye iphepha ledatha. Ngale ndlela, uya kuqinisekisa ukuba Iimpawu zobugcisa Inayo, kodwa kunye nemida onokuyibeka kuyo, njengombane, amandla, umthwalo ophakamileyo, i-torque, njl. Khumbula ukuba imodeli nganye inokwahluka kakhulu.

Umzekelo, ukuba ujonga enye yezona zidumileyo, iMicro Servo 9G SG90 isuka inkampani eyaziwayo yeNqaba Pro, emva koko uya kuba neempawu ezizodwa, nangona inkqubo kunye nokudityaniswa kweemodeli kungaphezulu okanye kungaphantsi ngokufanayo kwaye yonke into ekuthethwa ngayo apha iluncedo nakubani na.

Kwimeko yale modeli, yimoto ekumgangatho ophezulu, ine-angle yokujika evumela u tshayela phakathi -90 kunye 90ºOko kukuthi, ukujika ngokupheleleyo kwe-180º. Isisombululo onokufikelela kuso siphezulu kakhulu, ke uya kuba nakho ukuqhubela phambili kancinci kancinci. Umzekelo, ngokusikelwa umda kwesiginali ye-PWM Arduino UNO, unokufumana kwangaphambili ukusuka kwibanga ukuya kwelinye.

Ngokunjalo, umqondiso we-PWM uya kubeka omnye umda, kwaye linani lamaxesha isikhundla ngasinye esinokuthi sitshintshe kwiyunithi yexesha. Umzekelo, njengoko iimpundu zisebenza phakathi kwe-1 kunye ne-2 ms kunye ne Amaxesha angama-20 ms (50Hz), emva koko i-servo inokuhamba kube kanye nge-20 ms.

Ukongeza, iya kuba nobunzima beigram ezili-9 kwaye, ngaphandle kobunzima kunye nobukhulu becompact, inokukhulisa torque okanye torque 1.8 kg / cm nge-4.8v. Ndiyabulela kwiseti ye-POM.

Okokugqibela, sele uyazi ukuba, kuxhomekeke kwinto ofuna ukuyiphumeza, kuya kufuneka ukhethe enye okanye enye imodeli, ukuze ibe nayo Iimpawu ezifunekayo kwiprojekthi yakho. Oko kukuthi, akufani ukuba ufuna imoto ukuhambisa umthwalo X, kunenye ye-XX ...

Uyithenga phi i-servo

umncedisi

Ukuba ufuna ukuqala ukusebenzisa olu hlobo lwe-servomotor, ungayifumana ngexabiso eliphantsi kwiivenkile ezininzi ezikhethekileyo, kwaye unokuyifumana kwi-Intanethi kwiAmazon. Umzekelo, nantsi eminye imizekelo iimveliso ezicetyiswayo Oko kunokuba nomdla kuwe:

Zonke zinekona entle yokujija, kodwa yahlukile ngokusisiseko kwi-torque umntu anokuyinyamezela. Ndibandakanyile iimodeli ezintathu ezahlukeneyo. Ezangaphambili, kwaye zitshiphu, zinokwanela uninzi lwezicelo. Kodwa ukuba ufuna enye enamandla angaphezulu kwezinye izicelo, unayo i-25 kunye ne-35, esele iphawuleka ...

Umdibaniso neArduino

arduino servo

Njengoko ubona kumfanekiso ongentla, i-servo idibanisa ngokulula kakhulu ukuya eArduino. Ineentambo ezintathu kuphela, onokuzidibanisa ngale ndlela:

  • Bomvu nge5V
  • Mnyama ngeGND
  • Mthubi ngepini yeArduino PWM, kule meko ine -9.

Ukwenza inkqubo yomzobo wokuqala ukusebenzisa ezi ntlobo zeinjini, unokukhetha izinto ezininzi. Kodwa, kuqala kwiinto zonke, ukuqala, kuya kufuneka yongeza ilayibrari ye-Arduino IDE ukuqhuba olu hlobo lweemoto ze-servo:

  1. Vula iArduino IDE.
  2. Yiya kwiNkqubo.
  3. Emva koko Faka iThala leencwadi.
  4. Servo

Ngokuphathelele ikhowudi yomzobo, kunokuba yinto elula apho i-servo izakuhamba ngezikhundla 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);
}

Ngoku ukuba uyafuna uyihambise ukusuka kwinqanaba ukuya kwinqanabaiya kuba ngolu hlobo:

// 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);
  }
}


Yiba ngowokuqala ukuphawula

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.