-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): Avoid flickering between charge/discharge due to PID filter #2960
base: develop
Are you sure you want to change the base?
Conversation
1c683a1
to
2d398f4
Compare
Codecov ReportAttention: Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2960 +/- ##
=============================================
+ Coverage 57.09% 57.23% +0.14%
- Complexity 9735 9775 +40
=============================================
Files 2266 2267 +1
Lines 96819 96823 +4
Branches 7163 7164 +1
=============================================
+ Hits 55270 55407 +137
+ Misses 39487 39348 -139
- Partials 2062 2068 +6 |
fcbcdfb
to
b477aca
Compare
Before this change the PID filter implementation eventually caused the behavior to switch from charging to discharing, eventhough the system wanted to (a) charge with a lower value than before (b) set active power to 0. This was due to the fact, that the PID filter overshoots its target. By detecting if the system wants charge/discharge/no current flow the battery, it now dynamically adjusts the limits of the battery so it does not overshoot in the unwanted area. This reduces stress on the battery. It also improves the controller that are using this filter (e.g. self consumption optimization, peak load shaving). Sometimes they showed behavior where they wildly flicker between charging/discharging.
b477aca
to
c4a0653
Compare
Looking at your graphs I have some questions:
Best regards, |
I can confirm, that i had the same Issues with 0,3 0,3 0,1 |
@pooran-c & @huseyinsaht Could you please crosscheck this with our experiences? |
This looks like something I have been seeing in my much smaller system I think. Whenever my system was loaded with a 20kW consumer (Water heater) and the load was suddenly turned off it looked like the system needed some time to balance things out again. When I saw your simulated graph that looked pretty much like something I have been seeing. Not saying it’s the same thing but if it is I can’t wait for this fix being added to FEMS as well. Well done, the after-graph looks great! |
Yes, I also had the same Issues (NO FEMS - native OpenEMS) :) |
Please note that PID is disabled by default for FENECON Home systems, because there we use a specific SMART mode instead, which uses the faster internal reaction time of the inverter. |
If that is the case and I am seeing instability when trying to recover from a removed load for a couple of minutes I would assume it’s not working properly? Probably not for this issue then 🙂 |
Even though the PID filter may not apply on FEMS systems, the flicker still exists. Here a better view with lower power consumption overall but visible flicker of Grid/Battery fluctuations. Not sure this is the right place for it since it’s using a different implementation but figured I append the ticket. |
Hi @parapluplu, We have reviewed your code and noticed that you are manipulating the input of the PID controller. Rather than altering the feedback power (input), we should take the calculated power value and then decide how to proceed with it. Apart from that, it is quite difficult to predict the outcome because we do not know the model. We will give a feedback as soon as possible as we talk to our engineers. BR, |
Before this change the PID filter implementation eventually caused the behavior to switch from charging to discharing, eventhough the system wanted to (a) charge with a lower value than before (b) set active power to 0. This was due to the fact, that the PID filter overshoots its target.
By detecting if the system wants charge/discharge/no current flow the battery, it now dynamically adjusts the limits of the battery so it does not overshoot in the unwanted area. This reduces stress on the battery. It also improves the controller that are using this filter (e.g. self consumption optimization, peak load shaving). Sometimes they showed behavior where they wildly flicker between charging/discharging.
Examples:
self consumption optimization: