## How to get tilt Angle - what is 1G?

Supporting Visual Studio on Windows
ozkhan

### How to get tilt Angle - what is 1G?

I'm trying to calculate the angle based on the readings given by the accelorometer, using the example from the documentation:

arcsin (0.7071G/1G)

Can someone tell me how I work out 1G

I know 1G stands for gravity in motion, but where do I get the figure from.

I'm getting my pitch from axis(0) and bank angle from axis(2), do I use axis(1) to get 1G???

Patrick
Posts: 3141
Joined: Mon Jun 20, 2005 8:46 am
Contact:

### Re: How to get tilt Angle - what is 1G?

1G is just 1. 0.7071G is just an example value that represents 45 degrees. You just want to do arcsin(x), arcsin(y) - unless you are trying to calculate tilt angles where gravity does not equal 1G (ie in space, etc.)

-Patrick

ozkhan

### Re: How to get tilt Angle - what is 1G?

Hi Patrick,

Thanks for the response.

I was quoting the example given in the documentation for the accelorometer when I put:

arcsin (0.7071G/1G)

The documentation, and many other sites on the web say that arcsin(x/1G) is how you get the Tilt angle.

I've poured over the documentation, and confirmed that based on the positioning of the accelorometer, axis 1 should provide the 1G value.

However, if I calculate the tilt angle using this formula, or using your formula, the value is still inconsistent.

For example, tilting the accelorometer on the x axis, the x value will change to 0.05, then to 0.06 then back to 0.05 when you would expect it to continue onto 0.07.

I've tried just putting the raw data into the display field with sensitivity set to 0.01, and it cycle's through a whole lot of numbers before stopping on one.

I might have to switch to just keeping track of the position of the stepper motors, or buy a dedicated tilt sensor.

Why does the thought "It shouldn't be this hard?" keep popping into my mind?

All the best,

James

Patrick
Posts: 3141
Joined: Mon Jun 20, 2005 8:46 am
Contact:

### Re: How to get tilt Angle - what is 1G?

Make sure that you're measuring tilt along the same axis of sensitivity as the acceleration output. Also - could you be picking up data from static vibrations? -you mentioned stepper motors.

-Patrick