Calculation in the controller

Configuration

1. Set the parameter 8080:11hex "Range" to the value "+-2G".
Explanation: this is the measuring range with the highest resolution.
Calculation in the controller 1:
2. Set the parameter 8080:1Dhex to the value "Raw Values".
Calculation in the controller 2:

Evaluation

You can calculate the angles of inclination using the following formulas:

 

Calculation in the controller 3:

θ: angle of inclination around the y-axis

ax, ay, az: measured acceleration values

tan-1: arc tangent

 

Calculation in the controller 4:

Ѱ: angle of inclination around the x-axis

ax, ay, az: measured acceleration values

tan-1: arc tangent

The chapter "Example" shows an example for the implementation of these formulas in TwinCAT.