Infineon One Point Calibration Library  1.0.1
Infineon One Point Calibration Library
Version
1.0.1

Introduction

This library is intended to help out hardware and software engineers, system integrators and developers with the process of calibrating analog angle sensors. An analog angle sensor does not provide any angle value, only analog sine and cosine (positive and negative) output signals. The angle has to be calculated externally.

Analog angle sensors have to be calibrated before they are used in order to achieve the specified angle accuracy. This calibration process includes a compensation of offset, amplitude and non-orthogonality of the output channels in use with the help of an external microcontroller. Calibration can be done in a one time fashion at the start-up of the system for example, or in a continuous matter (dynamic calibration). This library and the examples given talk about the one-time calibration however the functions could be easily extended to support continuous calibration.

Attention
Infineon Technologies AG (INFINEON) is supplying this file for use exclusively with Infineon's products. This file can be freely distributed within development tools and software supporting such microcontroller products.
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, ASPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
Warning
It is in the responsibility of the system integrator to insure that:
  • the magnet is large enough to ensure that the non-homogeneity of the magnetic field in the sensing area is negligible.
  • the mechanical tolerances of the sensor-magnet assembly are minimal.
  • the output amplitude together with the resolution of the ADC in use matches the requirement in angle accuracy.
See also
https://www.infineon.com/dgdl/Infineon-TLE5xxx(D)_Calibration_360_AN-v02_00-AN-v02_00-EN.pdf?fileId=5546d46264a8de7e0164f09d8bfa228d

Usage

Note
This library assumes that you have connected the analog angle sensor to an ADC and you can easily get the SINP, COSP, SINN, COSN digitized values.

The one time calibration process requires you to:

If your application is subjected to temperature variations you should perform dynamic/continuous calibration as the one time calibration can help reduce only the temperature independent offset.

Note
Because the calibration process is quite intensive computationally the system integrator should use either a microcontroller with an FPU or a dedicated math coprocessor/hardware CORDIC.

Example

dot_inline_dotgraph_1.png

Code Example 1:

CALIB_DATA_t calibration_store_params;
float64_t angle_read = 0;
uint32_t sinP_in_LSB = 0;
uint32_t cosP_in_LSB = 0;
uint32_t sinN_in_LSB = 0;
uint32_t cosN_in_LSB = 0;
int main(void)
{
ONECALIB_InitCalibData(&calibration_store_params);
while(1U)
{
//------------------- CALIBRATION FOR CW DIRECTION -------------------------------
while (!calibration_store_params.rotation_data_CW.calibration_done) {
// read sensor data
// AnalogRead(ch) is a user defined function to read the analog voltage on P and N channels
sinP_in_LSB = AnalogRead(ch0);
cosP_in_LSB = AnalogRead(ch1);
sinN_in_LSB = AnalogRead(ch2);
cosN_in_LSB = AnalogRead(ch3);
ONECALIB_InitSensorData(sinP_in_LSB, cosP_in_LSB, sinN_in_LSB, cosN_in_LSB);
ONECALIB_CalibrationFindParam(&calibration_store_params, true, false);
}
//------------------- CALIBRATION FOR CCW DIRECTION -------------------------------
while (!calibration_store_params.rotation_data_CCW.calibration_done) {
// read sensor data
// AnalogRead(ch) is a user defined function to read the analog voltage on P and N channels
sinP_in_LSB = AnalogRead(ch0);
cosP_in_LSB = AnalogRead(ch1);
sinN_in_LSB = AnalogRead(ch2);
cosN_in_LSB = AnalogRead(ch3);
ONECALIB_InitSensorData(sinP_in_LSB, cosP_in_LSB, sinN_in_LSB, cosN_in_LSB);
ONECALIB_CalibrationFindParam(&calibration_store_params, false, true);
}
//------------------- GET CALIBRATED ANGLE DATA ----------------------------------
if (calibration_store_params.full_calibration_performed) {
angle_read = ONECALIB_GetCalibAngle(&calibration_store_params);
}
// or angle_read = ONECALIB_GetAngle();
// Returns the calibrated or uncalibrated angle in degrees.
}
}

Example 2

dot_inline_dotgraph_2.png

Code Example 2:

CALIB_DATA_t calibration_store_params;
float64_t differential_uncalibrated_angle_read = 0;
uint32_t sinP_in_LSB = 0;
uint32_t cosP_in_LSB = 0;
uint32_t sinN_in_LSB = 0;
uint32_t cosN_in_LSB = 0;
int main(void)
{
ONECALIB_InitCalibData(&calibration_store_params);
while(1U)
{
// read sensor data
// AnalogRead(ch) is a user defined function to read the analog voltage on P and N channels
sinP_in_LSB = AnalogRead(ch0);
cosP_in_LSB = AnalogRead(ch1);
sinN_in_LSB = AnalogRead(ch2);
cosN_in_LSB = AnalogRead(ch3);
ONECALIB_InitSensorData(sinP_in_LSB, cosP_in_LSB, sinN_in_LSB, cosN_in_LSB);
differential_uncalibrated_angle_read = ONECALIB_GetAngle();
}
}

Other considerations

See also
https://www.infineon.com/dgdl/Infineon-TLE5xxx(D)_Calibration_360_AN-v02_00-AN-v02_00-EN.pdf?fileId=5546d46264a8de7e0164f09d8bfa228d