Working With Inertial Measurement Unit
Working With Inertial Measurement Unit
Robot navigation.
Inertial Navigation
• Inertial Navigation is a technique for determining the position, velocity, and orientation of
a moving object by integrating data from an Inertial Measurement Unit (IMU) over time.
• The IMU provides acceleration and angular velocity measurements, which can be
integrated over time to estimate the object's velocity and position relative to an initial
reference frame .
• To get the correct direction of the robot, the orientation of the robot is required; this can be
obtained by integrating sensed angular velocity from gyroscope.
• The following figure illustrates an inertial navigation system, which
will convert IMU values to odometric data:
• The values we get from the IMU are converted into navigational information
using navigation equations and feeding into estimation filters such as the
Kalman filter.
• The Kalman filter is an algorithm that estimates the state of a system from the
measured data .
• The data from Inertial Navigation System (INS) will have some drift because of
the error from the accelerometer and gyroscope.
• To limit the drift, an INS is usually aided by other sensors that provide direct
measurements of the integrated quantities.
• Based on the measurements and sensor error models, the Kalman filter
estimates errors in the navigation equations and all the colored sensors' errors.
The following figure shows a diagram of an aided inertial navigation
system using the Kalman filter:
Along with the motor encoders, the value from the IMU can be taken
as the odometer value and it can be used for dead reckoning, the
process of finding the current position of a moving object by using a
previously determined position.
• The basic principle behind dead reckoning is to continuously update the object's
estimated position based on its previous position and its estimated
displacement, which is calculated using information on the object's speed and
direction.
• This displacement is added to the previous position to obtain the new estimated
position.
• Dead reckoning can be used in situations where it's difficult or impossible to obtain
external position information, such as GPS signals or other location-based systems.
Interfacing MPU 6050 with Tiva C LaunchPad
The MPU-6000/MPU-6050 family of parts are the world's first and only 6-axis motion tracking devices
designed for the low power, low cost, and high performance requirements of smart phones, tablets,
wearable sensors, and robotics.
The MPU-6000/6050 devices combine a 3-axis gyroscope and 3-axis accelerometer on the silicon die
together with an onboard digital motion processor capable of processing complex 9-axis motion
fusion algorithms.
• Extract the files inside the Arduino folder inside the ZIP file to the
sketchbook/libraries location.
• The Arduino packages in this repository are also compatible with Launchpad.
• The extracted files contain the I2Cdev, Wire, and MPU6050 packages that are
required for the interfacing of the MPU 6050 sensor.
• The preceding procedure is done in Ubuntu, but it is the same for Windows
and Mac OS X.
Interfacing code of Energia
This code is used to read the raw value from MPU 6050 to Launchpad, it uses a MPU
6050 third-party library that is compatible with Energia IDE.
• The Wire library allows us to communicate with the I2C devices. MPU 6050 can
communicate using I2C.
• The Wire.begin() function will start the I2C communication between MPU 6050
and Launchpad;
• Also, it will initialize the MPU 6050 device using the initialize() method defined in
the MPU6050 class.
If everything is successful, it will print connection successful, otherwise it will print
connection failed:
The definition of Update_MPU6050() is given as follows.
• It declares six variables to handle
the accelerometer and gyroscope
value in 3-axis.