From 8f951b356fb041773f63a71ac02d43730c10fe1b Mon Sep 17 00:00:00 2001 From: wangfq Date: Mon, 29 Jun 2026 18:45:29 +0800 Subject: [PATCH] =?UTF-8?q?tune:=20=E7=A8=B3=E5=AE=9A=E6=9C=9F=E5=9F=BA?= =?UTF-8?q?=E7=BA=BF=E7=AA=97=E5=8F=A3=20500=E2=86=92100,=20=E5=BC=80?= =?UTF-8?q?=E6=9C=BA=20Origin=20=E6=94=B6=E6=95=9B=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 稳定期用 100 样本 × 10ms = 1s 快速收敛, 开机即用。 稳定后切换为 WINDOW_ORIGIN=500 (5s) 提供更强的噪声抑制。 --- utilities/at32f421_freertos_demo/src/TaskLoop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/at32f421_freertos_demo/src/TaskLoop.c b/utilities/at32f421_freertos_demo/src/TaskLoop.c index 88f364d..2534bfa 100644 --- a/utilities/at32f421_freertos_demo/src/TaskLoop.c +++ b/utilities/at32f421_freertos_demo/src/TaskLoop.c @@ -657,12 +657,12 @@ void vd1_task(void) loop1_CAPVD = get_flt_value(clamped_value, loop1_CAPVD); } - /*--- 2. 稳定期:绕过 IIR 和斜率限幅,直接用 Value 快速收敛 ---*/ + /*--- 2. 稳定期:绕过 IIR 和斜率限幅,小窗口快速收敛 ---*/ if (!g_loop_stable) { loop1_CAPVD = loop1_Value; update_moving_average(&loop1_ORG_SUM, &loop1_ORG_CNT, - &loop1_Origin, loop1_CAPVD, WINDOW_ORIGIN); + &loop1_Origin, loop1_CAPVD, 100); _stable_cnt++; if (_stable_cnt >= STABLE_SAMPLES) { g_loop_stable = 1;