-
Notifications
You must be signed in to change notification settings - Fork 10
2. Quickstart Guide PowerFactory
Developed with PowerFactory 2024 SP4 with Python 3.8.8 denpendent on Python packages as specified in requirements.txt
The dependencies can be installed by executing the command "python –m pip install –r requirements.txt"
Note: An example setup of the MTB can be found in the folder setup_examples named MTB_Setup_Example.pfd. This is purely an example to showcase the setup of the MTB and the model used is not in any way representative of a compliant model or plant.
Extract or copy all test bench files into a common folder on your PC.
- Fill in the model-specific information in the 'Settings' sheet in the testcases.xlsx file. The Excel guide can be found here Quickstart Guide Excel
- The config.ini file in MTB folder can be edited to specify a path specific path of the testcases.xlsx sheet if it is not placed within the common folder. The same is true for the results folder.
-
Right-click the Network Data folder in your PowerFactory model and Import MTB.pfd from the common folder. The project must be inactive to import using this method.
-
Activate the MTB grid and replace the external grid with MTB. Remember to deactivate the existing external grid, as well as any linked dynamic control used for the external grid. 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 and then paste the cubicle to the element ”meas.ElmSind”, Terminal j.
There are two main ways to connect the MTB to the model PPC both found in the following sections.
The first method is to connect the MTB via the execute script, where reference signals and the corresponding models are linked.
The second method is to assign the PPC and connect the signals to the MTB via the graphic of the MTB frame.
To add additional custom signals, please refer to 2.5 Custom cases and signals setup
Note that the execute script has other relevant parameters regardless of the method for connecting the MTB to the model PPC. For instance the "Only Setup" and "Post_run_backup". If the value in "Only_setup" is set to 1, the MTB will only set up the selected cases and plots but not run and output any result files. If "Post_run_backup" is set to 1, the MTB will create a project version right after the MTB has been run.
- Open the execute.ComPython script and add the active and reactive PPC controller signal names to the respective value rows in the Input Parameters table.
- Add the PPC controller block(s) responsible for controlling the active- and reactive power references. Depending on your specific PPC configuration, this can be a single or multiple blocks, as shown in the picture below.
Note: Using this setup method requires that the plant references needed to be connected to the User blocks are modeled as signals and not internal parameters in the Pcontrol and Qcontrol blocks of the PPC.
- 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.
- Select the controller type to place in the MTB Slot by editing the slot and selecting the relevant type from the project library that corresponds with the types used in the project's PPC active and reactive power controllers.
- 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.
- 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"
- Add the Pcontrol and Qcontrol from the PPC to the external elements columns.
-
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. Ensure 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".
-
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. Ensure that the FSM parameter's parameter name 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.
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 them to the inverter element. The second uses the qdsl element "initializer_qdsl" to control the inverter ElmGenstat.
- Open the Station controller under the MTB folder and add the inverter ElmGenstat to the Machines column.
- Open the Power Frequency controller, and under the Load Flow tab, add the inverter.
- To initialize the testbench, the second method uses 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.
- Choose a Qdsl 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".
By default the "mtb_init_example_4" is selected and recommended for use. This type requires the input of the user being PPM upper current limit in p.u., the plant nominal reactive power in Mvar and the upper and lower reactive power limits of the plant in p.u. all at the bottom of the parameter pane.
- Select the load flow tap of the Qdsl block and connect the respective network elements, e.g., the park inverter (setting up the simplified model).
- Edit the "execute.ComPython" script by selecting the Python script "execute_pf.py" in the script tab. The complete file path 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. Go to Tools > User Settings > Parallel Computing > Advanced to fix this. In this tab, check the box "Transfer complete project to all processes".
- 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 variations will be applied to the Network Data Folder.
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 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 in the picture 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 creates a set of '.csv'-files that can be used with the MTB Plotter to plot the results and, if relevant to your project, compare them with the results from PSCAD. These can also be found in the 'Results' folder.
If you wish to record more signals or parameters from your model, like monitoring the inverter's active and reactive power output or other DSL blocks, such as protection blocks or PLLs, you can do so from the execute script.
-
Scroll down to the Measurement object inputs starting from line 18 in the Input parameters table. Here you must give your object a name and the parameter or list of parameters you wish to record the results of. See the picture below.
-
Add the object from which you want to record the signal values to the External objects table in the same script. Make sure that the object is placed in the correct Meas_obj_X line that corresponds with the chosen string in the Input parameters table:
The MTB allows for changing additional custom signals specific for a given PPC. It is possible to connect and control additional signals/parameters from the PPC or other DSL models, such as the protection block in the model either through the execute script or the MTB frame itself. The custom signals can then be changed in the testcases.xslx sheet for each case they are needed.
To setup custom signals from the execute script, rows 12-16 can be used for this.
- Input the signal you wish to control to the attribute row and the needed scaling value. The MTB works on a p.u. scale.
- Connect the object from which the signal is from in the external objects pane.
From the MTB frame graphic:
- Copy the existing slots from the User Blocks section of the frame and place them down by the Custom signals slots. You can also select a new one from the Blocks and Signals under drawing tools. The MTB frame type's Graphical Freeze Mode (the lock icon) must be unlocked in both cases.
- Connect the MTB signals to the desired signal input in the object block(s).
- Make sure that the P- and Q-control blocks are from the PPC, not the inverter when setting up the MTB.
For further questions or help, please check if the README or the Quickstart Guides contains the answer.
Otherwise, please contact the Energinet simulation model team: [email protected]