Cov txheej txheem:

Robotic Arm Nrog Zio Modules Ntu 2: 11 Cov Kauj Ruam
Robotic Arm Nrog Zio Modules Ntu 2: 11 Cov Kauj Ruam

Video: Robotic Arm Nrog Zio Modules Ntu 2: 11 Cov Kauj Ruam

Video: Robotic Arm Nrog Zio Modules Ntu 2: 11 Cov Kauj Ruam
Video: Amazon's Sparrow Robot Arm 2024, Kaum ib hlis
Anonim
Robotic Arm Nrog Zio Modules Ntu 2
Robotic Arm Nrog Zio Modules Ntu 2

Hauv kev qhia niaj hnub no, peb yuav siv tag nrho 4 servos thiab PS2 wireless tswj los tswj cov neeg hlau caj npab.

Cov ntawv tshaj tawm blog no yog ib feem ntawm Zio Robotics Series.

Taw qhia

Hauv peb qhov blog dhau los, peb tshaj tawm Tshooj 1 qhia yuav ua li cas thiaj tswj tau Robotic Arm siv Zio cov qauv. Ntu 1 feem ntau mloog zoo rau kev tswj hwm koj li Robotic Arm's Claw kom qhib thiab kaw.

Hauv qhov kev qhia niaj hnub no, peb yuav nqis tes ua me ntsis los ntawm suav nrog PS2 Wireless tus tswj hwm los tswj Robotic Arm. Txog qhov haujlwm no, peb yuav siv 4 servos.

Kauj ruam 1: Txheej txheem cej luam

Qib Nyuaj:

Zoj Padawan

Cov peev txheej pab tau:

Koj yuav tsum muaj kev nkag siab yooj yim ntawm yuav ua li cas rau nruab Zio cov laug cam txhim kho. Hauv qhov kev qhia no, peb xav tias koj lub rooj tsav xwm txhim kho twb tau teeb tsa thiab npaj tau teeb tsa. Yog tias koj tsis tau teeb tsa koj lub rooj tsav xwm tseem txheeb xyuas peb Zio Qwiic Pib Qhia qhia hauv qab no kom pib:

Zio Zuino M UNO Qwiic Pib Qhia

Kauj ruam 2: Schematics

Schematics
Schematics

Nov yog Wiring Schematics ntawm Robotic Arm Part 2 Project nrog rau PS2 Controller daim duab xav tau kom nkag siab rau koj li coding ib feem.

Kauj Ruam 3: Daim Duab PS2 Tus Tswj

PS2 Controller Diagram
PS2 Controller Diagram

Kauj Ruam 4: Zio Modules Kev Txuas Txuas Teeb

Hauv qab no yog qhov txuas ntawm peb Zio cov qauv los teeb tsa nrog Robotic Arm. Kev txuas txhua tus qauv ua ke yog yooj yim zoo nkauj thiab yuav tsis siv sijhawm ntau dua 10 feeb los teeb tsa.

Kauj Ruam 5: Txuas Robotic Arm Servo rau Zio 16 Servo Controller

Txuas Robotic Arm Servo rau Zio 16 Servo Controller
Txuas Robotic Arm Servo rau Zio 16 Servo Controller

Kauj Ruam 6: Txuas Koj 16 Servo rau DC/DC Booster thiab teeb nws ntawm 6.0V

Txuas koj 16 Servo rau DC/DC Booster thiab teeb nws ntawm 6.0V
Txuas koj 16 Servo rau DC/DC Booster thiab teeb nws ntawm 6.0V

Peb siv DC/DC Booster los txhawb thiab kho lub roj teeb hluav taws xob rau 6.0.

Siv lub hwj chim ntawm DC Booster los kho qhov hluav taws xob kom txog thaum koj tau txais 6.0. Laub khawm Hauv/Tawm kom txog thaum cov duab pom 6.0. Koj yuav tsum tau muab lub zog (3.7V roj teeb) ua ntej rau koj lub DC/DC Booster txhawm rau txhawm rau kho qhov hluav taws xob.

Kauj Ruam 7: Txuas Zuino M Uno rau Zio 16 Servo Controller

Txuas Zuino M Uno rau Zio 16 Servo Controller
Txuas Zuino M Uno rau Zio 16 Servo Controller

Qwiic txuas Zuino M Uno rau Zio Servo maub los nrog qwiic cable.

Kauj Ruam 8: Txuas Uno rau PS2 Tus Txais

Txuas Uno rau PS2 Tus Txais
Txuas Uno rau PS2 Tus Txais

Nov yog Pin Diagram ntawm Kev Sib Txuas. Koj xav tau 5 Txiv neej rau Poj Niam Jumper Wires rau ntu no.

Kauj Ruam 9: Txoj Cai rau Robotic Arm

Peb yuav siv PS2 Arduino Library los cim peb PS2 Wireless Controller los ua haujlwm nrog peb Robotic Arm. Koj tuaj yeem nrhiav thiab rub tawm qhov chaws rau qhov Robotic Arm Part 2 txoj haujlwm ntawm peb nplooj Github.

Rub tawm thiab teeb tsa cov tsev qiv ntawv hauv qab no thiab txuag nws ntawm koj lub zos Arduino IDE cov tsev qiv ntawv nplaub tshev:

  • Adafruit PWM Servo Driver Library
  • PS2 Arduino tsev qiv ntawv

Txhawm rau teeb tsa lub tsev qiv ntawv qhib koj Arduino IDE, mus rau Sketch tab, xaiv suav nrog Lub Tsev Qiv Ntawv -> Ntxiv. Zip Library. Xaiv cov tsev qiv ntawv saum toj no kom suav nrog koj li IDE.

Arduino muaj phau ntawv qhia yuav ua li cas rau nruab cov tsev qiv ntawv rau koj Arduino IDE. Txheeb lawv tawm ntawm no!

Kauj ruam 10: Khiav Koj Cov Cai

Khiav Koj Cov Cai
Khiav Koj Cov Cai

Qhib Arduino IDE. Hauv Cov Ntaub Ntawv> Piv Txwv> PS2_Arduino_Library, Xaiv PS2X_Servo

Nco tseg: Ua ntej koj tuaj yeem tswj hwm koj lub caj npab Robotic nrog PS2 Tus Tswj Xyuas kos cov kauj ruam hauv qab no: Hloov ntawm koj li PS2 maub los. Txheeb xyuas tias Hom LED teeb. Yog tias nws tsis yog, nyem lub khawm khawm ntawm koj lub maub los. Tom qab ua qhov saum toj no, koj yuav tsum nias lub pob pib dua ntawm koj Zuino M Uno rau nws kom nyeem koj li kev teeb tsa. Koj yuav tsum Nias L1 thiab Joystick kom txav koj Lub Caj Npab Robotic.

  • Sab laug Joystick tswj kev khoov ntawm caj npab nce lossis nqis qis
  • Txoj cai Joystick tswj tus Claw kom qhib lossis kaw thiab tig lub claw mus rau sab laug lossis sab xis.

Kauj ruam 11: Kev piav qhia Code

Kev siv PS2X Arduino lub tsev qiv ntawv yog qhov yooj yim, tsuas yog xav tau kev pib ua haujlwm, teeb tsa, thiab tom qab ntawv nyeem cov lus txib.

Txhawm rau teeb tsa kev sib txuas rau koj li PS2 maub los nrog koj Uno, hauv qab no yog cov pins koj xav tau los txhais hauv koj cov cai:

/********************************************************** ****************teeb pins txuas rau PS2 maub los:* - 1e kem: thawj* - 2e colmun: Stef? *hloov tus lej tus lej los ntawm cov uas koj siv ****************************************** **********************/#txhais PS2_DAT 13 // 14#txhais PS2_CMD 11 // 15#txhais PS2_SEL 10 // 16#txhais PS2_CLK 12 // 17

Peb tau hloov cov pins nrog cov uas peb siv los txuas rau peb Uno raws li tau hais tseg hauv Pin Diagram saum toj no.

/********************************************************** **************** xaiv hom ntawm PS2 maub los:* - kev sib zog = sib piv nyeem ntawv ntawm laub -butttons* - rumble = lub cev tsis muaj zog*tsis pom zoo 1 ntawm kab rau txhua hom xaiv ** ********************************************************** ****** ************///#Txheeb xyuas qhov tseeb qhov tseeb#txhais cov lus tsis tseeb //#txhais cov lus tsis tseeb#txhais cov lus tsis tseeb

Nov peb tau piav qhia hom PS2 rau kev nyuaj siab thiab nrov nrov tias tsis yog. Peb tawm tswv yim cov uas peb tsis siv.

Peb yuav tsuas yog siv Tus Tswj Tus Joystick hais kom ua thiab L1 los tswj kev txav ntawm peb Robotic Arm.

void loop () {/* Koj yuav tsum Nyeem Gamepad kom tau txais qhov txiaj ntsig tshiab thiab teeb tsa kev co qhov tseem ceeb ps2x.read_gamepad (lub cav me me rau/tawm, lub zog loj zog los ntawm 0-255) yog tias koj tsis tuaj yeem ua rau nrov nrov, siv ps2x.read_gamepad (); tsis muaj qhov tseem ceeb Koj yuav tsum hu qhov no tsawg kawg ib zaug ib zaug*/yog (yuam kev == 1) // hla lub voj yog tias tsis muaj tus tswj pom pom rov qab; lwm tus {// DualShock Controller ps2x.read_gamepad (cuav, co); // nyeem tus tswj hwm thiab teeb tsa lub cav loj kom tig ntawm 'vibrate' nrawm yog (ps2x. Button (PSB_START)) // yuav yog qhov tseeb tsuav yog khawm tau nias Serial.println ("Pib tau tuav"); yog (ps2x. Button (PSB_SELECT)) Serial.println ("Xaiv tab tom tuav"); vibrate = ps2x. Analog (PSAB_CROSS); // qhov no yuav teeb tsa lub cav loj kom nrawm raws qhov nyuaj koj nias lub xiav (X) khawm yog (ps2x. Button (PSB_L1) || ps2x. Button (PSB_R1)) {// luam tawm qhov tseem ceeb yog ib qho yog RUEValue = ps2x. Analog (PSS_RY); RX_Value = ps2x. Analog (PSS_RX); LY_Value = ps2x. Analog (PSS_LY); LX_Value = ps2x. Analog (PSS_LX); Serial.print ("Stick Values:"); Serial.print (RX_Value); Serial.print (""); Serial.print (RY_Value); Serial.print (""); Serial.print (LY_Value); Serial.print (""); Serial.println (LX_Value);

Cov cai hauv qab no yog qhov uas peb sau peb cov servos uas tswj peb cov neeg hlau caj npab uas peb suav nrog hauv kev ua haujlwm hu hauv qab ps2x.button (PSB_L1) || ps2x.button (PSB_R1).

Koj yuav tsum nias L1 lossis R1 khawm ua ke nrog Joystick los tswj koj li Robotic Arm.

Sab laug Joystick tswj servos 2 thiab 3 rau Caj Npab ib sab - tswj txoj kev khoov nce thiab nqis ntawm caj npab feem, thaum txoj cai Joystick tswj servos 0 thiab 1 ntawm Robotic Arm's Claw qhib lossis kaw, thiab tig sab laug lossis sab xis.

SERVO 0, 1 - Claw SERVO 2, 3 - Caj npab

Koj tuaj yeem hloov pauv qhov tseem ceeb hauv ntu no txhawm rau tswj qib koj li Robotic Arm angle:

pulselen0 = daim ntawv qhia (RY_Value, 0, 127, SERVOMIN0, SERVOMAX0); pulselen1 = daim ntawv qhia (RX_Value, 0, 127, SERVOMIN0, SERVOMAX0); pulselen2 = daim ntawv qhia (LY_Value, 0, 127, SERVOMIN2, SERVOMAX2); pulselen3 = daim ntawv qhia (LX_Value, 0, 255, SERVOMIN3, SERVOMAX3);

Pom zoo: