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

Voltage control of transformer: remote and local #127

Merged
merged 95 commits into from
Nov 26, 2020

Conversation

annetill
Copy link
Member

@annetill annetill commented Jul 6, 2020

Signed-off-by: Anne Tilloy anne.tilloy@rte-france.com

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem ? If so, link to this issue using '#XXX' and skip the rest

#106

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

.setTargetV(34.0);

LoadFlowResult result = loadFlowRunner.run(network, parameters);
// assertTrue(result.isOk()); FIXME
Copy link
Member Author

Choose a reason for hiding this comment

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

@geofjamg it is just a first version of voltage control by transformer and it is not working. At this test, the norm of my cost function is NaN. Do you have any idea of the problem ?

Copy link
Member

Choose a reason for hiding this comment

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

This is because the way tap changer voltage target equation is defined in AcEquationSystem.createBranchVoltageTargetEquation.
You should define a new equation type for tap changer target voltage (like BUS_TRANSFO_V)) because if you look at Equation.initTargets for type BUS_V, we look for a generator target voltage and not a tap changer target voltage so result is nan and this nan is added to targets vector before first NR.

}

@Override
public OuterLoopStatus check(OuterLoopContext context) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't known if it is clear for you what has to be done here but here is a raw extract (to translate) of what is done in H2:

Articulation des 3 load flows pour la simulations des regleurs en charges

  • Pour rappel:
  • -LF1 = gpesTHT PV, grpes HT PV, regleurs fixes
  • -LF2 = gpesTHT PV, grpes HT PQ, regleurs variables
  • -LF3 = gpesTHT PV, grpes HT PV, regleurs fixes (apres discretisation)

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure that we have to follow these 3 steps here. I think that I am going to follow simply what we have done for phase tap changer. It will be easy after that to make a more business and complex outerloop. In the EMF specifications, it is just written:
When calculating the steady state solution, a full Newton Raphson power flow algorithm is to be used, using the following settings:
• Q limits shall be respected (also for slack node/swing bus)
• Transformer tap adjustment is set to enabled
• Switched shunt adjustment is set to enabled
Transformer tap and switch shunt control is used during power flow calculation to enable regulating control during contingency analysis (where the solved system state is used for the base case). In case of non-convergence, switched shunt and transformer tap regulation is disabled and power flow calculation is started again.

Copy link
Member

Choose a reason for hiding this comment

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

Even if not specified you need to follow these 3 steps in order to emulate a realistics tap changer and generation co ntrol behaviour.

Copy link
Member Author

@annetill annetill Jul 8, 2020

Choose a reason for hiding this comment

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

Do we have a way to have a generic outerloop that can be customized easily to simulate real world ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes just one outerloop and a different behaviour at iteration 0, 1 and 2


LoadFlowResult result = loadFlowRunner.run(network, parameters);
assertTrue(result.isOk());
assertVoltageEquals(34.433, bus3);
Copy link
Member Author

Choose a reason for hiding this comment

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

@geofjamg I have a small difference but I am not sure to understand why...

Copy link
Member

Choose a reason for hiding this comment

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

Because we round the r1?

Copy link
Member

Choose a reason for hiding this comment

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

There is something missing in the algo, maybe after rounding and fixing ratio it is to generation behind transformers du help reaching the target voltage?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 5 Code Smells

88.5% 88.5% Coverage
0.0% 0.0% Duplication

@annetill annetill requested a review from geofjamg July 8, 2020 14:47
@annetill
Copy link
Member Author

annetill commented Jul 8, 2020

@geofjamg I have finished my first version. Can you make a review in order to be technically good ? It could be a good starting point for a functional definition of the transformer voltage control outerloop with our colleagues.

tadam50 and others added 24 commits September 18, 2020 10:46
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
annetill and others added 6 commits November 12, 2020 17:06
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -92,7 +92,7 @@ void voltageControlT2wtTest() {
LoadFlowResult result = loadFlowRunner.run(network, parameters);
assertTrue(result.isOk());
assertVoltageEquals(134.281, bus2);
assertVoltageEquals(34.433, t2wt.getTerminal2().getBusView().getBus());
assertVoltageEquals(34.433, t2wt.getTerminal2().getBusView().getBus()); //FIXME: should be 34.427
Copy link
Member Author

Choose a reason for hiding this comment

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

@geofjamg here the FIXME: result is strange.

@annetill annetill requested review from geofjamg and flo-dup November 13, 2020 16:45
annetill and others added 9 commits November 13, 2020 17:56
Remove unit case.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Remove useless functions for PiModel.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -18,7 +18,8 @@
BRANCH_I("i", SubjectType.BRANCH),
ZERO_Q("z_q", SubjectType.BUS),
ZERO_V("z_v", SubjectType.BRANCH),
ZERO_PHI("z_\u03C6", SubjectType.BRANCH);
ZERO_PHI("z_\u03C6", SubjectType.BRANCH),
ZERO_RHO1("z_\u03B1", SubjectType.BRANCH);
Copy link
Contributor

Choose a reason for hiding this comment

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

\u03C1 for rho

@@ -13,6 +13,7 @@
BUS_V("v"),
BUS_PHI("\u03C6"),
BRANCH_ALPHA1("\u03B1" + "1"),
BRANCH_RHO1("rho" + "1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

\u03C1 instead of rho

if (bus.isDiscreteVoltageControlled()) {
equationSystem.createEquation(bus.getNum(), EquationType.BUS_V).addTerm(new BusVoltageEquationTerm(bus, variableSet));
}
if (bus.isDiscreteVoltageControlled() && bus.getDiscreteVoltageControl().getControllers().size() > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you could insert that if in the if above. Or we could add a isDiscreteVoltageSharedControlled method?

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
annetill and others added 3 commits November 26, 2020 11:49
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
private static double getRho1DistributionTarget(LfNetwork network, int num, DistributionData data) {
LfBranch controllerBranch = network.getBranch(num);
LfBranch firstControllerBranch = network.getBranch(data.getFirstControllerElementNum());
return controllerBranch.getPiModel().getR1() - firstControllerBranch.getPiModel().getR1();
Copy link
Member

Choose a reason for hiding this comment

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

As far as I understand we keep the gap between rhos constant during regulation?
Maybe just add a comment somewhere?

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

90.9% 90.9% Coverage
0.0% 0.0% Duplication

@geofjamg geofjamg merged commit 4ff88b8 into master Nov 26, 2020
@geofjamg geofjamg deleted the transformer-voltage-control branch November 26, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants