forked from tbnobody/OpenDTU
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this implementation checks all requirements for a new power limit to be calculated, one after the other. if any requirement is not met, a respective status is announced. status messages are communicated on the (serial) console. these can also be displayed easily on the web app in the future. the status texts explain clearly what the DPL is currently doing, which aids understanding how the DPL works. the status is only announced if it changes, or after a fixed interval. as each requirement is checked individually, the code readability is improved as well. previously, all the respective conditions had to be checked as well, but the statements were more complex. the DPL loop is now executed with high frequency, i.e., it does not wait for a fixed timespan to pass before checking requirements. it always aborts on the first unmet requirement. this should improve responsiveness, as the DPL checks all requirements more often. the DPL now waits for all power commands and power limit updates to complete. when that is the case, a settling time elapses. after the settling phase, the DPL waits for a new update from the inverter and from the power meter. now it can be assumed that the values are in sync. it then makes sense to calculate a new power limit immediately, which the DPL then does.
- Loading branch information
1 parent
0b0bcf1
commit 18b1076
Showing
2 changed files
with
159 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters