#include "Waring_Analys.h"
U8 Battery_DChgVoltageUnder_time[3][2];
U8 Battery_DChgVoltageOver_time[3][2];
U8 Cell_DChgVoltageUnder_time[3][2];
U8 Cell_RChgVoltageOver_time[3][2];
U8 Battery_DChgCellDiffer_time[3][2];
U8 Battery_DChgTempOver_time[3][2];
U8 Battery_DChgTempUnder_time[3][2];
U8 Battery_DChgTempDiffer_time[3][2];
U8 DChg_InsCurrentOver_time[3][2];
U8 DChg_CtsCurrentOver_time[3][2];
U8 Battery_ChgVoltageOver_time[3][2];
U8 Battery_ChgVoltageUnder_time[3][2];
U8 Cell_ChgVoltageOver_time[3][2];
U8 Cell_ChgVoltageUnder_time[3][2];
U8 Battery_ChgCellDiffer_time[3][2];
U8 Battery_ChgTempOver_time[3][2];
U8 Battery_ChgTempUnder_time[3][2];
U8 Battery_ChgTempDiffe_time[3][2];
U8 Chg_CurrentOver_time[3][2];
U8 SOC_LOW_time[3][2];
U8 VSampleLineFail_time[3][2];
U8 Bms_Hardware_Fail_time[3][2];
U8 AbnorlCurrent_time[3][2]; //630A
U8 Battery_DChgVoltageUnder_warning[3];
U8 Battery_DChgVoltageOver_warning[3];
U8 Cell_DChgVoltageUnder_warning[3];
U8 Cell_RChgVoltageOver_warning[3];
U8 Battery_DChgCellDiffer_warning[3];
U8 Battery_DChgTempOver_warning[3];
U8 Battery_DChgTempUnder_warning[3];
U8 Battery_DChgTempDiffer_warning[3];
U8 DChg_InsCurrentOver_warning[3];
U8 DChg_CtsCurrentOver_warning[3];
U8 Battery_ChgVoltageOver_warning[3];
U8 Battery_ChgVoltageUnder_warning[3];
U8 Cell_ChgVoltageOver_warning[3];
U8 Cell_ChgVoltageUnder_warning[3];
U8 Battery_ChgCellDiffer_warning[3];
U8 Battery_ChgTempOver_warning[3];
U8 Battery_ChgTempUnder_warning[3];
U8 Battery_ChgTempDiffe_warning[3];
U8 Chg_CurrentOver_warning[3];
U8 SOC_LOW_warning[3];
U8 VSampleLineFail_warning[3];
U8 Bms_Hardware_Fail_warning[3];
U8 AbnorlCurrent_warning[3];
//1、放电总压低
static U8 Battery_DChgVoltageUnder_warning0_detect(void);
static U8 Battery_DChgVoltageUnder_warning1_detect(void);
static U8 Battery_DChgVoltageUnder_warning2_detect(void);
//2、放电总压高
static U8 Battery_DChgVoltageOver_warning0_detect(void);
static U8 Battery_DChgVoltageOver_warning1_detect(void);
//3、放电单体低
static U8 Cell_DChgVoltageUnder_warning0_detect(void);
static U8 Cell_DChgVoltageUnder_warning1_detect(void);
static U8 Cell_DChgVoltageUnder_warning2_detect(void);
//4、回馈单体高
static U8 Cell_RChgVoltageOver_warning0_detect(void);
static U8 Cell_RChgVoltageOver_warning1_detect(void);
//5、放电单体压差大
static U8 Battery_DChgCellDiffer_warning0_detect(void);
//6、放电高温
static U8 Battery_DChgTempOver_warning0_detect(void);
static U8 Battery_DChgTempOver_warning1_detect(void);
//7、放电低温
static U8 Battery_DChgTempUnder_warning0_detect(void);
//8、放电温差
static U8 Battery_DChgTempDiffer_warning0_detect(void);
static U8 Battery_DChgTempDiffer_warning1_detect(void);
//9、瞬时过流
static U8 DChg_InsCurrentOver_warning0_detect(void);
static U8 DChg_InsCurrentOver_warning1_detect(void);
//10、持续过流
static U8 DChg_CtsCurrentOver_warning0_detect(void);
static U8 DChg_CtsCurrentOver_warning1_detect(void);
//11、充电总压高
static U8 Battery_ChgVoltageOver_warning0_detect(void);
//12、充电单体高
static U8 Cell_ChgVoltageOver_warning0_detect(void);
//13、充电总压低
static U8 Battery_ChgVoltageUnder_warning0_detect(void);
static U8 Battery_ChgVoltageUnder_warning1_detect(void);
static U8 Battery_ChgVoltageUnder_warning2_detect(void);
//14、充电单体低
static U8 Cell_ChgVoltageUnder_warning0_detect(void);
static U8 Cell_ChgVoltageUnder_warning1_detect(void);
static U8 Cell_ChgVoltageUnder_warning2_detect(void);
//15、充电单体压差
static U8 Battery_ChgCellDiffer_warning0_detect(void);
static U8 Battery_ChgCellDiffer_warning1_detect(void);
//16、充电高温
static U8 Battery_ChgTempOver_warning0_detect(void);
static U8 Battery_ChgTempOver_warning1_detect(void);
//17、充电低温
static U8 Battery_ChgTempUnder_warning0_detect(void);
static U8 Battery_ChgTempUnder_warning1_detect(void);
static U8 Battery_ChgTempUnder_warning2_detect(void);
//18、充电温差
static U8 Battery_ChgTempDiffe_warning0_detect(void);
static U8 Battery_ChgTempDiffe_warning1_detect(void);
//19、充电过流
static U8 Chg_CurrentOver_warning0_detect(void);
static U8 Chg_CurrentOver_warning1_detect(void);
//20、排线脱落
static U8 VSampleLineFail_warning0_detect(void);
//21、电流异常
static U8 AbnorlCurrent_warning0_detect(void);
//22、初始化故障
static U8 Bms_Hardware_Fail_warning0_detect(void);
//23、SOC低
static U8 SOC_LOW_warning0_detect(void);
static U8 SOC_LOW_warning1_detect(void);
static U8 SOC_LOW_warning2_detect(void);
//24、others
static U8 Found_most_level(U8 * data);
static U8 Is_Charge_OK(void);
static U8 Is_Disharge_OK(void);
/*
********************************************************************************
**函数名称:Warning_time_init(void)
**功 能 初始化函数
**参 数:无
**返 回 值:无
**备 注:初始化时调用
********************************************************************************
*/
void Warning_time_init(void)
{
U8 j,i;
//0-三级故障/1-二级故障/2-一级故障
for(j=0;j<3;j++)
{
Battery_DChgVoltageUnder_warning[j]=1; //normal=1
Battery_DChgVoltageOver_warning[j]=1;
Cell_DChgVoltageUnder_warning[j]=1;
Cell_RChgVoltageOver_warning[j] = 1;
Battery_DChgCellDiffer_warning[j]=1;
Battery_DChgTempOver_warning[j]=1;
Battery_DChgTempUnder_warning[j]=1;
Battery_DChgTempDiffer_warning[j]=1;
DChg_InsCurrentOver_warning[j]=1;
DChg_CtsCurrentOver_warning[j]=1;
Battery_ChgVoltageOver_warning[j]=1;
Battery_ChgVoltageUnder_warning[j]=1;
Cell_ChgVoltageOver_warning[j]=1;
Cell_ChgVoltageUnder_warning[j]=1;
Battery_ChgCellDiffer_warning[j]=1;
Battery_ChgTempOver_warning[j]=1;
Battery_ChgTempUnder_warning[j]=1;
Battery_ChgTempDiffe_warning[j]=1;
Chg_CurrentOver_warning[j]=1;
SOC_LOW_warning[j]=1;
VSampleLineFail_warning[j]=1;
Bms_Hardware_Fail_warning[j]=1;
AbnorlCurrent_warning[j]=1;
//0-故障确认/1-恢复确认
for(i=0; i<2; i++)
{
Battery_DChgVoltageUnder_time[j][i]=0;//time = 0;
Battery_DChgVoltageOver_time[j][i]=0;
Cell_DChgVoltageUnder_time[j][i]=0;
Cell_RChgVoltageOver_time[j][i]=0;
Battery_DChgCellDiffer_time[j][i]=0;
Battery_DChgTempOver_time[j][i]=0;
Battery_DChgTempUnder_time[j][i]=0;
Battery_DChgTempDiffer_time[j][i]=0;
DChg_InsCurrentOver_time[j][i]=0;
DChg_CtsCurrentOver_time[j][i]=0;
Battery_ChgVoltageOver_time[j][i]=0;
Battery_ChgVoltageUnder_time[j][i]=0;
Cell_ChgVoltageOver_time[j][i]=0;
Cell_ChgVoltageUnder_time[j][i]=0;
Battery_ChgCellDiffer_time[j][i]=0;
Battery_ChgTempOver_time[j][i]=0;
Battery_ChgTempUnder_time[j][i]=0;
Battery_ChgTempDiffe_time[j][i]=0;
Chg_CurrentOver_time[j][i]=0;
SOC_LOW_time[j][i]=0;
VSampleLineFail_time[j][i]=0;
Bms_Hardware_Fail_time[j][i]=0;
AbnorlCurrent_time[j][i]=0;
}
}
}
/*
********************************************************************************
**函数名称handle_debouncing( )
**功 能 各种报警处理函数
**参 数:无
**返 回 值:无
**备 注:100ms调用
********************************************************************************
*/
void handle_debouncing( U8 *flag, //record the warninglevel
U8 (*false_condition_function_ptr)(void), U8 *debounce_false_counter, //wrong
U8 (*true_condition_function_ptr)(void), U8 *debounce_true_counter, //right
U32 false_debounce_limit, U32 true_debounce_limit)
{
if (*flag==TRUE ) //如果标识位是正1
{
if (debounce_false_counter) //如果指针是有效的
{
if (false_condition_function_ptr()==TRUE) //1、无故障
{
*debounce_false_counter = 0; //该地址值增加
}
else //2、存在故障
{
(*debounce_false_counter)++; //开始计数/100ms/次
if (*debounce_false_counter >= false_debounce_limit)
{
*flag = FALSE; //3.记录故障-为什么
没有合适的资源?快使用搜索试试~ 我知道了~
基于NXPS32MCU电池管理系统.rar
共168个文件
h:33个
args:31个
o:30个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 63 浏览量
2022-07-10
21:40:54
上传
评论
收藏 6.29MB RAR 举报
温馨提示
基于C/C++开发的。源码参考使用。
资源推荐
资源详情
资源评论
收起资源包目录
基于NXPS32MCU电池管理系统.rar (168个子文件)
BMS_lib.a 42.61MB
GVB_BMS_S32K146.args 947B
Battery_Data_Process.args 350B
OsTask.args 350B
PowerUpDown.args 350B
Relay_Operation.args 350B
OsSched.args 350B
main.args 350B
Config.args 350B
ComCAN0.args 350B
Debug.args 350B
CANSet.args 350B
RS485.args 350B
SocCal.args 350B
SOHEstimator.args 350B
Waring_Analys.args 350B
system_S32K146.args 350B
startup.args 350B
NVM.args 350B
Comm.args 350B
charge_AC.args 344B
SOCEstimator.args 344B
DCharge_Relay.args 344B
Chg_Current_Estimate.args 344B
StbM.args 344B
charge_standard.args 344B
Chg_Temp.args 344B
est_power_lim.args 344B
state_tm_temp_management.args 344B
Debug.args 344B
VCU_Commun.args 344B
startup_S32K146.args 285B
Waring_Analys.c 45KB
NVM.c 28KB
Comm.c 16KB
Debug.c 16KB
ComCAN0.c 12KB
OsSched.c 11KB
OsTask.c 10KB
Battery_Data_Process.c 10KB
system_S32K146.c 9KB
startup.c 8KB
CANSet.c 7KB
RS485.c 5KB
Config.c 5KB
SocCal.c 4KB
Relay_Operation.c 2KB
PowerUpDown.c 2KB
SOHEstimator.c 1KB
main.c 327B
.cproject 108KB
CANSet.d 6KB
OsTask.d 6KB
Battery_Data_Process.d 4KB
Relay_Operation.d 4KB
Waring_Analys.d 4KB
SOHEstimator.d 4KB
PowerUpDown.d 4KB
ComCAN0.d 4KB
SocCal.d 4KB
OsSched.d 3KB
Debug.d 3KB
Comm.d 3KB
state_tm_temp_management.d 3KB
Chg_Current_Estimate.d 3KB
charge_standard.d 3KB
DCharge_Relay.d 3KB
est_power_lim.d 3KB
SOCEstimator.d 3KB
VCU_Commun.d 3KB
charge_AC.d 3KB
Chg_Temp.d 3KB
Debug.d 2KB
StbM.d 2KB
main.d 2KB
system_S32K146.d 899B
startup.d 871B
Config.d 355B
RS485.d 351B
NVM.d 209B
GVB_BMS_S32K146.elf 1.51MB
S32K146.h 751KB
S32K146_features.h 81KB
BSW_DIO.h 27KB
NVM.h 20KB
BSW_BatInfo.h 15KB
Comm.h 13KB
Battery_Data.h 10KB
OsTask.h 9KB
BSW_ADC.h 9KB
BSW_IOHv.h 9KB
OsSched.h 8KB
s32_core_cm4.h 7KB
device_registers.h 5KB
Battery_Data_Process.h 5KB
system_S32K146.h 4KB
devassert.h 4KB
Waring_Analys.h 3KB
CANSet.h 2KB
BSW_RTC.h 2KB
共 168 条
- 1
- 2
资源评论
- ligangcd2022-11-28感谢资源主的分享,这个资源对我来说很有用,内容描述详尽,值得借鉴。
等天晴i
- 粉丝: 3513
- 资源: 10万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 产品说明书翻译及练习(1).pdf 产品说明书翻译及练习(1).pdf
- 【图书馆预约】个人版(仅个人使用)
- xcap,好用的发包工具
- kouzhao-main-pycharm官网
- 太原理工大学在项目管理方面涉及多个领域和层面 以下是对太原理工大学项目管理的一些概述: 实验室建设项目管理:太原理工大学制定了
- python 数据分析示例
- 一分钟计数绷踢.mp4
- intel-visual-fortran-xe2011.zip
- tensorflow-gpu-2.5.3-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-gpu-2.2.1-cp35-cp35m-win-amd64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功