diff --git a/src/charger.cpp b/src/charger.cpp index 9a3ee3d..1ef60b0 100644 --- a/src/charger.cpp +++ b/src/charger.cpp @@ -414,9 +414,17 @@ void ChargerStateMachine() } else { - dcCurController.SetRef(0); + // Final ramp tick: clear GPIOs (cuts AC enable; output decays + // through filter caps) and restore the PI reference to the + // current idcspnt/idclim so the NEXT EVSEACTIVATE entry + // doesn't sip at 0 A. Param::Change only fires on parameter + // changes; a normal restart cycle never touches idcspnt or + // idclim, so without this restore the PI controller stays + // pinned at 0 across the cycle. Iteration O bug — bench- + // confirmed 0.1 kW sip on limit-raise from COMPLETE. DigIo::acpres_out.Clear(); DigIo::evseact_out.Clear(); + dcCurController.SetRef(MIN(Param::Get(Param::idcspnt), Param::Get(Param::idclim))); completeRampTicks = 0; completeRampOriginalRef = 0; state = STOP;