From 56f7acb7bd6f35063ccf497664e200fd64f556d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zeng=20wei=20=28=E6=9B=BE=E5=A8=81=29?= Date: Wed, 3 Apr 2024 17:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E9=AB=98=E6=B8=A9=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E6=B8=A9=E5=BA=A6=E6=8E=A5=E8=BF=91=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=B8=A9=E5=BA=A6=E6=97=B6=EF=BC=8C=E5=B0=86pid.hp=5F?= =?UTF-8?q?h=E8=AE=BE=E7=BD=AE=E4=B8=BA0.6=E5=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HARDWARE/PID.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/HARDWARE/PID.c b/HARDWARE/PID.c index 860ff58..1ecb554 100644 --- a/HARDWARE/PID.c +++ b/HARDWARE/PID.c @@ -166,6 +166,11 @@ void PID_Calc() // pid calc float hd = pid.hd_h; int h_base = pid.h_base_h; + // if now temp is close to set temp, the heater will be less power + if (pid.set_tem - pid.now_tem < 3) { + hp = pid.hp_h * 0.6; + } + // l mode if (pid.set_tem <= pid.max_compressor_tem) { hp = pid.hp_l;