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. - 2. Set the parameter 8080:1Dhex to the value "Raw Values".
Evaluation
You can calculate the angles of inclination using the following formulas:
| θ: angle of inclination around the y-axis ax, ay, az: measured acceleration values tan-1: arc tangent |
| Ѱ: 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.
- In the program code, make sure that the denominator never becomes zero.
- Use a software filter for smoothing the calculated angles of inclination. See chapter: Smoothing of measured values.
Further Information