Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

finding out angle from a mems gyroscope

Status
Not open for further replies.

Disha Karnataki

Full Member level 5
Joined
Jul 20, 2013
Messages
249
Helped
9
Reputation
18
Reaction score
8
Trophy points
18
Location
india
Activity points
2,231
i just want to clarify whether the way i measure the angle is correct or not so that i can later write a code on it.
the gyro sensor i have uses i2c protocol and has a 16bit adc built in it requiers a supply voltage of about 3.3v.
sensitivity of that gyro=172mV/deg/sec
hence the reference voltage of the adc i will consider as 3.3v (am i right?).
the angular velocity value that gyro will output will be 16bit(due to adc which is 16bit) 65535 is max value that adc can o/p
calculations:
say value outputted is 6000 for some some rotation about say z axis then,
the angle made will be:
3.3v ref of adc-------65536
? -------6000
the voltage that refers to the digital number outputted by the gyro is:0.30212v(after above calculations).
converting this voltage into degrees/sec:
172mv(sensitivity of gyro)-------1deg/sec
.30212v-----------------------------?
1.7565deg
hence the angle made by the gyro with z axis is:1.7565deg.
is this calculation correct?
 

No.

1) The gyro output is degrees per second (angular velocity); if you want degrees(angle) you need to integrate the gyro output.

2) There is no way you can assume the reference voltage for your ADC is 3.3V unless it says so in the spec. It could be 1.25; it could be 2.5. Read the data sheet.

But you confuse us: if the sensor has a built in ADC, why do you even CARE what the reference voltage is? The output is a digital value, and if you read the spec it should tell you what the scaling is.
 

full scale range is given as: ±250°/s, ±500°/s, or ±2000°/s.
 
Last edited:

as full scale range given in datasheets is ±250°/s, ±500°/s, or ±2000°/s.
& the gyro outputted value is a digital one then how do i find the angle? I know gyro instantaneous value is the change in angular velocity But, say sampling frequency=100hz so every 10ms the gyro data is sampled and a digital value is outputted for that 10ms this angle will be calculated and then added with the previous one.
now as the gyro gives out a 16 bit value digital & say i select ±250°/s , 10ms as it's sampling time period and i take 100 such readings to get to total digital o/p for 1s let the value got after integration be 6000. How do i relate the digital value with the range?
is it like this?: for 250 deg/sec change the digital value outputted by adc is 65535
so, how much is the degree in 1sec for----------------------if adc value for 6000
angle=22.888deg/sec. Is this correct? otherwise rectify me.
then the above procedure is repeated and the new value added with previous to get new angle.
 
Last edited:

Assuming that the angular velocity changes linearly between samples, and that's a BIG assumption, all you have to do is calculate:

w(0)*.01 +w(1)*.01+...w(99)*.01.=Angle, where "w" is angular velocity.

The above assumes your example of 100 samples, .01 seconds apart.
 

Assuming that the angular velocity changes linearly between samples, and that's a BIG assumption,
ok then how would you calculate, say scale range is selected as: ±250°/s and let us assume some digital value outputted how will you convert that instantaneous change in digital value into degrees?.
 

You CAN NOT convert instantaneous angular velocity to angle. You need to read a physics book.

Your question is like: "I'm driving 100 Km/Hr in my car. Where am I?"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top