From 046c2e038e7366c37d306c5087de7cf897413b92 Mon Sep 17 00:00:00 2001 From: "REASEARCHER\\18383" <1633026436@qq.com> Date: Sat, 30 Aug 2025 14:52:03 +0800 Subject: [PATCH] =?UTF-8?q?heat80Gear=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hyt2/APP/Device/device_Other/device_heat.c | 6 +++--- Hyt2/APP/Service/service_statusmonitor.c | 22 ++++++++++++++++++++++ Hyt2/APP/Service/service_statusmonitor.h | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Hyt2/APP/Device/device_Other/device_heat.c b/Hyt2/APP/Device/device_Other/device_heat.c index c3e5445..15f0f48 100644 --- a/Hyt2/APP/Device/device_Other/device_heat.c +++ b/Hyt2/APP/Device/device_Other/device_heat.c @@ -485,7 +485,7 @@ static char ptz_heat_data_collect_task() { ptz_heat_collect_adc1_task(); - if ( g_ptz.electric_current > 6 ) //过流 + if ( g_ptz.electric_current > 6.0 ) //过流 { overCurrTime++; } @@ -494,7 +494,7 @@ static char ptz_heat_data_collect_task() currTime = 0; } //长时间过流 - if ( overCurrTime >= 20 ) //20*100ms=2s + if ( overCurrTime >= 5 ) //5*100ms=500 { heatFlag = 1; //禁止加热 closeHeat(); @@ -512,7 +512,7 @@ static char ptz_heat_data_collect_task() currTime = 0; } //长时间电流正常 - if ( currTime >= 20 ) //20*100ms=2s + if ( currTime >= 5 ) //20*100ms=2s { heatFlag = 0; //允许加热 currTime = 0; diff --git a/Hyt2/APP/Service/service_statusmonitor.c b/Hyt2/APP/Service/service_statusmonitor.c index 69ee057..fa0dfab 100644 --- a/Hyt2/APP/Service/service_statusmonitor.c +++ b/Hyt2/APP/Service/service_statusmonitor.c @@ -14,6 +14,7 @@ static char ptz_temp_volt_current_fault_detect_task() static unsigned short int time_ms; static unsigned char hori_fault; static unsigned char vert_fault; + static uint32_t curOverCount = 0; time_ms ++; if(time_ms < 50) @@ -132,6 +133,25 @@ static char ptz_temp_volt_current_fault_detect_task() // //˫ת // if((g_ptz.hori_start_stop_set == PTZ_HORI_START) && (g_ptz.vert_start_stop_set == PTZ_VERT_START)) // { + if(g_ptz.electric_current >= PTZ_CURRENT_DETECT) + { + curOverCount++; + if ( curOverCount >= 40 ) + { + curOverCount = 0; + g_ptz.fault_detect.electric_current_fault = FAULT; + //Ӧֹͣת + ptz_hori_stop(PTZ_HORI_STOP_TIME); + ptz_vert_stop(PTZ_VERT_STOP_TIME); + } + } + else + { + curOverCount = 0; + g_ptz.fault_detect.electric_current_fault = NO_FAULT; + } + +/* if(g_ptz.electric_current >= PTZ_CURRENT_DETECT) { g_ptz.fault_detect.electric_current_fault = FAULT; @@ -141,6 +161,8 @@ static char ptz_temp_volt_current_fault_detect_task() }else{ g_ptz.fault_detect.electric_current_fault = NO_FAULT; } +*/ + // } return 1; } diff --git a/Hyt2/APP/Service/service_statusmonitor.h b/Hyt2/APP/Service/service_statusmonitor.h index 6e3d153..61648c0 100644 --- a/Hyt2/APP/Service/service_statusmonitor.h +++ b/Hyt2/APP/Service/service_statusmonitor.h @@ -107,7 +107,7 @@ #define PTZ_VOLT_DETECT_MIN 18.0//30.0 //ֵ - #define PTZ_CURRENT_DETECT 7.5//5.0 + #define PTZ_CURRENT_DETECT 8.0//5.0 //ֵ #define PTZ_HALL_DETECT 30//30