Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
30 views12 pages

IMU and Encoders: Team Project Robocon 2016 Harsh Sinha, 14265, Deepak Gangwar, 14208, Swati Gupta, 14742, March 17 2016

Uploaded by

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

IMU and Encoders: Team Project Robocon 2016 Harsh Sinha, 14265, Deepak Gangwar, 14208, Swati Gupta, 14742, March 17 2016

Uploaded by

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

IMU and Encoders

Team project
Robocon 2016

Harsh Sinha, 14265, ​[email protected]


Deepak Gangwar, 14208, ​[email protected]
Swati Gupta, 14742, ​[email protected]

March 17​th​ 2016


IMU and Encoders
Module Report

Harsh Sinha
Deepak Gangwar
Swati Gupta
Table of Contents

Table of Contents
1. Project Management Plan
2. Requirement Specification
3. Analysis
4. Design
5. Implementation
6. Test Documentation
Appendices
1. Project Management Plan
Automated movement of robots requires some sort of localisation, using which the robot is able
to identify the path. There are various methods of localisation for example GPS(Global
Positioning System), Point-cloud localisation, Line following, Wall following etc. Inertial
Measurement Unit (IMU) is very widely used sensor for localisation of robots and vehicles (e.g.
auto navigation robot).

For Robocon ‘16 we were planning to localise our hybrid robot with IMU and encoders such that
robot would know its orientation and coordinates in the game arena with a precision of 50 cm.
By knowing its coordinates and orientation it is very feasible to automate the robot without
hardcoding.

This whole project took almost 15 days to be completed.


2. Requirement Specification
Will be provided by the instructor.
3. Analysis
IMU (Inertial Measurement Unit) is a sensor that uses an inbuilt accelerometer, gyro and
magnetometer to produce acceleration and orientation readings in real time.
Rotary Encoders are used to measure the angle turned and hence one can attach its axis to a
wheel and calculate the distance traversed in the direction.
We used GY-87 10DOF IMU (3-axis Gyroscope + 3-axis Acceleration + 3-axis Magnetic Field +
Air Pressure Module) and Rotary encoder autonics e40s.
4. Design
After calibrating the IMU we implemented Kalman filter to get less noisy acceleration values.
Then travelled distance can be calculated by integrating acceleration twice.

Kalman Filter
Kalman filtering is an algorithm that uses a series of measurements observed over
realtime(containing statistical noise and other inaccuracies) and produces estimates of unknown
variables that tend to be more precise than those based on a single measurement alone.

The algorithm works in a two-step process. In the prediction step, the Kalman filter produces
estimates of the current state variables, along with their uncertainties. Once the outcome of the
next measurement (necessarily corrupted with some amount of error, including random noise) is
observed, these estimates are updated using a weighted average, with more weight being given
to estimates with higher certainty. The algorithm is recursive. It can run in real time, using only
the present input measurements and the previously calculated state and its uncertainty matrix;
no additional past information is required.
5. Implementation
For implementation of Kalman filter we used following C code respectively for prediction and
updation part:
void predict(double *est_x, double *pk, double a)
{ (*est_x) = a * (*est_x);
(*pk) = a * (*pk) * a + 10;
}

void update(double *pk, double * gk, double r, double *est_x, double *zk, double c)
{ (*gk) = (*pk) * c / (c * c * (*pk) + r);
(*est_x) = (*est_x) + (*gk) * (*zk - (*est_x) * c);
(*pk)=(1-(*gk)*c)*(*pk);
}

Where ,
est_x = estimated x
gk = gain
pk = prediction factor
zk = reading

For calculating distances from rotary encoder following C code is used :


angvelo = (encAngle[1] - encAngle[0])
encDist += angvelo * 0.01 * 0.3372; //time 0.01 , radius of wheel = 0.3372

Where encAngle are the readings of angles obtained from encoders

6. Test Documentation
Following are some results obtained from our testing

Synthesized data
For 10% and 30% synthesize noise respectively
Real Time data
IMU was kept on a robot that stays put for 10s, then moves forward for 10s, stays put again for
10s and in the end goes back for 10s.
Real time distance calculation using IMU
These are the results of calculated distance from IMU in both forward and reverse directions
respectively. We moved the robot 3 m and got 2.9 m calculated which is very good.
Appendices
For basic tutorial on IMU you can go through my lecture presentation
https://docs.google.com/presentation/d/1sKFActMGCSR1DL5n2hOCsF_MsTidwE68sNDpWhta
UUk/edit?usp=sharing

You might also like