标定Voffset,说起来也不复杂:
就是器件放置在某一环境温度下(比如室温),经过一段时间达到热平衡后,
记录室温T0 和 AD的读出值ADvalue0,注意 T0 的单位是K, T0(K) = T0(C) + 273.15
则有
Vsensor0 = Vref * (ADvalue0 - 32768) / 65535
T0 = (Vsensor0 - Voffset) / (1.32mV / K)
==>
Voffset = Vsensor0 - T0 * 1.32
在实际的计算中,并不需要求出 Voffset,
因为测温时,通过 T0 和 Vsensor0 就可以得到结果了
T = (Vsensor - Voffset) / TempCo = (Vsensor - Vsensor0 + T0 * TempCo) / TempCo = (Vsensor - Vsensor0) / TempCo + T0
其中 TempCo 为温度系数,精度要求不高时取典型值1.32即可。
以下是对温度系数TempCo的分析:
假设在温度 T0 经过标定得到 Vsensor0,即有
T = (Vsensor - Vsensor0) / TempCo + T0
由TempCo的误差(dTempCo)产生的测温误差(dT)为
dT = - dTempCo * (Vsensor - Vsensor0) / (TempCo * TempCo) = - (dTempCo / TempCo) * (T - T0)
==>
dT / (T - T0) = - dTempCo / TempCo
可以看出相对测温误差和温度系数相对偏差成正比。
比如,某种应用,需要MCU工作在 5 ~ 45C 之间, Voffset 在 23C 经过标定,即 T0 = 23C
当 1.18 < TempCo < 1.46 即 TempCo = 1.32 +- 0.14 时,
dT / (T - T0) = - dTempCo / TempCo = +-0.14 / 1.32 = +-10.6 %
将会产生最大 +-10.6% 的相对测温误差
在5C时, 测温误差 dT = +-10.6% * (5-23) = +-1.9C 在20C时,测温误差 dT = +-10.6% * (20-23) = +- 0.32C 在23C时,测温误差 dT = +-10.6% * (23-23) = +- 0C 在25C时,测温误差 dT = +-10.6% * (25-23) = +- 0.21C 在45C时,测温误差 dT = +-10.6% * (45-23) = +- 2.3C
如果上述误差是允许的,则不需要标定TempCo,否则就要标定。
标定TempCo,需要选择两个温度点 T0, T1,
TempCo = (Vsensor1 - Vsensor0) / (T1 - T0)
|