Skip to content

4. Quickstart Guide Plotter

Peter Jan Randewijk edited this page Aug 7, 2025 · 107 revisions

4.1 Preperation

The MTB Plotter is a tool that allows plotting of the generated RMS and EMT results.

The tool is located in the folder "plotter" which includes the main script "plotter.py", subscripts, a figure setup file and a configuration file.

Before running the main script, you should configure both the figure setup file and the configuration file itself.

4.2 Configuration of config.ini [MTB > v2.0]

The plotter configuration file, config.ini,

image

contains the following modifiable parameters:

Parameter Type Default Description
[config]
resultsDir string results The relative path for plotter results directory
genHTML boolean True Whether or not to generation of HTML result files
genlmage boolean True Whether or not to generation of image result files
imageFormat string png Image format, either png or jpeg
htmlCloumns integer 1 Number of HTML columns produced
imageColumns integer 3 Number of image columns produced
threads integer 10 Number of Python threads for producing result files
pfFlatTime real 0.1 Negative offset of PowerFactory results relative to O
pscadlnitTime real 3.5 Negative offset of PSCAD results relative to O
optionalCasesheet string -- Path to testcases.xlsx (optional)
[Simulation data paths]
PathlLegendName string ..\export\MTB_XXX Path1 for RMS or EMT data directory, e.g. RMS
Path2LegendName string ..\export\MTB_YYY Path2 for RMS or EMT data directory, e.g. EMT
Path3LegendName string -- Path3 for RMS or EMT data directory
etc.

Note that paths under the section header [Simulation data paths] can be appended to compare additional results from multiple models. Simply add a new line matching the folder containing the data one wants to plot.

The strings Path1LegendName, Path2LegendName, etc. used for each data path will be appended in front of all the signals names from that specified data path. It could be as simple as e.g.

  • EMT
  • RMS

or more elaborate if different versions of RMS and EMT results are being plotted to compare results from different versions, e.g.

  • RMS_V04,
  • RMS_V05,
  • EMT_V04,
  • EMT_V05,
  • etc.

The plotter tool automatically categorizes results found in paths of the [Simulation data paths] section header. An RMS result file is defined as a .csv file with the leftmost column named b:tnow in s and an EMT_INF result file (metafile) is defined as an .inf file with the first line starting with PGB(1). _EMT_INF_datafiles (*.csv) are assumed to be in the same folder as the .inf metafile. All files with extension .psout are assumed to be of type EMT_PSOUT, the new binary-based PSCAD output. The plotter tool also supports .csv and compressed .csv output generated by the psout_to_csv.py script

Type Enum Description
RMS 0 PowerFactory standard .csv output
EMT_INF 1 PSCAD legacy .inf/.csv output
EMT_PSOUT 2 PSCAD new style .psout output
EMT_CSV 3 PSCAD .psout -> .csv support
EMT_ZIP 4 PSCAD .psout -> .zip, .gz, .bz2 and .xz support

4.3 Configuration of figureSetup.csv

The figure setup file, figureSetup.csv, is used to configure individual plot pane. Three EMT and RMS signals can be specified in each plot pane. A set of predefined signals have already been setup containing the following parameters:

figure title units emt_signal_1 emt_signal_2 emt_signal_3 rms_signal_1 rms_signal_2 rms_signal_3 down_sampling_method gradient_threshold include_in_case exclude_in_case
1 Vpp pu MTB\meas_Vab_pu MTB\meas_Vbc_pu MTB\meas_Vca_pu meas\s:Vab_pu meas\s:Vbc_pu meas\s:Vca_pu gradient 0.5
2 Vpg pu MTB\meas_Vag_pu MTB\meas_Vbg_pu MTB\meas_Vcg_pu meas\s:Vag_pu meas\s:Vbg_pu meas\s:Vcg_pu gradient 0.5
3 Vseq pu MTB\fft_pos_Vmag_pu MTB\fft_neg_Vmag_pu meas\s:pos_Vmag_pu meas\s:neg_Vmag_pu gradient 0.5
4 Itotal pu MTB\meas_Ia_pu MTB\meas_Ib_pu MTB\meas_Ic_pu meas\s:Ia_pu meas\s:Ib_pu meas\s:Ic_pu gradient 0.5
5 Iactive pu MTB\fft_pos_Id_pu MTB\fft_neg_Id_pu meas\s:pos_Id_pu meas\s:neg_Id_pu gradient 0.5
6 Ireactive pu MTB\fft_pos_Iq_pu MTB\fft_neg_Iq_pu meas\s:pos_Iq_pu meas\s:neg_Iq_pu gradient 0.5
7 Ppoc pu MTB\P_pu_PoC MTB\mtb_s_pref_pu meas\s:ppoc_pu gradient 0.5
8 Qpoc pu MTB\Q_pu_PoC MTB\mtb_s_qref meas\s:qpoc_pu gradient 0.5
9 F Hz MTB\pll_f_hz meas\s:f_hz gradient 0.5
10 Id_pll pu MTB\pll_pos_Id_pu MTB\pll_neg_Id_pu gradient 0.5
11 Iq_pll pu MTB\pll_pos_Iq_pu MTB\pll_neg_Iq_pu gradient 0.5
12 Terminal pu $Unit$\unit_fft_pos_Id_pu $Unit$\unit_fft_pos_Iq_pu $Unit$\unit_fft_pos_Vmag_pu Unit_1\m:i1P:bus1 in p.u. Unit_1\m:i1Q:bus1 in p.u. Unit_1\m:u1:bus1 in p.u. gradient 0.5
13 Instantaneous Voltage (pg) kV MTB\meas_Vag_kV MTB\meas_Vbg_kV MTB\meas_Vcg_kV gradient 0.5 1,2,3,4,5,6,7,8,9,10,98
14 Instantaneous Current (kA) kA MTB\meas_Ia_kA MTB\meas_Ib_kA MTB\meas_Ic_kA gradient 0.5 1,2,3,4,5,6,7,8,9,10,98

The default setup contains:

  • Phase-phase voltages at POC
  • Phase-ground voltages at POC
  • Positive- and Negative-sequence voltages at POC
  • Total currents at POC
  • Id current at POC
  • Iq current at POC
  • Active power at POC
  • Reactive power at POC
  • Frequency at POC
  • Id current at POC measured by pll
  • Iq component current at POC measured by pll
  • Id and Iq currents, and positive-sequence voltage at a terminal
  • Instantaneous Voltage from the EMT model
  • Instantaneous Current from the EMT model

For adding additional plots, append a row and add a figure number and a title. Three EMT signals, emt_signal_1, emt_signal_2 and emt_signal_3 and three RMS signals, rms_signal_1, rms_signal_2 and rms_signal_3 are per figure, per simulation data path.

The down_sampling_method and gradient_threshold are set by default to "gradient" and "0.5" respectively.

Certain plots can be included or excluded from certain cases, simply the comma-seperated case numbers under include_in_case or exclude_in_case.

4.4 Script Execution

Execute the "plotter.py" script after config.ini and figureSetup.csv have been configured. The results will be output to the default path of the config.ini file. This is set as "results" meaning a folder is created from the location of the script named "results" that will contain the files that are created by the script.

4.4.1 Result Examples

The results should look similar to the examples below. Keep in mind, that project-data is paired and plotted by the Case Rank, in this example Case Rank 07 is shown plotted, with all paths defined in the config.ini file under the "[Simulation data paths]" section header containing the ID 07 is plotted together. You must manually include only the relevant data in the "[Simulation data paths]" that you want to plot together.


For the HTML results, note that you are able to navigate between the hmtl results by utilizing the buttons at the top, either navigating to the previous or the next rank number in relation to the testcases.xlsx sheet. To enable quicker navigation between results further away from eachother in terms of rank number, make use of the "More Ranks" drop-down menu, this includes a list of every fifth plot that can be navigated to.

Additionally, shortcuts are added to navigate through HTML result ranks:

  • Alt + Page Up = Navigates to previous rank.
  • Alt + Page Down = Navigates to next rank.
  • Alt + H = Displays help message.

Clone this wiki locally