Example Implementation Code For Temperature Calibration - Infineon TLE4997 User Manual

Configuration and calibration of linear hall sensor
Table of Contents

Advertisement

In a second step, the error function defined in
(i)
equidistant steps T
. For the computation, a step size of 10°C or less is recommended. Then, the parameters TL,
J
TQ, and the constant C are varied until the residual ε
N
1
--- -
ε
(
ε T
(
=
rms
N
i
1
=
5.4.2

Example Implementation Code for Temperature Calibration

The following code example is done in Microsoft® Visual Basic® and can be adapted to any other programming
language.
Setup of global Variables
Precalibrated parameter set read from the sensor:
TL_pre (as stored in EEPROM)
TQ_pre (as stored in EEPROM)
TT (as stored in EEPROM)
Valid ranges are: TR_pre: 0...7; TL_pre: 0...511; TQ_pre: 0...255; TT: 0...31.
Given user values in °C and ppm:
T0 (application sensitivity polynomial reference temperature)
TC1 (application sensitivity polynomial linear temperature coefficient)
TC2 (application sensitivity polynomial quadratic temperature coefficient)
Valid ranges are: T0_user: -50...80, TC1_user: -0.001...0.0025, TC2_user: -0.000004...0.000004.
Last but not least we have the new setup values, we initialize partly:
TL (used as sweep variable, needs no initialization)
TQ (used as sweep variable, needs no initialization)
Valid ranges are: TL: 0...511; TQ: 0...255;
Sensitivity Calculation Subroutines
The first function calculates the user polynomial at a given temperature T:
Private Function S_app(ByVal T) As Double
S_app = 1 + TC1 * (T - T0) + TC2 * (T - T0) ^ 2
End Function
The next function calculates the sensor DSP behaviour after precalibration at a given temperature T:
Private Function S_dsppre(ByVal T) As Double
S_dsppre = 1 + (TL_pre - 160) * (T - 48) / 8 / 8192 +
(TQ_pre - 128) * ((T - 48) ^ 2) / 1024 / 8192 +
(TT - 64) * ((T -48) ^ 3) / 131072 / 8192
End Function
Finally, there is the calculation function for the DSP polynomial at a temperature T:
Private Function S_dsp(ByVal T) As Double
S_dsp = 1 + (TL - 160) * (T -48) / 8 / 8192 +
(TQ - 128) * ((T -48) ^ 2) / 1024 / 8192 +
(TT-64) * ((T - 48) ^ 3) / 131072 / 8192
End Function
For the algorithm we need the already explained error function:
User's Manual
2
i ( )
)
)
J
Calibration of TLE4997 Temperature Compensation
Equation (5.10)
is summed over the temperature range in finite
in
Equation (5.11)
rms
29
User's Manual
is minimized.
v01_01, 2019-08
TLE4997
(5.11)

Advertisement

Table of Contents
loading

Table of Contents