signed int Modify_55Degree_Bom[4] = {0,0,0,0};
signed int Modify_72Degree_Bom[4] = {0,0,0,0};
signed int Modify_95Degree_Bom[4] = {0,0,0,0};
/****************************************************************************
* 名称:Modify_Temp(signed int mod_temp,UCHAR mod_Channel)
* 功能:模块修正值计算
* 调用者:TX_Temp_Control_Entry
* 调用:
* 入口参数:signed int mod_temp,修正温度
* UCHAR mod_Channel 修正通道
* 出口参数:signed int 修正后温度
****************************************************************************/
signed int Modify_Temp(signed int mod_temp,UCHAR mod_Channel)
{
static int Cal_Temp,temp;
static UCHAR Channel;
temp = mod_temp;
Channel = mod_Channel;
if (mod_temp>5500 && mod_temp<=7200)
{
Cal_Temp = temp+Modify_55Degree_Bom[Channel]+(temp-5500)*(Modify_72Degree_Bom[Channel]-Modify_55Degree_Bom[Channel])/1700;
}
else if (mod_temp>7200)
{
Cal_Temp = temp+Modify_72Degree_Bom[Channel]+(temp-7200)*(Modify_95Degree_Bom[Channel]-Modify_72Degree_Bom[Channel])/2300;
}
else
{
Cal_Temp = temp+(temp-3000)*Modify_55Degree_Bom[Channel]/2500;
}
return Cal_Temp;
}
温度校准 现在怎么测试的?是不是先清零。假如说要 55℃(5500),你就设置成55℃(5500),然后测试出实际假如是56℃(5600),然后55℃(5500)的校准是 100。假如测出来是54℃(5400),校准值就是-100。
温度校准表通过外部命令比如串口等传输进来,校准表是偏差温度:Modify_55Degree_Bom= 测试的实际温度-标准温度。
比如说:
测量温度(mod_temp) | 实际温度(cal_temp) | 温度偏差(Modify_Bom) |
---|---|---|
55℃ | 56℃ | +1摄氏度 |
75℃ | 78℃ | +3摄氏度 |
那么求65℃的实际温度?
cal_temp=65℃+1℃+(65-55)*(3-1)/20
=65℃+1℃+1℃
=67℃
更为直观的类似如下: