-
Notifications
You must be signed in to change notification settings - Fork 19
3. Quickstart Guide PSCAD
Developed with PSCAD release 5.0.2 (2023/04/26) with Python 3.7.2 (embedded) dependent on python packages as specified in requirements.txt
Since the script uses the embedded PSCAD python environment (for now #109), the external packages cannot be installed and imported in the standard way. The easiest way around this is the following procedure:
- Install Python 3.7.2
- Install requirements from PSCAD requirements.txt into the python 3.7.2 installation (or a virtual environment). This can be done by executing “python -m pip install -r requirements.txt”.
- Adapt the path in config.ini so it points to the python 3.7.2 installations site-packages folder. The default path is
C:\Program Files\Python37\Lib\site-packages.
- Extract or copy all test bench files and your model (.pscx-file) into the same 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
- Open a workspace with all the models and libraries required for running simulations. This includes ETRAN libraries and any resources.
- Load in the MTB.pslx project into the workspace. Do this by right-clicking on the Projects folder, click 'Add Existing Project...'.
- Load in the interface.f file. Do this by right-clicking the Resources folder, click 'Add' -> 'Source Code (*.f, *.for, *.f90, *.c, *.cpp)'.
- Load in the execute_pscad.py file. Do this by right-clicking the Resources folder, click 'Add' -> 'Script\Apps (*.py, *.exe, *.bat)'.
- Disconnect and disable the power grid from POC in the model. Make sure to keep any measurements present at POC (Shown below in the red dotted box.). Otherwise the model might not work properly.
- Copy the test bench from the MTB project into the model. Do this by right-clicking the MTB block and clicking 'Copy'. Then go to the model, right click and click 'Paste'. The last step is to connect the MTB block to the POC.
- You can see the different signals the MTB outputs by right clicking on the MTB block and selecting 'Edit Parameters...'. Then go to 'Signal outputs'
- The different output signals are summarized below
-
Pref signal
The 'Pref signal' is the active power reference. It is given in per unit with a base value determined by the 'Pn' value in the Settings sheet in the testcases.xlsx excel document. -
Qref signal
The 'Qref signal' is the reactive power reference for both reactive power control (Q), voltage control (Qu), and power factor control (Qpf) mode. It changes its value based on the Q mode selected at the given time. It is given in per unit when in Q or Qu mode. In Q mode the base value is the 'Pn' value in the Settings sheet. In Qu mode the base value is the 'Un' value in the Settings sheet. In Qpf mode the value is the desired power factor. -
Qref Q mode
The 'Qred Q mode' signal is the reactive power reference when in reactive power control mode. It is given in per units with a base value determined by the 'Pn' value in the Settings sheet. -
Qref Qu mode
The 'Qred Qu mode' signal is the reactive power reference when in voltage control mode. It is given in per units with a base value determined by the 'Un' value in the Settings sheet. -
Qref Qpf mode
The 'Qred Qu mode' signal is the reactive power reference when in power factor mode. -
Qref mode 3-6
These outputs can be used to create custom Q modes -
Pmode signal
The 'Pmode signal' is a integer output determining the active power mode. The modes are:- mtb_Pmode = 0: FSM and LFSM disabled
- mtb_Pmode = 1: LFSM enabled, FSM disabled
- mtb_Pmode = 2: FSM enabled, LFSM disabled
- mtb_Pmode = 3: FSM and LFSM enabled
-
Qmode signal
The 'Qmode signal' is a integer output determining the reactive power mode. The modes are:- mtb_Qmode = 0: Reactive power mode (Q)
- mtb_Qmode = 1: Voltage mode (Qu)
- mtb_Qmode = 2: Power factor mode (Qpf)
-
Custom signal 1-10
These outputs can be used to create custom signal outputs. In the testcases.xlsx excel document they are used by writing e.g. 'Signal 1' in the type column of a given Event. They can be used to for example implement System Guard control or lower the available solar cell radiance.
- Right-click the python script in the model and press 'Run' and the test bench will automatically run and plot the cases defined in 'TestCases.xlsx'.
- Once the script has finished and the simulation runs are complete, individual results can be view under 'Simulation Sets' -> 'PMR' -> 'Model Name' with numbers corresponding to the rank of the case set in 'TestCases.xlsx'. Acces the MTB block to view different plots. Keep in mind, that this is only possible until you close the application.
- The test bench also creates a set of '.csv'- and corresponding '.inf'-files that can be used with the PP-MTB Plotter to plot the results and optionally compare it with results from PowerFactory. These files are found under the folder 'Output'.
Individual cases can be run by replacing the "Rank#" components in both the "Model testbench (MTB)" and "Plant control" blocks with a constant integer with the desired case id.


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: simuleringsmodeller@energinet.dk