EVerest / everest-core

Apache License 2.0
92 stars 68 forks source link

Charger: Fix soft over current detection when PWM changes often #762

Closed corneliusclaussen closed 2 months ago

corneliusclaussen commented 2 months ago

Describe your changes

Soft over current detection triggers when the EV draws more current then the PWM limit for several seconds. The current implementation checked the EV's current against the internally set current limit, which may be different from the PWM signalled current limit for up to 5 seconds (as IEC allows PWM updates only every 5 seconds). If PWM is changed frequently (e.g. due to solar charging) this may lead to unintended over current triggers (it takes 5 seconds for the PWM to change and another 6s or so for some EVs to actually reduce current). With this PR, the OC detection is based on the current actually signalled on the PWM for basic AC charging.

Issue ticket number and link

Checklist before requesting a review