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

Fix circuits disabling instead of reducing demand #13768

Merged
merged 3 commits into from
May 5, 2024
Merged

Conversation

andig
Copy link
Member

@andig andig commented May 5, 2024

Refs #13750

@andig andig added the bug Something isn't working label May 5, 2024
@andig andig merged commit 45e3df9 into master May 5, 2024
7 checks passed
@andig andig deleted the fix/circuits branch May 5, 2024 17:57
Copy link
Member

@premultiply premultiply left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schau mal. So müsste es meines Erachtens nach "richtiger" sein.

Es dürfen ja nur die positiven Ströme (= Bezug) berücksichtigt werden, da nur diese das LM über die Reduzierung der Stellgröße oder bzw. Abschaltung ausgleichen kann.
Negative Ströme können nicht zusätzlich durch Mehrleistungsaufnahme reduziert werden.
Das gleichen wir ja ohnehin in der normalen Regelung im PV-Modus aus.

@@ -176,15 +177,15 @@ func (c *Circuit) updateLoadpoints(loadpoints []api.CircuitLoad) {
func (c *Circuit) updateMeters() error {
if f, err := c.meter.CurrentPower(); err == nil {
// TODO handle negative powers
c.power = f
c.power = math.Abs(f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.power = max(0, f) ?

} else {
return fmt.Errorf("circuit power: %w", err)
}

if phaseMeter, ok := c.meter.(api.PhaseCurrents); ok {
if l1, l2, l3, err := phaseMeter.Currents(); err == nil {
// TODO handle negative currents
c.current = max(l1, l2, l3)
c.current = max(math.Abs(l1), math.Abs(l2), math.Abs(l3))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.current = max(0, l1, l2, l3) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants