From 1d4ccfff3f3c0ab136bd6e6a129abbe02edcfffe Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 29 Dec 2020 04:47:18 -0800 Subject: [PATCH] add idle timing defaults (#2155) Co-authored-by: Matthew Kennedy --- firmware/controllers/actuators/idle_thread.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 323811b47b..436ee05811 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -573,8 +573,20 @@ void setDefaultIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->idleRpmPid.iFactor = 0.05f; engineConfiguration->idleRpmPid.dFactor = 0.0f; - engineConfiguration->idlerpmpid_iTermMin = -200; - engineConfiguration->idlerpmpid_iTermMax = 200; + engineConfiguration->idlerpmpid_iTermMin = -20; + engineConfiguration->idlerpmpid_iTermMax = 20; + + // Good starting point is 10 degrees per 100 rpm, aka 0.1 deg/rpm + CONFIG(idleTimingPid).pFactor = 0.1f; + CONFIG(idleTimingPid).iFactor = 0; + CONFIG(idleTimingPid).dFactor = 0; + + // Allow +- 10 degrees adjustment + CONFIG(idleTimingPid).minValue = -10; + CONFIG(idleTimingPid).minValue = 10; + + // Idle region is target + 100 RPM + CONFIG(idlePidRpmUpperLimit) = 100; } #if ! EFI_UNIT_TEST