Skip to content

(Temp) Quick Guide PowerFactory

Rikke edited this page Mar 31, 2024 · 8 revisions

System Requirements

Developed with PowerFactory 2022 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. Is this still the case?

Preperation

  • 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.

folder


  • Fill in the model-specific information of the ‘Settings’ sheet in the ‘TestCases.xlsx’ file.

excel_settings


  • Edit the config.ini file in PP-MTB folder by including a path to the testcases excel 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 in the number of parallel computations, default value is 8.

excel_settings

Model Setup in PowerFactory

  • Right-click the Network Data folder in your PowerFactory model and Import PP-MTB.pfd from the common folder.

PF_import

NOTE: The project must be inactive to import using this method.


  1. Activate the PP-MTB grid and replace the external grid with PP-MTB.

pq_connect


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.

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.


  • Connect the reactive- and active power controllers from the model PPC to the MTB... how to do that:

Open the MTB composite frame (this can be done by selecting "Mark in Graphic") and in the "User blocks" area insert the PPC active- and reactive power control block types.

MTB_Type_edit

Select the controller type to place in the MTB Slot by selecting the slot and selecting the type from the model library. Hereafter, manually change 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).

pq_connect


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

  1. Edit the Initializer_script.ComDpl DPL script

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

  • Go to the "Script" tap in the "Initializer_script" and edit the Qcontrol parameters so that they correspond to the values in the model PPC. If the control values correspond to 1, 2, and 3 (in that order) nothing needs changing and the script should look like the picture on the left-hand side. If changes need to be made do as shown on the right-hand side:

pq_connect

The next step can be done in two ways

  • To initialize the testbench the first method is to use the initializer_qdsl.ElmQdsl. The Qdsl script is located in the MTB composite frame folder. It is put out of service and it should be "put in service" before running the test bench.

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

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

If this method causes problems the other method is explained below

----Will be added later 29/03----

  • Lastly, 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’. You can click the ‘…’ button and navitage 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".

Script Execution

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

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

Script Execution Finished

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


  • All results from the simulations are exported to the 'Results' folder as seen below, each with a unique ID to match the study case. All simulations can also be reviewed in PowerFactory through the study cases created by the test bench.

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

Common mistakes

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