-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add flag to enable/disable static var compensator regulation #3324
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -34,7 +34,7 @@ public class RegulatingControlMappingForStaticVarCompensators { | |||||||
} | ||||||||
|
||||||||
public static void initialize(StaticVarCompensatorAdder adder) { | ||||||||
adder.setRegulationMode(StaticVarCompensator.RegulationMode.OFF); | ||||||||
adder.setRegulating(false); | ||||||||
} | ||||||||
|
||||||||
public void add(String iidmId, PropertyBag sm) { | ||||||||
|
@@ -121,7 +121,7 @@ private boolean setRegulatingControl(CgmesRegulatingControlForStaticVarCompensat | |||||||
okSet = true; | ||||||||
} else { | ||||||||
context.fixed("SVCControlMode", () -> String.format("Invalid control mode for static var compensator %s. Regulating control is disabled", svc.getId())); | ||||||||
regulationMode = StaticVarCompensator.RegulationMode.OFF; | ||||||||
regulationMode = null; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
To be discussed but here we need to avoid having a null RegulationMode + disable the regulation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we previously need to check that the |
||||||||
} | ||||||||
|
||||||||
svc.setVoltageSetpoint(targetVoltage); | ||||||||
|
@@ -130,6 +130,9 @@ private boolean setRegulatingControl(CgmesRegulatingControlForStaticVarCompensat | |||||||
svc.setRegulationMode(regulationMode); | ||||||||
} | ||||||||
svc.setRegulatingTerminal(regulatingTerminal); | ||||||||
if (regulationMode == null) { | ||||||||
svc.setRegulating(false); | ||||||||
} | ||||||||
|
||||||||
return okSet; | ||||||||
} | ||||||||
|
@@ -160,21 +163,24 @@ private void setDefaultRegulatingControl(CgmesRegulatingControlForStaticVarCompe | |||||||
// We try to keep data from original regulating control if available. | ||||||||
// Even if the regulating control was disabled it may have defined a valid target value | ||||||||
if (RegulatingControlMapping.isControlModeVoltage(rc.defaultRegulationMode.toLowerCase())) { | ||||||||
regulationMode = onlyReactivePowerReg ? StaticVarCompensator.RegulationMode.OFF : StaticVarCompensator.RegulationMode.VOLTAGE; | ||||||||
regulationMode = onlyReactivePowerReg ? null : StaticVarCompensator.RegulationMode.VOLTAGE; | ||||||||
targetVoltage = isValidVoltageFromRegulatingControl(control) ? control.targetValue : rc.defaultTargetVoltage; | ||||||||
} else if (isControlModeReactivePower(rc.defaultRegulationMode.toLowerCase())) { | ||||||||
regulationMode = StaticVarCompensator.RegulationMode.REACTIVE_POWER; | ||||||||
targetReactivePower = isValidReactivePowerFromRegulatingControl(control) ? control.targetValue : rc.defaultTargetReactivePower; | ||||||||
} else { | ||||||||
context.fixed("SVCControlMode", () -> String.format("Invalid control mode for static var compensator %s. Regulating control is disabled", svc.getId())); | ||||||||
regulationMode = StaticVarCompensator.RegulationMode.OFF; | ||||||||
regulationMode = null; | ||||||||
} | ||||||||
|
||||||||
svc.setVoltageSetpoint(targetVoltage); | ||||||||
svc.setReactivePowerSetpoint(targetReactivePower); | ||||||||
if (rc.controlEnabled) { | ||||||||
svc.setRegulationMode(regulationMode); | ||||||||
} | ||||||||
if (regulationMode == null) { | ||||||||
svc.setRegulating(false); | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
// SVCControlMode and voltageSetPoint are optional in Cgmes 3.0 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this comment imply that they are mandatory in CGMES 2.4.15? I will check out of curiosity. |
||||||||
|
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.
shouldn't we set the RegulationMode as
VOLTAGE
to avoid having a null RegulationMode in those kind of cases?@geofjamg