
TLE5012B
Interfaces
User’s Manual
44
Rev. 1.2, 2018-02
After the X and Y values are read out, the temperature-corrected offset value must be subtracted:
(5.2)
X_RAW and Y_RAW are 16 bit values at which a 12 bit value is subtracted. Offsets are in the 12 bit range since
the values are smaller than the whole X_RAW and Y_RAW range.
Next, the Y value is normalized with the amplitude synchronicity:
(5.3)
While Y
1
is a 16 bit absolute value, SYNCH is a 12 bit relative factor (amplitude synchronicity is a relative correction
between the amplitude of the X-raw and Y-raw values). To convert SYNCH to absolute factor a normalized one
has to be added, this corresponds to add a value of 16,384 (2^14). After the multiplication Y
2
will be a 28 bit value
(16 bit from Y
1
and 14 bit from the SYNCH absolute factor which includes the added one), therefore it has to be
shifted to have the 16 MSBs only (arithmetic shift by 14, if supported by compiler/architecture or signed division
by 16384).
The influence of the non-orthogonality can be compensated using the following equation, in which only the Y value
must be corrected:
(5.4)
As described in the IFAB register (address 0D
H
), the ORTHO bits represent a value between -11.2500° and
11.2445° with a 12 bit resolution. Y
3
should finally be limited to 16 bits.
Angle calculation
After correction of all errors, the resulting angle can be calculated using the arctan function and subtracting the
angle base as shown in
:
(5.5)
To correctly resolve the arctan function in 360°, the microcontroller should implement the function
arctan2(Y
3
/X
3
)
.
ANG_BASE is a 12 bit register.
Small deltas from the ANG_VAL register may depend on the speed of application.
shows the flow chart of angle calculation from the X-raw and Y-raw values as described above.
Y
X
O
RAW
Y
Y
O
RAW
X
X
−
=
−
=
_
_
1
1
SYNCH
Y
Y
X
X
*
1
2
1
2
=
=
)
cos(
)
sin(
*
2
2
3
2
3
ORTHO
ORTHO
X
Y
Y
X
X
−
−
−
=
=
BASE
ANG
X
Y
_
arctan
3
3
−
⎟⎟
⎠
⎞
⎜⎜
⎝
⎛
=
α