ماژول IMU و تخمین جهت گیری در ربات ها: از ژیروسکوپ تا فیلتر کالمن
ربات برای حفظ تعادل، پیمودن مسیر و کنترل دقیق بازو یا پهپاد باید در هر لحظه بداند چگونه در فضا قرار گرفته است؛ یعنی زاویه های غلتش، گام و سمت آن چیست. ماژول واحد اندازه گیری اینرسی یا IMU این اطلاعات را با نرخ نمونه برداری بالا فراهم می کند. یک IMU از شتاب سنج و ژیروسکوپ سه محوره تشکیل می شود و برخی نمونه ها مغناطیس سنج هم دارند. شتاب سنج شتاب خطی را می سنجد و در حالت سکون، جهت گرانش را نشان می دهد و از روی آن غلتش و گام به دست می آید. ژیروسکوپ سرعت زاویه ای را اندازه می گیرد و با انتگرال گیری زمانی از آن، تغییر جهت گیری محاسبه می شود.

نمونه MPU-6050 یک حسگر شش محوره MEMS است که شتاب سنج و ژیروسکوپ را با مبدل های ۱۶ بیتی، بازه های قابل تنظیم ±۲ تا ±۱۶ g برای شتاب و ±۲۵۰ تا ±۲۰۰۰ درجه بر ثانیه برای سرعت زاویه ای و رابط I2C ترکیب می کند. در مقابل، ICM-20948 نه محوره است و با افزودن مغناطیس سنج سه محوره و پردازنده حرکت داخلی، علاوه بر غلتش و گام مرجعی برای سمت می دهد و از I2C و SPI پشتیبانی می کند.
هیچ یک به تنهایی کافی نیست. شتاب سنج زیر لرزش و شتاب های حرکتی نویزی است، اما در بلندمدت مرجع پایداری برای جهت گرانش دارد. ژیروسکوپ در کوتاه مدت پاسخ سریع و نرمی دارد، ولی بایاس و نویز آن هنگام انتگرال گیری انباشته می شود و خطای جهت گیری، یعنی دریفت، با زمان رشد می کند. شتاب سنج سمت حول محور گرانش را تعیین نمی کند.
راه حل، ترکیب داده حسگرهاست. فیلتر مکمل ژیروسکوپ را بالاگذر و شتاب سنج را پایین گذر ترکیب می کند؛ پس پاسخ سریع ژیروسکوپ حفظ و دریفت آن آهسته اصلاح می شود. این فیلتر سبک و مناسب میکروکنترلرهای ساده است. فیلتر کالمن و گونه توسعه یافته آن، با مدل کردن حالت و نویزهای فرایند و اندازه گیری، در چرخه پیش بینی و به روزرسانی وزن مناسب تری به هر منبع می دهد و بایاس ژیروسکوپ را می تواند تخمین بزند. کالیبراسیون اولیه، نرخ نمونه برداری و تنظیم بهره یا کوواریانس ها کیفیت نهایی را تعیین می کند؛ ازاین رو IMU ستون فقرات پایدارسازی و ناوبری بسیاری از ربات هاست.
کلیدواژه ها: ماژول IMU، تخمین جهت گیری، ژیروسکوپ، شتاب سنج، دریفت، فیلتر مکمل، فیلتر کالمن، MPU-6050، ICM-20948
IMU Modules and Orientation Estimation in Robots: From Gyroscopes to the Kalman Filter
To keep its balance, follow a path, or precisely control an arm or drone, a robot must know at every instant how it is oriented in space: its roll, pitch, and yaw. An inertial measurement unit (IMU) module provides it at a high sampling rate. A typical IMU combines a three-axis accelerometer and gyroscope; some versions also add a magnetometer. The accelerometer measures linear acceleration and, at rest, reveals the direction of gravity, from which roll and pitch follow. The gyroscope measures angular velocity, and integrating it over time yields the change in orientation.
The MPU-6050 is a six-axis MEMS chip combining an accelerometer and a gyroscope, with 16-bit converters, programmable ranges of ±2 to ±16 g for acceleration and ±250 to ±2000 degrees per second for angular rate, and an I2C interface. The nine-axis ICM-20948 adds a three-axis magnetometer and an internal motion processor, giving a yaw reference besides roll and pitch, and supports both I2C and SPI.
Neither sensor is sufficient on its own. The accelerometer is noisy under vibration and motion, yet over the long term it gives a stable gravity reference. The gyroscope responds quickly and smoothly in the short term, but its bias and noise accumulate during integration, so the orientation error, known as drift, grows with time. The accelerometer also cannot determine heading around the gravity axis.
The solution is sensor fusion. A complementary filter combines the gyroscope through a high-pass filter and the accelerometer through a low-pass filter, preserving the gyroscope's fast response while correcting its drift. This filter is lightweight and suits simple microcontrollers. The Kalman filter and its extended variant model the state and the process and measurement noises, weighting each source in a predict-and-update cycle; they can also estimate gyroscope bias. In practice, initial calibration, sampling rate, and tuning of gains or covariances determine final quality; thus the IMU is the backbone of stabilization and navigation in many robots.
Keywords: IMU module, orientation estimation, gyroscope, accelerometer, drift, complementary filter, Kalman filter, MPU-6050, ICM-20948
منابع / Sources
1. TDK InvenSense, "MPU-6050 Product Specification (PS-MPU-6000A-00)": https://product.tdk.com/en/search/sensor/mortion-inertial/imu/info?part_no=MPU-6050
2. TDK InvenSense, "ICM-20948" (datasheet DS-000189): https://www.invensense.tdk.com/en-us/products/9-axis/icm-20948
3. MathWorks, "Determine Orientation Using Inertial Sensors": https://se.mathworks.com/help/releases/R2022b/fusion/gs/determine-orientation-through-sensor-fusion.html
4. Mahony, R., Hamel, T., & Pflimlin, J.-M. (2008), "Nonlinear Complementary Filters on the Special Orthogonal Group", IEEE Transactions on Automatic Control, 53(5), 1203–1218. DOI: 10.1109/TAC.2008.923738
5. Kalman, R. E. (1960), "A New Approach to Linear Filtering and Prediction Problems", Journal of Basic Engineering, 82(D), 35–45.
6. MathWorks, "Estimating Orientation Using Inertial Sensor Fusion and MPU-9250": https://www.mathworks.com/help/releases/R2022a/nav/ug/estimating-orientation-using-MPU-9250.html