{"id":605,"date":"2026-06-11T13:18:31","date_gmt":"2026-06-11T05:18:31","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/3axis-gimbal-arduino-mpu6050-fpv-stabilizer-farsi\/"},"modified":"2026-06-11T13:18:32","modified_gmt":"2026-06-11T05:18:32","slug":"3axis-gimbal-arduino-mpu6050-fpv-stabilizer-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/3axis-gimbal-arduino-mpu6050-fpv-stabilizer-farsi\/","title":{"rendered":"\u0633\u0627\u062e\u062a \u06af\u06cc\u0645\u067e\u0627\u0644 \u06f3 \u0645\u062d\u0648\u0631\u0647 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 MPU-6050: \u062a\u0635\u0648\u06cc\u0631 \u067e\u0627\u06cc\u062f\u0627\u0631 \u0628\u0631\u0627\u06cc FPV (\u0641\u0627\u0631\u0633\u06cc)"},"content":{"rendered":"<div class='hero-image-container' style='margin-bottom:28px;border-radius:14px;overflow:hidden;box-shadow:0 4px 18px rgba(0,0,0,0.08)'>\n<img src='https:\/\/projectleon.net\/make\/wp-content\/uploads\/2026\/06\/post100-gimbal-mpu6050.jpg' alt='\u06af\u06cc\u0645\u067e\u0627\u0644 \u06f3 \u0645\u062d\u0648\u0631\u0647 MPU-6050 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 FPV \u067e\u0627\u06cc\u062f\u0627\u0631' style='width:100%;height:auto;display:block' loading='eager'\/>\n<\/div>\n<div class='beginner-intro' style='background:#f0f7ff;border-right:4px solid #2e5fb6;padding:16px 20px;border-radius:10px;margin-bottom:22px'>\n<h2 style='margin-top:0'>\u06af\u06cc\u0645\u067e\u0627\u0644 \u0648 \u067e\u0627\u06cc\u062f\u0627\u0631\u0633\u0627\u0632\u06cc \u062a\u0635\u0648\u06cc\u0631 \u0686\u06cc\u0633\u062a\u061f (\u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u0648\u0642\u062a\u06cc \u06cc\u06a9 \u067e\u0647\u067e\u0627\u062f \u06cc\u0627 UGV \u062d\u0631\u06a9\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f\u060c \u062f\u0648\u0631\u0628\u06cc\u0646 \u0647\u0645\u0631\u0627\u0647 \u0622\u0646 \u0645\u06cc\u200c\u0644\u0631\u0632\u062f \u2014 \u062a\u0635\u0648\u06cc\u0631 FPV \u0646\u0627\u067e\u0627\u06cc\u062f\u0627\u0631 \u0645\u06cc\u200c\u0634\u0648\u062f. \u06cc\u06a9 <strong>\u06af\u06cc\u0645\u067e\u0627\u0644<\/strong> (Gimbal) \u06cc\u06a9 \u067e\u0644\u062a\u0641\u0631\u0645 \u0645\u062a\u062d\u0631\u06a9 \u0627\u0633\u062a \u06a9\u0647 \u0644\u0631\u0632\u0634\u200c\u0647\u0627 \u0631\u0627 \u0628\u0627 \u0633\u0631\u0648\u0647\u0627 \u062c\u0628\u0631\u0627\u0646 \u0645\u06cc\u200c\u06a9\u0646\u062f \u2014 \u062f\u0648\u0631\u0628\u06cc\u0646 \u0647\u0645\u06cc\u0634\u0647 \u0635\u0627\u0641 \u0645\u06cc\u200c\u0645\u0627\u0646\u062f.<\/p>\n<p>\u0633\u0646\u0633\u0648\u0631 <strong>MPU-6050<\/strong> \u06cc\u06a9 IMU \u06f6 \u0645\u062d\u0648\u0631\u0647 (\u06f3 \u0645\u062d\u0648\u0631 \u0634\u062a\u0627\u0628\u200c\u0633\u0646\u062c + \u06f3 \u0645\u062d\u0648\u0631 \u0698\u06cc\u0631\u0648\u0633\u06a9\u0648\u067e) \u0628\u0627 \u0642\u06cc\u0645\u062a \u0632\u06cc\u0631 \u06f5 \u062f\u0644\u0627\u0631 \u0627\u0633\u062a. \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0628\u0627 \u06a9\u0646\u062a\u0631\u0644\u0631 <strong>PID<\/strong> \u062e\u0637\u0627\u06cc \u0632\u0627\u0648\u06cc\u0647 \u0631\u0627 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f \u0648 \u0633\u0631\u0648\u0647\u0627\u06cc <strong>MG996R<\/strong> \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u06af\u06cc\u0645\u067e\u0627\u0644 \u06f3 \u0645\u062d\u0648\u0631\u0647 \u0647\u0631 \u0633\u0647 \u0645\u062d\u0648\u0631 Roll\u060c Pitch\u060c \u0648 Yaw \u0631\u0627 \u06a9\u0646\u062a\u0631\u0644 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<\/div>\n<div style='border:1px solid #d8d8d8;padding:18px 20px;border-radius:12px;background:#fafafa;margin-bottom:22px'>\n<h2 style='margin-top:0'>\u0645\u062d\u0635\u0648\u0644\u06cc \u06a9\u0647 \u0645\u06cc\u200c\u0633\u0627\u0632\u06cc\u062f<\/h2>\n<p>\u06af\u06cc\u0645\u067e\u0627\u0644 \u06f3 \u0645\u062d\u0648\u0631\u0647 \u0628\u0627 MPU-6050 \u0648 \u06f3 \u0633\u0631\u0648 MG996R \u0628\u0631\u0627\u06cc \u062f\u0648\u0631\u0628\u06cc\u0646 FPV.<\/p>\n<ul>\n<li><strong>\u0647\u0632\u06cc\u0646\u0647:<\/strong> \u06f5\u06f0\u06f0 \u0647\u0632\u0627\u0631 \u062a\u0627 \u06f1 \u0645\u06cc\u0644\u06cc\u0648\u0646 \u062a\u0648\u0645\u0627\u0646<\/li>\n<li><strong>\u0645\u062d\u0648\u0631\u0647\u0627:<\/strong> Roll\u060c Pitch\u060c Yaw<\/li>\n<li><strong>\u0633\u0631\u0639\u062a \u067e\u0627\u0633\u062e:<\/strong> \u06f2\u06f0\u06f0Hz \u0628\u0627 MPU-6050<\/li>\n<\/ul>\n<\/div>\n<p><svg viewBox='0 0 860 200' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#fff;border:1px solid #e0e0e0;border-radius:12px;margin-bottom:22px'>\n<rect x='330' y='60' width='200' height='100' rx='14' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<text x='430' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>\u062f\u0648\u0631\u0628\u06cc\u0646 FPV<\/text>\n<text x='430' y='118' text-anchor='middle' font-size='11' font-family='Tahoma'>MPU-6050 \u0631\u0648\u06cc \u0622\u0646<\/text>\n<!-- \u0633\u0631\u0648 Roll -->\n<rect x='180' y='80' width='140' height='60' rx='10' fill='#8bd3dd' stroke='#1f6f78' stroke-width='2'\/>\n<text x='250' y='108' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0633\u0631\u0648 Roll<\/text>\n<line x1='320' y1='110' x2='330' y2='110' stroke='#555' stroke-width='2'\/>\n<!-- \u0633\u0631\u0648 Pitch -->\n<rect x='540' y='80' width='140' height='60' rx='10' fill='#8bd3dd' stroke='#1f6f78' stroke-width='2'\/>\n<text x='610' y='108' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0633\u0631\u0648 Pitch<\/text>\n<line x1='530' y1='110' x2='540' y2='110' stroke='#555' stroke-width='2'\/>\n<!-- \u0633\u0631\u0648 Yaw -->\n<rect x='330' y='170' width='200' height='25' rx='8' fill='#b7e4a0' stroke='#3a7a1e'\/>\n<text x='430' y='186' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0633\u0631\u0648 Yaw (\u0632\u06cc\u0631)<\/text>\n<text x='430' y='195' text-anchor='middle' font-size='10' font-family='Tahoma' fill='#888'>\u06af\u06cc\u0645\u067e\u0627\u0644 \u06f3 \u0645\u062d\u0648\u0631\u0647 \u2014 PID \u0647\u0631 \u0645\u062d\u0648\u0631<\/text>\n<\/svg><\/p>\n<h2>\u06a9\u062f \u06af\u06cc\u0645\u067e\u0627\u0644 \u0628\u0627 PID<\/h2>\n<pre style='background:#1e1e1e;color:#d4d4d4;padding:14px;border-radius:10px;overflow-x:auto;font-size:13px'><code class='language-cpp'>\n#include &lt;Wire.h&gt;\n#include &lt;MPU6050.h&gt;\n#include &lt;Servo.h&gt;\n\nMPU6050 mpu;\nServo servoRoll, servoPitch, servoYaw;\n\nfloat rollAngle, pitchAngle, yawAngle;\nfloat rollTarget=90, pitchTarget=90, yawTarget=90;\n\n\/\/ PID \u0647\u0631 \u0645\u062d\u0648\u0631:\nfloat Kp=1.5, Ki=0.05, Kd=0.3;\nfloat errR,errP,errY;\nfloat intR=0,intP=0,intY=0;\nfloat prevR=0,prevP=0,prevY=0;\n\nvoid setup() {\n  Wire.begin();\n  mpu.initialize();\n  servoRoll.attach(9);\n  servoPitch.attach(10);\n  servoYaw.attach(11);\n}\n\nfloat pid(float err, float &integral, float &prev) {\n  integral += err;\n  float d = err - prev;\n  prev = err;\n  return Kp*err + Ki*integral + Kd*d;\n}\n\nvoid loop() {\n  int16_t ax,ay,az,gx,gy,gz;\n  mpu.getMotion6(&ax,&ay,&az,&gx,&gy,&gz);\n\n  \/\/ \u0645\u062d\u0627\u0633\u0628\u0647 \u0632\u0627\u0648\u06cc\u0647 \u0627\u0632 \u0634\u062a\u0627\u0628\u200c\u0633\u0646\u062c:\n  rollAngle  = atan2(ay,az)*180\/PI;\n  pitchAngle = atan2(-ax,sqrt(ay*ay+az*az))*180\/PI;\n\n  \/\/ PID \u0648 \u062e\u0631\u0648\u062c\u06cc \u0633\u0631\u0648:\n  errR = rollTarget  - rollAngle;\n  errP = pitchTarget - pitchAngle;\n\n  int outR = 90 + pid(errR,intR,prevR);\n  int outP = 90 + pid(errP,intP,prevP);\n\n  servoRoll.write(constrain(outR,0,180));\n  servoPitch.write(constrain(outP,0,180));\n  delay(5);  \/\/ 200Hz\n}\n<\/code><\/pre>\n<h2>\u0686\u06a9\u200c\u0644\u06cc\u0633\u062a \u06a9\u0627\u0644\u06cc\u0628\u0631\u0627\u0633\u06cc\u0648\u0646 \u0648 \u062a\u0633\u062a<\/h2>\n<table style='width:100%;border-collapse:collapse;margin-bottom:18px'>\n<thead>\n<tr style='background:#e8f0fe'>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0628\u0631\u0631\u0633\u06cc<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0631\u0648\u0634<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>MPU-6050 \u0627\u0641\u0633\u062a \u06a9\u0627\u0644\u06cc\u0628\u0631\u0647 \u0634\u062f\u0647\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>mpu.calibrateGyro() \u0631\u0648\u06cc \u0645\u06cc\u0632 \u0635\u0627\u0641<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0633\u0631\u0648 \u062f\u0631 \u06f9\u06f0\u00b0 \u0635\u0641\u0631 \u062f\u0631\u062c\u0647 \u0646\u06af\u0647 \u0645\u06cc\u200c\u062f\u0627\u0631\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>rollTarget=pitchTarget=90<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u06af\u06cc\u0645\u067e\u0627\u0644 \u062a\u06a9\u0627\u0646 \u0631\u0627 \u062c\u0628\u0631\u0627\u0646 \u0645\u06cc\u200c\u06a9\u0646\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u067e\u0627\u06cc\u0647 \u0631\u0627 \u06a9\u062c \u06a9\u0646\u06cc\u062f \u2014 \u0628\u0627\u06cc\u062f \u062b\u0627\u0628\u062a \u0628\u0645\u0627\u0646\u062f<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>Oscillation (\u0644\u0631\u0632\u0634 PID) \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>Kp \u0631\u0627 \u06a9\u0627\u0647\u0634 \u062f\u0647\u06cc\u062f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><svg viewBox='0 0 860 200' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#fff;border:1px solid #e0e0e0;border-radius:12px;margin-bottom:22px'>\n<rect x='40' y='75' width='155' height='60' rx='12' fill='#8bd3dd' stroke='#1f6f78' stroke-width='2'\/>\n<rect x='245' y='75' width='155' height='60' rx='12' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<rect x='450' y='75' width='155' height='60' rx='12' fill='#b7e4a0' stroke='#3a7a1e' stroke-width='2'\/>\n<rect x='655' y='75' width='165' height='60' rx='12' fill='#e8f4ff' stroke='#3a60c0' stroke-width='2'\/>\n<line x1='195' y1='105' x2='245' y2='105' stroke='#555' stroke-width='2.5'\/>\n<line x1='400' y1='105' x2='450' y2='105' stroke='#555' stroke-width='2.5'\/>\n<line x1='605' y1='105' x2='655' y2='105' stroke='#555' stroke-width='2.5'\/>\n<text x='117' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>MPU-6050<\/text>\n<text x='117' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>200Hz IMU<\/text>\n<text x='322' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Arduino PID<\/text>\n<text x='322' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u06f3 \u0645\u062d\u0648\u0631<\/text>\n<text x='527' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>\u06f3\u00d7 MG996R<\/text>\n<text x='527' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0633\u0631\u0648 \u0642\u0648\u06cc<\/text>\n<text x='737' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>\u062f\u0648\u0631\u0628\u06cc\u0646 \u062b\u0627\u0628\u062a<\/text>\n<text x='737' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>FPV \u067e\u0627\u06cc\u062f\u0627\u0631<\/text>\n<text x='430' y='175' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#666'>\u06af\u06cc\u0645\u067e\u0627\u0644 \u2014 MPU-6050 \u2192 PID \u2192 \u0633\u0631\u0648 \u2192 \u062a\u0635\u0648\u06cc\u0631 FPV \u067e\u0627\u06cc\u062f\u0627\u0631<\/text>\n<\/svg><\/p>\n<h2>\u0648\u06cc\u062f\u0626\u0648\u0647\u0627\u06cc \u0622\u0645\u0648\u0632\u0634\u06cc<\/h2>\n<div style='display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:18px;margin:20px 0'>\n<iframe width='100%' height='315' src='https:\/\/www.youtube.com\/embed\/ufmFJVMrMwA' title='Arduino Gimbal MPU6050 3 Axis Stabilizer' frameborder='0' allow='accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture' allowfullscreen><\/iframe><br \/>\n<iframe width='100%' height='315' src='https:\/\/www.youtube.com\/embed\/4sttF3P8SaA' title='3 Axis Gimbal PID Control Tutorial' frameborder='0' allow='accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture' allowfullscreen><\/iframe>\n<\/div>\n<h2>\u0645\u0646\u0627\u0628\u0639 \u0628\u06cc\u0634\u062a\u0631<\/h2>\n<ul>\n<li><a href='https:\/\/www.aparat.com\/result\/%DA%AF%DB%8C%D9%85%D9%BE%D8%A7%D9%84_%D8%AF%D9%88%D8%B1%D8%A8%DB%8C%D9%86_%D9%BE%D8%A7%DB%8C%D8%AF%D8%A7%D8%B1%D8%B3%D8%A7%D8%B2' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: \u06af\u06cc\u0645\u067e\u0627\u0644 \u062f\u0648\u0631\u0628\u06cc\u0646 \u067e\u0627\u06cc\u062f\u0627\u0631\u0633\u0627\u0632 \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/github.com\/jrowberg\/i2cdevlib\/tree\/master\/Arduino\/MPU6050' target='_blank'>GitHub: MPU6050 Arduino Library<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u06af\u06cc\u0645\u067e\u0627\u0644 \u06f3 \u0645\u062d\u0648\u0631\u0647 \u0628\u0627 \u06f3 \u0633\u0631\u0648 MG996R\u060c MPU-6050 \u0648 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\u061b \u06a9\u062f PID \u0628\u0631\u0627\u06cc \u067e\u0627\u06cc\u062f\u0627\u0631\u0633\u0627\u0632\u06cc \u062f\u0648\u0631\u0628\u06cc\u0646\u060c \u06a9\u0627\u0644\u06cc\u0628\u0631\u0627\u0633\u06cc\u0648\u0646 IMU\u060c \u062a\u0633\u062a \u0631\u0648\u06cc \u067e\u0647\u067e\u0627\u062f.<\/p>\n","protected":false},"author":1,"featured_media":604,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[17,20],"tags":[24,396,73,21,50,398,397,395],"class_list":["post-605","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uav","category-projects-2","tag-fpv","tag-mpu-6050","tag-pid","tag-arduino","tag-50","tag-398","tag--mg996r","tag-395"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/comments?post=605"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":606,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/605\/revisions\/606"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/604"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}