Skip to content
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

DPL: (re-)send power limits periodically #483

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

schlimmchen
Copy link
Member

avoid staleness in case the same power limit is calculated over and over again, hence no new power limit value is calculated and hence no power limit command is sent to the inverter. staleness occurs in this case if the first power limit command to establish the respective limit was not received by the inverter. one can easily simulate a situation where the same power limit is caluclated over and over again: with a battery above the start threshold, set a very low upper power limit for the inverter (DPL setting). that value will be used as the limit as long as the power meter reading is larger than that.

we could also check the limit reported by the inverter. however, that value is in percent of the inverter's max AC output, and is often not the same value as we requested as the limit, but slightly off. we then would have to decide how much deviation is okay, which is unreasonably complicated.

closes #478.

avoid staleness in case the same power limit is calculated over and over
again, hence no new power limit value is calculated and hence no power
limit command is sent to the inverter. staleness occurs in this case if
the first power limit command to establish the respective limit was not
received by the inverter. one can easily simulate a situation where the
same power limit is caluclated over and over again: with a battery above
the start threshold, set a very low upper power limit for the inverter
(DPL setting). that value will be used as the limit as long as the power
meter reading is larger than that.

we could also check the limit reported by the inverter. however, that
value is in percent of the inverter's max AC output, and is often not
the same value as we requested as the limit, but slightly off. we then
would have to decide how much deviation is okay, which is unreasonably
complicated.

closes hoylabs#478.
@schlimmchen
Copy link
Member Author

Tested briefly:

[2023-10-06 22:01:26.292] [DPL::loop] ******************* ENTER **********************
[2023-10-06 22:01:26.292] [DPL::loop] battery interface enabled, SoC: 16 %, StartTH: 16 %, StopTH: 15 %, SoC age: 1 s
[2023-10-06 22:01:26.298] [DPL::loop] dcVoltage: 51.80 V, loadCorrectedVoltage: 51.85 V, StartTH: 52.00 V, StopTH: 51.00 V
[2023-10-06 22:01:26.302] [DPL::loop] StartTH reached: yes, StopTH reached: no, inverter is producing
[2023-10-06 22:01:26.307] [DPL::loop] SolarPT enabled, Drain Strategy: 0, canUseDirectSolarPower: no
[2023-10-06 22:01:26.312] [DPL::loop] battery discharging allowed, PowerMeter: 271 W, target consumption: 10 W
[2023-10-06 22:01:26.318] [DPL::setNewPowerLimit] requested: 351 W, last limit: 100 W, diff: 0 W, hysteresis: 20 W, age: 58261 ms
[2023-10-06 22:01:26.323] [DPL::loop] ******************* Leaving PL, calculated limit: 351 W, requested limit: 100 W (kept last requested)
[2023-10-06 22:01:27.353] [DPL::loop] ******************* ENTER **********************
[2023-10-06 22:01:27.353] [DPL::loop] battery interface enabled, SoC: 16 %, StartTH: 16 %, StopTH: 15 %, SoC age: 2 s
[2023-10-06 22:01:27.358] [DPL::loop] dcVoltage: 51.80 V, loadCorrectedVoltage: 51.85 V, StartTH: 52.00 V, StopTH: 51.00 V
[2023-10-06 22:01:27.363] [DPL::loop] StartTH reached: yes, StopTH reached: no, inverter is producing
[2023-10-06 22:01:27.368] [DPL::loop] SolarPT enabled, Drain Strategy: 0, canUseDirectSolarPower: no
[2023-10-06 22:01:27.373] [DPL::loop] battery discharging allowed, PowerMeter: 274 W, target consumption: 10 W
[2023-10-06 22:01:27.379] [DPL::setNewPowerLimit] requested: 354 W, last limit: 100 W, diff: 0 W, hysteresis: 20 W, age: 59322 ms
[2023-10-06 22:01:27.384] [DPL::loop] ******************* Leaving PL, calculated limit: 354 W, requested limit: 100 W (kept last requested)
[2023-10-06 22:01:28.414] [DPL::loop] ******************* ENTER **********************
[2023-10-06 22:01:28.419] [DPL::loop] battery interface enabled, SoC: 16 %, StartTH: 16 %, StopTH: 15 %, SoC age: 0 s
[2023-10-06 22:01:28.424] [DPL::loop] dcVoltage: 51.80 V, loadCorrectedVoltage: 51.85 V, StartTH: 52.00 V, StopTH: 51.00 V
[2023-10-06 22:01:28.429] [DPL::loop] StartTH reached: yes, StopTH reached: no, inverter is producing
[2023-10-06 22:01:28.434] [DPL::loop] SolarPT enabled, Drain Strategy: 0, canUseDirectSolarPower: no
[2023-10-06 22:01:28.439] [DPL::loop] battery discharging allowed, PowerMeter: 273 W, target consumption: 10 W
[2023-10-06 22:01:28.445] [DPL::setNewPowerLimit] requested: 353 W, (re-)sending limit: 100 W
[2023-10-06 22:01:28.451] [DPL::loop] ******************* Leaving PL, calculated limit: 353 W, requested limit: 100 W (updated from calculated)
[2023-10-06 22:01:28.458] [    318.310] DPL: waiting for a power limit command to complete

@helgeerbe helgeerbe merged commit 116da05 into hoylabs:development Oct 9, 2023
8 checks passed
@schlimmchen schlimmchen deleted the periodic-limit-updates branch October 9, 2023 08:12
philippsandhaus pushed a commit to philippsandhaus/OpenDTU-OnBattery that referenced this pull request Oct 20, 2023
avoid staleness in case the same power limit is calculated over and over
again, hence no new power limit value is calculated and hence no power
limit command is sent to the inverter. staleness occurs in this case if
the first power limit command to establish the respective limit was not
received by the inverter. one can easily simulate a situation where the
same power limit is caluclated over and over again: with a battery above
the start threshold, set a very low upper power limit for the inverter
(DPL setting). that value will be used as the limit as long as the power
meter reading is larger than that.

we could also check the limit reported by the inverter. however, that
value is in percent of the inverter's max AC output, and is often not
the same value as we requested as the limit, but slightly off. we then
would have to decide how much deviation is okay, which is unreasonably
complicated.

closes hoylabs#478.
Copy link

github-actions bot commented Apr 4, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants