Skip to content

2. Quickstart Guide PowerFactory

Rikke edited this page Dec 10, 2024 · 16 revisions

2.1 System Requirements

Developed with PowerFactory 2024 SP3 with Python 3.8.8 Dependencies are listed in requirements.txt and can be installed by entering the command:

python –m pip install –r requirements.txt

In the PC command window.

2.2 Preparation

Extract or copy all test bench files and your model into a common folder on your PC and make a subfolder for Results and Measurement files used later on.

foulder


2.2.1 Tescases excel sheet

1.Fill in the model-specific information of the ‘Settings’ sheet in the ‘testcases.xlsx’ file.

testcases sheet

  1. Select the desired case group tests the project will run through. This is done via the drop-down menu pictured below:

test cases selection

Please consult the Quickstart Guide Excel for further instructions.

2.2.2 Edit the config.ini file

The config.ini file in PP-MTB folder must be edited by including a path to the testcases.xlsx sheet (if you have not placed this sheet within the PP-MTB folder) and likewise for the results folder.

It is also possible to edit the number of parallel computations, default value is 8.

excel_settings

2.3 Model Setup in PowerFactory

2.3.1 Import the MTB into the project.

  1. Right-click the Network Data folder in your PowerFactory model and Import PP-MTB.pfd from the common folder. The project must be inactive to import using this method.

PF_import

  1. Activate the PP-MTB grid and replace the external grid with PP-MTB. Remember to deactivate the existing external grid, as well as any linked dynamic control used for the external grid, by leaving it Out of Service. Do this by selecting the elements and marking them as Out of Service.

pq_connect

Connect the cubicle at POC, formerly used for the external grid, to the element ”meas.ElmSind”. Copy the cubicle from the busbar used for the external grid (Ctrl+C) and then paste the cubicle to the element ”meas.ElmSind”, Terminal j.


2.3.2

There are two main ways to connect the MTB to the model PPC. The first method is to connect the MTB via the execute script, where parameters responsible for the active and reactive power references are attached. If you have used the previous MTB version, this setup resembles the old setup. However, adding and controlling additional signals/parameters in the PPC´s control blocks is now possible. This is further described in Quickstart Guide Excel, and the setup is described in 2.5 Custom cases and signals setup. The second method is to connect the signals from the PPC to the type graphic of the MTB and will be explained in 2.3.2.b

2.3.2.a Fill out the execute script:

  1. Open the execute.ComPython script and add the signal names to the respective value rows in the Input Parameters table.
  2. Add the PPC controller(s) responsible for controlling the active- and reactive power references. Depeding on your specific PPC configuration this can be a single controller or multiple controllers as shown in the picture below.

execute script setup

2.3.2.b Connect the reactive- and active power controllers from the model PPC to the MTB frame:

  1. Open the MTB composite frame type (this can be done by right-clicking and selecting "Mark in Graphic"). Scroll down to the "User blocks" area (shaded area in the navigation pane on the picture below) to insert the PPC active- and reactive power control block types.
howto select the mtb type annotated
  1. Select the controller type to place in the MTB Slot by selecting the slot ( and selecting the type from the project library that corresponds with the types used in the project's PPC active and reactive power controllers.

mtb slot anno blocks before connection

  1. Use the signal wiring to connect the setpoints for P, Q, U, and PF controls to their respective inputs in the P- and Q-control blocks with signals from the plant references (circled in pink).

block connection


2.3.3 MTB composite model setup

  1. Add the ElmDsl models for the PPC P- and Q-control at the bottom of the Net Elements in the MTB composite model "MTB.ElmComp"

2.3.3.1 Edit the Initializer_script.ComDpl DPL script

  1. Add the Pcontrol and Qcontrol from the PPC to the external elements columns.

path initializer

  1. The MTB Q control modes are set up with the default values: 0 = Q reference mode, 1 = Q(U) mode, and 2 = PF (cosphi) mode. If these numbers do not correspond with the values in the project Qmode parameter, the script must be used to change the values. To do this open the script tab in the "initializer_script.ComDpl". Scroll to the bottom of the script and uncomment the section of code that assigns a new value to the Qmode parameter. Make sure that the variable name for the Qmode corresponds with the name in the PPC´s Qcontrol dsl model. It is usually named something with "mode".

  2. If the frequency sensitivity mode is disabled in the project and enabled by changing a parameter value the FSM part of the scrip highlighted in the black box below the Qmode box, should be uncommented and the control mode parameter set to what it is in the Pcontrol element of the project PPC. Make sure that the parameter name for the FSM parameter in the active power control module corresponds with the parameter name after Pcontrol:??????. The variable name is sometimes named FSMenable or somewhere along these lines.

init script anno

2.3.4 Connect the inverter to the MTB

This next part can be done in two ways. The first is to utilize the MTB built-in Station- and Power Frequency controllers and connect the inverter to these. The second uses the qdsl element "initializer_qdsl" to control the inverter ElmGenstat

2.3.4.1 Station- and Power Frequency Controller setup

  1. Open the Station controller under the MTB folder and add the inverter ElmGenstat to the Machines column.

station controller

  1. Open the Power Frequency controller and under the Load Flow tab add the inverter

power-frequency controller

2.3.4.2 Qdsl initializer setup

  1. To initialize the testbench the second method is to use the initializer_qdsl.ElmQdsl. The Qdsl script is located in the MTB composite frame folder. It is by default "Out of Service" and should be "put in service" before running the test bench.

  1. Choose a script type from the MTB library that best fits the setup of the park model and fill in the data that is not "Set by Script"

  1. Select the load flow tap in the script and connect the respective network elements e.g. the park inverter (setting up the simplified model).

2.3.5 Execute script

  1. Edit the "execute.ComPython" script by selecting the python script "execute_pf.py" in the script tab.

The complete filepath must be defined in the field ‘Script file’. Click the ‘…’ button and navigate to the execute_pf.py script.

OBS: There might be some issues with the script while setting up the plots and exporting the result files. To fix this, go to Tools > User Settings > Parallel Computing > Advanced. In this tab check the box "Transfer complete project to all processes".

  1. Pressing Execute, the script does both simulation and plotting of results automatically.

** When executing the script, active variations are consolidated, meaning all changes recorded in the active varitions will be applied to the Network Data Folder. **

2.4 Script Execution Finished

When the script is finished the output window should look like the snapshot below, with the text ”Python Script ‘execute’ successfully executed” at the bottom.

The study cases that were set to "TRUE" in the testcases.xslx document should be visible in the project overview.


  • All simulation results are exported to the 'Results' folder, as seen below. Each has a unique ID to match the study case. The study cases created by the MTB allow users to review all simulations in PowerFactory.

  • The test bench also creates a set of '.csv'-files that can be used with the PP-MTB Plotter to plot the results and, if relevant for your project, compare them with the results from PSCAD. These can also be found in the 'Results' folder.

2.5 Custom cases and signals setup

There are multiple possibilities to connect additional signals/parameters from the PPC active- and reactive power controller or to control other ds models e.g. the protection block in the model.

custom cases setup execute custom cases setup graphical

2.6 Common mistakes

  • Make sure that the P- and Q-control blocks are from the PPC and not from i.e. an inverter