Cov txheej txheem:

Motion Control Gimbal: 12 Kauj Ruam
Motion Control Gimbal: 12 Kauj Ruam

Video: Motion Control Gimbal: 12 Kauj Ruam

Video: Motion Control Gimbal: 12 Kauj Ruam
Video: Обзор MOZA LITE 2 и пульт MOZA MIMIC MOTION CONTROL. Полный обзор. 2024, Kaum ib hlis
Anonim
Image
Image

Nyob Zoo Txhua Tus, Kuv lub npe yog Harji Nagi. Tam sim no kuv yog tub ntxhais kawm xyoo thib ob kawm txog hluav taws xob thiab kev sib txuas lus engineering los ntawm Pranveer Singh Institute Of Technology, Kanpur (UP). Kuv muaj kev txaus siab rau neeg hlau, arduino, Artificial Intelligence thiab Analog electronics.

Lo lus "gimbal" tau txhais tias yog kev txhawb nqa piv txwv uas tso cai rau kev sib hloov ntawm ib qho khoom hauv ib lub axis. Yog li peb-axis gimbal tso cai rau ib qho khoom siv ntawm lub gimbal kom muaj kev ywj pheej ntawm kev txav ntawm ib tus tuav lub gimbal. Lub gimbal hais qhov txav ntawm qhov khoom, tsis yog tus nqa nws.

Nws suav nrog 3 MG996R servo motors rau 3-axis tswj, thiab lub hauv paus uas MPU6050 sensor, Arduino thiab roj teeb yuav muab tso rau. Lub 3-axis gimbal ua kom ntseeg tau tias lub suab ntawm lub koob yees duab tau ruaj khov txawm tias tus tuav nws nce thiab nqis, sab laug thiab sab xis, pem hauv ntej thiab tom qab. Nov yog qhov peb hais txog yaw, suab, thiab yob ruaj khov.

Kauj Ruam 1: Daim Ntawv Teev Npe

Daim ntawv teev cov khoom siv yog:

1) Arduino Uno

2) 8V, 1.5 Amp Roj Teeb rau lub zog Arduino Uno

3) 7805 Tus tswj hwm qhov hluav taws xob Ic lossis koj tuaj yeem siv pob conveter

4) PIB 6050

5) 3*(MG995 SERVO Cov Tsav Tsheb)

6) Jumper Hlau

Lwm yam khoom siv:

1) Soldering Hlau

2) Rab yaj phom

3) Laum tshuab

4) Khoom Noj Tau

Hloov chaw ntawm kev siv breadborad Kuv tau siv me me coustom perf board rau qhov zoo thiab tsis zoo txuas nrog npav

Kauj ruam 2: Sib dhos

Sib dhos
Sib dhos
Sib dhos
Sib dhos

Ua npuas ncauj, ua npuas ncauj, lossis ntawv ntsej muag ua npuas ncauj yog lub teeb yuag thiab txiav tau yooj yim cov khoom siv rau kev teeb tsa Servo lub cev muaj zog thiab ua cov qauv ntsuas.

Ua ntej tshaj plaws kuv tau ua DIY L-zoo nkhaus rau mount servo motor nrog kev pab los ntawm pawg thawj coj ua npuas ncauj.

Kauj ruam 3:

Duab
Duab

Sib dhos gimbal tau yooj yim heev. Kuv pib nrog txhim kho Yaw servo, MPU 6050 sensor thiab ON-OFF hloov. Siv cov ntsia liaj qhov rooj thiab cov txiv ntoo Kuv ruaj nws rau lub hauv paus

Kauj Ruam 4: Tom ntej, Siv Tib Txoj Kev Kuv Ruaj Ntseg Roll Servo. Cov Khoom Tshwj Xeeb tau tsim los kom yooj yim haum rau MG995 Servos

Tom ntej no, Siv Tib Txoj Kev Kuv Ruaj Ntseg Roll Servo. Cov Khoom Tshwj Xeeb tau tsim los kom yooj yim haum rau MG995 Servos
Tom ntej no, Siv Tib Txoj Kev Kuv Ruaj Ntseg Roll Servo. Cov Khoom Tshwj Xeeb tau tsim los kom yooj yim haum rau MG995 Servos

Kauj Ruam 5: Tom ntej, Siv Tib Txoj Kev Kuv Ruaj Ntseg Roll Servo. Cov Khoom Tshwj Xeeb tau tsim los kom yooj yim haum rau MG995 Servos

Tom ntej no, Siv Tib Txoj Kev Kuv Ruaj Ntseg Roll Servo. Cov Khoom Tshwj Xeeb tau tsim los kom yooj yim haum rau MG995 Servos
Tom ntej no, Siv Tib Txoj Kev Kuv Ruaj Ntseg Roll Servo. Cov Khoom Tshwj Xeeb tau tsim los kom yooj yim haum rau MG995 Servos

Kauj Ruam 6: Kev Sib Txuas

Kev sib txuas
Kev sib txuas

Hauv daim duab kab hluav taws xob koj tuaj yeem siv ib qho hloov pauv lossis 7805 Voltage regulator IC los hloov 8V rau 5 V. Cov microcontroller uas tau muab daim duab kos yog Arduino Nano koj tseem tuaj yeem siv Arduino Uno, Arduino Mega.

SCL thiab SDA pins ntawm MPU 6050 txuas nrog Arduino Analog tus pin A5 thiab A4. (SCL thiab SDA tus pin yuav sib txawv yog li txheeb xyuas cov ntaub ntawv rau SCl thiab SDA pins rau lwm lub microcontroller)

Kauj Ruam 7: Kev Txuas Nrog 7805 Voltage Regulator IC

Kev Txuas Nrog 7805 Voltage Regulator IC
Kev Txuas Nrog 7805 Voltage Regulator IC

Daim duab qhia chaw no yog rau kev sib txuas ntawm 7805 tus tswj hluav taws xob ic, txuas lub roj teeb 8v ntawm Vin thiab koj yuav tau txais qhov hluav taws xob tso tawm ntawm 5v.

Kauj ruam 8: Coding

Koj yuav tsum suav nrog cov tsev qiv ntawv hauv qab no:

1) #includeClick Hereto download zip file

2) #includeClick Ntawm no mus rub cov ntawv zip

Tom qab rub tawm cov ntawv zip, ntxiv zip qiv hauv arduino kos duab

Rau Code

/*

DIY Gimbal - MPU6050 Arduino Tutorial Code raws MPU6050_DMP6 piv txwv los ntawm i2cdevlib lub tsev qiv ntawv los ntawm Jeff Rowberg: https://github.com/jrowberg/i2cdevlib */// I2Cdev thiab MPU6050 yuav tsum tau teeb tsa ua lub tsev qiv ntawv, lossis lwm qhov.cpp/.h cov ntaub ntawv // rau ob chav kawm yuav tsum suav nrog txoj hauv kev ntawm koj txoj haujlwm #suav nrog "I2Cdev.h" #suav nrog "MPU6050_6Axis_MotionApps20.h" // #suav nrog "MPU6050.h" // tsis tsim nyog yog siv MotionApps suav nrog cov ntawv / / Arduino Wire lub tsev qiv ntawv xav tau yog I2Cdev I2CDEV_ARDUINO_WIRE kev siv // siv hauv I2Cdev.h #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE #include "Wire.h" #endif #include // class default I2C address is 0x68 // specific I dhau los ua qhov ntsuas ntawm no // AD0 qis = 0x68 (lub hauv paus rau SparkFun breakout thiab InvenSense kev tshuaj xyuas pawg thawj coj saib) // AD0 siab = 0x69 MPU6050 mpu; // MPU6050 mpu (0x69); // <- siv rau AD0 siab // Txhais 3 servo motors Servo servo0; Servo tsav 1; Servo tsav 2; ntab raug; int j = 0; #define OUTPUT_READABLE_YAWPITCHROLL #define INTERRUPT_PIN 2 // siv tus pin 2 ntawm Arduino Uno & cov laug cam feem ntau blinkState = cuav; // MPU tswj/xwm txheej vars bool dmpReady = tsis tseeb; // teeb tsa qhov tseeb yog tias DMP pib ua tiav uint8_t mpuIntStatus; // tuav qhov xwm txheej cuam tshuam los ntawm MPU uint8_t devStatus; // rov qab xwm txheej tom qab txhua lub cuab yeej ua haujlwm (0 = ua tiav,! 0 = yuam kev) uint16_t packetSize; // xav tias DMP pob ntawv loj (lub neej ntawd yog 42 bytes) uint16_t fifoCount; // suav ntawm txhua bytes tam sim no hauv FIFO uint8_t fifoBuffer [64]; // FIFO tsis khaws cia // kev taw qhia/txav vars Quaternion q; // [w, x, y, z] quaternion ntim VectorInt16 aa; // [x, y, z] accel sensor ntsuas VectorInt16 aaReal; // [x, y, z] tsis muaj lub ntiajteb txawj nqus accel sensor ntsuas VectorInt16 aaWorld; // [x, y, z] ntiaj teb-ncej accel sensor ntsuas VectorFloat lub ntiajteb txawj nqus; // [x, y, z] gravity vector ntab euler [3]; // [psi, theta, phi] Euler kaum lub thawv ntim ntab ypr [3]; // [yaw, pitch, roll] yaw/pitch/roll container and gravity vector // packet structure for InvenSense teapot demo uint8_t teapotPacket [14] = {'$', 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0x00, '\ r', '\ n'}; // ======================================================== ================ // === INTERRUPT DETECTION ROUTINE === // ===================== =========================================== volatile bool mpuInterrupt = cuav; // qhia seb MPU cuam tshuam tus pin tau ploj mus tsis muaj dab tsi dmpDataReady () {mpuInterrupt = muaj tseeb; } // ================================================ ================= // === Kev teeb tsa thawj zaug === // ===================== =========================================== void teeb tsa () {// koom nrog I2C npav (I2Cdev tsev qiv ntawv tsis ua qhov no tau) #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE Wire.begin (); Wire.setClock (400000); // 400kHz I2C moos. Tawm tswv yim kab ntawv no yog tias muaj teeb meem sau ua ke #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE Fastwire:: teeb tsa (400, muaj tseeb); #endif // pib ua kev sib txuas lus // (115200 xaiv vim nws xav tau rau Teapot Demo tso tawm, tab sis nws yog // tiag tiag rau koj nyob ntawm koj qhov project) Serial.begin (38400); thaum (! Serial); // tos rau Leonardo suav, lwm tus txuas ntxiv tam sim // pib ntaus ntawv //Serial.println(F("Initializing I2C li… ")); mpu.initialize (); pinMode (INTERRUPT_PIN, INPUT); devStatus = mpu.dmpInitialize (); // muab koj tus kheej gyro offsets ntawm no, ntsuas rau min rhiab heev mpu.setXGyroOffset (17); mpu.setYGyroOffset (-69); mpu.setZGyroOffset (27); mpu.setZAccelOffset (1551); // 1688 lub hauv paus tsis raug rau kuv qhov kev xeem nti // xyuas kom nws ua haujlwm (rov qab 0 yog li) yog (devStatus == 0) {// qhib DMP, tam sim no nws tau npaj txhij // Serial.println (F ("Enabling DMP… ")); NPE mpu.setDMPEnabled (muaj tseeb); attachInterrupt (digitalPinToInterrupt (INTERRUPT_PIN), dmpDataReady, RISING); mpuIntStatus = mpu.getIntStatus (); // teeb tsa peb DMP Npaj tus chij kom lub voj tseem ceeb () ua haujlwm paub nws zoo siv nws //Serial.println(F("DMP npaj txhij! Tos thawj qhov cuam tshuam … ")); dmpReady = muaj tseeb; // tau txais kev cia siab DMP pob ntawv loj rau tom qab sib piv packetSize = mpu.dmpGetFIFOPacketSize (); } lwm {{ERROR! // 1 = thawj lub cim xeeb thauj khoom ua tsis tiav // 2 = DMP kev hloov kho tshiab tsis ua tiav // (yog tias nws yuav tawg, feem ntau cov cai yuav yog 1) // Serial.print (F ("DMP Initialization failed (code"))); //Serial.print(devStatus); //Serial.println (F (")")); } // Txhais cov pins uas 3 servo motors txuas nrog servo0.attach (10); servo1.attach (9); servo2.attach (8); } // ================================================ ================= // === MAIN PROGRAM LOOP === // ==================== ============================================ void loop () { / / yog tias lub program tsis ua tiav, tsis txhob sim ua dab tsi yog (! dmpReady) rov qab; // tos MPU cuam tshuam lossis pob ntawv ntxiv (s) muaj thaum (! mpuInterrupt && fifoCount <packetSize) {yog (mpuInterrupt && fifoCount

= 1024) {

// rov pib dua yog li peb tuaj yeem txuas ntxiv huv si mpu.resetFIFO (); fifoCount = mpu.getFIFOCount (); Serial.println (F ("FIFO txhoj puab heev!")); // txwv tsis pub, kos rau DMP cov ntaub ntawv npaj cuam tshuam (qhov no yuav tsum tshwm sim ntau zaus)} lwm qhov yog (mpuIntStatus & _BV (MPU6050_INTERRUPT_DMP_INT_BIT)) {// tos kom muaj cov ntaub ntawv ntev, yuav tsum yog VERY luv tos thaum (fifoCount 1 pob ntawv muaj / / (qhov no tso cai rau peb nyeem tam sim ntawd yam tsis tau tos kev cuam tshuam) fifoCount -= packetSize; // Tau Yaw, Pitch and Roll values #ifdef OUTPUT_READABLE_YAWPITCHROLL mpu.dmpGetQuaternion (& q, fifoBuffer); mpu.dmpGetGravity ().dmpGetYawPitchRoll (ypr, & q, & lub ntiajteb txawj nqus); // Yaw, Pitch, Roll values - Radians rau degrees ypr [0] = ypr [0] * 180 / M_PI; ypr [1] = ypr [1] * 180 / M_PI; ypr [2] = ypr [2] * 180 / M_PI; // Hla 300 nyeem (txheej txheem ntsuas tus kheej) yog (j <= 300) {raug = ypr [0]; // Yaw pib ntawm tus nqi random, yog li peb ntes tus nqi kawg tom qab 300 nyeem j ++;} // Tom qab 300 nyeem ntxiv {ypr [0] = ypr [0] - raug; // Teeb tsa Yaw rau 0 deg - rho tawm qhov kawg random Yaw tus nqi los ntawm tus nqi currrent los ua Yog 0 deg es // Qhia qhov tseem ceeb ntawm MPU6050 sensor los ntawm -90 txog 90 rau qhov muaj txiaj ntsig zoo rau kev tswj hwm servo los ntawm 0 txog 180 int servo0Value = daim ntawv qhia (ypr [0], -90, 90, 0, 180); int servo1Value = daim ntawv qhia (ypr [1], -90, 90, 0, 180); int servo2Value = daim ntawv qhia (ypr [2], -90, 90, 180, 0); // Tswj cov servos raws li MPU6050 kev taw qhia servo0.write (servo0Value); servo1.write (servo1Value); servo2.write (servo2Value); } #endif}}

Thaum kawg siv cov ntawv sau ua haujlwm, peb xa cov txiaj ntsig no mus rau servos raws li tswj cov cim. Yog lawm, koj tuaj yeem kaw Yaw servo yog tias koj xav tau kev ruaj ntseg rau X thiab Y axis, thiab siv lub platform no ua lub koob yees duab gimbal

Kauj Ruam 9: Thaum Txhua Lub Cheeb Tsam Txuas nrog, nws zoo ib yam rau daim duab no

Thaum Txhua Lub Cheeb Tsam Txuas nrog, nws zoo ib yam rau daim duab no
Thaum Txhua Lub Cheeb Tsam Txuas nrog, nws zoo ib yam rau daim duab no

Kauj Ruam 10: Tam sim no ntxig tag nrho cov khoom hauv qab hauv Cov Khoom Noj

Tam sim no ntxig Txhua Yam Khoom Hauv Hauv Cov Khoom Noj Tau
Tam sim no ntxig Txhua Yam Khoom Hauv Hauv Cov Khoom Noj Tau

Kauj Ruam 11: Thaum Tag Nrho Cov Hluav Taws Xob thiab Cheeb Tsam raug tso rau sab hauv cov khoom noj tuaj yeem siv tau rab yaj phom ntawm lub hauv paus ntawm Npuas Npoo

Thaum Txhua Cov Hluav Taws Xob thiab Cov Cheeb Tsam raug tso rau sab hauv cov khoom noj tuaj yeem siv tom qab ntawd phom phom ntawm lub hauv paus ntawm Npuas Npoo
Thaum Txhua Cov Hluav Taws Xob thiab Cov Cheeb Tsam raug tso rau sab hauv cov khoom noj tuaj yeem siv tom qab ntawd phom phom ntawm lub hauv paus ntawm Npuas Npoo

Kauj Ruam 12: Xaus

Thov nco tseg qhov no deb ntawm lub koob yees duab zoo gimbal. Kev txav mus los tsis yooj yim vim tias cov kev pabcuam no tsis tau txhais rau lub hom phiaj zoo li no. Lub koob yees duab tiag gimbals siv hom tshwj xeeb ntawm BLDC lub cev kom tau txais kev txav mus los yooj yim. Yog li, txiav txim siab qhov haujlwm no tsuas yog rau lub hom phiaj kev kawm.

Qhov ntawd yuav yog txhua yam rau qhov kev qhia no, Kuv vam tias koj nyiam nws thiab kawm qee yam tshiab. Xav tias yuav nug ib lo lus nug hauv kab lus hauv qab no thiab tsis txhob hnov qab tshawb xyuas kuv cov phiaj xwm ntawm qhov project

Pom zoo: