电池—应急电源之过载保护(线性插值算法——查表法)

应急电源之过载保护

数据统计

过载电流表

下面展示一些 内联代码片

const Uint16 OL_Point[22][13]=
{//稳态过载点 低 高 瞬态过载点
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//A1_SK
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//A2_SK
		{508,608,749,890,1070,1470,1547,1600,1700,1750,1800,1900,2000},//A3_SK
		{508,608,749,890,1070,1470,1547,1600,1700,1750,1800,1900,2000},//A4_SK
		{508,608,749,890,1070,1470,1547,1600,1700,1750,1800,1900,2000},//A5_SK  1块
		{863,1033,1273,1513,1819,2499,2629,2720,2890,2975,3060,3230,3400},//A6_SK  2块
		{863,1033,1273,1513,1819,2499,2629,2720,2890,2975,3060,3230,3400},//A7_SK

		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B1
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B2
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B3
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B4
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B5
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B6
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B7
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B8
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B9
		{220,260,310,350,400,450,500,550,600,740,850,900,1000},//B10

		//A机型
		{508,608,749,890,1070,1470,1547,1600,1700,1750,1800,1900,2000},//A1  1块
		{863,1033,1273,1513,1819,2499,2629,2720,2890,2975,3060,3230,3400},//A2	 2块 *2*0.85 = 1.7
		{863,1033,1273,1513,1819,2499,2629,2720,2890,2975,3060,3230,3400},//A3
};
// An highlighted block
var foo = 'bar';

过载电流对应的过载时间累计进度

下面展示一些 内联代码片

// A code block
var foo = 'bar';
const Uint16 OL_t[22][13]=
{//稳态过载点 低 高 瞬态过载点
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//A1_SK
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//A2_SK
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A3_SK
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A4_SK
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A5_SK
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A6_SK
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A7_SK

		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B1
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B2
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B3
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B4
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B5
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B6
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B7
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B8
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B9
		{100,190,540,1070,1870,2500,3000,100,125,208,250,417,517},//B10

		//A机型
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A1
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A2
		{83, 107,187,312, 625, 2500,3750,125,250,417,617,817,1000},//A3
};

线性插值算法

理论知识

在这里插入图片描述
在这里插入图片描述

线性插值代码

电流过大,采用快速(瞬态)响应 4ms

下面展示一些 内联代码片

// A code block
var foo = 'bar';
Uint8 OverLoad_Fast()//4ms
{
	Uint8 ID = Fuc->p_Y->p_Y0->machine_type.Per_value;//机型参数
	Uint16 D_I = Fuc->p_D->p_D1->bat_I_discharge.dis_value;
	//return 0;

	if(ID>20){ID = 1;}

	//基点+线性差值数   ,线性插值算法
	if(D_I>(OL_Point[ID][11]))//4.17
	{
		p_gcout->OVL_Count_ms += ( OL_t[ID][11] + ((OL_t[ID][12] -OL_t[ID][11] )*(D_I-OL_Point[ID][11]) )/(OL_Point[ID][12] - OL_Point[ID][11]) );
	}
	else if(D_I>(OL_Point[ID][10]))//2.5
	{
		p_gcout->OVL_Count_ms += ( OL_t[ID][10] + ((OL_t[ID][11] -OL_t[ID][10] )*(D_I-OL_Point[ID][10]) )/(OL_Point[ID][11] - OL_Point[ID][10]) );
	}
	else if(D_I>(OL_Point[ID][9]))//2.08
	{
		p_gcout->OVL_Count_ms += ( OL_t[ID][9] + ((OL_t[ID][10] -OL_t[ID][9] )*(D_I-OL_Point[ID][9]) )/(OL_Point[ID][10] - OL_Point[ID][9]) );
	}
	else if(D_I>(OL_Point[ID][8]))//累进速度1.250个单位
	{
		p_gcout->OVL_Count_ms += ( OL_t[ID][8] + ((OL_t[ID][9] -OL_t[ID][8] )*(D_I-OL_Point[ID][8]) )/(OL_Point[ID][9] - OL_Point[ID][8]) );
	}
	else if(D_I>(OL_Point[ID][7]))
	{
		p_gcout->OVL_Count_ms += ( OL_t[ID][7] + ((OL_t[ID][8] -OL_t[ID][7] )*(D_I-OL_Point[ID][7]) )/(OL_Point[ID][8] - OL_Point[ID][7]) );
	}
	else
	{
		if(p_gcout->OVL_Count_ms  >2) p_gcout->OVL_Count_ms-=2;//62500*4/2ms = 125s
	}

	if( p_gcout->OVL_Count_ms > 62500)
	{
		Error_Handel(E0012);//故障处理
		p_gcout->OVL_Count_ms = 62500;
		return 1;
	}

	return 0;
}

电流较小,采用慢速(稳态)响应 25ms

下面展示一些 内联代码片

// A code block
var foo = 'bar';
Uint8 OverLoad_s() //时基25ms
{
	Uint8 ID = Fuc->p_Y->p_Y0->machine_type.Per_value;//机型参数
	Uint16 D_I = Fuc->p_D->p_D1->bat_I_discharge.dis_value;//精度0.1
	//int16 T_em = p_D1->mos_temperature  / 10;//精度0.1
	static u16 tdelay = 0;

	if(Fuc->p_Y->p_Y0->PCB_test.Per_value) return 0;

	if(D_I< (OL_Point[ID][4]))
	{
		p_gcout->OVL_Count_ms -= (200 + (OL_Point[ID][4]-D_I)/10);//62500*4ms = 250s
		if(p_gcout->OVL_Count_ms > 65535) p_gcout->OVL_Count_ms = 0;
	}

	tdelay++;
	if(tdelay>=4) tdelay = 0;//时基100ms
	else return 0;



//	return 0;
	if(ID>20){ID = 1;}
	//基点+线性差值数
	if(D_I>(OL_Point[ID][6]))//300
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][6] + ((Fuc->p_Y->p_Y1->slow_OL_t1.Per_value)*(D_I-OL_Point[ID][6]) )/(OL_Point[ID][12] - OL_Point[ID][6]) );
	}
	else if(D_I>(OL_Point[ID][5]))//250
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][5] + ((OL_t[ID][6] -OL_t[ID][5] )*(D_I-OL_Point[ID][5]) )/(OL_Point[ID][6] - OL_Point[ID][5]) );
	}
	else if(D_I>(OL_Point[ID][4]))//187
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][4] + ((OL_t[ID][5] -OL_t[ID][4] )*(D_I-OL_Point[ID][4]) )/(OL_Point[ID][5] - OL_Point[ID][4]) );
	}
	else if(D_I>(OL_Point[ID][3]))//107
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][3] + ((OL_t[ID][4] -OL_t[ID][3] )*(D_I-OL_Point[ID][3]) )/(OL_Point[ID][4] - OL_Point[ID][3]) );
	}
	else if(D_I>(OL_Point[ID][2]))//54
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][2] + ((OL_t[ID][3] -OL_t[ID][2] )*(D_I-OL_Point[ID][2]) )/(OL_Point[ID][3] - OL_Point[ID][2]) );
	}
	else if(D_I>(OL_Point[ID][1]))//19
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][1] + ((OL_t[ID][2] -OL_t[ID][1] )*(D_I-OL_Point[ID][1]) )/(OL_Point[ID][2] - OL_Point[ID][1]) );
	}
	else if(D_I>(OL_Point[ID][0]))//10
	{
		p_gcout->OVL_Count_s_1 += ( OL_t[ID][0] + ((OL_t[ID][1] -OL_t[ID][0] )*(D_I-OL_Point[ID][0]) )/(OL_Point[ID][1] - OL_Point[ID][0]) );
	}
	else
	{
		p_gcout->OVL_Count_s_1-=300;//15000 * 0.05S = 47s
		if(p_gcout->OVL_Count_s_1 > 655350) p_gcout->OVL_Count_s_1 = 0;
	}


	if(p_gcout->OVL_Count_s_1>150000)
	{
		Error_Handel(E0012);//故障处理
		p_gcout->OVL_Count_s_1 = 150000;
		return 1;
	}

	return 0;
}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Not Dr.Wang422

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值