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.

[SOLVED] L3G4200D Gyroscope _ Measuring Angle!?

Status
Not open for further replies.

Jigar 4 Electronics

Full Member level 5
Full Member level 5
Joined
Apr 28, 2011
Messages
312
Helped
40
Reputation
82
Reaction score
38
Trophy points
1,318
Location
Hamilton, ON, Canada
www.facebook.com
Activity points
3,368
Hello All,

I am making an IMU for 6DOF which has L3G4200D 3-Axis Digital Gyroscope.

I've checked so many Blogs, Forums, Application notes and have programmed accordingly to get the proper reading/information from my gyro.

Though I am very near to solve it - a single problem has made me mad since last two nights!
I've 16 bit digit - 1 signed bit + 15 bit value

Suppose I want to measure an angle with respect to X-axis at 2000 dps, for that I am doing the following:

X = X*70/1000; // X is of type int & having the 16bit value in it
Print(X); // to print X on UART

I am getting some values most probably <800 when I move gyro in counter clock direction with respect to X-axis and getting >4000 for the opposite direction!!

I want to have positive angle values while rotating it on counter clockwise direction and negative angle values for the clock wise direction... For that what I should add on my calculations?? [Angles should be in degrees 1 to 180 & (-1) to (-180)]

// in code 0.007 is in mdps which is the value of each LSB of gyro's data

What I should add in could and why I am having >4000 & <800 values right now?

Could anyone please help me with this?

Thank you so much for your valuable time.
 

I've observed(on internet) that everyone is getting +/- readings while I am not getting it.
so I've tried it with different data type...
and now I am getting +/- readings at both the side of the axis..

but still my main question is unsloved!

Can you tell me what should I do to getting the angles now???
should I take x1 at time t1 and x2 at time t2 and then :
X_angle = (x2-x1)/(t2-t1)

Am I right???
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top