Chapterبەش 2 · Lectureوانە 2.3

The Flight Controller: Sensors, Control Loops and Autopilotsکۆنترۆڵکەری فڕین: هەستەوەرەکان، خولەکانی کۆنترۆڵ و فڕۆکەوانی خۆکار

The flight controller is the drone's brain: a small computer that reads the gyroscope, accelerometer, compass, barometer and other sensors, fuses them into one best guess, and corrects every motor hundreds of times a second with control loops such as PID. Also: flight modes, the open-source autopilots PX4 and ArduPilot, ground stations and pre-arm checks.

مێشکی : کۆمپیوتەرێکی بچووکە کە ، ، ، و تر دەخوێنێتەوە، دەیانکاتە یەک باشترین مەزەندە و بە وەک PID چەند سەد جار لە چرکەیەکدا خێرایی هەموو ڕاست دەکاتەوە. هەروەها: ، ⁦PX4⁩ و ArduPilot کە دوو ، و پشکنینەکانی پێش .

24 min read26 خولەک خوێندنەوە · 21 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain what a flight controller is and what it does many times every second.
  • Name a drone's sensors, say what each one measures and how it can be fooled.
  • Explain sensor fusion and the control loop: measure, compare, correct.
  • Describe what P, I and D do, and recognise a controller tuned too weak, too strong or just right.
  • Choose a suitable flight mode, and explain pre-arm checks and why they must never be switched off.
  • ڕوونی بکەیتەوە چییە و لە هەر چرکەیەکدا چەندین جار چی دەکات.
  • ناو ببەیت و بڵێیت هەریەکەیان چی دەپێوێت و چۆن هەڵدەخەڵەتێت.
  • و ڕوون بکەیتەوە: پێوان، بەراوردکردن، ڕاستکردنەوە.
  • ڕوونی بکەیتەوە P، I و D چی دەکەن و بناسیتەوە کە زۆر لاواز، زۆر بەهێز یان گونجاو ڕێکخراوە.
  • هەڵبژێریت و پشکنینەکانی پێش ڕوون بکەیتەوە و بڵێیت بۆچی نابێت هەرگیز بکوژێنرێنەوە.

The drone's brainمێشکی درۆن

Inside every drone sits a small computer board: the flight controller. People call it the drone's "brain", because it processes inputs and controls the flight. The inputs are the readings of its sensors and the pilot's commands. What it controls is how the drone is tilted, how high it is, where it is and, in the end, how fast each motor spins.

لە ناو هەموو بۆردێکی کۆمپیوتەریی بچووک هەیە: . پێی دەڵێن «مێشک»ـی ، چونکە چارەسەر دەکات و فڕینەکە کۆنترۆڵ دەکات. خوێندنەوەی و فڕۆکەوانن. ئەوەی کۆنترۆڵی دەکات ئەمەیە: چەند لار بووەتەوە، چەند بەرزە، لە کوێیە و لە کۆتاییدا هەر بە چ خێراییەک دەسووڕێت.

The heart of the board is a microcontroller — a whole small computer on one chip (Microcontrollers) — that runs autopilot software, also called the flight stack, on a small real-time operating system (RTOS). PX4 and ArduPilot are the two best-known open-source autopilots. The autopilot repeats one job hundreds of times a second: read the sensors, work out the drone's state and send a new speed to every ESC (Signals from the flight controller).

دڵی بۆردەکە — کۆمپیوتەرێکی بچووکی تەواو لەسەر یەک (مایکرۆکۆنترۆڵەرەکان) — کە (flight stack) لەسەر بچووک کار پێ دەکات (RTOS). ⁦PX4⁩ و ArduPilot ناسراوترین دوو . یەک کار چەند سەد جار لە چرکەیەکدا دووپاتە دەکاتەوە: دەخوێنێتەوە، دۆخی دەدۆزێتەوە و خێراییەکی نوێ بۆ هەر دەنێرێت (سیگناڵەکان لە کۆنترۆڵکەری فڕینەوە).

A flight controller board seen from above. In the middle is a large chip, the microcontroller, which runs the autopilot. Above it are two small chips: the IMU (gyroscope and accelerometer) and the barometer (air pressure, used for height). On the left three inputs arrive: the GNSS and compass module on a mast, the radio receiver with the pilot's sticks, and the telemetry radio linked to the ground station. On the right, motor outputs 1 to 4 send speed signals to the ESCs, which drive the motors. Power comes from the battery at the bottom.بۆردی کۆنترۆڵکەری فڕین لە سەرەوە. لە ناوەڕاستدا چیپێک گەورە هەیە، مایکرۆکۆنترۆڵەر، کە فڕۆکەوانی خۆکار تێیدا کار دەکات. لە سەرەوەیدا دوو چیپی بچووک هەن: یەکەی پێوانی بارنەگۆڕین (جایرۆسکۆپ و ئەکسێلەرۆمیتەر) و بارۆمەتر (پەستانی هەوا بۆ بەرزایی). لە چەپەوە سێ نێوخستە دێن: GNSS و ماگنێتۆمیتەر لەسەر ستوونێک، وەرگری ڕادیۆ بۆ دەسکەکانی فڕۆکەوان و ڕادیۆی تەلەمەتری کە بە وێستگەی کۆنترۆڵی زەمینییەوە بەستراوە. لە ڕاستەوە دەرخستەکانی 1 تا 4 سیگناڵی خێرایی بۆ کۆنترۆڵکەرەکانی خێرایی دەنێرن کە ماتۆڕەکان دەسووڕێنن. کارەبا لە خوارەوە لە پاترییەوە دێت.
A flight controller: inputs on the left, motor outputs on the right.: لە چەپ، لە ڕاست.CêIT

The drone's brainمێشکی درۆن

Real boards: spare sensors and protectionبۆردی ڕاستەقینە: هەستەوەری یەدەگ و پاراستن

A real flight controller is small. The Pixhawk 6X, a board built to the open Pixhawk standard for PX4, has a 480 MHz processor, 2 MB of flash memory and 1 MB of RAM, and its core module weighs 23 g. It also shows redundancy: three IMUs and two barometers on separate wires and power, so one failed sensor does not bring the drone down. Besides spare sensors, the firmware guards the processor itself with a watchdog that restarts it if its main loop hangs: see Lab: The Watchdog Timer.

ڕاستەقینە بچووکە. ⁦Pixhawk 6X⁩، بۆردێک کە بەپێی Pixhawk بۆ ⁦PX4⁩ دروست کراوە، پرۆسێسەرێکی ⁦480 MHz⁩، ⁦2 MB⁩ و ⁦1 MB RAM⁩ـی هەیە و مۆدیولە سەرەکییەکەی ⁦23⁩ گرامە. نیشان دەدات: سێ و دوو لەسەر وایەر و کارەبای جیا، بۆ ئەوەی تێکچوونی یەک نەخات. جگە لە یەدەگ، خودی بە دەپارێزێت کە ئەگەر گیر بخوات دەستی پێ دەکاتەوە: بڕوانە تاقیگە: تایمەری پاسەوان.

The sensors also need protection. Motor vibration shakes them, so the IMUs sit on a small shock-absorbing mount, and tiny heating resistors keep them at a steady temperature, because MEMS sensors change their readings slightly when they warm up or cool down. Camera drones from big makers hide all this inside their shell, but the job is the same.

پاراستنیشیان پێویستە. لەرینەوەی دەیانهەژێنێت، بۆیە لەسەر پایەیەکی بچووکی دژەلەرین دادەنرێت و بە گەرم ڕادەگیرێت تا پلەی گەرمیی جێگیر بمێنێت، چونکە MEMS کاتێک گەرم یان سارد دەبنەوە خوێندنەوەکانیان کەمێک دەگۆڕێت. کامێرادار کە کۆمپانیا گەورەکان دروستیان دەکەن هەموو ئەمانە لە ناو لەشیاندا دەشارنەوە، بەڵام کارەکە هەمان کارە.

Sense, decide, act — hundreds of times a secondهەستکردن، بڕیاردان، کارکردن — چەند سەد جار لە چرکەیەکدا

A flight controller works like every robot: it senses, decides and acts, in a loop that never stops (Robots: sense, decide, act). In the language of artificial intelligence, a drone is an agent: its sensors are the gyroscope, the compass, GNSS and the rest, and its actuators are the motors, which the ESCs drive (Sensors, Actuators).

وەک هەموو کار دەکات: هەست دەکات، بڕیار دەدات و کار دەکات، لە خولێکدا کە هەرگیز ناوەستێت (ڕۆبۆتەکان: هەستکردن، بڕیاردان، کارکردن). بە زمانی ، : بریتین لە ، ، GNSS و ئەوانی تر و بریتین لە ، کە دەیانسووڕێنن (هەستەوەرەکان، جووڵێنەرەکان).

Each time round, the sensors measure; the autopilot works out where the drone is and how it is tilted, compares that with where it should be, and decides on a correction; the ESCs change the motor speeds. The drone moves, the sensors see the change and the loop starts again. The pilot's sticks — or a planned mission — only set the target.

لە هەر جارێکدا دەپێون؛ دەدۆزێتەوە لە کوێیە و چەند لار بووەتەوە، ئەوە لەگەڵ ئەو شوێنەی کە دەبێت تێیدا بێت بەراورد دەکات و بڕیاری ڕاستکردنەوەیەک دەدات؛ خێراتر یان هێواشتر دەکەن. دەجووڵێت، گۆڕانەکە دەبینن و دیسان دەست پێ دەکاتەوە. فڕۆکەوان — یان ئەرکێکی پلاندانراو — تەنیا ئامانجەکە دیاری دەکەن.

A loop of three boxes around a drone. SENSE: IMU, compass, barometer, GNSS, rangefinder. An arrow leads to DECIDE: the autopilot asks where am I and what should I do. An arrow leads to ACT: the ESCs change the speed of each motor. A dashed arrow goes back to SENSE: the drone moves and the sensors see the change. The pilot's sticks or the mission feed into DECIDE. At the bottom: again and again, hundreds of times every second.خولێک لە سێ چوارچێوە بە دەوری درۆنێک. هەستکردن: یەکەی پێوانی بارنەگۆڕین، ماگنێتۆمیتەر، بارۆمەتر، GNSS، هەستەوەری دووری. تیرێک دەچێت بۆ بڕیاردان: فڕۆکەوانی خۆکار دەپرسێت لە کوێم و چی بکەم. تیرێک دەچێت بۆ کارکردن: کۆنترۆڵکەرەکانی خێرایی خێرایی هەر ماتۆڕێک دەگۆڕن. تیرێکی پچڕپچڕ دەگەڕێتەوە بۆ هەستکردن: درۆنەکە دەجووڵێت و هەستەوەرەکان گۆڕانەکە دەبینن. فەرمانی فڕۆکەوان یان ئەرکەکە دەچێتە ناو بڕیاردانەوە. لە خوارەوە: دووپاتە و دووپاتە، چەند سەد جار لە هەر چرکەیەکدا.
Sense → decide → act: the loop behind every flight.هەستکردن ← بڕیاردان ← کارکردن: ئەو خولەی لە پشت هەموو فڕینێکەوەیە.CêIT

The drone's sensesهەستەکانی درۆن

A drone must always know three things: how it is tilted, how high it is and where it is. No single sensor can tell all of that, so it carries several. PX4 needs at least four: a gyroscope, an accelerometer, a magnetometer (compass) and a barometer. It adds GNSS for its automatic modes, highly recommends a rangefinder and can use optical flow.

هەمیشە دەبێت سێ شت بزانێت: چەند لار بووەتەوە، چەند بەرزە و لە کوێیە. هیچ بە تەنیا ناتوانێت هەموو ئەمانە بڵێت، بۆیە چەند دانەیەک هەڵدەگرێت. ⁦PX4⁩ لانیکەم چواری پێویستە: ، ، (وەک قیبلەنما) و . بۆ دۆخە خۆکارەکانی GNSSـی پێویستە، بە توندی پێشنیاری دەکات و دەتوانێت بەکار بهێنێت.

SensorMeasuresچی دەپێوێتThe drone uses it for بۆ چی بەکاری دەهێنێت
Gyroscope (in the IMU) (لە ناو )how fast it turnsبە چ خێراییەک دەسووڕێتەوەstaying level, in the fastest loopڕێک مانەوە، لە خێراترین خولدا
Accelerometer (in the IMU) (لە ناو )speeding up and the pull of gravityخێرابوون و ڕاکێشانی knowing which way is downزانینی ئەوەی خوارەوە کامەیە
Magnetometerthe Earth's magnetic fieldبواری موگناتیسیی زەویwhich way the nose pointsلووتی ڕووی لە کام لایە
Barometerair pressureheight
GNSS receiverوەرگری GNSSsatellite signals مانگی دەستکردposition and speed (next lesson)شوێن و خێرایی (وانەی داهاتوو)
Rangefinder, optical flow، distance to the ground; how the ground slides pastدووری تا زەوی؛ زەوی چۆن بەردەمی دەخلیسکێتlanding; holding still without GNSSنیشتنەوە؛ ڕاوەستان بەبێ GNSS
Obstacle sensors, cameras بەربەست، کامێراwhat is around the droneچی لە دەوری avoiding crashes; pictures (payloads)خۆپاراستن لە بەرکەوتن؛ وێنە (باری درۆن)
A multirotor seen from the side with labels. On a mast above the body: the GNSS receiver and compass, away from motors and cables. Inside the flight controller in the body: the IMU and the barometer. Under the body, looking down: a rangefinder and an optical-flow camera, with a dashed beam to the ground. On the nose: obstacle sensors looking around, with a dashed field of view. Under the front: a camera on a gimbal.فرەپەروانەیەک لە تەنیشتەوە بە ناونیشانەوە. لەسەر ستوونێک لە سەرووی لەشەکەوە: وەرگری GNSS و ماگنێتۆمیتەر، دوور لە ماتۆڕەکان و کێبڵەکان. لە ناو کۆنترۆڵکەری فڕیندا لە ناو لەشەکەدا: یەکەی پێوانی بارنەگۆڕین و بارۆمەتر. لە ژێر لەشەکە، ڕوو لە خوارەوە: هەستەوەری دووری و کامێرای تەوژمی وێنە، بە تیشکێکی پچڕپچڕ بۆ زەوی. لەسەر لووت: هەستەوەرەکانی بەربەست کە ڕوو لە دەوروبەرن، بە مەودای بینینی پچڕپچڕ. لە ژێر پێشەوە: کامێرایەک لەسەر گیمباڵ.
Where each sensor sits: the compass far from the motors, the IMU at the centre.هەر لە کوێیە: دوور لە ، لە ناوەڕاست.CêIT

The IMU: gyroscope and accelerometerیەکەی پێوانی بارنەگۆڕین: جایرۆسکۆپ و ئەکسێلەرۆمیتەر

The gyroscope and the accelerometer sit together in one tiny chip, the IMU (inertial measurement unit). They are MEMS sensors — microscopic moving structures made in silicon — the same kind of chip that turns your phone's screen (The sensors in your phone); IoT labs use one on a small board (the MPU-6050). Each measures three numbers, one for each direction (Three axes), hundreds or thousands of times a second.

و پێکەوە لە یەک زۆر بچووکدان: (inertial measurement unit). ئەمانە جۆری MEMSـن — پێکهاتەی جووڵاوی زۆر ورد کە لە سیلیکۆن دروست کراون — هەمان جۆری ئەو کە شاشەی مۆبایلەکەت دەسووڕێنێت (هەستەوەرەکانی ناو مۆبایلەکەت)؛ تاقیگەکانی IoT یەکێکی لەسەر بۆردێکی بچووک بەکار دەهێنن (⁦MPU-6050⁩). هەریەکەیان سێ ژمارە دەپێوێت، یەکێک بۆ هەر ئاراستەیەک (سێ تەوەرەکە)، سەدان یان هەزاران جار لە چرکەیەکدا.

The gyroscope measures how fast the drone turns, in degrees per second. Adding up these turns gives the tilt angle, but tiny errors add up too: a gyroscope that reads just 0.1 °/s too much is 6° wrong after one minute. This slow creep is called drift. The accelerometer feels gravity, so when the drone is still it knows which way is down — but every bump, turn and motor vibration shakes its reading. The gyroscope is smooth but drifts; the accelerometer does not drift but is noisy. Before take-off the flight controller measures the gyroscope's small constant error while the drone stands still and subtracts it — a one-point calibration, as in Drift and calibration — but a little error always remains.

دەپێوێت بە چ خێراییەک دەسووڕێتەوە، بە پلە لە چرکەیەکدا. کۆکردنەوەی ئەم سووڕانەوانە لاربوونەوە دەدات، بەڵام هەڵە وردەکانیش کۆ دەبنەوە: کە تەنیا ⁦0.1⁩ پلە لە چرکەیەکدا زیاتر بخوێنێتەوە، دوای یەک خولەک 6 پلە هەڵەیە. بەم خزینە هێواشە دەوترێت لادان (drift). هەست بە دەکات، بۆیە کاتێک وەستاوە دەزانێت خوارەوە کامەیە — بەڵام هەموو تەکان، سووڕانەوە و لەرینەوەیەکی خوێندنەوەکەی دەهەژێنێت. ڕێکە بەڵام لادەدات؛ لانادات بەڵام زۆرە. پێش هەستان، هەڵە جێگیرە بچووکەکەی دەپێوێت کاتێک وەستاوە و لە خوێندنەوەکان کەمی دەکاتەوە — بە یەک خاڵ، وەک لە لادانی هەستەوەر و ڕێکخستنی پێواندا — بەڵام هەمیشە هەڵەیەکی کەم دەمێنێتەوە.

Left: a small dark chip with three green arrows pointing forward, sideways, and up and down, and an orange curved arrow around each one. Right, two cards. Accelerometer, 3 numbers: speeding up or slowing down in the three directions, and gravity, so it knows which way is down. Gyroscope, 3 numbers: how fast it turns around each of the three directions, in degrees per second.چەپ: چیپێکی تاریکی بچووک بە سێ تیری سەوز بۆ پێشەوە، بۆ لاکان و بۆ سەرەوە و خوارەوە، هەروەها تیرێکی چەماوەی پرتەقاڵی بە دەوری هەریەکەیاندا. ڕاست، دوو کارت. ئەکسێلەرۆمیتەر، 3 ژمارە: خێرابوون یان هێواشبوونەوە لە هەر سێ ئاراستەکەدا، هەروەها کێشکردن، بۆیە دەزانێت خوارەوە کامەیە. جایرۆسکۆپ، 3 ژمارە: بە چ خێراییەک بە دەوری هەر سێ ئاراستەکەدا دەسووڕێتەوە، بە پلە لە چرکەیەکدا.
Six numbers from one chip: three accelerations and three turning rates.شەش ژمارە لە یەک : سێ و سێ خێرایی سووڕانەوە.CêIT

Compass and barometerماگنێتۆمیتەر و بارۆمەتر

The magnetometer is an electronic compass: it measures the Earth's magnetic field, so the drone knows which way its nose points, even while it hovers. The Earth's field is weak, so motors, power cables, steel roofs, concrete full of steel bars and even a phone in your pocket can bend it. That is why the compass usually sits in the GNSS module on a mast, away from the power wires. For the same reason you calibrate it in an open space, away from cars and metal.

قیبلەنمایەکی ئەلیکترۆنییە: بواری موگناتیسیی زەوی دەپێوێت، بۆیە دەزانێت لووتی ڕووی لە کام لایە، تەنانەت کاتێک لە هەوادا ڕاوەستاوە. بواری زەوی لاوازە، بۆیە ، کێبڵی کارەبا، سەربانی ئاسن، کۆنکریتی پڕ لە شیشی ئاسن و تەنانەت مۆبایلێک لە گیرفانتدا دەتوانن لای بدەن. لەبەر ئەوە زۆرجار لە ناو یەکەی GNSS لەسەر ستوونێکە، دوور لە وایەرەکانی کارەبا. هەر لەبەر ئەمەش لە شوێنێکی کراوە، دوور لە ئۆتۆمبێل و ئاسن، ڕێکی دەخەیت (calibrate).

The barometer measures air pressure. Near the ground the pressure falls about 1 hPa for every 8–9 m you climb, so the autopilot turns pressure into altitude. But the weather changes the pressure too: a change of 1 hPa, which can happen within a few hours, looks like 8–9 m of climbing. Wind and the propellers' own downwash also disturb it, so builders shield it with a little open-cell foam.

دەپێوێت. نزیک زەوی، بۆ هەر 8 تا 9 مەتر بەرزبوونەوە پەستان نزیکەی ⁦1 hPa⁩ کەم دەبێتەوە، بۆیە پەستان دەکاتە . بەڵام کەشوهەواش پەستان دەگۆڕێت: گۆڕانی ⁦1 hPa⁩، کە دەکرێت لە ماوەی چەند کاتژمێرێکدا ڕووبدات، وەک 8 تا 9 مەتر بەرزبوونەوە دەردەکەوێت. با و هەوای خۆیشی تێکی دەدەن، بۆیە دروستکەران پارچەیەکی بچووکی ئیسفەنجی کونکون بەسەریدا دادەنێن.

Two panels. Left, the magnetometer: a compass whose purple needle points to magnetic north, while an orange dashed needle shows it bent the wrong way by a power cable next to it; motors, cables, steel and phones bend it. Right, the barometer: a height scale from 0 to 200 m with air pressure from 966 down to 943 hPa, a drone higher up where there is less air above it, and a cloud: a weather change of 1 hPa looks like 8 to 9 m of height.دوو بەش. چەپ، ماگنێتۆمیتەر: قیبلەنمایەک کە دەرزییە مۆرەکەی ئاراستەی باکووری موگناتیسی نیشان دەدات، لە کاتێکدا دەرزییەکی پرتەقاڵیی پچڕپچڕ پیشانی دەدات کە کێبڵێکی کارەبای نزیک بە ئاراستەی هەڵەدا لای داوە؛ ماتۆڕەکان، کێبڵ، ئاسن و مۆبایل لای دەدەن. ڕاست، بارۆمەتر: پێوەرێکی بەرزی لە 0 تا 200 مەتر بە پەستانی هەوا لە 966 تا 943 hPa، درۆنێک لە بەرزیدا کە هەوای کەمتری لە سەرەوەیە و هەورێک: گۆڕانی 1 hPa لە کەشوهەوادا وەک 8 تا 9 مەتر بەرزایی دەردەکەوێت.
Two useful sensors that are easy to fool: metal bends the compass; weather moves the barometer.دوو بەسوود کە بە ئاسانی هەڵدەخەڵەتێن: ئاسن لا دەدات؛ کەشوهەوا دەگۆڕێت.CêIT

Compass and barometerماگنێتۆمیتەر و بارۆمەتر

Looking down: rangefinder and optical flowسەیرکردنی خوارەوە: هەستەوەری دووری و تەوژمی وێنە

Close to the ground, a few metres of barometer error matter a lot. A downward rangefinder measures the distance to the ground directly; it can be a lidar, an infrared sensor, an ultrasonic sensor or a small radar. Autopilots use it for the last metres of landing, for following the shape of the ground and for precision landing; above its maximum range they switch back to the barometer.

لە نزیک زەوی، چەند مەترێک هەڵەی زۆر گرنگە. ڕوو لە خوارەوە ڕاستەوخۆ دووری تا زەوی دەپێوێت؛ دەکرێت ، ، یان بچووک بێت. بۆ دوا مەترەکانی نیشتنەوە، بۆ فڕین بەدوای شێوەی زەویدا و بۆ نیشتنەوەی ورد بەکاری دەهێنێت؛ لە سەرووی زۆرترین مەودای خۆیەوە دەگەڕێتەوە سەر .

An optical flow camera looks straight down and watches how the picture of the ground slides past. If the ground slides backwards, the drone is moving forwards. Together with a rangefinder, which gives the scale, it can hold a drone still indoors or under a bridge, where GNSS does not work.

کامێرای ڕاست سەیری خوارەوە دەکات و دەبینێت وێنەی زەوی چۆن بەردەمی دەخلیسکێت. ئەگەر زەوی بەرەو دواوە بخلیسکێت، بەرەو پێشەوە دەجووڵێت. لەگەڵ ، کە پێوانەکە دەدات، دەتوانێت لە ناو باڵەخانە یان لە ژێر پردێکدا ڕابگرێت، لەو شوێنانەی GNSS کار ناکات.

A drone hovers above textured ground. A blue dashed rangefinder beam goes straight down, with a double arrow showing 2.4 m. A green cone shows the optical-flow camera's view of the ground; under it, an arrow shows the ground pattern sliding backwards, while an arrow above shows the drone drifting forwards. Text: together they can hold a drone still indoors, where GNSS does not work.درۆنێک لە سەرووی زەوییەکی نەخشداردا ڕاوەستاوە. تیشکێکی شینی پچڕپچڕی هەستەوەری دووری ڕاست بەرەو خوارەوە دەچێت، بە تیرێکی دوولایەنە کە 2.4 مەتر نیشان دەدات. قووچەکێکی سەوز مەودای بینینی کامێرای تەوژمی وێنە نیشان دەدات؛ لە ژێریدا تیرێک نیشان دەدات نەخشی زەوی بەرەو دواوە دەخلیسکێت، لە کاتێکدا تیرێک لە سەرەوە پیشانی دەدات درۆنەکە بەرەو پێشەوە دەخلیسکێت. نووسین: پێکەوە دەتوانن درۆن لە ژووردا ڕابگرن، کە GNSS کار ناکات.
A rangefinder gives the exact height; optical flow sees the drone sliding. ورد دەدات؛ دەبینێت دەخلیسکێت.CêIT

Obstacle sensorsهەستەوەرەکانی بەربەست

To avoid hitting walls, trees and wires, many drones carry obstacle-avoidance sensors that look forwards, sideways, up or all around. Each kind sees the world differently:

بۆ ئەوەی بەر دیوار، دار و وایەر نەکەون، زۆرێک لە هەڵدەگرن کە ڕوو لە پێشەوە، لاکان، سەرەوە یان هەموو لایەک دەڕوانن. هەر جۆرێکیان بە شێوەیەکی جیاواز جیهان دەبینێت:

SensorHow it worksچۆن کار دەکاتGood atلە چیدا باشەWeak atلە چیدا لاوازە
Ultrasonictimes the echo of a sound pulseکاتی دەنگدانەوەی تڕپەیەکی دەنگ دەپێوێتcheap; very close objectsهەرزان؛ شتی زۆر نزیکonly a few metres; soft surfaces, windتەنیا چەند مەترێک؛ ڕووی نەرم، با
Time-of-flight beamتیشکی کاتی فڕین ⁦(ToF)⁩times a pulse of infrared or laser lightکاتی تڕپەیەکی ڕووناکیی یان دەپێوێتsmall and fastبچووک و خێراone narrow beam; strong sunlightیەک تیشکی تەسک؛ خۆری بەهێز
Stereo camerasدوو کامێرای هاوجووتtwo cameras judge depth like two eyesدوو کامێرا وەک دوو چاو قووڵایی مەزەندە دەکەنwide view, colourبینینی فراوان، ڕەنگdarkness, plain walls, glareتاریکی، دیواری بێنەخش، تیشکدانەوە
Lidarsweeps a laser, thousands of points دەگێڕێت، هەزاران خاڵexact distances all aroundدووریی ورد بە هەموو لایەکداweight, price, glass, rainکێش، نرخ، شووشە، باران
Radarradio waves and their echoes و دەنگدانەوەیانdust, fog, smoke, darknessتۆز، تەم، دووکەڵ، تاریکیless detailوردەکاریی کەمتر

Sensing is only the first step. Turning these readings into a safe new path is part of autonomy, taught in Obstacle avoidance.

هەستکردن تەنیا یەکەم هەنگاوە. گۆڕینی ئەم خوێندنەوانە بۆ ڕێگایەکی نوێی سەلامەت بەشێکە لە ، کە لە خۆلادان لە بەربەست دەیخوێنیت.

A quadcopter seen from above, front up, with the coverage of five kinds of sensor. A long narrow orange cone forward: radar. A wide blue cone forward: stereo cameras. A dashed purple circle all around: 360-degree lidar. Short wide green cones to the left and right: ultrasonic sensors. A single thick green line backwards: a time-of-flight beam. A legend explains each one.چوارپەروانەیەک لە سەرەوە، پێشەوەی بەرەو سەرەوەیە، لەگەڵ مەودای پێنج جۆر هەستەوەر. قووچەکێکی پرتەقاڵیی درێژ و تەسک بەرەو پێشەوە: ڕادار. قووچەکێکی شینی پان بەرەو پێشەوە: دوو کامێرای هاوجووت. بازنەیەکی مۆری پچڕپچڕ بە هەموو لایەکدا: لایدار. قووچەکی سەوزی کورت و پان بۆ چەپ و ڕاست: هەستەوەرەکانی سەروودەنگی. یەک هێڵی سەوزی ئەستوور بەرەو دواوە: تیشکی کاتی فڕین. ڕێبەرێک هەریەکەیان ڕوون دەکاتەوە.
Each obstacle sensor covers a different area: drones often combine several.هەر بەربەست ناوچەیەکی جیاواز دەگرێتەوە: زۆرجار چەندانێکیان پێکەوە بەکار دەهێنن.CêIT

Sensor fusion: one best guessیەکخستنی هەستەوەرەکان: یەک باشترین مەزەندە

Every sensor has a weakness: the gyroscope drifts, the accelerometer is noisy, the compass can be fooled, the barometer follows the weather, and GNSS is slow and sometimes jumps. Sensor fusion mixes them all into one best guess of the drone's tilt, heading, speed and position. The same idea is explained in How AI sees: sensor fusion; a flight controller does it all the time.

هەموو لاوازییەکی هەیە: لادەدات، زۆرە، هەڵدەخەڵەتێت، بەدوای کەشوهەوادا دەڕوات و GNSS هێواشە و هەندێک جار بازدەدات. هەموویان تێکەڵ دەکات و یەک باشترین مەزەندە دەدات بۆ لاربوونەوە، ئاراستە، خێرایی و شوێنی . هەمان بیرۆکە لە ژیریی دەستکرد چۆن دەبینێت: یەکخستنی هەستەوەرەکان ڕوون کراوەتەوە؛ هەمیشە ئەمە دەکات.

A chart of the tilt angle over 60 seconds. The real tilt (dashed) is level except for a short tilt of about 6 degrees near 28 seconds. The gyroscope-only line (orange) is smooth but climbs steadily away, reaching about 9 degrees by the end. The accelerometer-only line (blue) stays around the real value but jumps up and down all the time. The sensor-fusion line (green) follows the real tilt closely.هێڵکارییەکی گۆشەی لاربوونەوە لە ماوەی 60 چرکەدا. لاربوونەوەی ڕاستەقینە (پچڕپچڕ) ڕێکە جگە لە لاربوونەوەیەکی کورتی نزیکەی 6 پلە نزیکەی چرکەی 28. هێڵی تەنیا جایرۆسکۆپ (پرتەقاڵی) ڕێکە بەڵام بە بەردەوامی بەرز دەبێتەوە و لە کۆتاییدا دەگاتە نزیکەی 9 پلە. هێڵی تەنیا ئەکسێلەرۆمیتەر (شین) لە دەوری بەها ڕاستەقینەکەدا دەمێنێتەوە بەڵام هەمیشە بەرز و نزم دەبێتەوە. هێڵی یەکخستنی هەستەوەرەکان (سەوز) لە نزیکەوە دوای لاربوونەوە ڕاستەقینەکە دەکەوێت.
The gyroscope drifts, the accelerometer is noisy, fusion follows the truth. لادەدات، زۆرە، دوای ڕاستییەکە دەکەوێت.CêIT

Sensor fusion: one best guessیەکخستنی هەستەوەرەکان: یەک باشترین مەزەندە

How the estimator predicts and correctsمەزەندەکەر چۆن پێشبینی دەکات و ڕاستی دەکاتەوە

PX4 and ArduPilot fuse their sensors with an EKF (Extended Kalman Filter), an algorithm for making estimates. It predicts with the IMU — from the last state and the measured turns and accelerations, where should the drone be now? — and then corrects the prediction with GNSS, the compass, the barometer and the rangefinder. A measurement that disagrees too much with the prediction is rejected, so one bad sensor cannot drag the answer far away.

⁦PX4⁩ و ArduPilot خۆیان بە EKF (Extended Kalman Filter) یەک دەخەن، کە بۆ مەزەندەکردن. بە پێشبینی دەکات — لە دۆخی پێشوو و ئەو سووڕانەوە و پێوراون، ئێستا دەبێت لە کوێ بێت؟ — پاشان پێشبینییەکە بە GNSS، ، و ڕاست دەکاتەوە. پێوانێک کە زۆر لەگەڵ پێشبینییەکە جیاواز بێت ڕەت دەکرێتەوە، بۆیە یەک خراپ ناتوانێت وەڵامەکە زۆر دوور بخات.

Walking home in the darkگەڕانەوە بۆ ماڵەوە لە تاریکیدا

Imagine walking home through the old bazaar after the power goes off. You count your steps and feel every turn (the IMU). Now and then you glance at the compass on your phone (the magnetometer). When you pass the clock tower, you know exactly where you are (a GNSS fix). Steps alone slowly lead you astray; the landmark alone comes too rarely. Together they keep you on track.

وای دابنێ دوای بڕانی کارەبا بە ناو بازاڕی کۆندا بەرەو ماڵ دەڕۆیت. هەنگاوەکانت دەژمێریت و هەست بە هەموو سووڕانەوەیەک دەکەیت (). جار جار سەیری قیبلەنمای مۆبایلەکەت دەکەیت (). کاتێک بە لای بورجی کاتژمێرەکەدا تێدەپەڕیت، بە وردی دەزانیت لە کوێیت (شوێنی GNSS). هەنگاو بە تەنیا وردە وردە ڕێگات لێ تێک دەدات؛ نیشانەکەش بە تەنیا زۆر بە کەمی دێت. پێکەوە لەسەر ڕێگا ڕاتدەگرن.

Where the analogy stops workingسنووری ئەم نموونەیە

A real EKF does this with numbers hundreds of times a second, and it also estimates how much to trust each sensor at every moment.

EKFـی ڕاستەقینە ئەمە بە ژمارە چەند سەد جار لە چرکەیەکدا دەکات، هەروەها لە هەر ساتێکدا مەزەندە دەکات چەند متمانە بە هەر بکات.

The control loopخولی کۆنترۆڵ

Knowing the state is half the job; the other half is fixing it. The flight controller compares what it measures with what it wants — the set point, for example "level, 0° tilt" — and corrects the difference. Then it measures again. This control loop (or feedback loop) never stops: in ArduPilot's Copter the main loop runs 400 times a second, so a correction goes out every 2.5 milliseconds. Embedded systems everywhere use the same idea (Closed-loop control).

زانینی دۆخەکە نیوەی کارەکەیە؛ نیوەکەی تر چاککردنەوەیەتی. ئەوەی دەیپێوێت لەگەڵ ئەوەی دەیەوێت بەراورد دەکات — ، بۆ نموونە «ڕێک، 0 پلە لاربوونەوە» — و جیاوازییەکە ڕاست دەکاتەوە. پاشان دیسان دەپێوێت. ئەم هەرگیز ناوەستێت: لە Copterـی ArduPilotـدا خولە سەرەکییەکە ⁦400⁩ جار لە چرکەیەکدا کار دەکات، واتە هەر ⁦2.5⁩ میلیچرکە جارێک ڕاستکردنەوەیەک دەنێردرێت. لە هەموو شوێنێک هەمان بیرۆکە بەکار دەهێنن (خولی کۆنترۆڵ لە سیستەمە چەسپێنراوەکاندا).

ArduCopter 4.7 and later can even run the innermost loop in its own fast thread, close to the rate at which the gyroscopes deliver data — up to 4,000 times a second on suitable boards. That is why a gust that tilts a drone is usually corrected before you can see it.

⁦ArduCopter 4.7⁩ و وەشانەکانی دواتر دەتوانن ناوەکیترین خول لە ڕێڕەوێکی خێرای تایبەتدا کار پێ بکەن، نزیک لەو خێراییەی کە دەدەن — لەسەر هەندێک بۆرد تا ⁦4000⁩ جار لە چرکەیەکدا. لەبەر ئەوە بایەک کە لار دەکاتەوە زۆرجار پێش ئەوەی بیبینیت ڕاست دەکرێتەوە.

An animation in six steps. 1: A drone hovers level; target 0 degrees, measured 0 degrees. 2: A gust from the left lifts one side and the drone tilts 15 degrees. 3: SENSE is highlighted: the gyroscope feels the turn and the estimate says 15 degrees. 4: COMPARE is highlighted: 15 degrees away from the target. 5: CORRECT is highlighted: the right motors speed up (a long thick green arrow) and the left motors slow down (a short arrow); the tilt shrinks to 7 degrees. 6: The drone is level again, and the whole loop is highlighted: it runs about 400 times a second.
An animation in six steps. 1: A drone hovers level; target 0 degrees, measured 0 degrees. 2: A gust from the left lifts one side and the drone tilts 15 degrees. 3: SENSE is highlighted: the gyroscope feels the turn and the estimate says 15 degrees. 4: COMPARE is highlighted: 15 degrees away from the target. 5: CORRECT is highlighted: the right motors speed up (a long thick green arrow) and the left motors slow down (a short arrow); the tilt shrinks to 7 degrees. 6: The drone is level again, and the whole loop is highlighted: it runs about 400 times a second.
A gust, then sense → compare → correct, until the drone is level again.بایەک، پاشان هەستکردن ← بەراوردکردن ← ڕاستکردنەوە، تا دیسان ڕێک دەبێتەوە.CêIT

PID in plain wordsPID بە زمانێکی سادە

Carrying a tray of teaهەڵگرتنی سینییەکی چا

Picture a waiter in a tea house carrying a full tray of glasses through a crowd. P: the more the tray tips, the harder he pushes it back. I: if the tray keeps leaning a little towards the heavy teapot, he slowly learns to hold that side higher. D: if the tray starts tipping fast, he reacts early, before the tea spills, and does not over-correct.

چایچییەکی چایخانە بهێنە پێش چاوت کە سینییەکی پڕ لە پەرداخی چا بە ناو قەرەباڵغیدا دەبات. P: تا سینییەکە زیاتر لار ببێتەوە، بەهێزتر ڕاستی دەکاتەوە. I: ئەگەر سینییەکە بەردەوام کەمێک بەرەو لای قۆرییە قورسەکە لار بێتەوە، وردە وردە فێر دەبێت ئەو لایە بەرزتر ڕابگرێت. D: ئەگەر سینییەکە بە خێرایی دەست بە لاربوونەوە بکات، پێش ئەوەی چاکە بڕژێت زوو کاردانەوەی دەبێت و زیادەڕەویش لە ڕاستکردنەوەدا ناکات.

Where the analogy stops workingسنووری ئەم نموونەیە

The flight controller does this with numbers, hundreds of times a second, for roll, pitch and yaw separately; the waiter uses his feeling.

ئەمە بە ژمارە دەکات، چەند سەد جار لە چرکەیەکدا و بۆ ، و بە جیا؛ چایچییەکە بە هەستی خۆی دەیکات.

A PID controller works the same way. The error is the difference between the set point and the measurement. P (proportional) reacts to how big the error is now. I (integral) adds the error up over time, to remove a small error that never goes away, such as a camera mounted off-centre. D (derivative) looks at how fast the error is changing and brakes early, so the drone does not swing past level.

بە هەمان شێوە کار دەکات. جیاوازی (error) ئەوەیە کە پێوانەکە چەند لە دوورە. P (proportional) بەپێی گەورەیی جیاوازییەکە ئێستا کاردانەوەی هەیە. I (integral) جیاوازییەکە بە درێژایی کات کۆ دەکاتەوە، بۆ لابردنی جیاوازییەکی بچووک کە هەرگیز خۆی ناڕوات، وەک کامێرایەک کە لە ناوەڕاستەوە لاتر دانرابێت. D (derivative) سەیری ئەوە دەکات جیاوازییەکە بە چ خێراییەک دەگۆڕێت و زوو ڕایدەگرێت، بۆ ئەوەی لە ئاستی ڕاست تێنەپەڕێت.

A chart of the error over time after a gust tilts the drone by 18 degrees; the curve falls towards zero. At the moment marked now, an orange bar shows P, the size of the error now; a purple shaded area under the curve shows I, the error added up so far; a blue tangent line shows D, how fast the error is changing. Three cards explain: P, the present; I, the past; D, the future.هێڵکارییەکی جیاوازی بە درێژایی کات دوای ئەوەی بایەک درۆنەکە 18 پلە لار دەکاتەوە؛ هێڵەکە بەرەو سفر دادەبەزێت. لە ساتی «ئێستا»دا، ستوونێکی پرتەقاڵی P نیشان دەدات، واتە گەورەیی جیاوازییەکە ئێستا؛ ناوچەیەکی مۆری ژێر هێڵەکە I نیشان دەدات، واتە ئەو جیاوازییەی تا ئێستا کۆ بووەتەوە؛ هێڵێکی شینی تەنیشت D نیشان دەدات، واتە جیاوازییەکە بە چ خێراییەک دەگۆڕێت. سێ کارت ڕوونی دەکەنەوە: P ئێستا، I ڕابردوو، D داهاتوو.
P looks at the present, I at the past, D at the future of the same error.P سەیری ئێستا، I سەیری ڕابردوو و D سەیری داهاتووی هەمان جیاوازی دەکەن.CêIT

PID in plain wordsPID بە زمانێکی سادە

Too little, too much, just rightکەم، زۆر، گونجاو

Choosing the three gains is called tuning. Watch three drones hit by the same gust, each with different gains:

هەڵبژاردنی سێ ژمارەکە (KpK_p، KiK_i و KdK_d) پێی دەوترێت ڕێکخستن (tuning). سەیری سێ بکە کە هەمان با لێیان دەدات، هەریەکە بە ژمارەی جیاواز:

An animation with three rows and a clock from 0 to 1.5 seconds after a gust tilts each drone by 20 degrees. Row 1, too little correction: the line falls slowly and the drone is still tilted after 1.5 seconds. Row 2, P too big with no D brake: the line drops fast, swings well past level and wobbles up and down many times. Row 3, P, I and D tuned: the line returns to level in about half a second without wobbling.
An animation with three rows and a clock from 0 to 1.5 seconds after a gust tilts each drone by 20 degrees. Row 1, too little correction: the line falls slowly and the drone is still tilted after 1.5 seconds. Row 2, P too big with no D brake: the line drops fast, swings well past level and wobbles up and down many times. Row 3, P, I and D tuned: the line returns to level in about half a second without wobbling.
Same gust, three tunings: lazy, wobbly, and just right.هەمان با، سێ ڕێکخستن: تەمبەڵ، لەرزۆک و گونجاو.CêIT
  • Too little: the drone comes back slowly and drifts with the wind; it feels lazy.
  • Too much P (and too little D): it swings past level and wobbles; PX4's tuning guide says a P gain that is too high shows as fast oscillations.
  • Too much I gives slow oscillations; too much D makes the motors twitchy and hot, because D amplifies sensor noise.
  • Just right: it returns in about half a second without wobbling; PX4 calls a good response "locked-in".
  • کەم: بە هێواشی دەگەڕێتەوە و لەگەڵ بادا دەخلیسکێت؛ تەمبەڵ دیارە.
  • P زۆر (و D کەم): لە ئاستی ڕاست تێدەپەڕێت و دەلەرێتەوە؛ ڕێبەری ڕێکخستنی ⁦PX4⁩ دەڵێت P زۆر وەک لەرینەوەی خێرا دەردەکەوێت.
  • I زۆر لەرینەوەی هێواش دروست دەکات؛ D زۆر دەلەرێنێت و گەرمیان دەکات، چونکە D گەورە دەکات.
  • گونجاو: لە نزیکەی نیو چرکەدا بەبێ لەرینەوە دەگەڕێتەوە؛ ⁦PX4⁩ بە وەڵامی باش دەڵێت «قوفڵدراو» (locked-in).

PID in plain wordsPID بە زمانێکی سادە

Optional: the PID formulaبۆ زیاتر زانین: هاوکێشەی PID

In words: the push back is the sum of three parts, each multiplied by its own gain. Doubling KpK_p doubles the reaction to the present error; a bigger KiK_i removes a steady offset faster; a bigger KdK_d brakes harder against fast changes.

بە وشە: هێزی گەڕاندنەوە کۆی سێ بەشە و هەر بەشێک لە ژمارەی خۆی لێک دەدرێت. دووهێندەکردنی KpK_p کاردانەوە بەرامبەر جیاوازیی ئێستا دوو هێندە دەکات؛ ئەگەر KiK_i گەورەتر بێت، جیاوازییەکی جێگیر خێراتر لادەبات؛ ئەگەر KdK_d گەورەتر بێت، بە توندتر بەرامبەر گۆڕانی خێرا دەوەستێتەوە.

Loops inside loopsخول لە ناو خولدا

A drone does not jump straight from "go to that point" to motor speeds. PX4 uses a cascade of loops, each giving the next its target. The position loop turns "where to go" into a wanted velocity. The velocity loop turns that into a wanted tilt and thrust. The angle (attitude) loop turns the tilt into a wanted turning rate. The rate loop, fed directly by the gyroscope, turns that into a turning effort (torque). The position and angle loops are simple P controllers; the velocity and rate loops are PID.

ڕاستەوخۆ لە «بڕۆ بۆ ئەو خاڵە»وە بازناداتە سەر خێرایی . ⁦PX4⁩ زنجیرەیەک خول بەکار دەهێنێت کە هەر یەکێکیان ئامانجی خولی دواتر دیاری دەکات. خولی شوێن «بۆ کوێ بڕۆم» دەکاتە خێرایی ویستراو. خولی خێرایی ئەوە دەکاتە لاربوونەوە و ویستراو. خولی لاربوونەوەکە دەکاتە خێرایی سووڕانەوەی ویستراو. خولی خێرایی سووڕانەوە، کە ڕاستەوخۆ لە زانیاری وەردەگرێت، ئەوە دەکاتە . خولەکانی شوێن و کۆنترۆڵکەری سادەی Pـن؛ خولەکانی خێرایی و خێرایی سووڕانەوە PIDـن.

Last comes the mixer: it turns "this much thrust, this much roll, pitch and yaw" into one speed for each motor — the rules you met in All the moves in one picture. The inner loops run fastest, because tilt changes in milliseconds while position changes in seconds.

لە کۆتاییدا تێکەڵکەر (mixer) دێت: «ئەوەندە ، ئەوەندە ، و » دەکاتە یەک خێرایی بۆ هەر — ئەو یاسایانەی لە هەموو جووڵەکان لە یەک وێنەدا بینیت. خولەکانی ناوەوە خێراترین کار دەکەن، چونکە لاربوونەوە لە چەند میلیچرکەیەکدا دەگۆڕێت بەڵام شوێن لە چەند چرکەیەکدا.

Four boxes in a chain under the target, a waypoint or the pilot's sticks. Position loop (P) gives a wanted velocity and measures the GNSS position. Velocity loop (PID) gives a wanted tilt and thrust and measures the velocity estimate. Angle loop (P) gives a wanted turning rate and measures the tilt angles. Rate loop (PID) gives a wanted torque and measures the gyroscope. Then the mixer gives one speed per motor, to the ESCs and motors of a quadcopter. A note: inner loops run fastest, hundreds of times a second.چوار چوارچێوە بە زنجیرە لە ژێر ئامانجەکەدا، خاڵێکی ڕێگە یان فەرمانی فڕۆکەوان. خولی شوێن (P) خێرایی ویستراو دەدات و شوێنی GNSS دەپێوێت. خولی خێرایی (PID) لاربوونەوە و هێزی پاڵنەری ویستراو دەدات و مەزەندەی خێرایی دەپێوێت. خولی گۆشە (P) خێرایی سووڕانەوەی ویستراو دەدات و گۆشەکانی لاربوونەوە دەپێوێت. خولی خێرایی سووڕانەوە (PID) زەبری ویستراو دەدات و جایرۆسکۆپ دەپێوێت. پاشان تێکەڵکەر خێراییەک بۆ هەر ماتۆڕێک دەدات، بۆ کۆنترۆڵکەرەکانی خێرایی و ماتۆڕەکانی چوارپەروانەیەک. تێبینییەک: خولەکانی ناوەوە خێراترینن، چەند سەد جار لە چرکەیەکدا.
PX4's cascade: position → velocity → angle → rate → mixer → motors.زنجیرەی ⁦PX4⁩: شوێن ← خێرایی ← ← خێرایی سووڕانەوە ← تێکەڵکەر ← .CêIT

Flight modesدۆخەکانی فڕین

A flight mode tells the autopilot how much to help. The names below are ArduPilot's (PX4's are similar: Stabilized, Altitude, Position, Mission, Return, Land). ArduPilot suggests that beginners learn them in this order: Stabilize, Alt Hold, Loiter, RTL, Auto.

بە دەڵێت چەند یارمەتی بدات. ناوەکانی خوارەوە هی ArduPilotـن (هی ⁦PX4⁩ـیش هاوشێوەن: Stabilized، Altitude، Position، Mission، Return، ⁦Land). ArduPilot⁩ پێشنیار دەکات تازەکاران بەم ڕیزە فێریان ببن: Stabilize، Alt Hold، Loiter، RTL، Auto.

ModeدۆخWhat the autopilot does چی دەکاتNeeds GNSS?GNSSـی پێویستە؟
Stabilizekeeps the drone level; the pilot controls height and position ڕێک ڕادەگرێت؛ فڕۆکەوان و شوێن کۆنترۆڵ دەکاتnoنەخێر
Alt Holdalso holds the height with the barometer; the drone drifts with the wind بە ڕادەگرێت؛ لەگەڵ بادا دەخلیسکێتnoنەخێر
Loiteralso holds the position: let go of the sticks and it staysشوێنیش ڕادەگرێت: دەست لە دەسکەکان بەردە و دەمێنێتەوەyesبەڵێ
Autoflies a planned mission of waypoints by itselfخۆی ئەرکێکی پلاندانراو لە دەفڕێتyesبەڵێ
Guidedflies to points sent live from a ground station or computerبۆ ئەو خاڵانە دەفڕێت کە ڕاستەوخۆ لە یان کۆمپیوتەرەوە دەنێردرێنyesبەڵێ
RTLreturns home and lands (next lesson)دەگەڕێتەوە بۆ ماڵ و دەنیشێتەوە (وانەی داهاتوو)yesبەڵێ
Landcomes down and lands where it isلە شوێنی خۆی دادەبەزێت و دەنیشێتەوەnoنەخێر
Acroonly holds turning rates: for experts and stuntsتەنیا خێرایی سووڕانەوە ڕادەگرێت: بۆ شارەزایان و نمایشnoنەخێر
Six bars that get longer from top to bottom, showing how much the autopilot does. Acro: the pilot does almost everything. Stabilize: plus it keeps itself level. Alt Hold: plus it holds its height with the barometer. Loiter or Position: plus it holds its place. Auto: plus it flies the route by itself. RTL: plus it flies home and lands. A column on the right marks the last three with a satellite: they need GNSS.شەش شریت کە لە سەرەوە بۆ خوارەوە درێژتر دەبن و نیشان دەدەن فڕۆکەوانی خۆکار چەند کار دەکات. Acro: فڕۆکەوان نزیکەی هەموو کارێک دەکات. Stabilize: لەگەڵ ئەوەشدا خۆی ڕێک ڕادەگرێت. Alt Hold: هەروەها بەرزاییەکەی بە بارۆمەتر ڕادەگرێت. Loiter یان Position: هەروەها شوێنی خۆی ڕادەگرێت. Auto: هەروەها خۆی ڕێگاکە دەفڕێت. RTL: هەروەها دەگەڕێتەوە بۆ ماڵ و دەنیشێتەوە. ستوونێک لە ڕاست سێ دانەی کۆتایی بە مانگێکی دەستکرد نیشان دەکات: GNSSـیان پێویستە.
The more a mode does for you, the more it depends on its sensors — the last three need GNSS.تا دۆخێک زیاتر کارت بۆ بکات، زیاتر پشت بە دەبەستێت — سێ دانەی کۆتایی GNSSـیان پێویستە.CêIT

PX4, ArduPilot and ground stations⁦PX4⁩، ArduPilot و وێستگەکانی کۆنترۆڵی زەمینی

PX4 and ArduPilot are the two big open-source autopilots: anyone may read, change and share their source code. PX4 uses the BSD 3-Clause licence and is hosted by the Dronecode Foundation, a Linux Foundation project; ArduPilot uses the GPLv3 licence. Both fly multirotors, fixed wings, VTOL aircraft, helicopters and ground rovers. Many camera drones from big makers run their own closed firmware instead.

⁦PX4⁩ و ArduPilot دوو گەورەی : هەر کەسێک دەتوانێت بخوێنێتەوە، بیگۆڕێت و بڵاوی بکاتەوە. ⁦PX4⁩ ⁦BSD 3-Clause⁩ بەکار دەهێنێت و دامەزراوەی Dronecode، کە پرۆژەیەکی Linux Foundationـە، سەرپەرشتی دەکات؛ ArduPilot ⁦GPLv3⁩ بەکار دەهێنێت. هەردووکیان دەتوانن ، ، فڕۆکەی VTOL و هەلیکۆپتەر بفڕێنن و ئۆتۆمبێلی زەمینیش بجووڵێنن. زۆرێک لە کامێرادار کە کۆمپانیا گەورەکان دروستیان دەکەن، لەبری ئەوانە داخراوی خۆیان بەکار دەهێنن.

On the ground the pilot uses a ground control station: software such as QGroundControl (for PX4 and ArduPilot; Windows, macOS, Linux, Android and iOS) or Mission Planner (for ArduPilot). It shows the telemetry — mode, battery, satellites, height, speed and a map — sends missions and changes settings over a radio link that speaks MAVLink (Telemetry and MAVLink).

لەسەر زەوی فڕۆکەوان بەکار دەهێنێت: وەک QGroundControl (بۆ ⁦PX4⁩ و ArduPilot؛ Windows، macOS، Linux، Android و iOS) یان Mission Planner (بۆ ArduPilot). نیشان دەدات — ، ، مانگە دەستکردەکان، ، خێرایی و نەخشە — ئەرک دەنێرێت و ڕێکخستنەکان دەگۆڕێت بە پەیوەندییەکی ڕادیۆیی کە بە زمانی قسە دەکات (تەلەمەتری و MAVLink).

A sketch of a ground-station screen. The top bar shows AUTO ARMED, the battery as 15.6 V and 72 percent, and GPS 3D with 17 satellites. On the left an attitude indicator shows the tilt, with the altitude 32 m and the ground speed 4 m/s below it. On the right a simple map of a field shows the home point H, four numbered waypoints joined by a dashed route and the drone between waypoints 2 and 3. A message bar at the bottom says Reached waypoint 2. Labels around the screen name each part.هێڵکارییەکی سادەی شاشەی وێستگەی کۆنترۆڵی زەمینی. شریتی سەرەوە AUTO ARMED، پاتری بە 15.6 V و 72 لە سەددا، هەروەها GPS 3D بە 17 مانگی دەستکرد نیشان دەدات. لە چەپ نیشاندەرێکی لاربوونەوە هەیە، لە ژێریدا بەرزایی 32 مەتر و خێرایی 4 مەتر لە چرکەیەکدا. لە ڕاست نەخشەیەکی سادەی کێڵگەیەک خاڵی ماڵ H، چوار خاڵەکانی ڕێگەی ژمارەدار کە بە ڕێگایەکی پچڕپچڕ بەستراون و درۆنەکە لە نێوان خاڵی 2 و 3دا نیشان دەدات. شریتی پەیام لە خوارەوە دەڵێت Reached waypoint 2. ناونیشانەکانی دەوری شاشەکە هەر بەشێک ناو دەبەن.
What the pilot watches during a flight: mode, battery, satellites, attitude, map and messages.ئەوەی فڕۆکەوان لە کاتی فڕیندا چاودێری دەکات: دۆخ، ، مانگی دەستکرد، لاربوونەوە، نەخشە و پەیام.CêIT

PX4, ArduPilot and ground stations⁦PX4⁩، ArduPilot و وێستگەکانی کۆنترۆڵی زەمینی

Arming and pre-arm checksچالاککردنی ماتۆڕەکان و پشکنینەکانی پێش ئەو

Before take-off the pilot arms the drone: the motors become live and the propellers may start to spin. Before it allows this, the autopilot runs pre-arm checks: are the accelerometers and the compass calibrated, and do they agree? Is the barometer healthy? Is there a good GNSS fix for the modes that need one? Is the battery above its minimum, the radio calibrated, the EKF happy? If any check fails, it refuses to arm, the LED flashes yellow and the ground station shows the reason.

پێش هەڵفڕین فڕۆکەوان چالاک دەکات (): زیندوو دەبن و لەوانەیە دەست بە سووڕانەوە بکەن. پێش ئەوەی ڕێگە بەمە بدات، پشکنینەکانی پێش ئەنجام دەدات: ئایا و ڕێکخراون و یەک دەگرنەوە؟ ئایا تەندروستە؟ ئایا شوێنێکی باشی GNSS هەیە بۆ ئەو دۆخانەی پێویستیانە؟ ئایا لە سەرووی کەمترین ئاستەوەیە، ڕێکخراوە و EKF ڕازییە؟ ئەگەر یەک پشکنین سەرنەکەوێت، ڕێگە نادات، گڵۆپەکە زەرد دەترووسکێتەوە و هۆکارەکە نیشان دەدات.

A list of seven pre-arm checks. Six have green ticks: accelerometers calibrated and agree, gyroscopes healthy, barometer healthy, GNSS 3D fix with 14 satellites, battery above the minimum, radio controller calibrated. One has an orange cross: compass not calibrated. On the right, an orange panel says Arming refused: the LED flashes yellow and the ground station shows the reason; fix it, never switch the check off. A green panel says: all checks pass, now the pilot may arm; the motors are live and the props may spin; keep hands clear.لیستێک لە حەوت پشکنینی پێش چالاککردنی ماتۆڕەکان. شەشیان نیشانەی ڕاستی سەوزیان هەیە: ئەکسێلەرۆمیتەرەکان ڕێکخراون و یەک دەگرنەوە، جایرۆسکۆپەکان تەندروستن، بارۆمەتر تەندروستە، GNSS شوێنی 3D بە 14 مانگی دەستکرد، پاتری لە سەرووی کەمترین ئاستە، کۆنترۆڵی دوور ڕێکخراوە. یەکێکیان خاچێکی پرتەقاڵیی هەیە: ماگنێتۆمیتەر ڕێکنەخراوە. لە ڕاست، بەشێکی پرتەقاڵی دەڵێت چالاککردنی ماتۆڕەکان ڕەت کرایەوە: گڵۆپەکە زەرد دەترووسکێتەوە و وێستگەی کۆنترۆڵی زەمینی هۆکارەکە دەڵێت؛ چاکی بکەوە، هەرگیز پشکنینەکە مەکوژێنەوە. بەشێکی سەوز دەڵێت: هەموو پشکنینەکان سەرکەوتوون، ئێستا چالاککردنی ماتۆڕەکان ڕێگەپێدراوە؛ ماتۆڕەکان زیندوون و پەروانەکان لەوانەیە بسووڕێن؛ دەست دوور بگرە.
One failed check is enough to refuse arming — and that is a good thing.یەک پشکنینی سەرنەکەوتوو بەسە بۆ ڕەتکردنەوەی — و ئەمە شتێکی باشە.CêIT

Common mistakesهەڵە باوەکان

MistakeهەڵەBetterباشتر
"The gyroscope measures height."« دەپێوێت.»The gyroscope measures how fast the drone turns. Height comes from the barometer, a rangefinder and GNSS. دەپێوێت بە چ خێراییەک دەسووڕێتەوە. لە ، و GNSSـەوە دێت.
"GPS keeps the drone level."« ڕێک ڕادەگرێت.»The IMU and the control loop keep it level, hundreds of times a second. GNSS only tells it where it is. و چەند سەد جار لە چرکەیەکدا ڕێکی ڕادەگرن. GNSS تەنیا دەڵێت لە کوێیە.
"Calibrating the compass next to a car or on a steel table is fine."«ڕێکخستنی لە تەنیشت ئۆتۆمبێل یان لەسەر مێزی ئاسن کێشە نییە.»Steel and electric current bend the magnetic field. Calibrate in an open space, away from cars, metal and power lines.ئاسن و بواری موگناتیسی لا دەدەن. لە شوێنێکی کراوە، دوور لە ئۆتۆمبێل، ئاسن و هێڵی کارەبا ڕێکی بخە.
"Higher PID gains always make a better drone."«ژمارەی بەرزتری PID هەمیشە باشتر دروست دەکات.»Too much P makes it wobble; too much D makes the motors hot and twitchy. Tune in small steps.P زۆر دەیلەرێنێت؛ D زۆر گەرم و لەرزۆک دەکات. هەنگاو بە هەنگاوی بچووک ڕێکی بخە.
"The barometer gives an exact height near the ground."« لە نزیک زەوی ورد دەدات.»It drifts with the weather and the propellers' wash; a rangefinder is better for the last metres.لەگەڵ کەشوهەوا و بای دەگۆڕێت؛ بۆ دوا مەترەکان باشترە.
"If a pre-arm check fails, switch it off."«ئەگەر پشکنینێکی پێش سەرنەکەوت، بیکوژێنەوە.»A failed check is a warning. Find and fix the cause.پشکنینی سەرنەکەوتوو ئاگادارکردنەوەیە. هۆکارەکە بدۆزەوە و چاکی بکەوە.
"Sensor fusion just averages all the sensors."« تەنیا ناوەندی هەموو دەدۆزێتەوە.»An EKF predicts with the IMU, corrects with the others and rejects readings that disagree too much.EKF بە پێشبینی دەکات، بە ئەوانی تر ڕاستی دەکاتەوە و ئەو خوێندنەوانە ڕەت دەکاتەوە کە زۆر جیاوازن.

Exercisesڕاهێنانەکان

ExerciseڕاهێنانPEAS for a delivery dronePEAS بۆ درۆنێکی گەیاندن

Write the PEAS description (Performance measure, Environment, Actuators, Sensors) of a drone that carries medicine from a hospital in Erbil to clinics in nearby villages. Use the format of PEAS.

وەسفی PEAS (، ژینگە، ، ) بۆ بنووسە کە دەرمان لە نەخۆشخانەیەکی هەولێرەوە بۆ بنکە تەندروستییەکانی گوندە نزیکەکان دەبات. شێوازی PEAS بەکار بهێنە.

Hintئاماژە

Sensors measure, actuators act; the performance measure says what a good delivery looks like.

دەپێون، کار دەکەن؛ دەڵێت گەیاندنێکی باش چۆنە.

Show answerوەڵامەکە پیشان بدە
  • P: the parcel arrives on time and undamaged; nobody is hurt; the flight stays legal and inside its geofence; little battery is used.
  • E: the air over the city and villages, wind, rain and dust, buildings, power lines, birds and other aircraft, the landing spots and the people below.
  • A: the motors with their ESCs and propellers, a release hook or winch, lights and a buzzer, and the radio that sends telemetry.
  • S: the IMU (gyroscope and accelerometer), magnetometer, barometer, GNSS, rangefinder, obstacle sensors and cameras, the battery monitor and the radio receiver.
  • P: بارەکە لە کاتی خۆیدا و بێ زیان دەگات؛ کەس ئازار نابینێت؛ فڕینەکە یاسایی دەبێت و لە ناو دەمێنێتەوە؛ کەمترین وزەی بەکار دەهێنرێت.
  • E: ئاسمانی سەر شار و گوندەکان، با، باران و تۆز، باڵەخانە، هێڵی کارەبا، باڵندە و فڕۆکەی تر، شوێنەکانی نیشتنەوە و خەڵکی خوارەوە.
  • A: لەگەڵ و ، قولاپ یان وینجی بەردانەوەی بار، گڵۆپ و زەنگ، هەروەها ئەو ڕادیۆیەی دەنێرێت.
  • S: ( و )، ، ، GNSS، ، بەربەست و کامێرا، پێوەری و .
ExerciseڕاهێنانWhich sensor?کام هەستەوەر؟

Name the main sensor for each job: (a) know which way the nose points; (b) hold the height in Alt Hold; (c) land gently on a pad; (d) hold still under a bridge where there is no GNSS; (e) feel a gust tilting the drone.

بۆ هەر کارێک سەرەکی ناو ببە: (أ) زانینی ئەوەی لووت ڕووی لە کام لایە؛ (ب) ڕاگرتنی لە Alt Holdـدا؛ (ج) نیشتنەوەی هێمن لەسەر شوێنی نیشتنەوە؛ (د) ڕاوەستان لە ژێر پردێکدا کە GNSS نییە؛ (هـ) هەستکردن بەو بایەی لار دەکاتەوە.

Show answerوەڵامەکە پیشان بدە
  • (a) magnetometer; (b) barometer; (c) downward rangefinder; (d) optical flow with a rangefinder; (e) gyroscope (in the IMU).
  • (أ) ؛ (ب) ؛ (ج) ڕوو لە خوارەوە؛ (د) لەگەڵ ؛ (هـ) (لە ناو ).
ExerciseڕاهێنانLoop arithmeticحیسابی خول

A copter runs its main loop 400 times a second and flies at 10 m/s. How far does it move between two corrections? How far if the rate loop runs 4,000 times a second?

خولە سەرەکییەکەی ⁦400⁩ جار لە چرکەیەکدا کار پێ دەکات و بە خێرایی ⁦10⁩ مەتر لە چرکەیەکدا دەفڕێت. لە نێوان دوو ڕاستکردنەوەدا چەند دەڕوات؟ ئەگەر خولی خێرایی سووڕانەوە ⁦4000⁩ جار لە چرکەیەکدا کار بکات چەند؟

Show answerوەڵامەکە پیشان بدە
T=1400 Hz=0.0025 s=2.5 msd=10 m/s×0.0025 s=0.025 m=2.5 cmd4 kHz=10 m/s×0.00025 s=2.5 mm\begin{aligned} T &= \frac{1}{400\ \text{Hz}} = 0.0025\ \text{s} = 2.5\ \text{ms} \\ d &= 10\ \text{m/s} \times 0.0025\ \text{s} = 0.025\ \text{m} = 2.5\ \text{cm} \\ d_{4\,\text{kHz}} &= 10\ \text{m/s} \times 0.00025\ \text{s} = 2.5\ \text{mm} \end{aligned}

At 400 Hz the drone moves only 2.5 cm between corrections; at 4 kHz only 2.5 mm.

لە ⁦400⁩ هێرتزدا لە نێوان دوو ڕاستکردنەوەدا تەنیا ⁦2.5⁩ سانتیمەتر دەڕوات؛ لە 4 کیلۆهێرتزدا تەنیا ⁦2.5⁩ میلیمەتر.

ExerciseڕاهێنانDiagnose the tuningڕێکخستنەکە دەستنیشان بکە

Three test flights: (a) after a gust the drone takes a long time to level and drifts in the wind; (b) it shakes quickly back and forth after every stick movement; (c) it flies steadily, but the motors are hot after landing and sound rough. Which gain is probably wrong each time?

سێ فڕینی تاقیکردنەوە: (أ) دوای با ماوەیەکی زۆری پێدەچێت تا ڕێک ببێتەوە و لەگەڵ بادا دەخلیسکێت؛ (ب) دوای هەموو جووڵاندنێکی دەسکەکان بە خێرایی سەر و خوار دەلەرێتەوە؛ (ج) جێگیر دەفڕێت، بەڵام دوای نیشتنەوە گەرمن و دەنگیان ناڕێکە. لە هەر جارێکدا کام ژمارە ئەگەری هەیە هەڵە بێت؟

Show answerوەڵامەکە پیشان بدە
  • (a) P (and perhaps I) is too low: the correction is too weak.
  • (b) P is too high, or D too low to brake the swing.
  • (c) D is too high: it amplifies sensor noise, so the motors work hard all the time.
  • (أ) P (و لەوانەیە I) کەمە: ڕاستکردنەوەکە زۆر لاوازە.
  • (ب) P زۆرە، یان D کەمە بۆ ئەوەی لەرینەوەکە ڕابگرێت.
  • (ج) D زۆرە: گەورە دەکات، بۆیە هەمیشە بە توندی کار دەکەن.

Summaryپوختە

  • The flight controller is a microcontroller board running an autopilot (PX4, ArduPilot): it processes inputs and controls the flight.
  • At least four sensors: gyroscope and accelerometer (the IMU), magnetometer and barometer; plus GNSS, rangefinder, optical flow and obstacle sensors.
  • Each sensor can be fooled; sensor fusion (an EKF) predicts with the IMU and corrects with the others.
  • The control loop measures, compares with the set point and corrects — 400 times a second in ArduCopter.
  • PID: P for the present error, I for the past, D for the future; tuning finds gains that are neither lazy nor wobbly.
  • Loops sit inside loops (position → velocity → angle → rate → mixer); flight modes decide how much the autopilot helps; pre-arm checks must never be switched off.
  • بۆردێکی کە (⁦PX4⁩، ArduPilot) کار پێ دەکات: چارەسەر دەکات و فڕینەکە کۆنترۆڵ دەکات.
  • لانیکەم چوار : و ()، و ؛ هەروەها GNSS، ، و بەربەست.
  • هەموو هەڵدەخەڵەتێت؛ ⁦(EKF)⁩ بە پێشبینی دەکات و بە ئەوانی تر ڕاستی دەکاتەوە.
  • دەپێوێت، لەگەڵ بەراورد دەکات و ڕاست دەکاتەوە — لە ArduCopterـدا ⁦400⁩ جار لە چرکەیەکدا.
  • ⁦PID: P⁩ بۆ جیاوازیی ئێستا، I بۆ ڕابردوو، D بۆ داهاتوو؛ ڕێکخستن ئەو ژمارانە دەدۆزێتەوە کە نە تەمبەڵن نە لەرزۆک.
  • خول لە ناو خولدان (شوێن ← خێرایی ← ← خێرایی سووڕانەوە ← تێکەڵکەر)؛ دیاری دەکەن چەند یارمەتی بدات؛ نابێت هەرگیز پشکنینەکانی پێش بکوژێنرێنەوە.
Review questionsپرسیارەکانی پێداچوونەوە
Why does a drone need both a gyroscope and an accelerometer?بۆچی درۆن پێویستی بە جایرۆسکۆپ و ئەکسێلەرۆمیتەر پێکەوە هەیە؟

The gyroscope is smooth but drifts over time; the accelerometer knows where down is but is noisy. Fused together they give a tilt that is both smooth and correct.

ڕێکە بەڵام بە تێپەڕبوونی کات لادەدات؛ دەزانێت خوارەوە کامەیە بەڵام زۆرە. کاتێک یەک دەخرێن لاربوونەوەیەک دەدەن کە هەم ڕێکە و هەم دروست.

What happens in one turn of the control loop?لە یەک سووڕی خولی کۆنترۆڵدا چی ڕوودەدات؟

The sensors measure, the autopilot estimates the state, compares it with the set point and computes a correction, and the ESCs change the motor speeds.

دەپێون، دۆخەکە مەزەندە دەکات، لەگەڵ بەراوردی دەکات و ڕاستکردنەوەیەک هەژمار دەکات، پاشان خێراتر یان هێواشتر دەکەن.

Which flight mode would you use if GNSS stops working, and why?ئەگەر GNSS کار نەکات کام دۆخی فڕین بەکار دەهێنیت و بۆچی؟

Alt Hold (or Stabilize): they need no position, so you can fly by eye and land; Loiter, Auto and RTL depend on GNSS.

Alt Hold (یان Stabilize): پێویستیان بە شوێن نییە، بۆیە دەتوانیت بە چاو بفڕیت و بنیشیتەوە؛ Loiter، Auto و RTL پشت بە GNSS دەبەستن.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

GNSS Navigation, Return-to-Home, Geofences and Failsafesڕێنیشاندەری GNSS، گەڕانەوە بۆ ماڵ، پەرژینەکانی جوگرافی و سەلامەتیی کاتی تێکچوون

Related lecturesوانە پەیوەندیدارەکان

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.