Skip to content

3. Quickstart Guide PSCAD

MARVIenerginet edited this page Oct 14, 2024 · 161 revisions

System Requirements

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:

  1. Install Python 3.7.2
  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”.
  3. 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.

Preperation

  • Extract or copy all test bench files and your model (.pscx-file) into the same common folder on your PC.


3.1 Model Setup in PSCAD

3.1.1 Import MTB into PSCAD workspace

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


3.1.2 Connect MTB block to POC

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


3.1.3 Connect MTB controls to the Power Plant Controller

  • 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
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Qref Qpf mode
    The 'Qred Qu mode' signal is the reactive power reference when in power factor mode.
  6. Qref mode 3-6
    These outputs can be used to create custom Q modes
  7. Pmode signal
    The 'Pmode signal' is a integer output determining the active power mode. The modes are:
    1. mtb_Pmode = 0: FSM and LFSM disabled
    2. mtb_Pmode = 1: LFSM enabled, FSM disabled
    3. mtb_Pmode = 2: FSM enabled, LFSM disabled
    4. mtb_Pmode = 3: FSM and LFSM enabled
  8. Qmode signal
    The 'Qmode signal' is a integer output determining the reactive power mode. The modes are:
    1. mtb_Qmode = 0: Reactive power mode (Q)
    2. mtb_Qmode = 1: Voltage mode (Qu)
    3. mtb_Qmode = 2: Power factor mode (Qpf)
  9. 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.

Script Execution

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

Script Execution Finished

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

Running individual cases without the script

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.

Clone this wiki locally