Mündəricat:

Robotik Qol Oyunu - Smartfon Nəzarətçisi: 6 addım
Robotik Qol Oyunu - Smartfon Nəzarətçisi: 6 addım

Video: Robotik Qol Oyunu - Smartfon Nəzarətçisi: 6 addım

Video: Robotik Qol Oyunu - Smartfon Nəzarətçisi: 6 addım
Video: FALLOUT SHELTER APOCALYPSE PREPARATION 2024, Iyul
Anonim
Robotik Qol Oyunu - Smartfon Nəzarətçisi
Robotik Qol Oyunu - Smartfon Nəzarətçisi

Salam !

Burada əyləncəli bir yay oyunu: Smartphone tərəfindən idarə olunan robot qolu !!

Videoda gördüyünüz kimi, smartfonunuzdakı bəzi Joysticks ilə qolu idarə edə bilərsiniz.

Robotun bir döngədə çoxalacağı bir nümunə saxlaya bilərsiniz, məsələn, bəzi təkrarlanan vəzifələri yerinə yetirmək üçün. Ancaq bu model istədiyiniz kimi modulyasiya edilə bilər !!!!

Yaradıcı olmaq !

Addım 1: Materiallar

Materiallar
Materiallar

Burada sizə lazım olan materialı görə bilərsiniz.

Bu robot qolu hazırlamaq sizə 50 avroya başa gələcək. Proqram və alətlər dəyişdirilə bilər, amma bunları bu layihə üçün istifadə etdim.

Addım 2: Robotik Kolu 3D çap edin

Robot Qolunu 3D çap edin
Robot Qolunu 3D çap edin
Robot Qolunu 3D çap edin
Robot Qolunu 3D çap edin
Robot Qolunu 3D çap edin
Robot Qolunu 3D çap edin

Robotik Kol 3D çap edildi (prusa i3 ilə).

"HowtoMechatronics.com" veb saytı sayəsində STL Faylları 3D qolu qurmaq üçün zəhmlidir.

Bütün parçaları çap etmək təxminən 20 saat çəkəcək.

Addım 3: Elektron Montaj

Elektron montaj
Elektron montaj

Montaj 2 hissədən ibarətdir:

Arduinonun Digital Pins ilə servolara və Bluetooth cihazına (Rx, Tx) qoşulduğu elektron hissə.

Servoların 2 telefon şarj cihazı (5V, 2A max) ilə işlədiyi güc hissəsi.

Addım 4: Smartfon tətbiqi

Smartfon tətbiqi
Smartfon tətbiqi

Tətbiq App ixtiraçısı 2 -də hazırlanmışdır. Son Tutuşu idarə etmək üçün 4 servo və 2 düyməni idarə etmək üçün 2 Joystick istifadə edirik.

Qol və Smartfonu Bluetooth modulu (HC-06) istifadə edərək birləşdiririk.

Nəhayət, qənaət rejimi istifadəçiyə Qol üçün 9 -a qədər mövqe saxlamağa imkan verir.

Qol daha sonra avtomatik rejimə keçəcək və burada saxlanılan mövqeləri təkrarlayacaq.

Addım 5: Arduino Kodu

Arduino kodu
Arduino kodu
Arduino kodu
Arduino kodu

// 08/19 - Robotik Arm Smartphone idarə olunur

#daxil et #DOĞRU həqiqəti təyin et #YALAN yalan // ******************** Bəyannamələr ***************** ***********

söz nümayəndəsi; // Arduino və ya smartfon üçün modul nümayəndəsi

int chiffre_final = 0; int cmd = 3; // dəyişən komando du servo moteur (troisième fil (narıncı, sarı)) int cmd1 = 5; // servo1 int cmd2 = 9; // servo2 int cmd3 = 10; // servo3 // int cmd4 = 10; // servo4 int cmd5 = 11; // pince int activate_saving = 0; Servo moteur; // haqqında notre servomoteur haqqında Servo moteur1; Servo moteur2; Servo moteur3; // Servo moteur4; Servo moteur5; int step_angle_mini = 4; int step_angle = 3; int bucağı, bucaq1, bucaq3, bucaq5, bucaq2; // açı int pas; int r, r1, r2, r3; int qeydiyyatçısı; boolean üzgüçü = FALSE; boolean fin1 = FALSE; boolean fin2 = FALSE; boolean fin3 = FALSE; boolean fin4 = FALSE; w sözü; // Arduino int sauvegarde_positions1 modulu ilə smartfonun dəyişən nümayəndəsi [5]; int sauvegarde_positions2 [5]; int sauvegarde_positions3 [5]; int sauvegarde_positions4 [5]; int sauvegarde_positions5 [5]; int sauvegarde_positions6 [5]; int sauvegarde_positions7 [5]; int sauvegarde_positions8 [5]; int sauvegarde_positions9 [5];

// int bucağı; // fırlanma bucağı (0 ilə 180)

//********************QURMAQ*************************** ******** void setup () {sauvegarde_positions1 [0] = sauvegarde_positions1 [1] = sauvegarde_positions1 [2] = sauvegarde_positions1 [3] = sauvegarde_positions1 [4] = 0; sauvegarde_positions2 [0] = sauvegarde_positions2 [1] = sauvegarde_positions2 [2] = sauvegarde_positions2 [3] = sauvegarde_positions2 [4] = 0; sauvegarde_positions3 [0] = sauvegarde_positions3 [1] = sauvegarde_positions3 [2] = sauvegarde_positions3 [3] = sauvegarde_positions3 [4] = 0; sauvegarde_positions4 [0] = sauvegarde_positions4 [1] = sauvegarde_positions4 [2] = sauvegarde_positions4 [3] = sauvegarde_positions4 [4] = 0; sauvegarde_positions5 [0] = sauvegarde_positions5 [1] = sauvegarde_positions5 [2] = sauvegarde_positions5 [3] = sauvegarde_positions5 [4] = 0; sauvegarde_positions6 [0] = sauvegarde_positions6 [1] = sauvegarde_positions6 [2] = sauvegarde_positions6 [3] = sauvegarde_positions6 [4] = 0; sauvegarde_positions7 [0] = sauvegarde_positions7 [1] = sauvegarde_positions7 [2] = sauvegarde_positions7 [3] = sauvegarde_positions7 [4] = 0; sauvegarde_positions8 [0] = sauvegarde_positions8 [1] = sauvegarde_positions8 [2] = sauvegarde_positions8 [3] = sauvegarde_positions8 [4] = 0; sauvegarde_positions9 [0] = sauvegarde_positions9 [1] = sauvegarde_positions9 [2] = sauvegarde_positions9 [3] = sauvegarde_positions9 [4] = 0; moteur.tach (cmd); // on l'objet au pin de commande moteur1.attach (cmd1); moteur2.tach (cmd2); moteur3.tach (cmd3); // moteur4.attach (cmd4); moteur5. əlavə (cmd5); moteur.write (6); bucaq = 6; moteur1.write (100); bucaq1 = 100; moteur2.write (90); moteur 3. yazın (90); //moteur4.write(12); moteur5.write (90); bucaq = 6; bucaq1 = 100; bucaq2 = 90; bucaq3 = 90; bucaq5 = 90; Serial.begin (9600); // Bluetooth modulu ilə əlaqə qurun} // ******************** BOUCLE ****************** ***************** boşluq döngəsi () {

// Serial.print ("bucaq");

//Serial.print(angle); Serial.print ("\ t"); Serial.print (angle1); Serial.print ("\ t"); Serial.print (angle2); Serial.print ("\ t "); Serial.print (açı3); Serial.print (" / t "); Serial.print (bucaq5); Serial.print (" / n ");

//Serial.print("angle ");

int i; w = recevoir (); // ağıllı telefon haqqında heç bir məlumat yoxdur, dəyişən w keçid (w) {hal 1: TouchDown_Release (); break; hal 2: TouchDown_Grab (); fasilə; hal 3: Base_Rotation (); fasilə; hal 4: Base_AntiRotation (); fasilə; hal 5: Waist_Rotation (); fasilə; hal 6: Waist_AntiRotation (); fasilə; hal 7: Third_Arm_Rotation (); fasilə; hal 8: Third_Arm_AntiRotation (); fasilə; hal 9: Fourth_Arm_Rotation (); fasilə; hal 10: Fourth_Arm_AntiRotation (); fasilə; // hal 11: Fifth_Arm_Rotation (); break; // hal 12: Fifth_Arm_AntiRotation (); break; hal 21: Serial.print ("dava düyməsi 1"); chiffre_final = 1; sauvegarde_positions1 [0] = bucaq; sauvegarde_positions1 [1] = bucaq1; sauvegarde_pozisyonlar1 [2] = bucaq2; sauvegarde_pozisyonlar1 [3] = 1 açı_3] sa] = bucaq5; Serial.println (sauvegarde_positions1 [1]); Serial.println (sauvegarde_positions1 [2]); Serial.println (sauvegarde_positions1 [3]); Serial.println (sauvegarde_positions1 [4]; fasilə; dava 22: chiffre_final = 2; sauvegarde_positions2 [0] = bucaq; sauvegarde_positions2 [1] = bucaq1; sauvegarde_pozitions2 [2] = bucaq2; sauvegarde_pozisyonlar2 [3] = açı3; sauvegarde_pozisyonlar2 [4] fasilə; dava 23: chiffre_final = 3; sauvegarde_positions3 [0] = bucaq; sauvegarde_positions3 [1] = bucaq1; sauvegarde_pozitions3 [2] = bucaq2; sauvegarde_pozisyonlar3 [3] = bucaq 3; sauvegarde_pozisyonları3 [4] hal 24: chiffre_final = 4; sauvegarde_positions4 [0] = bucaq; sauvegarde_positions4 [1] = bucaq1; sauvegarde_pozitions4 [2] = bucaq2; sauvegarde_pozisyonlar4 [3] = açı3; sauvegarde_pozisyonları4 [4] fasilə; hal 25: chiffre_final = 5; sauvegarde_positions5 [0] = bucaq; sauvegarde_pozitions5 [1] = bucaq1; sauvegarde_pozitions5 [2] = bucaq2; sauvegarde_pozisyonlar5 [3] = bucaq 3; sauvegarde_pozisyonları5 [4] fasilə; dava 26: chiffre_final = 6; sauvegarde_positions6 [0] = bucaq; sauvegarde_positions6 [1] = bucaq1; sauvegarde_positions6 [2] = bucaq2; sauvegarde_pozisyonlar6 [3] = açı3; sauvegarde_pozisyonlar6 [4] fasilə; dava 27: chiffre_final = 7; sauvegarde_positions7 [0] = bucaq; sauvegarde_positions7 [1] = bucaq1; sauvegarde_positions7 [2] = bucaq2; sauvegarde_pozisyonlar7 [3] = bucaq3; sauvegarde_pozisyonları7 [4] fasilə; hal 28: chiffre_final = 8; sauvegarde_positions8 [0] = bucaq; sauvegarde_positions8 [1] = bucaq1; sauvegarde_pozitions8 [2] = bucaq2; sauvegarde_pozisyonlar8 [3] = bucaq 3; sauvegarde_pozisyonları8 [4] fasilə; dava 29: chiffre_final = 9; sauvegarde_positions9 [0] = bucaq; sauvegarde_positions9 [1] = bucaq1; sauvegarde_pozitions9 [2] = bucaq2; sauvegarde_pozisyonlar9 [3] = bucaq3; sauvegarde_pozisyonlar9 [4] fasilə;

hal 31: Serial.print ("31"); activate_saving = 1; chiffre_final = 0; fasilə; // BAŞLAYIN

hal 33: Serial.print ("33"); activate_saving = 0; fasilə; // BUTTON SAVE default: break; } if (w == 32) {Serial.print ("\ nReproduce / nChiffre final:"); Serial. çap (chiffre_final); Serial.print ("\ n Sauvegarde mövqeyi 1: / n"); for (i = 0; i <5; i ++) {Serial.print (sauvegarde_positions1 ); Serial.print ("\ t");} Serial.print ("\ n Sauvegarde mövqeyi 2: / n"); for (i = 0; i <5; i ++) {Serial.print (sauvegarde_positions2 ); Serial.print ("\ t");} Serial.print ("\ n Sauvegarde mövqeyi 3: / n"); for (i = 0; i <5; i ++) {Serial.print (sauvegarde_positions3 ); Serial.print ("\ t");} for (i = 1; i <= chiffre_final; i ++) {Serial. çap ("\ n / n BAŞLAYIN / nDöngə:"); Serial.print (i); Serial.print ("\ n"); keçid (i) {hal 1: goto_moteur (*(sauvegarde_positions1)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions1+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions1+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions1+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions1+4)); gecikmə (200); fasilə; hal 2: goto_moteur (*(sauvegarde_positions2)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions2+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions2+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions2+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions2+4)); gecikmə (200); fasilə; hal 3: goto_moteur (*(sauvegarde_positions3)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions3+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions3+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions3+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions3+4)); gecikmə (200); fasilə; hal 4: goto_moteur (*(sauvegarde_positions4)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions4+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions4+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions4+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions4+4)); gecikmə (200); fasilə; hal 5: goto_moteur (*(sauvegarde_positions5)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions5+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions5+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions5+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions5+4)); gecikmə (200); fasilə; hal 6: goto_moteur (*(sauvegarde_positions6)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions6+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions6+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions6+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions6+4)); gecikmə (200); fasilə; hal 7: goto_moteur (*(sauvegarde_positions7)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions7+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions7+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions7+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions7+4)); gecikmə (200); fasilə; hal 8: goto_moteur (*(sauvegarde_positions8)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions8+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions8+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions8+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions8+4)); gecikmə (200); fasilə; hal 9: goto_moteur (*(sauvegarde_positions9)); gecikmə (200); goto_moteur1 (*(sauvegarde_positions9+1)); gecikmə (200); goto_moteur2 (*(sauvegarde_positions9+2)); gecikmə (200); goto_moteur3 (*(sauvegarde_positions9+3)); gecikmə (200); goto_moteur5 (*(sauvegarde_positions9+4)); gecikmə (200); fasilə; } Serial.print ("\ n *********************** FIN TEKRARLAMA ***************** / n "); gecikmə (500); }} /*Serial.print ("debüt / n"); Serial.print (sauvegarde_positions1 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions1 [4]); Serial.print ("\ n"); Serial.print (sauvegarde_positions2 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions2 [4]); Serial.print ("\ n"); Serial.print (sauvegarde_positions3 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions3 [4]); Serial.print ("\ n"); Serial.print (sauvegarde_positions4 [0]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [1]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [2]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [3]); Serial.print ("\ t"); Serial.print (sauvegarde_positions4 [4]); Serial.print ("\ n");

Serial.print ("\ nfin / n");*/

gecikmə (100); } // **************************** FONKSİYALAR ****************** ******************

word recevoir () {// smartfonlar haqqında məlumatların dəyişdirilməsi

if (Serial.available ()) {w = Serial.read ();

Serial.flush ();

qayıt w; }}

void goto_moteur (int angle_destination)

{while (angle_destination angle+step_angle) {Serial.print ("\ n -------------- * * * * * * -------------- ---- / n "); Serial.print ("angle_destination = / t"); Serial. çap (bucaq_ təyinatı); Serial.print ("\ n açı1 = / t"); Serial. çap (bucaq); if (bucaq_ təyinat bucağı + addım_bucaq) {bucaq = bucaq + addım_angle; moteur. yazmaq (bucaq);} gecikmə (100); } moteur.write (angle_destination); } void goto_moteur1 (int angle_destination) {while (angle_destination angle1+step_angle) {Serial.print ("\ n -------------- * * * * * * ------- ----------- / n "); Serial.print ("angle_destination = / t"); Serial. çap (bucaq_ təyinatı); Serial.print ("\ n açı2 = / t"); Serial. çap (açı1); əgər (bucaq_dest təyinat bucağı1 +addım_bucaq) {bucaq1 += addım_angle; moteur1.write (angle1);;} gecikmə (100); } moteur1.write (angle_destination); } void goto_moteur2 (int angle_destination) {

isə (bucaq_ təyinat bucağı2+addım_bucaq)

{Serial.print ("\ n -------------- * * * * * * ------------------ / n"); Serial.print ("angle_destination = / t"); Serial. çap (bucaq_ təyinatı); Serial.print ("\ n angle3 = / t"); Serial.print (bucaq2); əgər (bucaq_dəyər bucağı2 +addım_bucaq) {bucaq2 += addım_angle; moteur2.write (angle2);} gecikmə (100); } moteur2.write (angle_destination); } void goto_moteur3 (int angle_destination) {

isə (bucaq_ təyinat açısı3+addım_bucaq)

{Serial.print ("\ n -------------- * * * * * * ------------------ / n"); Serial.print ("angle_destination = / t"); Serial. çap (bucaq_ təyinatı); Serial.print ("\ n angle4 = / t"); Serial.print (bucaq3); əgər (bucaq_ təyinat açısı3 +addım_angle) {bucaq3 += addım_angle; moteur3.write (angle3);} gecikmə (100); } moteur3. yazmaq (bucaq_destinatı); } void goto_moteur5 (int angle_destination) {

isə (bucaq_ təyinat bucağı5+addım_bucaq)

{Serial.print ("\ n -------------- * * * * * * ------------------ / n"); Serial.print ("angle_destination = / t"); Serial. çap (bucaq_ təyinatı); Serial.print ("\ n açı5 = / t"); Serial. çap (açı5); əgər (bucaq_dəyər bucağı5 +addım_bucaq) {bucaq5 += addım_angle; moteur5.write (angle5);} gecikmə (100); } moteur5.write (angle_destination); }

etibarsız TouchDown_Release () // TouchDown Button Release

{if (bucaq5 <180) {bucaq5 = bucaq5+addım_angle_mini; } moteur5.write (angle5); }

etibarsız TouchDown_Grab () // TouchDown Button Grab

{if (angle5> 0) {angle5 = angle5-step_angle_mini; } moteur5.write (angle5); } boş Base_Rotation () {if (bucaq 0) {bucaq = bucaq-addım_angle; } başqa açı = 0; moteur yazmaq (bucaq); } boş Waist_Rotation () {if (angle1 20) {angle1 = angle1-step_angle; } başqa açı1 = 20; moteur1. yazmaq (bucaq1); } etibarsız Third_Arm_Rotation () {if (angle2 0) {angle2 = angle2-step_angle; } moteur2.write (angle2); } etibarsız Fourth_Arm_Rotation () {if (angle3 = 0) {angle3 = angle3-step_angle_mini; } moteur3. yazmaq (bucaq3); }

Addım 6: Budur

İzlədiyiniz üçün təşəkkürlər, ümid edirəm dəyərləndirdiniz!

Bu Təlimatı bəyənmisinizsə, əmin olun ki, daha çox şey üçün bizi ziyarət edə bilərsiniz! =)

Tövsiyə: