{"id":596,"date":"2026-06-11T13:17:30","date_gmt":"2026-06-11T05:17:30","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/bldc-foc-simplefoc-arduino-ugv-smooth-control-farsi\/"},"modified":"2026-06-11T13:17:30","modified_gmt":"2026-06-11T05:17:30","slug":"bldc-foc-simplefoc-arduino-ugv-smooth-control-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/bldc-foc-simplefoc-arduino-ugv-smooth-control-farsi\/","title":{"rendered":"\u06a9\u0646\u062a\u0631\u0644 \u0645\u0648\u062a\u0648\u0631 BLDC \u0628\u0627 FOC \u0648 SimpleFOC \u0631\u0648\u06cc Arduino: \u0646\u0631\u0645\u200c\u062a\u0631\u06cc\u0646 \u062d\u0631\u06a9\u062a \u0628\u0631\u0627\u06cc UGV (\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\/post97-foc-simplefoc.jpg' alt='FOC SimpleFOC BLDC \u0645\u0648\u062a\u0648\u0631 UGV \u06a9\u0646\u062a\u0631\u0644' 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'>FOC \u0648 SimpleFOC \u0686\u06cc\u0633\u062a\u061f (\u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u0645\u0648\u062a\u0648\u0631\u0647\u0627\u06cc <strong>BLDC<\/strong> (Brushless DC) \u062f\u0631 \u06a9\u0648\u0627\u062f\u06a9\u0648\u067e\u062a\u0631\u0647\u0627\u060c \u0645\u0627\u0634\u06cc\u0646\u200c\u0647\u0627\u06cc \u0628\u0631\u0642\u06cc\u060c \u0648 UGV\u0647\u0627\u06cc \u062d\u0631\u0641\u0647\u200c\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u0646\u062f. \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u06a9\u0646\u062a\u0631\u0644 \u0622\u0646\u200c\u0647\u0627 \u0628\u0627 ESC \u0633\u0627\u062f\u0647 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u0634\u0648\u062f \u06a9\u0647 \u0641\u0642\u0637 \u0633\u0631\u0639\u062a \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0627\u0645\u0627 <strong>FOC<\/strong> (Field Oriented Control \u2014 \u06a9\u0646\u062a\u0631\u0644 \u0645\u06cc\u062f\u0627\u0646\u200c\u06af\u0631\u0627) \u0631\u0648\u0634\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0645\u0648\u062a\u0648\u0631 \u0631\u0627 \u0628\u0627 \u0628\u06cc\u0634\u062a\u0631\u06cc\u0646 \u06af\u0634\u062a\u0627\u0648\u0631 \u0648 \u06a9\u0645\u062a\u0631\u06cc\u0646 \u0627\u062a\u0644\u0627\u0641 \u0627\u0646\u0631\u0698\u06cc \u06a9\u0646\u062a\u0631\u0644 \u0645\u06cc\u200c\u06a9\u0646\u062f \u2014 \u0646\u062a\u06cc\u062c\u0647: \u062d\u0631\u06a9\u062a \u0646\u0631\u0645\u200c\u062a\u0631\u060c \u062a\u0648\u0642\u0641 \u062f\u0642\u06cc\u0642\u200c\u062a\u0631\u060c \u0648 \u06a9\u0646\u062a\u0631\u0644 \u0645\u0648\u0642\u0639\u06cc\u062a.<\/p>\n<p>\u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 <strong>SimpleFOC<\/strong> \u0627\u06cc\u0646 \u06a9\u0646\u062a\u0631\u0644 \u067e\u06cc\u0686\u06cc\u062f\u0647 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0633\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647. \u0628\u0627 \u06cc\u06a9 \u062f\u0631\u0627\u06cc\u0648\u0631 DRV8302\/DRV8305 (\u062d\u062f\u0648\u062f \u06f1\u06f5-\u06f3\u06f0 \u062f\u0644\u0627\u0631) \u0648 \u06cc\u06a9 \u0627\u0646\u06a9\u0648\u062f\u0631 \u0645\u063a\u0646\u0627\u0637\u06cc\u0633\u06cc AS5600 (\u06f5 \u062f\u0644\u0627\u0631)\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 FOC \u0631\u0627 \u0631\u0648\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0627\u062c\u0631\u0627 \u06a9\u0631\u062f. UGV \u0628\u0627 FOC \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0633\u0631\u0639\u062a \u062f\u0642\u06cc\u0642 \u0631\u0627 \u062d\u0641\u0638 \u06a9\u0646\u062f \u062d\u062a\u06cc \u062f\u0631 \u0633\u0631\u0628\u0627\u0644\u0627\u06cc\u06cc.<\/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 UGV \u0628\u0627 \u06a9\u0646\u062a\u0631\u0644 \u0633\u0631\u0639\u062a FOC \u2014 \u0645\u0648\u062a\u0648\u0631 BLDC + AS5600 + SimpleFOC.<\/p>\n<ul>\n<li><strong>\u0647\u0632\u06cc\u0646\u0647 \u062f\u0631\u0627\u06cc\u0648\u0631:<\/strong> SimpleFOC Shield \u2248 \u06f2\u06f5 \u062f\u0644\u0627\u0631<\/li>\n<li><strong>\u0627\u0646\u06a9\u0648\u062f\u0631:<\/strong> AS5600 \u2248 \u06f5 \u062f\u0644\u0627\u0631<\/li>\n<li><strong>\u062f\u0642\u062a \u0633\u0631\u0639\u062a:<\/strong> \u00b1\u06f0.\u06f5 RPM<\/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='30' y='65' width='180' height='90' rx='12' fill='#e8f4ff' stroke='#3a60c0' stroke-width='2'\/>\n<text x='120' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Arduino + SimpleFOC<\/text>\n<text x='120' y='117' text-anchor='middle' font-size='11' font-family='Tahoma'>PID Velocity<\/text>\n<text x='120' y='133' text-anchor='middle' font-size='10' font-family='Tahoma'>AS5600 \u2190 \u0641\u06cc\u062f\u0628\u06a9<\/text>\n<line x1='210' y1='110' x2='300' y2='110' stroke='#555' stroke-width='2.5'\/>\n<rect x='300' y='65' width='180' height='90' rx='12' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<text x='390' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>DRV8302 Driver<\/text>\n<text x='390' y='117' text-anchor='middle' font-size='11' font-family='Tahoma'>3-phase PWM<\/text>\n<line x1='480' y1='110' x2='570' y2='110' stroke='#555' stroke-width='2.5'\/>\n<rect x='570' y='65' width='200' height='90' rx='12' fill='#b7e4a0' stroke='#3a7a1e' stroke-width='2'\/>\n<text x='670' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>BLDC Motor<\/text>\n<text x='670' y='117' text-anchor='middle' font-size='11' font-family='Tahoma'>AS5600 \u0627\u0646\u06a9\u0648\u062f\u0631<\/text>\n<text x='670' y='133' text-anchor='middle' font-size='10' font-family='Tahoma'>UGV \u0686\u0631\u062e<\/text>\n<text x='430' y='185' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#888'>FOC \u2014 Arduino \u2192 DRV8302 \u2192 BLDC \u2192 AS5600 \u0641\u06cc\u062f\u0628\u06a9<\/text>\n<\/svg><\/p>\n<h2>\u06a9\u062f SimpleFOC \u2014 Velocity Control<\/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;SimpleFOC.h&gt;\n\n\/\/ \u0645\u0648\u062a\u0648\u0631: 7 \u062c\u0641\u062a \u0642\u0637\u0628 (BLDC \u0645\u0639\u0645\u0648\u0644\u06cc)\nBLDCMotor motor = BLDCMotor(7);\nBLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8);  \/\/ 3PWM + Enable\n\n\/\/ \u0627\u0646\u06a9\u0648\u062f\u0631 \u0645\u063a\u0646\u0627\u0637\u06cc\u0633\u06cc AS5600 \u0631\u0648\u06cc I2C\nMagneticSensorI2C sensor = MagneticSensorI2C(AS5600_I2C);\n\nfloat target_velocity = 10.0;  \/\/ rad\/s\n\nvoid setup() {\n  sensor.init();\n  motor.linkSensor(&sensor);\n\n  driver.voltage_power_supply = 12;  \/\/ \u0648\u0644\u062a\u0627\u0698\n  driver.init();\n  motor.linkDriver(&driver);\n\n  motor.controller = MotionControlType::velocity;\n\n  \/\/ PID \u062a\u0646\u0638\u06cc\u0645 Velocity:\n  motor.PID_velocity.P = 0.2;\n  motor.PID_velocity.I = 20;\n  motor.PID_velocity.D = 0.001;\n\n  motor.voltage_limit = 6;  \/\/ \u062d\u062f\u0627\u06a9\u062b\u0631 \u0648\u0644\u062a\u0627\u0698 \u0627\u0639\u0645\u0627\u0644\u06cc\n\n  motor.init();\n  motor.initFOC();\n}\n\nvoid loop() {\n  motor.loopFOC();\n  motor.move(target_velocity);\n\n  \/\/ \u062f\u0633\u062a\u0648\u0631 \u0627\u0632 Serial:\n  if(Serial.available()) {\n    target_velocity = Serial.parseFloat();\n  }\n}\n<\/code><\/pre>\n<h2>\u0645\u0642\u0627\u06cc\u0633\u0647 FOC \u0628\u0627 L298N<\/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'>\u0645\u0634\u062e\u0635\u0647<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>L298N + \u0645\u0648\u062a\u0648\u0631 DC<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>SimpleFOC + BLDC<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0646\u0631\u0645\u06cc \u062d\u0631\u06a9\u062a<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0645\u062a\u0648\u0633\u0637<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0639\u0627\u0644\u06cc \u2713<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u06a9\u0646\u062a\u0631\u0644 \u062f\u0642\u06cc\u0642 \u0633\u0631\u0639\u062a<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0636\u0639\u06cc\u0641<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0639\u0627\u0644\u06cc (\u00b10.5RPM) \u2713<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0647\u0632\u06cc\u0646\u0647<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06f5 \u062f\u0644\u0627\u0631<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06f3\u06f0 \u062f\u0644\u0627\u0631<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0633\u0627\u062f\u0647<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0645\u062a\u0648\u0633\u0637<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0631\u0627\u0646\u062f\u0645\u0627\u0646<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06f6\u06f0-\u06f7\u06f0%<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06f9\u06f0-\u06f9\u06f5% \u2713<\/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='#e8f4ff' stroke='#3a60c0' 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='#f7c6c6' stroke='#a03030' 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'>SimpleFOC<\/text>\n<text x='117' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>Velocity PID<\/text>\n<text x='322' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>DRV8302<\/text>\n<text x='322' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>3-phase PWM<\/text>\n<text x='527' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>BLDC Motor<\/text>\n<text x='527' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0646\u0631\u0645 \u0648 \u062f\u0642\u06cc\u0642<\/text>\n<text x='737' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>AS5600<\/text>\n<text x='737' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0641\u06cc\u062f\u0628\u06a9 \u0627\u0646\u06a9\u0648\u062f\u0631<\/text>\n<text x='430' y='175' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#666'>SimpleFOC \u2014 \u06a9\u0646\u062a\u0631\u0644 BLDC \u0628\u0627 Loop \u0628\u0633\u062a\u0647\u060c UGV \u0646\u0631\u0645<\/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\/Y3lJgAFVK7E' title='SimpleFOC BLDC Motor Control Arduino Tutorial' 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\/I1KXgBQ4oR0' title='AS5600 Magnetic Encoder FOC Setup' 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\/FOC_%D9%85%D9%88%D8%AA%D9%88%D8%B1_BLDC_%D8%A2%D8%B1%D8%AF%D9%88%DB%8C%D9%86%D9%88' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: FOC \u0645\u0648\u062a\u0648\u0631 BLDC \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/docs.simplefoc.com\/' target='_blank'>SimpleFOC: Official Documentation<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u06a9\u0646\u062a\u0631\u0644 \u0645\u0648\u062a\u0648\u0631 BLDC \u0628\u0627 FOC (Field Oriented Control) \u0648 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 SimpleFOC\u061b \u0646\u0631\u0645\u200c\u062a\u0631\u06cc\u0646 \u062d\u0631\u06a9\u062a \u0645\u0645\u06a9\u0646 \u0628\u0631\u0627\u06cc UGV\u060c \u062a\u0646\u0638\u06cc\u0645 PID Velocity\u060c \u0645\u0642\u0627\u06cc\u0633\u0647 \u0628\u0627 L298N.<\/p>\n","protected":false},"author":1,"featured_media":595,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[16,20],"tags":[80,135,136,385,48,387,50,386],"class_list":["post-596","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ugv","category-projects-2","tag-arduino-2","tag-bldc","tag-foc","tag-simplefoc","tag-ugv","tag-velocity-pid","tag-50","tag-386"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/596","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=596"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/596\/revisions"}],"predecessor-version":[{"id":597,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/596\/revisions\/597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/595"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}