修改短路保护时间
This commit is contained in:
parent
557fb2777e
commit
c31fddb450
|
@ -5,6 +5,7 @@
|
|||
#include "task.h"
|
||||
#include "pDebug.h"
|
||||
#include "parameter.h"
|
||||
#include "FM_TIM.h"
|
||||
|
||||
void startInfo(void)
|
||||
{
|
||||
|
|
|
@ -112,7 +112,10 @@ void saveTime(timeInfo *time);
|
|||
void readTime(timeInfo *time);
|
||||
|
||||
|
||||
|
||||
|
||||
#define eventsOrderRecordStartAddr 200
|
||||
void eventsOrderRecordStartInit(void);
|
||||
void setEventsOrderRecord(eventsOrderRecordMode mode);
|
||||
void printfEventsOrderRecord(void);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "configParameter.h"
|
||||
#include "capture.h"
|
||||
|
||||
static int checkMode = 0;
|
||||
//static int checkMode = 0;
|
||||
|
||||
/* 软件输出过载标志位 */
|
||||
static BOOL disChargOverLoad = FALSE;
|
||||
|
@ -43,8 +43,8 @@ void setDisChargOverLoad(void)
|
|||
/* 过载时间过长关闭输出 */
|
||||
if (num1 >= thirdStageProtectionDelay) {
|
||||
num1 = 0;
|
||||
disChargOverLoad = TRUE;
|
||||
setPowerOutput(FALSE);
|
||||
disChargOverLoad = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,8 +59,8 @@ void setDisChargOverLoad(void)
|
|||
/* 过载时间过长关闭输出 */
|
||||
if (num1 >= secondStageProtectionDelay) {
|
||||
num1 = 0;
|
||||
disChargOverLoad = TRUE;
|
||||
setPowerOutput(FALSE);
|
||||
disChargOverLoad = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,20 +82,46 @@ void setSoftShortCircuit(uint16_t disChargCurrAdcNum)
|
|||
|
||||
/* 三段式保护中的第一段 */
|
||||
static int num = 0;
|
||||
if (disChargCurrAdcNum > firstStageProtectionCurr) {
|
||||
if (disChargCurrAdcNum > firstStageProtectionValue) {
|
||||
num++;
|
||||
} else {
|
||||
num = 0;
|
||||
}
|
||||
|
||||
/* 200uS内都短路则关闭输出 */
|
||||
/* 20uS内都短路则关闭输出 */
|
||||
if (num >= firstStageProtectionDelay) {
|
||||
setPowerOutput(FALSE);
|
||||
shortCircuitFlag = TRUE;
|
||||
shortCircuit++;
|
||||
setPowerOutput(FALSE);
|
||||
startSoftShortCircuitProtection();
|
||||
}
|
||||
}
|
||||
void setSoftShortCircuit1(void)
|
||||
{
|
||||
// /* 三段式保护中的第一段 */
|
||||
// static int num = 0;
|
||||
// if (getDischargCurrent() > firstStageProtectionCurr) {
|
||||
// num++;
|
||||
// } else {
|
||||
// num = 0;
|
||||
// }
|
||||
|
||||
// /* 三段式保护中的第一段 */
|
||||
// static int num = 0;
|
||||
// if (getDischargCurrent() > firstStageProtectionCurr) {
|
||||
// num++;
|
||||
// } else {
|
||||
// num = 0;
|
||||
// }
|
||||
|
||||
// /* 200uS内都短路则关闭输出 */
|
||||
// if (num >= firstStageProtectionDelay) {
|
||||
// setPowerOutput(FALSE);
|
||||
// shortCircuitFlag = TRUE;
|
||||
// shortCircuit++;
|
||||
// startSoftShortCircuitProtection();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 得到放电过载状态
|
||||
|
@ -327,6 +353,19 @@ void lowInputLoadDetection(void)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 判断充电电流是否过高,过高则关闭充电
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void judgeChargCurr(void)
|
||||
{
|
||||
if (getChargCurrent() > maxChargCurr) {
|
||||
stopChargWork();
|
||||
}
|
||||
}
|
||||
|
||||
void checkAbnormal(void)
|
||||
{
|
||||
// checkTimeInit();
|
||||
|
@ -342,9 +381,9 @@ void checkAbnormal(void)
|
|||
/* 判断 */
|
||||
checkFFMOS_CON();
|
||||
setDisChargOverLoad();
|
||||
// setSoftShortCircuit();
|
||||
setSoftShortCircuit1();
|
||||
lowInputLoadDetection();
|
||||
|
||||
judgeChargCurr();
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -292,6 +292,16 @@ void readTime(timeInfo *time)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 初始化事件顺序记录
|
||||
* @param
|
||||
*/
|
||||
|
||||
void eventsOrderRecordStartInit(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 将事件顺序记录在flash中
|
||||
* @param
|
||||
|
|
|
@ -446,6 +446,8 @@ float get_OUT_VOLT_IN(void)
|
|||
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hdma)
|
||||
{
|
||||
if (hdma->Instance == ADC1) {
|
||||
setSoftShortCircuit(adcBuff[DSG_CURR_NUM]);
|
||||
|
||||
WORK_VOLT_capture.totalInData -= WORK_VOLT_capture.inData16[pointer];
|
||||
DSG_CURR_capture.totalInData -= DSG_CURR_capture.inData16[pointer];
|
||||
PV_VOLT_IN_capture.totalInData -= PV_VOLT_IN_capture.inData16[pointer];
|
||||
|
@ -475,8 +477,6 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hdma)
|
|||
DSG_CURR_capture.IODataF[3] = (float32_t)DSG_CURR_capture.totalInData / indata16_size;
|
||||
PV_VOLT_IN_capture.IODataF[3] = (float32_t)PV_VOLT_IN_capture.totalInData / indata16_size;
|
||||
CHG_CURR_capture.IODataF[3] = (float32_t)CHG_CURR_capture.totalInData / indata16_size;
|
||||
|
||||
setSoftShortCircuit(DSG_CURR_capture.inData16[pointer - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ void SystemClock_Config(void)
|
|||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
// RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
|
||||
|
|
|
@ -59,10 +59,12 @@ typedef enum {
|
|||
/* 顺序事件记录 */
|
||||
typedef enum {
|
||||
firstStageProtection = 1, //第一段保护,短路保护
|
||||
secondStageProtection = 2, //第二段保护,介于过载和短路之间
|
||||
thirdStageProtection = 3, //第三段保护,过载保护
|
||||
excessiveLoadIn = 4, //进入了电压降低中断
|
||||
lowInputLoad = 5, //输入功率不足保护
|
||||
secondStageProtection , //第二段保护,介于过载和短路之间
|
||||
thirdStageProtection, //第三段保护,过载保护
|
||||
lowInputLoad, //输入功率不足保护
|
||||
overTemperature, //过温保护
|
||||
stopTemperature, //停止温度保护
|
||||
overchargCurr, //充电功率过大保护
|
||||
}eventsOrderRecordMode;
|
||||
|
||||
|
||||
|
|
|
@ -28,10 +28,13 @@
|
|||
// const uint32_t lowInputLoadDetectionDelay = 30; // 120S
|
||||
|
||||
|
||||
/* 第一段保护的延时时间(单位100uS) */
|
||||
#define firstStageProtectionDelay 2 // 200uS
|
||||
/* 第一段保护的电流(单位A) */
|
||||
// /* 第一段保护的延时时间(单位100uS) */
|
||||
/* 第一段保护的延时时间(单位10uS) */
|
||||
#define firstStageProtectionDelay 2
|
||||
// /* 第一段保护的电流(单位A) */
|
||||
#define firstStageProtectionCurr 50.0f
|
||||
/* 第一段保护的电流采集的ADC的值 */
|
||||
#define firstStageProtectionValue 3412
|
||||
|
||||
/* 第二段保护的延时时间(单位100uS) */
|
||||
#define secondStageProtectionDelay 50000 // 5S
|
||||
|
@ -51,6 +54,8 @@
|
|||
/* 输入功率较低延时电流(单位A) */
|
||||
#define lowInputLoadDetectionVolt 10.0f
|
||||
|
||||
/* 最大充电电流(A) */
|
||||
#define maxChargCurr 35.0f
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue