SlideShare a Scribd company logo
1 of 35
Vijay Kumar
Professor
Mechanical Engineering
Chitkara University
IMU Fundamental
Micro: Very small in size. Measured in micrometer(ฮผm)
1 ฮผm = 10-6 m
Electro: MEMS have electrical components
Mechanical: MEMS have moving parts
Systems: Refers to integration of components.
We find MEMS in
Automobiles (Air bag sensors)
Computer printers (Ink jet print heads)
Cell phones (RF devices)
Optical devices (Micromirrors)
MEMS
They have also found application in the healthcare domain in devices
such as blood pressure monitors, pacemakers, ventilators, and respirators.
Air bag crash sensors
Active suspension systems
Antilock brake systems
Ride control systems
V K Jadon, Prof., Mechanical Engineering, Chitkara University 2
Accelerometer
๐‘ฅ, ๐‘Ž
๐‘˜
๐‘š
๐‘ฅ, ๐‘Ž
๐‘˜
๐‘š
๐‘ฅ, ๐‘Ž
โˆ’๐‘˜๐‘ฅ = ๐‘š๐‘Ž
๐‘˜
๐‘š ๐‘š๐‘Ž๐‘ ๐‘  ๐‘–๐‘  ๐‘‘๐‘–๐‘ ๐‘๐‘™๐‘Ž๐‘๐‘’๐‘‘
๐‘Ž = โˆ’
๐‘˜
๐‘š
๐‘ฅ
๐‘Ž = ๐‘“(๐‘ฅ)
External Force in the direction of
displacement =massร—acceleration
๐‘š
๐‘˜๐‘ฅ ๐‘Ž
๐ถ = ๐‘“(๐ด/๐‘ฅ)
๐ถ = ๐‘“(๐ด/๐‘Ž)
Accelerometer measures linear acceleration
Acceleration is opposite to
the displacement
๐ถ = ๐‘๐‘Ž๐‘๐‘Ž๐‘๐‘–๐‘ก๐‘Ž๐‘›๐‘๐‘’
๐ด = surface area of
capacitor plates
V K Jadon, Prof., Mechanical Engineering, Chitkara University 3
Displacement of the frame changes the differential capacitance
Capacitive accelerometers offer high sensitivities and
are utilized for low-amplitude, low-frequency devices.
Accelerometer
๐’™
๐’›
๐’š
Internal moveable
assembly
Proof mass
Spring
External Fixed assembly
MPU6050 measures linear acceleration in terms of g force
Usefulness of accelerometer in
IMU will be discussed later
V K Jadon, Prof., Mechanical Engineering, Chitkara University 4
VCC
GND
SCL
SDA
XDA
XCL
ADO
INT
X
Y
I2C ProtocolGyro Accelerometer
MPU6050 Pinout
Clock pulse for I2C Communication
Data through I2C communication
Data to external sensors
Clock pulse to external sensors
I2C Slave Address
Interrupt digital output
The SCL line is the clock signal which synchronize the
data transfer between the devices on the I2C bus.
Clock signal is generated by the master device.
The full scale range of the digital output can be adjusted to ยฑ2g,
ยฑ4g, ยฑ8g, or ยฑ16g.
Three-Axis MEMS Accelerometer with 16-bit ADCs and Signal Conditioning
MPU6050: MEMS Accelerometer
The MPU-60X0โ€™s 3-Axis accelerometer uses separate proof masses for
each axis.
Acceleration along an axis induces displacement on the corresponding
proof mass, and capacitive sensors detect the displacement differentially.
When the device is placed on a flat surface, it will measure
0g on the X- and Y-axes and +1g on the Z-axis (upward).
Each sensor has a dedicated ADC for providing digital outputs.
V K Jadon, Prof., Mechanical Engineering, Chitkara University 6
UNO
Arduino
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
TX-1
RX-0
IOREF
RESET
3.3V
5V
GND
GND
Vin
A0
A1
A2
A3
A4
A5
ON
TX
RX
L
Arduino Uno Pinout
master out slave in
master in slave out
Serial Clock
Slave Select
V K Jadon, Prof., Mechanical Engineering, Chitkara University 7
UNO
Arduino
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
TX-1
RX-0
IOREF
RESET
3.3V
5V
GND
GND
Vin
A0
A1
A2
A3
A4
A5
ON
TX
RX
L
MPU6050 Connection
V K Jadon, Prof., Mechanical Engineering, Chitkara University 8
I2C Protocol
I2C Protocol
V K Jadon, Prof., Mechanical Engineering, Chitkara University 10
โ€ข Begins with a start bit
โ€ข 7 bit Address is transmitted
โ€ข 1 control bit to indicate Master to Read from or
write to slave
โ€ข If communicated slave send ack bit to Master
โ€ข Master to send 8 bit Internal Register Address
โ€ข Slave send back ack bit
โ€ข Master transmits data in 8 bits chunk
โ€ข Write request โ€“ Slave sends ack bit to Master
โ€ข Read request โ€“ Master sends ack bit to Slave
I2C addresses are generally 7 bits, yielding an
address between 0 and 127.
The addresses from 0 to 7 are not used because are
reserved. So, the first address that can be used is 8
S B6 B5 B4 B3 B2 B1 B0 R/W Ack
B7 B6 B5 B4 B3 B2 B1 B0 Ack
B7 B6 B5 B4 B3 B2 B1 B0 Ack S
7 bit Device Address sequence
8 bit internal Register Address sequence
8 bit data sequence
โ€ข Ends with a stop bit
V K Jadon, Prof., Mechanical Engineering, Chitkara University 11
<Wire.h> Library
Wire.begin(address) function initiates Wire library
Wire.beginTransmission(address) begins transmission to
the particular sensor
Wire.beginTransmission(0b1101000)
Wire.endTransmission(address) Transmits data in
buffer and return a status byte, 0 for success.
Wire.endTransmission(0b1101000)
write() buffers data for sending
Wire.write(value)
Wire.write(string)
Wire.write(data, length)
value: a value to send as a single byte
string: a string to send as a series of bytes
data: an array of data to send as bytes
length: the number of bytes to transmit
write() will return the number of bytes written, though
reading that number is optional
address: the 7-bit slave address (optional);
if not specified, join the bus as a master.
Start condition to the slave device with the given address.
It asks for data from the internal registers of the
slave device
S B6 B5 B4 B3 B2 B1 B0 R/W A B7 B6 B5 B4 B3 B2 B1 B0 A B7 B6 B5 B4 B3 B2 B1 B0 A S
V K Jadon, Prof., Mechanical Engineering, Chitkara University 12
<Wire.h> Library
requestFrom() Used by the master to request bytes
from a slave device..
The default value is true.
If true, requestFrom() sends a stop message after the
request, releasing the I2C bus.
If false, requestFrom() sends a restart message after
the request.
Wire.requestFrom(address, quantity)
Wire.requestFrom(address, quantity, stop)
If false, the bus will not be released, which prevents
another master device from requesting between
messages. This allows one master device to send
multiple requests while in control.
The Wire.available() function will return the number
of bytes available for retrieval and if that number
match with our requested bytes
Wire.read() function we will read the bytes from
the two registers of the X axis.
I2C Scanner
MPU6050-
Accelerometer
UNO
Arduino
AREF
GND
13
12
~11
~10
~9
8
7
~6
~5
4
~3
2
TX-1
RX-0
IOREF
RESET
3.3V
5V
GND
GND
Vin
A0
A1
A2
A3
A4
A5
ON
TX
RX
L
MPU6050 Connection
V K Jadon, Prof., Mechanical Engineering, Chitkara University 14
V K Jadon, Prof., Mechanical Engineering, Chitkara University 15
MPU6050 Setup Read Accelerometer data using Arduino
Start I2C Communication
โ€• Use Wire.begin() to initiate wire.h
โ€• Wire.beginTransmission(SDA)
Slave Device Address (SDA)=1101000 AD0=Low
Slave Device Address (SDA)=1101001 AD0=High
Reference โ€“ Product Specifications (Revision 3.4)
Section 9.2 pp33
โ€• Wire.write(0x6B)
Internal Register Address Sequence to
access Power management register (0x6B)
โ€• Wire.write(0b00000000)
Data Transfer Bit Sequence to awake MPU
โ€• Wire.endTransmission(1101000)
FS Range AFS_SEL Register Bit LSB Sensitivity ADC Bits
ยฑ2g 0 0b00000000 16384 LSB/g 15 bit
ยฑ4g 1 0b00001000 8192 LSB/g 14 bits
ยฑ8g 2 0b00010000 4096 LSB/g 13 bits
ยฑ16g 3 0b00011000 2048 LSB/g 12 bits
๐‘ฅ โ‰ˆ 0
๐‘ฆ โ‰ˆ 0
๐‘ง โ‰ˆ 1๐‘”
๐‘ฆ โ‰ˆ 0
๐‘ง โ‰ˆ 0
๐‘ฅ โ‰ˆ 1๐‘”
๐‘ง โ‰ˆ 0
๐‘ฅ โ‰ˆ 0
๐‘ฆ โ‰ˆ 1๐‘”
V K Jadon, Prof., Mechanical Engineering, Chitkara University 16
Accelerometer Setup
The MPU-60X0 features three 16-bit ADCs for digitizing the accelerometer outputs.
For precision tracking of both fast and slow motions, the parts feature a user-
programmable accelerometer full-scale range of ยฑ2g, ยฑ4g, ยฑ8g, and ยฑ16g.
Reference โ€“ Product Specifications (Revision 3.4)
Section 6.2 pp13
โ€• Wire.beginTransmission(0b1101000)
โ€• Wire.write(0b00000000)
โ€• Wire.endTransmission(0b1101000)
โ€• Wire.write(0x1C)Reference โ€“ Register Map and Description (Revision 4.2)
Section 4.5 pp15
Reference โ€“ Product Specifications (Revision 3.4)
Section 3.1 pp7
V K Jadon, Prof., Mechanical Engineering, Chitkara University 17
Read Accelerometer Data
Reference โ€“ Register Map (Revision 4.2)
Section 3 pp7
Wire.beginTransmission(0b1101000)
3B and 3C stores Acceleration data along x-axis
3D and 3E stores Acceleration data along y-axis
3F and 40 stores Acceleration data along z-axis
We should give starting Internal Register Address to access
all Read only registers after that.
To transmit all acceleration data, we should write to 0x3B
register.
โ€• Wire.write(0x3B)
Slave device transmit data in 8 bits(1 byte)
Master store integers in 16 bits.
โ€• Wire.endTransmission(0b1101000)
V K Jadon, Prof., Mechanical Engineering, Chitkara University 18
Read Accelerometer Data
For getting hold of the data available in buffer, master has to request using Wire.requestFrom(address, quantity)
Wire.requestFrom(0b1101000, 6)Check availability of the data requested by the master Wire.available()
It returns the number of received bytes from receive-buffer.
Reads a byte that was transmitted from a slave device to a master after a call to requestFrom()
using Wire.read() function.
The each acceleration data is stored in two register (2 bytes)
The data read is to be stored in one variable of int datatype.
Every repeated Wire.read() gives the next byte available.
accel_rawX = Wire.read()<<8|Wire.read();
00001010
00001111
00001010-00000000
00001010-00001111
00001010
V K Jadon, Prof., Mechanical Engineering, Chitkara University 19
Arduino Pseudo Code
Set-Up MPU6050
Configure Accelerometer
Read Accelerometer Data
Every task starts with beginning communication with slave device
and ends with terminating communication with slave device
begin communication โ€“ Slave device address sequence
access power management register โ€“ internal register address sequence
Update power management register to disable SLEEP mode โ€“ data
transfer sequence
terminate communication โ€“ stop bit
(one time execution)
(one time execution)
begin communication โ€“ Slave device address sequence
access accelerometer configure register โ€“ internal register
address sequence
update accelerometer register to set full scale range โ€“ data
transfer sequence
terminate communication โ€“ stop bit
(data needed continuously)
Disable SLEEP mode
Set Full Scale range
Read accelerometer data
V K Jadon, Prof., Mechanical Engineering, Chitkara University 20
Arduino Pseudo Code
Set-Up MPU6050 Configure Accelerometer
Read Accelerometer Data
Every task starts with beginning communication with slave device
and ends with terminating communication with slave device
(data needed continuously)
Disable SLEEP mode Set Full Scale range
Access Register Read Data
begin communication
stop communication
access accelerometer first data
register
Read accelerometer data
begin communication
stop communication
Request data
Check availability Read 8 bits and
store in 16 bits data
V K Jadon, Prof., Mechanical Engineering, Chitkara University 21
Angle Measurement
๐น๐‘ฅ
๐’™
๐’š
๐’›
๐น๐‘ฆ
๐น๐‘ง
๐น๐‘ฅ
2
+ ๐น๐‘ฆ
2
+ ๐น๐‘ง
2
๐น๐‘ฅ
2
+ ๐น๐‘ฆ
2
๐น๐‘ฆ
2
+ ๐น๐‘ง
2
๐น๐‘ฅ
2
+ ๐น๐‘ง
2
๐’™
๐’š
๐’›
๐น๐‘ฅ
2
+ ๐น๐‘ฆ
2
๐น๐‘ฆ
2
+ ๐น๐‘ง
2
๐น๐‘ฅ
2
+ ๐น๐‘ง
2
V K Jadon, Prof., Mechanical Engineering, Chitkara University 22
There are six possible orderings of these three rotation
matrices and, in principle, all are equally valid
Angle Measurement
๐œ“, โˆ…, ๐œƒ are called as Roll, Pitch, and Yaw Angles
๐‘… ๐‘ฅ =
1 0 0
0 ๐‘๐‘œ๐‘ ๐œ“ โˆ’๐‘ ๐‘–๐‘›๐œ“
0 ๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ ๐œ“
๐‘… ๐‘ฆ =
๐‘๐‘œ๐‘ โˆ… 0 ๐‘ ๐‘–๐‘›โˆ…
0 1 0
โˆ’๐‘ ๐‘–๐‘›โˆ… 0 ๐‘๐‘œ๐‘ โˆ…
๐‘… ๐‘ง =
๐‘๐‘œ๐‘ ๐œƒ โˆ’๐‘ ๐‘–๐‘›๐œƒ 0
๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œƒ 0
0 0 1
Initial force vector=
0
0
1
๐‘ฎ ๐’‘ =
๐‘ฎ ๐’‘๐’™
๐‘ฎ ๐’‘๐’š
๐‘ฎ ๐’‘๐’›
= ๐‘น
0
0
1
๐‘น ๐’™๐’š๐’›
0
0
1
= ๐‘น ๐’™(๐œ“)๐‘น ๐’š(โˆ…) ๐‘น ๐’›(๐œƒ)
0
0
1
๐‘น ๐’š๐’›๐’™
0
0
1
= ๐‘น ๐’š(โˆ…) ๐‘น ๐’›(๐œƒ)๐‘น ๐’™(๐œ“)
0
0
1
๐‘น ๐’š๐’™๐’›
0
0
1
= ๐‘น ๐’š(โˆ…) ๐‘น ๐’™(๐œ“)๐‘น ๐’›(๐œƒ)
0
0
1
๐‘น ๐’›๐’™๐’š
0
0
1
= ๐‘น ๐’›(๐œƒ)๐‘น ๐’™(๐œ“)๐‘น ๐’š(โˆ…)
0
0
1
๐‘น ๐’™๐’›๐’š
0
0
1
= ๐‘น ๐’™(๐œ“)๐‘น ๐’›(๐œƒ)๐‘น ๐’š(โˆ…)
0
0
1
๐‘น ๐’›๐’š๐’™
0
0
1
= ๐‘น ๐’›(๐œƒ)๐‘น ๐’š(โˆ…)๐‘น ๐’™(๐œ“)
0
0
1
V K Jadon, Prof., Mechanical Engineering, Chitkara University 23
The last four rotation sequences result in the accelerometer
output being function of all three rotation angles and cannot
therefore be solved.
It is conventional therefore to select either the rotation
sequence ๐‘… ๐‘ฅ๐‘ฆ๐‘ง or the sequence ๐‘… ๐‘ฆ๐‘ฅ๐‘ง to eliminate the yaw
rotation ฯˆ and allow solution for the roll ฯ† and pitch ฮธ angles.
Angle Measurement
๐‘ฎ ๐’‘ =
๐‘ฎ ๐’‘๐’™
๐‘ฎ ๐’‘๐’š
๐‘ฎ ๐’‘๐’›
=
๐Ÿ
๐บ ๐‘๐‘ฅ
2
+ ๐บ ๐‘๐‘ฆ
2
+ ๐บ ๐‘๐‘ง
2
๐บ ๐‘๐‘ฅ
๐บ ๐‘๐‘ฆ
๐บ ๐‘๐‘ง
=
๐บ ๐‘๐‘ฅ
๐บ ๐‘๐‘ฆ
๐บ ๐‘๐‘ง ๐‘… ๐‘ฅ๐‘ฆ๐‘ง
0
0
1
= ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ฆ(โˆ…) ๐‘… ๐‘ง(๐œƒ)
0
0
1
๐‘… ๐‘ฅ๐‘ฆ๐‘ง =
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œƒ ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œƒ โˆ’๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“ โˆ’ ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ ๐œƒ + ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“
๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ… + ๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
๐‘… ๐‘ฅ๐‘ฆ๐‘ง =
โˆ’๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
๐‘… ๐‘ฆ๐‘ฅ๐‘ง = ๐‘… ๐‘ฆ(โˆ…) ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ง(๐œƒ)
0
0
1
=
โˆ’๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ
๐‘ ๐‘–๐‘›๐œ“
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
๐‘… ๐‘ฅ๐‘ง๐‘ฆ = ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ง(๐œƒ)๐‘… ๐‘ฆ(โˆ…)
0
0
1
=
โˆ’๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ + ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œƒ
๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ โˆ… โˆ’ ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ
๐‘… ๐‘ฅ๐‘ง๐‘ฆ = ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ง(๐œƒ)๐‘… ๐‘ฆ(โˆ…)
0
0
1
=
๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›๐œ“
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ + ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ
๐‘… ๐‘ง๐‘ฆ๐‘ฅ = ๐‘… ๐‘ง(๐œƒ)๐‘… ๐‘ฆ(โˆ…)๐‘… ๐‘ฅ(๐œ“)
0
0
1
=
๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›๐œ“ + ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›๐œƒ๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
๐‘… ๐‘ง๐‘ฅ๐‘ฆ = ๐‘… ๐‘ง(๐œƒ) ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ฆ(โˆ…)
0
0
1
=
๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ ๐œƒ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ + ๐‘ ๐‘–๐‘›โˆ…๐‘๐‘œ๐‘ ๐œƒ
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
Accelerometer Readings
V K Jadon, Prof., Mechanical Engineering, Chitkara University 24
Angle Measurement
Solving ๐‘… ๐‘ฅ๐‘ฆ๐‘ง for the Roll (๐œ“) and Pitch (โˆ…) Angles
The rotation sequence ๐‘… ๐‘ฅ๐‘ฆ๐‘ง is widely used in the aerospace
industry and is termed the 'aerospace rotation sequenceโ€˜.
๐บ ๐‘๐‘ฅ
๐บ ๐‘๐‘ฆ
๐บ ๐‘๐‘ง
=
โˆ’๐‘ ๐‘–๐‘›โˆ…
๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“
๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
๐บ ๐‘๐‘ฅ = โˆ’๐‘ ๐‘–๐‘›โˆ…
๐บ ๐‘๐‘ฆ = ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“
๐บ ๐‘๐‘ง = ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“
tan ๐œ“ ๐‘ฅ๐‘ฆ๐‘ง =
๐บ ๐‘๐‘ฆ
๐บ ๐‘๐‘ง
tan โˆ… ๐‘ฅ๐‘ฆ๐‘ง =
โˆ’๐บ ๐‘๐‘ฅ
๐บ ๐‘๐‘ฆ
2
+ ๐บ ๐‘๐‘ง
2
๐œ‹
4
โˆ’
3๐œ‹
4
๐‘ ๐‘–๐‘›
๐œ‹
4
=
1
2
๐‘๐‘œ๐‘ 
๐œ‹
4
=
1
2
๐‘ก๐‘Ž๐‘›
๐œ‹
4
= 1
๐‘ ๐‘–๐‘› โˆ’
3๐œ‹
4
= โˆ’
1
2
๐‘๐‘œ๐‘  โˆ’
3๐œ‹
4
= โˆ’
1
2
๐‘ก๐‘Ž๐‘› โˆ’
3๐œ‹
4
= 1
๐‘ก๐‘Ž๐‘›โˆ’1
1
1
= ๐‘ก๐‘Ž๐‘›โˆ’1
โˆ’1
โˆ’1
atan function does not distinguish
between opposite angles
atan2 function takes into account the ratio
and sign of ๐‘ฆ and ๐‘ฅ
๐‘Ž๐‘ก๐‘Ž๐‘›2 1, 1 =
๐œ‹
4
๐‘Ž๐‘ก๐‘Ž๐‘›2 โˆ’1, โˆ’1 = โˆ’
3๐œ‹
4
Gyroscope
๐Ž
๐‘ฟ๐’
๐’€
MEMS gyroscopes measure the angular
rate of rotation of one or more axes
V K Jadon, Prof., Mechanical Engineering, Chitkara University
Gyroscope
๐’— ๐‘จ = ๐Ž ร— ๐’“ ๐‘จ
๐Ž
๐’™
๐’›
๐’š
Path of the ball as seen by an
observer moving with table
Path of the ball as
seen from fixed frame
๐’— ๐‘ช
๐’™
๐’›
๐’š
Position of ball
after some time โˆ†๐‘ก
๐’— ๐‘ฉ
๐‘ฉ
๐‘ฉ
Point B after timeโˆ†๐‘ก
๐’— ๐‘จ
๐’— ๐’ƒ๐’‚๐’๐’
Ball has two velocities
V K Jadon, Prof., Mechanical Engineering, Chitkara University
Gyroscope
๐’— ๐‘จ = ๐Ž ร— ๐’“ ๐‘จ
๐’— ๐’ƒ๐’‚๐’๐’
๐Ž
๐’™
๐’›
๐’š
๐Ž ๐’— ๐’ƒ๐’‚๐’๐’
MEMS gyroscopes use vibrating
mechanical elements (proof-mass) to
sense rotation caused by Coriolis
acceleration.
The ADC sample rate is programmable from 8,000 samples per second,
down to 3.9 samples per second, and user-selectable low-pass filters
enable a wide range of cut-off frequencies.
Three-Axis MEMS Gyroscope with 16-bit ADCs and Signal Conditioning
Gyroscope Setup-MPU6050
V K Jadon, Prof., Mechanical Engineering, Chitkara University 28
The MPU-60X0 consists of three independent vibratory MEMS rate
gyroscopes, which detect rotation about the X-, Y-, and Z- Axes.
When the gyros are rotated about any of the sense axes, the Coriolis
Effect causes a vibration that is detected by a capacitive pickoff.
The signal is amplified, demodulated, and filtered to produce a voltage
that is proportional to the angular rate.
This voltage is digitized using individual on-chip 16-bit Analog-to-
Digital Converters (ADCs) to sample each axis.
The full-scale range of the gyro sensors may be digitally programmed
to ยฑ250, ยฑ500, ยฑ1000, or ยฑ2000 degrees per second (dps).
๐‘Ÿ๐‘๐‘š =
๐‘Ÿ๐‘Ž๐‘›๐‘”๐‘’(ยฐ/๐‘ )
360
ร— 60
Range Condition ๐’…๐’†๐’•๐’†๐’„๐’•๐’‚๐’ƒ๐’๐’† ๐’“๐’‘๐’Ž Register Bit
ยฑ250 0 41.67 0x00000000
ยฑ500 1 83.33 0x00001000
ยฑ1000 2 166.7 0x00010000
ยฑ2000 3 333.3 0x00011000
Gyroscope Setup
V K Jadon, Prof., Mechanical Engineering, Chitkara University 29
V K Jadon, Prof., Mechanical Engineering, Chitkara University
For a FS_SEL =1
LSB Sensitivity = 65.5
Register Bit = 0x00001000
๐œ”(๐‘ฆ๐‘Ž๐‘ค ๐‘Ÿ๐‘œ๐‘ก๐‘Ž๐‘ก๐‘–๐‘œ๐‘›) = 1 0
๐‘  ๐‘”๐‘ฆ๐‘Ÿ๐‘œ ๐‘ง = 65.5
๐œ”(๐‘ฆ๐‘Ž๐‘ค ๐‘Ÿ๐‘œ๐‘ก๐‘Ž๐‘ก๐‘–๐‘œ๐‘›) = 5 0
๐‘  ๐‘”๐‘ฆ๐‘Ÿ๐‘œ ๐‘ง = 327.5
At any
particular
time
To convert Gyro values into instantaneous angular rate
๐‘–๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก๐‘Ž๐‘›๐‘’๐‘œ๐‘ข๐‘  ๐‘Ž๐‘›๐‘”๐‘ข๐‘™๐‘Ž๐‘Ÿ ๐‘Ÿ๐‘Ž๐‘ก๐‘’ =
๐‘”๐‘ฆ๐‘Ÿ๐‘œ ๐‘ฅ,๐‘ฆ,๐‘ง
๐ฟ๐‘†๐ต ๐‘†๐‘’๐‘›๐‘ ๐‘–๐‘ก๐‘–๐‘ฃ๐‘–๐‘ก๐‘ฆ
=
327.5
65.5
= 5 0
๐‘ 
To measure total angle travelled
add all instantaneous angles obtained for
small time duration, โˆ†๐‘ก
๐œ” =
๐‘‘๐œƒ
๐‘‘๐‘ก
๐‘‘๐œƒ = ๐œ”๐‘‘๐‘ก ๐œƒ =
๐‘ก1
๐‘ก2
๐œ”๐‘‘๐‘ก
Gyroscope Data
V K Jadon, Prof., Mechanical Engineering, Chitkara University
๐œƒ =
๐‘ก1
๐‘ก2
๐œ”๐‘‘๐‘ก
๐œ”
๐‘ก
๐œ”
๐‘ก
โˆ†๐‘’
Drift error
Drift error is gradual divergence between the true
orientation and estimated orientation by gyro due to error
in measurement.
๐‘’
๐‘ก
Use other sensors to bring down the drift error to
zero. Take angles with reference to world frame.
Gradually apply corrections.
โ€ข These correction are to be fast enough to fully
compensate the drift error.
โ€ข Slow enough to avoid jerky compensations
Tilt Error or (roll and pitch angle error)
Yaw Error
Linear accelerometer
Magnetometer
The noise part is
also integrated
V K Jadon, Prof., Mechanical Engineering, Chitkara University
gyro_pitch_angle=gyro_pitch_angle+ gyro_roll_angle * sin(gyro_z)
gyro_roll_angle=gyro_roll_angle- gyro_pitch_angle * sin(gyro_z)
Transfer of Yaw angles
V K Jadon, Prof., Mechanical Engineering, Chitkara University
The gyroscope drift is mainly due to the integration of two components: a slow changing, near-dc variable
called bias instability and a higher frequency noise variable called angular random walk (ARW).
The yaw axis is most sensitive to this drift. A good portion of the pitch (attitude) and roll axis gyroscope drift
can be removed within an IMU through the use of accelerometer feedback to monitor position relative to
gravity.
Ideally, two references are needed to correct for gyroscope drift on all axes.
An IMU with nine degrees of freedom typically provides additional magnetometer sensors - about 3 axes.
A magnetometer senses field strength relative to the Earthโ€™s magnetic North. These sensors can be used
together with accelerometer data, as another external reference, to mitigate the impact of gyroscope drift
error on the yaw axis.
V K Jadon, Prof., Mechanical Engineering, Chitkara University
However, design of proper spatial magnetometers can be a less reliable vector than an
accelerometer, as there are many things that create magnetic fields within the same order of
magnitude as that of the Earth.
Another one of the more effective methods for cancelling long-term drift is to implement a zero
angular velocity update to the gyroscope. Any time the device is known to be completely stationary,
the gyroscope offset can be nulled to zero for that respective axis.
This opportunity can vary wildly depending on the application. But any instance that the system is at a
recurring resting state can be used for nulling, such as an idling car, a stationary autonomous robot,
or the time between human foot steps.
Of course, using a state-of-the-art IMU that has minimal bias instability within the design at the onset
may offer the most immediate impact on gyroscope drift.
The constant bias error of a gyroscope can be measured by taking the average of the output over a
long period of time while the device is not rotating.
Thanks
V K Jadon, Prof., Mechanical Engineering, Chitkara University 35

More Related Content

What's hot

Smart Face Recognition System Analysis
Smart Face Recognition System AnalysisSmart Face Recognition System Analysis
Smart Face Recognition System AnalysisVishal Aditya
ย 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller Nitesh Kumar
ย 
Chebyshev filter
Chebyshev filterChebyshev filter
Chebyshev filterMOHAMMAD AKRAM
ย 
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMSACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMSKrishna Moparthi
ย 
MICROPROCESSOR AND INTERFACING
MICROPROCESSOR AND INTERFACING MICROPROCESSOR AND INTERFACING
MICROPROCESSOR AND INTERFACING Radhika Talaviya
ย 
Project work of computer sc
Project work of computer scProject work of computer sc
Project work of computer scprakash9526
ย 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pillnirmalk1503
ย 
Accelerometer, MEMS sensor
Accelerometer, MEMS sensorAccelerometer, MEMS sensor
Accelerometer, MEMS sensorAnisha Pathania
ย 
Matched filter
Matched filterMatched filter
Matched filtersrkrishna341
ย 
EEG based Motor Imagery Classification using SVM and MLP
EEG based Motor Imagery Classification using SVM and MLPEEG based Motor Imagery Classification using SVM and MLP
EEG based Motor Imagery Classification using SVM and MLPDr. Rajdeep Chatterjee
ย 
Wearable Biosensors Presentation
Wearable Biosensors PresentationWearable Biosensors Presentation
Wearable Biosensors Presentationraj7
ย 
Microchip's 16-bit and 32-bit PIC MCUs
Microchip's 16-bit and 32-bit PIC MCUsMicrochip's 16-bit and 32-bit PIC MCUs
Microchip's 16-bit and 32-bit PIC MCUsPremier Farnell
ย 
An introduction to digital signal processors 1
An introduction to digital signal processors 1An introduction to digital signal processors 1
An introduction to digital signal processors 1Hossam Hassan
ย 
MEMS & micro systems
MEMS & micro systemsMEMS & micro systems
MEMS & micro systemsMustafa Memon
ย 
Final thesis presentation on bci
Final thesis presentation on bciFinal thesis presentation on bci
Final thesis presentation on bciRedwan Islam
ย 
Fir filter design (windowing technique)
Fir filter design (windowing technique)Fir filter design (windowing technique)
Fir filter design (windowing technique)Bin Biny Bino
ย 

What's hot (20)

Smart Face Recognition System Analysis
Smart Face Recognition System AnalysisSmart Face Recognition System Analysis
Smart Face Recognition System Analysis
ย 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller
ย 
Chebyshev filter
Chebyshev filterChebyshev filter
Chebyshev filter
ย 
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMSACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ย 
Smart dust
Smart dustSmart dust
Smart dust
ย 
Mems in medical technology
Mems in medical technologyMems in medical technology
Mems in medical technology
ย 
Dft
DftDft
Dft
ย 
MICROPROCESSOR AND INTERFACING
MICROPROCESSOR AND INTERFACING MICROPROCESSOR AND INTERFACING
MICROPROCESSOR AND INTERFACING
ย 
Project work of computer sc
Project work of computer scProject work of computer sc
Project work of computer sc
ย 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pill
ย 
Accelerometer, MEMS sensor
Accelerometer, MEMS sensorAccelerometer, MEMS sensor
Accelerometer, MEMS sensor
ย 
Wearable Biosensors
Wearable BiosensorsWearable Biosensors
Wearable Biosensors
ย 
Matched filter
Matched filterMatched filter
Matched filter
ย 
EEG based Motor Imagery Classification using SVM and MLP
EEG based Motor Imagery Classification using SVM and MLPEEG based Motor Imagery Classification using SVM and MLP
EEG based Motor Imagery Classification using SVM and MLP
ย 
Wearable Biosensors Presentation
Wearable Biosensors PresentationWearable Biosensors Presentation
Wearable Biosensors Presentation
ย 
Microchip's 16-bit and 32-bit PIC MCUs
Microchip's 16-bit and 32-bit PIC MCUsMicrochip's 16-bit and 32-bit PIC MCUs
Microchip's 16-bit and 32-bit PIC MCUs
ย 
An introduction to digital signal processors 1
An introduction to digital signal processors 1An introduction to digital signal processors 1
An introduction to digital signal processors 1
ย 
MEMS & micro systems
MEMS & micro systemsMEMS & micro systems
MEMS & micro systems
ย 
Final thesis presentation on bci
Final thesis presentation on bciFinal thesis presentation on bci
Final thesis presentation on bci
ย 
Fir filter design (windowing technique)
Fir filter design (windowing technique)Fir filter design (windowing technique)
Fir filter design (windowing technique)
ย 

Similar to Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050

Motorized pan tilt(Arduino based)
Motorized pan tilt(Arduino based)Motorized pan tilt(Arduino based)
Motorized pan tilt(Arduino based)kane111
ย 
Short Range Radar System using Arduino Uno
Short Range Radar System using Arduino UnoShort Range Radar System using Arduino Uno
Short Range Radar System using Arduino UnoIRJET Journal
ย 
Ee24832835
Ee24832835Ee24832835
Ee24832835IJERA Editor
ย 
Netzer ds 247-128-specsheet
Netzer ds 247-128-specsheetNetzer ds 247-128-specsheet
Netzer ds 247-128-specsheetElectromate
ย 
Ju2416921695
Ju2416921695Ju2416921695
Ju2416921695IJERA Editor
ย 
Assembler4
Assembler4Assembler4
Assembler4Omar Sanchez
ย 
Netzer ds 37-16-specsheet
Netzer ds 37-16-specsheetNetzer ds 37-16-specsheet
Netzer ds 37-16-specsheetElectromate
ย 
Gesture Controlled Chair
Gesture Controlled ChairGesture Controlled Chair
Gesture Controlled Chairtheijes
ย 
Design of Counter Using SRAM
Design of Counter Using SRAMDesign of Counter Using SRAM
Design of Counter Using SRAMIOSRJECE
ย 
Meeting w10 chapter 3 part 3
Meeting w10   chapter 3 part 3Meeting w10   chapter 3 part 3
Meeting w10 chapter 3 part 3Hattori Sidek
ย 
UAV Presentation
UAV PresentationUAV Presentation
UAV PresentationRuyyan
ย 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERVijay Elavunkal
ย 
Design and Implementation of Schmitt Trigger using Operational Amplifier
Design and Implementation of Schmitt Trigger using Operational AmplifierDesign and Implementation of Schmitt Trigger using Operational Amplifier
Design and Implementation of Schmitt Trigger using Operational AmplifierIJERA Editor
ย 
Hand Gesture Control Robot
Hand Gesture Control RobotHand Gesture Control Robot
Hand Gesture Control RobotIRJET Journal
ย 
MaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Inc
ย 
Xbee Wireless Throttle Position Sensor And Control
Xbee Wireless Throttle Position Sensor  And ControlXbee Wireless Throttle Position Sensor  And Control
Xbee Wireless Throttle Position Sensor And Controlkians64
ย 
Wireless Microcontroller (IEEE802.15.4 and ZigBee): JN5139
Wireless Microcontroller  (IEEE802.15.4 and ZigBee): JN5139Wireless Microcontroller  (IEEE802.15.4 and ZigBee): JN5139
Wireless Microcontroller (IEEE802.15.4 and ZigBee): JN5139Premier Farnell
ย 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and RoboticsNIT Raipur
ย 
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyScaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyShivaprasad Tilekar
ย 
Radio Astronomy and electronics
Radio Astronomy and electronicsRadio Astronomy and electronics
Radio Astronomy and electronicsFlavio Falcinelli
ย 

Similar to Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050 (20)

Motorized pan tilt(Arduino based)
Motorized pan tilt(Arduino based)Motorized pan tilt(Arduino based)
Motorized pan tilt(Arduino based)
ย 
Short Range Radar System using Arduino Uno
Short Range Radar System using Arduino UnoShort Range Radar System using Arduino Uno
Short Range Radar System using Arduino Uno
ย 
Ee24832835
Ee24832835Ee24832835
Ee24832835
ย 
Netzer ds 247-128-specsheet
Netzer ds 247-128-specsheetNetzer ds 247-128-specsheet
Netzer ds 247-128-specsheet
ย 
Ju2416921695
Ju2416921695Ju2416921695
Ju2416921695
ย 
Assembler4
Assembler4Assembler4
Assembler4
ย 
Netzer ds 37-16-specsheet
Netzer ds 37-16-specsheetNetzer ds 37-16-specsheet
Netzer ds 37-16-specsheet
ย 
Gesture Controlled Chair
Gesture Controlled ChairGesture Controlled Chair
Gesture Controlled Chair
ย 
Design of Counter Using SRAM
Design of Counter Using SRAMDesign of Counter Using SRAM
Design of Counter Using SRAM
ย 
Meeting w10 chapter 3 part 3
Meeting w10   chapter 3 part 3Meeting w10   chapter 3 part 3
Meeting w10 chapter 3 part 3
ย 
UAV Presentation
UAV PresentationUAV Presentation
UAV Presentation
ย 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETER
ย 
Design and Implementation of Schmitt Trigger using Operational Amplifier
Design and Implementation of Schmitt Trigger using Operational AmplifierDesign and Implementation of Schmitt Trigger using Operational Amplifier
Design and Implementation of Schmitt Trigger using Operational Amplifier
ย 
Hand Gesture Control Robot
Hand Gesture Control RobotHand Gesture Control Robot
Hand Gesture Control Robot
ย 
MaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Code Examples
MaxBotix Code Examples
ย 
Xbee Wireless Throttle Position Sensor And Control
Xbee Wireless Throttle Position Sensor  And ControlXbee Wireless Throttle Position Sensor  And Control
Xbee Wireless Throttle Position Sensor And Control
ย 
Wireless Microcontroller (IEEE802.15.4 and ZigBee): JN5139
Wireless Microcontroller  (IEEE802.15.4 and ZigBee): JN5139Wireless Microcontroller  (IEEE802.15.4 and ZigBee): JN5139
Wireless Microcontroller (IEEE802.15.4 and ZigBee): JN5139
ย 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
ย 
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyScaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
ย 
Radio Astronomy and electronics
Radio Astronomy and electronicsRadio Astronomy and electronics
Radio Astronomy and electronics
ย 

More from Vijay Kumar Jadon

Outcome Based Education and Assessment
Outcome Based Education and AssessmentOutcome Based Education and Assessment
Outcome Based Education and AssessmentVijay Kumar Jadon
ย 
Analysis and design eccentric loading
Analysis and design eccentric loadingAnalysis and design eccentric loading
Analysis and design eccentric loadingVijay Kumar Jadon
ย 
Program outcome maping
Program outcome mapingProgram outcome maping
Program outcome mapingVijay Kumar Jadon
ย 
Concept of state of stress and strain
Concept of state of stress and strainConcept of state of stress and strain
Concept of state of stress and strainVijay Kumar Jadon
ย 
Free Body Diagram - FBD
Free Body Diagram - FBDFree Body Diagram - FBD
Free Body Diagram - FBDVijay Kumar Jadon
ย 
tensile test - stress strain curve
tensile test - stress strain curvetensile test - stress strain curve
tensile test - stress strain curveVijay Kumar Jadon
ย 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static loadVijay Kumar Jadon
ย 
Introduction to Aerial Robotics
Introduction to Aerial RoboticsIntroduction to Aerial Robotics
Introduction to Aerial RoboticsVijay Kumar Jadon
ย 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static loadVijay Kumar Jadon
ย 
Machine design philosophy
Machine design philosophyMachine design philosophy
Machine design philosophyVijay Kumar Jadon
ย 
quadcopter modelling and controller design
quadcopter modelling and controller designquadcopter modelling and controller design
quadcopter modelling and controller designVijay Kumar Jadon
ย 
Mechanics of Quadcopter
Mechanics of QuadcopterMechanics of Quadcopter
Mechanics of QuadcopterVijay Kumar Jadon
ย 

More from Vijay Kumar Jadon (16)

Co jan22
Co jan22Co jan22
Co jan22
ย 
Session 2 jan17
Session 2 jan17Session 2 jan17
Session 2 jan17
ย 
Outcome Based Education and Assessment
Outcome Based Education and AssessmentOutcome Based Education and Assessment
Outcome Based Education and Assessment
ย 
Analysis and design eccentric loading
Analysis and design eccentric loadingAnalysis and design eccentric loading
Analysis and design eccentric loading
ย 
Program outcome maping
Program outcome mapingProgram outcome maping
Program outcome maping
ย 
Concept of state of stress and strain
Concept of state of stress and strainConcept of state of stress and strain
Concept of state of stress and strain
ย 
Free Body Diagram - FBD
Free Body Diagram - FBDFree Body Diagram - FBD
Free Body Diagram - FBD
ย 
tensile test - stress strain curve
tensile test - stress strain curvetensile test - stress strain curve
tensile test - stress strain curve
ย 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static load
ย 
Introduction to Aerial Robotics
Introduction to Aerial RoboticsIntroduction to Aerial Robotics
Introduction to Aerial Robotics
ย 
Aerial Robotics
Aerial RoboticsAerial Robotics
Aerial Robotics
ย 
Tensile test
Tensile testTensile test
Tensile test
ย 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static load
ย 
Machine design philosophy
Machine design philosophyMachine design philosophy
Machine design philosophy
ย 
quadcopter modelling and controller design
quadcopter modelling and controller designquadcopter modelling and controller design
quadcopter modelling and controller design
ย 
Mechanics of Quadcopter
Mechanics of QuadcopterMechanics of Quadcopter
Mechanics of Quadcopter
ย 

Recently uploaded

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
ย 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
ย 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
ย 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
ย 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
ย 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
ย 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
ย 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
ย 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
ย 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
ย 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
ย 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
ย 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
ย 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
ย 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoรฃo Esperancinha
ย 

Recently uploaded (20)

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
ย 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
ย 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
ย 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
ย 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
ย 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
ย 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
ย 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
ย 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
ย 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
ย 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
ย 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
ย 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
ย 
โ˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
โ˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCRโ˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
โ˜… CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
ย 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
ย 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
ย 

Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050

  • 2. Micro: Very small in size. Measured in micrometer(ฮผm) 1 ฮผm = 10-6 m Electro: MEMS have electrical components Mechanical: MEMS have moving parts Systems: Refers to integration of components. We find MEMS in Automobiles (Air bag sensors) Computer printers (Ink jet print heads) Cell phones (RF devices) Optical devices (Micromirrors) MEMS They have also found application in the healthcare domain in devices such as blood pressure monitors, pacemakers, ventilators, and respirators. Air bag crash sensors Active suspension systems Antilock brake systems Ride control systems V K Jadon, Prof., Mechanical Engineering, Chitkara University 2
  • 3. Accelerometer ๐‘ฅ, ๐‘Ž ๐‘˜ ๐‘š ๐‘ฅ, ๐‘Ž ๐‘˜ ๐‘š ๐‘ฅ, ๐‘Ž โˆ’๐‘˜๐‘ฅ = ๐‘š๐‘Ž ๐‘˜ ๐‘š ๐‘š๐‘Ž๐‘ ๐‘  ๐‘–๐‘  ๐‘‘๐‘–๐‘ ๐‘๐‘™๐‘Ž๐‘๐‘’๐‘‘ ๐‘Ž = โˆ’ ๐‘˜ ๐‘š ๐‘ฅ ๐‘Ž = ๐‘“(๐‘ฅ) External Force in the direction of displacement =massร—acceleration ๐‘š ๐‘˜๐‘ฅ ๐‘Ž ๐ถ = ๐‘“(๐ด/๐‘ฅ) ๐ถ = ๐‘“(๐ด/๐‘Ž) Accelerometer measures linear acceleration Acceleration is opposite to the displacement ๐ถ = ๐‘๐‘Ž๐‘๐‘Ž๐‘๐‘–๐‘ก๐‘Ž๐‘›๐‘๐‘’ ๐ด = surface area of capacitor plates V K Jadon, Prof., Mechanical Engineering, Chitkara University 3
  • 4. Displacement of the frame changes the differential capacitance Capacitive accelerometers offer high sensitivities and are utilized for low-amplitude, low-frequency devices. Accelerometer ๐’™ ๐’› ๐’š Internal moveable assembly Proof mass Spring External Fixed assembly MPU6050 measures linear acceleration in terms of g force Usefulness of accelerometer in IMU will be discussed later V K Jadon, Prof., Mechanical Engineering, Chitkara University 4
  • 5. VCC GND SCL SDA XDA XCL ADO INT X Y I2C ProtocolGyro Accelerometer MPU6050 Pinout Clock pulse for I2C Communication Data through I2C communication Data to external sensors Clock pulse to external sensors I2C Slave Address Interrupt digital output The SCL line is the clock signal which synchronize the data transfer between the devices on the I2C bus. Clock signal is generated by the master device.
  • 6. The full scale range of the digital output can be adjusted to ยฑ2g, ยฑ4g, ยฑ8g, or ยฑ16g. Three-Axis MEMS Accelerometer with 16-bit ADCs and Signal Conditioning MPU6050: MEMS Accelerometer The MPU-60X0โ€™s 3-Axis accelerometer uses separate proof masses for each axis. Acceleration along an axis induces displacement on the corresponding proof mass, and capacitive sensors detect the displacement differentially. When the device is placed on a flat surface, it will measure 0g on the X- and Y-axes and +1g on the Z-axis (upward). Each sensor has a dedicated ADC for providing digital outputs. V K Jadon, Prof., Mechanical Engineering, Chitkara University 6
  • 7. UNO Arduino AREF GND 13 12 ~11 ~10 ~9 8 7 ~6 ~5 4 ~3 2 TX-1 RX-0 IOREF RESET 3.3V 5V GND GND Vin A0 A1 A2 A3 A4 A5 ON TX RX L Arduino Uno Pinout master out slave in master in slave out Serial Clock Slave Select V K Jadon, Prof., Mechanical Engineering, Chitkara University 7
  • 10. I2C Protocol V K Jadon, Prof., Mechanical Engineering, Chitkara University 10 โ€ข Begins with a start bit โ€ข 7 bit Address is transmitted โ€ข 1 control bit to indicate Master to Read from or write to slave โ€ข If communicated slave send ack bit to Master โ€ข Master to send 8 bit Internal Register Address โ€ข Slave send back ack bit โ€ข Master transmits data in 8 bits chunk โ€ข Write request โ€“ Slave sends ack bit to Master โ€ข Read request โ€“ Master sends ack bit to Slave I2C addresses are generally 7 bits, yielding an address between 0 and 127. The addresses from 0 to 7 are not used because are reserved. So, the first address that can be used is 8 S B6 B5 B4 B3 B2 B1 B0 R/W Ack B7 B6 B5 B4 B3 B2 B1 B0 Ack B7 B6 B5 B4 B3 B2 B1 B0 Ack S 7 bit Device Address sequence 8 bit internal Register Address sequence 8 bit data sequence โ€ข Ends with a stop bit
  • 11. V K Jadon, Prof., Mechanical Engineering, Chitkara University 11 <Wire.h> Library Wire.begin(address) function initiates Wire library Wire.beginTransmission(address) begins transmission to the particular sensor Wire.beginTransmission(0b1101000) Wire.endTransmission(address) Transmits data in buffer and return a status byte, 0 for success. Wire.endTransmission(0b1101000) write() buffers data for sending Wire.write(value) Wire.write(string) Wire.write(data, length) value: a value to send as a single byte string: a string to send as a series of bytes data: an array of data to send as bytes length: the number of bytes to transmit write() will return the number of bytes written, though reading that number is optional address: the 7-bit slave address (optional); if not specified, join the bus as a master. Start condition to the slave device with the given address. It asks for data from the internal registers of the slave device S B6 B5 B4 B3 B2 B1 B0 R/W A B7 B6 B5 B4 B3 B2 B1 B0 A B7 B6 B5 B4 B3 B2 B1 B0 A S
  • 12. V K Jadon, Prof., Mechanical Engineering, Chitkara University 12 <Wire.h> Library requestFrom() Used by the master to request bytes from a slave device.. The default value is true. If true, requestFrom() sends a stop message after the request, releasing the I2C bus. If false, requestFrom() sends a restart message after the request. Wire.requestFrom(address, quantity) Wire.requestFrom(address, quantity, stop) If false, the bus will not be released, which prevents another master device from requesting between messages. This allows one master device to send multiple requests while in control. The Wire.available() function will return the number of bytes available for retrieval and if that number match with our requested bytes Wire.read() function we will read the bytes from the two registers of the X axis. I2C Scanner
  • 15. V K Jadon, Prof., Mechanical Engineering, Chitkara University 15 MPU6050 Setup Read Accelerometer data using Arduino Start I2C Communication โ€• Use Wire.begin() to initiate wire.h โ€• Wire.beginTransmission(SDA) Slave Device Address (SDA)=1101000 AD0=Low Slave Device Address (SDA)=1101001 AD0=High Reference โ€“ Product Specifications (Revision 3.4) Section 9.2 pp33 โ€• Wire.write(0x6B) Internal Register Address Sequence to access Power management register (0x6B) โ€• Wire.write(0b00000000) Data Transfer Bit Sequence to awake MPU โ€• Wire.endTransmission(1101000)
  • 16. FS Range AFS_SEL Register Bit LSB Sensitivity ADC Bits ยฑ2g 0 0b00000000 16384 LSB/g 15 bit ยฑ4g 1 0b00001000 8192 LSB/g 14 bits ยฑ8g 2 0b00010000 4096 LSB/g 13 bits ยฑ16g 3 0b00011000 2048 LSB/g 12 bits ๐‘ฅ โ‰ˆ 0 ๐‘ฆ โ‰ˆ 0 ๐‘ง โ‰ˆ 1๐‘” ๐‘ฆ โ‰ˆ 0 ๐‘ง โ‰ˆ 0 ๐‘ฅ โ‰ˆ 1๐‘” ๐‘ง โ‰ˆ 0 ๐‘ฅ โ‰ˆ 0 ๐‘ฆ โ‰ˆ 1๐‘” V K Jadon, Prof., Mechanical Engineering, Chitkara University 16 Accelerometer Setup The MPU-60X0 features three 16-bit ADCs for digitizing the accelerometer outputs. For precision tracking of both fast and slow motions, the parts feature a user- programmable accelerometer full-scale range of ยฑ2g, ยฑ4g, ยฑ8g, and ยฑ16g. Reference โ€“ Product Specifications (Revision 3.4) Section 6.2 pp13 โ€• Wire.beginTransmission(0b1101000) โ€• Wire.write(0b00000000) โ€• Wire.endTransmission(0b1101000) โ€• Wire.write(0x1C)Reference โ€“ Register Map and Description (Revision 4.2) Section 4.5 pp15 Reference โ€“ Product Specifications (Revision 3.4) Section 3.1 pp7
  • 17. V K Jadon, Prof., Mechanical Engineering, Chitkara University 17 Read Accelerometer Data Reference โ€“ Register Map (Revision 4.2) Section 3 pp7 Wire.beginTransmission(0b1101000) 3B and 3C stores Acceleration data along x-axis 3D and 3E stores Acceleration data along y-axis 3F and 40 stores Acceleration data along z-axis We should give starting Internal Register Address to access all Read only registers after that. To transmit all acceleration data, we should write to 0x3B register. โ€• Wire.write(0x3B) Slave device transmit data in 8 bits(1 byte) Master store integers in 16 bits. โ€• Wire.endTransmission(0b1101000)
  • 18. V K Jadon, Prof., Mechanical Engineering, Chitkara University 18 Read Accelerometer Data For getting hold of the data available in buffer, master has to request using Wire.requestFrom(address, quantity) Wire.requestFrom(0b1101000, 6)Check availability of the data requested by the master Wire.available() It returns the number of received bytes from receive-buffer. Reads a byte that was transmitted from a slave device to a master after a call to requestFrom() using Wire.read() function. The each acceleration data is stored in two register (2 bytes) The data read is to be stored in one variable of int datatype. Every repeated Wire.read() gives the next byte available. accel_rawX = Wire.read()<<8|Wire.read(); 00001010 00001111 00001010-00000000 00001010-00001111 00001010
  • 19. V K Jadon, Prof., Mechanical Engineering, Chitkara University 19 Arduino Pseudo Code Set-Up MPU6050 Configure Accelerometer Read Accelerometer Data Every task starts with beginning communication with slave device and ends with terminating communication with slave device begin communication โ€“ Slave device address sequence access power management register โ€“ internal register address sequence Update power management register to disable SLEEP mode โ€“ data transfer sequence terminate communication โ€“ stop bit (one time execution) (one time execution) begin communication โ€“ Slave device address sequence access accelerometer configure register โ€“ internal register address sequence update accelerometer register to set full scale range โ€“ data transfer sequence terminate communication โ€“ stop bit (data needed continuously) Disable SLEEP mode Set Full Scale range Read accelerometer data
  • 20. V K Jadon, Prof., Mechanical Engineering, Chitkara University 20 Arduino Pseudo Code Set-Up MPU6050 Configure Accelerometer Read Accelerometer Data Every task starts with beginning communication with slave device and ends with terminating communication with slave device (data needed continuously) Disable SLEEP mode Set Full Scale range Access Register Read Data begin communication stop communication access accelerometer first data register Read accelerometer data begin communication stop communication Request data Check availability Read 8 bits and store in 16 bits data
  • 21. V K Jadon, Prof., Mechanical Engineering, Chitkara University 21 Angle Measurement ๐น๐‘ฅ ๐’™ ๐’š ๐’› ๐น๐‘ฆ ๐น๐‘ง ๐น๐‘ฅ 2 + ๐น๐‘ฆ 2 + ๐น๐‘ง 2 ๐น๐‘ฅ 2 + ๐น๐‘ฆ 2 ๐น๐‘ฆ 2 + ๐น๐‘ง 2 ๐น๐‘ฅ 2 + ๐น๐‘ง 2 ๐’™ ๐’š ๐’› ๐น๐‘ฅ 2 + ๐น๐‘ฆ 2 ๐น๐‘ฆ 2 + ๐น๐‘ง 2 ๐น๐‘ฅ 2 + ๐น๐‘ง 2
  • 22. V K Jadon, Prof., Mechanical Engineering, Chitkara University 22 There are six possible orderings of these three rotation matrices and, in principle, all are equally valid Angle Measurement ๐œ“, โˆ…, ๐œƒ are called as Roll, Pitch, and Yaw Angles ๐‘… ๐‘ฅ = 1 0 0 0 ๐‘๐‘œ๐‘ ๐œ“ โˆ’๐‘ ๐‘–๐‘›๐œ“ 0 ๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ ๐œ“ ๐‘… ๐‘ฆ = ๐‘๐‘œ๐‘ โˆ… 0 ๐‘ ๐‘–๐‘›โˆ… 0 1 0 โˆ’๐‘ ๐‘–๐‘›โˆ… 0 ๐‘๐‘œ๐‘ โˆ… ๐‘… ๐‘ง = ๐‘๐‘œ๐‘ ๐œƒ โˆ’๐‘ ๐‘–๐‘›๐œƒ 0 ๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œƒ 0 0 0 1 Initial force vector= 0 0 1 ๐‘ฎ ๐’‘ = ๐‘ฎ ๐’‘๐’™ ๐‘ฎ ๐’‘๐’š ๐‘ฎ ๐’‘๐’› = ๐‘น 0 0 1 ๐‘น ๐’™๐’š๐’› 0 0 1 = ๐‘น ๐’™(๐œ“)๐‘น ๐’š(โˆ…) ๐‘น ๐’›(๐œƒ) 0 0 1 ๐‘น ๐’š๐’›๐’™ 0 0 1 = ๐‘น ๐’š(โˆ…) ๐‘น ๐’›(๐œƒ)๐‘น ๐’™(๐œ“) 0 0 1 ๐‘น ๐’š๐’™๐’› 0 0 1 = ๐‘น ๐’š(โˆ…) ๐‘น ๐’™(๐œ“)๐‘น ๐’›(๐œƒ) 0 0 1 ๐‘น ๐’›๐’™๐’š 0 0 1 = ๐‘น ๐’›(๐œƒ)๐‘น ๐’™(๐œ“)๐‘น ๐’š(โˆ…) 0 0 1 ๐‘น ๐’™๐’›๐’š 0 0 1 = ๐‘น ๐’™(๐œ“)๐‘น ๐’›(๐œƒ)๐‘น ๐’š(โˆ…) 0 0 1 ๐‘น ๐’›๐’š๐’™ 0 0 1 = ๐‘น ๐’›(๐œƒ)๐‘น ๐’š(โˆ…)๐‘น ๐’™(๐œ“) 0 0 1
  • 23. V K Jadon, Prof., Mechanical Engineering, Chitkara University 23 The last four rotation sequences result in the accelerometer output being function of all three rotation angles and cannot therefore be solved. It is conventional therefore to select either the rotation sequence ๐‘… ๐‘ฅ๐‘ฆ๐‘ง or the sequence ๐‘… ๐‘ฆ๐‘ฅ๐‘ง to eliminate the yaw rotation ฯˆ and allow solution for the roll ฯ† and pitch ฮธ angles. Angle Measurement ๐‘ฎ ๐’‘ = ๐‘ฎ ๐’‘๐’™ ๐‘ฎ ๐’‘๐’š ๐‘ฎ ๐’‘๐’› = ๐Ÿ ๐บ ๐‘๐‘ฅ 2 + ๐บ ๐‘๐‘ฆ 2 + ๐บ ๐‘๐‘ง 2 ๐บ ๐‘๐‘ฅ ๐บ ๐‘๐‘ฆ ๐บ ๐‘๐‘ง = ๐บ ๐‘๐‘ฅ ๐บ ๐‘๐‘ฆ ๐บ ๐‘๐‘ง ๐‘… ๐‘ฅ๐‘ฆ๐‘ง 0 0 1 = ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ฆ(โˆ…) ๐‘… ๐‘ง(๐œƒ) 0 0 1 ๐‘… ๐‘ฅ๐‘ฆ๐‘ง = ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œƒ ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œƒ โˆ’๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“ โˆ’ ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ ๐œƒ + ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ… + ๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ ๐‘… ๐‘ฅ๐‘ฆ๐‘ง = โˆ’๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ ๐‘… ๐‘ฆ๐‘ฅ๐‘ง = ๐‘… ๐‘ฆ(โˆ…) ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ง(๐œƒ) 0 0 1 = โˆ’๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ ๐‘… ๐‘ฅ๐‘ง๐‘ฆ = ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ง(๐œƒ)๐‘… ๐‘ฆ(โˆ…) 0 0 1 = โˆ’๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ + ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ โˆ… โˆ’ ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘… ๐‘ฅ๐‘ง๐‘ฆ = ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ง(๐œƒ)๐‘… ๐‘ฆ(โˆ…) 0 0 1 = ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ + ๐‘ ๐‘–๐‘›โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ ๐‘… ๐‘ง๐‘ฆ๐‘ฅ = ๐‘… ๐‘ง(๐œƒ)๐‘… ๐‘ฆ(โˆ…)๐‘… ๐‘ฅ(๐œ“) 0 0 1 = ๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ ๐œ“๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›๐œ“ + ๐‘๐‘œ๐‘ ๐œ“๐‘ ๐‘–๐‘›๐œƒ๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ ๐‘… ๐‘ง๐‘ฅ๐‘ฆ = ๐‘… ๐‘ง(๐œƒ) ๐‘… ๐‘ฅ(๐œ“)๐‘… ๐‘ฆ(โˆ…) 0 0 1 = ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“๐‘ ๐‘–๐‘›๐œƒ โˆ’ ๐‘๐‘œ๐‘ ๐œƒ๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ ๐œƒ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ + ๐‘ ๐‘–๐‘›โˆ…๐‘๐‘œ๐‘ ๐œƒ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ Accelerometer Readings
  • 24. V K Jadon, Prof., Mechanical Engineering, Chitkara University 24 Angle Measurement Solving ๐‘… ๐‘ฅ๐‘ฆ๐‘ง for the Roll (๐œ“) and Pitch (โˆ…) Angles The rotation sequence ๐‘… ๐‘ฅ๐‘ฆ๐‘ง is widely used in the aerospace industry and is termed the 'aerospace rotation sequenceโ€˜. ๐บ ๐‘๐‘ฅ ๐บ ๐‘๐‘ฆ ๐บ ๐‘๐‘ง = โˆ’๐‘ ๐‘–๐‘›โˆ… ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ ๐บ ๐‘๐‘ฅ = โˆ’๐‘ ๐‘–๐‘›โˆ… ๐บ ๐‘๐‘ฆ = ๐‘๐‘œ๐‘ โˆ…๐‘ ๐‘–๐‘›๐œ“ ๐บ ๐‘๐‘ง = ๐‘๐‘œ๐‘ โˆ…๐‘๐‘œ๐‘ ๐œ“ tan ๐œ“ ๐‘ฅ๐‘ฆ๐‘ง = ๐บ ๐‘๐‘ฆ ๐บ ๐‘๐‘ง tan โˆ… ๐‘ฅ๐‘ฆ๐‘ง = โˆ’๐บ ๐‘๐‘ฅ ๐บ ๐‘๐‘ฆ 2 + ๐บ ๐‘๐‘ง 2 ๐œ‹ 4 โˆ’ 3๐œ‹ 4 ๐‘ ๐‘–๐‘› ๐œ‹ 4 = 1 2 ๐‘๐‘œ๐‘  ๐œ‹ 4 = 1 2 ๐‘ก๐‘Ž๐‘› ๐œ‹ 4 = 1 ๐‘ ๐‘–๐‘› โˆ’ 3๐œ‹ 4 = โˆ’ 1 2 ๐‘๐‘œ๐‘  โˆ’ 3๐œ‹ 4 = โˆ’ 1 2 ๐‘ก๐‘Ž๐‘› โˆ’ 3๐œ‹ 4 = 1 ๐‘ก๐‘Ž๐‘›โˆ’1 1 1 = ๐‘ก๐‘Ž๐‘›โˆ’1 โˆ’1 โˆ’1 atan function does not distinguish between opposite angles atan2 function takes into account the ratio and sign of ๐‘ฆ and ๐‘ฅ ๐‘Ž๐‘ก๐‘Ž๐‘›2 1, 1 = ๐œ‹ 4 ๐‘Ž๐‘ก๐‘Ž๐‘›2 โˆ’1, โˆ’1 = โˆ’ 3๐œ‹ 4
  • 26. ๐Ž ๐‘ฟ๐’ ๐’€ MEMS gyroscopes measure the angular rate of rotation of one or more axes V K Jadon, Prof., Mechanical Engineering, Chitkara University Gyroscope ๐’— ๐‘จ = ๐Ž ร— ๐’“ ๐‘จ ๐Ž ๐’™ ๐’› ๐’š Path of the ball as seen by an observer moving with table Path of the ball as seen from fixed frame ๐’— ๐‘ช ๐’™ ๐’› ๐’š Position of ball after some time โˆ†๐‘ก ๐’— ๐‘ฉ ๐‘ฉ ๐‘ฉ Point B after timeโˆ†๐‘ก ๐’— ๐‘จ ๐’— ๐’ƒ๐’‚๐’๐’
  • 27. Ball has two velocities V K Jadon, Prof., Mechanical Engineering, Chitkara University Gyroscope ๐’— ๐‘จ = ๐Ž ร— ๐’“ ๐‘จ ๐’— ๐’ƒ๐’‚๐’๐’ ๐Ž ๐’™ ๐’› ๐’š ๐Ž ๐’— ๐’ƒ๐’‚๐’๐’ MEMS gyroscopes use vibrating mechanical elements (proof-mass) to sense rotation caused by Coriolis acceleration.
  • 28. The ADC sample rate is programmable from 8,000 samples per second, down to 3.9 samples per second, and user-selectable low-pass filters enable a wide range of cut-off frequencies. Three-Axis MEMS Gyroscope with 16-bit ADCs and Signal Conditioning Gyroscope Setup-MPU6050 V K Jadon, Prof., Mechanical Engineering, Chitkara University 28 The MPU-60X0 consists of three independent vibratory MEMS rate gyroscopes, which detect rotation about the X-, Y-, and Z- Axes. When the gyros are rotated about any of the sense axes, the Coriolis Effect causes a vibration that is detected by a capacitive pickoff. The signal is amplified, demodulated, and filtered to produce a voltage that is proportional to the angular rate. This voltage is digitized using individual on-chip 16-bit Analog-to- Digital Converters (ADCs) to sample each axis. The full-scale range of the gyro sensors may be digitally programmed to ยฑ250, ยฑ500, ยฑ1000, or ยฑ2000 degrees per second (dps).
  • 29. ๐‘Ÿ๐‘๐‘š = ๐‘Ÿ๐‘Ž๐‘›๐‘”๐‘’(ยฐ/๐‘ ) 360 ร— 60 Range Condition ๐’…๐’†๐’•๐’†๐’„๐’•๐’‚๐’ƒ๐’๐’† ๐’“๐’‘๐’Ž Register Bit ยฑ250 0 41.67 0x00000000 ยฑ500 1 83.33 0x00001000 ยฑ1000 2 166.7 0x00010000 ยฑ2000 3 333.3 0x00011000 Gyroscope Setup V K Jadon, Prof., Mechanical Engineering, Chitkara University 29
  • 30. V K Jadon, Prof., Mechanical Engineering, Chitkara University For a FS_SEL =1 LSB Sensitivity = 65.5 Register Bit = 0x00001000 ๐œ”(๐‘ฆ๐‘Ž๐‘ค ๐‘Ÿ๐‘œ๐‘ก๐‘Ž๐‘ก๐‘–๐‘œ๐‘›) = 1 0 ๐‘  ๐‘”๐‘ฆ๐‘Ÿ๐‘œ ๐‘ง = 65.5 ๐œ”(๐‘ฆ๐‘Ž๐‘ค ๐‘Ÿ๐‘œ๐‘ก๐‘Ž๐‘ก๐‘–๐‘œ๐‘›) = 5 0 ๐‘  ๐‘”๐‘ฆ๐‘Ÿ๐‘œ ๐‘ง = 327.5 At any particular time To convert Gyro values into instantaneous angular rate ๐‘–๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก๐‘Ž๐‘›๐‘’๐‘œ๐‘ข๐‘  ๐‘Ž๐‘›๐‘”๐‘ข๐‘™๐‘Ž๐‘Ÿ ๐‘Ÿ๐‘Ž๐‘ก๐‘’ = ๐‘”๐‘ฆ๐‘Ÿ๐‘œ ๐‘ฅ,๐‘ฆ,๐‘ง ๐ฟ๐‘†๐ต ๐‘†๐‘’๐‘›๐‘ ๐‘–๐‘ก๐‘–๐‘ฃ๐‘–๐‘ก๐‘ฆ = 327.5 65.5 = 5 0 ๐‘  To measure total angle travelled add all instantaneous angles obtained for small time duration, โˆ†๐‘ก ๐œ” = ๐‘‘๐œƒ ๐‘‘๐‘ก ๐‘‘๐œƒ = ๐œ”๐‘‘๐‘ก ๐œƒ = ๐‘ก1 ๐‘ก2 ๐œ”๐‘‘๐‘ก Gyroscope Data
  • 31. V K Jadon, Prof., Mechanical Engineering, Chitkara University ๐œƒ = ๐‘ก1 ๐‘ก2 ๐œ”๐‘‘๐‘ก ๐œ” ๐‘ก ๐œ” ๐‘ก โˆ†๐‘’ Drift error Drift error is gradual divergence between the true orientation and estimated orientation by gyro due to error in measurement. ๐‘’ ๐‘ก Use other sensors to bring down the drift error to zero. Take angles with reference to world frame. Gradually apply corrections. โ€ข These correction are to be fast enough to fully compensate the drift error. โ€ข Slow enough to avoid jerky compensations Tilt Error or (roll and pitch angle error) Yaw Error Linear accelerometer Magnetometer The noise part is also integrated
  • 32. V K Jadon, Prof., Mechanical Engineering, Chitkara University gyro_pitch_angle=gyro_pitch_angle+ gyro_roll_angle * sin(gyro_z) gyro_roll_angle=gyro_roll_angle- gyro_pitch_angle * sin(gyro_z) Transfer of Yaw angles
  • 33. V K Jadon, Prof., Mechanical Engineering, Chitkara University The gyroscope drift is mainly due to the integration of two components: a slow changing, near-dc variable called bias instability and a higher frequency noise variable called angular random walk (ARW). The yaw axis is most sensitive to this drift. A good portion of the pitch (attitude) and roll axis gyroscope drift can be removed within an IMU through the use of accelerometer feedback to monitor position relative to gravity. Ideally, two references are needed to correct for gyroscope drift on all axes. An IMU with nine degrees of freedom typically provides additional magnetometer sensors - about 3 axes. A magnetometer senses field strength relative to the Earthโ€™s magnetic North. These sensors can be used together with accelerometer data, as another external reference, to mitigate the impact of gyroscope drift error on the yaw axis.
  • 34. V K Jadon, Prof., Mechanical Engineering, Chitkara University However, design of proper spatial magnetometers can be a less reliable vector than an accelerometer, as there are many things that create magnetic fields within the same order of magnitude as that of the Earth. Another one of the more effective methods for cancelling long-term drift is to implement a zero angular velocity update to the gyroscope. Any time the device is known to be completely stationary, the gyroscope offset can be nulled to zero for that respective axis. This opportunity can vary wildly depending on the application. But any instance that the system is at a recurring resting state can be used for nulling, such as an idling car, a stationary autonomous robot, or the time between human foot steps. Of course, using a state-of-the-art IMU that has minimal bias instability within the design at the onset may offer the most immediate impact on gyroscope drift. The constant bias error of a gyroscope can be measured by taking the average of the output over a long period of time while the device is not rotating.
  • 35. Thanks V K Jadon, Prof., Mechanical Engineering, Chitkara University 35