Infosys在阅读器中打开 / AI 翻译

EPxxxx | Industrial housing · 0 次阅读

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.

  • 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