0% found this document useful (0 votes)
77 views20 pages

Working With Inertial Measurement Unit

This document discusses working with an Inertial Measurement Unit (IMU) and inertial navigation. It provides the following key points: 1. An IMU uses accelerometers, gyroscopes and magnetometers to measure velocity, orientation and gravitational forces. IMUs are used for applications like robot navigation and balancing drones. 2. Inertial navigation determines position, velocity and orientation by integrating IMU sensor data over time. It provides odometric data by converting IMU values through navigation equations and filters like Kalman filtering. 3. Interfacing an MPU-6050 IMU with a Tiva C LaunchPad microcontroller requires using an I2C library to read the sensor's gyroscope and

Uploaded by

gvkovind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views20 pages

Working With Inertial Measurement Unit

This document discusses working with an Inertial Measurement Unit (IMU) and inertial navigation. It provides the following key points: 1. An IMU uses accelerometers, gyroscopes and magnetometers to measure velocity, orientation and gravitational forces. IMUs are used for applications like robot navigation and balancing drones. 2. Inertial navigation determines position, velocity and orientation by integrating IMU sensor data over time. It provides odometric data by converting IMU values through navigation equations and filters like Kalman filtering. 3. Interfacing an MPU-6050 IMU with a Tiva C LaunchPad microcontroller requires using an I2C library to read the sensor's gyroscope and

Uploaded by

gvkovind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Working with Inertial Measurement Unit

• An Inertial Measurement Unit (IMU) is an electronic device that


measures velocity, orientation, and gravitational forces using a
combination of accelerometers, gyroscopes, and magnetometers.

• An IMU has a lot of applications in robotics


 Balancing of Unmanned Aerial Vehicles (UAVs) and

 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.

system diagram of MPU 6050


The breakout board of MPU 6050 is shown in the following figure
• The connection from Launchpad to MPU 6050 is given in the following
table.
• The remaining pins can be left disconnected:
The MPU 6050 and Launchpad communicate using
the I2C protocol, the supply voltage is 3.3 Volt and
it is taken from Launchpad.
Setting up the MPU 6050
library in Energia
• The interfacing code uses the
https://github.com/jrowberg/i
2cdevlib/zipball/master library

for interfacing MPU 6050.

• Download the ZIP file from


the preceding link and
navigate to Preference from
File | Preference in Energia,
as shown in the following
screenshot:
• Go to Sketchbook location under Preferences, as seen in the preceding
screenshot, and create a folder called libraries.

• 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.

• In this first section of code, we include the necessary


headers for interfacing MPU 6050 to Launchpad
such as I2C, Wire and the MPU6050 library and
create an object of MPU6050 with the name
accelgyro.

• The MPU6050.h library contains a class named


MPU6050 to send and receive data to and from the
sensor:
In the following section, we start the I2C and serial communication to communicate
with MPU 6050 and print sensor values through the serial port.

The serial communication baud rate is 115200 and Setup_MPU6050() is the


custom function to initialize the MPU 6050 communication
The following section is the definition of the Setup_MPU6050() function.

• 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.

• The getMotion6() function in the


MPU 6050 class is responsible for
reading the new values from the
sensor.

• After reading, it will print via the


serial port:

You might also like