From d1eb6d897f3cc4cf542cb26ec23cf42832ee30d5 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 26 Jan 2023 02:02:26 -0500 Subject: [PATCH] docs --- firmware/controllers/actuators/alternator_controller.cpp | 2 +- firmware/controllers/actuators/idle_thread.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/actuators/alternator_controller.cpp b/firmware/controllers/actuators/alternator_controller.cpp index 6181fa6fc1..f3d26b4fc4 100644 --- a/firmware/controllers/actuators/alternator_controller.cpp +++ b/firmware/controllers/actuators/alternator_controller.cpp @@ -69,7 +69,7 @@ void AlternatorController::onFastCallback() { alternatorControl.setSimplePwmDutyCycle(0); } else { currentAltDuty = alternatorPid.getOutput(targetVoltage, vBatt.Value, FAST_CALLBACK_PERIOD_MS / 1000.0f); - // huh, why do we bump based on button not based on actual A/C relay state? + // see "idle air Bump for AC" comment int acDutyBump = engine->module().unmock().acButtonState ? engineConfiguration->acRelayAlternatorDutyAdder : 0; currentAltDuty += acDutyBump; if (engineConfiguration->isVerboseAlternator) { diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 109ff0941e..d79eaac205 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -26,8 +26,10 @@ int IdleController::getTargetRpm(float clt) { targetRpmByClt = interpolate2d(clt, config->cltIdleRpmBins, config->cltIdleRpm); - // Bump for AC - // huh, why do we bump based on button not based on actual A/C relay state? + // idle air Bump for AC + // Why do we bump based on button not based on actual A/C relay state? + // Because AC output has a delay to allow idle bump to happen first, so that the airflow increase gets a head start on the load increase + // alternator duty cycle has a similar logic targetRpmAcBump = engine->module().unmock().acButtonState ? engineConfiguration->acIdleRpmBump : 0; return targetRpmByClt + targetRpmAcBump;