-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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)
?
Refs #13750