TLE5012B
Interfaces
User’s Manual
43
Rev. 1.2, 2018-02
5.2.5
Angle Calculation with X-raw and Y-raw values
The TLE5012B’s COordinate Rotation DIgital Computer (CORDIC) contains the trigonometric function for angle
calculation. The angle value can be accessed reading the ANG_VAL register.
For safety checks and other purposes, it is also possible to calculate the angle value in a microcontroller by reading
the X-raw and Y-raw values from the TLE5012B. The raw values have to be compensated by either calculating
the offset, amplitude and phase parameters or by reading the registers which contain the pre-calibrated values.
The second case is recommended in cases where either the application does not turn full rotations (to calculate
the compensation parameters the whole sine and cosine signals are required) or it rotates at high speeds (enough
data has to be read to ensure that the maximum and minimum values of the sine and cosine are read).
5.2.5.1
Angle Calculation using pre-calibrated compensation values
For the angle calculation using pre-calibrated compensation values the following values have to be read from the
registers:
•
X-raw value (ADC_X register, address 10
H
)
•
Y-raw value (ADC_Y register, address 11
H
)
•
T-raw value (T_RAW register, address 15
H
)
•
T25O value (T25O register, address 30
H
)
•
TCO_X_T value (MOD_4 register, address 0E
H
)
•
TCO_Y_T value (TCO_Y register, address 0F
H
)
•
X_OFFSET value (Offset X register, address 0A
H
)
•
Y_OFFSET value (Offset Y register, address 0B
H
)
•
SYNCH value (SYNCH register, address 0C
H
)
•
ORTHO value (IFAB register, address 0D
H
)
•
ANG_BASE value (MOD_3 register, address 09
H
)
The values T25O, TCO_X_T, TCO_Y_T, X_OFFSET, Y_OFFSET, SYNCH, ORTHO and ANG_BASE are values
specific for each device and constant (if autocalibration disabled). Therefore these values are required to be read
only once and saved to the microcontroller for re-use.
Refer to
for the description of the listed registers. These values have to be read with autocalibration
disabled.
X-raw and Y-raw values compensation
To increase the accuracy, the temperature-dependent offset drift can be compensated. The offset values O
X
and
O
Y
can be described by
(5.1)
T25O is a 7 bit register that has to be subtracted from the 10 bit T_RAW register. No shifts are required in this
operation, since the higher order bits of the T_RAW register are used to represent a wider range of values and not
a different resolution.
TCO_X_T and TCO_Y_T have 7 bits only and are multiplied with a 10 bit value. Therefore the result of the
multiplication has to be limited to the 10 MSBs (arithmetic shift by 7, if supported by compiler/architecture or signed
division by 128). In the last step of
, the 10 bit value for the temperature-dependent offset has to be
added to the 12 bit X_OFFSET and Y_OFFSET.
(
)
(
)
439
25
_
*
_
_
_
439
25
_
*
_
_
_
−
−
+
=
−
−
+
=
O
T
RAW
T
T
Y
TCO
OFFSET
Y
O
O
T
RAW
T
T
X
TCO
OFFSET
X
O
Y
X