A1340, A1341, and A1343 Sensor Temperature Compensation
A1340, A1341, and A1343 Sensor Temperature Compensation
By Nevenka Kozomora and Jesse Lapomardo,
Allegro MicroSystems, LLC
Introduction
Sensor output can change over temperature due to sensor imperfections or temperature-dependent properties of the magnetic system. The purpose of applying temperature compensation inside the sensor is to keep the sensor output value independent of the temperature and only dependent on the input magnetic field strength.
Implementation
Allegro sensors allow the customer to change how the sensor responds to temperature deviations through the use of sensor temperature compensation coefficients. These coefficients are part of the sensor temperature algorithm implemented in the Temperature Compensation Block shown in Figure 1.
The transfer function of the temperature compensation block is given as the following equation:
VOUT(V) = SENS(ΔTA) × VIN(V) + OFFSET(ΔTA)(1)
where TAis ambient temperature, and ΔTA= TA– 25°C.
TheSensitivity Temperature Compensation,标记为SENS(ΔTA),用于控制温度对传感器施加在输入磁场上的增益的影响信号。信号灵敏度温度补偿描述为二阶多项式函数:
SENS(ΔTA) =
[TC1_SENS (m%/°C) × ΔTA(摄氏度)+
TC2_SENS (m%/°C2) × (ΔTA)2(°C)+1](2)
where SENS(ΔTA) at some temperature T is actually calculated as:
(SENS at 25°C) / (Recorded SENS @ T°C)(3)
The user-programmable parameters are described in the following table:
Table 1: Input Variables of Sensitivity CompensationParameter | Definition | Unit |
TC1_SENS | First-order gain temperature coefficient. Coefficient applied to the first order term of the sensitivity change over temperature. |
米%/°C |
TC2_SENS | Second-order gain temperature coefficient. Coefficient applied to the second order term of the sensitivity change over temperature. |
米%/°C2 |
应用补偿系数TC1_SENS和TC2_SENS(如计算)将导致应用于传感器输入信号的与温度无关的增益。必须记住,这些参数有两组,一组用于补偿25℃以下的温度,另一组用于补偿25℃以上的温度。
TheOffset Temperature Compensation, labeled as OFFSET(ΔTA), is used to change the temperature behavior of the offset that the sensor applies on the input magnetic signal. The equation for OFFSET(ΔTA) is described as a linear first-order function:
OFFSET(ΔTA) =
TC1\U偏移(mG/°C)× ΔTA(摄氏度)×
DIV_SENS_COARSE (mV/G)(4)
where OFFSET(ΔTA) at some temperature T is actually calculated as:
OFFSET(ΔTA) = (OFFSET @ 25°C) –
(Recorded OFFSET @ T°C)(5)
Applying the coefficient TC1_OFFSET as calculated would result in temperature-independent offset behavior.
In the case of the A1343 device, parameter DIV_SENS_COARSE is not applicable since the temperature compensation algorithm is not accounting for this parameter.
Table 2: Input Variables of Offset Compensation
Parameter | Definition | Unit |
TC1\U偏移 | First-order offset temperature coefficient. Coefficient applied to the first-order term of the offset change over temperature. | mG/°C |
DIV_SENS_COARSE | 不同磁区的偏移补偿系数。它分别随磁场的变化而变化。对于±500 G的值,它等于1。例如,如果场范围更改为±300 G,则系数值将为3/5。 | mV/G |
Calculating Sensitivity Compensation
Allegro sensors are often used with permanent magnets of unknown field strength at the specific operating positions. Therefore exact calculation of the system Sensitivity per gauss is impossible. However, Sensitivity can be calculated with respect to device position.
在下面的示例中,用户在移动范围的两个不同点收集设备输出。位置1为–10度,位置2为+10度。
Table 3: Example of Device Output
温度 (摄氏度) |
Sensor with Analog Output | Sensor with PWM Output | Sensor with SENT Output | |||
Sensor Output @ Position 1 (V) |
Sensor Output @ Position 2 (V) |
Sensor Output @ Position 1 (%D) |
Sensor Output @ Position 2 (%D) |
Sensor Output @ Position 1 (LSB) |
Sensor Output @ Position 2 (LSB) |
|
–40 | 0.354 | 4.548 | 8 | 91.9 | 139 | 3955 |
–20 | 0.394 | 4.532 | 8.6 | 91.3 | 165 | 3929 |
0 | 0.435 | 4.514 | 9.2 | 90.8 | 191 | 3902 |
25 | 0.500 | 4.501 | 10 | 90 | 227 | 3867 |
50 | 0.546 | 4.481 | 10.7 | 89.4 | 257 | 3837 |
75 | 0.614 | 4.459 | 11.6 | 88.5 | 298 | 3796 |
100 | 0.693 | 4.427 | 12.7 | 87.4 | 349 | 3746 |
125 | 0.790 | 4.393 | 14.1 | 86.1 | 408 | 3686 |
150 | 0.883 | 4.342 | 15.5 | 84.7 | 474 | 3621 |
整个温度范围内的灵敏度可计算为:
SENS = (VOUT@位置2–VOUT@ Position 1)
/ (Position 2 – Position 1)(6)
Table 4
温度 (摄氏度) |
Sensitivity (V/°C) |
Sensitivity (%D/°C) |
Sensitivity (最低有效温度/°C) |
–40 |
0.210 | 4.19 | 190.78 |
– 20 | 0.207 | 4.14 | 188.23 |
0 | 0.204 | 4.08 | 185.55 |
25 | 0.200 | 4 | 182.00 |
50 | 0.197 | 3.93 | 179.00 |
75 | 0.192 | 3.84 | 174.90 |
100 | 0.187 | 3.73 | 169.85 |
125 | 0.180 | 3.60 | 163.90 |
150 | 0.173 | 3.46 | 157.35 |
In order to calculate the compensation function SENS(ΔTA) versus ΔTAvalues, apply equation 3 on the recorded data in Table 4. The equation effectively performs an inverted normalization with respect to 25°C. The resulting data is presented in the table below (note that the temperature values now appear as ΔTAvalues, representing deviation from 25°C):
Table 5: Normalized Inverse Sensitivity vs. Temperature
ΔTA (摄氏度) |
归一化逆 Sensitivity |
|
(cold) | –65 | 0.954 |
–45 | 0.967 | |
–25 | 0.981 | |
0 | 1.000 | |
(热的) | 25 | 1.017 |
50 | 1.041 |
|
75 | 1.072 | |
100 | 1.110 | |
125 | 1.157 |
The graphical representation of Table 5 is given in Figure 3:
Since Allegro sensors have different temperature coefficient codes for compensation at hot and cold temperatures, the above curve is divided into two regions. The hot region, from ΔTAof 0°C and above, is described with the following equation: SENS(ΔTA) = 1.408E-06x2+ 7.994E-04x + 1.000. The cold region, below ΔTAof 0°C on the x-axis, is governed by the equation: SENS(ΔTA) = 5.941E-06x2+ 5.094E-04x + 1.000.
可编程系数现在可以从上述方程计算出来。请注意,要转换为m%,应引入系数105。
Table 6: Calculated Temperature Compensation Coefficients
Coefficients Hot |
Value | Coefficients Cold |
Value |
TC1_SENS_HOT (m%/°C) |
79.94 | TC1传感器CLD (m%/°C) |
50.94 |
TC2_SENS_HOT (m%/°C2) |
0.1408 | TC2_SENS_CLD (m%/°C2) |
0.5941 |
Programming Sensitivity Coefficients
Calculated values for the temperature adjustment can be entered in the software directly under the “Value” column, or the user can calculate the code manually and enter it under the “Code” column.
If the user enters the desired coefficient under the “Value” column, then the software will round the actual number to the closest discrete value offered in the device. For example, TC2_SENS_CLD is calculated as 0.5941 m%/°C2, but the program rounded to the 0.593 m%/°C2. The software automatically calculates the code based on the TC2_SENS_CLD value, the step size of that register, and also the transfer function between the value and the code.
In the case that the user would like to calculate the necessary codes, the table below, extracted from the datasheet, can be used as a guideline. The needed value of 0.5941 m%/°C2 would be divided by 0.00596 m%/°C2,得到所需的代码99。
Calculating Offset Compensation
In the application, linear sensors often see a magnetic field in all positions or often the customer cannot determine in which position the field will be equal to 0. However, reading the device output in two application positions can help to determine the needed sensitivity of the sensor which then helps to calculate the offset as: (VOUT @ Position 2 – Position 2 × Sensitivity). This is shown in Table 7 below:
Table 7: Voltage Offset Over Temperature
温度 (摄氏度) |
Offset (V) |
Offset (%) |
Offset (LSB) |
–40 |
2.45 | 49.95 | 2047 |
–20 | 2.46 | 49.96 | 2047 |
0 | 2.47 | 49.97 | 2047 |
25 | 2.5 | 50.00 | 2047 |
50 | 2.51 | 50.01 | 2047 |
75 | 2.53 | 50.04 | 2047 |
100 | 2.56 | 50.06 | 2047 |
125 | 2.6 | 50.09 | 2047 |
150 | 2.61 | 50.11 | 2047 |
Once the offset at each temperature is obtained, the correction curve is calculated using equation 5.
从图7可以看出,温度偏移量可以计算为
OFFSET(ΔTA) = –0.0009 × ΔTA+ 0.0004.
The recorded behavior is in mV/°C and represents the formula:
OFFSET(ΔTA) = TC1_OFFSET (mG/°C) × ΔTA(摄氏度)
× DIV_SENS_COARSE (mV/G).
0.0004是接近于零的常数项,所以我t can be ignored. The function gain of 0.0009 is the product of TC1_OFFSET (mG/°C) × DIV_SENS_COARSE (mV/G), so it is necessary to divide the gain number with DIV_SENS_COARSE (mV/G), which depends on the chosen magnetic coarse range. If the chosen range were 250 G, then the parameter DIV_SENS_COARSE (mV/G) has value of 0.5.
Table 8: Offset Coefficient Value
Offset Coefficient | Value |
TC1\U偏移(mG/°C) for +/-250 G range | 0.0009 / 0.5 = –0.002 |
Programming Sensitivity Coefficients
Calculated values for the temperature adjustment can be entered in the software directly under the “Value” column, or the user can calculate the code manually and enter it under the “Code” column.
In the case that the user would like to calculate the necessary codes, the table below, extracted from the datasheet, can be used as a guideline