{"id":614,"date":"2026-06-11T13:28:41","date_gmt":"2026-06-11T05:28:41","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/antenna-tracker-auto-uav-esp32-servo-farsi\/"},"modified":"2026-06-11T13:28:42","modified_gmt":"2026-06-11T05:28:42","slug":"antenna-tracker-auto-uav-esp32-servo-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/antenna-tracker-auto-uav-esp32-servo-farsi\/","title":{"rendered":"\u0633\u0627\u062e\u062a \u067e\u06cc\u06af\u0631\u062f \u062e\u0648\u062f\u06a9\u0627\u0631 \u0622\u0646\u062a\u0646 (Antenna Tracker) \u0628\u0631\u0627\u06cc UAV \u0628\u0627 ESP32 \u0648 \u0633\u0631\u0648 (\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\/post103-antenna-tracker.jpg' alt='Antenna Tracker \u062e\u0648\u062f\u06a9\u0627\u0631 UAV ESP32 \u0633\u0631\u0648' 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'>Antenna Tracker \u0686\u06cc\u0633\u062a\u061f (\u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u062f\u0631 \u067e\u0631\u0648\u0627\u0632\u0647\u0627\u06cc \u062f\u0648\u0631\u0628\u0631\u062f UAV\u060c \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u0627\u0632 \u0622\u0646\u062a\u0646 <strong>\u062c\u0647\u062a\u200c\u062f\u0627\u0631<\/strong> (\u0645\u062b\u0644 Yagi \u06cc\u0627 Patch) \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u0628\u0647\u062a\u0631 \u0633\u06cc\u06af\u0646\u0627\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0645\u0634\u06a9\u0644: \u0628\u0627\u06cc\u062f \u0622\u0646\u062a\u0646 \u0631\u0627 \u062f\u0633\u062a\u06cc \u0628\u0647 \u0633\u0645\u062a \u067e\u0647\u067e\u0627\u062f \u0646\u06af\u0647 \u062f\u0627\u0631\u06cc\u062f. \u06cc\u06a9 <strong>Antenna Tracker<\/strong> \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u062f \u2014 \u0645\u0648\u0642\u0639\u06cc\u062a GPS \u067e\u0647\u067e\u0627\u062f \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0633\u0631\u0648\u0647\u0627\u06cc Pan (\u0686\u067e\/\u0631\u0627\u0633\u062a) \u0648 Tilt (\u0628\u0627\u0644\u0627\/\u067e\u0627\u06cc\u06cc\u0646) \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<p>ESP32 \u0645\u0648\u0642\u0639\u06cc\u062a \u067e\u0647\u067e\u0627\u062f \u0631\u0627 \u0627\u0632 \u062a\u0644\u0647\u200c\u0645\u062a\u0631\u06cc MAVLink \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f\u060c \u0633\u067e\u0633 <strong>Azimuth<\/strong> (\u0632\u0627\u0648\u06cc\u0647 \u0627\u0641\u0642\u06cc) \u0648 <strong>Elevation<\/strong> (\u0632\u0627\u0648\u06cc\u0647 \u0639\u0645\u0648\u062f\u06cc) \u0631\u0627 \u0627\u0632 \u0645\u0648\u0642\u0639\u06cc\u062a \u062e\u0648\u062f \u0646\u0633\u0628\u062a \u0628\u0647 \u067e\u0647\u067e\u0627\u062f \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0633\u0631\u0648\u0647\u0627 \u0631\u0627 \u0645\u06cc\u200c\u0686\u0631\u062e\u0627\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>\u06cc\u06a9 Antenna Tracker Pan-Tilt \u062e\u0648\u062f\u06a9\u0627\u0631 \u0628\u0627 \u062f\u0642\u062a \u00b1\u06f5 \u062f\u0631\u062c\u0647.<\/p>\n<ul>\n<li><strong>\u0647\u0632\u06cc\u0646\u0647:<\/strong> \u06f5\u06f0\u06f0 \u0647\u0632\u0627\u0631 \u062a\u0648\u0645\u0627\u0646 (\u0633\u0631\u0648+ESP32+Pan-Tilt)<\/li>\n<li><strong>\u062f\u0642\u062a:<\/strong> \u00b1\u06f5 \u062f\u0631\u062c\u0647 Azimuth<\/li>\n<li><strong>\u067e\u0631\u0648\u062a\u06a9\u0644:<\/strong> MAVLink \u0631\u0648\u06cc Serial<\/li>\n<\/ul>\n<\/div>\n<p><svg viewBox='0 0 860 200' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#e8f4e8;border:1px solid #4caf50;border-radius:12px;margin-bottom:22px'>\n<rect x='0' y='0' width='860' height='200' rx='12' fill='#e8f4e8'\/>\n<!-- \u0632\u0645\u06cc\u0646 -->\n<rect x='340' y='140' width='180' height='50' rx='8' fill='#78909c' stroke='#37474f' stroke-width='2'\/>\n<text x='430' y='163' text-anchor='middle' font-size='11' font-family='Tahoma' fill='#fff'>Tracker \u0632\u0645\u06cc\u0646<\/text>\n<text x='430' y='178' text-anchor='middle' font-size='10' font-family='Tahoma' fill='#fff'>ESP32+\u0633\u0631\u0648<\/text>\n<!-- \u0622\u0646\u062a\u0646 -->\n<polygon points='430,140 420,110 440,110' fill='#e53935'\/>\n<line x1='430' y1='110' x2='430' y2='90' stroke='#e53935' stroke-width='3'\/>\n<!-- \u0632\u0627\u0648\u06cc\u0647 -->\n<path d='M430,110 Q480,80 530,60' fill='none' stroke='#4caf50' stroke-width='2' stroke-dasharray='5,3'\/>\n<text x='490' y='73' font-size='10' font-family='Tahoma' fill='#4caf50'>Elevation \u03b8<\/text>\n<!-- \u067e\u0647\u067e\u0627\u062f -->\n<circle cx='680' cy='55' r='20' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<text x='680' y='59' text-anchor='middle' font-size='10' font-family='Tahoma'>UAV<\/text>\n<line x1='430' y1='100' x2='660' y2='60' stroke='#3a60c0' stroke-width='1.5' stroke-dasharray='4,2'\/>\n<text x='540' y='95' font-size='10' font-family='Tahoma' fill='#3a60c0'>Azimuth \u03c6<\/text>\n<arc cx='430' cy='140' r='30'\/>\n<text x='430' y='195' text-anchor='middle' font-size='12' font-family='Tahoma' fill='#1a237e'>Antenna Tracker \u2014 \u0622\u0646\u062a\u0646 \u062f\u0646\u0628\u0627\u0644 \u067e\u0647\u067e\u0627\u062f \u0645\u06cc\u200c\u06af\u0631\u062f\u062f<\/text>\n<\/svg><\/p>\n<h2>\u06a9\u062f ESP32 \u2014 Antenna Tracker<\/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;ESP32Servo.h&gt;\n#include &lt;TinyGPS++.h&gt;\n#include &lt;HardwareSerial.h&gt;\n\nServo pan, tilt;\nHardwareSerial mavSerial(1);  \/\/ \u062a\u0644\u0647\u200c\u0645\u062a\u0631\u06cc MAVLink\nTinyGPSPlus gpsHome;          \/\/ GPS \u0632\u0645\u06cc\u0646 (\u0645\u0648\u0642\u0639\u06cc\u062a tracker)\n\n\/\/ \u0645\u0648\u0642\u0639\u06cc\u062a \u062e\u0627\u0646\u0647 (tracker):\ndouble homeLat = 35.7448;  \/\/ \u062a\u0647\u0631\u0627\u0646\ndouble homeLon = 51.3753;\n\nvoid setup() {\n  pan.attach(13);   \/\/ \u0633\u0631\u0648 Pan (Azimuth)\n  tilt.attach(14);  \/\/ \u0633\u0631\u0648 Tilt (Elevation)\n  pan.write(90); tilt.write(45);  \/\/ \u0645\u0642\u062f\u0627\u0631 \u0627\u0648\u0644\u06cc\u0647\n\n  Serial.begin(115200);\n  mavSerial.begin(57600, SERIAL_8N1, 16, 17);  \/\/ UART2\n}\n\ndouble calcAzimuth(double lat1,double lon1,double lat2,double lon2) {\n  double dLon = (lon2-lon1)*PI\/180;\n  lat1*=PI\/180; lat2*=PI\/180;\n  double y = sin(dLon)*cos(lat2);\n  double x = cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(dLon);\n  return fmod(atan2(y,x)*180\/PI + 360, 360);\n}\n\ndouble calcElevation(double dist, double alt) {\n  return atan2(alt, dist*1000)*180\/PI;  \/\/ alt \u0645\u062a\u0631\u060c dist km\n}\n\nvoid loop() {\n  \/\/ \u062f\u0631\u06cc\u0627\u0641\u062a GPS \u0647\u0648\u0627\u067e\u06cc\u0645\u0627 \u0627\u0632 MAVLink\n  \/\/ (\u0633\u0627\u062f\u0647\u200c\u0634\u062f\u0647 \u2014 \u062f\u0631 \u067e\u0631\u0648\u0698\u0647 \u0648\u0627\u0642\u0639\u06cc MAVLink parse \u06a9\u0646\u06cc\u062f)\n  double uavLat = 35.7500;  \/\/ \u0627\u0632 \u062a\u0644\u0647\u200c\u0645\u062a\u0631\u06cc\n  double uavLon = 51.3800;\n  double uavAlt = 100;      \/\/ \u0645\u062a\u0631\n\n  double dist = TinyGPSPlus::distanceBetween(homeLat,homeLon,uavLat,uavLon)\/1000.0;\n  double az = calcAzimuth(homeLat,homeLon,uavLat,uavLon);\n  double el = calcElevation(dist, uavAlt);\n\n  \/\/ \u0646\u06af\u0627\u0634\u062a \u0628\u0647 \u0633\u0631\u0648:\n  int panAngle  = map(az, 0, 360, 0, 180);  \/\/ \u0645\u062d\u062f\u0648\u062f \u0628\u0647 \u06f1\u06f8\u06f0\u00b0 \u0633\u0631\u0648\n  int tiltAngle = constrain(map(el, 0, 90, 45, 135), 0, 180);\n\n  pan.write(panAngle);\n  tilt.write(tiltAngle);\n  delay(200);\n}\n<\/code><\/pre>\n<h2>\u0686\u06a9\u200c\u0644\u06cc\u0633\u062a \u06a9\u0627\u0644\u06cc\u0628\u0631\u0627\u0633\u06cc\u0648\u0646<\/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'>\u0645\u0648\u0642\u0639\u06cc\u062a Home \u062f\u0642\u06cc\u0642 \u0627\u0633\u062a\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>GPS \u062e\u0627\u0646\u0647 \u0631\u0627 \u062f\u0631 \u06a9\u062f \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0633\u0631\u0648 Pan \u062f\u0631 \u06f9\u06f0\u00b0 \u0628\u0647 \u0634\u0645\u0627\u0644 \u0627\u0634\u0627\u0631\u0647 \u062f\u0627\u0631\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06a9\u0627\u0644\u06cc\u0628\u0631\u0627\u0633\u06cc\u0648\u0646 \u0645\u06a9\u0627\u0646\u06cc\u06a9\u06cc<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0648\u0642\u062a\u06cc \u067e\u0647\u067e\u0627\u062f \u062f\u0631 \u06f1\u06f0\u06f0\u00b0 \u0634\u0631\u0642 \u2192 Pan \u0628\u0647 \u06f1\u06f0\u06f0\u00b0\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u2610<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>Tilt \u062f\u0631 \u06f4\u06f5\u00b0 \u0627\u0641\u0642 \u0627\u0641\u0642\u06cc \u0646\u06af\u0647 \u0645\u06cc\u200c\u062f\u0627\u0631\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u2610<\/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='#b7e4a0' stroke='#3a7a1e' 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='#8bd3dd' stroke='#1f6f78' 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' stroke-dasharray='6,3'\/>\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'>MAVLink UAV<\/text>\n<text x='117' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>GPS lat\/lon\/alt<\/text>\n<text x='322' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>ESP32<\/text>\n<text x='322' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>Azimuth\/Elevation<\/text>\n<text x='527' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>\u0633\u0631\u0648 Pan+Tilt<\/text>\n<text x='527' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>MG996R\u00d72<\/text>\n<text x='737' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>\u0622\u0646\u062a\u0646 \u062c\u0647\u062a\u200c\u062f\u0627\u0631<\/text>\n<text x='737' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>Yagi\/Patch<\/text>\n<text x='430' y='175' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#666'>Tracker \u2014 MAVLink \u2192 ESP32 \u2192 \u0633\u0631\u0648 \u2192 \u0622\u0646\u062a\u0646 \u062f\u0646\u0628\u0627\u0644 UAV<\/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\/gyCnr8LvELI' title='DIY Antenna Tracker for FPV Drone Build' 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\/1ioUzclMEns' title='Antenna Tracker MAVLink Arduino 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\/Antenna_Tracker_%D9%BE%D9%87%D9%BE%D8%A7%D8%AF_%D8%AE%D9%88%D8%AF%DA%A9%D8%A7%D8%B1' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: Antenna Tracker \u067e\u0647\u067e\u0627\u062f \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/ardupilot.org\/antennatracker\/' target='_blank'>ArduPilot: AntennaTracker Documentation<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u0633\u06cc\u0633\u062a\u0645 \u067e\u06cc\u06af\u0631\u062f \u0622\u0646\u062a\u0646 \u062e\u0648\u062f\u06a9\u0627\u0631 (Antenna Tracker) \u0628\u0627 ESP32\u060c \u0633\u0631\u0648 Pan-Tilt\u060c \u0648 \u062a\u0644\u0647\u200c\u0645\u062a\u0631\u06cc MAVLink\u061b \u0622\u0646\u062a\u0646 \u0647\u0645\u06cc\u0634\u0647 \u0628\u0647 \u0633\u0645\u062a \u067e\u0647\u067e\u0627\u062f \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc\u200c\u0634\u0648\u062f \u0628\u0631\u0627\u06cc \u0628\u0631\u062f \u0628\u06cc\u0634\u062a\u0631.<\/p>\n","protected":false},"author":1,"featured_media":613,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[17,20],"tags":[131,22,125,132,49,50,69,402],"class_list":["post-614","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uav","category-projects-2","tag-antenna-tracker","tag-esp32","tag-mavlink","tag-pan-tilt","tag-uav","tag-50","tag-69","tag-402"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/614","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=614"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/614\/revisions"}],"predecessor-version":[{"id":615,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/614\/revisions\/615"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/613"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}