0% found this document useful (0 votes)
905 views532 pages

PSCAD Users Guide PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
905 views532 pages

PSCAD Users Guide PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

USER’S GUIDE

on the use of PSCAD

PSCAD
Power Systems Computer Aided Design

244 Cree Crescent, Winnipeg, Manitoba, Canada R3J 3W1


Copyright© 2003 Manitoba HVDC Research Centre Inc. All rights reserved.

Information in this document is subject to change without notice. No part of this


document may be reproduced in any form or by any means, electronically or
mechanically, for any purpose without the express written permission of Manitoba
HVDC Research Centre Inc.

PSCAD is a registered trademark of Manitoba HVDC Research Centre Inc.

EMTDC is a trademark of Manitoba Hydro, and Manitoba HVDC Research Centre


Inc. is a registered user.

Microsoft, Windows 95, Windows 98, Windows NT, Windows 2000, Windows ME,
NT, XP, and Developer Studio are the registered trademarks or trademarks of
Microsoft Corporation in the United States and other countries.

DEC and DEC Fortran are trademarks of Digital Equipment Corporation.

UNIX is a registered trademark in the United States and other countries licensed
exclusively through X/Open Company.

Netscape and Netscape Navigator are registered trademarks of Netscape


Communications Corporation in the United States and other countries.

MATLAB and Simulink are registered trademarks of The MathWorks, Inc.

Compaq and the names of Compaq products referenced herein, are either
trademarks and/or service marks or registered trademarks and/or service marks of
the Compaq Computer Corporation.

WinZip is a registered trademark of WinZip Computing, Inc.

Other product and company names mentioned herein may be trademarks or


registered trademarks of their respective holders.

Print history:

• February 3, 2003, Version 4.0.0, First printing.


• March 21, 2003, Version 4.0.1
• July 18, 2003, Version 4.0.2, Second printing.
• December 23, 2003, Version 4.0.3
• April 30, 2004, Version 4.1.0, Third printing.
Foreword 1
PSCAD V4 is a major product upgrade from the effort and vision of a small team of
professionals and programmers. Building on its predecessor, PSCAD/EMTDC V3, version
4’s mission is to provide visual power system simulation tools that are both graphically
visual and easy to use. With a large amount of user feedback, many new features exist
in V4 that will make power system circuit development time and transient study more
efficient, error free, and practical.

The application requirements for PSCAD V4 were simple. The migration of existing V3
data must be forward compatible so that our users do not loose their data investment.
The new platform must provide better tools for creation and maintenance of circuits,
and new features to support advanced studies. PSCAD V4 must be robust and perform
at a level that exceeds PSCAD/EMTDC V3. In all of these, we have exceeded our
expectations.

As a large percentage of our client base has adopted the Microsoft Windows platform
for their desktop studies, PSCAD also has migrated to become a fully Microsoft
compliant product. Much of the look and feel derives itself from the standard Windows
MFC calls. The decision to adopt this standard was not done lightly and we have strived
to reduce our exposure and reliance of the Microsoft platform by employing only a thin
MFC library layer.

With this new product, PSCAD has adopted a new application environment and plotting
tool kit developed by Z Systems. This tool kit provided us several advantages in drawing
tools, application environment control, plotting and control tools. ZSystems also has
developed a standalone analysis product called LiveWire that is an alternative to other
post-processing packages. Many of our V2 users may find LiveWire a suitable
replacement for the Unix based Multiplot bundled with PSCAD/EMTDC V2.

The last two years have proven challenging to our programmers as they migrated to the
new tools; however, the additional power and technology has allowed them to embed a
much higher level of sophistication within PSCAD. Looking to the future, users will see
new phasor-based solutions engines, and new visual tools to complement the power of
EMTDC within the same environment.

The possibilities are exciting and endless.

Paul Wilson, P. Eng.


Managing Director
January 2003
This masterpiece is dedicated to all the hardworking,
programmers, engineers, students, professors and
support staff who made this program possible.
Foreword 2
Fifteen years before PSCAD, the process of simulation was carried out using a traditional
command line program approach and hand crafted data files. The engine called EMTDC
was developed to solve the electrical networks in the time domain, using a new
approach to the problem. The program was accurate and effective, but like all programs
of its type, it required an intimate knowledge of the program procedures, an expert
knowledge of electrical systems, and a great deal of time. This limited access of the
program to all but those experts well funded and well versed in the black art of
simulation research.

Fifteen years after its inception, and some ten years after it was first created for
commercial applications, PSCAD continues to evolve. In the early years, it was viewed
primarily as a tool to improve coding reliability and to make it easier to work with the
simulation engine EMTDC. But few at the time could have realized the power and
potential of bringing a visual simulation interface to the traditional procedural simulator.
No longer did an engineer need to be an expert programmer to create a simulation.
Rather, the engineer could draw the circuit and hand over the nuts and bolts to the
software, freeing up both time and ensuring consistency and reliability.

Version 4 is not just the latest generation of the simulator. It represents a concerted
effort to face the challenge of creating a product that is both powerful enough for the
experts, and intuitive enough for the beginner. The migration path from previous
versions has been kept simple, ensuring users can keep their valuable data investment.
To maintain the interface current, much effort has been put into migrating the previous
body of work into the latest windowing interfaces.

To bring advanced features to the hands of our users, PSCAD has adopted a new
component-drawing environment and proven graphing tools developed by Z Systems.
These tools provided us with several advantages in drawing, environment control and
reliability. The work was done in a fraction of the implementation time required by the
conventional approach, maximizing resources for simulation development. Z Systems has
also developed a standalone post-analysis product that many of our users will find a
suitable alternative to Unix based Multiplot bundled with earlier versions.

Less than two years ago, the next generation of PSCAD was drafted. Today, the team
has delivered on its objectives and is proud of the result. We sincerely believe it to be a
truly powerful, versatile product that you can count on for your work, and the solid
foundation for even more advanced tools to come.

Craig Muller P. Eng.


PSCAD Team Leader
January 2003
PSCAD

Table of Contents
About This Guide ........................................................................... xxv
Organization .................................................................................xxv
Documentation Conventions ....................................................... xxvii
References ............................................................................. xxvii
Notes ..................................................................................... xxvii
Important Sections .................................................................. xxvii
Text Boxes .............................................................................. xxvii

Chapter 1: Welcome to PSCAD .......................................................1


What is PSCAD? ............................................................................. 2
What’s New in PSCAD V4? .............................................................3
V3/V4 Comparison Tables ............................................................5
Appearance and Terminology ......................................................6
Keyboard Shortcuts ......................................................................7
New Master Library Models .........................................................8
Dimension Limits ........................................................................... 14
PSCAD Users’ Group ..................................................................... 16
Membership .............................................................................. 16
Facilities .................................................................................... 16
E-Mail List Server ................................................................... 16
Web Site ............................................................................... 16
Contacting Us ............................................................................... 17
PSCAD Support Services ............................................................ 17
PSCAD Sales ............................................................................. 17

Chapter 2: Installation and Setup ................................................ 19


Hardware and Software Requirements ........................................... 19
Fortran Compilers .......................................................................... 20
Licensing ....................................................................................... 20
Multi-User Licensing .................................................................. 20
Single-User Licensing ................................................................. 21
Trial Licensing ............................................................................ 22
Hardware Locks (Dongles) ......................................................... 23
License Key ............................................................................... 23
License Manager Software ............................................................ 24
Standalone License Manager ..................................................... 24
Maintenance and Support ......................................................... 24
Local License Manager .............................................................. 25

PSCAD User’s Guide vii


Table of Contents

Trial License Manager ............................................................... 25


Installing V4 for the First Time ....................................................... 25
Installing PSCAD ....................................................................... 25
Installing the License Manager .................................................. 31
Possible Messages: .................................................................... 34
Troubleshooting: ........................................................................ 39
License File and License Database Do Not Match: ..................... 39
Installing EGCS/GNU Fortran ...................................................... 41
Installing LiveWire/LiveWire Lite ................................................. 41
Upgrading Your V4 Software ......................................................... 41
Upgrading a Previous Installation with a Patch ........................... 41
Modifying a Previous Installation ................................................ 43
Repairing a Previous Installation ................................................. 47
Uninstalling ............................................................................... 50
Finalizing Your Installation ............................................................. 52
Adding a Shortcut to the PSCAD Executable ............................. 53
Running PSCAD for the First Time ................................................. 53
Failed to Connect to License Manager Server ............................ 54
Running a Simulation Generates a ’make –f‘ or ’nmake –f‘ Error
55
Setting Compiler Environment Variables ........................................ 56
EGCS/GNU Fortran 77 Compiler ................................................ 56
Digital Fortran 5 Compiler ......................................................... 57
Compaq Fortran 6 Compiler ...................................................... 57
Trial Licenses ................................................................................. 58
Requesting a Trial License .......................................................... 58
Installing a Trial License ............................................................. 62
Adding / Upgrading StandAlone license manager Licenses ............ 65
Adding / Upgrading a Single-User License ..................................... 66
Changing Active Licensing Settings ............................................... 67
Changing License Manager Host ............................................... 68
Changing Active License Type ................................................... 68
Viewing Active License Information ............................................... 69
Getting Licensing Information ........................................................ 70
Stand-Alone License Manager Information ................................ 70
Active Licensing Information ...................................................... 71
Manually Starting the License Manager ......................................... 71
Manually Stopping the License Manager ....................................... 72
Workspace Settings ....................................................................... 73
Projects ..................................................................................... 73
Initialization ............................................................................... 74
HTML Browser ........................................................................... 74
Views ........................................................................................ 74

viii PSCAD User’s Guide


PSCAD

Circuit View .............................................................................. 75


Script Editor ........................................................................... 76
Graph and Control Panel Style ............................................... 76
Fortran ...................................................................................... 78
Fortran Compiler ....................................................................... 79
Matlab ...................................................................................... 80
Interface Settings ................................................................... 80
License ...................................................................................... 81
Trial License .......................................................................... 82
Single User License ................................................................ 82
Available License(s) ............................................................... 82
Active License ....................................................................... 82

Chapter 3: The PSCAD Environment ............................................ 85


Terminology and Definitions .......................................................... 85
Components .............................................................................. 85
Definitions ............................................................................. 86
Instances ............................................................................... 86
Modules .................................................................................... 86
Projects ..................................................................................... 86
Case ..................................................................................... 87
Library ................................................................................... 87
Tutorial: My First Simulation ......................................................... 87
Starting PSCAD ......................................................................... 87
Title, Menu and Main Tool Bar .................................................. 88
Title Bar and Active Project .................................................... 88
Menu Bar and Menu Items .................................................... 88
Toolbar Buttons .......................................................................... 89
Workspace and Output Windows ............................................... 89
Loading a Case Project .............................................................. 90
Running a Simulation ................................................................. 92
Printing the Circuit ..................................................................... 94
The Workspace ............................................................................. 94
Moving and Resizing the Workspace Window ............................ 95
The Projects Section .................................................................. 95
Main Page Branch ..................................................................... 96
Definitions Branch ..................................................................... 97
Active Project .......................................................................... 101
The Master Library .................................................................. 102
The Runtime Section ............................................................... 103
Modules View ......................................................................... 104
Runtime Objects ...................................................................... 106
Observers ................................................................................ 110

PSCAD User’s Guide ix


Table of Contents

Groups View ............................................................................ 112


Radio Links View ..................................................................... 113
The Files Section ..................................................................... 113
Transmission Lines and Cables ................................................. 115
RTP/COMTRADE Recorder ....................................................... 117
The Output Window .................................................................... 118
Moving and Resizing the Output Window ................................ 118
Errors and Warnings ................................................................ 119
Build ........................................................................................ 119
Runtime .................................................................................. 120
Locating the Problem Source ................................................... 120
Search ................................................................................. 120
The Design Editor ........................................................................ 120
Viewing Windows .................................................................... 121
Circuit ................................................................................. 121
Graphic ............................................................................... 121
Parameters .......................................................................... 121
Script ................................................................................... 122
Fortran ................................................................................ 122
Data .................................................................................... 122
Signals ................................................................................ 122
Nodes ................................................................................. 122
Other Important Features ............................................................. 122
Menus ..................................................................................... 122
Main Menu Bar ................................................................... 123
Right-Click Pop-Up Menus ................................................... 124
Library Pop-Up Menus ......................................................... 124
Toolbars .................................................................................. 125
Main Toolbar ....................................................................... 125
Status Bar ............................................................................ 127
Rotation Bar ........................................................................ 127
Settings Bar ......................................................................... 128
Electrical Palette .................................................................. 128
Control Palette .................................................................... 129
Graphic Palette .................................................................... 131
Parameters Bar .................................................................... 131
Script Bar ............................................................................. 133
Keyboard Shortcuts .................................................................. 133
General ............................................................................... 133
Wires ................................................................................... 135
Plotting ................................................................................ 135
Window Settings ..................................................................... 137
Tab Navigation ........................................................................ 137

x PSCAD User’s Guide


PSCAD

PSCAD Temporary Directories ..................................................... 138


PSCAD On-Line Help System ....................................................... 138
Accessing Help ........................................................................ 138
Look and Feel ......................................................................... 139
The Help Toolbar ..................................................................... 140
The Navigation Pane ............................................................... 140
Contents ............................................................................. 140
Index ................................................................................... 141
Search ................................................................................. 141
Favourites ............................................................................ 142
The Main Viewer ..................................................................... 143
Tutorial Projects ........................................................................... 143

Chapter 4: Basic Operations and Features ................................ 147


Projects ....................................................................................... 147
Creating a New Project ........................................................... 147
Loading a Project ..................................................................... 148
Opening the Project Main Page ............................................... 149
Setting the Active Project ........................................................ 150
Saving Project Changes ........................................................... 150
Save Project As… ................................................................ 151
Saving as PSCAD V3 Format ............................................... 153
Unloading a Project ................................................................. 153
Editing Project Settings ............................................................ 154
Changing Duration of Run ................................................... 156
Changing the Solution Time Step ........................................ 157
Changing the Channel Plot Step .......................................... 157
Cleaning the Temporary Directory ........................................... 157
Opening and Viewing a Project ................................................ 157
Navigating Through an Open Project ....................................... 158
Scroll Bars ........................................................................... 158
Arrow Keys .......................................................................... 158
Panning (Dynamic Scroll) Mode ........................................... 158
Moving In and Out of Modules ............................................ 158
Tabs .................................................................................... 160
Zooming .................................................................................. 160
Refresh .................................................................................... 161
Editing Module Settings ........................................................... 161
Display Options .................................................................... 163
Fortran Code Sequencing .................................................... 163
Running a Simulation ............................................................... 163
Viewing Errors and Warnings ................................................... 164
Finding the Message Source ................................................ 164

PSCAD User’s Guide xi


Table of Contents

Taking a Snapshot ................................................................... 165


Manual ............................................................................... 165
Pre-Defined ......................................................................... 165
Starting from a Snapshot ......................................................... 166
Saving Output to File ............................................................... 166
Editing the Page Setup ............................................................ 167
Printing a Module Page ........................................................... 168
Printing Selected Objects ......................................................... 168
Copy Group as Meta-File ......................................................... 169
Components and Modules ........................................................... 170
Selecting and Grouping Objects ............................................... 170
Adding Components to a Project ............................................. 170
Adding Multiple Instances of a Component ......................... 171
Moving or Dragging an Object ................................................. 171
Cut/Copy/Paste ....................................................................... 171
Rotate/Mirror/Flip ..................................................................... 172
Deleting Objects ...................................................................... 172
Undo and Redo ....................................................................... 172
Connecting Components Together ........................................... 172
Transferring Data Into and Out of Modules .............................. 174
Control Signals .................................................................... 174
Radio Links .......................................................................... 176
Electrical Nodes ................................................................... 176
Wire Mode .............................................................................. 178
Resizing Wires ......................................................................... 178
Editing Component Properties ................................................. 178
Changing Property Values .................................................... 180
Viewing/Saving Component Data ............................................ 181
Viewing Component Data ....................................................... 181
Formatting Component Data ................................................... 182
Saving Component Data to a File ............................................ 182
Changing to Single-Line View .................................................. 183
Creating the First Instance of a Definition ................................ 183
Compiling an Individual Module .............................................. 184
Importing/Exporting Definitions ................................................ 184
Import a Definition .............................................................. 184
Export a Definition ............................................................... 185
Tutorial: Creating a New Project .................................................. 185
Adding a New Case Project ..................................................... 185
Saving the Project ................................................................... 186
Opening the Project Main Page ............................................... 187
Opening the Master Library ..................................................... 187
Assembling a Voltage Divider Circuit ....................................... 188

xii PSCAD User’s Guide


PSCAD

Locating the Single-Phase Source ........................................ 188


Add and Assemble .............................................................. 189
Editing the Remaining Component Properties ...................... 190
Plotting Results ........................................................................ 191
Adding a Graph Frame ........................................................ 191
Adding Another Overlay Graph and Curve ........................... 194
Editing the Graph Properties ................................................ 195
Running the Project ................................................................. 196
Creating a New Component or Module ....................................... 196
Using the Component Wizard .................................................. 197
Step 1 ................................................................................. 198
Step 2 ................................................................................. 198
Step 3 ................................................................................. 199
Step 4 ................................................................................. 200
Creating a Default Module .................................................. 201
Drag and Drop ............................................................................ 201
Copy a Component Instance ................................................... 201
Adding a Curve to a Graph ...................................................... 202
From an Output Channel ......................................................... 202
............................................................................................... 202
From a Runtime Object ............................................................ 202
............................................................................................... 202
Adding a Meter to a Control Panel .......................................... 203
From an Output Channel ......................................................... 203
............................................................................................... 203
From a Runtime Object ............................................................ 203
Adding a Control Interface to a Control Panel ......................... 203
From a Controls Component .................................................... 204
From a Runtime Object ............................................................ 204
Create a Component Instance ................................................. 204
Help ............................................................................................ 204
Accessing the Online Help System ........................................... 205
Using Flyby Help Windows ....................................................... 205
Searching .................................................................................... 206
Control Settings ........................................................................... 207
Storing Settings to a Template ................................................. 207
Synchronizing Default Settings ................................................. 208
Duplicate, Rename or Delete Template ................................... 208
Template Settings Viewer ........................................................ 209
Features and Functions ............................................................ 209
Setting Global Constants ............................................................. 211
EMTDC Output Files .................................................................... 212
Creating Output Files ............................................................... 213

PSCAD User’s Guide xiii


Table of Contents

Multiple Output Files ............................................................... 213


Column Identification and the Information File ......................... 213

Chapter 5: Online Plotting and Control .................................... 215


Preparing Data for Control or Display .......................................... 215
Channelling Output Data ......................................................... 216
Controlling Input Data ............................................................. 216
Graph Frames .............................................................................. 217
Adding a Graph Frame ............................................................ 218
Moving and Resizing a Graph Frame ....................................... 218
Cut/Copy Frames ..................................................................... 218
Paste Frame ............................................................................ 219
Adjusting Frame Properties ...................................................... 219
Adjusting Horizontal Axis Properties ..................................... 220
Graphs ........................................................................................ 222
Adding Graphs to a Graph Frame ............................................ 222
Graph Order ............................................................................ 223
Cut/Copy Graphs ..................................................................... 223
Paste Graph ............................................................................ 224
Copy Data to Clipboard ........................................................... 224
Overlay Graphs ........................................................................ 225
Adjusting Overlay Graph Properties ...................................... 225
Poly Graphs ............................................................................. 227
Adjusting Poly Graphs Properties .......................................... 227
Curves ......................................................................................... 229
Adding a New Curve to a Graph ............................................. 229
Drag and Drop .................................................................... 229
Input/Output Reference ........................................................ 229
Curve Legends ........................................................................ 230
Curve Order ............................................................................ 230
Cut/Copy/Paste an Existing Curve ............................................ 231
Copy Data to Clipboard ........................................................... 231
Adjusting Curve Properties ....................................................... 231
Active Trace ........................................................................ 233
Style: ................................................................................... 233
Digital Display: .................................................................... 234
Adjusting Channel Settings ...................................................... 234
Synchronizing Output Channel Limits with Those of the Graph . 234
Traces ......................................................................................... 235
Trace Drop Down Menu .......................................................... 235
Adjusting Trace Properties ....................................................... 235
Polymeters .................................................................................. 236
Adding a Polymeter ................................................................. 237

xiv PSCAD User’s Guide


PSCAD

Moving and Resizing a Polymeter ............................................ 237


Cut/Copy Polymeter ................................................................ 238
Paste Polymeter ...................................................................... 238
Copy Polymeter as Meta-File/Bitmap ....................................... 238
Adjusting Polymeter Properties ................................................ 239
Adjusting Channel Settings ...................................................... 240
XY Plots ...................................................................................... 240
Adding an XY Plot ................................................................... 241
Moving and Resizing an XY Plot Frame .................................... 241
Adding an XY Plot ................................................................... 241
Moving and Resizing an XY Plot Frame .................................... 241
Cut/Copy XY Plot Frame .......................................................... 242
Paste XY Plot Frame ................................................................ 242
Copy Data to Clipboard ........................................................... 243
Adjusting XY Plot Frame Properties .......................................... 243
Adjusting Plot Properties .......................................................... 245
Dynamic Zoom ........................................................................ 248
Dynamic Aperture Adjustment ..................................................... 248
Adjusting and Controlling the Aperture in XY Plots .................. 250
Markers ...................................................................................... 251
Show/Hide Markers ................................................................. 252
Graph Frame Marker Legends ................................................. 254
XY Plot Marker Legends .......................................................... 254
Changing the Active Curve ...................................................... 255
Adjusting Marker Positions ...................................................... 255
Toggle Time Difference Frequency/Delta ................................. 256
Locking/Unlocking Markers ..................................................... 257
Setting Markers ....................................................................... 257
Using Markers as Bookmarks ................................................... 258
Preferences ................................................................................. 258
Zoom Features ............................................................................ 259
General Zoom In and Zoom Out .............................................. 259
Box Zoom ................................................................................ 260
Vertical Zoom .......................................................................... 260
Horizontal Zoom ...................................................................... 261
Zoom Previous/Next ................................................................ 261
Zoom Extents .......................................................................... 262
Zoom Limits ............................................................................ 262
Resetting All Extents and Limits ............................................... 263
Dynamic Zoom in XY Plots ...................................................... 263
Cross Hair Mode ......................................................................... 264
OnLine Controls and Meters ........................................................ 264
Control Panels ......................................................................... 264

PSCAD User’s Guide xv


Table of Contents

Adding a Control Panel ....................................................... 265


Moving and Resizing a Control Panel ................................... 265
Cut/Copy Panel ................................................................... 265
Paste Panel ......................................................................... 266
Adjusting Panel properties ................................................... 266
Control Interfaces .................................................................... 266
Adding a Control Interface to a Control Panel ..................... 267
Control Interface Order ........................................................ 268
Cut/Copy Control Interface .................................................. 268
Paste Control Interface ........................................................ 269
Adjusting Control Interface Properties .................................. 269
Using the Control Interfaces ................................................ 269
Meters .................................................................................... 271
Adding a Meter to a Control Panel ...................................... 272
Meter Order ............................................................................ 272
Cut/Copy Meter .................................................................. 273
Paste Meter ............................................................................ 273
Adjusting Meter Properties .................................................. 273
Grouping of Runtime Objects ....................................................... 273
Creating a Runtime Object Group ............................................ 273
Viewing Runtime Object Groups .............................................. 275
Frame/Panel Minimization ........................................................... 275
Moving and Organizing Minimized Frames/Panels ................... 276
Displaying Plots and Control in Reports ........................................ 276
Setting Panel Style .................................................................. 276
Copy as Meta-File or Bitmap ................................................... 276

Chapter 6: Project Settings ......................................................... 279


General ....................................................................................... 280
Description .............................................................................. 281
File Path .................................................................................. 281
Persist As ................................................................................. 281
Revision Tracking ..................................................................... 281
File Version .......................................................................... 281
First Created ........................................................................ 282
Last Modified ...................................................................... 282
Author ................................................................................. 282
Runtime ...................................................................................... 282
Time Settings .......................................................................... 283
Duration of Run (sec) ........................................................... 283
Solution Time Step (us) ........................................................ 283
Channel Plot Step (us) ......................................................... 283
Start-up Method ...................................................................... 284

xvi PSCAD User’s Guide


PSCAD

Standard ............................................................................. 284


From Snapshot File .............................................................. 284
Save Channels to Disk? ........................................................... 284
Timed Snapshot ...................................................................... 285
Single (Once Only) ............................................................... 285
Incremental (Same File) ....................................................... 285
Incremental (Many Files) ..................................................... 285
Multiple Run ............................................................................ 286
Miscellaneous ......................................................................... 287
Remove Time Offset When Starting From a Snapshot .......... 287
Send Only the Output Channels that are In Use ................... 287
Start Simulation Manually to Allow Use of an Integrated
Debugger ............................................................................ 288
Network ...................................................................................... 288
Process Communication .......................................................... 289
Allow Simulation to Run Ahead at Most .............................. 289
Network Solution Accuracy ...................................................... 289
Interpolate Switching Events to the Precise Time ................. 289
Use Ideal Branches for Resistances Under ............................ 290
Numerical Chatter Suppression ................................................ 290
Detect Chatter that Exceeds the Threshold .......................... 290
Suppress Effects When Detected ......................................... 290
Diagnostic Information ......................................................... 291
Echo Network and Storage Dimensions ............................... 291
Echo Runtime Parameters and Options ................................ 291
Echo Input Data While Reading Data Files ........................... 291
Dynamics .................................................................................... 291
Signal Storage ......................................................................... 292
Store Feed Forward Signals for Viewing ............................... 292
Signal Flow .............................................................................. 293
Compute and Display Flow Pathways on Control Wires ........ 294
Mapping ..................................................................................... 294
Matrix Optimizations ............................................................... 294
Optimize Node Ordering to Speed Up Solution .................... 295
Split De-coupled Networks into Separate Matrices ............... 295
Move Switching Devices to Speed Up Solution .................... 295
Fortran ........................................................................................ 296
Additional Source (.f) Files ....................................................... 297
Runtime Debugging ................................................................. 298
Enable Addition of Runtime Debugging Information ............. 298
Checks .................................................................................... 298
Array & String Bounds ......................................................... 298
Floating Point Underflow ..................................................... 299

PSCAD User’s Guide xvii


Table of Contents

Integer Overflow .................................................................. 299


Argument Mismatch ............................................................ 299
Uncalled Routines ................................................................ 299
Uninitialized Variables ......................................................... 299
Link ............................................................................................. 299
Additional Library (.lib) and Object (.obj) Files .......................... 300
Matlab .................................................................................... 302
Link This Simulation with the Currently Installed Matlab Librar-
ies ....................................................................................... 302

Chapter 7: Transmission Lines and Cables ................................ 305


Constructing Transmission Line Systems ....................................... 306
Adding a Transmission Line Corridor ........................................ 307
Converting to a Direct Connection ....................................... 308
Editing Transmission Line Properties ......................................... 309
Changing the Line Length ................................................... 309
Changing the Number of Conductors ................................... 309
Constructing Underground Cable Systems ................................... 310
Adding a Cable System Corridor .............................................. 311
Editing Cable Properties .......................................................... 313
Changing the Cable Length ................................................. 313
Changing the Number of Cables ......................................... 313
The T-Line / Cable Configuration Editor ....................................... 314
Editing a Transmission Line Configuration ................................ 314
Adding a Tower Component ................................................ 316
Editing Tower Properties ...................................................... 318
Editing a Cable System Configuration ...................................... 318
Adding a Cable Cross-Section Component .......................... 321
Editing Cross-Section Properties ........................................... 322
Selecting the Proper Line Model .............................................. 322
The Bergeron Model ............................................................ 323
The Frequency-Dependent (Mode) Model ........................... 324
The Frequency-Dependent (Phase) Model ........................... 324
Adding a Line Model ........................................................... 324
Editing Line Model Properties .............................................. 325
Line Constants’ Files .................................................................... 325
Solving the T-Line/Cable Constants Manually ........................... 326
Viewing Line Constants Files .................................................... 327
Input File ................................................................................. 327
Constants’ File ......................................................................... 329
Log File ................................................................................... 329
Output Files ............................................................................. 329

xviii PSCAD User’s Guide


PSCAD

Chapter 8: Designing Components ............................................ 331


The Design Editor ........................................................................ 331
Editing a Component or Module Definition .................................. 332
Returning to Circuit View ............................................................. 333
The Graphic Section .................................................................... 333
Graphic Objects ....................................................................... 333
Adding Graphic Objects ....................................................... 334
Rotate, Flip, Mirror and Resize Graphic Objects .................... 335
Changing Graphic Object Properties .................................... 336
Changing Arc Object Properties ........................................... 339
Cut, Copy, Paste and Delete Objects ................................... 342
Text Labels .............................................................................. 342
Adding Text Labels .............................................................. 342
Rotate, Flip or Mirror Text Labels ......................................... 343
Changing Text Label Properties ............................................ 344
Cut, Copy, Paste and Delete Labels ..................................... 345
Linking a Text Label to an Input Field ................................... 345
Connections ............................................................................ 346
Adding Connections ............................................................ 346
Changing Connection Properties .......................................... 347
Cut, Copy, Paste and Delete Connections ........................... 348
Electrical Node Types ........................................................... 349
Undo and Redo ....................................................................... 349
Zooming .................................................................................. 350
Saving and Reloading Graphics ................................................ 351
Adjusting Graphic Page Size .................................................... 351
Parameters Section ..................................................................... 352
Categories ............................................................................... 352
Adding a New Category ...................................................... 353
Viewing Categories ............................................................. 354
Ordering Categories ............................................................ 355
Previewing Categories ......................................................... 355
Changing Category Properties ............................................. 356
Deleting a Category ............................................................ 357
Text Field ................................................................................. 357
Adding Text Fields ............................................................... 358
Moving and Resizing Text Fields .......................................... 358
Changing Text Field Properties ............................................. 359
Cut, Copy, Paste and Delete Text Fields .............................. 360
Input Field ............................................................................... 360
Adding Input Fields .............................................................. 360
Moving and Resizing Imput Fields ........................................ 361
Changing Input Field Properties ........................................... 361

PSCAD User’s Guide xix


Table of Contents

Cut, Copy, Paste and Delete Input Fields ............................. 363


Allowing Variables ............................................................... 364
Choice Box .............................................................................. 365
Adding Choice Boxes ........................................................... 365
Moving and Resizing Choice Boxes ...................................... 366
Changing Choice Box Properties .......................................... 366
Cut, Copy, Paste and Delete Choice Boxes .......................... 367
Adding Choices to a Choice Box .......................................... 367
Undo and Redo ....................................................................... 369
Find Symbol ............................................................................ 370
Saving and Reloading Parameters ............................................ 371
Conditional Statements, Layers & Filters ...................................... 372
Conditional Statements ........................................................... 372
Layers ..................................................................................... 374
Viewing Layers .................................................................... 374
Setting Layers ...................................................................... 375
Graphic Filters ......................................................................... 376
The Script Section ....................................................................... 377
Segments ................................................................................ 377
Adding a New Segment ...................................................... 378
Viewing Segments ............................................................... 379
Deleting a Segment ............................................................ 379
Segment Types ........................................................................ 379
Computations ...................................................................... 380
Branch ................................................................................. 380
Fortran ................................................................................ 383
DSDYN ................................................................................ 386
DSOUT ................................................................................ 386
Checks ................................................................................ 386
Help .................................................................................... 387
Comments .......................................................................... 388
FlyBy ................................................................................... 388
Transformers ........................................................................ 389
Model-Data ......................................................................... 392
Matrix-Fill ............................................................................ 393
T-Lines ................................................................................. 397
Undo and Redo ....................................................................... 397
Text Colouring ......................................................................... 397
Internal Output Variables ............................................................. 398
Outputting EMTDC Measured Voltages and Currents ............... 398
CBR ..................................................................................... 398
VDC .................................................................................... 398
Adding a Reference to a Source File ............................................ 399

xx PSCAD User’s Guide


PSCAD

Interfacing to C Source Code ...................................................... 399


Using the GNU Compiler ......................................................... 400
Using a Fortran 90 Compiler .................................................... 401
Tutorial: Creating a New Component .......................................... 403
Creating a New Component .................................................... 403
Adding Graphics ...................................................................... 403
Adding a User Interface ........................................................... 404
Adding Conditional Statements to the Graphic Objects ............ 405
Pre-Processing User Input ......................................................... 407
Defining the Electrical Branch .................................................. 407
Adding Code to Define the Source .......................................... 408
Setting the Branch Source ....................................................... 410
Sanity Checks ......................................................................... 411
Testing Your New Component ................................................. 411
Adding Internal Output Variables ............................................. 412
Running Your Component ........................................................ 414

Chapter 9: PSCAD Script ............................................................. 415


The Pre-Processor ........................................................................ 415
Operators .................................................................................... 416
$ Variable Substitution Prefix Operator ..................................... 416
Substituting Pre-Defined Variables or Constants into Script ... 416
Substituting Pre-Defined Constants into Text Labels ............. 418
% Text Substitution Prefix Operator ......................................... 419
Substituting Pre-Defined Variable Text into Commented Script
419
Substituting Pre-Defined Variable Text into Text Labels ......... 420
{ } Expression Braces ................................................................ 421
! Comment Indicator ............................................................... 422
Directives .................................................................................... 423
#STORAGE .............................................................................. 423
#LOCAL .................................................................................. 424
#FUNCTION ............................................................................ 425
#SUBROUTINE ......................................................................... 426
#OUTPUT ................................................................................ 427
#TRANSFORMERS ................................................................... 428
#windings .................................................................................... 428
#IF, #ELSEIF, #ELSE, #ENDIF Directives ......................................... 429
~ Line Continuation Operator ...................................................... 432
#CASE Conditional Directive ....................................................... 433
Expression Evaluation .................................................................. 435
Mathematical Functions .......................................................... 435
Arithmetic Operators ............................................................... 437

PSCAD User’s Guide xxi


Table of Contents

Logical Operators ..................................................................... 437


Ternary Operator ..................................................................... 438

Chapter 10: Debugging and Finalizing ....................................... 441


Compiling and Building the Project .............................................. 441
Compiling an Individual Module .............................................. 442
Common Output Window Messages ............................................ 442
Warning: Suspicious isolated node detected ........................... 443
Parser: Suspicious substitution of empty key ‘<name>’ ............ 443
Signal ‘<name>’ type conversion may lose accuracy ............... 443
Signal ‘<name>’ source contention -> ‘<source_1>’ and
‘<source_2>’ ........................................................................... 443
Signal ‘<name>’ dimension mismatch -> <dim_1> != <dim_1>
443
Signal ‘<name>’ size mismatch at connection ‘<con>’ ............ 444
Array ‘<Name>’ cannot be typecasted .................................... 444
Invalid breakout connection to ground at ‘<Node>’. Node array
elements cannot be individually grounded. .............................. 444
Short in breakout at ‘<Node>’. Node array elements must be
uniquely defined. ..................................................................... 444
Branch imbalance between breakouts at ‘<Node>’. Node array
elements cannot be shared between signals. ........................... 444
Find Feature ................................................................................ 445
Find What ............................................................................... 445
Search ..................................................................................... 445
Viewing Search Results ............................................................ 446
Viewing Build and Data Files ....................................................... 447
Fortran and Data Files ............................................................. 447
Map and Make Files ............................................................... 447
Wire Colour Code ....................................................................... 448
Component Ordering ................................................................... 448
Showing Sequence Numbers ................................................... 449
Showing Signal Locations .................................................... 450
Manually Setting Sequence Numbers ...................................... 450
Control Signal Flow Indicators ...................................................... 451
Using an Integrated Debugger ..................................................... 452
Project Options to Preset .......................................................... 452
Linking to the Debugger .......................................................... 453
Protecting User Code .................................................................. 455
Creating Library (*.lib) and Object (*.obj) Files ......................... 456
Fortran 90 Compiler ............................................................ 456
Fortran 77 Compiler ............................................................ 460

xxii PSCAD User’s Guide


PSCAD

Chapter 11: MATLAB/Simulink Interface ..................................... 463


The MATLAB Interface SubRoutine .............................................. 463
Arguments .............................................................................. 464
Inputs .................................................................................. 464
Outputs ............................................................................... 464
The Simulink Interface Subroutine ............................................... 466
Arguments .............................................................................. 466
Inputs .................................................................................. 467
Designing a MATLAB Component ............................................... 467
Component Design .................................................................. 468
Designing a MATLAB/SIMULINK Component ............................... 470
Interfacing Notes ......................................................................... 473
Alternative Simulink Interface .................................................. 474
Simulation Speed .................................................................... 474
Conversion to C ...................................................................... 475
Plotting Enhancements ............................................................ 475
Enabling and Using the Interface ................................................. 475

Chapter 12: Migrating from Older Versions ............................... 477


Converting PSCAD V2 Projects .................................................... 477
User-Written EMTDC Source Code .......................................... 478
Conversion Issues .................................................................... 478
V2 Control Type Components .............................................. 478
V2 Electrical Interface Components ..................................... 478
V2 Component Libraries ...................................................... 479
Component Definitions ........................................................ 480
Importing V2 Draft and Runtime Batch Files ............................. 480
Common Warning and Error Messages ................................ 482
Importing V2 User Libraries ...................................................... 483
Importing Individual V2 Components ....................................... 485
Manual Revisions to the New PSCAD V4 Project ..................... 488
Too Many External Connections .......................................... 489
Import/Export Tags with Array Variables ............................... 489
Runtime Module .................................................................. 490
Migrating V2 Cable Systems ................................................ 491
Migrating V2 Transmission Line Systems .............................. 491
Converting PSCAD V3 Projects .................................................... 491
Conversion Issues .................................................................... 492
System Dynamics Component Ordering ............................... 492
Additional Libraries and Object Files .................................... 492
Flyby Windows .................................................................... 493
Node Loop Component Output Format ................................ 493
MATLAB Libraries and Interface ........................................... 494

PSCAD User’s Guide xxiii


Table of Contents

Appendix A: References ................................................................. 495

Index ................................................................................... 497

xxiv PSCAD User’s Guide


PSCAD

About This Guide


The goal of this guide is to provide a comprehensive reference for
installing and using the PSCAD software. It is composed of a
combination of both newly written, as well as previously available
material from the PSCAD V3 Getting Started Manual and Online Help
System.

Information specific to certain models is not included here, but can be


found in the new PSCAD V4 Online Help System. The online help
system also includes this guide and the EMTDC User’s Guide.

For information on more advanced topics regarding simulating using


EMTDC, please see the EMTDC User’s Guide.

ORGANIZATION
The PSCAD User’s Guide is organized in the following manner:

• Chapter 1: Welcome to PSCAD briefly introduces the


PSCAD product, its use and development, what is new,
and also provides important information regarding both
compiler and PSCAD restrictions.
• Chapter 2: Installation and Set-up describes the
installation procedure for all platforms on which PSCAD is
supported. It also discusses hardware and software
requirements, License Manager and licensing, and
provides information on setting up workspace preferences
once installation is complete.
• Chapter 3: The PSCAD Environment describes the new
PSCAD look and feel, including new terminology and
features. This chapter also discusses using the Online
Help System, and provides a tutorial on creating a new
project.
• Chapter 4: Basic Features and Operations is essentially
a ‘how to’ guide, which outlines most of the basic
features and operations that are available in PSCAD V4.
This chapter also includes a tutorial on creating a new
project from scratch.

PSCAD User’s Guide xxv


About This Guide

• Chapter 5: Online Plotting and Control provides


details on creating and using the new PSCAD V4 online
plotting tools. Creating and using the online controls and
meters is also discussed.
• Chapter 6: Project Settings describes all parameters
included within the Project Settings dialog window.
• Chapter 7: Transmission Lines and Cables provides
details on constructing and defining transmission corridors
for both overhead transmission lines, and underground
cable systems. Related output files are also discussed.
• Chapter 8: Designing Components is essentially a
manual in itself, which describes how to design
components using the Design Editor. This chapter also
includes a tutorial on designing a component from
scratch.
• Chapter 9: PSCAD Script is a complimentary chapter for
Designing Components above. It describes all features
and coding conventions involved in the PSCAD Script
language.
• Chapter 10: Debugging and Finalizing Projects
describes common warning and error messages associated
with running a project, as well as methods for debugging
user code, creating library files and using the search
feature.
• Chapter 11: MATLAB/Simulink Interface provides
details on the interface subroutine and how to set-up the
interface and connect with MATLAB/Simulink.
• Chapter 12: Migrating from Older Versions outlines
all procedures for migrating both V2 and V3 projects into
PSCAD V4. Important conversion issues are also discussed
for migrating each type of project.
• Appendix A: References provides references to
technical publications sited in this manual, as well as
additional readings of interest.
• Index: Alphabetical index of keywords with page
numbers.

xxvi PSCAD User’s Guide


PSCAD

DOCUMENTATION CONVENTIONS
The following general conventions are followed throughout this
manual:

References
References are cited using ‘boxed brackets.’ For example, referring to
Reference #5 would appear as [5].

Notes
The ‘Note’ icon will appear in the margin if there is additional
information that may be of interest to the user. The actual note text
will be included underneath the icon itself.
Note text will appear here.

Important Sections
The ‘Important’ icon will appear if the information contained in the
section is of particular importance to the user.

Text Boxes
Actual
All code examples will appear in text boxes, as shown here.
Code

PSCAD User’s Guide xxvii


About This Guide

xxviii PSCAD User’s Guide


PSCAD

Chapter 1:

Welcome to PSCAD
Whether you are a seasoned user upgrading to PSCAD V4, or you have
just recently joined our expanding, worldwide user base - welcome!

PSCAD was first conceptualized in 1988 and began its evolution as a


tool to generate data files for the EMTDC simulation program. In its
early form, Version 1 was largely experimental. Nevertheless, it
represented a great leap forward in speed and productivity, since users
of EMTDC could now draw their systems, rather than creating text
listings. PSCAD was first introduced as a commercial product as Version
2 targeted for Unix platforms in 1994. It arrived as a suite of associated
software tools that performed circuit drafting, runtime plotting/control
and offline plotting.

When Version 3 for Windows arrived in 1999, it sought to push the


envelope by introducing a simulation system that could be built in a
modular form. Systems could now be built up using interconnecting
drawing blocks, compiled individually and having their own private data
space. This modular system improved accuracy and correctness of the
simulation. In addition, Version 3 brought new usability by fully
integrating the drafting and runtime systems of its predecessor. This
integration produced an intuitive environment for both design and
simulation.

PSCAD Version 4 represents the latest developments in power system


simulation software. With much of the simulation engine being fully
mature for many years, the new challenges lie in the advancement of
the design tools for the user. The goal is to produce software that is
both powerful and easy to use. Version 4 retains the strong simulation
models of its predecessors, while bringing to the table an updated and
fresh new look and feel to its windowing and plotting. New single-line
representations and new compiler enhancements improve both the
accuracy and reliability of the simulation. New editors and easier
navigation mean that finding your way and maintaining larger systems is
far easier to do. Portability to Version 3 means updating to Version 4 is
as simple as point, click, and run. These and many other enhancements
are why PSCAD has been, and is, the professional’s choice for transient
simulation.

PSCAD User’s Guide 1


Chapter 1: Welcome to PSCAD

WHAT IS PSCAD?
PSCAD (Power Systems CAD) is a powerful and flexible graphical user
interface to the world-renowned, EMTDC solution engine. PSCAD
enables the user to schematically construct a circuit, run a simulation,
analyze the results, and manage the data in a completely integrated,
graphical environment. Online plotting functions, controls and meters
are also included, so that the user can alter system parameters during a
simulation run, and view the results directly.

PSCAD comes complete with a library of pre-programmed and tested


models, ranging from simple passive elements and control functions, to
more complex models, such as electric machines, FACTS devices,
transmission lines and cables. If a particular model does not exist,
PSCAD provides the flexibility of building custom models, either by
assembling them graphically using existing models, or by utilising an
intuitively designed Design Editor.

The following are some common models found in systems studied


using PSCAD:

• Resistors, inductors, capacitors


• Mutually coupled windings, such as transformers
• Frequency dependent transmission lines and cables
(including the most accurate time domain line model in
the world!)
• Current and voltage sources
• Switches and breakers
• Protection and relaying
• Diodes, thyristors and GTOs
• Analog and digital control functions
• AC and DC machines, exciters, governors, stabilizers and
inertial models
• Meters and measuring functions
• Generic DC and AC controls
• HVDC, SVC, and other FACTS controllers
• Wind source, turbines and governors

PSCAD, and its simulation engine EMTDC, have enjoyed close to 30


years of development, inspired by ideas and suggestions by its ever
strengthening, worldwide user base. This development philosophy has

2 PSCAD User’s Guide


PSCAD

helped to establish PSCAD as one of the most powerful and intuitive


CAD software packages available.

WHAT’S NEW IN PSCAD V4?


Many individuals reading this chapter may be current users of PSCAD
V3 (or even V2), who have recently upgraded to V4. If so, you are
probably eager to start simulating.

This section is provided especially for users of older versions who want
a jump-start to proficiently using V4, without the hassle of a lot of
reading. Of course, this section will also be of interest to new users, as
the new features are described.

The following is a list of some of the major new features and


improvements in PSCAD V4:

• New Windowing Interface: PSCAD V4 boasts a completely


new windowing interface, which includes full MFC (Microsoft
Foundation Class) compatibility, docking window support and
a new integrated design editor.
• New Drawing Interface: The drawing interface has been
enhanced to provide uniform messaging and core support, as
well as a full double-buffered display.
• All New On-Line Plotting Tools: The online plotting
facilities in PSCAD V4 have been completely redesigned and
are now more powerful than ever. The new advanced graphs
come complete with full features, including; full zoom and
panning support, marker controls, Polymeter and XY plotting
capabilities.
• Improved On-Line Control: New and improved on-line user
interface controls have replaced those used in V3. The new
user controls include the basics as in V3, but feature new
functionality, insightful design and stunning appearance.
• Off-Line Plotting Facilities: With the inclusion of LiveWire,
the best data visualization and analysis software package
available today, PSCAD output comes to life. LiveWire
includes many of the functions that were available in the
PSCAD V2 utility called ‘Multiplot’. For more on LiveWire, visit
[Link].

PSCAD User’s Guide 3


Chapter 1: Welcome to PSCAD

• Component Ordering Control: Users now have the ability


to manually order system dynamics (controls) components.
This new diagnostic functionality also includes graphical
indication of feed-forward and feedback loops, as well as
component sequence numbering. PSCAD will order system
dynamics automatically, using a sophisticated algorithm, by
default.
• Control Grouping: Runtime objects, such as online controls
and displays may now be grouped according to group name.
• Control Signal Flow Indicators: It is now possible to show
control signal flow on data wires. The indicators appear as
small arrowheads, pointing in the direction of signal flow.
• Storage Optimization: Users now have the option to only
store data that is required for the next simulation time step
(i.e. feedback signals). Depending on the amount of data
signals, this has the potential to greatly increase simulation
speed. In addition, users now have the option to ‘turn off’
unused Output Channels.
• Multiple-Trace Curves: Output channels will now directly
accept both REAL and INTEGER arrays. This translates to a
multiple-trace curve, which can be inserted directly to graphs.
• Control Setting Storage: A new feature has been added,
which allows users to store the current setting of Dial, Switch
and Slider control components to a template file. Multiple
templates can be stored for each Project. This is similar to
having different Runtime batch files for a single PSCAD V2
project.
• Single-Line Diagram Support: PSCAD now includes the
ability to construct circuits in a convenient and space saving
single-line format. This new feature includes fully adaptive
wires and connections using dimension propagation logic. All
three-phase electrical components in the Master Library can
be adjusted easily to display a single-line equivalent view.
• New Smart Subsystem Logic: Now, electrical subsystems
no longer need to be separated into multiple page modules,
and electrical nodes on the main page no longer restrict
matrix splitting.

4 PSCAD User’s Guide


PSCAD

• Enhanced Project Navigation and Organisation: Most


plotting and online control display design, as well as
navigational operations can now be performed directly from a
central project database called the Workspace. Similar to the
Project Tree in PSCAD V3, the Workspace provides a wealth of
Project related information in a neatly organised tree type
environment.
• Drag and Drop: PSCAD now supports Drag and Drop
functionality for component Instances, as well as display
related features, such as Curves and Control Interfaces.
• New Wires: Multiple segment Wires are now possible.
These new and improved Wires can be manipulated as a
group, and may be merged or decomposed at will. Older
Wires will be automatically replaced with the new Wire
component upon upgrade.
• New Data Management Interface: New record support has
been added for improved speed and flexibility, along with data
export portability to offline analysis tools.
• New On-line Help System: The Online Help system has
been completely redesigned and updated. Based on the
Microsoft HTML Compiled help format, the new system
provides a search engine, TOC and index. Also included are
the complete PSCAD and EMTDC manual set.
• New 2D Navigation: Now not only can you navigate into
and out of sub-pages and components, but also view
Graphics, Fortran Files, Data Files and signal information, all
with the click of the new multi-window tab features.
Component definition graphics, parameters and script are
also included.
• Improved Menus and Toolbars: The most commonly used
menu functions have been added as buttons on various new
toolbars. Users can now add the most common Master
Library components directly using convenient toolbar buttons.
• MATLAB®/Simulink® Interface: Now interface PSCAD to
both your MATLAB® and/or Simulink® files.
• Backwards Compatibility: Both library and case projects
created in PSCAD V4, can be easily saved as PSCAD V3 type
format. Backwards compatibility to PSCAD V2 is not available.
• Frequency Scan of a Network: Users now can get a
impedance profile of a network over a frequency range by
using Interface to Harmonic Impedance Solution.

PSCAD User’s Guide 5


Chapter 1: Welcome to PSCAD

• New Models: There are many new models and


improvements to existing models. See the section entitled
New Master Library Models below for a list of available
models and features.

V3/V4 Comparison Tables


With PSCAD V4, we have tried our best to incorporate the best
features of both PSCAD V2 and V3. However, there are of course some
differences in appearance, function and terminology. The following
tables compare PSCAD V3 with V4, providing a quick and convenient
reference.

Appearance and Terminology


There have been some changes to the appearance and the terminology
used in PSCAD V4. The following is a list of most of them:

6 PSCAD User’s Guide


PSCAD

Category PSCAD V3 PSCAD V4

Project Project Tree Workspace. The Workspace


Organisation contains information on
loaded projects. The
organizational structure of
information in each individual
project is now referred to as
the project tree for that
particular project.

Messaging Message Tree Output Window. This


window also categorizes
Build and Runtime messages
using the new 2D
navigational tab features, as
well as providing search
results.

Graphical Draft window Design Editor - Graphic Tab.


View Imbedded graphical display
editor.

Viewing Fortran file Design Editor - Fortran Tab.


Fortran viewed in text Imbedded text viewer.
editor

Viewing Data file viewed Design Editor - Data Tab.


Electrical in text editor Imbedded text viewer.
Data

Component Component Design Editor - Graphic,


Design Workshop Parameters and Script Tabs.
In V3, component design
was performed in a separate
utility called the Component
Workshop. Access to
component definitions is now
included directly into the
Design Editor window, using
the new tab features.

PSCAD User’s Guide 7


Chapter 1: Welcome to PSCAD

Component Graphics category Design Editor - Graphic Tab.


Workshop: in Component Imbedded graphical display
Graphics Workshop editor.

Component Parameters Design Editor - Parameters


Workshop: category in Tab. Imbedded text editor
Parameters Component
Workshop

Component Code section Design Editor - Script Tab.


Workshop: category in Imbedded text editor.
SectionsNode Component
Workshop

Keyboard Shortcuts
There have been some minor changes to the keyboard shortcuts
(especially plotting related shortcuts) from that used in PSCAD V3. The
following tables summarize these changes:

General:

Shortcut PSCAD V3 PSCAD V4

Dynamic Ctrl + left mouse Ctrl + Shift + left mouse


Scroll hold hold. This change was made
in order to avoid conflicts with
the new on-line plotting tools.

Iconify Plot I No longer used. See


Frame/Panel Minimization for
more details.

Plotting:

8 PSCAD User’s Guide


PSCAD

Shortcut PSCAD V3 PSCAD V4

Zoom to Z Ctrl + left mouse hold


Time
Frame

Zoom Shift + Z P
Previous

Show X C
Cross Hairs

Zoom A No longer used


Actual

Zoom S Y
Smart

Zoom to D L
Default

Cut Graph Ctrl + X No longer used

For a complete list of PSCAD keyboard shortcuts, see Keyboard


Shortcuts.

New Master Library Models


Many new models have been added to the PSCAD Master Library since
the last release of PSCAD V3. The following summary provides a
picture and a quick description of each new model. For more details on
these components, see the PSCAD On-Line Help system.

PSCAD User’s Guide 9


Chapter 1: Welcome to PSCAD

Graphic Description

Two Winding DC Machine

Wind Turbine

Wind Governor

Wind Source

10 PSCAD User’s Guide


PSCAD

Internal Combustion Engine

1-Phase Auto Transformer

3-Phase Star-Star Auto


Transformer

Optimum Run

Radio Links (Global Variables)

Coupled Capacitor Voltage


Transformer

PSCAD User’s Guide 11


Chapter 1: Welcome to PSCAD

Current Transformer - Lucas Model

Current Transformer - JA Model

Two CT Differential Configuration - JA


Model

Interface to Harmonic Impedance Solution

3-Phase View / Single-Line View Electrical


Wire Converter (Breakout)

6-Dimension / 2 x 3-Dimension Electrical


Wire Converter

Capacitive, Inductive and Resistive 3-Phase


Passive Loads

12 PSCAD User’s Guide


PSCAD

Voltage Source Model 3

Multiple Input Logic Gate

Mutually Coupled Three Wire Bus

Mutually Coupled Two Wire Bus

Distance Relay Element - Apple


Characteristics

PSCAD User’s Guide 13


Chapter 1: Welcome to PSCAD

Negative Sequence Directional Element

Dual Slope Current Differential Relay

Inverse Time Over Current Relay

Distance Relay Element - Lens Characteristics

Out of Step Relay - Lens Characteristics

Out of Step Relay - Mho Characteristics

14 PSCAD User’s Guide


PSCAD

Out of Step Relay - Polygon Characteristics

DIMENSION LIMITS
Any limitations imposed on your simulation projects will depend mainly
on which PSCAD edition you are using, and which Fortran compiler you
have chosen. The following tables list the most commonly
encountered dimension limitations.

PSCAD Limits (all Editions and Compilers)

Description Limit

Number of Transmission Line or Cable conductors per


20
right-of-way

Edition Specific Limits

Description Student Educational Professional

Subsystems 1 1 Unlimited
Page Modules 5 25 Unlimited
Electrical Nodes 15 200 Unlimited

Compiler Specific Limits

PSCAD User’s Guide 15


Chapter 1: Welcome to PSCAD

EGCS/GNU Fortran Fortran 90


Description
77 Compiler Compilers

Subsystems 10 Unlimited
Electrical Nodes 200 Unlimited
Electrical Branches 2,000 Unlimited
Transformers 70 Unlimited
Mutually Coupled
10 Unlimited
Windings
Transmission Lines and
50 Unlimited
Cables
Frequency Dependent
(Phase) Transmission 20 Unlimited
Lines and Cables
Output Channels 500 Unlimited
Radio Link Transmitters 50 Unlimited
Radio Link Receivers 500 Unlimited
STOR Storage
50,000 Unlimited
Allocations
STORF Storage
10,000 Unlimited
Allocations
STORI Storage
10,000 Unlimited
Allocations
STORL Storage
10,000 Unlimited
Allocations
STORC Storage
10,000 Unlimited
Allocations

16 PSCAD User’s Guide


PSCAD

PSCAD USERS’ GROUP


The PSCAD Users’ Group (also known as the EMTDC Users’ Group) is
an informal forum for PSCAD/EMTDC users worldwide. The Group
maintains a web site and email list server.

There are other regional users’ groups as well: Please contact the
PSCAD Users’ Group (details below) or PSCAD Technical Support to find
out if your region has one.

Membership
To become a member of the list server, you should be a PSCAD user.
There is no membership fee.

To add your name to this worldwide Users’ Group list, contact the
group coordinator, via email at emtdcug@[Link].

Facilities
The PSCAD Users’ Group maintains the following facilities:

Facility Address

E-Mail List Server emtdcug@[Link]

Web Site pscad_ug.[Link]

E-Mail List Server


Users can submit their questions regarding PSCAD or EMTDC by
sending an email to emtdcug@[Link]. Your email will be
distributed to all members through a moderator. Members who have a
reply to your query will also send an email to
emtdcug@[Link]. Often there may be multiple replies with
multiple solutions to your problems.

The Manitoba HVDC Research Centre Inc. is also a member of the


Users’ Group and hence PSCAD Technical Support staff at the Centre
will get a copy of all the emails sent to the Users’ Group.

Web Site
The worldwide web site, maintained by the Users’ Group, contains
valuable contributions from users. These may include user-written
models not yet available in the standard releases of PSCAD.

PSCAD User’s Guide 17


Chapter 1: Welcome to PSCAD

18 PSCAD User’s Guide


PSCAD

Chapter 2:

Installation and Setup


HARDWARE AND SOFTWARE REQUIREMENTS
The following are the minimum recommended specifications.

Category Requirement

Processor 500 MHz processor (higher speed recommended).

Operating system Windows 98, NT 4.0, ME, 2000 or XP.

Additional Digital Visual Fortran 5.0 is still supported, but


software Compaq Visual Fortran 6.x is recommended.

A free EGCS/GNU Fortran 77 compiler is provided,


which is sufficient to run most cases in PSCAD.
However, certain dimensioning limits will be
imposed (see Dimension Limits).

Memory (RAM) 64 MB (128 MB or more recommended).

Hard disc space 100 MB minimum. More space may be required


to save cases and output as you use PSCAD.

Monitor SVGA minimum, XGA recommended. 17" for


desktop and 11" minimum for laptop, 800x600
resolution (1024x768 or higher recommended).

Other A CD-ROM drive and 32 bit CD-ROM drivers, a


peripherals mouse or compatible pointing device, one
and parallel, serial or USB port for hardware lock (for
hardware Professional and Educational Editions only), TCP/IP
Network Protocol.

PSCAD User’s Guide 19


Chapter 2: Installation and Setup

FORTRAN COMPILERS
PSCAD requires a Fortran compiler to build and simulate projects. The
following commercially available compilers are presently supported:

• Digital Fortran 5.0


• Compaq Visual Fortran 6.x
The free EGCS/GNU Fortran
77 compiler is available for
all users on our world wide For your convenience, a free Fortran compiler, called the EGCS/GNU
website: [Link] Fortran 77 compiler, is provided on your PSCAD CD. If you have
downloaded the Student Edition from our website, the GNU compiler
is available as a separate file. Please note that the GNU compiler will
impose some limitations otherwise not experienced with the Digital or
Compaq Fortran 90 compilers.
If you are the owner of a professional PSCAD license, and intend to run
large cases (i.e. greater than 200 nodes), it is highly recommended that
you purchase the Compaq Visual Fortran 6.x compiler. Contact us at
PSCAD Sales (sales@[Link]) for purchasing details.

LICENSING
All PSCAD software editions, except the Student Edition, must be
licensed. Licensing is organised and controlled using License Manager
software, which can exist either as a separate, standalone program, or
can be embedded within PSCAD itself.
The type of licensing arrangement that is best for you depends on
how you wish to utilize PSCAD, and on what type of license you
purchased. The following sections describe each type of licensing
arrangement in detail.
Multi-User Licensing
The multi-user licensing (MUL) method was first introduced with PSCAD
V3, and was then the only licensing option available. With this
configuration, the License Manager software is installed as a
standalone program, which can be accessed by any computer
(including the host), on a Local Area Network (LAN).
The License Manager will A multi-user set-up is capable of providing multiple users on multiple
only grant licences to
computers on the same
machines, the ability to run multiple combinations of various licensable
subnet. Licenses requested editions of PSCAD. In other words, if a user is sufficiently licensed, this
via a router will not be method has the potential to afford a lot of freedom when operating
accepted.
over a LAN, and should be used if there will be several PSCAD users.
In multi-user licensing, the License Manager is used in conjunction with

20 PSCAD User’s Guide


PSCAD

a hardware lock (also known as a dongle), which contains licensing


information for the purpose of validation. When an instance of PSCAD
is started somewhere on the LAN, a license will be requested from the
License Manager. The License Manager determines whether a license
is available, and checks the information on the dongle for verification.
The number of users that can access PSCAD simultaneously over the
LAN depends on the number of licenses available on the dongle. For
example, if there are a total of two Professional Edition licenses on a
network dongle, then only two users may use the PSCAD Professional
Edition at the same time. Each time a user opens or closes the PSCAD The number of licenses
program, it will request or relinquish a license respectively. Each owned does not limit the
number of PSCAD
licensable edition of PSCAD possesses a separate product number, so installations on the LAN!
that several products are possible on one dongle.
The License Manager and dongle needs to be installed on only one
computer in a network. This computer will act as the License Manager
‘server’, which will hand out licenses to other machines on the network,
as requested. PSCAD may also be installed on the License Manager
server machine if desired.

EXAMPLE: A PSCAD user


owns three Professional
Edition licenses
programmed onto one
dongle. This diagram
illustrates how the user
could install the License
Manager on a LAN, so that
up to three users can run
PSCAD simultaneously.

Multi-user licenses can be time limited or infinite (no time limit).

Single-User Licensing
Single-user licensing (SUL) still involves the use of a dongle, but a
standalone License Manager program is not required. Here, an
embedded License Manager, within the PSCAD program itself, manages
the licenses.

PSCAD User’s Guide 21


Chapter 2: Installation and Setup

A single-user license will only allow a single user on a single machine to


EXAMPLE: A PSCAD user run only one instance of a licensable edition of PSCAD. Single-user
owns one Professional
Edition license programmed licensing is designed especially for use on standalone machines and
onto a single dongle. This laptops, and will NOT allow access from other machines, even if it is
diagram illustrates how the
user would install PSCAD as connected to a LAN.
a single-user configuration.
Note the absence of the
License Manager as a
separate program.

Single-user licenses can be time limited or infinite (no time limit).

Trial Licensing
Only the Professional Edition In order to simplify the evaluation process, and to provide access to the
of PSCAD is available for
full PSCAD Professional Edition functions, trial licensing is now available
trial licensing.
with PSCAD V4. A trial license is a special type of single-user license,
where a time limit is mandatory and the user may only own a single
trial license of the PSCAD Professional Edition.

With trial licensing, neither the License Manager nor the dongle is
required. However, the user must request a trial license after PSCAD is
installed. Note that until the trial license is approved and sent by the
Do not upgrade your Manitoba HVDC Research Centre Inc., the installed copy of PSCAD will
operating system, hard
drive, or network card function as a Student Edition (SE), with all SE limitations imposed (i.e.,
during the duration of the 15 electrical nodes maximum).
trial license period. Any one
of these changes will cause
your trial license to be lost. Trial licenses are locked to the hardware and registry of a particular
machine and are therefore not transferable from one machine to
another. The latest installed trial license will overwrite any previously
existing trial licenses.

22 PSCAD User’s Guide


PSCAD

Hardware Locks (Dongles)


The License Manager software supports the following types of hardware
locks:

Sentinal SuperPro™ 797, Low Profile Parallel


Port Hardware Lock

Sentinal SuperPro™ USB, USB Port Hardware


Lock

MicroSentinal™, 25-Pin Serial Port Hardware


Lock with 25 to 9-Pin Adapter

The USB and parallel port dongles are the preferred choice, due to their
small size. The parallel port dongle is perfect for laptop computers, as
it features a low profile and does not protrude from the back of the
machine (and typically does not ever need to be removed). The serial
and parallel port locks are compatible with all Windows platforms on Not all computers come with
USB ports. If you are not sure
which PSCAD is supported. However, the USB dongle is NOT if you have one, contact
compatible with the following operating systems: Your system administrator for
help.

• Windows NT 4.0
• Windows 95 OEM Service Release 2 or earlier

License Key
The license key is an ASCII text file named ‘[Link]’, which usually
resides on a floppy disk (called ‘License Manager: [Link]’) required
for the PSCAD Professional and Educational Editions. This file contains

PSCAD User’s Guide 23


Chapter 2: Installation and Setup

encrypted information designed to act as a ‘Key’ to adding or upgrading


licenses (both single-user and stand-alone) to the license database file,
which is used directly by the License Manager

LICENSE MANAGER SOFTWARE


In addition to the standalone License Manager software that was first
introduced with PSCAD V3, the PSCAD package now includes two
additional types of License Manager. The type of License Manager you
will need depends on your licensing arrangement.
There are a few important points to discuss regarding the maintenance
and operation of the License Manager. These are outlined in the
following sections as well.
Standalone License Manager
The Standalone License Manager (SLM) is used only with multi-user
licenses. The SLM can operate on a dedicated server, or on any
machine running PSCAD. Any combination of PSCAD products can be
included and used interchangeably with this License Manager.
Installation instructions for the SLM are given later in this chapter.
Maintenance and Support
Once the License Manager is installed and running, it is a good idea
for the person operating the designated License Manager server to
maintain the software and ensure proper operation.
The Standalone License Manager (SLM) usually starts automatically
when the machine is booted (unless manual starting is specified during
installation) and runs as a background process. All SLM events and
transactions are recorded in a log file entitled ‘[Link]’, which is
usually located in the Windows or WINNT directory (depending on
your OS). When troubleshooting, this file contains important
information about the cause of any problems.
If problems arise with the operation of your License Manager software,
first try to address the problem using the clues found in the log file. If
the solution remains elusive, send us an email at PSCAD Support
Services (support@[Link]) with a detailed description of the
problem. To ensure efficient response time, please attach the log file
(i.e. [Link]). Also, got to START | Programs | HVDC Lmgr
and run the ‘Get License Info’ utility and attach the generated ‘Get
License Info’ file ([Link]) to the email.

24 PSCAD User’s Guide


PSCAD

Local License Manager


The Local License Manager (LLM) is utilised only when running under a
single-user license. Although the LLM will support multiple product
licenses, it will not support multiple instances of any individual PSCAD
product. Attempting to start a second instance of a certain product
(say Professional Edition), will force the second instance to run as the
Student Edition.
Trial License Manager
The Trial License Manager (TLM) is utilised only when running under a
lockless trial license. The TLM supports only a single, time limited
license of the Professional Edition (multiple trial licenses are not
supported). As with the Local License Manager, the TLM will not grant
licenses to other machines on the LAN, and only one instance of a trial
license may be active at one time. Any additional instances of PSCAD
will run as the Student Edition.

INSTALLING V4 FOR THE FIRST TIME


This section is exclusively for those who are either installing PSCAD V4
for the first time, or installing PSCAD V4 for the first time on a
particular PC.
If you currently have PSCAD V3 installed on your PC, installing PSCAD
V4 will not affect it - V4 is installed in a different program directory.
However, your V3 License Manager software (if present) will be
upgraded during your V4 installation. This will not affect your PSCAD
V3 operations, and is recommended anyway.
If you have a previous version of PSCAD V4 installed already on your
machine, see Upgrading Your V4 Software.
Installing PSCAD
If your operating system is Windows NT4, XP or 2000, you must have
administrator or power user access to your machine, in order to install
PSCAD.
Please perform the following steps:

1. Insert the PSCAD CD into your CD-ROM drive.


2. The installer should start automatically and in a few moments,
you should see the following screen:

PSCAD User’s Guide 25


Chapter 2: Installation and Setup

If a different window
appears asking if you want
to Modify, Repair or Remove
existing installed
components, skip to
Upgrading Your V4
Software.

3. Click Next. A dialog as shown below should appear outlining


the PSCAD License Agreement. Once the entire agreement
has been read, click Yes to continue.

The PSCAD version numbers


on this dialog may vary
according to what version
you are upgrading to/from.

26 PSCAD User’s Guide


PSCAD

If you are installing from a CD, and a previous version of PSCAD is


detectd, the following dialoge should appear. See the notes given
below.

• Patch existing PSCAD 4.x.x to PSCAD 4.x.x: Selecting this


option will patch your existing installation. Files pertaining to
PSCAD v4.0.x will be overwritten with the latest upgrades.
• Install PSCAD 4 to new directory: Select this option to fully
install PSCAD v4.1.x into a new directory. This is useful if you
wish to keep the older version in order to compare results for
example.

4. You have the option of installing PSCAD anywhere on your


system. The dialog box below will allow you to make any
changes you desire for installation location. When you have
finished selecting a destination for PSCAD, click Next.

PSCAD User’s Guide 27


Chapter 2: Installation and Setup

28 PSCAD User’s Guide


PSCAD

5. You will be presented with the above dialog, on which options


are available for your install. Explanations for each of these
options are given below.

• PSCAD: Select this option to install PSCAD. Although all


PSCAD editions (i.e. Student, Educational and Professional) are
included on the CD, you must be properly licensed to use any
edition other than the Student Edition!
• GNU Fortran Compiler: If you do not currently have either
the Digital or the Compaq Fortran 90 compiler installed, select
the GNU Fortran compiler. A Fortran compiler is required for
any PSCAD project to simulate (run).
• License Manager: Only select to install the License Manager
if you intend for this machine to be the License Manager server
on a network (Standalone Licensing). If you choose to install
the License Manager, proceed to Step 8.
• LiveWire Lite (Demo): Select this option to install the If you change compilers at a
later date, you can change
evaluation version of LiveWire. LiveWire is the primary data the compiler options directly
analysis and post-processing software tool recommended for in PSCAD without having to
re-install.
use with PSCAD. You can get more information on this
software at [Link]/[Link].
• LiveWire: Select this option to install the full version of
LiveWire. Note that you must be licensed to run the full
version. Please contact us at sales@[Link] for more details
on obtaining a full license.
• Real Time Playback: If you wish to evaluate the Real Time
Playback (RTP) demo software (or install the commercial
version), select this option. For more on the RTP, see our
website at: [Link]/products/RTP/[Link]

If you selected only PSCAD to be installed above in Step 5, then the


installer will ask you to provide some additional information about how
your current Licensing is configured:

PSCAD User’s Guide 29


Chapter 2: Installation and Setup

• If you are a Student Edition user, will be using a Single-User


License, or intend to request a Trial License (time limited), then
you do not require a Stand-Alone License Manager. Select the
appropriate choice within the I do not need a standalone
License Manager section of the above dialog.
• If you did not select to install the Stand-Alone License
Manager in Step 5, but have changed your mind, select I will
use a License Manager on this machine.
• If this machine will be contacting a remote Stand-Alone
License Manager, select I will use a License Manager on
another machine on my network. If this option is selected,
you must then enter the hostname of the machine, on which
the License Manager resides. For example, if this machine is
named ‘zeus’, then you should enter this name as shown
above. The Installer will also accept an IP address. The
hostname CANNOT contain spaces!

30 PSCAD User’s Guide


PSCAD

6. The Installer will now perform a variety of tests to verify system


settings and ensure that everything is OK to proceed. If you
would like to see the results of these diagnostics, please have
a look at the report dialog window (similar to that shown
below). Click the Next button to continue.

7. You will then be asked to enter a program folder, in which to


place all of the program icons. A folder called PSCAD is
selected by default. Click Next when finished.

At this point, the Installer will install PSCAD, and then branch off into
additional installations that were indicated in Step 5. If you did not
select the License Manager in Step 5, proceed to the section entitled
‘Installing EGCS/GNU Fortran’.

Installing the License Manager


The License Manager Installer will only run if you selected it in Step 5.
If you did not, proceed to the section entitled ‘Installing EGCS/GNU
Fortran.’

PSCAD User’s Guide 31


Chapter 2: Installation and Setup

8. You will be presented with the following dialog window. Click


Next.

9. A dialog as shown below should appear outlining the License


Manager License Agreement. Once the entire agreement has
been read, click Yes to continue.

32 PSCAD User’s Guide


PSCAD

10. A window should pop-up with some pre-installation


information. Please review and click Next.

11. The Installer will now perform a variety of tests to verify


system settings and ensure that everything is OK to proceed.
If you would like to see the results of these diagnostics, please
have a look at System Information dialog window (similar to
that shown below) once the tests are completed. Click Next.

PSCAD User’s Guide 33


Chapter 2: Installation and Setup

12. You have the option of installing the License Manager


anywhere on your system. The dialog above will allow you to
make any changes that you require for installation location.
When you have finished selecting a destination, click Next.
13. You will then be asked to enter a program folder, in which to
place all of the License Manager related program icons. A
folder called HVDC Lmgr is selected by default. Click Next
when finished.

Windows 98/ME Only:

14. The installer will ask ‘Would you like to start the License
Manager during machine boot?’. Selecting Yes means that
the License Manager will start automatically when the system
is re-booted. If No is selected, the License Manager must be
manually started following each machine reboot. See the
section entitled ‘Manually Starting the License Manager’ in
this chapter for more details.

15. Another window will pop-up asking to simply verify the chosen
program folder and installation location. Click Next.
16. At this point, the License Manager software will be installed
along with the proper drivers required for the supported
hardware locks. Also, a new service will be added to the
Windows Services list. The Installer will run checks to ensure if
the required drivers already exist, and if so is an upgrade
required.

Possible Messages:

Missing USB Driver:

If it is found that your PC has a more recent Sentinel parallel port driver
installed, but is missing a USB driver, the following message will be
issued. Click OK.

34 PSCAD User’s Guide


PSCAD

More Recent Drivers Detected:

If it is found that your PC has more recent Sentinel USB and parallel port
drivers already installed than those that come with the PSCAD
installation, the following message will be issued. Click OK.

17. Before the hardware lock drivers are installed, you should
receive an important warning message similar to the
following. Click OK once you have unplugged your dongle.

18. If installation of the hardware lock drivers is successful, the


following message will appear. Take note of the specified
directory path and click OK.

PSCAD User’s Guide 35


Chapter 2: Installation and Setup

19. The Installer will now ask you to connect your dongle as shown
below. If you are unsure where your USB, parallel or serial
ports are located, contact your system administrator. Also, see
the notes given below.

Parallel Port Dongle:

• DO NOT insert the Parallel Port Dongle into the 25-pin serial
port (if it exists).
• The dongle and the floppy disk have serial numbers (SN#) on
them. They MUST match to be installed on the same
machine.

USB Dongle:

• If you are using a USB dongle, it is possible that the Windows


‘Find New Hardware Wizard’ may appear when you connect
your dongle. If so, it will ask where the driver for the new
device is. Enter the path given in the information dialog
shown in Step 17. Otherwise, incorrect default drivers may be
installed.
• The dongle and the floppy disk have serial numbers (SN#) on
them. They MUST match to be installed on the same
machine.

36 PSCAD User’s Guide


PSCAD

Serial Port Dongle:

• If you are using a Serial Port dongle, connect the dongle to the
25-pin serial port. If you have specified the 25-pin serial port
dongle during purchase, then a 9-pin to 25-pin converter will
have been included with the PSCAD package (in case you do
not have a 25-pin serial port).
• The dongle should be inserted in the direction indicated on the
dongle.
• DO NOT insert the 25-pin serial port dongle into the parallel
port.

The dongle and the floppy disk have serial numbers (SN#) on them.
They MUST match to be installed on the same machine.

20. You should now be presented with the following dialog


window.

As this is the first time you are installing PSCAD V4 and the License
Manager will require a new product license - select Yes - install/
update product licenses. If this not your first installation of the
License Manager or you prefer not to install or update your license,
select No - don’t install/update product licenses. See the notes
below if you are not sure. Click Next. If No - don’t install/update
product licenses is selected, proceed to Step 24.

PSCAD User’s Guide 37


Chapter 2: Installation and Setup

Select Yes:
• If this is the first time you are installing the License Manager on
this machine, or
• If you are adding a new license (V4 for instance) to an existing
license database file, or
• If you are updating or modifying a license, which is already in
the existing license database file.

Select No:

• If you have no new licenses to add to the license database file,


and
• If you do not wish to update or modify any licenses already in
your license database file.

21. The Installer will then invoke the ‘Enter License Key’ program,
and a DOS window should appear asking you to enter the
License Key File Name. This file is located on the floppy disk
provided with PSCAD, entitled ‘License Manager: [Link]’.

22. Place the License Floppy Disk into your floppy drive and enter
‘a:\[Link]’, as shown below, where ‘a’ represents the
drive letter. If your License File is located at another location,
such as on the network, enter the absolute path to the file or
contact your system administrator for help.

38 PSCAD User’s Guide


PSCAD

Press the Enter key when you are finished.


Troubleshooting:
License File Cannot be Found:
If the ‘Enter License Key’ program is unable to find the license file, you
may receive the following message:

If so, make sure that the path to the license file is indeed correct. Also,
make sure that there are no problems with the floppy disk or drive (if
your License File is on a floppy disk). Press the Enter key.
License File and License Database Do Not Match:
This problem usually arises during a new installation when License
Manager software was previously installed on this computer. The
licensing information is stored on a file called ‘lmgr-hvdc’ (with no
extension), which is usually located in your Windows or WINNT directory.
This file is not deleted when the License Manager is uninstalled. If this is
indeed the case, select Option 3 as indicated below:

PSCAD User’s Guide 39


Chapter 2: Installation and Setup

If problems persist, press Ctrl + C to exit the Enter License Key program
and continue with the installation. When the installation is completed,
attempt to add your license again by following the directions given in
the section entitled ‘Adding/Upgrading Licenses’ in this chapter. If this
fails, follow the directions in the section entitled ‘Getting License
Information’ in this chapter. Send the ‘[Link]’ file to PSCAD
Support Services (support@[Link]) with a description of the
problem.

40 PSCAD User’s Guide


PSCAD

23. The Install program will now scan both the dongle and the
license file and check for validity. The output will be similar to
that shown above. Press the Enter key to exit.
24. This completes the License Manager installation process. It is
highly recommended that you view the ‘Read Me’ file when
prompted, as it contains useful information to users.

If you did not choose to install the GNU Fortran compiler in Step 5, then
installation is now complete (unless you selected to install the RTP demo
software). Please review the section entitled ‘Finalizing Your
Installation’ .

Installing EGCS/GNU Fortran


If you chose to install the GNU Fortran compiler in Step 5, the Installer
will now begin to install it.
25. The GNU compiler installation is quite straightforward. Press
Finish when complete.
26. This completes the EGCS/GNU Fortran installation process. It is
highly recommended that you view the ‘Read Me’ file when
prompted, as it contains useful information to users.

Installing LiveWire/LiveWire Lite


If you chose to install LiveWire in Step 5, the Installer will now begin to
install it.

27. The LiveWire installation is quite straightforward. Press Finish


when complete.
28. This completes the LiveWire installation process. It is highly
recommended that you view the ‘Read Me’ file when
prompted, as it contains useful information to users.

UPGRADING YOUR V4 SOFTWARE


This section is exclusively for those who are upgrading a previous version
of PSCAD V4. If this is the first time that PSCAD and/or the License
Manager is to be installed on a particular machine, see Installing V4 for
the First Time
Patching is not a full install
Upgrading a Previous Installation with a Patch and so you must have
previously installed an older
Patch upgrades are available for download on the official PSCAD web version of PSCAD v4.0.x
site ([Link]). before you can continue.

Please perform the following steps:

PSCAD User’s Guide 41


Chapter 2: Installation and Setup

1. Go to the official PSCAD web site ([Link]) and select


the Downloads section from the main menu bar. You will be
asked to enter your PSCAD Member ID and Password before
being allowed access to the download site. If you do not have
a Member ID and Password, you can become a member by
selecting the ‘register’ link on the page. Contact us at
support@[Link] if you experience problems.
2. Once you are in the Downloads area, select the desired
Download, Update or Patch PSCAD V4 link under PSCAD
V4 heading. This will direct you to a new page corresponding
to the PSCAD Edition type selected. Please review the
information presented in this page before proceeding. Select
the link entitled Patch PSCAD™ V4 <xxx> Edition to V4.x.x.
3. On the resulting page, click the Install button.
4. Set-up will initiate and you should see a dialog indicating the
security risk of downloading the patch directly from our
website. Please read carefully and select I understand the
security risk and wish to continue and click Next IF this is
indeed what you wish to do. If you wish to cancel the patch
installation, click the Cancel button.

42 PSCAD User’s Guide


PSCAD

5. The installer will then check your system for the required base
installation. You must have previously fully installed a PSCAD
v4.x.x version in order to proceed with the patch process. If
this is indeed the case, then refer to Steps 6 and 7 in the next
section.

Modifying a Previous Installation


An option is provided to modify the PSCAD software components that
were installed by the previous set-up. If your operating system is
Windows NT4, XP or 2000, you must have administrator or power user
access to your machine, in order to modify an installation.
Please perform the following steps:
In order to install a patch,
1. If a Standalone License Manager was previously installed on you have already installed a
this PC, it must be stopped before you continue. See previous full version of
PSCAD v4.x.x.
Manually Stopping the License Manager for more details.
2. Insert the PSCAD CD (from which you previously installed your
software) into your CD-ROM drive.
3. The installer should start automatically and in a few moments,
you should see the following screen:

PSCAD User’s Guide 43


Chapter 2: Installation and Setup

4. Select Modify and then click Next. Each screen that requires
important user input will have a corresponding step to it in
the following pages.
5. The following warning should pop-up. If this warning is not
heeded, the Installer may not be able to perform the
modifications. Click OK

6. You will be presented with the following screen, on which


options are available for your install. The options previously
selected should appear. Select how you would like to modify
your installation.

All components selected will


be installed or upgraded.
All components that are
deselected will be
uninstalled!

44 PSCAD User’s Guide


PSCAD

Explanations for each of the above options are given below.


• PSCAD: Select this option to install PSCAD. Although all
PSCAD editions (i.e. Student, Educational and Professional) are
included on the CD, you must be properly licensed to use any
edition other than the Student Edition!
• GNU Fortran Compiler: If you do not currently have either
the Digital or the Compaq Fortran 90 compiler installed, select
the GNU Fortran compiler. A Fortran compiler is required for
any PSCAD project to simulate (run).
• License Manager: Only select to install the License Manager
if you intend for this machine to be the License Manager server
on a network (Standalone Licensing).
• LiveWire Lite (Demo): Select this option to install the
evaluation version of LiveWire. LiveWire is the primary data
analysis and post-processing software tool recommended for
use with PSCAD. You can get more information on this
software at [Link]/[Link].
• LiveWire: Select this option to install the full version of
LiveWire. Note that you must be licensed to run the full
version. Please contact us at sales@[Link] for more details
on obtaining a full license.
• Real Time Playback: If you wish to evaluate the Real Time
Playback (RTP) demo software (or install the commercial
version), select this option. For more on the RTP, see our
website at: [Link]/products/RTP/[Link]

Possible Messages:

License Manager is Currently Running:

If you selected to either install or uninstall the License Manager software


and an instance of the License Manager is detected as running on this
PC, you will receive the following dialog.

PSCAD User’s Guide 45


Chapter 2: Installation and Setup

See Manually Stopping the License Manager for more details. Click
Retry once the License Manager process has been stopped.

PSCAD is Currently Running:

If you selected to either install or uninstall the PSCAD and an instance of


PSCAD is detected as running on this PC, you will receive the following
dialog.

Close PSCAD and click Retry.

7. The Installer will now perform a variety of tests to verify system


settings and to ensure that everything is OK to proceed. If you
would like to see the results of these diagnostics, please have
a look at the report dialog window (similar to that shown
below):

46 PSCAD User’s Guide


PSCAD

At this point, the Installer will attempt to install or uninstall components


as selected in Step 6.

Repairing a Previous Installation


An option is provided to repair any PSCAD software components that
were installed by the previous set-up. If your operating system is
Windows NT4, XP or 2000, you must have administrator access to your
machine, in order to repair an installation.

Please perform the following steps:

1. If a stand-alone License Manager was previously installed, it


must be stopped before you continue. See Manually Stopping
the License Manager for more details on how to stop the
License Manager.

2. Insert the PSCAD CD (from which you previously installed your


software) into your CD-ROM drive.

3. The installer should start automatically and in a few moments,


you should see the following screen:

PSCAD User’s Guide 47


Chapter 2: Installation and Setup

4. Select Repair and the click Next. Each screen that requires
important user input will have a corresponding step to it in
the following pages.

5. The following warning should pop-up. Click OK.

6. You will be presented with the following screen, on which


software modules are available for your repair. Select which
ones you would like to repair.

7. The Installer will now perform a variety of tests to verify system


settings and to ensure that everything is OK to proceed. If you
would like to see the results of these diagnostics, please have
a look at the report dialog window (similar to that shown
below):

48 PSCAD User’s Guide


PSCAD

At this point, the Installer will attempt to re-install all components


installed in the previous set-up.

Possible Messages:

License Manager is Currently Running:

If you selected to repair the License Manager software and an instance


of the License Manager is detected as running on this PC, you will
receive the following dialog.

See Manually Stopping the License Manager for more details. Click
Retry once the License Manager process has been stopped.

PSCAD User’s Guide 49


Chapter 2: Installation and Setup

PSCAD is Currently Running:

If you selected to repair PSCAD and an instance of PSCAD is detected


as running on this PC, you will receive the following dialog.

Close PSCAD and click Retry.

Uninstalling
An option is provided to remove (uninstall) all PSCAD software
components that were installed by the previous set-up. If your
operating system is Windows NT4, XP or 2000, you must have
administrator or power user access to your machine, in order to
uninstall.

Please perform the following steps:

The uninstall program will


1. If a standalone License Manager was previously installed, it
not remove any modified must be stopped before you continue. See Manually Stopping
files. This includes the
*.emt directories created by
the License Manager for more details on how to stop the
PSCAD at runtime. These License Manager.
must be removed manually.
2. Insert the PSCAD CD, from which you previously installed your
software, into your CD-ROM drive.

3. The installer should start automatically and in a few moments,


you should see the following screen:

50 PSCAD User’s Guide


PSCAD

4. Select Remove and the click Next.

5. The following confirmation warning should pop-up. Click


OK.

At this point, the Installer will attempt to re-install all components


installed in the previous set-up.

Possible Messages:

License Manager is Currently Running:

If you selected to remove the License Manager software and an


instance of the License Manager is detected as running on this PC, you
will receive the following dialog.

PSCAD User’s Guide 51


Chapter 2: Installation and Setup

See Manually Stopping the License Manager for more details. Click
Retry once the License Manager process has been stopped.

PSCAD is Currently Running:

If you selected to remove PSCAD and an instance of PSCAD is detected


as running on this PC, you will receive the following dialog

Close PSCAD and click Retry.

FINALIZING YOUR INSTALLATION


There are a couple of loose ends to tie up before you begin using
PSCAD V4.

Windows 98/ME Only

If you installed the EGCS/GNU Fortran 77 compiler or the License


Manager, then you must reboot in order set up environment
information.

If you chose to manually start the License Manager, then be sure to do

52 PSCAD User’s Guide


PSCAD

so upon reboot, before starting PSCAD. See Manually Starting the


License Manager for more details.

Windows NT4/XP/2000 Only

Once installation is complete, you must manually start the License


Manager service if you decide not to reboot your machine. See the
‘Manually Starting the License Manager’ section in this chapter for
more details.

If you installed the EGCS/GNU Fortran 77 compiler, then you must log-
out and then log-in in order to update the environment information.

Adding a Shortcut to the PSCAD Executable


All editions of PSCAD V4 now come complete as one executable file.
Therefore when creating a desktop shortcut, add one of the suffixes
described below to your shortcut path.
Professional Edition:

“C:\Program Files\PSCAD4xx\bin\win\[Link]” PRO

Educational Edition:

“C:\Program Files\PSCAD4xx\bin\win\[Link]” EDU

Student Edition:

“C:\Program Files\PSCAD4xx\bin\win\[Link]”

Of course, if you have used something other than the default


installation directory, the above paths will differ.

RUNNING PSCAD FOR THE FIRST TIME


To run PSCAD, simply click on START | Programs | PSCAD and select
whichever PSCAD edition you are licensed for. The program should
now load without any problems. You are now ready to simulate
cases!

There are however, a couple of problems that may be encountered at


this point. The most common are described below.

PSCAD User’s Guide 53


Chapter 2: Installation and Setup

Failed to Connect to License Manager Server


If there has been a problem with your License Manager installation,
have lost contact with the License Manager, or have not started it, it will
most likely be noticed when you first start PSCAD. When PSCAD is
invoked, it will ask the License Manager if there is a license available. If
PSCAD cannot communicate with the License Manager at all, the
following screen will be encountered upon attempting to start PSCAD:

Followed by:

‘localhost’ is the host name


of the License Manager
server. The host name
indicated could also be
another computer on the
network.

This usually indicates one of the following possible problems:

• The License Manager is installed, but either not configured


properly or not running at all. This may include problems
with the dongle (i.e., it is not connected or corrupt).
• The License Manager server on the network is down, or
communication with the server is impossible.
• The machine name (or IP address) of the License Manager
server is incorrect.
• The user failed to run the ‘Enter License Key’ program to
enter their license information.

54 PSCAD User’s Guide


PSCAD

Solution: First check the dongle’s physical connection. If this machine


is on the LAN, ask your system administrator for help. Ensure that the
machine name that you entered is correct and that there are no spaces
in the name. Check the License Manager Log file (i.e. [Link] or
[Link] in you Windows or WINNT directory) for clues: Did you
enter your License Key? If using Windows NT4, XP or 2000, did you
start the License Manager service? See Adding / Upgrading
Standalone Licenses or Adding / Upgrading Single-User Licenses for
more details on how to add a license.

If all else fails, contact us by email at PSCAD Support Services


(support@[Link]). Attach the ‘[Link]’ file and the
‘[Link]’ files from your Windows or WINNT directory for us to
analyze.

Running a Simulation Generates a ’make –f‘ or ’nmake –f‘ Error


You may encounter a ‘make –f’ or ‘nmake –f’ error when attempting to
run a simulation for the first time.

The ‘make –f’ error means


that PSCAD is configured to
use the GNU Fortran
compiler, while ‘nmake –f’
refers to one of the Fortran
90 compilers.
This error indicates that PSCAD is unable to connect with a Fortran
compiler so as to build an executable for simulating. This can be caused
by one of the following reasons:

• The specified Fortran compiler is not installed.


• A virus scanner is blocking TCP/IP communication.
• The compiler environment variables are not installed
properly.
• Another program uses a utility program with the same
name (i.e., ‘make’ or ‘nmake’) and is defined first in either
the ‘[Link]’ file, or in the system environment
variables. In other words, this other utility is being called.

Solution: Ensure that the specified Fortran compiler is installed. Make


sure that your virus scanner is configured to allow the required

PSCAD User’s Guide 55


Chapter 2: Installation and Setup

communication. Check that the compiler environment variables are set


properly. Check either your ‘[Link]’ file or your environment
variables (depending on your OS) to see if there is a conflicting utility. If
so, you may be able to solve this problem by placing the utility definition
statement, related to the PSCAD compiler, before the other. When in
doubt, ask your system administrator for help.

If all else fails, contact us by email at PSCAD Support Services


(support@[Link]) with a detailed description of the problem.

SETTING COMPILER ENVIRONMENT VARIABLES


Each compiler installer program should automatically set the
environment variables for the corresponding Fortran compiler. However,
there are instances where this may fail. The following are instructions
on how to manually set these variables as per compiler and operating
system:

EGCS/GNU Fortran 77 Compiler

Windows NT4/XP/2000

1. Right-click on your ‘My Computer’ icon and select


Properties...
2. Click the Advanced tab and select Environment Variables
3. Ensure that the following User Variable is set:

Variable: GCC_EXEC_PREFIX
Value: C:\progra~1\egcs\lib\gcc-lib\

4. Ensure that the following paths are added to the User Variable
PATH (in addition to what already exists):
The environment variable
paths should be in 8 - Variable: PATH
character DOS format.
Value: C:\progra~1\egcs\bin

Windows 98/ME

The above changes need to be made by editing the ‘[Link]’ file


according to standard formats. For help on this, contact your system
administrator.

56 PSCAD User’s Guide


PSCAD

Digital Fortran 5 Compiler


Windows NT4/XP/2000

1. Right-click on your ‘My Computer’ icon and select


Properties...
2. Click the Advanced tab and select Environment Variables
3. Ensure that the following System Variables are set:

Variable: FPS_LIB
Value: C:\Program Files\DevStudio\VC\LIB

Variable: INCLUDE
Value: C:\Program Files\DevStudio\DF\INCLUDE;
C:\Program Files\DevStudio\VC\INCLUDE

Variable: LIB
Value: C:\Program Files\DevStudio\DF\LIB;
C:\Program Files\DevStudio\VC\LIB
Variable: Path
Value: C:\Program Files\DevStudio\SharedIDE\BIN;
C:\Program Files\DevStudio\DF\BIN;
C:\Program Files\DevStudio\VC\BIN;

Windows 98/ME

The above changes need to be made by editing the ‘[Link]’ file


according to standard formats. For help on this, contact your system
administrator.

Compaq Fortran 6 Compiler


Windows NT4/XP/2000

1. Right-click on your ‘My Computer’ icon and select


Properties...
2. Click the Advanced tab and select Environment Variables
3. Ensure that the following System Variables are set:

Variable: INCLUDE
Value: C:\Program Files\Microsoft Visual
Studio\DF98\INCLUDE;

PSCAD User’s Guide 57


Chapter 2: Installation and Setup

C:\Program Files\Microsoft Visual


Studio\VC98\INCLUDE

Variable: LIB
Value: C:\Program Files\Microsoft Visual Studio\DF98\LIB;
C:\Program Files\Microsoft Visual Studio\VC98\LIB

Variable: Path
Value: C:\Program Files\Microsoft Visual
studio\Common\Tools;
C:\Program Files\Microsoft
VisualStudio\Common\Msdev98\BIN;
C:\Program Files\Microsoft Visual Studio\DF98\BIN;
C:\Program Files\Microsoft Visual Studio\VC98\BIN

Windows 98/ME

The above changes need to be made by editing the ‘[Link]’ file


according to standard formats. For help on this, contact your system
administrator.

TRIAL LICENSES
If you have already installed the PSCAD V4 Student Edition and require
Once you have submitted
Trial License request, a new more than the fixed 15 electrical node limit, or if you would like to
License Key will be sent review the component design features, you may be interested in a time
pending approval. Trial
licensing is only available for limited evaluation license for the PSCAD V4 Professional Edition. If
the PSCAD V4 Professional interested, please follow the procedures below to receive your Trial
Edition. License.

Requesting a Trial License


As part of the Requesting a Trial License procedure, you must provide us
with some specifics on the PC you will be using to run PSCAD. This
information is supplied to us in the form of a text file, which contains
important machine metrics, such as computer name and other operating
system information. This data is required to create a Trial License file
and is held in the strictest confidentiality.

The following lists the steps involved in requesting a trial license:

1. Open the PSCAD Student Edition and go to Edit | Workspace


Settings... in the main menu bar to open the Workspace
Settings dialog.
2. Select the License tab near the top of the dialog.

58 PSCAD User’s Guide


PSCAD

3. In the Trial License area of this dialog, enter a filename and


path in the input field entitled Generate Trial License
Request or use the Browse button to navigate to the desired
directory. This will specify where PSCAD is to place the Trial
License Request file once it is generated. To avoid confusion,
leave this path and filename as default. Press the ‘Generate’
button directly to the right of this field.

PSCAD User’s Guide 59


Chapter 2: Installation and Setup

4. A Trial License Registration entry form will appear. Enter all


required information into the form and then click the Submit
button near the bottom of the form.

60 PSCAD User’s Guide


PSCAD

5. If all fields in Step 4 were entered correctly, PSCAD will


generate the Trial License Request file and place it in the
directory specified in Step 3. A Trial License Request dialog
will appear confirming the placement of the file.

6. A dialog will appear asking if you would like to email the Trial
License Request file now. Click Yes to proceed to Step 7.
Click No if you wish to email the Trial License Request file at a
later time. If you decide to send the file at a later time, you
can start at Step 8 of this procedure, as the file has already
been created.

7. Another dialog will appear with a simple warning. Please read


carefully:

PSCAD User’s Guide 61


Chapter 2: Installation and Setup

8. PSCAD will then open a new email form from your default
email tool. The body of the email will contain the information
given in Step 4 and the sending address is set to PSCAD Sales
(sales@[Link]).

If you generated your Trial


License Request file at an
earlier time, you do not
need to add the text to the
body of the email, as this is
contained within your Trial
License Request file anyway.

9. Remember to manually attach the Trial License Request file to


email in Step 8 (the file will located in the directory specified in
Step 3). Send the email to PSCAD Sales (sales@[Link]).
You should receive a response within the next couple of days.
Do not upgrade your
operating system, change See the next section entitled ‘Installing a Trial License’ upon
your system clock, or receipt of your Trial License key.
change any hardware
configuration (i.e. hard
drives, motherboard, etc.) Installing a Trial License
while waiting for your Trial
Upon approval of your trial license request, you will receive an email from
License Key.
us with your trial license file attached (called ‘[Link]’).

62 PSCAD User’s Guide


PSCAD

Before proceeding with installation, please note the following important


points:

• The Trial License can only be installed on the computer from


which it was requested.
• When operating under a Trial License, PSCAD will only run if it
is the only PSCAD instance active on your machine. Quit all
other instances of PSCAD (both V3 and V4), prior to starting
with a Trial License.
• The Trial License will not operate if certain computer system
configurations are changed. Do not: Upgrade your operating
system, change your system clock, or change any hardware
configuration (i.e. hard drives, motherboard, etc.) during the
course of the Trial License period.
• If you encounter problems during this process contact us at
PSCAD Support Services (support@[Link]).

The following procedure outlines how to install a Trial License:

1. Save the Trial License key (i.e. ‘[Link]’ file) somewhere on


your hard drive (say C:\temp).
2. Open the PSCAD Student Edition and go to Edit | Workspace
Settings... in the main menu bar to open the Workspace
Settings dialog.
3. Select the License tab near the top of the dialog.

PSCAD User’s Guide 63


Chapter 2: Installation and Setup

4. In the Trial License area of this dialog, enter the filename and
path to your ‘[Link]’ file in the input field entitled Install
Trial License or press the Browse button to navigate to the
file. Once entered, press the Install button directly to the
right of this field.

If the license does not install


correctly, please contact us
at PSCAD Support Services
(support@[Link]).

64 PSCAD User’s Guide


PSCAD

5. If Trial License is installed correctly, a Trial License Installation


dialog will appear confirming this along with the expiry date of
the Trial License. Click the OK button.

Please see Finalizing Your


Installation in this chapter if
6. Close the PSCAD Student Edition and then open the PSCAD you plan to add a shortcut
Professional Edition. See ‘Viewing Active License Information’ to the PSCAD Professional
for details on checking if your Trial License is running properly. Edition on your desktop.

ADDING / UPGRADING STANDALONE LICENSE


MANAGER LICENSES
You do not need to reinstall the License Manager in order to update or
add a Stand-Alone License Manager License. You will simply need to
update the License Manager database file, which resides on your
computer’s hard drive.

To update or add a new Stand-Alone License Manager License to your


license database file, use the ‘Enter License Key’ program:
1. Go to START | Programs | HVDC Lmgr and select ‘Enter License
Key’.
2. Follow Steps 21 to 23 in Installing V4 for the First Time.

PSCAD User’s Guide 65


Chapter 2: Installation and Setup

ADDING / UPGRADING A SINGLE-USER LICENSE


You do not need to reinstall the License Manager in order to update or
add a Single-User License. You will simply need to update the License
Manager database file, which resides on your computer’s hard drive.

To update or add a new license to your license database file:


1. Save your license file (located on the floppy disk provided with
PSCAD, entitled ‘License Manager: [Link]’) to a
convenient directory (say C:\temp).
2. Open PSCAD V4 Student Edition and go to Edit | Workspace
Settings… in the Main Menu Bar. Click the License tab.

66 PSCAD User’s Guide


PSCAD

3. In the Single User License area of this dialog, enter the


filename and path to your Single User license file in the input
field entitled Install Single User License(s). Press the Install
button directly to the right of the input field and navigate to
the saved ‘[Link]’ file. Select OK in the pop-up dialog
window.

4. Click OK on the Workspace Settings dialog and exit the


PSCAD Student Edition.
5. You should now be able to load the PSCAD edition for which
you are licensed.

CHANGING ACTIVE LICENSING SETTINGS


PSCAD allows you to alter your present (i.e. ‘active’) license settings
without the need to close and reopen the program in a different mode.
You can change the License Manager host computer, and/or the license
type (i.e. Professional, Educational or Student) directly from the
Workspace Settings dialog. To open this dialog, go to Edit |
Workspace Settings... in the main menu bar and click the License
tab.

PSCAD User’s Guide 67


Chapter 2: Installation and Setup

Changing License Manager Host


To change the License Manager host computer, simply enter the name
of the new host (along with 2053), and click the Apply button.

Changing Active License Type


To change the active license type, click the down arrow in the selection
box under the Available License(s) area and select the required
license. Click the Activate button.

68 PSCAD User’s Guide


PSCAD

You must be properly


licensed in order to change
license type!
VIEWING ACTIVE LICENSE INFORMATION
At any time, you can review the status of your active license.

1. Open PSCAD and go to Edit | Workspace Settings… in the


Main Menu bar. Select the License tab.

PSCAD User’s Guide 69


Chapter 2: Installation and Setup

2. Near the bottom of the dialog, there is an area entitled Active


License. Some preliminary information is given directly within
this area. For more detailed information, click the Details...
button. A dialog should pop-up displaying all available
information regarding your current licensing. If you wish you
can save this data to a text file or copy it to the Windows
clipboard. Select OK to close the dialog.

GETTING LICENSING INFORMATION


If you would like information about your licenses, you can get this
directly from the dongle itself. This information is also helpful in
troubleshooting if a problem arises, and is used by PSCAD Support to
help solve any License Manager issues.

Stand-Alone License Manager Information


To view your Stand-Alone License Manager information, use the ‘Get
License Info’ program:
1. Go to START | Programs | HVDC Lmgr and select ‘Get License
Info’.

70 PSCAD User’s Guide


PSCAD

When you run this program, a DOS based window should appear similar
to that shown above.

A text file will also be created at the same time called ‘[Link]’ (as
indicated above). This is an important file to include when contacting
PSCAD Support Services by email (support@[Link]).

Active Licensing Information


See the section entitled ‘Viewing Active License Information’ for more
details.

MANUALLY STARTING THE LICENSE MANAGER


The method for starting the License Manager is different for the various
Windows platforms:

PSCAD User’s Guide 71


Chapter 2: Installation and Setup

Windows 98/ME

• Go to START | Programs | HVDC Lmgr. Select ‘Start License


Manager.’

Windows NT

• Go to START | Settings | Control Panel | Services. Select


the HVDC License Manager and select ‘Start.’

Windows XP/2000

• Right-click on your My Computer desktop icon and


select Manage.
• Double-click on the Services and Applications entry and
then double-click Services.
• Highlight ‘HVDC License Manager,’ right-click and select
‘Start.’

MANUALLY STOPPING THE LICENSE MANAGER


The method for stopping the License Manager is different for various
Windows platforms:

Windows 98/ME

• Press Ctrl-Alt-Del to bring up the Task List and then use


End Task to stop any instances of ‘lmgrd-hvdc.’

Windows NT

• Go to START | Settings | Control Panel | Services. Select


the HVDC License Manager and select ‘Stop.’

Windows XP/2000

• Right-click on your My Computer desktop icon and select


Manage.
• Double-click on the Services and Applications entry and
then double-click Services.
• Highlight ‘HVDC License Manager,’ right-click and select
‘Stop.’

72 PSCAD User’s Guide


PSCAD

WORKSPACE SETTINGS
Workspace settings are those that affect the entire Workspace (i.e. all
loaded projects). These parameters are contained within a single dialog
window called the Workspace Settings dialog.
To access this dialog, go to Edit | Workspace Settings... in the Main
Menu bar. The settings available in the Workspace Settings dialog
control window are divided into five specific areas:
• Projects
• Views
• Fortran
• Matlab
• License
Projects
The Projects section of the Workspace Settings dialog window contains
a variety of user preference settings related to Projects. These are
explained in detail [Link] below.

PSCAD User’s Guide 73


Chapter 2: Installation and Setup

Initialization
This area provides some preferences specific to saving and initialization:
• Reload Projects at Startup: When selected, this setting will
ensure that all Library and Case Project files, which were
loaded in the Workspace when you last exited PSCAD, are
reloaded again at start-up. When de-selected, only the Master
Library will be loaded at start-up.
• Automatically Save Projects: When selected, PSCAD will
save all Library and Case Projects loaded in the Workspace at
the specified intervals.
• Most Recently Used Projects: Enter the number of recently
used Library and Case Projects that you would like to appear in
the File menu of the Main Menu bar. You may enter a
number in the range from 0 to 16 recently used Projects.
• Project Directory: Enter the default directory path for the
Load Project dialog. You can either enter the path directly, or
use the browse button to select the directory. This path may
be changed at any time.

HTML Browser
Enter the path to your preferred Internet browser. You can either enter
the path directly, or use the browse button to select the directory. This
browser will be used for viewing your user-written component help files.
See Help Segment in Chapter 8 for details on setting up component
help files.
Views
The Views section of the Workspace Settings dialog window contains a
variety of mostly cosmetic preference settings and functions. These are
explained in detail below.

74 PSCAD User’s Guide


PSCAD

Circuit View
This area provides some preferences specific to the Circuit view:
• Enable Visual Feedback when Hovering Over
Components: Selecting this option will enable selection
boxes to appear around Components and Modules when the
mouse pointer is over top of them.
• Enable Cut/Copy/Paste without ‘Ctrl’ Key: Select this
option to revert to the PSCAD V3 style hot keys for cut/copy/
paste (i.e. x, c and v)

PSCAD User’s Guide 75


Chapter 2: Installation and Setup

• Solder Wires at Signal Junctions: Select this option to show


solder connection symbols at all overlapping signal junctions.
This feature is used mostly to detect for overlapping Wires and
possible short circuits. Once debugging is complete, this option
should be turned off on larger Projects, as it can add significant
build time to the Project.
• Enable ‘Shift’ key to create controls and curves: This
option is directly related to Drag and Drop. By default, all Drag
and Drop functions are invoked using the ‘Ctrl’ key in
combination with the left mouse button. This option should be
enabled if the user would prefer to designate the ‘Shift’ key (in
place of ‘Ctrl’) to place Curves to Graphs, or Control Interfaces/
Meters to Control Panels.

Script Editor
This area provides some preferences specific to the Script section of the
Design Editor:
• Use Syntax Colouring: Select this option to turn on code
syntax colouring in the Script section. When de-selected, all
Script code will appear in black and white.

Graph and Control Panel Style


Select a preferred panel style for Control Panels and Graph Frames.
The default setting is Metal Chisel, but you may also choose either
Plain Paper or 3D Shadow. The panels affected by this preference are
illustrated below:

76 PSCAD User’s Guide


PSCAD

PSCAD User’s Guide 77


Chapter 2: Installation and Setup

Fortran
The Fortran section of the Workspace Settings dialog window is used to
set-up Fortran related settings. These are explained in detail below.

78 PSCAD User’s Guide


PSCAD

Fortran Compiler
This section contains Fortran compiler settings:
• Installed Version: Select the Fortran compiler to be used for
compilation of PSCAD projects. If you have more than one
compiler installed, you may freely switch between compilers
without having to restart PSCAD or reload the project.
• EMTDC Library Path: Enter the path to the EMTDC library
directories. You can either enter the path directly, or use the
browse button to select the directory. This path is set to
default to the installation directory and should be left as such

PSCAD User’s Guide 79


Chapter 2: Installation and Setup

• User Library Path: The path entered here is automatically


appended to files entered into the Additional Library (*.lib) and
Object (*.obj) Files input field in the Project Settings dialog.

Matlab
The MATLAB® section of the Workspace Settings dialog window is used
to set-up MATLAB®/Simulink® Interface related settings. These are
explained in detail below

Interface Settings
The Interface Settings area is used to set-up a directory path to the
MATLAB® installation libraries.
• Installed Version: If you intend to make use of the
MATLAB®/Simulink® Interface in PSCAD, then choose which
version of MATLAB® you will be using in this field. PSCAD V4
currently supports MATLAB® versions 5.0 and 6.

80 PSCAD User’s Guide


PSCAD

• Library Path: If you are using MATLAB® version 5.0, you


must specify a path to the MATLAB® installation library
directory. This path will be used for all PSCAD projects using
the MATLAB®/Simulink® Interface. If MATLAB® version 6 is
selected, setting a path to the MATLAB® installation library
directory is not required. You can either enter the path directly,
or use the browse button to select the directory.

NOTE: Enabling the MATLAB®/ Simulink® interface is a


Project specific option. See Link Options in Chapter 6 for more
details.

License
The License section of the Workspace Settings dialog window is
devoted to License Manager and other licensing preferences and
features. These are explained in detail below.

PSCAD User’s Guide 81


Chapter 2: Installation and Setup

• License Host: Enter the hostname of the License Manager


server machine on your network. This field is automatically
configured during installation and should not need to be
adjusted unless your License Manager server hostname is
changed. The additional ‘2053’ number is always required
(specifies the port number). This field is not used if you are
using a trial license. For more details on how to change the
License Manager host directly from this dialog, see Changing
Active Licensing Settings in this chapter.

Trial License
The Trial License area is used only when requesting and installing a trial
license. See Trial Licenses in this chapter for more details.
Single User License
The single user license area is used only when installing and activating
single user licenses. See the sections entitled Adding/Upgrading a
Single-User License and Getting Licensing Information in this chapter for
more details.
Available License(s)
The Available License(s) area is used for switching between available
licenses. See Changing Active Licensing Settings in this chapter for
more details.
Active License
The Active License area is used only when requesting and installing a
trial license. See Trial Licenses in this chapter for more details.

82 PSCAD User’s Guide


PSCAD

PSCAD User’s Guide 83


Chapter 2: Installation and Setup

84 PSCAD User’s Guide


PSCAD

Chapter 3:

The PSCAD Environment


The term ‘PSCAD Environment’ refers not only to how the PSCAD
graphical users interface is organized visually, but also to naming
conventions, utilities and other features that facilitate creativity and
design. As you may notice, a lot of effort has gone into enhancing the
work environment in PSCAD V4. We have however, tried to maintain
the look and feel of the previous versions, preserving the most popular
functions and enhancing others.

This chapter discusses a wide range of introductory topics ranging from


simple terms and definitions, to a general overview of most important
functions in PSCAD. The tutorial section entitled ‘My First Simulation’ is
a must read for new PSCAD V4 users.

For a more detailed description of basic functions and operations, see


Chapter 4.

TERMINOLOGY AND DEFINITIONS


In order to fully appreciate the PSCAD User’s Guide and On-line Help
System, a quick review of the following common terms is suggested.
Due to the environmental changes implemented since PSCAD V3, there
have been several changes in the terminology used to describe some
new and old features as well.

Components
A component (sometimes referred to simply as a ‘block’) is essentially a
graphical representation of a device model, and is the basic building
block of circuits created in PSCAD. Components are usually designed to Single-Phase Transformer
perform a specific function, and can exist as either electrical, control, component in PSCAD
documentary or simply decorative in type.

Components usually posses inputs and outputs and can be pieced


together with other components to form larger systems. Model
parameters, such as input variables and constants, can also be manually
entered through the component.

PSCAD User’s Guide 85


Chapter 3: The PSCAD Environment

Definitions
A definition is essentially the underlying ‘blueprint’ of a component.
Accessed through the Design Editor, the component definition is where
all aspects of the component design are defined. This can include
graphical appearance, connection nodes, input dialogs and model code.

Component definitions are not graphical entities, and are usually stored
in library projects. Definitions stored in a library project can be used to
create component instances in any case project – including that library
project itself. However, definitions stored in a case project are local to
that case and cannot be used in other projects.

Instances
A component instance is a graphical ‘copy’ of the component definition,
and is normally what is seen and used in a project. An instance is not
exactly a copy, in that many component instances, based on the same
definition can exist simultaneously. Each instance is its own entity, and
can have different parameter settings, or even appear graphically
different from other instances.

Since all instances are based on a single definition, any design changes
to a component definition will affect all instances.

Modules
Modules are a special type of component, where the basic function of
the component model is described using a combination of other basic
components, rather than code. Modules can contain other modules
See the EMTDC User’s within them and thus provide a hierarchical modeling capability. Also
Guide for more details referred to as ‘sub-pages’ or ‘page components,’ modules are also
program structure and how
defined by a definition, but presently may only posses one instance per
modules are represented.
definition. A module behaves very much like an ordinary component
except that it does not allow input parameter entry.

Projects
PSCAD allows the user to store everything involved in a particular
simulation (except output files) into one file called a project. Projects
can contain stored component definitions, on-line plots and controls, and
of course the graphically constructed system itself. There are two types
of projects in PSCAD: Library and case projects.

86 PSCAD User’s Guide


PSCAD

Case
Case projects (or simply ‘cases’) are where most work is performed in
PSCAD. In addition to performing the functions of a library project,
cases may be compiled, built and run. Simulated results can be viewed
directly within the project through on-line meters and/or plots. Case
projects are saved with the file extension ‘*.psc.’
Component definitions
Library stored in case projects are
local to that case and
Library projects are used primarily to store component definitions and cannot be used in other
viewable component instances. Instances of component definitions projects. Library projects
should not contain
stored in a library, can be used in any case project, provided that the components defined in
library is loaded first. Library projects are saved with the file extension other cases or libraries.
‘*.psl.’

TUTORIAL: MY FIRST SIMULATION


The objective of this section is to give you a chance to try out a PSCAD
simulation before proceeding further in this chapter. If you can
successfully run this example case at the end of this chapter, it will also
mean that your installation was successful. So let’s begin!

Starting PSCAD
To start PSCAD, go to Start | Programs | PSCAD in the Windows Start
Menu, and select whichever PSCAD Edition you are licensed for. This
will open the main PSCAD environment as shown below.

PSCAD User’s Guide 87


Chapter 3: The PSCAD Environment

You should see a list of items across the top of the environment (File,
Edit, etc.). These items are part of the Main Menu. The buttons
directly below the main menu are part of the Main Toolbar.

Title, Menu and Main Tool Bar


The image below shows the PSCAD V4 Title and Menu Bars.

Title Bar and Active Project


The top most part of the window that displays PSCAD [Edition] is called
the Title Bar. The Title Bar will also include the Project page that is
currently being viewed in the Design Editor, once a Project is opened.

Menu Bar and Menu Items


The area under the Title Bar, consisting of menu items and menu
buttons, is called the Main Menu. All main menu items are drop down
menus, which means that when you left-click with your mouse pointer
over top one of these menus, you will see a list appearing below it.

To select an item from this list, first move the pointer onto that item (the
item becomes raised) and then click the left mouse button. The
following menu shows how to load a project using the File menu from
Main Menu bar.

88 PSCAD User’s Guide


PSCAD

Toolbar Buttons
The row of buttons directly below the Main Menu bar comprises the
Main Toolbar.

While menu items are a two-stage process, a toolbar offers a single-click


alternative. The Main Toolbar buttons initiate actions as soon as you
click on them and hence are easier to use. For this reason, most
frequently used operations have toolbar button equivalents.

After you become more familiar with the program, you can even use
the many keyboard shortcuts available. See Keyboard Shortcuts in this
chapter for more details.

Workspace and Output Windows


If you take a look at the top left-hand corner of the PSCAD
Environment, you should see a smaller window referred to as the
Workspace window. If it is not visible, go to the main menu bar and
click on View | Workspace.

The Workspace gives you an overall view of any library and/or case
project loaded. You can use it to select components and perform many
other activities.

Directly below the Workspace window, you should see another window
referred to as the Output window. If the Output window is not visible,
click on View | Output.

PSCAD User’s Guide 89


Chapter 3: The PSCAD Environment

All the status, warning and error messages involved in both Build and
Runtime procedures are logged in this window - so it is a good idea to
keep this window open and visible at all times.

Both the Workspace and Output windows behave similar to the Explorer
(file manager) standard on your Windows operating system. The use of
these windows is discussed in greater detail later in this chapter.

Loading a Case Project


We will first simulate an example case that has already been created to
appreciate the power of PSCAD. More importantly, this exercise will
help us to ensure that PSCAD and any Fortran compilers being used are
installed correctly. We will learn to create a case from scratch in
Creating a New Project in Chapter 4.

To load an existing Case Project, click on File from the Main Menu bar
and select Load Project... You can also either press Ctrl + O or click
the Load button in the Main Toolbar.
Load Button
You should see the Load Project dialog pop up on your screen. By
default, the selected file type is ‘PSCAD Files (*.psc, .psl)’ at the bottom
of the dialog. With this type selected, you will see only PSCAD Project
files that have ‘*.psc’ or ‘*.psl’ extension and directories. The file
extensions stand for pscad case or pscad library.

90 PSCAD User’s Guide


PSCAD

Navigate to the ‘tutorial’ directory inside your PSCAD installation


directory (i.e., C:\Program Files\PSCAD400\examples\tutorial). Click on
the ‘vdiv_1.psc’ file and then click on the Open button to load this
case project into PSCAD.

The Workspace window will now list a second project entitled ‘vdiv_1
(Single Phase Voltage Divider)’ directly under the Master Library Listing.
Double-click on the project title (or right-click and select Open) in the
Workspace window to open and view the main page of the project in
the Circuit window of the Design Editor.

PSCAD User’s Guide 91


Chapter 3: The PSCAD Environment

You should see the assembled voltage divider circuit as shown below,
which is located at the top left corner of the main page of the project
that you just opened. The plots are situated directly to the right of the
circuit.

The circuit consists of a single-phase resistive voltage source connected


to a resistive load. Since the magnitude of the source resistance (1W)
and the load resistance are the same, the voltage at the load terminal is
half that of the voltage behind the source resistance. This voltage is
measured using a voltmeter called ‘Vmid’ connected to the node
between the source and the load. The current in the circuit should be:

E
I Load =
RS + RL

The plot and graphs will contain the values of the voltage at the mid-
point of the circuit, and the current flowing through the circuit when the
project is run.

Running a Simulation
Before we run the simulation we will do a simple calculation to find out
what load current and mid-point voltage we should be expecting.
Double-click on the source component to open and view its properties
- note that the source voltage magnitude is 70.71 kV RMS (or 100 kV
peak). Close this dialog by clicking on the Cancel button at the bottom
of the dialog and left-click anywhere in an empty space on the page, to

92 PSCAD User’s Guide


PSCAD

de-select the selected source component (this will stop the component
from blinking). For a 100 kV source voltage, we know that the mid-
point voltage should then be 50 kV peak, and the load current should
be 50 kA peak. Now let us run the simulation and actually verify the
current and voltage waveforms.

To run a case, simply click on the Run button in the Main Toolbar.
When this button is pressed, PSCAD will go through several stages of
processing the circuit before starting the EMTDC simulation. You should
see a message window pop up on the screen and display messages Compile and Run
related to various stages of the process.

Watch the graphs as the simulation progresses. If you look at the


bottom left corner of the PSCAD Environment, you will see a message
‘xx% complete’ where ‘xx’ represents the percentage of the total
simulation length. To the right of it you will also see the current
simulation time, which changes with the simulation.

This tutorial case is set up to run for 0.2 seconds. At the end of the run
you will see the message ‘EMTDC run completed’. Your plots should
look similar to the following - depending on your plot settings:

Make sure that your simulation produces the same result as shown here.
This is one step towards ensuring that your PSCAD is installed correctly.

Click again on the Run button to see the run once again. PSCAD will
go through all three stages (i.e., compile, build and run), however, you
may not be able to detect the first two stages, as they pass by very

PSCAD User’s Guide 93


Chapter 3: The PSCAD Environment

quickly. This is because PSCAD performs them only if changes have


been made to the circuit.

Printing the Circuit


To print the circuit along with the graph you just simulated, click the
right mouse button on the background of the main circuit page and
either select Print Page or Print Preview Page items.

This should bring up either the Print dialog or the Print Preview Viewer.
The contents of the Print dialog is dependent on the printer driver
installed on your computer. The Print Preview Page allows you to view
your page before printing.

THE WORKSPACE
Formally known as the ‘Project Tree’ in PSCAD V3, the Workspace has
matured into a central project database for PSCAD. The Workspace not
only provides an overview of all projects currently loaded, but also
The PSCAD Master Library is
always the first project
organizes data files, signals, controls, display devices, etc. within an
loaded into the Workspace. easily navigable environment. Features such Drag and Drop may also
The Master Library cannot
be utilized from the Workspace.
be unloaded.

94 PSCAD User’s Guide


PSCAD

The Workspace window is divided into three tabular sections:

• Projects
• Runtime
• Files

Moving and Resizing the Workspace Window


The Workspace window may be moved and dropped anywhere in the
PSCAD environment. To do this, click and hold the left mouse button
with the mouse pointer directly over the top window bar.

Drag the window to where you want it placed (you should see a boxed
outline of the window) and let go of the mouse button. Depending on
where the window outline is when the mouse button is released, the
window will either dock itself into position or appear as a floating
window.

The Workspace window can be resized by moving the mouse pointer


over one of the four window edges until the pointer changes to that
shown below:

or

Click and hold the left mouse button, and drag the mouse pointer to
resize in either the horizontal or vertical direction as shown above.

The Projects Section


When a Case or Library Project is loaded into PSCAD, the Project

PSCAD User’s Guide 95


Chapter 3: The PSCAD Environment

filename and description will appear in the Projects section of the


Workspace window. It is possible to load multiple Projects – and if this
happens – the Projects will be listed in the order in which they were
loaded.

The Projects section is used mainly for navigating either between


Projects or within Projects; including direct access to Modules and
Definitions. A simple double-click on a listed Module, for instance, will
bring you directly to that page in Circuit view.

Icons are included for easy visual differentiation between Case and
Library Projects. These are listed below:

• Library Project

• Inactive Case Project

• Active Case Project

As mentioned above, each project listed in the Projects section contains


information regarding any stored Definitions, as well as Module
hierarchy, organised into a standard tree-type structure. This structure
is referred to as the Project Tree.

You can expand and detract each branch in the project tree by clicking
on either the [+] or the [-] symbols respectively.

Main Page Branch


This branch lists the various Module instances in the project. Starting
with the main page, any existing Modules will be shown in hierarchal
structure for easy navigation.

96 PSCAD User’s Guide


PSCAD

For example, the Case Project above (called ‘test’) contains a main
page with two Modules called ‘net1’ and ‘net2’. The Module ‘net1’
contains another Module called ‘sub1’.

A simple double-click on a particular Module will bring you directly to


that page in the Circuit window of the Design Editor. Right-clicking on a
Module will bring up a menu where you can either compile that
particular Module, or change the Module page set-up.

Icons are included for visual representation and are listed below:
• Main Page
• Module Instance
Definitions Branch
The Definitions branch contains a list of all definitions that are stored

PSCAD User’s Guide 97


Chapter 3: The PSCAD Environment

within that particular Project. Instances of component Definitions that


are defined in other Projects (such as Master Library components) do not
appear here.

The image below shows the list of component Definitions for the same
Case Project discussed in the previous section. In addition to the
definitions of each Module, the existence of a component Definition
(called ‘user_comp’) is also indicated.

This example is for


illustrative purposes only. It
is not usually a good idea to
define component
Definitions within a Case
Project, as they can then
only be used in that Project.
All component Definitions
should exist exclusively in
Library Projects.

A simple double-click on a Module Definition will bring you directly to


that page in the Circuit window of the Design Editor, whereas double-
clicking on a component Definition will bring you directly to the Graphic
view.

There are a couple of right-click menu functions involved with the


Definitions branch as well (some of these functions are not available
anywhere else). Right-clicking directly over the Definitions branch will
bring up a menu as shown below:

98 PSCAD User’s Guide


PSCAD

The following list describes the functions of this pop-up menu:

• Paste Definition: This function can be used to paste a


Definition that has been copied from this Project or from
another Project currently loaded in the Workspace (see the
Copy Definition menu function described below).
• Import Definition(s)…: This function is used to import
stored Definition Files (*.cmp).
• Copy to Clipboard: This option allows the user to copy the
entire Definitions list (i.e. names only) to the Windows
clipboard as ASCII text.
• Sort By Name: Select this option to sort the Definitions list by
name. Continually selecting this option will toggle the
alphabetical order from A to Z or Z to A.
• Sort By Description: Select this option to sort the Definitions
list by description. Continually selecting this option will toggle
the alphabetical order from A to Z or Z to A.

If you right-click with the mouse pointer over a specific component


Definition in the list, the following menu will appear:

PSCAD User’s Guide 99


Chapter 3: The PSCAD Environment

The following list describes the functions of this pop-up menu:

• Properties…: This brings up the Definition Properties dialog


window for editing the definition Name and Description. This
dialog is shown below:

• Edit Definition: Select this option to edit the Definition of


the component (opens the Graphic section of the Design
Editor).
• Copy Definition: Select this option to copy the Definition to
the Windows Clipboard.
• Delete Definition: Select this option to delete the Definition
(and all existing Instances of course!).

100 PSCAD User’s Guide


PSCAD

• Create Instance: Select this option to create an Instance of


the component for graphical display in the Circuit window of
the Design Editor. Note that once this option has been
selected, go to a blank part of the Circuit canvas, right-click
and select Paste. This will paste the copied Instance directly
onto the page. Once the first instance has been created,
subsequent copies may be made by directly copying the
original Instance.
• Export As…: This option brings up the ‘Export As’ dialog so
you can save the Definition to a Definition File (*.cmp).

Modules Only:

• Compile Module: If the selected Definition is a Module,


then selecting this option will compile that Module
individually.

Components Only:

• Help: If the Definition is a component, selecting this option


will open the associated help file.

Icons are included for visual differentiation between component


definitions and module definitions. These are listed below:

• Component Definition (no Instances exist in Project)


• Component Definition (one or more Instances exist in
Project)
• Module Definition (no Instances exist in Project)
• Module Definition (an Instance exists in Project)
• Component Definition has changed since last save
• Module Definition has changed since last save

Active Project
As mentioned earlier, the Projects section of the Workspace will allow
you to have multiple Projects loaded simultaneously. If a Case Project
is to be compiled and run, PSCAD needs to know which one – this is
accomplished by selecting an ‘Active’ Case Project (right-click on the
project and select Set as Active). The Projects, Runtime and Files
sections of the Workspace operate based on the Active Project.

PSCAD User’s Guide 101


Chapter 3: The PSCAD Environment

Active case projects are indicated shown below:

• Inactive Case Project


• Active Case Project

See Setting the Active Project for more details.


The Master Library
The Master Library is always the first Project listed in Projects section of
the Workspace whenever PSCAD is started. It contains most of the
components required to build almost any circuit. To open the Master
Library, simply left double-click the title in the Workspace or right-click
on the title and select Open from the pull down menu. The Master
Library page will open (Circuit view in the Design Editor window), giving
access to all of its components.

102 PSCAD User’s Guide


PSCAD

Components stored in the Master Library are categorized into several


Modules (located in the top-left corner of the main page), according to
the functionality of the component. For example, all transformer
components are stored in the Transformers Module. In addition to
these categories, most Master Library components are also located on
the main page. Some users may find this format allows for easier
navigation to the correct component.

If you want to add any of these components to your own case, simply
copy the Instance directly from the Master Library and paste into your
own Project. You can also use the Library Pop-up Menu system, or the Component definitions
Draw toolbars. stored in the Master Library
can be viewed, but not
directly modified. If you
The Runtime Section wish to modify one of these
The Runtime section is provided specifically for the organisation of definitions, copy the
definition into another
Runtime related objects, such as Output Channels, Controls, Graphs, Library Project first.
etc. into a convenient tree-based environment. The main trunk of the
Runtime tree is by default arranged according to existing Modules.
However, it is also possible to view Runtime objects according to
Runtime Group, or to view a list of existing Radio Links components.
Regardless of the view settings, any Runtime object can be navigated
to directly with a simple double-click.

To switch between each view type, right-click on the Project in the


Runtime section to view the pop-up menu.

PSCAD User’s Guide 103


Chapter 3: The PSCAD Environment

Select one of the following:

• View Modules: Select this option to view all Runtime objects


according to Module hierarchy.
• View Groups: Select this option to view all Runtime objects
according to Runtime Groups.
• View Radio Links: Select this option to view a list of existing
Radio Links components.

The other functions in this menu are as described below:

• Project Settings...: Select this option to access the Project


Settings dialog for the Project.
• Open: Select this option to open the Project main page in
Circuit view.
• Save: Select this option to save the Project.
• Save as...: Select this option to save the Project to another
filename.
• Sort By Name: Select this option to sort all Modules displayed
by name. Continually selecting this option will toggle the
alphabetical order from A to Z or Z to A.
• Sort By Description: Select this option to sort all Modules
displayed by description. Continually selecting this option will
toggle the alphabetical order from A to Z or Z to A.

Modules View
In Modules View, each Module Instance existing in a Project is
represented in the Runtime section as a branch. If the Module contains
any Runtime objects within it, a [+] box will appear beside its branch. In
the Case Project shown below, the only Module containing any Runtime
objects is ‘net1’.

104 PSCAD User’s Guide


PSCAD

A simple double-click on a particular Module branch will bring you


directly to that page in the Circuit window of the Design Editor. Right-
clicking on a Module branch will bring up the corresponding pop-up
menu.

The following list describes the functions available in this pop-up menu:

• Open: Opens the Module in Circuit view.


• Point to...: PSCAD will point to the location of the Module
Instance in the Project.
• View All: Allows viewing of all existing Runtime object sub-
branches.
• View Controls: Allows viewing of Control objects only.
• View Recorders: Allows viewing of Recorder objects only.

PSCAD User’s Guide 105


Chapter 3: The PSCAD Environment

• View Named Signals: Allows viewing of Named Signal


objects only.
• View Display Devices: Allows viewing of Display Devices
only.

Runtime Objects
Each Module branch will contain a list of all Runtime objects that exist in
the corresponding Module (provided that View All is selected as
described above). Whenever a Runtime object is added to the Project, a
Record of it is immediately added under the appropriate Module branch.
The Record will remain until the object is removed from the project.

Runtime objects are classified as special components that are involved


exclusively with the PSCAD Runtime interface and are organised into
four main groups:

• Controls
• Recorders
• Display Devices
• Named Signals

If a module contains any Runtime objects, these will appear as sub-


branches under the corresponding Module branch, as shown below.

If the Project does not


contain any devices in a
certain category, then the
respective category branch
will not appear here.

You can expand and detract each Module or sub-branch by clicking on


either the [+] or the [-] symbols respectively. Right-clicking on a sub-

106 PSCAD User’s Guide


PSCAD

branch branch will bring up the corresponding pop-up menu.

The following list describes the functions of this pop-up menu:

• Sort By Name: Select this option to sort all Records contained


within the sub-branch by Record name. Continually selecting
this option will toggle the alphabetical order from A to Z or Z
to A.
• Sort By Location: Select this option to sort all Records
contained within the sub-branch by Record location (i.e.
coordinates). Continually selecting this option will toggle the
alphabetical order from 1 to 9 or 9 to 1.
• Sort By Type: Select this option to sort all Records contained
within the sub-branch by Record type.

A simple double-click on a Runtime object will point you directly to that


object in the Circuit window. For example, double-clicking on the
‘Slider 1’ object under ‘Controls’ in the above diagram will result in the
following in Circuit view:

PSCAD User’s Guide 107


Chapter 3: The PSCAD Environment

Right-clicking on a Runtime object will invoke the pop-up menu:

The following list describes the functions of this menu:

• Point to…: Select this option to point directly to the


associated Runtime object in Circuit view (same as double-
click).
• Properties…: The properties dialog associated with this
Instance of the Runtime object can be accessed directly using
this option.
• Help…: Invokes the help page related to the Runtime object.

Controls and Records Only:

• Sort By Type: Select this option to sort all Observers (if they
exist) associated with the Runtime object by Type. Continually
selecting this option will toggle the alphabetical order from A
to Z or Z to A.
• Sort By Module Name: Select this option to sort all
Observers (if they exist) associated with the Runtime object by
Module name. Continually selecting this option will toggle the
alphabetical order from A to Z or Z to A.

108 PSCAD User’s Guide


PSCAD

Controls Only:

Sort By Panel Name: Select this option to sort all Observers (if
they exist) associated with the Runtime object by Control
Panel name. Continually selecting this option will toggle the
alphabetical order from A to Z or Z to A. You may use the Drag and
Drop feature to send
Controls and Records
Records Only: directly to a Display Device.

Sort By Container: Select this option to sort all Observers (if they
exist) associated with the Runtime object by Container (i.e.
Graph Frame or Control Panel). Continually selecting this
option will toggle the alphabetical order from A to Z or Z to A.

Icons are included in each Runtime object section for easy visual
identification and are listed below:

• Module
• Runtime sub-branch

Controls:

• Slider Component Instance


• Two State Switch Component Instance
• Dial Component Instance
• Push Button Component Instance

Recorders:

• Output Channel Instance


• RTP/COMTRADE Recorder Component Instance

Display Devices:

• Control Panel Instance


• Plot Frame Instance
• XY Plot Instance
• Polymeter Instance

PSCAD User’s Guide 109


Chapter 3: The PSCAD Environment

Named Signals:

• REAL Data Signal defined with a Data Label


• INTEGER Data Signal defined with a Data Label
• LOGICAL Data Signal defined with a Data Label

Observers
Output Channel and Control objects can exist in a Project without being
associated with a Curve, Meter or Control Interface (i.e. the data is not
plotted or monitored). If any of these objects is added as a Curve to a
Graph, Meter to a Control Panel, or added directly to a Polymeter, an
entry referred to as an ‘Observer’ will be added as a sub-branch to the
corresponding Recorder or Control in the Runtime section. If the object
is displayed in more than one Display Device, an Observer will be added
for each occurrence.

The figure below shows the existing Controls and Recorders in the
‘Network #1’ Module for our test Project. The Project contains a Slider
called ‘Slider 1’, a Two State Switch called ‘Switch 1’, as well as two
Output Channels entitled ‘Ea’ and ‘Switch 1 Output’. Each object
possesses an Observer to indicate that the output of the objects is being
sent to a Display Device.

110 PSCAD User’s Guide


PSCAD

A simple double-click on any Observer will point you directly to that


occurrence of Runtime Object within the Display Device. For
example, double-clicking on the ‘Slider 1’ Observer under ‘Controls’
in the above diagram will result in the following in Circuit view:

Icons are included for all Observer types. These are listed below:

PSCAD User’s Guide 111


Chapter 3: The PSCAD Environment

Recorders:

• Curve
• Meter Interface
• Polymeter

Controls:

• Slider Interface
• Dial Interface
• Two State Switch Interface
• Push Button Interface

Groups View
In Groups View, Runtime objects are listed according to Runtime Group.
If a particular Group contains any Runtime objects within it, a [+] box
will appear beside its branch. Right-clicking on a Group branch will
invoke a pop-up menu:

The following list describes the functions available in this pop-up menu:

• Sort By Name: Select this option to sort all Runtime objects


within a Group by name. Continually selecting this option will
toggle the alphabetical order from A to Z or Z to A.
• Sort By Type: Select this option to sort all Runtime objects
within a Group by type. Continually selecting this option will
toggle the alphabetical order from A to Z or Z to A.

In this view, all Controls or Output Channel objects (and corresponding

112 PSCAD User’s Guide


PSCAD

Observers) are organised according to a specified Runtime Group name.


Each group can contain any Controls or Output Channel object that is
described in the Runtime Objects and Observers sections above.

For more information on creating Runtime Groups, see Grouping of


Runtime Objects.

Radio Links View


In Radio Links View, all Radio Links components existing in the Project
are listed in alphabetical order. Right-clicking on a Group branch will
invoke a pop-up menu:

The following list describes the functions available in this pop-up menu:

• Point to...: PSCAD will point to the location of the


corresponding Radio Link component within the Project.
• Properties...: Select this option to edit the properties of the
corresponding Radio Link component.

Icons are included for both Radio Link types. These are listed below:

• Transmitter
• Receiver

The Files Section


The Files section is provided specifically for the organisation of all files
found in the Project Temporary Directory, such as Fortran, Data, Output,
etc. files, into a convenient tree-based environment. The main trunk of
the Files tree is arranged according to existing Modules, with an
additional ‘Output Files’ branch specifically to harbour miscellaneous
Output Files, unrelated to specific Modules.

PSCAD User’s Guide 113


Chapter 3: The PSCAD Environment

Right-clicking on the Project name will invoke a pop-up menu:

The functions in this menu are as described below:

• Close all File Windows: Selecting this option will close all
file windows currently open for viewing. This option will only
close windows related to external files, it will not close any
open Circuit views.
• Sort By Name: Select this option to sort all Modules
displayed by name. Continually selecting this option will
toggle the alphabetical order from A to Z or Z to A.
• Sort By Description: Select this option to sort all Modules
displayed by description. Continually selecting this option will
toggle the alphabetical order from A to Z or Z to A.
• Clean Temporary Directory (.emt): Select this option to
delete all temporary Project files (i.e. compilation, make,
data, etc. files) from the Temporary Directory. See PSCAD
Temporary Directories for more details.

The files shown on the main trunk are the Active Case Project file itself
(*.psc), along with the corresponding Map (*.map) and Make (*.mak)
files. A simple double-click on any file will open that file in the main
viewing area of the PSCAD Environment. Right-clicking on the File will
invoke a pop-up menu:

114 PSCAD User’s Guide


PSCAD

The functions in this menu are as described below:

• Open: Open the selected file for viewing.


• Delete: Delete the selected file from the PSCAD Temporary
Directory.

The icons used here are described as follows:

• Module directory
• Output files directory
• File

Transmission Lines and Cables


For the most part, Project related files can be viewed according to their
parent Module. Once the Project has been compiled, each Module
directory will contain a corresponding Fortran (*.f) and a Data (*.dta)
file.

If there are any existing transmission lines or cables within the Module,
all related line constants files will appear within a separate directory,
organised by the transmission system name. In the example below, the
Module ‘sub1’ contains both a overhead transmission line and an
underground cable system, in addition to a Fortran and Data file:

PSCAD User’s Guide 115


Chapter 3: The PSCAD Environment

Right-clicking on a transmission line or cable sub-directory will invoke a


pop-up menu as shown above. The options in this menu are as
described below:

• Edit Configuration: Selecting this option will open the The T-


Line/Cable Configuration Editor for the corresponding
transmission system, directly from the Files section.
• Properties...: Select this option to access the input dialog for
the corresponding Transmission Line Configuration or Cable
Configuration.
• Point to...: PSCAD will point to the location of the
transmission system in the Project.

RTP/COMTRADE Recorder
If there are any existing RTP/COMTRADE Recorder components within

116 PSCAD User’s Guide


PSCAD

the Module, all related files will appear within a separate directory,
organised by the RTP/COMTRADE Recorder output filename. In the
example below, the Module ‘net2’ contains an RTP/COMTRADE
Recorder component with an output filename labelled as ‘test’, in
addition to a Fortran and Data file:

Right-clicking on a RTP/COMTRADE Recorder sub-directory will invoke a


pop-up menu as shown above. The options in this menu are as
described below:

• Properties...: Select this option to access the input dialog for Depending on the settings
of the RTP/COMTRADE
the corresponding RTP/COMTRADE Recorder. Recorder component, there
• Point to...: PSCAD will point to the location of the RTP/ could be a number of
possible file types appearing
COMTRADE Recorder component in the Project. in this directory. See the
RTP/COMTRADE Recorder
component in the online
help for more details.

PSCAD User’s Guide 117


Chapter 3: The PSCAD Environment

Additional icons are provided as follows:

• Transmission line directory


• Cable directory
• RTP/COMTRADE Recorder component directory

THE OUTPUT WINDOW


Formerly known as the ‘Message Tree’ in previous PSCAD versions, the
Output window provides an easily accessible interface for viewing
feedback and troubleshooting your simulation. All error and warning
messages, either issued by a component, PSCAD or EMTDC, can be
viewed here – subdivided into either Build or Runtime messages.

The Output window will also provide the results of a project search,
using the Find feature, under the Search section tab.

Moving and Resizing the Output Window


The Output window may be moved and dropped anywhere in the
PSCAD environment. To do this, click and hold the left mouse button
with the mouse pointer directly over the top window bar.

Drag the window to where you want it placed (you should see a boxed
outline of the window) and let go of the mouse button. Depending on
where the window outline is when the mouse button is released, the
window will either dock itself into position or appear as a floating
window.

The Output window can be resized by moving the mouse pointer over
one of the four window edges until the pointer changes as shown
below:

118 PSCAD User’s Guide


PSCAD

or

Click and hold the left mouse button, and drag the mouse pointer to
resize in either the horizontal or vertical direction.

Errors and Warnings


A distinction can be made between error and warning messages simply
by the colour of the symbol preceding the message. The colour code is
as follows:

• OK (green)
• Warning (yellow)
• Error (red)

Warning messages are not considered detrimental to the simulation


run, and PSCAD will continue to build and run the project regardless of
any warnings. However, warnings can indicate areas of the system
that, although not technically illegal, will still affect the simulation
results (a mistakenly disconnected node, for instance). It is therefore
important to study the Output window every time the project is built
and run.

If an error is reported, the simulation build or run will be halted


immediately and an audible beep should sound. The user must then
study any error messages reported and attempt to determine the
problem source. See ‘Locating the Problem Source’ below for more
details.

Build
The Build section provides mainly component based and PSCAD error
and warning messages related to the compilation and building of
Fortran, data and map files for the project. PSCAD has the capability
of detecting a number of different types of system inconsistencies
related to this.

Any warning or error messages defined in the Checks segment of any


component definition will be displayed in Build. See Chapter 8 for
more on this.

PSCAD User’s Guide 119


Chapter 3: The PSCAD Environment

Runtime
The Runtime section provides error and warning messages related to the
simulation run – that is, messages from EMTDC. Runtime messages are
usually more serious in nature and can involve numerical instabilities and
other problems of this nature.

It is important to study the messages thoroughly. In some cases, PSCAD


will direct you towards the subsystem and node number in the electrical
system where the problem is occurring. The Find feature in PSCAD can
help point you toward the problem area – see Chapter 10 for more on
this feature.

Locating the Problem Source


The Output window provides an easy method of locating the source of
any displayed message: Either right-click the message itself and select
Point to Message Source, or simply double-click the message. PSCAD
will then automatically open the source page in Circuit view and point
directly at the problem with message box:

Search
If a message indicates that the problem is arising at a particular
subsystem and node, then you can utilize the Find feature in PSCAD to
search for this exact location. Simply Invoke the Find dialog and in the
Search input field, select Node Number. Enter the Subsystem # and
See Chapter 10 for more on Node # indicated in the Output Window and select the Find button.
using the Find feature in
PSCAD. The feedback from this search will be displayed in the Search section of
the Output window. Simply double-click the search feedback messages
and PSCAD will automatically open the source page in Circuit view and
point directly at the problem (with the same arrow as described above).

THE DESIGN EDITOR


The Design Editor window is probably the most important aspect of the
PSCAD environment, and where most if not all project design work is
performed. The Design Editor is used mostly for the graphical

120 PSCAD User’s Guide


PSCAD

construction of circuits (Circuit view), and also includes an embedded


component definition design editor.

The Design Editor window is invoked (in Circuit view) by either a left
double click on a loaded project title in the Workspace, or by right
clicking on the title and selecting Open.

Viewing Windows
The Design Editor is divided into eight sub-windows. Each of the sub-
windows can be accessed by simply clicking on a particular tab on the
tab bar at the bottom of the Design Editor. The tab bar is shown below
for reference:

As you can see, some the tabs are initially disabled (greyed out). This
depends on what you are trying to view, as well as whether or not the
project has been compiled.

The Graphic, Parameters and Script tabs are used exclusively for
component design, and will not be enabled unless editing a component
definition. The Graphic window will also be enabled while viewing a
module page. You can edit a component definition by a Ctrl + left
double click on the component, or right clicking on the component and
selecting Edit Definition…

Circuit
The Circuit window is always the default view when a project is first
opened. This is where the majority of design work is done while
working with PSCAD, and is where all control and electrical circuits are
constructed.

While the Circuit window is open, the Control Palette and Electrical
Palette toolbars are enabled.

Graphic
This Graphic window is used for editing the graphics of a component
definition or module. For more on this section, see Chapter 8.

Parameters
This Parameters window is used for editing the parameters of a
component definition. For more on this section, see Chapter 8.

PSCAD User’s Guide 121


Chapter 3: The PSCAD Environment

Script
This Script window is used for editing component definition code. For
more on this section, see Chapter 8.

Fortran
The Fortran window is a simple text viewer that allows easy access to
the EMTDC Fortran code corresponding to the module currently being
viewed in the Circuit window. For example, if you are viewing the main
page of a project in Circuit view, the Fortran window (click the Fortran
tab) will show the EMTDC Fortran code corresponding to the main
page.

Data
The Data window is a simple text viewer that allows easy access to the
EMTDC input data for any existing electric network, corresponding to
the module being viewed in the Circuit window. For example, if you
The Fortran, Data, Signals
are viewing the main page of a project in Circuit view, the Data
and Nodes windows will window (click the Data tab) will show the EMTDC input data for the
only be enabled following
compilation of the project or
main page.
corresponding module.
For details on how to read this data file, see the EMTDC User’s Guide.

Signals
The Signals window is a simple text viewer that lists information on all
data signals available for output, corresponding to the module being
viewed in the Circuit window. Click the Signals tab to view this
window.

Nodes
The Nodes window is a simple text viewer that lists information on all
electrical nodes, corresponding to the module being viewed in the
Circuit window. Click the Nodes tab to view this window.

OTHER IMPORTANT FEATURES


If you have worked through the previous tutorial section entitled ‘My
First Simulation,’ then you should have a basic understanding of the
PSCAD Environment.

The following sections describe some minor aspects and features of the
environment in greater detail.

Menus
There are a couple of different types of menus available in PSCAD.

122 PSCAD User’s Guide


PSCAD

The following sections provide a description of each.

Main Menu Bar


The Main Menu bar contains an assortment of the most common
PSCAD commands. It is located near the top of the PSCAD
Environment, appearing as shown below:
The Main Menu bar contains
only some of the standard
PSCAD functions. There are
many others available using
right-click pop-up menus.

This bar may appear differently depending on what section of the


PSCAD Environment you are currently in.

To select a menu item, move the mouse pointer onto that item (the
item becomes raised) and then click the left mouse button. The
following menu shows how to create a new project using the File
menu.

You will notice that some menu items, New in the File menu for
instance, contain an arrow symbol pointing to the right. This indicates
that there are sub-menu listings related to that menu item, as shown
above.

You may also notice that some menu items are followed by a triple-
period, for instance the Load Project... menu item in the File menu.
This signifies that a dialog box will open if this command is invoked.

PSCAD User’s Guide 123


Chapter 3: The PSCAD Environment

Right-Click Pop-Up Menus


PSCAD V4 contains an extensive set of right-click pop-up menus for
easy support of location specific commands and tasks. Depending on
the location of your mouse pointer, you can invoke pop-up menus
almost anywhere in the environment by simply pressing your right
mouse button. The menus that pop-up will always contain commands,
which are specific to the area you are currently working in.

Library Pop-Up Menus


Library pop-up menus are designed to provide an organized method of
accessing desired component instances located in the Master Library, or
any other user-defined library project. This menu system is invoked by
pressing Ctrl + right mouse button, while the mouse pointer is over a
blank section of any project page in Circuit view.

It is a good idea to always


provide an adequate
description in user-defined
components, so as to avoid
confusion while using these
menus. If a description is
not provided, the Library
Pop-Up Menus will display
the actual filename of the
component.

Library pop-up menus display whatever is entered into the description


field of the component definition. In the above image, the user has
two library projects currently loaded in the Workspace: The Master
Library and another library with ‘My Library’ entered into the project
description field. The mouse pointer is pointing towards the ‘Current
Source’ component in the ‘Sources’ module, in the Master Library. A
left-click at this point will add the current source component to
whichever project page is open in Circuit view.

In general, library pop-up menus construct a system of menus according


to the hierarchal structure of any loaded library projects. As a default,

124 PSCAD User’s Guide


PSCAD

the Master Library will always be displayed first, and any user-defined
library projects will then be placed in the order as they appear in the
Workspace. If components are located within a module in a specific
library project, the library pop-up menus will automatically nest these
components into another sub-menu. This sub-menu will be named
according to the contents of the corresponding module description field.

Here are some key points to remember when using library pop-up
menus:

• Component instances, located on the main page of the


Master Library, will not be included in the pop-up menu.
However, such instances will be included for user-defined
library projects.
• Duplicate component instances in a module will be
ignored.
• Duplicate component instances in multiple modules will
be added to the menu multiple times.
• Modifications to a library project will not appear in the
library pop-up menu until the library project has been
reloaded.

Toolbars
Toolbars are useful in any program to provide a quick and easy method
to access menu functions. PSCAD V4 now includes multiple toolbars,
which contain the most commonly used menu tasks.

The new PSCAD drawing related toolbars allow you to add the most
common drawing objects and components by simply using the left
mouse button: A single click on the toolbar to select an object, and a
single click to add the object to the drawing canvas.

Main Toolbar
The Main Toolbar resides near the top of the PSCAD environment. This
bar primarily contains tasks found in the Main Menu bar, but also
includes others as well. The individual toolbar buttons are listed below
with a short description:

PSCAD User’s Guide 125


Chapter 3: The PSCAD Environment

Button Description

Creates a new case project (*.psc file)

Loads a case project (*.psc file)

Saves changes to the active project


(*.psc file)

Print current page

Cuts the current selection to the


Windows clipboard
Copies the current selection to the
Windows clipboard

Pastes from the Windows clipboard

Undo

Redo

Up one Module level

Zoom in one step

Zoom out one step

Zoom control list box

Pan (dynamic scroll)

Invoke Wire Mode

Create a default Module

Create new component

Launches Find feature

126 PSCAD User’s Guide


PSCAD

Status Bar
The Status bar is located at the very bottom of the PSCAD Environment,
and is not actually a toolbar, but used for the purpose of display only
(does not contain any command buttons). Most of time, the Status bar
is used to monitor the status of a simulation build, link and run, and will
display the percentage complete and the simulation time during a run.

There are however, some graphical indicators that may appear


depending on what process is currently running. These symbols are
listed below:

Sym b o l D escrip tio n

D isplays the m ouse pointer X and Y coordinates


w hile in either the C ircuit, or the G raphic w indow s
of the D esign Editor (w hichever is currently
displayed).

Indicates project is being com piled and built.

M oving gears: Indicates that the sim ulation is


running (Runtim e).

Rotation Bar
The individual Rotation bar buttons are listed below with a short
description:

Button Description

Rotate selection counter-clockwise

Rotate selection clockwise

Mirror selection

Flip selection

PSCAD User’s Guide 127


Chapter 3: The PSCAD Environment

Settings Bar
The individual Settings bar buttons are listed below with a short
description:

Button Description

Compile (build) all modules (active project only)

Make project (active project only)

Run simulation (active project only)

Stop simulation (active project only)

Pause simulation (active project only)

Advances run by one time step (while pause is


invoked)

Take a snapshot

Change PSCAD Plot Step

Control settings menu button

Control settings template list

Electrical Palette
The Electrical palette contains common electrical components used
when building circuits in Circuit view. Most of these button functions
can also be found under Add New Component in the Circuit view
right-click pop-up menu. The individual toolbar buttons are listed below
with a short description:

128 PSCAD User’s Guide


PSCAD

Button Description

Add Wire

Add Resistor

Add Inductor

Add Capacitor

Add Ground

Add Node Label

Add External Node (Xnode)

Add Breakout

Add Pin

Add Current Meter

Add Voltmeter

Add Voltmeter with ground

Add a T-Line Configuration

Add a T-Line interface

Add a Cable Configuration

Add a Cable interface

Control Palette
The Control palette contains common control components used when
building circuits in Circuit view. Most of these button functions can also
be found under Add New Component in the Circuit view right-click
pop-up menu. The individual toolbar buttons are listed below with a
short description:

PSCAD User’s Guide 129


Chapter 3: The PSCAD Environment

Button Description

Add Data Tap

Add Data Merge

Add Data Label

Add Integer Constant

Add Real Constant

Add Import

Add Export

Add Output Channel

Add Slider

Add Switch

Add Dial

Add Pushbutton

Add Graph Frame

Add XY Plot

Add Control Panel

Add Annotation Box

Add Sticky Note

Add Sticky note arrow 45°

Add Sticky note arrow curved

Add Sticky Note arrow straight

130 PSCAD User’s Guide


PSCAD

Graphic Palette
The Graphic palette contains functions used only when editing
component definitions in the Graphic section of the Design Editor. The
individual toolbar buttons are listed below with a short description:

Button Description

Reload changes from last save

Return to Circuit view

Set layers

Show/Hide all layers

Add Line

Add Rectangle

Add Ellipse

Add Arc (90°)

Add Arc (180°)

Add Text Label

Add Connection Node

Default line colour

Default line weight

Default line style

Default fill style

Parameters Bar
The Parameters bar contains functions used only when editing

PSCAD User’s Guide 131


Chapter 3: The PSCAD Environment

component definitions in the Parameters section of the Design Editor.


The individual toolbar buttons are listed below with a short description:

Button Description

Reload changes from last save

Return to Circuit view

Set layers

Search for symbol names

Add new text field

Add new input field

Add new radio button choice box

Add new drop list choice box

Navigate Category pages

Add new Category

View Category properties

Duplicate current Category

Delete Category

Move Category up one level

Move Category down one level

Move Category to top

Move Category to bottom

132 PSCAD User’s Guide


PSCAD

Script Bar
The Script bar contains functions used only when editing component
definitions in the Script section of the Design Editor. The individual
toolbar buttons are listed below with a short description:

Button Description

Reload changes from last save

Return to circuit view

Search for text

Search for and replace text

Navigate segments

Add new segment

Delete segment

Keyboard Shortcuts
There are many keyboard shortcuts (or hotkeys) available in order to
make the design process more efficient. Hotkeys help to reduce the
‘amount of clicks’ required for performing a specific task.

The following tables list the available keyboard shortcuts in PSCAD V4.
See What’s New in PSCAD V4? In Chapter 1 for changes to keyboard
shortcuts since PSCAD V3.

General
Note that ‘Ctrl’ may be dropped where indicated (i.e. [Ctrl +]) if Enable
Cut/Copy/Paste without ‘Ctrl’ Key selected (see Workspace Settings in
Chapter 2).

PSCAD User’s Guide 133


Chapter 3: The PSCAD Environment

Shortcut Description

[Ctrl +] X Cut selection

[Ctrl +] C Copy selection

[Ctrl +] V Paste selection

A Select all

R Rotate selection

M Mirror selection

F Flip selection

S Set sequence

Ctrl + Z Undo

Ctrl + Y Redo

Ctrl + F Find function (search)

Ctrl + O Load project

Ctrl + S Save active project

Ctrl + U Unload selected project

Ctrl + W Invoke/Cancel Wire Mode

Esc Cancel action

+ Zoom in

- Zoom out

134 PSCAD User’s Guide


PSCAD

Ctrl + Shift +
Left Mouse Pan (dynamic scroll)
Hold
Ctrl + Left
Edit definition of selected component
Double Click
Left Double
Edit properties of selected component
Click

Backspace Navigate up one module level

F5 Refresh canvas

F1 Help

Scroll Circuit page horizontally and


vertically

Wires
To apply any of the following shortcuts, simply move your mouse pointer
over a Wire.

Shortcut Description

V Insert a Wire Vertex

I Reverse Wire Vertexes

D Decompose Wire

Plotting
To apply any of the following shortcuts, simply move your mouse pointer
over a plot area. Note that in some instances, the graph must be
selected.

PSCAD User’s Guide 135


Chapter 3: The PSCAD Environment

Shortcut Description

Insert Insert an Overlay Graph


+ Zoom in to graphs
- Zoom out of graphs
P Zoom previous
N Zoom next
X Zoom x-axis extents
E Zoom x-axis limits
Y Zoom y-axis extents
U Zoom y-axis limits
R Reset all extents
B Reset all limits
Ctrl + Left
Zoom horizontal aperture
Mouse Hold
Shift + Left
Zoom vertical aperture
Mouse Hold
Left Mouse Zoom to box (simultaneous horizontal and
Hold vertical)
G Toggle grid lines
I Toggle tick marks
K Toggle curve Glyphs
M Show Markers
X Set X marker
O Set O marker
L Toggle marker lock-step
F Toggle frequency/delta view
Q Show x-intercept

136 PSCAD User’s Guide


PSCAD

W S h o w y - i n t e r c e p t

C S ho w cr o s s- h a ir s (f o llow s c ur ve tra ce s )

Space Bar S w it c h c ur ve s w h ile in c r o ss- ha ir mo d e

Graph frame dynamic aperture adjustment

Window Settings
PSCAD V3 users will notice a difference in the window settings for V4.
That is, all environment windows are now docked (i.e., embedded)
rather than floating by default.

Docked windows, although embedded, may still be manipulated in the


standard ways. They may be moved, stretched, maximized, minimized
and turned off quite easily (see Chapter 4 for more details).

Tab Navigation
Another ‘dimension’ was added to the navigational abilities of PSCAD
in V4: Tabs. Tabs allow you to view several aspects of a project, by
simply clicking tab buttons (usually located at the bottom of the
window). For example, once a project is compiled, you can quickly
look at project related files (i.e., Circuit, Fortran, Data, etc.) with a
single click.

Tab navigation is also available in the Output window, the Design


Editor, as well as other areas.

PSCAD TEMPORARY DIRECTORIES


When a case project is run for the first time, there are several files that
are created by the Fortran compiler and PSCAD itself. As these files
are specific to a certain project, it would be prudent to keep these files
together and organized.

PSCAD accomplishes this by creating a temporary directory when the

PSCAD User’s Guide 137


Chapter 3: The PSCAD Environment

project is compiled and run, and placing it in the same directory location
as the project file (*.psc) itself. The directory is named by simply
appending a ‘.emt’ extension to the project filename. For example, if a
case project has a filename ‘[Link],’ a temporary directory called
‘[Link]’ will be created when the project is compiled and run.

The temporary directory will contain all files created by both the
compiler and PSCAD. That is, in addition to compiler related files such
as make (.mak) and the case executable (.exe) files, transmission line
related files, EMTDC output files (.out), snapshot files (.snp), and
multirun related files are also placed here.

Most of these files can be viewed from their respective viewers within
PSCAD. However, you may want access output files for post-processing
and it is important to know where to find them!

PSCAD ON-LINE HELP SYSTEM


For the release of PSCAD V4, an entirely new and improved on-line help
system has been included. Based on the content of the previous PSCAD
V3 on-line help, the new system has been brought up-to-date and
includes new information previously unavailable.

The new on-line help is no longer a collection of HTML documents, but


a single compiled file in Microsoft HTML Compiled Help format. This
single file includes it’s own browser, and as such, a stand-alone web
browser is no longer required for viewing. In addition, features
previously unavailable, such as a full-text search engine and
comprehensive index are now at the users disposal.

In addition to the complete PSCAD V4 manual set, the on-line help file
includes component specific documentation (not included in the
manuals).

Accessing Help
The Table of Contents (TOC) and Index can be accessed directly through
the Help section in the Main Menu Bar, as shown below:

138 PSCAD User’s Guide


PSCAD

You may also bring up the on-help by simply pressing the F1 key.

Master Library component specific help can be accessed by one of the


following methods:

• Select the component and then press F1.


• Right-click on the component and select Help.
• Edit the component parameters and click the Help
button.
Look and Feel
When the help system is invoked (by pressing the F1 key), a window
similar to that shown below should appear.

PSCAD User’s Guide 139


Chapter 3: The PSCAD Environment

There are three main sections of the help system. Across the top is the
Help Toolbar, and below this are the Navigation Pane on the left, and
the Main Viewing Window on the right.

The Help Toolbar


The Help toolbar contains the most commonly used functions. These are
summarized below:

B u tto n D e s c r ip t io n

H id e s n a v ig a t io n p a n e

M o v e s b a c k w a r d in t h e v ie w e d t o p ic lis t

M o v e s f o r w a r d in t h e v ie w e d t o p ic lis t

P r in t s c u r r e n t ly v ie w e d t o p ic

P r o v id e s s o m e o p t io n s t o a llo w u s e r t o c u s t o m iz e t h e
o n lin e h e lp v ie w e r

The Navigation Pane


The Navigation Pane is separated into three sections: The Table of
Contents (TOC), the Index and the Search engine. To access any
section, click the corresponding tab at the top of the pane.

Contents
The Contents tab contains the help system Table of Contents. The TOC
is organized using a standard tree-type structure. To expand or collapse
any branch of the tree, left-click on the corresponding [+] or [-] icons,
directly to the left of each branch, respectively.

140 PSCAD User’s Guide


PSCAD

There are two icons associated with the TOC: Books and Topics. A Book
simply contains a selection of Topics:

• Book
• Topic

Index
The index contains a large list of keywords, listed in alphabetical order,
that have been associated with various topics within the help system.
You have the choice of either scrolling through this list directly, or you
may type in a word into the input field near the top of the index pane,
in order to directly look up a word.

In the figure below, for example, a user is looking up ‘air core


reactance.’ Entering ‘air’ will bring the list window to the nearest
matching word.

PSCAD User’s Guide 141


Chapter 3: The PSCAD Environment

Search
The Search section allows you to enter in a single word or a text string,
and then list the topics that contain the word or string. Simply enter the
The Help System search text string and click the List Topics button. Any topics containing the
engine will search all text in string will be displayed in the output field as shown below.
each topic. Text that exists
within embedded images
will not be considered.

NOTE: The Help System search engine will search all text in each topic.
Text that exists within embedded images will not be considered.

To bring up a listed topic into the main viewer, simply left double-click,
or select it and click the Display button.

142 PSCAD User’s Guide


PSCAD

Favourites
The Favourites section allows users to bookmark their favourite help
pages. To add a favourite topic to the favourites list, simply left click
the Add button. To remove a topic from Favourites, select it and left
click the Remove button. To display a topic from the favourites list,
select it and left click the Display button.

The Main Viewer


The contents of the main viewing window are interactive in the same
way as in a normal HTML web page. Depending on the page viewed,
there may be hyperlinks and other types of functionality, normally seen
while navigating the web. Usually, text with associated hyperlinks and
other functions are shown in blue color and may or may not be
underlined.

TUTORIAL PROJECTS
The PSCAD software package is installed complete with a directory of
tutorial projects, which contains a variety of simple cases to illustrate
various features of PSCAD. This directory is located within the PSCAD
installation directory under …examples\tutorial.

The tutorial projects described in this section are mainly meant to


illustrate the use of PSCAD and hence, they are simple cases from an

PSCAD User’s Guide 143


Chapter 3: The PSCAD Environment

electrical engineering point of view. If you are a first time user, go


through all the tutorial cases in the order they are listed below.

Once you are familiar with these projects, have a look at the more
detailed projects contained within the main examples directory. These
include a variety of practical examples ranging in topics from machines
to FACTS devices.

Voltage Divider
vdiv_1.psc A simple voltage divider circuit with a resistor
and a resistive source. Demonstrates how to
assemble a circuit, monitor voltage and current,
and run the simulation.

Fast Fourier Analysis


[Link] Shows the use of Fast Fourier analysis
component to perform online fft on signals.

Simple AC System with a Transmission Line


[Link] A simple AC system with transmission lines.
Introduces transformers, transmission lines, and
the concept of subsystems in PSCAD.

Use of Control Arrays


[Link] Demonstrates the use of control arrays and how
to export electrical nodes to other pages so that
a circuit can be modeled on multiple pages -
even if you do not have transmission lines.

Use of Slider, Switch, Button, and Dial


[Link] Shows the use of dynamic input devices: Slider,
Switch, Push Button and the Dial.

Interpolation
[Link] A simple case illustrating the use of
interpolation.

144 PSCAD User’s Guide


PSCAD

Generating a Legend and using PSCAD Macros


[Link] Shows how to generate a legend. Also
illustrates the use of PSCAD macros in a legend.

Chatter Elimination
[Link] Defines chatter and gives examples on chatter
elimination techniques.

Multiple Run
[Link] A simple example to demonstrate the use of
multiple run features to find the maximum
overvoltage due to a fault in a 3-phase power
system. The point on wave and type of fault is
varied to determine the worst case overvoltage.

Rotating Machines
machines This directory has many examples to illustrate
directory the use of synchronous and induction machines
and its accessories, such as governors, exciters,
stabilizers, and multi-mass models.

PSCAD User’s Guide 145


Chapter 3: The PSCAD Environment

146 PSCAD User’s Guide


PSCAD

Chapter 4:

Basic Operations and Features


This chapter provides a resource for basic operations (or ‘clickology’) and
features in PSCAD. Whether you are a new user, or a seasoned PSCAD
veteran, the following topics can be very helpful in getting you familiar
with PSCAD V4.

This chapter includes a tutorial entitled ‘Creating a New Case,’ which is


designed to jump start the learning process and to get you using
PSCAD. If you have not done so already, try the tutorial section in
Chapter 3 entitled ‘My First Simulation’ as well. This chapter is divided
into three main sections: Projects, Components and Drawing.

PROJECTS
The following sections describe some basic operations and features
relating to the use of library and case projects.

Creating a New Project


Click the left mouse button on the menu item File in the Main Menu
bar - a drop down menu should appear. With your mouse pointer, select
New. A secondary menu should open listing a choice of either a
Library project or a Case project.

PSCAD User’s Guide 147


Chapter 4: Basic Operations and Features

Select the desired project type. A new project entitled ‘noname’ should
then appear in the Workspace window, indicating that a new project
was created.

You can also create a new case project by simply pressing the New
Project button in the Main Toolbar, or by pressing Ctrl + N on your
New Case Project keyboard.

Loading a Project
Click the left mouse button on the menu item File in the Main Menu
bar - a drop down menu should appear. With your mouse pointer, select
Load Project….

A dialog window should open with a default Files of type as PSCAD


Files (*.psc, *.psl) for PSCAD case project and library project,
respectively. Navigate to the desired project and select it so that its
name appears in the File name field, as shown below.

148 PSCAD User’s Guide


PSCAD

Click the Open button to open the project. The project name should
then appear in the Workspace window, indicating that the project was
loaded.

You can also bring up the Load Project dialog by simply pressing the
Load Project button in the Main Toolbar, or by pressing Ctrl + O on
your keyboard. Load Project Button

Opening the Project Main Page


In the Workspace window, right click on the Project title and select
Open from the right-click pop-up menu. You should then see the
project main page in the Circuit window of the Design Editor.

PSCAD User’s Guide 149


Chapter 4: Basic Operations and Features

Setting the Active Project


When there is more than one case project loaded simultaneously in the
Workspace window, PSCAD needs to know which project to run when a
simulation is requested. This is accomplished by setting the ‘Active
Project.’

In the Workspace window, right-click on the title of an inactive project


and select Set as Active.

Saving Project Changes


To save the Active Project, click the left mouse button on the menu item
File in the Main Menu bar - a drop down menu should appear. With
your mouse pointer, select Save Active Project….

150 PSCAD User’s Guide


PSCAD

You can also save the Active Project by pressing the Save Active
Project button in the Main Toolbar, or by pressing Ctrl + S on your
keyboard. Save Active Project
Button
To save a selected project (either active or inactive), right click on the
project title in the Workspace window and select Save from the pop-up
menu.

Save Project As…


To save the Active Project as another file, click the left mouse button on
the menu item File in the Main Menu bar - a drop down menu should
appear. With your mouse pointer, select Save Project As….

PSCAD User’s Guide 151


Chapter 4: Basic Operations and Features

To save a selected project (either active or inactive) as another file, right


click on the Project title in the Workspace window and select Save As…
from the pop-up menu.

In either case, a dialog window should open with a default Save as


type as PSCAD V4 Files (*.psc, *.psl) for PSCAD V4 case project and
library project, respectively. Change the file name of the project in the
File name field, as shown below.

Click the Save button to save the project under a different file name.
The project name should then change in the Workspace window,
indicating that the project was renamed.

152 PSCAD User’s Guide


PSCAD

Saving as PSCAD V3 Format


Follow the same procedure outlined in the ‘Save Project As…’ section
above. When the Save As dialog window appears, go to the Save as
type drop list and select PSCAD V3 File (*.psc, *.psl).

Note that some components


available in the PSCAD V4
Master Library are not
available in PSCAD V3 and
will be lost upon conversion.
Also single-line diagrams are
not supported in V3. See
Chapter 13 for more details.

Click the Save button to save the project in PSCAD V3 format.

Unloading a Project
In the Workspace window, select the project that is to be unloaded.
Click the left mouse button on the menu item File in the Main Menu
bar - a drop down menu should appear. With your mouse pointer, select
Unload Project.

PSCAD User’s Guide 153


Chapter 4: Basic Operations and Features

You can also unload a project by either right clicking on the project title
in the Workspace window and selecting Unload from the pop-up menu,
or by selecting the project in the Workspace window and pressing Ctrl +
U on your keyboard.

Editing Project Settings


Right-click on the desired project in the Workspace window and select
Project Settings….

154 PSCAD User’s Guide


PSCAD

Also, you can right-click over a blank area of any project page in Circuit
view and select Project Settings… from the pop-up menu.

In either case, a dialog window entitled ‘Project Settings’ should open,


as shown below:

PSCAD User’s Guide 155


Chapter 4: Basic Operations and Features

The Project Settings dialog allows for many project-specific parameter


settings to be adjusted.

Changing Duration of Run


Right-click on the particular project in the Workspace window and
select Project Settings... to bring up the Project Settings dialog
window. Click the Runtime tab near the top of the dialog window
and, in the Time Settings area, enter a new Duration of Run time in
seconds.

156 PSCAD User’s Guide


PSCAD

Changing the Solution Time Step


Right-click on the particular project in the Workspace window and select
Project Settings... to bring up the Project Settings dialog window.
Click the Runtime tab near the top of the dialog window and, in the
Time Settings area, enter a new Solution Time Step time in
microseconds (ms).

Changing the Channel Plot Step


Right-click on the particular project in the Workspace window and select
Project Settings... to bring up the Project Settings dialog window.
Click the Runtime tab near the top of the dialog window and, in the
Time Settings area, enter a new Channel Plot Step time in
microseconds (ms).

Cleaning the Temporary Directory


To delete all temporary Project files (i.e. compilation, make, data, etc.
files), right-click on the Project title in the Workspace window, and
select Clean Temporary Directory (.emt) from the right-click pop-up
menu. See PSCAD Temporary Directories for more details.

Opening and Viewing a Project


Right-click on the desired project in the Workspace window and select
Open. You can also open a project for viewing, with a left double-click
on the project title in the Workspace window.

Once opened, the main page of the project should appear in the Circuit

PSCAD User’s Guide 157


Chapter 4: Basic Operations and Features

window of the Design Editor.

Navigating Through an Open Project


Once a project has been opened in Circuit view, there are many
navigational features available to help you efficiently navigate about the
project.

Scroll Bars
Standard vertical and horizontal scroll bars are available in all Design
Editor windows. These are located at the right-most and bottom-most
edges of the open window respectively.

Arrow Keys
You can use the arrow buttons on your keyboard to scroll both
horizontally and vertically while in Circuit view.

Panning (Dynamic Scroll) Mode


The panning or dynamic scroll feature allows you to scroll through the
Circuit or Graphic views in a fluid motion. You can invoke panning
mode by one of the following methods:

Pan Button • On a blank portion of the page, press the Ctrl and Shift
keys at the same time, then click and hold the left mouse
button (Ctrl + Shift + left mouse hold). Moving the
mouse will then allow panning though the page.
Panning Mode
• Press the Pan button in the Main Toolbar to invoke
Indicator panning mode. To indicate that you are in panning mode,
the mouse pointer will change into a hand shape, as
shown to the right.

Moving In and Out of Modules


To move into or open a module in Circuit view, either left double-click
the module, or right-click on the module and select Edit Definition….

158 PSCAD User’s Guide


PSCAD

To move out of the current module (i.e. move back one level), press
either the Backspace key on your keyboard, press the Up one module
button on the Main Toolbar, or right-click on a blank part of the module
page and select Up one module.

PSCAD User’s Guide 159


Chapter 4: Basic Operations and Features

Tabs
The new tab features in PSCAD V4 add an extra dimension to
navigation. That is, the tabs allow you to jump from one viewing area
to another by simply selecting a specific tab. There is a tab bar
included at the bottom of the Design Editor window (as shown below),
as well as on the Output window and others.

Zooming
Zoom features are available when working in either the Circuit or the
Graphic sections of the Design Editor. There are a few different
methods for zooming available:

• From the main menu bar, select View | Zoom. You then
Zoom In and Zoom have a choice to select either In, Out or a specified zoom
Out Buttons percentage.
• From the main toolbar, select either the Zoom In or Zoom
Out buttons, or select a percentage zoom directly from the
Zoom In/Out drop down list.
Zoom In/Out Drop
List • Press the ‘+’ or ‘–‘ keys on your keyboard.
• Right-click on a blank part of the page and select Zoom In
or Zoom Out from the pop-up menu.

160 PSCAD User’s Guide


PSCAD

Refresh
You can refresh the page view in either the Circuit or Graphic windows
by one of the following methods:

• From the Main Menu bar, select View | Refresh.


• Press the F5 key on your keyboard.
• Right-click on a blank part of the page and select Refresh.

Editing Module Settings


Right-click on a blank part of the Circuit page and select Module
Settings… These settings are module specific and they will vary for
each individual module in the project.

PSCAD User’s Guide 161


Chapter 4: Basic Operations and Features

A dialog window entitled ‘Module Settings’ should open, as shown


below:

162 PSCAD User’s Guide


PSCAD

The Module Settings dialog inputs are described in the following


sections.

Display Options
These options are related to the page display.
• Show Connection Grid: Select this option to view the major
grid points on the module page.
• Show Signal Locations: When this option is enabled, PSCAD
will use icons placed on data signal wires and connections so
as to allow for easy, graphical differentiation between feed-
forward and feed back signals. For more on this option, see
Component Ordering in Chapter 10.

Fortran Code Sequencing


These options are related to the way in which System Dynamics code is
ordered.
• Assign Execution Sequence Numbers Automatically: Select
this option to ensure that a PSCAD smart algorithm will
automatically order your control components. This algorithm
systematically scans all control systems and sub-modules with
the Module and determines the sequence that each See Chapter 10 for more
component should appear in the in EMTDC System Dynamics. details on Manual
Component Ordering and
This option is by default enabled, and should remain that way
Fortran code sequencing.
unless the user wants to order these components manually.
• Show Sequence Numbers on Circuit Schematic: When this
option is enabled, PSCAD will label each Component and
Module in the Project with an auto-generated sequence
number. This sequence number represents the sequential
placement of the Component or Module code in the Project
Fortran files.

Running a Simulation
Before running a simulation, ensure that the desired project is the active
project in the Workspace window.

Use either of the following methods:

• Press the Run button in the Main Toolbar. Run Button


• In the Main Menu, select Build | Run.

PSCAD User’s Guide 163


Chapter 4: Basic Operations and Features

Viewing Errors and Warnings


If a problem is detected when a simulation is run, all error and warning
messages will appear in the Output window.

The Output window is divided into three main areas: Build, Runtime
and Search. Compilation messages will appear under Build, while
EMTDC runtime messages will appear in Runtime. The Search area is
used to view results from the Find Feature.
See Chapter 10 for more
details on searching your Finding the Message Source
project using the Find
Feature. If an error or warning message is received, PSCAD can automatically
point to the source of the problem. In the Output window, navigate to
the error or warning message, hold the mouse pointer over the message
itself and either left double-click or right-click and select Point to
Message Source. PSCAD will point to the problem source in the
Circuit window of the Design Editor.

164 PSCAD User’s Guide


PSCAD

In the example image below, it can be seen that the voltmeter ‘Vmid’
has been shifted and is not measuring a specific node voltage.

Taking a Snapshot
Taking a snapshot of a simulation run is presently the only way to start
PSCAD from an initialized condition. This can be accomplished by one
of several methods.

Manual
You can manually take a snapshot by either pressing the Snapshot
button on the Main Toolbar, or selecting Build | Snapshot from the
Main Menu bar, while the project is running. Snapshot Button

Pre-Defined
Pre-defined snapshots are set before the run is started. There are a
couple of different pre-defined snapshot types available.

Right-click on the desired Project and select Project Settings… in the


Workspace window. In the Runtime section of the Project Settings’
dialog, choose the snapshot type from the Timed Snapshot(s) drop list. For more on pre-defined
snapshot settings, see
Chapter 4.

PSCAD User’s Guide 165


Chapter 4: Basic Operations and Features

Enter a name for the snapshot file in the Snapshot File field, and the
exact time at which to take the snapshot during the next run in the
Time field.

Click the OK button to exit the Project Settings’ dialog and save
changes. Run the project to completion.

Starting from a Snapshot


Right-click on the desired project and select Project Settings… in the
Make sure that the run
duration is greater than the
Workspace window. In the Runtime section of the Project Settings’
snapshot time, or no dialog, choose From snapshot file from the Startup method drop list.
snapshot file will be created! Enter the name for the snapshot file in the Input File field or use the
Browse… button to select the file.

Click the OK button to exit the Project Settings’ dialog and save
changes. Run the project – it should start initializing from the snapshot
time.

Saving Output to File


Right-click on the desired project and select Project Settings… in the
Workspace window. In the Runtime section of the Project Settings’
dialog, choose Yes from the Save channels to disk? drop list. Enter
the name for the output file in the Output File field.

See the section entitled


‘EMTDC Output Files’ for
more details on this topic. Click the OK button to exit the Project Settings’ dialog and save
changes. Run the case to create the output file.

166 PSCAD User’s Guide


PSCAD

Editing the Page Setup


Right-click on a blank part of the page and select Page Setup… These
settings are Module specific. That is, they can vary for each individual
Module in the project.

A dialog window entitled ‘Page Setup’ should open, as shown below:

PSCAD User’s Guide 167


Chapter 4: Basic Operations and Features

The Page Setup dialog inputs are described below:

• Paper Size: Select a standard paper size for this Module.


• Orientation: Select the Module page orientation.

The Oversize (34x44) paper Printing a Module Page


size is included simply for
compatibility with the
Bring up the desired module in Circuit view. Right-click on a blank
PSCAD V2 large canvas size. portion of the page and select Print Page. A print dialog window
should appear – select your desired printer properties and click OK.

To preview before printing, bring up the desired module in Circuit view.


Right-click on a blank portion of the page and select Print Preview
Print Button Page, or simply press the Print button in the main toolbar.

Printing Selected Objects


Bring up the desired area in Circuit view. Select the objects to be
printed, right-click and select Print Selection. A print dialog window
should appear – select your desired printer properties and click OK.

168 PSCAD User’s Guide


PSCAD

More than one object must


be selected to print a
selection.

To preview the selection before printing, select the objects to be printed,


right-click and select Print Preview Selection.

Copy Group as Meta-File


Instead of printing objects as described above, you can also copy a
selection to the clipboard in metafile format. Bring up the desired area
in Circuit view. Select the objects to be copied, right-click and select
Copy Group as Meta-File.

Then, simply paste the copied selection into a report program of your
choice.

PSCAD User’s Guide 169


Chapter 4: Basic Operations and Features

COMPONENTS AND MODULES


The following sections deal with the manipulation of graphical objects
(i.e., components, panels, modules, etc.), as well as basic drawing
techniques in the Circuit window of the Design Editor.

Selecting and Grouping Objects


Select an individual object with a simple left-click on the object itself.
Select a group of objects by one of the following methods:

• Press and hold the Ctrl key and then select (left-click) all
objects to be grouped into one selection.
• Press and hold the left mouse button and then drag the
mouse pointer so that a box outline appears. Encompass
all desired objects to be selected and then release the left
mouse button.

To ungroup any objects, hold the Ctrl key and then select (left-click) all
objects to be ungrouped.

Adding Components to a Project


There are a variety of ways to insert components into a Project page.
Before proceeding, ensure that your project has been opened and you
are viewing the desired Project page in the Circuit window.
• Manual Copy/Paste: Open the Master Library and navigate
to the area containing the desired component. Right-click on
the component and select Copy, or select the component and
press Ctrl + C. Open the project page where you wish to add
the component, right-click over a blank area and select Paste
(or press Ctrl + V).

170 PSCAD User’s Guide


PSCAD

• Right-Click Menu: Right-click over a blank area of the page


and select Add Component. A sub-menu will appear
containing the most commonly used components from the
Master Library. Select a component and it will be
automatically added.
• Library Pop-Up Menu: Press Ctrl + right mouse button
over a blank area of the page to invoke the library pop-up
The Control and Electrical
menu system. Select a component and it will be automatically Palettes are usually located
added. to the right of the Design
Editor window. If you
• Control and Electrical Palettes: Left-click on any of the cannot see them, select
palette buttons and then drag your mouse pointer over the View | Control Palette
and/or View | Electrical
Circuit window - you should see the object attached to your Palette from the Main
pointer. Continue to move the object to where you want it Menu bar.
placed, and then left-click again.

Adding Multiple Instances of a Component


Multiple Instances of the same component can be added when using
the Control and Electrical Palettes:
1. Hold down the Ctrl key.
2. Left-click on the desired component from either the Control
Palette or the Electrical Palette (continue holding Ctrl).
3. Move the mouse pointer over the Circuit canvas and left-click
again to paste the first Instance of the component (continue
holding Ctrl).
4. Move the mouse pointer to a new position and left-click again
to paste a second Instance of the component.
You may continue this process and add as many Instances as desired,
provided the Ctrl key remains depressed. To escape from this function,
simply release the Ctrl key at any time.
Moving or Dragging an Object
To move an object, place the mouse pointer over the object icon. Press
and hold the left mouse button. Now drag the mouse to move the
component. When you move a component, it will always snap to the
nearest drawing grid, even if the grid dots are not visible.

Cut/Copy/Paste
Objects can be cut, copied and pasted as many times as desired within
the Circuit window: Right-click on the object and select either Cut or
Copy (or select the object and press Ctrl + X or Ctrl + C respectively).

PSCAD User’s Guide 171


Chapter 4: Basic Operations and Features

Once cut or copied, you can paste the object by right clicking over a
blank area of the Project page and selecting Paste (or press Ctrl + V).

Rotate/Mirror/Flip
Once added, objects can be rotated, flipped or mirrored:

• Hotkeys: Select the object and press the R, F or M to


rotate, flip or mirror respectively.
The Rotation Bar is usually • Right-Click Menu: Right-click over the object and select
located to the right of the
Design Editor window. If Rotate or Flip. Select the desired option from the
you cannot see it, select resulting sub-menu.
View | Rotation Bar from the
main menu bar.
• Rotation Bar: Select the object or group of objects and
then press one of the four Rotation Bar buttons.

Deleting Objects
Select the object and press the Delete key. Note that in PSCAD,
deleting performs the same function as ‘Cut.’

Undo and Redo


To undo or redo any object manipulations, such as moves, cuts, pastes,
deletions, etc., select the Undo or Redo button in the Main Toolbar, or
Undo and Redo
press Ctrl + Z or Ctrl + Y. The undo and redo features will store most
Buttons
manipulations and changes, however some limitations will apply (i.e.
plots for example).
Connecting Components Together
A connection is made whenever wire components make contact with
the end of another wire, or when the input/output connection nodes of
a component or module are overlaid on top of each other. For example,
two resistors can be connected directly, or with a wire between them as
follows:

172 PSCAD User’s Guide


PSCAD

It is important to note the difference between an electrical and a control


type component when connecting components together. Electrical
connection nodes cannot be connected to control (or data) connection
nodes and vice versa. For example, the following is an illegal
connection:

Wires are universal in that they assume the signal type of the nodes they
are connected to. If a wire is connected to an electrical node, it will
become an electrical wire, for example.

PSCAD User’s Guide 173


Chapter 4: Basic Operations and Features

Transferring Data Into and Out of Modules


At some point in building up a project, you may want to incorporate a
common group of components into a Module (sometimes referred to as
a ‘sub-page’). Modules can be useful in that they simplify the
appearance of the overall circuit design, along with providing a
‘container’ in which to keep all components involved in a specific task.

Transferring signals to or from the parent page (i.e. into or out of a


Module) is handled a bit differently for control and electrical signals.

Control Signals
When a project is compiled, PSCAD creates a variety of files describing
the case so that EMTDC can understand it and run the simulation. One
or more of these files are structured Fortran files (*.f), which describe
See System Dynamics in the dynamics (i.e. control signals) portion of the case. One Fortran file
Chapter 2 of the EMTDC will be created for each Module existing in the case. Each file is an
manual for more details on
code structure.
individual subroutine describing the contents of the corresponding
module. Each subroutine is called using a standard Fortran CALL
statement from its parent Module Fortran file. If control signals are
passed between the parent and child Modules, then these signals will
appear as subroutine arguments in both the CALL and the SUBROUTINE
statements.

The manner in which this is accomplished in PSCAD is to perform the


following steps:

1. Define an Input or Output external Connection object in the


Module definition Graphic section (Graphic tab).
2. Add a corresponding Import or Export tag component inside
the child Module. Each Import or Export must be named the
same as its corresponding Connection.

EXAMPLE 4-1:

Consider a simple case, which consists of a main page and a single


module. The user wants to pass a control signal from the main page
into the module, multiply it by another signal inside the module, and
then transfer the resulting signal back to the main page.

The user would first ensure that the Graphic section of the module
contained both an input and an output Connection object. If creating a
new module from scratch, these Connections can be defined directly in

174 PSCAD User’s Guide


PSCAD

the Component Wizard. If the Module exists already, then the


Connections can be added in the Graphic section of the Module
definition. In this example, the user names these two Connections as
‘in’ and ‘out’.

To complete the transfer, each of these Connections require a


corresponding Import or Export tag component (depending on whether
the Connection has been defined as Input or Output type) within the
Module page itself. Remember that each tag must have an identical
name as its corresponding Connection.

Here are a few important factors to remember when transferring control


signals into and out of Modules:

• Import and Export tags cannot be placed on the project


main page.
• Only one instance of an Import or Export tag may exist
within the Module for a single Connection. If the signal is
required at more than one location within the page, you
can use the Data Label component.

PSCAD User’s Guide 175


Chapter 4: Basic Operations and Features

Radio Links
The above control signal transfers can also be accomplished using Radio
Link components. Radio Links offer a ‘wireless’ method of transferring
the signals, without the need for cumbersome imports and exports on
each Module. If fact, Radio Links allow the user to transfer signals
through multiple Module layers! See the Radio Links component online
help for more details.

Electrical Nodes
When a project is compiled, PSCAD creates a variety of files describing
the case so that EMTDC can understand it and run the simulation. One
or more of these files are simple text Data Files (*.dta), which describe
the construction of electrical network in the case. One Data file is
See Network Solution in created for each Module existing in the case.
Chapter 2 of the EMTDC
manual for more details on
representation of an electric If an electrical node needs to be represented within a module, then
network. PSCAD must be informed of this requirement so that the network of
electric nodes can be properly mapped. The manner in which this is
accomplished is as follows:

1. Define Electrical external Connection object(s) in the Module


definition Graphic section (Graphic tab).
2. Add a corresponding External Electrical Node (XNode)
component for each electrical Connection, inside the child
Module. Each XNode must be named the same as its
corresponding Connection.

EXAMPLE 4-2:

Consider a simple case, which consists of a main page and a single


module. The user wants to represent a simple resistive branch with a
Module.

The user would first ensure that the Graphic section of the Module
included two electrical Connection objects (one for each side of the
resistor). If creating a new module from scratch, these Connections can
be defined directly in the Component Wizard. If the Module exists
already, then the Connections can be added in the Graphic section of
the Module definition. In this example, the user names these two
Connections as ‘NA’ and ‘NB’.

176 PSCAD User’s Guide


PSCAD

To complete the transfer, each of these Connections requires a


corresponding External Electrical Node component within the Module
page itself. Remember that each XNode must have an identical name
as its corresponding Connection.

Here are a few important factors to remember when transferring


electrical signals into and out of Modules:

• XNodes cannot be placed on the project main page.


• Only one instance of an XNode may exist within the
Module for a single Connection.
• An XNode cannot be directly grounded. That is, do not
connect a Ground component directly to an XNode. A
ground may be connected directly to the corresponding
electrical Connection however.

PSCAD User’s Guide 177


Chapter 4: Basic Operations and Features

Wire Mode
PSCAD includes a special wire drawing feature called Wire Mode,
which allows the user to quickly draw interconnecting Wires between
components.
To invoke Wire Mode, click the Wire Mode button in the Main Toolbar
or press Ctrl + W on your keyboard. With the Project open in Circuit
view, move the mouse pointer onto the Project page. The mouse
pointer will have turned into a pencil, which indicates you are in Wire
Mode.
To draw a wire, move the cursor to the node where you want the line
to start and left-click. Move the cursor to where you want the line to
end and left-click again to complete the wire. Multi-segment Wires
may be built by continuing to left click at different points.

To turn-off Wire Mode, either press the Esc key, press Ctrl + W, or
click the Wire Mode button again.
Resizing Wires
The wire component is a special component in that it is resizable in
length. To resize a wire, left-click on it to select it – grips should appear
at the endpoints. Left-click and hold over one of the grips and drag the
Wire Mode Indicator mouse. If the entire wire moves, you were not close enough to the end
when you left clicked.

Editing Component Properties


To edit the parameters of a component, either left double-click the
component, or right-click on the component and select Properties…
from the pop-up menu.

178 PSCAD User’s Guide


PSCAD

For more on the Wire


component, see the on-line
help (i.e., right-click on the
wire and select help).

This will bring up the properties’ dialog for that particular component
instance. The figure below shows the first page of the properties’ dialog
for one of the single-phase source models in the PSCAD Master Library.

Dialogs for other components will differ, but all include the same basic
features and most contain multiple pages: At the top of the dialog is a
drop list, which contains a list of all the property dialog pages. In this
example, the first page is entitled ‘Configuration.’ If only one page
exists, then the drop list will be disabled. To move through or view any

PSCAD User’s Guide 179


Chapter 4: Basic Operations and Features

other existing pages, left-click the down arrow on the field as shown
below:

If there are too many items in the list, you will need to scroll through the
list to see all the form names. To scroll though the list, hold the left
button pressed on the list and drag it up and down. Or press the up or
down arrow on your keyboard when the list is open. If there are more
items in the list that it can display, you will see the list scrolling.

Changing Property Values


Each page will usually contain an assortment of input fields, which can
include drop lists and radio buttons. Depending on the input field, you
can make any changes you desire by either selecting one of the choices
given in the drop lists or radio buttons, or by adjusting data directly in
input fields.

To change the parameter value in a Text Field, simply click on the field
itself (white background) and type the new value. Some property fields
Text Field will contain a unit (i.e., [MVA], [sec], [m/sec], etc.), displayed next to
the property value, to indicate the unit used. There is no need to type
the unit when you enter the value. PSCAD will insert the unit
automatically when you exit the field.

Drop Lists will have a downward pointing arrow on the right hand side.
Click on that arrow to see the list and then click on the required item.
The Drop List could have more items than visible in the list. To scroll
Drop List through the list, simply use the up or down arrows on your keyboard
when the list is open.

180 PSCAD User’s Guide


PSCAD

To select a radio button, simply click on the radio button item.

Once you are finished with all of your editing, click on the OK button to
accept the edited values and to exit the dialog. Clicking on the Cancel
button will exit the form and ignore all the changes made. Radio Buttons

Viewing/Saving Component Data


Users can view and/or save to text file component input Parameters and
Computations section data in an easy to read environment.

Viewing Component Data


To view the calculated results from the Computations section of a
particular component Instance or to view the component Instance input The Project must be
compiled first before
Parameters, right-click on the component and select View Parameters/ attempting to read
Computations... from the pop-up menu. Computations data.

This will bring-up the Parameters/Computations viewing window:

PSCAD User’s Guide 181


Chapter 4: Basic Operations and Features

Formatting Component Data


Once the Parameters/Computations viewing window has been opened
as described above, the data is open to some simple formatting.
Although parameter name and value can not be altered from this
window, users may adjust the order in which data appears - this can be
useful if the data is to be saved to a file.

Left-click and hold a listed parameter name in the display window.


Drag the mouse pointer to where you want to place the parameter and
release the mouse button.

Saving Component Data to a File


Component Data can be saved to a formatted text file at any time.
Select either the Parameters or Computations tabs depending on
what data is to be written. Press the Save As... button to bring up the
Save As dialog window.

182 PSCAD User’s Guide


PSCAD

Enter a name for the file and press the Save button. Once saved,
PSCAD will open the file automatically for viewing.

Changing to Single-Line View


If the component being edited is a three-phase electrical component,
then it is likely there will be a Drop List entitled ‘Graphics Display’ on
the main properties page.

To toggle the component between single-line and 3-Phase view, open


the component properties’ dialog and select the desired view from this
field.

Creating the First Instance of a Definition


In the Workspace window, navigate to the Definitions branch within the
project tree. Either select the desired component Definition from the
list, right-click and select Create Instance as shown below, or drag and
drop the definition directly on the canvas. See the section called Drag
and Drop in this chapter for more details.

PSCAD User’s Guide 183


Chapter 4: Basic Operations and Features

Component definitions
should be moved to a library
project once tested.

Compiling an Individual Module


In the Workspace window, navigate to the Definitions branch within the
project tree. Select the desired module from the list, right-click and
select Compile Module.

Importing/Exporting Definitions
Component Definitions may imported or exported to and from Projects
by saving the Definition to a special Component Definition (*.cmp) file.

Import a Definition
In the Project Section of the Workspace, left-click on the [+] box beside
the desired Project name to expand the Project Tree. Right-click on the

184 PSCAD User’s Guide


PSCAD

Definitions Branch and select Import Definition(s).... See the section


called The Workspace in Chapter 3 for more details.

Export a Definition
To export a Definition (or save the Definition to a special Component
Definition (*.cmp) file), left-click on the [+] box beside the Project name
where the Definition is stored to expand the Project Tree. Expand the
Definitions Branch in the same manner. Right-click on the desired
Definition from the list and select Export As.... See the section called
The Workspace in Chapter 3 for more details.

TUTORIAL: CREATING A NEW PROJECT


The objective of this section is to give you a chance to try out some of
what you have learned in the previous sections before proceeding
further in this chapter. So let’s begin!

Adding a New Case Project


Press the New button in the PSCAD Main Toolbar. A new Case Project
should appear in the Workspace window entitled ‘noname’. Right-click
on the Project name and select Project Settings....

If the Workspace is not


visible, select View |
Workspace in the Main
Menu bar.

This will open the Project Settings dialog. Click the General tab at the

PSCAD User’s Guide 185


Chapter 4: Basic Operations and Features

top of the dialog, left-click inside the Description field and type a
description for the case, say, ‘Voltage Divider’.

Click the Runtime tab and get familiar with the inputs displayed therein.
The Project will be automatically set up with a run duration of 0.5
seconds with a 50 ms time step by default (these settings are sufficient
for now). Click the OK button. The description you entered should now
appear in the Workspace beside the Project filename.

Saving the Project


To save your newly created Case Project, right-click on the Project name
in the Workspace and select Save from the pop-up menu.

This will open the Save Project As dialog.

186 PSCAD User’s Guide


PSCAD

Use the buttons at the top of this dialog to navigate to the desired
directory in which you want to save the Project. Type the name of the
file (say ‘[Link]’) in the File name field near the bottom of the dialog.
Make sure that you include the extension ‘.psc.’ Click the Save button
to save the changes. The Project name in the Workspace will turn to
black and the new filename should appear.

Opening the Project Main Page


To open the main page of your new Case Project, left double-click on
the Project name in the Workspace, or right-click on the name and
select Open.

Note that you should save


your case project frequently
in order to avoid loss of
work.

In either instance, an empty page should be opened in the Circuit


window of the Design Editor. This is the main page of your new Project,
on which you will draw the circuit.

Opening the Master Library


The first project listed in the Workspace window is always the Master
Library ([Link]). It contains most of the components you will ever
need to build any circuit. All of the components that will be used to
create this new Case Project example are available here.

To open the Master Library, follow the same procedure as outlined


above in ‘Opening the Project Main Page.’ The picture shown below is
the top left corner of the Master Library. Each icon is a Module that
opens into another page window, giving access to components
belonging to that group.

PSCAD User’s Guide 187


Chapter 4: Basic Operations and Features

For more on modules,


components and the Master
Library, see Chapter 3.

Assembling a Voltage Divider Circuit


The voltage divider circuit in this example will use eight different
components as shown below.

Initially, it may be a
challenge to navigate
through the Master Library
and find these components
one by one.

Locating the Single-Phase Source


The first step is to locate the single-phase source model to be used in

188 PSCAD User’s Guide


PSCAD

your circuit. There are three different source models available in the
Master Library – we will be using the Single Phase Voltage Source
Model 1 component. Once you find it, add it to your new Case Project
main page using one of the techniques outlined in the section entitled
‘Adding Components to a Project’ in this chapter.

Move the source component to an appropriate place on the page. Left


double-click on the component to bring up the component properties Single Phase Voltage
Source Model 1
window. On the Configuration page, change the Source Impedance component after
Type Drop List to ‘R’ (for purely resistive). properties modified.

Also on the Configuration page, change the Rated Volts (AC:L-G,


RMS) input field from ‘110.00 [kV]’ to ‘70.71 [kV].’ This will give an
internal source voltage of 100 kV peak.

Save your Project.

Add and Assemble


The next step is to add the remaining components (i.e., Wire, Resistor,
Current Meter, Data Label, Output Channel, and Ground components).
Arrange all components to form the simple voltage divider shown in the
following diagram:

PSCAD User’s Guide 189


Chapter 4: Basic Operations and Features

Save your Project.

Editing the Remaining Component Properties


Use the properties shown below for the remaining components. Only
the properties to be changed from their default values are mentioned.
Use the resistor with its default properties.

190 PSCAD User’s Guide


PSCAD

Save your Project.

Plotting Results
In order to view any results from our voltage divider circuit, we must
add a Graph Frame and set it up to display the waveforms. The
following sections describe only those aspects of plotting needed in this
exercise.
Adding a Graph Frame
Right-click on the Output Channel component called ‘Mid Point Voltage’
to bring up the pop-up menu. Select Input/Output Reference | Add
Overlay Graph with signal.

PSCAD User’s Guide 191


Chapter 4: Basic Operations and Features

This should create a new Graph Frame, Overlay Graph and a Curve
simultaneously as shown below:

Right-click on the Graph Frame title bar (top bar on the plot labelled
‘Main : Graphs’) and select Graph Frame Properties... from the pop-
up menu. This should bring-up the Graph Frame Properties dialog
window. In the Caption field, change the title to ‘Currents and
Voltages’.

192 PSCAD User’s Guide


PSCAD

To resize the Graph Frame at any time, left click on the Graph Frame
title bar so that Grips appear. Left-click and hold on a corner Grip and
drag mouse outwards. Resize the Graph Frame to approximately 5x5
inches.

PSCAD User’s Guide 193


Chapter 4: Basic Operations and Features

Adding Another Overlay Graph and Curve


Right-click on the Graph Frame title bar and select Add | Overlay
Graph. A new Overlay Graph should appear within the Graph Frame
directly below the existing graph. Add a Curve to this graph to monitor
load current: Right-click on the Output Channel component called
‘Load Current’ to bring up the pop-up menu. Select Input/Output
Reference | Add as Curve.

Right-click over the newly added Graph and select Paste Curve from
the pop-up menu. When finished, your Graph Frame should look similar
to that shown below:

194 PSCAD User’s Guide


PSCAD

Editing the Graph Properties


To customize an individual Graph title and/or vertical axis label,
right click over top the Graph and select Graph Properties... Edit
the Graph Properties as you see fit. For example, change the Y-
Axis Title input field to show ‘kV’ on the voltage graph, and ‘kA’
on the load current graph. You may also want to turn on/off Grid
Lines and adjust the scaling. The Graph Frame should appear
similar to that shown below once completed.

PSCAD User’s Guide 195


Chapter 4: Basic Operations and Features

Save your Project.

Running the Project


Before running your new Project, ensure that it is the active project in
the Workspace window. Press the Run button in the Main Toolbar.

This is the last step, assuming there are no errors. If there are any, they
will be logged in the Output Window. See Chapter 10 for more details
on common errors. Your simulated results should look similar to the
following, once the simulation is completed.

It may be necessary to
readjust your X and Y-axes,
as well as zoom and time
frame. See Chapter 5 for
more details.

CREATING A NEW COMPONENT OR MODULE


New Components or Modules can be created in PSCAD by invoking the
Component Wizard. The Component Wizard is a graphical tool that
creates a definition ‘shell’, which the user may then use for further
designing the component or module.

The following topics describe the simple steps involved when using the
Component Wizard. For more on component design, see Chapter 8.

196 PSCAD User’s Guide


PSCAD

Using the Component Wizard


Before proceeding, ensure that the Project you are working with is
opened in Circuit view. Press the New Component button in the Main New Component
Toolbar, or move the mouse pointer over a blank area of any page, Button
right-click and select Create New Component....

The first page of the Component Wizard should then appear as shown
below:

PSCAD User’s Guide 197


Chapter 4: Basic Operations and Features

Step 1
Step 1 in creating a new component involves entering the following
data:

• Name: Enter a name for the Component Definition. This


name must conform to Fortran standards (i.e., it cannot
begin with a number or contain any spaces).
• Title (Optional): If text is detected in any of the three
fields provided in this section, a Text Label containing the
text will be added to the component Graphic.
If a number is added to any • Connections: If you would like to automatically create
of the Connections fields,
then you must define each
any Connections to your component, enter the number
Connection in Step 2. required in either the Left, Top, Right or Bottom input
fields. For example, entering 2 in the Left field indicates
that you want to auto create to Connections on the left
side of the component Graphic.
• Page Module: Select this input if you want this new
component to be a module (also referred to as a page
component or a sub-page).

Enter all the parameters that you require according to the above
descriptions. When finished, click the Next > button. If no Connections
were specified above, skip to Step 4.

Step 2
Step 2 in creating a new component involves defining data for any
Connections specified in Step 1.

• Connection Name: Enter a name for the Connection.


This name must conform to Fortran standards (i.e., it
cannot begin with a number or contain any spaces).
• Display Label: If text is detected in this field, a Text Label
containing this text will be added near the Connection in
the component Graphic, acting as a Connection label.
• Connection Type: Select the type of Connection here.
Note that for Input Data type, the Component Wizard will
automatically draw an input arrow graphic for the
Connection.
For more on Connection Type,
Node Type, Data Type or • Node Type: Select the type of electrical Connection here.
Dimension, see Chapter 8. This input is only enabled if the Connection Type is
selected as Electrical.

198 PSCAD User’s Guide


PSCAD

• Data Type: Select the type of data Connection here.


This input is only enabled if the Connection Type is
selected as either Input Data or Output Data.
• Dimension: Enter the dimension of the Connection
signal. This input is only used if the signal is to be a
standard Fortran array (or vector).

Enter all the parameters that you require according to the above
descriptions. This page will be repeated for each Connection specified
in Step 1, starting with the left side of the component Graphic. The
text box at the top of the dialog will indicate what Connections are
currently being defined.

When finished each page, click the Next > button. If Page Module
was not selected in Step 1, skip to Step 4. If a mistake is made, press
the < Back button at any time.

Step 3
Step 3 in creating a new component involves defining the Page Setup
if the Page Module input was selected in Step 1.

• Paper Size: Select a standard paper size from the list


provided.
• Orientation: Select either Portrait or Landscape page
orientation.

PSCAD User’s Guide 199


Chapter 4: Basic Operations and Features

When finished, click the Next > button. If a mistake is made, press
the < Back button at any time.

Step 4
Step 4 is simply a confirmation step. Press the Finish button if you are
satisfied that everything is correct. Press the < Back button to go back
to the previous step.

200 PSCAD User’s Guide


PSCAD

Creating a Default Module


You can forego the above procedure when creating a simple Module.
Simply press the Create Default Module button in the PSCAD Main
Toolbar. This creates a simple Module with no external connections to Create Default
its parent page. To create a Module with Connections, follow the Module Button
procedure outlined above.

DRAG AND DROP


The addition of drag and drop functionality to PSCAD V4, greatly
improves the efficiency of designing Projects - especially the
construction of online plots and controls. Drag and drop may be
performed directly on the drawing canvas in Circuit view, or items may
be dragged and dropped from the Workspace onto the Circuit canvas.
The drag and drop feature uses mouse pointer icons to indicate
whether or not a dragged object may be placed under the current
mouse position:

• Drop position is valid

• Drop position is invalid

Copy a Component Instance


All component Instances appearing on the Circuit canvas may be
copied and pasted using drag and drop.
1. Hold down the Ctrl key.
2. Move the mouse pointer over the component Instance to be
copied.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer to a blank area of the Circuit canvas
and release the mouse button to paste.

PSCAD User’s Guide 201


Chapter 4: Basic Operations and Features

Adding a Curve to a Graph


A Curve can be added directly to a Graph in one of two ways:
• From an Output Channel Instance
• From a Runtime Object in the Workspace.

From an Output Channel

1. Hold down the Ctrl key (use the Shift key if Enable ‘Shift’ key
to create controls and curves is enabled in the Workspace
Settings dialog).
2. Move the mouse pointer over the desired Output Channel
Instance.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer to the desired Graph and release the
mouse button to paste.

From a Runtime Object

1. With the current Project set as active, click the Runtime tab in
the Workspace.
2. Navigate to the corresponding Runtime Object for the desired
Output Channel (will be in the Recorders sub-branch).
3. Select the object and hold with your left mouse button.

202 PSCAD User’s Guide


PSCAD

4. Drag the mouse pointer to the desired Graph and release the
mouse button to paste.

Adding a Meter to a Control Panel


A Meter can be added directly to a Control Panel in one of two ways:
• From an Output Channel Instance
• From a Runtime Object in the Workspace.

From an Output Channel


1. Hold down the Ctrl key (use the Shift key if Enable ‘Shift’ key
to create controls and curves is enabled in the Workspace
Settings dialog).
2. Move the mouse pointer over the desired Output Channel
Instance.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer over the desired Control Panel title bar
and release the mouse button to paste.

From a Runtime Object


1. With the current Project set as active, click the Runtime tab in
the Workspace.
2. Navigate to the corresponding Runtime Object for the desired
Output Channel (will be in the Recorders sub-branch).
3. Select the object and hold with your left mouse button.
4. Drag the mouse pointer over the desired Control Panel title bar
and release the mouse button to paste.

Adding a Control Interface to a Control Panel


A Control Interface can be added directly to a Control Panel in one of
two ways:
• From a controls component Instance (i.e. Slider, Dial, Switch or
Push Button)
• From a Runtime Object in the Workspace.

PSCAD User’s Guide 203


Chapter 4: Basic Operations and Features

From a Controls Component


1. Hold down the Ctrl key (use the Shift key if Enable ‘Shift’ key
to create controls and curves is enabled in the Workspace
Settings dialog).
2. Move the mouse pointer over the desired controls component
Instance.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer over the desired Control Panel title bar
and release the mouse button to paste.

From a Runtime Object


1. With the current Project set as active, click the Runtime tab in
the Workspace.
2. Navigate to the corresponding Runtime Object for the desired
Output Channel (will be in the Controls sub-branch).
3. Select the object and hold with your left mouse button.
4. Drag the mouse pointer over the desired Control Panel title bar
and release the mouse button to paste.

Create a Component Instance


Component Instances can be created directly from the corresponding
Definition in the Projects Section of the Workspace.
1. With the current Project set as active, click the Projects tab in
the Workspace.
2. Navigate to the Definitions Branch and select the desired
component Definition.
3. Drag the mouse pointer to a blank area on the Circuit canvas
and release the mouse button to paste.

HELP
PSCAD features a couple of different methods for users to obtain
information regarding a particular feature. In addition to the PSCAD
and EMTDC User’s Guides, there is the On-Line Help system and Flyby
help windows.

204 PSCAD User’s Guide


PSCAD

Accessing the Online Help System


The On-Line Help System Table of Contents (TOC) and Index can be
accessed directly through the Help menu in the Main Menu Bar, as
shown below:

You may also bring up the On-Line Help by simply pressing the F1 key.

Master Library component specific help can be accessed by one of the


following methods:

• Select the component and then press F1.


• Right-click on the component and select Help from the
pop-up menu.
• Edit the component parameters and click the Help button.

In addition, other various dialog windows in PSCAD will have a Help


button associated with them (usually in the bottom right corner). Click
this Help button to bring-up the On-Line Help system topic specific to
that dialog.

Using Flyby Help Windows


Flyby windows are a PSCAD feature especially designed for obtaining
information ‘on the fly.’ Flybys can be used either for providing pop-up
help for components (see Chapter 8), or for monitoring quantities
during a simulation.

PSCAD User’s Guide 205


Chapter 4: Basic Operations and Features

To monitor a signal value during a run, simply hold your mouse pointer
over the signal wire where you want to monitor the data. In a second
or two, a Flyby window should pop-up as shown below:

If the mouse pointer is held over a wire carrying an electrical signal, the
Flyby will indicate the voltage in kilovolts at that electrical node. The
Flyby shown above indicates that this is EMTDC node NT_2, which is a
Flyby information cannot be
read unless the Store Feed-
scalar quantity (i.e., single-phase node). The value of the node voltage
Forward Signals for at the instant this snapshot was taken was –73.8549 kV. The signal
Viewing parameter in the
Dynamics section of the
being read by the Flyby is created by the Volt Meter to Ground
Project Settings dialog is component called ‘Vmid.’
disabled. Deselect this
option first before using
Flybys.
If the mouse pointer is held over a data (control) signal, the value of the
data itself will be shown in the Flyby.

SEARCHING
If the user wishes to search a project for a signal name, connection
name, node number, etc., the Find feature in PSCAD can be used. To
bring up the Find dialog window, simply select Edit | Search… from the
Main Menu bar, press Ctrl + F on your keyboard, while the Circuit
window is open, or press the Find button in the Main Toolbar.

For more information on the Find feature, see Chapter 10.

206 PSCAD User’s Guide


PSCAD

CONTROL SETTINGS
The Control Settings feature was introduced in PSCAD V4, and provides
users with the ability to save the settings of all Dial, Switch and Slider
control components in a Project to a Template. When the Project is Find Button
reloaded, these settings can be reset immediately by selecting the
Template. It is possible to store multiple Templates so that the user can
easily switch between one Template to another, without having to
manually reset all the control components.
The Control Settings feature can be accessed through the Settings
Bar.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Settings Bar.
Storing Settings to a Template
Before storing your control settings to a Template, first ensure that all
Dial, Switch and Slider control components have been set, and that the
current Project is the Active Project. Press the Control Data Menu for
Active Project button to bring up the Control Data Menu pop-up as
shown below:

PSCAD User’s Guide 207


Chapter 4: Basic Operations and Features

You may store all settings to


the default Template if you
wish. Simply ensure that
<Default> appears in the
control setting window and
select Store Settings to
Current Template. Also,
ensure that all controls
possess a distinct name,
otherwise an error message
will be posted.
either Store Settings to Current Template or Store Settings
Select
to New Template... depending on what you want to do. If this will be
the first Template you have created for this Project, select the latter.

If creating a new Template, a dialog window will pop-up – enter a


name for the Template

When finished, press the OK button. Your control settings will now be
stored in this new Template. Whenever you reload the Project, or want
to revert back to these settings, simply left-click the down arrow on the
Template drop list and select the Template.

Synchronizing Default Settings


At any time, the Project default control settings may be synchronized
with the current settings. Press the Control Data Menu for Active
Project button to bring up the Control Data Menu pop-up. Select
Synchronize Default Settings

Duplicate, Rename or Delete Template


You can duplicate, rename or delete a Template by simply selecting the
corresponding function from the Control Data Menu pop-up as shown
below:

208 PSCAD User’s Guide


PSCAD

Template Settings Viewer


Once at least one Template has been created for a Project, PSCAD
provides a Template Settings Viewer so that users can view and verify
control settings in an visually organized environment. To bring-up the
Template Settings Viewer, simply select the corresponding function from
the Control Data Menu pop-up as shown below:

Features and Functions


The Template Settings Viewer window contains a few simply features to
help view and organize Template settings data. The viewer consists
mainly of three View Selector Tabs, where the settings data may be
viewed by Template, Module or by Control Group

PSCAD User’s Guide 209


Chapter 4: Basic Operations and Features

In the case of View by Template, the Template view may be switched


by using the Template Selector drop list. Under View by Module and
View by Group, this drop list becomes a Module selector and Group
selector respectively.
The current Template is
marked with an asterisk (*). The button bar includes three buttons. The OK button closes the viewer
window. The Save As... button allows the user to save the data in the
current view to a formatted text file. The Help button of course invokes
the online help.

The Point To... button may be used to have PSCAD point directly to the
control of interest. Simply select the desired control from the display list
and click the button:

210 PSCAD User’s Guide


PSCAD

SETTING GLOBAL CONSTANTS


Global constants is a new feature added in PSCAD V4, which provides
the user with a quick and efficient method to set constants that are to
be used globally in a project. For example, if your system frequency is
50 Hz, then you can define a constant (say ‘f’) and set it equal to 50.0
as a global constant. Then you simply need to add the constant name
‘f’ as an input parameter in any component that requires the system
frequency.

To define a global constant, right-click on the desired project in the


Workspace window and select Global Constants… or simply press Ctrl
+ G on your keyboard.

Either of these procedures will bring up the Global Constants’ dialog


window.

Enter the constant directly into the dialog. For example, say a user
wants to define the system frequency globally as 50 Hz, and the
transmission line length globally as 100 km in a project. This would be

PSCAD User’s Guide 211


Chapter 4: Basic Operations and Features

entered as follows in the Global Constants’ dialog:

The user would then enter either ‘f’ or ‘length’ in the appropriate
component input parameter field.

Global constants are saved within the project file itself, so once defined,
they remain as a project setting until they are removed from the Global
Constants’ dialog. Global constants are case insensitive.

EMTDC OUTPUT FILES


EMTDC output files are formatted text files, which organize all data
into columnar format. Each column, except the first, which is ALWAYS
time, represents the recorded data from a respective Output Channel
component existing within the project. For example, if two Output
Channel components exist in the project, then three columns of data
will appear in the EMTDC output file. The following is a segment of
text from a typical EMTDC output file:

Test Case
0.0000000000000 0.0000000000000 0.0000000000000
0.10000000000000E-02 0.0000000000000 0.0000000000000
0.20000000000000E-02 0.86727047422974 0.86727047422974
0.30000000000000E-02 1.6650619394029 1.7674567004163
0.40000000000000E-02 1.9545665157651 2.2542364437667
0.50000000000000E-02 2.0221282586499 2.8373003607589
0.60000000000000E-02 1.9264422562260 4.0202957514613
0.70000000000000E-02 2.3912531836698 5.5547061594874
0.80000000000000E-02 2.8769239640036 6.5791178737352
0.90000000000000E-02 2.8473253982397 6.9456914675731
0.10000000000000E-01 2.3232656122503 7.1369144410646
0.11000000000000E-01 1.2446128466462 7.1669414384869
0.12000000000000E-01 1.6208317681211 7.0023750435365
0.13000000000000E-01 1.6458908605563 7.1529925186834
0.14000000000000E-01 4.2422849293514 9.3453281849245

212 PSCAD User’s Guide


PSCAD

The project description is written as the first row of text at the top of the
file. The first column of data is always the EMTDC simulation time.
You may notice that the subsequent columns are not labelled – see the
section below called ‘Column Identification and the Information File’ for
more details on this.

EMTDC output files may be used for waveform analysis by a selected


post-processing software package. As they are formatted in a delimited
columnar format, they can be easily imported into most graphing or
data analysis programs. EMTDC output files are given the extension
‘*.out’ and are stored in the project temporary directory.
See Chapter 5 for more on
Output Channels and
Creating Output Files collecting data.
EMTDC output files are created by choosing Yes in the Save channels
to disk? drop list, in the Runtime section of the Project Settings’ dialog.
See the section entitled ‘Saving Output to File’ in this chapter for more
details.

Multiple Output Files


The maximum amount of columns per output file is 11 (including the
time column). Therefore, if more than 10 Output Channel components
exist in a project, multiple output files will be created. For example, if
your project contains 23 Output Channels, a total of three output files
will be created.

The naming convention for multiple output files is to simply append a


sequential number as a suffix. For example, if the output file is named
‘[Link],’ and there are three files as described above, the output files
would be named ‘abc_01.out,’ ‘abc_02.out’ and ‘abc_03.out.’ This
sequential numbering is important when identifying data columns.

Column Identification and the Information File


As mentioned above, EMTDC output file columns are not labelled. In
order to determine which column is what, an information file (‘*.inf’) is
also created along with the output file(s), that contains cross-referencing
information. The information file will be named the same as the output
file primary file name. For example, if the output file name is ‘[Link],’
the information file will be named ‘[Link].’ Only one information file is
created, even for multiple output files.

A typical information file is shown below for a project containing three


output channels.

PGB(1) Output Desc=”Fund - mag” Group=”Main” Max=25.0


Min=0.0 Units=””

PSCAD User’s Guide 213


Chapter 4: Basic Operations and Features

PGB(1) Output Desc=”Fund - mag” Group=”Main” Max=25.0 Min=0.0 Units=””


PGB(2) Output Desc=”2nd harm - mag” Group=”Main” Max=25.0 Min=0.0 Units=””
PGB(3) Output Desc=”3rd harm - mag” Group=”Main” Max=25.0 Min=0.0 Units=””

At the extreme left is the Output Channel number (i.e., PGB(1), PGB(2),
etc.). This number indicates the sequence in which the Output Channel
data is written to an output file. In other words, this number
corresponds to the output file column number. Remember however,
that the first column in the output file is time and is not counted.
Therefore, Output Channel 2 (PGB(2)) will actually be the third column
from the left in the output file. This column can then be identified using
the corresponding Output Channel name (i.e., ‘Desc’). In this case,
Output Channel 2 happens to be ‘2nd harm – mag.’

The Output Channel numbers in the information file will continue in


sequence with the number of Output Channel components in the
project. That is, if there are 50 Output Channels in the project, there
will be 50 rows in the information file, numbered up to 50. We already
know however, that a single output file will only hold up to 11 columns
of data (including time). For 50 Output Channels, PSCAD will create
five output files, where the columns are numbered ignoring the time
columns in each file. For example, column five in the 3rd output file
would be Output Channel 34.

Here is a simple formula to help identify an output file column:

Single Output File:

Output Channel # = Output File Column # - 1

Multiple Output Files:

Output Channel # = Output File Column # - 1 + (10 x Output File #)

214 PSCAD User’s Guide


PSCAD

Chapter 5:

Online Plotting and Control


PSCAD contains a few special Runtime objects designed to give the
user online control of input data, as well as the ability to record and
display output data.

Special objects such as Graph Frames, Graphs, Curves, Meters and


Polymeters are used to interactively display EMTDC output data, both
during a run and following completion of a simulation. Control Panels
and Control Interfaces are especially designed to give the user online
access to EMTDC input variables, so that these variables (and hence
the simulation results) can be altered during the course of the
simulation run.

The plotting and online tools are completely new and more powerful
than ever in PSCAD V4, but still maintain a likeness to those found in
earlier versions. For example, data could only be plotted with respect
to time in previous versions of PSCAD. In V4, an XY Plot tool has been
added to allow the plotting of one set data versus another. Portions of
Curve data, whole Graphs, or even entire Graph Frames may be copied
as a picture, meta-file or comma separated variable (*.csv) files for
placement in documents and reports. Many other intuitive features not
found in earlier versions are also now available.

PREPARING DATA FOR CONTROL OR DISPLAY


In order to record, display (i.e. plot) or control any data signals from
EMTDC within the PSCAD environment, the signal must be first linked
to an existing Runtime object. Runtime objects are classified as special
components involved exclusively with the PSCAD Runtime interface and
are organised into three main groups:

• Controls: Slider, Dial, Switch and Push Button


• Recorders: Output Channel and RTP/COMTRADE Recorder
• Display Devices: Control Panel, Graph Frame, XY Plot and
Polymeter

PSCAD User’s Guide 215


Chapter 5: Online Plotting and Control

Each Runtime object performs a specific task, and may be used in


combination with others to control and/or display data. Only Controls
and Recorders however are involved in directly linking with EMTDC data
signals. For more on the organization and use of Runtime objects, see
the section entitled The Workspace in Chapter 3.

Channelling Output Data


Channelling output data refers to preparing data signals for either online
display in a Graph or Meter, or for output to an Output File. This is
accomplished by simply directing the desired signal into an Output
Channel component. For example, the image below shows how to
channel signal data from a Voltmeter component (called ‘Vmid’), as well
as directly from a control signal in the PSCAD Circuit canvas:

Controlling Input Data


Controlling input data refers to using one of the Controls Runtime
objects (i.e. Slider, Dial, Switch or Push Button) as a source for a certain
data signal. This is accomplished by simply adding a Controls object to
the PSCAD Circuit canvas. This signal can be input at any valid location
in the circuit as shown below:

216 PSCAD User’s Guide


PSCAD

GRAPH FRAMES
A Graph Frame is a special Runtime object used for accommodating
Graphs and can be placed anywhere on the canvas in Circuit view. Once
a Graph Frame has been added, you may then proceed to add as many
Graphs to it as you wish.

Graph Frames are used exclusively for plotting Curves versus time. That
is, the Graph Frame horizontal axis is always the EMTDC simulation
time. If you need to a plot a Curve as a function of another variable,
please see XY Plots in this chapter.

PSCAD User’s Guide 217


Chapter 5: Online Plotting and Control

Adding a Graph Frame


Open the project in the Circuit window of the Design Editor. Right-click
Graph Frame Button on a blank portion of the page and select Add Component | Graph
Frame, or press the Graph Frame button in the Control Palette bar.

Moving and Resizing a Graph Frame


To move a Graph Frame, move the mouse pointer over the title bar and
then left-click and hold. Drag the frame to where it is to be placed
and release the mouse button.

To resize, move the mouse pointer over the title bar and left-click to
select the Graph Frame. Grips should then appear around the outer
edge as shown below.

Move the mouse pointer over one of the grips. Left-click and hold
and then drag and move the pointer to resize.

Cut/Copy Frames
Right-click over the graph frame title bar and select Cut Frame or Copy
Frame respectively.

218 PSCAD User’s Guide


PSCAD

Once a graph frame has been cut or copied, it may then be pasted
into another location in the Project (along with its contents).

Paste Frame
Cut or copy a Graph Frame as described above. Right-click over a
blank area of the Project Page in Circuit view and select Paste. A
Graph Frame may be pasted multiple times.

Adjusting Frame Properties


To access the Graph Frame Properties dialog, left double-click the
Graph Frame title bar, or right-click over the title bar and select Graph
Frame Properties….

PSCAD User’s Guide 219


Chapter 5: Online Plotting and Control

The properties available in this dialog are as described below:

• Caption: Enter a title for the Graph Frame. This text will
appear in the Graph Frame title bar. See Grouping of Runtime
Objects in this chapter for more details on adjusting this setting.

Preferences:

• Show Markers: Select this option to show the X and O


Markers on all Graphs in the Graph Frame.
• Show Glyphs: Select this option to show Glyph symbols on all
Curves in all Graphs in the Graph Frame.
• Show Ticks: Select this option to show Ticks along the Y-
Intercept in all Graphs in the Graph Frame.
• Show Grid: Select this option to show the Grid in all Graphs
in the Graph Frame.
• Show Y-Intercept: Select this option to show the Y-Intercept
in all Graphs in the Graph Frame.
• Show X-Intercept: Select this option to show the X-Intercept
in all Graphs in the Graph Frame.
• Auto-Pan X-Axis: This feature is equivalent to the ‘Follow
End Of Run’ feature available in PSCAD V3. The Auto-Pan X-
Axis feature however allows the user to adjust the panning
action. The input field directly beside this check box accepts
an input representing the percentage of the currently viewed
Graph window (or aperture). For example, if the total x-axis
view is 0.1 seconds, a 10% Auto-Pan setting will pan the
viewing window every 0.01 seconds.

Adjusting Horizontal Axis Properties


To access the Horizontal Axis Properties dialog, left double-click over the
Graph Frame horizontal axis, or right-click over the horizontal axis and
select Axis Properties....

220 PSCAD User’s Guide


PSCAD

Adjusting the horizontal axis


properties will affect all
Graphs in the Graph Frame.

Axis:

• Title: Enter a title for the x-axis. This text will appear in the
bottom-left corner of the graph frame, directly beside the x-
axis.
• Snap Aperture to Grid: Select this feature so that when
using Dynamic Aperture Adjustment, the aperture view will
snap to the major grid while scrolling.
• Dynamic Aperture Adjustment: Select this option to enable
Dynamic Aperture Adjustment (i.e., horizontal scroll).
• Enable Minor Grids: When selected, minor grid ticks will
appear on the Graph Frame horizontal axis. Minor grids will
always show the halfway point between major grid points, and
are not labelled.
• Max: Sets the maximum time of the viewed range.
• Min: Sets the minimum time of the viewed range.
• Grid: Sets the time between the axis major grid points. Major
grid points are labelled on the graph frame horizontal axis.

Markers:

• Show Markers: Select this option to show the X and O


markers.
• X Marker: Enter the position (in seconds) to place X marker. See the section entitled
‘Markers’ in this chapter for
• O Marker: Enter the position (in seconds) to place O marker. more details on marker
properties and use.

PSCAD User’s Guide 221


Chapter 5: Online Plotting and Control

GRAPHS
A Graph is a special Runtime object, which can reside only inside a
Graph Frame. There are two types of Graphs available in PSCAD:
Overlay and Poly Graphs. A single Graph may hold and display multiple
Curves, where all Curves in a Graph are based on the same y-axis scale.

The following illustrates a Graph Frame with an Overlay Graph on top


and a Poly Graph below it.

Adding Graphs to a Graph Frame


Graph Frames may accommodate single or multiple Graphs. To add one
or more Graphs, right-click on the Graph Frame title bar and select Add
Overlay Graph or Add Poly Graph. You can also add an Overlay
Graph directly by pressing the Ins key on your keyboard with your
mouse pointer over the Graph Frame.

222 PSCAD User’s Guide


PSCAD

Graph Order
Once multiple graphs have been added to a particular Graph Frame, you
may change the order in which they appear. Right-click over the graph
to be moved and select one of the following:

• Move Graph Up
• Move Graph Down
• Move Graph to Top
• Move Graph to Bottom

Cut/Copy Graphs
Right-click over the Graph to be cut (removed) or copied and select Cut
Graph or Copy Graph respectively.

PSCAD User’s Guide 223


Chapter 5: Online Plotting and Control

Once a Graph has been cut or copied it may then be pasted into the
same or another Graph frame.

Paste Graph
Cut or copy a graph as described above. Right-click on the Graph
Frame title bar and select Paste Graph. A Graph may be pasted
multiple times, where each paste will replicate the entire Graph.

Copy Data to Clipboard


If a simulation has been run and your Graph contains Curve data, you
have the option of copying all or a portion of all Curve data in the Graph
to the clipboard. Right-click over the corresponding Graph and select
Copy Data to Clipboard and then select one of the following from the
See the section entitled pop-up menu:
‘Markers’ in this chapter for
more details on Marker • All: Copies all Curve data available.
properties and use.
• Visible Area: Copies all Curve data visible in the Graph
window.
• Between Markers: Copies only Curve data situated between
Markers. Note that Show Markers must be selected in the
Axis Properties dialog.

The data is copied as ‘Comma Separated Variables’ (*.csv) format for


easy migration into common data analysis software.

224 PSCAD User’s Guide


PSCAD

Overlay Graphs
Overlay Graphs are the most common and familiar type of online
plotting tool in PSCAD. These Graphs display EMTDC measured data,
unaltered as a function of time. Multiple Curves may be added (or
overlayed) onto a single Graph.

Adjusting Overlay Graph Properties


Left double-click on the desired Overlay Graph, or right-click on the
graph and select Graph Properties....

This should bring up the Overlay Graph Properties dialog window as


shown below:

PSCAD User’s Guide 225


Chapter 5: Online Plotting and Control

There are various parameters that may be edited though this window,
each of which are described below.

Preferences:

• Invert Colours: Select this option to give the Graph a black


background (instead of white or yellow).
• Show Glyphs: Select this option to show glyph symbols on all
curves in the Graph.
• Show Grid: Select this option to display grid lines for the x-
axis and y-axis major grids.
• Show Ticks: Select this option to show major grid tick marks
along the y-axis intercept line.

226 PSCAD User’s Guide


PSCAD

• Auto Curve Colours: Select this option to use automatic


colouring of Curves in the Graph. You cannot change Curve
colour manually when this option is selected.
• Show Y-Intercept: Select this option to display the y-intercept
(horizontal) intercept line. The y-intercept line can be adjusted
using the Y-Intercept field described below.
• Show X-Intercept: Select this option to display the x-
intercept (vertical) intercept line. The x-intercept is always at
time zero, and cannot be adjusted in Overlay Graphs.
• Show Cross Hair: Select this option to invoke the Cross Hairs
Mode.
Y-Axis:

• Title: Enter text for display as the Graph title (located on the
left side of the Graph).
• Grid: Specifies the y-axis grid interval. To view the y-axis grid
lines, select the option Show Grid described above.
• Ymin: Specifies the minimum y-axis viewing limit on the
Graph.
• Ymax: Specifies the maximum y-axis viewing limit on the
Graph.
• Y-Intercept: Specifies the y-axis location of the y-intercept
line. This line is only visible if Show Y-Intercept is selected
(see above).
• Manual Scaling Only: Select this feature to lock the y-axis
limits set in Ymin and Ymax above. The y-axis will remain
locked during any subsequent Zoom operations.

Poly Graphs
Poly Graphs are used specifically to display EMTDC measured data in a
‘stacked’ format. That is, each individual Curve is contained within its
own viewing space, and are stacked on top of each other within the
Poly Graph.

Adjusting Poly Graphs Properties


Left double-click on the desired Poly Graph, or right-click on the Graph
and select Graph Properties.... This should bring up the Poly Graph
Properties dialog window.

PSCAD User’s Guide 227


Chapter 5: Online Plotting and Control

There are various parameters that may be edited though this window,
each of which are described below.

Preferences:

• Invert Colours: Select this option to give the Graph a black


background (instead of white or yellow).
• Draw Thick/Thin Lines: Select this option to toggle between
thick and thin line representation of Curves added to this
Graph.
• Show Grid: Select this option to display grid lines for the x-
axis and y-axis major grids.
• Show Cross Hair: Select this option to invoke the Cross Hairs
Mode.
• Auto Curve Colours: Select this option to use automatic
colouring of Curves in the Graph. You cannot change Curve
colour manually when this option is selected.
• Show X-Intercept: Select this option to display the x-intercept
(vertical) intercept line. The x-intercept is always at time zero,
and cannot be adjusted in Poly Graphs.
• Show Bands: Selecting this option will give a different
background colour between multiple Curves in one Graph, for
easy visual differentiation.

228 PSCAD User’s Guide


PSCAD

CURVES
A curve is special Runtime object best described as a graphical
representation of a string of data points, where each point is associated
with a simulation time step. Curves are created by linking to an Output
Channel component, to which a scalar or array set of data signals have
been input. In PSCAD V4, Curves can be multi-dimensional, that is a
single Curve may possess many Traces, where each Trace corresponds
to a single array value.

For more information on


accessing and adjusting
individual Trace properties,
see Traces in this chapter.

If the Output Channel input signal is a scalar (i.e. single dimension),


then the Curve will consist of a single Trace. In previous versions of
PSCAD, this was always the case.

Adding a New Curve to a Graph


Adding a Curve to a Graph can be accomplished a couple of different
ways:

Drag and Drop


Hold down the Ctrl key. Left-click and hold over the Output Channel
component from which you would like to extract the Curve. Drag the
mouse pointer over a Graph and release the mouse button. See Drag
and Drop in Chapter 4 for more details on this.

Input/Output Reference
Right-click on the Output Channel component from which you would

PSCAD User’s Guide 229


Chapter 5: Online Plotting and Control

like to extract the Curve. Select Input/Output Reference | Add as


Curve. Select the desired Graph with a left-click, then right-click and
select Paste Curve.

If the simulation has been


run already (with this
Output Channel inserted),
the corresponding Curve
data will be displayed
immediately in the Graph
upon being pasted.

Curve Legends
Once a Curve has been added to a Graph, the Curve Title will appear in
the Curve Legend.

Curve Order
Once multiple Curves have been added to a particular Graph, you may
change the order in which they appear. Right-click over the
corresponding Curve Legend and select one of the following from the
pop-up menu:

• Move to the Start


• Move to the End

230 PSCAD User’s Guide


PSCAD

Cut/Copy/Paste an Existing Curve


Right-click over the Curve Title in the Curve Legend and select either
Cut Curve or Copy Curve, depending on what you want to do. Right-
click over any Graph and select Paste Curve to add the copied Curve to
the Graph. The Curve should then appear in the corresponding Curve
Legend.

Copy Data to Clipboard


If a simulation has been run and a particular Curve contains data, you
have the option of copying all or a portion of this single Curve data set
to the clipboard. Right-click over the corresponding Curve name in the
Curve Legend and select one of the following from the pop-up menu:

• Copy Visible Data to Clipboard: Copies all Curve data


currently visible in the graph window.
• Visible Area: Copies all Curve data available.

The data is copied as ‘Comma Separated Variables’ (*.csv) format for


easy migration into common data analysis software.

Adjusting Curve Properties


Left double-click on the desired Curve in the Curve Legend, or right-
click the curve and select Curve Properties....

PSCAD User’s Guide 231


Chapter 5: Online Plotting and Control

This should bring up the Curve Properties dialog window.

232 PSCAD User’s Guide


PSCAD

Active Trace
The following list describes the parameters in this section:

• Display trace with a custom style: Select this option if you


wish to change the colour or width of the Active Trace.
• Colour: Press the Colour... button to select a display colour
for the Trace. Press the OK button in the Colour dialog. This
option is enabled only if ‘Display trace with a custom style’ is
selected.

• Bold: Select this option if you wish the Trace to appear


bolded. This option is enabled only if ‘Display trace with a
custom style’ is selected.

Style:
The following list describes the parameters in this section.

• Lines: Displays the Curve as a standard line.


• Points: Displays the Curve as a series of points according to
the set plot step.

PSCAD User’s Guide 233


Chapter 5: Online Plotting and Control

• Filled: Fills the area under the Curve (between the curve and
the 0.0 line) with the curve colour.
• Line-Point: Disabled

Digital Display:
These options are only considered if the Curve is part of a Poly Graph.
The following list describes the parameters in this section:

• Threshold: The threshold value at which to change the state


of the Curve.
• Above / Below: Enter the state for the Curve when value is
above and below the set threshold respectively.

Adjusting Channel Settings


The Output Channel Properties dialog for a particular Curve can be
accessed directly from the Curve Legend pop-up menu. Left double-
click on the desired Curve in the Curve Legend, or right-click the curve
and select Channel Settings....

Synchronizing Output Channel Limits with Those of the Graph


Once one or more Curves have been added to an Overlay Graph, all
corresponding Output Channel Min / Max Limits can be set equal to
the Graph y-axis minimum and maximum limits (Ymax and Ymin in
the Overlay Graph Properties dialog).

To synchronize Output Channel limits with the Graph, right-click over


the Overlay Graph and select Synchronize Channel Limits to Graph.

234 PSCAD User’s Guide


PSCAD

TRACES
PSCAD V4 now allows multiple signal Curves to be plotted online as a
single entity. Each individual ‘sub-curve’ in a multiple signal Curve is
referred to as a Trace. Each Trace in a Curve may be enabled or
disabled separately (i.e. shown or hidden).

Trace Drop Down Menu


Trace properties and control can be accessed through a special drop
down menu with a single left-click on the Curve title in the Curve
Legend.

Adjusting Trace Properties


Before adjusting any Trace properties, you must first invoke the Trace
Drop Down Menu as described above. The drop menu consists of four
separate columns, which each allow for easy access to certain Trace
properties. These columns are described below:

• Trace: Indicates the Trace number and corresponding colour


setting. The number corresponds to the array index number of
the multi-signal Curve. To change individual Trace colour, see
Adjusting Curve Properties in this chapter.
• A: The ‘A’ stands for ‘Active’. Select the radio button in this
column to select the Active Trace. The Active Trace properties
are set as described in Adjusting Curve Properties in this
chapter. The current Active Trace will always assume these
properties.
• V: The ‘V’ stands for ‘View’. Left-click the individual check
boxes in this column to hide/view individual Traces. You can
hide/view all Traces by left-clicking ‘V’ itself.

PSCAD User’s Guide 235


Chapter 5: Online Plotting and Control

• B: The ‘B’ stands for ‘Bold’. Left-click the individual check boxes
in this column to bold/unbold individual Traces. You can bold/
unbold all Traces by left-clicking ‘B’ itself.
• M: The ‘M’ stands for ‘Mode’. This function is only valid when
using Poly Graphs. Left-click the individual check boxes in this
column to change the Trace mode from digital to analog.
When in digital mode, the Trace will be displayed in a special
two-state format, where the state depends on whether it is
above or below a preset Threshold value. For more details on
setting Threshold and other digital properties see Poly Graphs
in this chapter.

POLYMETERS
A Polymeter is a special Runtime object used specifically for monitoring
multiple-Trace Curves (ex. a harmonic spectrum). The Polymeter
dynamically displays the magnitude of each individual Trace in bar type
format (called Gauges), which results in an appearance similar to a
spectrum analyzer. The power of this device lies in its ability to
compress a large amount of data into a small viewing area, which is
particularly helpful when viewing harmonic spectrums such as data
output from the On-Line Frequency Scanner (FFT) component.

Polymeters will appear as a


blank container (as shown
below) until the Project is
compiled and run.

The Polymeter is similar to the XY Plot in that it consists of a frame and


graph in a single object. Polymeters are special objects that cannot be
added directly from the toolbar, as with a Graph Frame for instance.
Each Polymeter is directly linked with a Curve from a single Output
Channel component.

236 PSCAD User’s Guide


PSCAD

Adding a Polymeter
Right-click on an Output Channel component within Circuit view of the
Design Editor and select Input/Output Reference | Add as Polymeter.

Right-click on a blank part of the Circuit canvas and select Paste to


insert the Polymeter.

Moving and Resizing a Polymeter


To move a Polymeter, move the mouse pointer over the title bar and
then left-click and hold. Drag the meter to where it is to be placed and
release the mouse button.

To resize, move the mouse pointer over the title bar and left-click to
select the Polymeter. Grips should then appear around the outer edge
as shown below.

PSCAD User’s Guide 237


Chapter 5: Online Plotting and Control

Move the mouse pointer over one of the grips. Left-click and hold and
then drag then move the pointer to resize.

Cut/Copy Polymeter
Right-click over the Polymeter title bar and select Cut or Copy
respectively.

Once a Polymeter has been cut or copied it may then be pasted to


another location in the Project.

Paste Polymeter
Cut or copy a Polymeter as described above. Right-click over a blank
area of the Project page in Circuit view and select Paste. A Polymeter
may be pasted multiple times.

Copy Polymeter as Meta-File/Bitmap


The entire Polymeter display can be copied to the Windows Clipboard in
either Meta-File (*.wmf) or Bitmap (*.bmp) format. Right-click over the
Polymeter title bar and select Copy as Bitmap or Copy as MetaFile. Go
to your report document and paste the image.

238 PSCAD User’s Guide


PSCAD

Adjusting Polymeter Properties


To access the Polymeter Properties dialog, left double-click the
Polymeter title bar, or right-click over the title bar and select Meter
Properties....

The properties available in this dialog are as described below:

• Title: Display only. The Polymeter title is set in the properties of


the associated Output Channel.

Appearance:

• Place a border around gauges: Select this option to place a


definite border around each individual Gauge in the Polymeter
display.
• Add index labels to gauges: Select this option to show
index labels directly below each Gauge in the Polymeter
display. The index number is corresponding array dimension
number of the Trace.
• Scroll display if required: Select this option to show add a
horizontal scroll bar to the Polymeter. Enabling this option
forces all Gauges to a default static width, and effectively
creates a viewing aperture for panning horizontally through the
display.

PSCAD User’s Guide 239


Chapter 5: Online Plotting and Control

Adjusting Channel Settings


The y-axis properties of the Polymeter are set in the corresponding
Output Channel Properties dialog. This dialog may be accessed directly
from the Polymeter by right-clicking over the Polymeter title bar and
selecting Channel Settings....

XY PLOTS
The XY Plot is a special type of Runtime object, which is composed of
both a Graph Frame and a single, specialized Graph window, for the
purpose of XY Plots allow plotting one Curve versus another. An XY Plot
can accommodate multiple Curves on each of the X and Y-axes, and
includes a Dynamic Zoom feature.

NOTE: Although the XY Plot is used to plot one signal versus another in
PSCAD, each of these simulated signals will be based on the same time
scale. Due to this fact, it is possible to create a time based plot window.
The XY Plot therefore includes a time domain Aperture Control Bar,
located at the bottom of the plot frame.

240 PSCAD User’s Guide


PSCAD

Adding an XY Plot
Open the Project in the Circuit window of the Design Editor. Right-click
on a blank portion of the page and select Add Component | XY Plot,
or press the XY Plot button in the Control Palette bar.

Moving and Resizing an XY Plot Frame


To move an XY Plot, place the mouse pointer over the title bar and then
left-click and hold. Drag the XY Plot frame to where it is to be placed
and release the mouse button.

To resize, place the mouse pointer over the title bar and left-click to
select the XY Plot frame. Grips should then appear around the outer
edge as shown below.

Adding an XY Plot
Open the project in the Circuit window of the Design Editor. Right-click
on a blank portion of the page and select Add Component | XY Plot,
or press the XY Plot button in the Control Palette bar.

Moving and Resizing an XY Plot Frame


To move an XY Plot, move the mouse pointer over the title bar and then
left-click and hold. Drag the plot frame to where it is to be placed
and release the mouse button.

To resize, move the mouse pointer over the title bar and left-click to

PSCAD User’s Guide 241


Chapter 5: Online Plotting and Control

select the plot frame. Grips should then appear around the outer edge
as shown below.

Move the mouse pointer over one of the grips. Left-click and hold
and then drag the pointer to resize.

Cut/Copy XY Plot Frame


Right-click over the XY Plot title bar and select Cut or Copy respectively.

Paste XY Plot Frame


Cut or copy an XY Plot as described above. Right-click over a blank
area of the Project page and select Paste. An XY Plot may be pasted
multiple times.

242 PSCAD User’s Guide


PSCAD

Copy Data to Clipboard


If a simulation has been run and your XY Plot contains Curve data, you
have the option of copying all or a portion of this data to the clipboard.

The data is copied as ‘Comma Separated Variables’ (*.csv) format for


easy migration into common data analysis software.

Two choices are given:

• All Data: Copies all curve data available.


• Visible Data: Copies all curve data visible in the plot
window.

Adjusting XY Plot Frame Properties


To access the Plot Frame Properties dialog, left double-click the plot
title bar, or right-click over the title bar and select Plot Frame
Properties....

PSCAD User’s Guide 243


Chapter 5: Online Plotting and Control

This should bring up the Plot Frame Properties dialog window.

244 PSCAD User’s Guide


PSCAD

There are various parameters that may be edited though this window,
each of which are described below.

• Name: Enter a name for the plot frame. This text will appear
in the plot title bar

Preferences:
• Show Glyphs: Select this option to show glyph symbols on all
curves in the graph.
• Show Ticks: Select this option to show major grid tick marks
along the x and y-axis intercept lines.
• Show Grid: Select this option to display grid lines for the x-
axis and y-axis major grids.
• Show Y-Intercept: Select this option to display the y-intercept
(horizontal) intercept line. The y-intercept is always at zero,
and cannot be adjusted.
• Show X-Intercept: Select this option to display the x-
intercept (vertical) intercept line. The x-intercept is always at
zero, and cannot be adjusted.

Markers:

• Show Markers: Select this option to show the X and O


markers.
• X Marker: Enter the position (in seconds) to place X marker.
• O Marker: Enter the position (in seconds) to place O marker.

Adjusting Plot Properties


Left double-click over the plot area (white part), or right-click over the
plot area and select Plot Properties....

PSCAD User’s Guide 245


Chapter 5: Online Plotting and Control

This should bring up the Plot Properties dialog window.

246 PSCAD User’s Guide


PSCAD

There are various parameters that may be edited though this window,
each of which are described below.

Preferences:

• Show Grid: Select this option to display grid lines for the x-
axis and y-axis major grids.
• Show Ticks: Select this option to show major grid tick marks
along the x and y-axis intercept lines.
• Show Intercepts: Select this option to display both intercept
lines (horizontal and vertical). The intercepts are always at
zero, and cannot be adjusted.
• Show Glyphs: Select this option to show glyph symbols on all
curves in the graph.
• Show Cross Hair: Select this option to invoke the Cross Hairs
mode.
• Auto Curve Colours: Select this option to use automatic
colouring of curves in the graph. You cannot change curve
colour manually when this option is selected.
• Invert Colours: Select this option to give the graph a black
background (instead of white or yellow).
• Snap Aperture to Grid: Select this feature so that when
using dynamic aperture adjustment, the aperture view will
snap to the major grid while zooming.
• Maintain Aspect Ratio: Select this option in order to
maintain the aspect ratio of the plotted curve (in both the x
and y directions) whenever the plot frame is resized. If this
option is disabled, the plotted curve will stretch or compress
according to the actual shape of the plot frame.

Trace Style:
• Primary Select whether to draw traces as Line or Scatter
view. Scatter view simply adds a single dot for each X-Y
coordinate.

PSCAD User’s Guide 247


Chapter 5: Online Plotting and Control

Aperture Settings (seconds):

• Position: Enter the starting position in seconds of the


aperture window.
• Width: Enter the width in seconds of the aperture
For more details on the window.
aperture, see the section
entitled ‘Dynamic Aperture
Adjustment’ in this chapter. Dynamic Zoom
See Dynamic Zoom in XY Plots in this chapter for more details.

DYNAMIC APERTURE ADJUSTMENT


The Dynamic Aperture Adjustment feature is available on both the
Graph Frame and the XY Plot Runtime objects and allows the user to
define a fixed time based display window (or aperture), and then
dynamically slide this aperture through the entire time scale. The
aperture size itself can be re-adjusted at any time.

Although the following example uses a Graph Frame, it may be easily


applied to the XY Plot as well. Run the simulation so that your Graph(s)
display the Curve data. The following image shows a simulation that
has been run for 0.5 s.

When using a Graph Frame,


at least one Graph must be
added first.

As can be seen from the Graph, the fault occurs around 0.25 s and lasts
for about 0.07 s. The Dynamic Aperture Adjustment feature can then
be used to close the viewing window to a smaller time width, so that
the fault waveforms can be more easily studied. To do this, move your
mouse pointer over the horizontal scroll bar at the far right so that the
mouse pointer turns into a double-headed arrow.

248 PSCAD User’s Guide


PSCAD

Click and hold the left mouse button and drag the scroll bar aperture
slowly to the left.

You should see your graph display dynamically adjusting as you change
the size of the scroll bar aperture. Watching the horizontal axis display,
shrink the aperture to an appropriate size (for the graph above, about
0.1 s or so).

Release the left mouse button and move the pointer over the scroll bar
aperture, click and hold the left mouse button again – the mouse
pointer icon should become a hand. Drag the mouse so as to scroll
across the time frame of the graph.

If desired, you can shrink the aperture further for even more detail. An
aperture will also be created automatically when you zoom into a
certain data range.

You may also use either the left and right arrow buttons at each end of
the scroll bar, or the arrow keys on your keyboard to scroll through data:

PSCAD User’s Guide 249


Chapter 5: Online Plotting and Control

To scroll in small increments, simply left-click the either arrow, for larger
increments hold down the Ctrl key and then left-click. When using the
arrow keys, make sure that the focus is on the Graph Frame being
viewed, as these keys can also function as a scroll mechanism for the
Circuit page.

Adjusting and Controlling the Aperture in XY Plots


As mentioned previously, the user is able to set and control the time
viewing window for the XY Plot. At the bottom of the XY Plot frame,
there is an area devoted solely for the adjustment and control of this
viewing window - otherwise known as the aperture.

This area contains two sections: The Dynamic Aperture Adjustment


and indicator scroll bar on the left, and the Manual Aperture
Adjustment field on the right.
You can increment the aperture width manually by pressing the up/
down arrows to the right of the Manual Aperture Adjustment field.

You may also set the aperture width to an exact value: With the
mouse pointer over the Manual Aperture Adjustment field, either left
double-click or right-click and select Control Settings....

Either of these actions should bring up the Spin Control dialog.

250 PSCAD User’s Guide


PSCAD

Enter the aperture width and scale in the Aperture and Increment
Scale fields respectively:
• Aperture: Enter the width of the aperture in seconds.
• Increment Scale: Enter the percentage of the total time
scale to increment the aperture window when manual up/
down arrows are pressed.

Press OK to save changes or Cancel to quit. If the aperture width


entered is a fraction of the total time scale for the plot, then the
aperture indicator scroll bar will reflect this by showing a smaller
aperture window:

You may now move the aperture window along the time axis,
maintaining its set width. To do this, move your mouse pointer over
the aperture indicator in the scroll bar and left-click and hold. Your
mouse pointer should become a hand symbol. Move the mouse left or
right along the axis.

The aperture position indicator at the bottom-right corner will indicate


the starting time of the aperture.

MARKERS
Markers are a special feature included in both Graph Frames and XY
Plots to help users with the analysis of their online data. Specifically,
Marker tabs
they are used to delineate the data so as to focus analysis to that

PSCAD User’s Guide 251


Chapter 5: Online Plotting and Control

specific range. Depending on Marker position, convenient legend


displays will indicate the difference between the two Markers in both
the x and y directions.

Markers are used only on the x-axis (time axis) and will appear as two
adjustable tabs. The Marker tabs are labelled as X and O and the
combination of the two set the specified boundaries. Once Markers are
set, analysis can be performed on the data contained within them.

Markers are used in a slightly different manner between Graph Frames


and XY Plots. Any differences are noted in the sections below.

Show/Hide Markers
There are a few ways to show or hide Markers:

• Select the desired Graph Frame or XY Plot with a left-click on


the graph display area. Right-click over the graph to generate
a pop-up menu and select Preferences | Show Markers.

252 PSCAD User’s Guide


PSCAD

• Left double-clickthe Graph Frame horizontal axis, or right-click


over the horizontal axis and select Axis Properties... to bring
up the Axis Properties dialog. Select the Show Markers
selection box.

• Left double-click an Overlay or Poly Graph, or right-click over


the Graph and select Graph Properties... to bring up the
Graph Properties dialog. Select the Show Markers selection
box.

If you are working with a Graph Frame, two tabs should appear along
the horizontal axis. Each marker tab, labelled X and O, correspond to
an x-axis (time) position.

If you are working with an XY Plot, an extra display bar will appear at
the bottom of the plot frame as shown below:

PSCAD User’s Guide 253


Chapter 5: Online Plotting and Control

Graph Frame Marker Legends


Once markers are enabled (shown) in a Graph Frame, legends will
appear on the right hand side of the frame itself.

Each Graph in the Graph Frame will have a legend directly to the right
of the Graph. The values displayed are specific to each Graph and are
described as follows:

• X: Displays the y-axis value at the X marker position for


the active curve.
• O: Displays the y-axis value at the O marker position for
the active curve.
• ∆: Displays the difference between the above two values.

The x-axis will also have its own legend where the values displayed are
similar to those described above, but for the x-axis.

XY Plot Marker Legends


Once Markers are enabled (shown) in an XY Plot, a Marker bar will
appear at the bottom of the Plot Frame.

254 PSCAD User’s Guide


PSCAD

As soon as either of these Markers is moved, marker legends will


appear directly to the right of each:

The values displayed are described as follows, specific to each Marker:

• x: Displays the Marker x-axis value for the active Trace.


• y: Displays the Marker y-axis value for the active Trace.
• T: Displays the Marker time-axis value for the active Trace.

Changing the Active Curve


The Markers will only monitor the Active Trace of one Curve at a time.
If multiple Curves exist in an Overlay or Poly Graph, you can scroll
through them by simply pressing the Space Bar on your keyboard. You
may also conveniently select the desired Curve in the Graph legend.
When using XY Plots, you must select the desired Curve in the graph
legend, as the Space Bar function is not available.

Adjusting Marker Positions


Once Markers are enabled, there are a few ways to adjust the Marker
positions:

• To manually adjust, place the mouse pointer over the marker


tab in either the graph frame or XY plot, left-click and hold
and drag it left or right. Release the left mouse button when
the Marker is in the desired position.

• When using Graph Frames, left double-click the Graph Frame


horizontal axis, or right-click over the horizontal axis and select
Axis Properties... to bring up the Axis Properties dialog.
Select the Show Markers selection box and then set the x-axis
values of each Marker directly in the input fields provided.

PSCAD User’s Guide 255


Chapter 5: Online Plotting and Control

• When using XY plots, left double-click the plot, or right-click


over the plot (white background) and select Plot Properties...
to bring up the Plot Properties dialog. Select the Show
Markers selection box and then set the time-axis values of
each marker directly in the input fields provided.

Toggle Time Difference Frequency/Delta


Once the Markers are enabled, you can conveniently invert the time
axis difference between the two Markers to display corresponding
frequency. Left double-click the Graph Frame horizontal axis, or right-
click over the horizontal axis and select Toggle Frequency/Delta (or
press the F key on your keyboard):

This feature is not available in XY plots.

256 PSCAD User’s Guide


PSCAD

Locking/Unlocking Markers
Locking will force the two Markers to maintain a constant distance
between each other when they are moved along the x-axis. Left
double-click the Graph Frame horizontal axis, or right-click over the
horizontal axis and select Toggle Marker Lock-Step (or press the L key
on your keyboard) to lock the Markers. Perform the same operation
again to unlock.

Setting Markers
Markers can be set to a certain position on the Graph Frame time axis
as follows: Left-click on the axis at the approximate position where you
wish to place the X Marker. Press the X key on your keyboard. Repeat
this procedure to set the O Marker, except press the O key.

Instead of pressing the above keys, you can also use the time axis pop-
up menu. Left-click on the Graph Frame time axis at the approximate
position where you wish to place a Marker, then select the appropriate
menu function.

PSCAD User’s Guide 257


Chapter 5: Online Plotting and Control

Using Markers as Bookmarks


If only a fraction of the total Graph Frame time scale is currently being
viewed in a Graph, the Markers may appear outside the viewing frame
when they are first enabled. If this happens, blue and red arrow
symbols will appear on the time axis indicating the markers are set off
the screen.

The current viewing window can be moved directly to the position of


either Marker: Simply left-click either the blue or the red arrow (blue
for the X Marker and red for the O Marker). This functionality, along
with setting the Markers, can be used to ‘bookmark’ viewing positions
on the Graph.

PREFERENCES
Plotting preferences can be adjusted from either the Graph or XY Plot
pop-up menus (depending on which one you are using). Simply right
click over a Graph or XY Plot to bring up the corresponding pop-up
menu. Then, select Preferences.

258 PSCAD User’s Guide


PSCAD

The functions available in this menu are described below:


• Grid Lines: Select this preference to toggle grid line display
on the selected graph. You can also use the G keyboard
shortcut.
• Tick Marks: Select this preference to show major grid tick
marks along the y-intercept. You can also use the I keyboard
shortcut.
• Curve Glyphs: Select this preference to show glyphs on all
curves in the graph. You can also use the K keyboard shortcut.
• Show Markers: Select this preference to show the markers.
You can also use the M keyboard shortcut.
• Show Y Intercept: Select this preference to display the y-
intercept (horizontal) intercept line. The y-intercept line can be
adjusted using the Y-Intercept field in the Graph Properties
dialog. On XY plots, the y-intercept is always along the x-axis.
You can also use the W keyboard shortcut.
• Show Cross Hair: Select this preference to invoke the Cross

Many of the above preferences can be set within the various dialog
windows involved with graphs and XY plots.

ZOOM FEATURES
Once a simulation has been run and EMTDC output data has been
collected, there are several ways to zoom in and out of the data
displayed. The following are some of the more common methods.
General Zoom In and Zoom Out
Select the desired Graph or XY Plot with a left-click on the graph display
area. Right-click over the graph to generate a pop-up menu and select
Zoom | Zoom In or Zoom | Zoom Out.

PSCAD User’s Guide 259


Chapter 5: Online Plotting and Control

As an alternative, you can also use the + or – keyboard shortcuts for


Zoom In or Zoom Out, respectively (once the desired graph has been
selected).

Box Zoom
Select the desired Graph or XY Plot with a left-click on the Graph display
area. Click and hold the left mouse button and drag the mouse pointer
to create a boxed region. Release the left mouse button to zoom to
that region.

You can also zoom along a


single axis by drawing out a
narrow box. The zoom will
ignore the narrow side of
the box.

Vertical Zoom
Select the desired Graph or XY Plot with a left-click on the Graph
display area. Press Shift + left mouse hold and drag the mouse

260 PSCAD User’s Guide


PSCAD

pointer in a vertical direction (i.e. up or down along the y-axis) to


create a vertical zoom region. Release the left mouse button to zoom
to that region.

Horizontal Zoom
Select the desired Graph or XY Plot with a left-click on the graph display
area. Press Ctrl + left mouse hold and drag the mouse pointer in a
horizontal direction (i.e. left or right along the x-axis) to create a
horizontal zoom region. Release the left mouse button to zoom to that
region.

Zoom Previous/Next
Select the desired Graph or XY Plot with a left-click on the graph display
area. Right-click over the graph to generate a pop-up menu and select
Zoom | Previous or Zoom | Next.

PSCAD User’s Guide 261


Chapter 5: Online Plotting and Control

As an alternative, you can also use the P or N keyboard shortcuts for


Zoom Previous or Zoom Next respectively (once the desired graph has
been selected).

Zoom Extents
The Zoom Extents feature allows the user to zoom to the extents of the
plotted data. The data ‘extents’ refers to the absolute maximum and
minimum values that exist during the entire simulation run, in either the
X or Y direction.

Select the desired Graph or XY Plot with a left-click on the graph display
area. Right-click over the graph to generate a pop-up menu and select
either Zoom | X Extents or Zoom | Y Extents.

As an alternative, you can also use the X or Y keyboard shortcuts for


Zoom X Extents or Zoom Y Extents respectively (once the desired graph
has been selected).

Zoom Limits
The Zoom Limits feature allows the user to zoom to predefined limits in
either the X or Y direction. The y-axis limits are set based on the
Default Display Limits inputs in the corresponding Output Channels for
the Curves. In the event of multiple Curves, the limits are based on the
largest and smallest Default Display Limits among all relevant Output
Channels. The x-axis limits are based on the desired duration of the
simulation.

262 PSCAD User’s Guide


PSCAD

Select the desired Graph or XY Plot with a left-click on the graph display
area. Right-click over the graph to generate a pop-up menu and select
either Zoom | X Limits or Zoom | Y Limits.

As an alternative, you can also use the E or U keyboard shortcuts for


Zoom X Limits or Zoom Y Limits respectively (once the desired graph has
been selected).

Resetting All Extents and Limits


Select the desired graph or XY plot with a left-click on the graph display
area. Right-click over the graph to generate a pop-up menu and select
either Zoom | Reset All Extents or Zoom | Reset All Limits.

As an alternative, you can also use the R or B keyboard shortcuts for


Reset All Extents or Reset All Limits respectively (once the desired graph
has been selected).

Dynamic Zoom in XY Plots


Dynamic zoom is a feature specific to the XY Plots. Left click and
hold with your mouse pointer over the dynamic zoom control bar as
shown below:

With a left click, your mouse pointer should become an open hand.
Hold down the left mouse button and move the hand down to zoom in,
or up to zoom out.

PSCAD User’s Guide 263


Chapter 5: Online Plotting and Control

CROSS HAIR MODE


Once a simulation has been run and EMTDC output data has been
collected, you can trace through Curve values using Cross Hairs. Right-
click over the Graph or XY Plot to generate a pop-up menu and then
select Preferences | Show Cross Hair. You can also select the Graph
or XY Plot and press the C key on your keyboard.

Once Cross Hair mode is enabled, move the mouse pointer over the
graph and left-click and hold. Drag the mouse along the Graph. If
multiple Curves exist in the Graph, then you can move the Cross Hair
from Curve to Curve by simply pressing the Space Bar on your
keyboard.

As shown above, the Curve XY data will be displayed beside the cross
hair. When your left mouse button is released, the Cross Hairs will
disappear, but Cross Hair Mode will remain invoked until you press the
C key again (or select Preferences | Show Cross Hair).

In XY plots, the Cross Hairs follow the mouse pointer only.

ONLINE CONTROLS AND METERS


As mentioned earlier, special objects in PSCAD allow the user online
access to EMTDC input variables, so that these variables (and hence
the simulation results) can be altered during the course of the
simulation run. These objects and how to use them are described in
the following sections.
Control Panels
A Control Panel is a special component used for accommodating control
or meter interfaces and can be placed anywhere in a project page.
Once a Control Panel has been added, you may then proceed to add as
many Control or Meter Interfaces to it as you wish

264 PSCAD User’s Guide


PSCAD

Adding a Control Panel


Open the Project in the Circuit window of the Design Editor. Right-click
on a blank portion of the page and select Add Component | Control Control Panel Button
Panel, or press the Control Panel button in the Control Palette bar.

Moving and Resizing a Control Panel


To move a Control Panel, move the mouse pointer over the title bar and
then left-click and hold. Drag the frame to where it is to be placed
and release the mouse button.

To resize, move the mouse pointer over the title bar and left-click to
select it the Control Panel. Grips should then appear around the outer
edge as shown below.

Move the mouse pointer over one of the Grips. Left-click and hold
and then drag then move the pointer to resize.
Cut/Copy Panel
Right-click over the Control Panel title bar and select Cut or Copy
respectively. You can also use the standard Ctrl + X or Ctrl + C.

PSCAD User’s Guide 265


Chapter 5: Online Plotting and Control

Once a Control Panel has been cut or copied it may then be pasted into
another location in the Project (along with its contents).

Paste Panel
Cut or copy a Control Panel as described above. Right-click over a
blank area of the project page and select Paste. A Control Panel may
be pasted multiple times.

Adjusting Panel properties


To access the Control Panel Properties dialog, left double-click the
Control Panel title bar, or right-click over the title bar and select Control
Panel Properties....

Presently the only adjustable panel property is the Caption:

Caption: Enter a name for the Control Panel. This text will appear in
the Control Panel title bar.

Control Interfaces
A Control Interface is just as its name describes: An interface object,

266 PSCAD User’s Guide


PSCAD

which allows manual adjustment of an EMTDC data input variable by


the user.

A Control Interface must first be linked with one of the control


component types available in the Master Library. The Control Interface
will then control the output of the linked control component. For
example, the following image shows a Slider component linked to a
control interface in a control panel.

Adding a Control Interface to a Control Panel


There are two methods to accomplish this:

• Drag and Drop: Hold down the Ctrl key, left-click and hold
the associated control component (i.e. Slider, Dial, Switch or
Push Button)and drag and release over the Control Panel. See
Drag and Drop in Chapter 4 for more details.
• Right-click on the associated control component (i.e. Slider,
Dial, Switch or Push Button) and select Input/Output
Reference | Add as Control. Right-click over the desired
Control Panel title bar and select Paste.

Of course, each type of control component will have a different control


interface when added to a control panel. The following figure shows
the available control components and their corresponding control
interfaces:

PSCAD User’s Guide 267


Chapter 5: Online Plotting and Control

Control Interface Order


Once multiple Control Interfaces have been added to a particular
Control Panel, you may change the order in which they appear. Right-
click over the Control Interface title bar to be moved and select Set
Control Order. Then select one of the following:

• Move Left
• Move Right
• Left Most
• Right Most

Cut/Copy Control Interface


Right-click over the Control Interface title bar and select Cut or Copy,
respectively.

268 PSCAD User’s Guide


PSCAD

Once a Control Interface has been cut or copied it may then be pasted
into control panel in the project.

Paste Control Interface


Cut or copy a Control Interface as described above. Right-click over a
Control Panel title bar and select Paste. A Control Interface may be
pasted multiple times.
For a description of these
Adjusting Control Interface Properties properties, see the relevant
Control Interface properties and the corresponding control component control component in the
properties are one and the same. Therefore, you can either adjust these PSCAD Online Help.

properties through the control component directly, or through the


Control Interface as follows: Left double-click the Control Interface title
bar, or right-click over the Control Interface title bar and select Channel
Settings....

Using the Control Interfaces


Once a particular Control Interface has been added to a Control Panel,
the user may operate manually, either before or during a simulation run.
Of course, each Control Interface (and control component) will perform
a different operation on its corresponding output signal.

Switch and Push Button Components:

To operate either the Switch or Push Button components, simply left-


click over top on the Control Interface itself. For example, each time
the Switch Interface is clicked, it will toggle the corresponding Switch
component between its two output states.

The image below shows a plot of a Switch component output, where


the user has changed its state (i.e. turned it on and off) during a 1.0
second simulation run.

PSCAD User’s Guide 269


Chapter 5: Online Plotting and Control

Dial Component:

To operate the Dial component, left-click and hold on the slider control
knob and move the knob up or down. As the control knob is moved,
the Dial interface will indicate graphically, which of the multiple states is
currently being output from the corresponding Dial component.

The image below shows a plot of a Dial component output, where the
user has changed its state during a 1.0 second simulation run.

Slider Component:

The Slider component is operated in the same manner as the Dial


interface described above. The only difference is that the Slider output
does not operate in discrete states, but provides a continuously variable
output.

The image below shows a plot of a Slider component output, where the
user has varied its output during a 1.0 second simulation run.

It is important to note that the Slider component will output exactly


what is shown on the Slider interface. The Slider interface has a

270 PSCAD User’s Guide


PSCAD

maximum precision of 6 significant digits. If more precision is required,


you can add successive Slider outputs together, each handling different
data ranges. Once you have fine-tuned the Slider output, you can
replace it with a Real Constant component, which is capable of higher
precision.

The Slider interface also allows you to enter an exact value (up to 6
significant digits) directly into its display window. Simple left double-
click on the display window and then enter the data. Press the Enter
button to exit and save the entered data, or press Esc to exit without
saving changes.

Meters
A meter is similar to a graph, in that it is used for displaying an EMTDC
output signal and is linked to a corresponding Output Channel. Instead
of displaying the signal as a curve trace (as a graph would), the signal is
used to operate a realistic meter display, with a pointer position
proportional to the signal magnitude. For example, the following image
shows an Output Channel component linked to a meter in a control
panel.

PSCAD User’s Guide 271


Chapter 5: Online Plotting and Control

Meters can exist only within a control panel.

Like a Slider interface, meter interfaces display a maximum of 6


significant digits. Twelve significant digits can be viewed with a flyby
window.

Adding a Meter to a Control Panel


There are a couple of methods to accomplish this:

• Drag and Drop: Hold down the Ctrl key, left-click and hold
the associated Output Channel component and drag and
release over the Control Panel. See Drag and Drop in Chapter
4 for more details.
• Right-click on the associated Output Channel component and
select Input/Output Reference | Add as Meter. Right-click
on the desired control panel title bar and select Paste.

Meter Order
Once multiple meters have been added to a particular Control Panel,
you may change the order in which they appear. Right-click over the
meter title bar to be moved and select Set Control Order. Then select
one of the following:

• Move Left
• Move Right
• Left Most
• Right Most

272 PSCAD User’s Guide


PSCAD

Cut/Copy Meter
Right-click over the meter title bar and select Cut or Copy, respectively.

Once a Meter has been cut or copied, it may then be pasted into any
control panel in the project.

Paste Meter
Cut or copy a Meter as described above. Right-click over a Control
Panel title bar and select Paste. A Meter may be pasted multiple times.

Adjusting Meter Properties


Meter properties and the corresponding Output Channel properties are
one and the same. Therefore, you can either adjust these properties
through the Output Channel directly, or through the meter as follows:
Left double-click the Meter title bar, or right-click over the title bar and
select Channel Settings....

GROUPING OF RUNTIME OBJECTS


It is possible to organize both Control (i.e. Slider, Dial, Switch or Push
Button) and Output Channel Runtime objects according to a Group
Name. Once Group Names have been specified, these objects may be
viewed according to their Group Name in the Workspace Runtime
Section.

Creating a Runtime Object Group


See the section entitled The
Creating a Runtime Group is straightforward: All that is required is that Workspace in Chapter 3 for
a Group Name be added to the object input Parameter called Group. more on runtime groups.
The image below shows the Group parameter in the Slider parameters
dialog.

PSCAD User’s Guide 273


Chapter 5: Online Plotting and Control

For example, consider the following Project page, where the user
wishes to group existing Control objects according to function:

Both the ‘Firing Angle’ Slider and ‘Enable/Disable’ Switch controls are
grouped under the name Firing Control, where as the two Output
Channels ‘Volts’ and ‘Amps’ are grouped under the name

274 PSCAD User’s Guide


PSCAD

Monitoring. These objects are automatically organized by PSCAD for


viewing in the Workspace Runtime Section.

Viewing Runtime Object Groups


For details on viewing Runtime objects according to Group Name, see
the section called The Workspace in Chapter 3.

FRAME/PANEL MINIMIZATION
All Graph Frames, Control Panels, Polymeters and XY Plot Frames can
be minimized in order to reduce clutter and save space when viewing
data. This feature is similar to the PSCAD V3 feature ‘Iconify Plot’,
however additional functionality has been added to make the
minimization process more intuitive.

Minimizing a Frame/Panel is accomplished simply by clicking the


Minimize button in the top right-hand corner:

The Frame/Panel can then be restored by clicking the Restore button in


the right-hand corner:

PSCAD User’s Guide 275


Chapter 5: Online Plotting and Control

Icons appear at the left of the minimized objects so that the different
types of the Frame/Panels can be identified. A summary of these icons
is given below:

• Graph Frame
• Control Panel
• Polymeter
• XY Plot

Moving and Organizing Minimized Frames/Panels


Once a Frame/Panel has been minimized, the minimized object can be
moved in a similar fashion as a restored Frame/Panel. Simply left-click
and hold the minimized object and drag it to wherever it needs to be
placed on the canvas.

The power in using minimized Frame/Panels for organization is that


PSCAD remembers the last position of the object before it is minimized/
restored. Therefore, it is possible to ‘stack’ the minimized objects to
optimize space, yet when any of the objects are restored, they will
appear in the same position as they were before being minimized. The
reverse is true as well.

DISPLAYING PLOTS AND CONTROL IN REPORTS


Any plotting or control object (i.e. Graph Frames, Graphs, XY Plots,
Control Panels, Meters, etc.) may be copied to the Windows clipboard
for inclusion in reports or other documents. Options are provided to
store the objects as either a picture in bitmap format (*.bmp),
orWindows Meta-File format (*.wmf). Note that meta-file format is
limited to the current screen size. Use bitmaps for larger graphs.

Setting Panel Style


You can change the panel style of all Graph Frames, XY Plots and
Control Panels in the Workspace Settings dialog, before including them
in reports. To access the Workspace Settings dialog, go to Edit |
Workspace Settings... in the Main Menu bar.

Copy as Meta-File or Bitmap


Right-click over the plotting or control object and select Copy <object>
as Meta-File or Copy <object> as Bitmap from the pop-up menu.
Depending on the object selected, the <object> part of the command
will be replaced by the object type.

276 PSCAD User’s Guide


PSCAD

You may then go directly to a report document and paste the image,
while it is still in the Windows clipboard.

PSCAD User’s Guide 277


Chapter 5: Online Plotting and Control

278 PSCAD User’s Guide


PSCAD

Chapter 6:

Project Settings
Most features and settings related directly to the control of the actual
simulation in PSCAD are contained in the Project Settings dialog.
Important parameters, such as total simulation time and time step, are
included here along with more advanced, Project specific PSCAD and
EMTDC features and processes.

This dialog can be accessed through a right-click on the project title


itself (either a case or a library) in the Workspace window, and
selecting Project Settings... from the pop-up menu.

The features and parameters available in the Project Settings dialog


control window are divided into seven specific areas:

• General
• Runtime
• Network
• Dynamics
• Mapping
• Fortran
• Link

PSCAD User’s Guide 279


Chapter 6: Project Settings

As mentioned above, there are a number of more advanced features


available for the enhancement of speed, accuracy and efficiency of
simulations performed in PSCAD. The Project Settings dialog gives the
user access and control of most of these features. Many users need not
concern themselves with these and should leave most Project Settings
The Project Settings window to their default. However, there may be some instances where more
for a library project contains advanced users would wish to disable and enable some processes at
only a few of the
parameters that appear for a their discretion.
case project, as simulations
cannot be performed on a
library project. GENERAL
The properties contained within the General section of the Project
Settings dialog control window are related to Project naming and
version tracking. These are explained in detail in the sections below.

280 PSCAD User’s Guide


PSCAD

Description
This field allows for the entry of a single-line description of the Project.
This description will be displayed beside the Project filename in the
Workspace Viewer. Do not use quotes (“) and apostrophes (‘) in this
field.

File Path
File Path displays the path and filename information for the Project. This
field is for display only and cannot be changed through the Project
Settings dialog.

Persist As
Persist As displays the Project filename. This field is for display only and
cannot be changed through the Project Settings dialog.

Revision Tracking
These settings display particular information regarding the Project
revision history.

File Version
This is the PSCAD version used to create the project.

PSCAD User’s Guide 281


Chapter 6: Project Settings

First Created
This is the date and time at which the project was first created.

Last Modified
This is the date and time at which the project last modified.

Author
This is the name (userid) of the person who created and/or modified the
project.

RUNTIME
The properties contained within the Runtime section of the Project
Settings dialog control window are the most commonly accessed project
parameters. These are explained in detail in the sections below.

282 PSCAD User’s Guide


PSCAD

Time Settings
These settings are very important and are used quite often in every day
simulation studies.

Duration of Run (sec)


This is the total length of the simulation run, entered in seconds. If you
start from time zero, this is the finish time of the run. If you start from
a snapshot file (pre-initialized state), this is the length of run from the
snapshot time.

Solution Time Step (us)


This is the EMTDC simulation time step, entered in microseconds. The
default is 50 µs, which is an optimum step for most practical circuits.
However, users should make sure that the time step selected is suitable
for their simulation. This input sets the value of the EMTDC internal
variable DELT.

Channel Plot Step (us)


This is the time interval at which EMTDC sends data to PSCAD for
plotting as well as writing data to Output Files. It is always a multiple
of the EMTDC simulation time step. Usually a 1000 µs plot step
provides a reasonable resolution and speed.

Lower sampling intervals (higher sampling rate) can considerably slow


down the simulation speed due to an excessive transfer of data from
EMTDC to PSCAD (without adding much to the plot resolution). Users The plot step can be
can experiment with this number for a given Project. If the sampling modified during a run (or
interval is too large, the waveforms may appear ‘choppy’. If you are after starting from a
snapshot). You can change
debugging the case, it is a good practice to plot every point in the the value from the Project
simulation, that is, plot sampling time as equal to EMTDC simulation Settings dialog or from the
Settings bar.
time step.

PSCAD User’s Guide 283


Chapter 6: Project Settings

A trap that even the most experienced engineers can readily fall into is
the setting of plot step too broad with respect to the level and period of
noise in the signal. If a signal is periodic at a frequency similar to the
plot step interval, the perceived output may be quite different to the
actual signal. As a basic rule: If you are puzzled by the results
observed from a plotted simulation output, run the case with the plot
step equal to the EMTDC time step and compare the results.

Start-up Method
There are two ways to start a simulation in PSCAD: The standard
method (i.e. from time = 0.0 seconds) and from a Snapshot File.

See the EMTDC User’s


Guide for more details on
initialisation and snapshot
files.

Standard
The standard method to start an EMTDC case is to simply start from an
un-initialized state (i.e. from time t = 0.0). This is how simulations are
started most of the time.

From Snapshot File


There may be instances when you would like to start your simulation
from a pre-initialised state. Although initial conditions are not yet
available as direct entry into certain components, it is possible in
PSCAD to run a case to a steady state and then to take a snapshot at a
When you start from a
certain instant during the run. All relevant network data will be saved
Snapshot File, make sure to a snapshot file, from which you may start your case already pre-
that you have not altered
the circuit from which the
initialised.
snapshot was taken,
otherwise an error may An input field is included directly beside this field called Input File.
occur.
Enter a name for the snapshot file to be used here. See Starting from
a Snapshot in Chapter 4 for more details on how to create and start
from a snapshot file.

Save Channels to Disk?


You can save all Output Channels in your project to a file for post
processing. Output files are saved in standard ASCII format and all
data is stored in columnar format in steps of time according to the set
plot step.

284 PSCAD User’s Guide


PSCAD

An input field is included directly beside this field called Output File.
Enter a name for the Output File here.

Timed Snapshot
There are two ways to utilize a snapshot file: Single and incremental
snapshots.

An input field is included directly beside this field called Snapshot File.
Enter a name for the snapshot file to be created here. Another input
field is included called Time. Enter the time in seconds at which the
snapshot is to be taken.

Single (Once Only)


A single snapshot will be taken at the time specified in the Time field.

Incremental (Same File)


An incremental snapshot in the same file will take the first snapshot at
the specified time and subsequent snapshots at equal intervals equal to
this time. The snapshot file will be over-written every time to save disk
space and you will end-up with only one file from the last interval.

Incremental (Many Files)


If you would like to save all Snapshot Files, select this option. You can
save up to 99 distinct snapshots. If the number of files exceeds 99, the
names will be reused starting from the beginning.

The file naming convention is:

base_name_##.snp

PSCAD User’s Guide 285


Chapter 6: Project Settings

You are required to provide only the ‘base_name’ (in the Snapshot File
field). The extension will be added automatically.

Multiple Run
There are currently two different methods for performing multiple runs in
Current Run Number
PSCAD – this is simpler and most basic of the two. This method is used
in conjunction with the ‘Current Run Number’ and ‘Total Number of
Total Number of Multiple Runs’ components, which are available in the PSCAD Master
Multiple Runs Library.

EXAMPLE 6-1:

Consider the simple comparator below. The Multiple Run parameter is


enabled from the Project Settings dialog and set to 10 runs.

The other multiple run


method involves the
‘Multiple Run’ component,
which is available in the
PSCAD Master Library. DO
NOT enable this multiple
run feature when using the
Multiple Run component.

In this case, the comparator output is set to go low (0) when input A is
less than or equal to 1.0 (i.e., the last two runs).

An additional input field is included directly beside this field called


Output File. Enter a name for the Multiple Run Output File to be

286 PSCAD User’s Guide


PSCAD

created here. Another input field is included called # runs. Enter the
total number of runs here (this value is used to set the Total Number of
Multiple Runs component).

Miscellaneous
The remaining Runtime parameters are outlined below:

Remove Time Offset When Starting From a Snapshot


This parameter is used in correlation with starting the simulation from a
snapshot file. Enabling this parameter will force the initial start time
on all plots to display a 0.0 start time - regardless of what time the
snapshot was taken. If disabled, the initial start time will be displayed
the time at which the snapshot file was created.

EXAMPLE 6-2:

A user runs a case project to steady state, and then takes a snapshot
at 0.5 seconds. The user then re-starts the simulation from the
snapshot file created, and sets the Duration of Run to 0.05 s.

If Initial Start Time Always Zero is enabled the simulation run will be
displayed from 0.0 to 0.05 seconds. If disabled, from 0.5 to 0.55
seconds.

It is important to note here that this option changes displayed start


time only. That is, if you are controlling breakers or faults for example,
you must use the actual time. In Example 6-2 above, if the user
wanted to open a breaker 0.01 seconds after starting from the
snapshot, the breaker logic must indicate 0.51 seconds (not 0.01
seconds).

Send Only the Output Channels that are In Use


Selecting this option will essentially turn off all Output Channels that
are not being plotted in Graphs, or monitored in Meters. Enabling this
option has the potential to greatly reduce the amount of storage for
the simulation, as well as a slight simulation speed improvement.

PSCAD User’s Guide 287


Chapter 6: Project Settings

Start Simulation Manually to Allow Use of an Integrated


Debugger
This option allows you to start a PSCAD run that can be connected with
a manually started EMTDC case. See Using an Integrated Debugger in
Chapter 10 for more details.

NETWORK
The properties contained within the Network section of the Project
Settings dialog control window are related to the EMTDC Electric
Network Solution and diagnostics. These are explained in detail in the
sections below.

288 PSCAD User’s Guide


PSCAD

Process Communication
The input parameters involved here are outlined below.

Allow Simulation to Run Ahead at Most


This parameter controls the maximum amount of time (in time steps),
by which EMTDC is allowed to run ahead of the PSCAD display.
Adjusting this parameter can have the following implications:

If the run-ahead time is too small, PSCAD will hold EMTDC back and
the overall simulation speed will be reduced.

If the run-ahead time is too large, interactive control actions (such as


resetting a slider value or pushing a button) are potentially conveyed to
EMTDC with a maximum delay equal to this margin.

Run-ahead time is something users can optimize based on the case and
has no implication on the accuracy of simulation. The default value of
100 steps is a good compromise.

Network Solution Accuracy


The following input parameters can affect solution speed.

Interpolate Switching Events to the Precise Time


To account for inter time step switching of switching devices (i.e. those
components whose electrical properties change during a run), the See the EMTDC User’s
Guide for more details on
EMTDC Electric Network Solution uses an interpolation algorithm in Interpolating the Network
order solve at the exact switching instant. This is the default behaviour Solution.
of EMTDC and is essential for the accurate simulation of frequently
switching devices, (such as FACTS models).

PSCAD User’s Guide 289


Chapter 6: Project Settings

Use Ideal Branches for Resistances Under


The Ideal Branch algorithm allows for zero resistances and true infinite
bus voltage sources in EMTDC.

With this option enabled, you can create an infinite bus by either
entering a value less than the threshold (set in the threshold field
directly to the right of this check box) or 0.0 Ω for the source
resistance. Similarly, for a zero resistance branch, enter a value less
than the threshold or 0.0 Ω for the ON resistance of a diode, close
resistance of a breaker, etc.
See the EMTDC User’s
Guide for more details on
the Ideal Branches The default threshold value is preset to 0.0005 Ω. As this algorithm
algorithm. involves extra computations and so a non-zero value greater than this
threshold is recommended, unless ideal like results are paramount.

Numerical Chatter Suppression


The following input parameters are related to the detection and
removal of numerical oscillations called chatter.

See the EMTDC User’s


Guide for more details on
chatter detection and
removal.
Detect Chatter that Exceeds the Threshold
Chatter is a numerical oscillation phenomenon inherent to the
trapezoidal integration method used in EMTDC, and is usually caused
by sudden network disturbances (either voltage or current). EMTDC
continuously looks for chatter and removes it if required.

An input field is included directly beside this option. Enter a threshold


value for chatter detection, below which chatter will be ignored (the
default is 0.001 p.u.).

Suppress Effects When Detected


When chatter is detected, a chatter suppression procedure is invoked
if this option is enabled.

290 PSCAD User’s Guide


PSCAD

Diagnostic Information
The following input parameters are important during the debugging
process of your simulation project and are recommended for more
advanced users.

See the Chapter 10 for more


Echo Network and Storage Dimensions details on manually
debugging your project.
Prints network and storage array dimensions into the Output window
for debugging purposes.

Echo Runtime Parameters and Options


Prints runtime options into the Output window for debugging purposes.

Echo Input Data While Reading Data Files


Prints all the data read from the Data File and Map File into the Output
Window for debugging purposes.

DYNAMICS
The properties contained within the Dynamics section of the Project
Settings dialog control window are related to the EMTDC System
Dynamics. These are explained in detail in the sections below.

PSCAD User’s Guide 291


Chapter 6: Project Settings

Signal Storage
The input parameters involved here are outlined below.

Flyby information will not be


available if this parameter is
enabled. Select this option
first before using Flybys. See Store Feed Forward Signals for Viewing
Using Flyby Help Windows
in Chapter 4 for more
When a project is compiled, all System Dynamics variables (signals) are
details. by default written to, and extracted from, internal storage locations
each time step. This of course can decrease simulation speed
proportionally to the number of existing feed-forward variables.

292 PSCAD User’s Guide


PSCAD

When Store Feed Forward Signals for Viewing is enabled, only those
variables that have been flagged by the PSCAD pre-compiler as
feedback paths (i.e. are used in the following time step) are
transferred to storage locations. All other variables remain as
temporary and are discarded at the end of each time step.

EXAMPLE 6-3:

In the control system shown below, there will be a total of four


variables that will be created when the project is compiled. Three are
feed-forward variables (indicated by the ), and one is a feedback
variable (indicated by an ).

Users can display these


symbols at any time by
enabling the Show Signal
Locations parameter within
this dialog.

If Store Feed Forward Signals for Viewing is disabled, all four variables
will be written to storage every time step, even though only the
feedback variable is needed between time steps.

Signal Flow
The input parameters involved here are outlined below.

PSCAD User’s Guide 293


Chapter 6: Project Settings

Compute and Display Flow Pathways on Control Wires


Select this option to show signal flow direction on control signals Wires
(i.e. Wires carrying REAL, INTEGER or LOGICAL data types). See
Control Signal Flow Indicators in Chapter 10 for more details on this.

MAPPING
The properties contained within the Mapping section of the Project
Settings dialog control window are related to the EMTDC Network
Solution conductance matrix optimization. These are explained in
detail in the sections below.

Matrix Optimizations
The input parameters involved here are outlined below.

294 PSCAD User’s Guide


PSCAD

Optimize Node Ordering to Speed Up Solution


Optimize Node Ordering is a PSCAD based algorithm, which re-
numbers nodes in the EMTDC Electric Network conductance matrix, so
as to optimize solution speed. The electric network conductance
matrix is optimized using a Tinney algorithm to exploit matrix sparsity.
For more information on matrix optimization, please see PSCAD
References [7], [8], [9] and [10].

Split De-coupled Networks into Separate Matrices


Matrix solution methods can be intensive, requiring a large amount of
computing power, especially if frequently switching branches are
involved. If this option is enabled, larger networks will be reduced into
smaller sub-networks (or subsystems).

Once the main electric network has been split into subsystems, each
subsystem can then be solved independently. Say for example a large
FACTS device (with many frequently switched branches) is located
within its own subsystem, but part of a much larger network. By See the EMTDC User’s
Guide for more details on
splitting the main network into subsystems, only the local subsystem, subsystem splitting.
housing the FACTS device, need be resolved when a switching event
occurs. The speed benefits here can be tremendous.

In PSCAD V3, a well-known shortcoming of the subsystem splitting


algorithm was that the main project page could not contain any
electrical nodes. In PSCAD V4, this problem has been resolved.

Move Switching Devices to Speed Up Solution


Frequently switching branches are identified and re-ordered, so as to
optimize conductance matrix re-triangularization following a change in
branch conductance (a switch). The switch-ordering algorithm splits
nodes into two types:

1. Nodes not attached to switching elements or nodes that have


switching elements connected, but do not switch frequently
(i.e. breakers and faults).

PSCAD User’s Guide 295


Chapter 6: Project Settings

2. Nodes that have switching elements connected that switch


frequently (i.e. thyristor, GTO, IGBT, diode, arrester, Variable
RLC, etc.).

Electrical Connections in
user-defined components
The switch-ordering algorithm moves the frequently switched nodes
are set as node type 2 by (i.e. type 2) to the bottom of the conductance matrix. The benefits to
changing the electrical
Connection type to
EMTDC solution speed are proportional to the number of nodes and
‘Switched’. See Chapter 8 the number of switching branches in a given Eelectric network. For
for more details. more information on matrix optimization, please see PSCAD
References [7], [8], [9] and [10].

FORTRAN
The parameters contained within the Fortran section of the Project
Settings dialog are used for the control of Fortran compiler based error
and warning messages. Also, any additional Fortran source files
required for the compilation of the project are indicated here as well.

296 PSCAD User’s Guide


PSCAD

Additional Source (.f) Files


This input field allows you to link one or more external source code
files, so as to include the contained code during compilation of the
associated project. An external source code file could contain one or
more subroutines, which are called from within the Fortran segment of
a user component, for example.

Files may be referenced in this field either by an absolute, or relative


path specification. For example, a file referenced with an absolute
path may appear as follows:

If only the filename is entered, PSCAD will assume that the source file
is located in the same directory as the project file itself, and will append
this path to the filename. You may also use standard directory
navigational features when working with relative paths. For example,
if a source file called ‘test.f’ is located in the directory directly above
the project file, then the file entry would appear as follows:

When entering multiple source files, each entry must be separated


either by a blank space, a comma or a semicolon:

This input field will only accept the following source file types:

• Fortran: *.f, *.f90, *.for


• C: *.c

In PSCAD V3, linking to external files was accomplished through the


use of a File Reference component - this method is still valid.

PSCAD User’s Guide 297


Chapter 6: Project Settings

Runtime Debugging
The input parameters involved here are outlined below.

Enable Addition of Runtime Debugging Information


This option will add some additional information to the build, so as to
allow for the effective use of the Fortran debugger. If you have
selected this option, you should also select all of the Checks available
in the Fortran section.

When a program crashes on a PC, the operating system brings up a


dialog asking if you would like to debug the case. If you select yes and
if you had this option selected, the Fortran debugger can load the
source file and point to the line of code that is causing the crash.

Checks
The input parameters involved here are outlined below.

Array & String Bounds


With this option selected, the program will stop if you are accessing an
invalid array index. For example, if the array X is declared to be of
dimension 10, and you have a line of source code that has X(J). If ‘J’
ever goes greater than 10, the program will stop with a proper message.
If this option is de-selected, the program will continue execution and
may eventually crash, adding difficulty to tracing the cause.

This option should be used when testing your new models. It will slow
down the simulation and the speed penalty will vary from machine to
machine - you can disable this option if speed is a concern. Please read
the Fortran compiler documentation you are using for more details.

298 PSCAD User’s Guide


PSCAD

Floating Point Underflow


This option is useful for debugging but has a speed penalty that is again
architecture dependent. Please read the Fortran compiler
documentation for more details.

Integer Overflow
This option is useful for debugging but has a speed penalty that is again
architecture dependent. Please read the Fortran compiler
documentation for more details.

Argument Mismatch
The Fortran compiler issues a warning if the argument type (REAL,
INTEGER, etc.) of the CALL statement does not match with the
subroutine statement (this is applicable to functions as well).

Do not ignore this warning as it may have the potential to create


unpredictable and hard to trace results.

Uncalled Routines
The Fortran compiler issues a warning if a routine is not called in the
program.

Uninitialized Variables
A warning is issued if a variable is used before it is assigned a value.
Normally, the cause of this is a typographical mistake in the source
code.

LINK
The parameters contained within the Links section of the Project
Settings dialog are used for the linking of pre-compiled library (including
MATLAB related) and object files.

PSCAD User’s Guide 299


Chapter 6: Project Settings

Additional Library (.lib) and Object (.obj) Files


This input field allows you to indicate extra Fortran object (*.obj) or
library (*.lib) files that should be linked to the project. Object and library
files would normally be used if you have lot of custom models
associated with user written subroutines, where it would be more
efficient to create a library or object file.

Object and library files provide a way to avoid the compilation of user
written subroutines every time they are used in different projects. They
are also useful for sharing custom models with others, where you do not
want to share the source code itself.

300 PSCAD User’s Guide


PSCAD

In PSCAD V4, a new compiler specific directory convention has been


added for the purpose of specifying compiler specific object and library
files. Now, object and library files can be compiled with one or more
different Fortran compilers, and then placed in a corresponding sub-
directory of the specified User Library Path directory. Then, the user
may freely switch between compilers without the need to re-specify the
files.

The user must manually add these sub-directories to the directory


specified by the User Library Path input in the Workspace dialog (go
to Edit | Workspace Settings... in the Main Menu). Each sub-
directory represents a specific Fortran compiler, and the same library or
object file (compiled by the corresponding compiler) may be placed.
Since there are three types of Fortran compilers that may be used with
PSCAD, there can be up to three sub-directories specified, which must
be named as follows:

• gnu (EGCS/GNU Fortran 77 compiler)


• df5 (Digital Fortran 90 compiler)
• cf6 (Compaq Fortran 90 compiler)

For example, if a user specifies ‘C:\my_libs’ as the User Library Path,


and intends to use either the EGCS/GNU Fortran 77 compiler or the
Compaq Fortran 90 compiler, then two sub-directories should be added
to ‘my_libs’ as shown below:

Any library or object files required should be created with both


compilers, and then added to the corresponding sub-directory.

Files may be referenced in this field either by an absolute, or relative


path specification. For example, a file referenced with an absolute path
may appear as follows

PSCAD User’s Guide 301


Chapter 6: Project Settings

If only the filename is entered, PSCAD will assume that the library or
object file is located in the specified sub-directory in the User Library
Path directory. The path to this directory is specified in the Workspace
Settings dialog.

When entering multiple files into this field, they must be separated with
a space, a comma or a semicolon as shown below:

Matlab
The input parameters involved here are outlined below.

Link This Simulation with the Currently Installed Matlab Libraries


Select this option if you intend to utilize the MATLAB®/Simulink®
interface with this project. Note that this option is disabled unless you
have specified a MATLAB® version in the Workspace Settings dialog.

302 PSCAD User’s Guide


PSCAD

PSCAD User’s Guide 303


Chapter 6: Project Settings

304 PSCAD User’s Guide


PSCAD

Chapter 7:

Transmission Lines and Cables


Overhead transmission line and underground cable corridors (right-of-
ways) are represented in PSCAD as two main parts: By defining the
configuration of the transmission corridor itself, where the definition can
include either the admittance/impedance data or the conductor and
insulation properties, ground impedance data, and geometric position of
all conductors within the corridor. This definition is then interfaced to
the rest of the electrical system through electrical interface components
(one at each end).
A 15 km line length to a 50
Three conductor transmission systems of very short length (i.e. less than µs time step is derived
15 km for a 50 µs time step) can also be represented using an assuming that waves
propagate through the line
equivalent PI Section. This is accomplished through a Master Library at the speed of light. In
component, called the PI Section, where only the admittance and general however, wave
propagation speed is less
impedance data of the line segment is entered. that than the speed of light
and hence the line length is
Using the data provided by the cross-sectional definition of the corridor, be less than 15 km.

the transmission lines and cables are modeled using one of three
distributed (travelling wave) models:

• Bergeron
• Frequency Dependent (Mode)
• Frequency Dependent (Phase)

The most accurate of these is the Frequency -Dependent (Phase) model,


which represents all frequency dependent effects of a transmission line,
and should be used whenever in doubt. When using the Bergeron
model, impedance/admittance data can also be entered directly to
define the transmission corridor.

For all of these Frequency Dependent models, detailed conductor


information (i.e. line geometry, conductor radius) must be given.

PSCAD User’s Guide 305


Chapter 7: Transmission Lines and Cables

CONSTRUCTING TRANSMISSION LINE SYSTEMS


There are two basic methods for constructing a transmission line in
PSCAD. The first involves building a transmission line composed of two
basic components:

• Electrical Interface: Interfaces the transmission line to


the rest of the electric network.
• Transmission Line Configuration: Definition of the
transmission corridor (right-of-way), which can include
tower cross-sectional geometry, ground properties and
conductor data. The transmission line model itself is also
specified here.

This method is probably


most familiar to users as it
was the only method
available in PSCAD V3. The
Transmission Line Interface
components may also
appear in single-line view.

The second method allows you to incorporate the electrical interface


directly into the Transmission Line Configuration component, making it
easier to add the line to the system. This method is only available when
using single-line mode. The figure below represents the equivalent
transmission line to that shown above.

306 PSCAD User’s Guide


PSCAD

Adding a Transmission Line Corridor


To add a transmission line, you must first ensure that you are in the
Circuit section of the Design Editor. The most straightforward method
is to use the Electrical Palette.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Electrical Palette. Left-click on the TLine Interface or the
TLine Configuration buttons and then move your mouse pointer over T-Line Configuration
the Circuit window (you should see the object attached to your Button
pointer). Continue to move the object to where you want it placed,
and then left-click again. Add one Transmission Line Configuration
component and two Transmission Line Interface components to the T-Line Interface
page. Button

Another method is to use the right-click menu: Move the mouse


pointer over a blank area of the Circuit window. Right-click and select
Add Component | TLine.

PSCAD User’s Guide 307


Chapter 7: Transmission Lines and Cables

Select Configuration and then repeat the procedure twice for each
end of the Interface component.

Lastly, you can add the components from the Master Library by copy
and paste. Open the Master Library in Circuit view and then open the
‘Tlines’ module on the main page. Select both the Transmission Line
Interface and Transmission Line Configuration components (should be
at the top of the page), right-click on the components and select Copy
TLines module in the (or press Ctrl + C). Open the Project page where you wish to add the
Master Library components, right-click over a blank area and select Paste (or press
Ctrl + V).

When finished, you should have something similar to that shown below
on your project page:

These components do not


need to be in proximity to
one another. As long as
they are connected by
name, each component can
be located anywhere in the
project, including modules. Converting to a Direct Connection
As mentioned above, you can remove the electrical interface and
simply use the Transmission Line Configuration component as a direct
connection. To convert to a direct connection, left double-click on the
component (or right-click and select Edit Parameters…) to bring up
the Transmission Line Configuration dialog.

308 PSCAD User’s Guide


PSCAD

Select the Direct Connection selection box and then press the OK
button. The Transmission Line Configuration component should now
appear as shown below, to which electrical components may be
connected directly, in single-line mode.

Editing Transmission Line Properties


Transmission line properties can be edited through the Transmission
Line Configuration dialog window. Right-click over the Transmission
Line Configuration component (without selecting it) and select
Properties… to access the Transmission line properties.

For an explanation of these


properties, along with more
details on the Transmission
Line Configuration
component, see the On-Line
Help.

Changing the Line Length


With the Transmission Line Configuration dialog window open, edit the
existing line length in the Length of Line input field. This will
represent the total length of the transmission corridor from the sending
end interface to the receiving end interface.

Changing the Number of Conductors


When changing the number of conductors involved in the transmission
corridor, you must ensure that this number is reflected in both the
Transmission Line Configuration, as well as both of the Transmission
Line Interface components.

PSCAD User’s Guide 309


Chapter 7: Transmission Lines and Cables

With the Transmission Line Configuration dialog window open, edit the
Number of Conductors input field to reflect the number of equivalent
conductors (up to a maximum of 20) in all components. Repeat this
procedure for each of the Transmission Line Interface components, as
well.
A single equivalent
conductor can either be a Each conductor will be given a corresponding electrical connection on
single, solid conductor or a
group of bundled
the Transmission Line Interface component. For example, if the
conductors. Bundled transmission line had a total of five conductors, the interface
conductor information is components will change as follows, where the ‘1’ indicates conductor
defined within the t-line
tower properties. Any number one:
ground wires, which are not
eliminated, must also be
included as an equivalent
conductor.

If the Transmission Line Properties’ component is being used in Direct


Connection mode, the number of conductors need only to be entered
once.

CONSTRUCTING UNDERGROUND CABLE SYSTEMS


Constructing underground cable systems in PSCAD involves building a
corridor composed of two basic components:

• Electrical Interface: Interfaces the cable system to the


rest of the electric network.
• Cable Configuration: Definition of the cable system
corridor (right-of-way), which can include cable cross-
sectional dimensions, ground properties and conductor
and insulation data. The cable line model itself is also
specified here.

310 PSCAD User’s Guide


PSCAD

Adding a Cable System Corridor


To add a cable system, you must first ensure that you are in the Circuit
section of the Design Editor. The most straightforward method is to
use the Electrical Palette.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Electrical Palette. Left-click on the Cable Interface or the
Cable Configuration
Cable Configuration buttons and then move your mouse pointer over Button
the Circuit window (you should see the object attached to your
pointer). Continue to move the object to where you want it placed, and
then left-click again. Add one Cable Configuration component and two
Cable Interface
Cable Interface components to the page. Button

Another method is to use the right-click menu: Move the mouse pointer
over a blank area of the Circuit window. Right-click and select Add
Component | Cable.

PSCAD User’s Guide 311


Chapter 7: Transmission Lines and Cables

Select Configuration and then repeat the procedure twice for each
end of the Interface component.

Lastly, you can add the components from the Master Library by copy
and paste. Open the Master Library in Circuit view and then open the
‘Cables’ module on the main page. Select both the Cable Interface and
Cable Configuration components (should be at the top of the page),
right-click on the components and select Copy (or press Ctrl + C).
Cables module in the
Master Library
Open the Project page where you wish to add the components, right-
click over a blank area and select Paste (or press Ctrl + V).

When finished, you should have something similar to that shown below
on your project page:

These components do not


need to be in proximity to
one another. As long as
they are connected by
name, each component can
be located anywhere in the
project, including modules.

312 PSCAD User’s Guide


PSCAD

Editing Cable Properties


Cable properties can be edited through the Cable Configuration
dialog window. Right-click over the Cable Configuration component
(without selecting it) and select Properties… to access this dialog.

For an explanation of these


properties, along with more
details on the Cable
Configuration component,
see the On-Line Help.

Changing the Cable Length


With the Transmission Line Configuration dialog window open, edit the
existing line length in the Length of Line input field. This will
represent the total length of the transmission corridor from the sending
end interface to the receiving end interface.

Changing the Number of Cables


Unlike with a transmission corridor, there is no need to indicate the
number of conductors involved in an underground cable system,
directly in the Cable Configuration dialog window. However, the
number of conductors must still be indicated in the Cable Interface
components.

With the Cable Interface dialog window open, edit the Number of
Cables input field to reflect the number of coupled cables (up to a
maximum of six).

Each cable will be given a corresponding electrical connection on the


Cable Interface component. For example, if the Cable had a total of
three cables, the interface components will change as follows, where
the cable numbers are indicated accordingly:

PSCAD User’s Guide 313


Chapter 7: Transmission Lines and Cables

THE T-LINE / CABLE CONFIGURATION EDITOR


The T-Line/Cable Configuration Editor is a graphical user interface
designed especially for defining transmission line and cable system
corridors. When invoked, this editor will appear overtop of the Design
Cable Configuration
Component Editor window, and includes its own tab sections for easy viewing of
transmission system related files.

The main section is entitled Editor, and is usually the default section
view when the editor is invoked. The four remaining sections are for
viewing transmission system related files, after the project has been
Transmission Line built. The tab bar showing all the sections is provided in following
Configuration
image:
Component

An explanation of all these sections is given in this chapter. The T-Line/


Cable Configuration Editor can be accessed through either the
Transmission Line or Cable Configuration components.

Editing a Transmission Line Configuration


Right-click over the Transmission Line Configuration component
(without selecting it) and select Edit Configuration…. The editor can
also be accessed from within the Transmission Line Configuration
dialog window by pressing the Edit… button.

314 PSCAD User’s Guide


PSCAD

In either case, the T-Line/Cable Configuration Editor will then open


overtop of the Design Editor. As shown below, the default view is the
Editor section, where the transmission line is graphically defined.

By default, the Editor section will contain three graphical objects:

PSCAD User’s Guide 315


Chapter 7: Transmission Lines and Cables

• Line Model General Data: Located in the top-left corner,


this object simply displays what has been entered into the
corresponding Transmission Line Configuration dialog. This
object is for display only and cannot be edited from the T-
Line/Cable Configuration Editor.
• Frequency Dependent (Phase) Model Options: This
component represents the transmission line model being
used, and by default is the Frequency Dependent (Phase)
model component. The properties of this component may
be edited by either a left double-click on the component
(or right-click and select Properties…) to bring up the
For more details on the
Frequency Dependent corresponding dialog window.
(Phase) model and Ground • Entry of Ground Data: This component, usually located
Data components, see the
On-Line Help. near the bottom of the Editor window, represents the
transmission line ground return path. The properties of
this component may be edited by either a left double-click
on the component (or right-click and select Properties…)
to bring up the corresponding dialog window.

A fourth object required is the definition of the transmission line itself.


This definition can be a geometrical cross-section of the transmission
tower (or towers), or can be a manual entry of admittance/impedance
data (Bergeron model only). In either case, this is left for the user to
add manually.

Adding a Tower Component


Tower components can be added to the T-Line/Cable Configuration
Editor in one of two ways. The most straightforward method is to use
the right-click pop-up menu: In the Editor section of the Editor, move

316 PSCAD User’s Guide


PSCAD

the mouse pointer over a blank area of the window. Right-click and
select Add Tower. A sub-menu will appear containing a list of all
transmission line tower components available in the Master Library.
Select a tower and it will be automatically added.

You can also copy and paste tower components directly from the
Master Library. Open the Master Library in Circuit view and then open
the ‘Tlines’ module on the main page. Select a tower component (at
the bottom of the page), right-click on the component and select Copy
(or press Ctrl + C). Open the Editor section if the T-Line/Cable
Configuration Editor, right-click over a blank area and select Paste (or TLines module in the
press Ctrl + V). Master Library

When finished, you should have something similar to that shown below
in the Editor section of the T-Line/Cable Configuration Editor:

PSCAD User’s Guide 317


Chapter 7: Transmission Lines and Cables

The location of the tower


component does not affect
the results. However, the
tower (or towers) should be
positioned to allow for ease
in readability. That is,
directly on top of the
ground plane.

Multiple towers may be added to a single configuration. Just


remember to ensure that the conductors are numbered properly within
each of the tower components, and that the X positions of the new
towers in the corridor are adjusted. Also, any conductors added by the
additional towers must be reflected in the corresponding Transmission
Line Interface components.

Editing Tower Properties


Tower properties can be edited through the corresponding tower
properties dialog window. Right-click over the tower component
(without selecting it) and select Properties… to access this dialog.
For more details on the
tower components, see the Editing a Cable System Configuration
On-Line Help. Right-click over the Cable Configuration component (without selecting
it) and select Edit Configuration…. The editor can also be accessed
from within the Cable Configuration dialog window by pressing the
Edit… button.

318 PSCAD User’s Guide


PSCAD

In either case, the T-Line/Cable Configuration Editor will then open


overtop of the Design Editor. As shown below, the default view is the
Editor section, where the cable system is graphically defined.

PSCAD User’s Guide 319


Chapter 7: Transmission Lines and Cables

By default, the Editor section will contain three graphical objects:

• Line Model General Data: Located in the top-left corner,


this object simply displays what has been entered into the
corresponding Cable Configuration dialog. This object is
for display only and cannot be edited from the T-Line/
Cable Configuration Editor.
• Frequency Dependent (Phase) Model Options: This
component represents the transmission line model being
used, and by default is the Frequency Dependent (Phase)
model component. The properties of this component may
be edited by either a left double-click on the component
For more details on the (or right-click and select Properties…) to bring up the
Frequency Dependent corresponding dialog window.
(Phase) model and Ground
Data components, see the • Entry of Ground Data: This component, usually located
On-Line Help. near the bottom of the Editor window, represents the
transmission line ground return path. The properties of
this component may be edited by either a left double-click
on the component (or right-click and select Properties…)
to bring up the corresponding dialog window.

A fourth object that is required is the definition of the cable (or cables).
This is left for the user to add manually.

320 PSCAD User’s Guide


PSCAD

Adding a Cable Cross-Section Component


Cable cross-section components can be added to the T-Line/Cable
Configuration Editor in one of two ways. The most straightforward
method is to use the right-click pop-up menu: In the Editor section of
the Editor, move the mouse pointer over a blank area of the window.
Right-click and select Add Cable. A sub-menu will appear containing a
list of all cross-section components available in the Master Library.
Select a cross-section and it will be automatically added.

You can also copy and paste cable cross-section components directly
from the Master Library. Open the Master Library in Circuit view and
then open the ‘Cables’ module on the main page. Select a cross-
section component (at the bottom of the page), right-click on the
component and select Copy (or press Ctrl + C). Open the Editor
section of the T-Line/Cable Configuration Editor, right-click over a blank Cables module in the
area and select Paste (or press Ctrl + V). Master Library

When finished, you should have something similar to that shown below
in the Editor section of the T-Line/Cable Configuration Editor:

PSCAD User’s Guide 321


Chapter 7: Transmission Lines and Cables

The location of the cable


cross-section component
does not affect the results.
However, the cross-section
(or cross-sections) should be
positioned to allow for ease
in readability. That is,
directly below the ground
plane.

Multiple cables may be added to a single configuration. Just remember


to ensure that the conductors are numbered properly within each of
the cross-section components, and that the X positions of the new
cross-sections in the corridor are adjusted. Also, any conductors added
by the additional cross-sections must be reflected in the corresponding
Cable Interface components.

Editing Cross-Section Properties


Cable cross-section properties can be edited through the corresponding
cross-section properties dialog window. Right-click over the cross-
section component (without selecting it) and select Properties… to
access this dialog.
For more details on the
cable cross-section
components, see the On- Selecting the Proper Line Model
Line Help. There are three types of distributed (i.e., travelling wave) transmission
models that may be selected to represent your transmission corridor:
The Bergeron model, the Frequency-Dependent (Mode) model, and the
Frequency-Dependent (Phase) model. These models exist as

322 PSCAD User’s Guide


PSCAD

components in the Master Library, and each include adjustable


properties. The requirements for your study will determine which of
the three models is suitable.

The Bergeron Model


The Bergeron model represents the L and C elements of a PI section in
a distributed manner (not using lumped parameters like PI sections). It
is accurate at the specified frequency and is suitable for studies where
the specified frequency load-flow is most important (e.g., relay studies).

When using the Bergeron model, it is not always necessary to use a


tower component to represent a transmission line. If you are modeling
a three-phase system, then you can enter the line data, in admittance
or impedance format, directly by substituting the ‘Manual Entry of Y, Z’
component.

PSCAD User’s Guide 323


Chapter 7: Transmission Lines and Cables

This component can be added just as you were adding a tower


component. Keep in mind that this component substitutes for the
tower component, and you still need the Bergeron model present in
your transmission line configuration.

The Frequency-Dependent (Mode) Model


The Frequency-Dependent (Mode) model represents the frequency
dependence of all parameters (not just at the specified frequency as in
For more details on the Bergeron model). This model uses modal techniques to solve the
transmission line models and line constants and assumes a constant transformation. It is therefore
theory, see the EMTDC
User’s Guide, as well as the
only accurate for systems of ideally transposed conductors (or two
On-Line Help for more on conductor horizontal configurations) or single conductors.
specific model properties.
The Frequency-Dependent (Phase) Model
The Frequency-Dependent (Phase) model also represents the frequency
dependence of all parameters as in the ‘Mode’ model above. However,
the Frequency Dependent (Phase) model circumvents the constant
transformation problem by direct formulation in the phase domain. It is
therefore accurate for all transmission configurations, including
unbalanced line geometry.

The Frequency-Dependent (Phase) model should always be the model


of choice, unless another model is chosen for a specific reason. This
model is the most advanced and accurate time domain line model in
the world!

Adding a Line Model


Line model components can be added to the T-Line/Cable
Configuration Editor in one of two ways. The most straightforward
method is to use the right-click pop-up menu: In the Editor section of
the Editor, move the mouse pointer over a blank area of the window.
Right-click and select Choose Model. A sub-menu will appear

324 PSCAD User’s Guide


PSCAD

containing a list of all model components available in the Master Library.


Select a model and it will be automatically added.

The line configuration


cannot contain more than
one model component. This
menu item will be disabled if
a model already exists in the
Editor.

You can also copy and paste model components directly from the
Master Library. Open the Master Library in Circuit view and then open
either the ‘TLines’ module or the ‘Cables’ module on the main page.
Select a line model component (middle of the page), right-click on the
component and select Copy (or press Ctrl + C). Open the Editor
section of the T-Line/Cable Configuration Editor, right-click over a blank
area and select Paste (or press Ctrl + V).

Editing Line Model Properties


Line model properties can be edited through the corresponding model
properties dialog window. Right-click over the line model component
(without selecting it) and select Properties… to access this dialog.
For more details on the line
model components, see the
On-Line Help.
LINE CONSTANTS’ FILES
Whenever a project containing a transmission line or a cable system is
compiled (or the line constants are solved manually), text files involved

PSCAD User’s Guide 325


Chapter 7: Transmission Lines and Cables

in the calculation of the line constants are created. PSCAD uses


information extracted from the various components involved with the
transmission system, and constructs a line constants input (*.tli) file.
This file is then used as input by the T-Line/Cable Constants program –
a separate executable supplied with your PSCAD software.

Depending on the transmission system (i.e., overhead line or


underground cable) and the actual line model used, the T-Line/Cable
Constants program creates up to three output files. These are:

• Constants File (*.tlo)


• Log File (*.log)
• Output File (*.out)

These files are located in the project temporary (*.emt) directory and
can be opened manually by using a simple text editor program.
However, they may also be viewed directly from within PSCAD.

Solving the T-Line/Cable Constants Manually


Invoke the T-Line / Cable Configuration Editor by right clicking over the
Transmission Line Configuration component (without selecting it) and
selecting Edit Configuration…. Right-click over a blank area of the
editor page and select Solve Constants.

326 PSCAD User’s Guide


PSCAD

Viewing Line Constants Files


There are a few files involved with the T-Line/Cable Constants program.
These are the Input, Constants, Log and Output files. To view any of
these files, first execute the T-Line/Cable Constants program (see above
section). Then, simply click the corresponding tab in the T-Line
Properties Editor tab bar, located near the bottom of the Design Editor
window.

Input File
The line constants’ input file is automatically constructed by PSCAD
when the project is compiled, or when the line constants are solved
manually (see section entitled ‘Solving the T-Line/Cable Constants
Manually’ above).

This file, which has extension *.tli, is used as an input file to the T-Line/
Cable Constants program. The file is pieced together using information
taken from:

1. Configuration Component: Depending on whether you are


modeling a transmission Line or a cable corridor, the first part
of this file is composed of parameters taken directly from the
Transmission Line or Cable Configuration component, as
shown below for a transmission line:

Line Summary:
{
Line Name = FLAT230
Line Length = 100.0
Steady State Frequency = 60.0
Number of Conductors = 3
}
! This should be in a section called TLINE-INPUT-DATA

PSCAD User’s Guide 327


Chapter 7: Transmission Lines and Cables

2. Tower or Cross Section Component: Important parameters,


such as conductor data and ground data, dimensions, etc. are
extracted from the Model-Data segments of whatever t-line
tower or cable cross-section components exist in the T-Line/
Cable Configuration Editor. These are placed in the input file
as well and represent the bulk of the file:
See Chapter 8 for more on
the Model-Data segment.

Line Constants Tower:


{
Name = H-Frame-3H4
Circuit = 1
{
Transposed = 0
Conductors = 3
Conductor Phase Information = 1 2 3
Radius = 0.0203454
DCResistance = 0.03206
ShuntConductance = 1.0e-011
P1 = -10.0 30.0
P2 = 0.0 30.0
P3 = 10.0 30.0
Sag = 10.0
Sub-ConductorsPerBundle = 2
{
BundleSpacing = 0.4572
}
}
GroundWires = 2
{
Eliminate Ground Wires = 1
Radius = 0.0055245
DCResistance = 2.8645
P1 = -5.0 35.0
P2 = 5.0 35.0
Sag = 10.0
}
}
Line Constants Ground Data:
{
GroundResistivity = 100.0
GroundPermeability = 1.0
EarthImpedanceFormula = 0
}

3. Model Component: Some important information will appear


in the input file from whatever model is being used. In this
case, it is the Frequency Dependent (Phase) model:

328 PSCAD User’s Guide


PSCAD

Frequency Dep. (Phase) Model Options:


{
Interpolate Travel Times = 1
Infinite Line Length = 0
Curve Fitting Start Frequency = 0.5
Curve Fitting End Frequency = 1000000.0
Maximum # of Poles for Surge Admittance Fit = 20
Maximum # of Poles for Attenuation Constant Fit = 20
Maximum Fitting Error (%) for Surge Admittance = 0.2
Maximum Fitting Error (%) for Attenuation Constant = 2.0
Weighting Factor 1 = 100.0
Weighting Factor 2 = 1000.0
Weighting Factor 3 = 1.0
Write Detailed Output Files = 0
}

Constants’ File
The constants’ file is a T-Line/Cable Constants program, which is used
as an input file for EMTDC. This file contains all the information
necessary for EMTDC to represent the transmission system.

Log File
The log file is used to display curve-fitting information from the T-Line/
Cable Constants program, when using either of the Frequency
Dependent models only. The log file is not used when the Bergeron
model is present.

The Frequency Dependent models use a curve-fitting algorithm to fit


both the characteristic admittance and propagation function curves for
the transmission line or cable in the phase domain. The log file is used
to display output from this routine, according to the parameter settings
in the model component itself. See the Online Help for more on the
line model component being used.

Output Files
Output files are created by the T-Line/Cable Constants program and are
used to display important transmission system data in a convenient
format for the user. This can include impedance and admittance matrix
information, sequence data and travel times.

The output file will change slightly depending on the model used.

PSCAD User’s Guide 329


Chapter 7: Transmission Lines and Cables

330 PSCAD User’s Guide


PSCAD

Chapter 8:

Designing Components
One of the features that make PSCAD such a powerful simulation tool is
its allowance for the design of custom models. Users can develop
models from the very simple to the very complex, limited only by their
skills and knowledge of the subject.

In order for a custom model to be included in either the System


Dynamics or the Electric Network Solution in EMTDC, the model must
first be added as a component in PSCAD. Components act as graphical
representation models, allowing the user to supply input parameters,
See Chapter 4 for details on
perform pre-calculations on input data, and change the component creating a new component
appearance. or module, using the
Component Wizard.
This chapter discusses the various features and tools available to the
user for the design of custom components in PSCAD. The information
here is closely linked with the following chapter entitled PSCAD Script.
It is suggested that you become familiar with both chapters before
proceeding with your component design.

The last section of this Chapter includes a tutorial called ‘Designing a


New Component,’ which goes through many of the features described
below.

THE DESIGN EDITOR


In PSCAD V3, designing components was accomplished by using a
utility entitled the Component Workshop (or CWS). The Component
Workshop was invoked by editing the Component Definition and
contained different sections for the design of graphics, dialog windows
and code sections. In PSCAD V4, components are designed in a very
similar fashion, but without the use of the Component Workshop as a
separate utility. Now, the user can conveniently edit Component
Definitions directly through the Design Editor.

As discussed in Chapter 3, the Design Editor includes a tab bar at the


bottom of its window, which includes tabs for the convenient access of
information pertinent to the project at hand. Three of the tabs
represent the three main sections of the Component Definition, and
will become enabled when the user decides to edit a particular

PSCAD User’s Guide 331


Chapter 8: Designing Components

Component Definition. These are:

• Graphic
• Parameters
• Script

The following sections describe the various features and tools available
for the design of a component.

EDITING A COMPONENT OR MODULE DEFINITION


To edit the definition of any component or module (i.e., enable the
relevant tabs), right-click over the component and select Edit
Definition… from the pop-up menu. As an alternative, press Ctrl +
double left click, while the mouse pointer is over the component.

You cannot edit the


definition of Master Library
components, unless you
rename the ‘[Link]’ file.

332 PSCAD User’s Guide


PSCAD

RETURNING TO CIRCUIT VIEW


To exit any section of the Component Definition, either left double-click
the project name in the Workspace window, or click the Return to
Circuit View button in the toolbar corresponding to that section. For Return to Circuit
example, use the Graphic Palette while in the Graphic section. View Button

If you cannot see this tool bar, go to the main menu bar and select
View | Graphic Palette.

THE GRAPHIC SECTION


The component graphic is the primary interface between you, your
model and PSCAD. Within this graphical interface, you can add
Connection Nodes for interfacing with other components, add text and
other graphic objects, as well as change the appearance or
functionality of the component according to specified conditions.

The graphical interface section is always the default window to open


upon entering the Component Definition for editing. If you are not
sure where you are in the Design Editor, simply look at the horizontal
tab bar at the bottom of the Design Editor window for clarification. If
the Graphic section is enabled, then the tab bar should appear as
below:

Graphic Objects
There are several types of graphic objects available to help design a
visually appealing component. These include:

• Line
• Ellipse
• Rectangle
• Arc

Object properties, such as colour, fill and size can be changed to suit

PSCAD User’s Guide 333


Chapter 8: Designing Components

the component graphical needs. A good graphical design can enhance


user understanding of the purpose of the component and what its
primary function is.

Adding Graphic Objects


To add a graphic object to your component definition, you must first
ensure that you are in the Graphic section. The most straightforward
method is to use the Graphic Palette.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Graphic Palette. Simply left-click the required object button in
the toolbar, drag the object to where you want it placed in the Graphic
window and left-click again.

Another method is to use the right-click menu: Move the mouse


pointer over a blank area of the Graphic window. Right-click and select
New Graphic.

334 PSCAD User’s Guide


PSCAD

Depending on the object selected, a new object should appear attached


to your mouse pointer. With your mouse, move the object to the
desired location within the Design Window and left-click to place the
object.

Rotate, Flip, Mirror and Resize Graphic Objects


Graphic objects can be rotated, flipped, mirrored or resized once they
have been placed in the Graphic window.

To resize, left-click on the object so that grips appear.

Place the mouse pointer over a selected Grip, press and hold the left
mouse button, and move the mouse. Note that the corner Grips will
allow resizing in both directions, while the mid-point grips will only
allow movement in either the horizontal or vertical directions.

Rotate, flip or mirror can be accomplished in one of three ways. The


first is to use the speed button on the Rotation Bar.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Rotation Bar. Select the object with a left-click of your mouse.
Then, click one of the four buttons shown above.

You can also use the right-click pop-up menus: Select the object with a
left-click of your mouse. Right-click over the selected object and select
Rotate. Choose one of the options given.

PSCAD User’s Guide 335


Chapter 8: Designing Components

As an alternative to the right-click menu and toolbar, you can also use
keyboard shortcuts r, f and m for rotate, flip and mirror respectively.
Make sure that the mouse pointer is over top the object before using
these keys. If you select the object first, then the object will rotate, flip
and mirror centred on the object itself.

Changing Graphic Object Properties


Graphic Object properties (except the Arc) can be adjusted through the
Format Graphic Object dialog window.

To change the object properties: Right-click over the object (without


selecting it) and select Properties….

336 PSCAD User’s Guide


PSCAD

As shown above, graphical features such as styles and colours can be


adjusted.

Line and Fill:

• Colour: Select the down arrow to bring up the colour


palette shown below. Left-click on a colour button to
change the colour of the object line. If the object is a
Rectangle or Ellipse, this will change the border colour. If
By Node Type is selected, the type of node to which the
object is associated with will determine the line colour.
See the Node input for more details.

• Weight: Select the down arrow to bring up the line


weight palette shown below. Left-click on a weight
button to change the weight or thickness of the object
line. If the object is a Rectangle or Ellipse, this will change
the border weight. If By Node Type is selected, the type
of node to which the object is associated with will
determine the line weight. See the Node input for more
details.

PSCAD User’s Guide 337


Chapter 8: Designing Components

• Fill: Select the down arrow to bring up the fill palette


shown below. Left-click on Clear, Solid or a hatch type
button to determine the style of the object. Then use the
two colour palettes to choose colours for both foreground
and background.

This input is disabled for


Line objects!

• Style: Select the down arrow to bring up the line style


palette shown below. Left-click on a style button to
change the style of the object line. If the object is a
Rectangle or Ellipse, this will change the border style. If
By Node Type is selected, the type of node to which the
object is associated with will determine the line style. See
the Node input for more details.

Other:

• Visible When: Enter a conditional statement to


determine under what input conditions the object is to be
visible. See the section entitled ‘Conditional Statements,
Layers & Filters’ in this chapter for more details.

338 PSCAD User’s Guide


PSCAD

• Connection: Enter the name of a Connection to which


this object is to be associated. This input is used to
associate graphical properties, such as colour, thickness
and style, with a particular type of Connection, to which it
is connected. For example, if the node indicated in this
field happens to be a single-line, electrical node (i.e.,
dimension of 3), then the line weight will become greater
when the project is compiled.

In addition to the Format Graphic Object dialog, you can change the
line/border colour, weight and style, as well as fill properties directly
from the Graphic Palette. First, select the object with a left-click (grips
appear). Then adjust any of the above properties by using the
appropriate buttons.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Graphic Palette.

Changing Arc Object Properties


The Arc is a special type of graphical object. Arc object properties can
be adjusted through the Format Arc dialog window.

To change the Arc properties: Right-click over the Arc object (without
selecting it) and select Properties….

For convenience, there is a


quarter arc and half arc
available in the Graphic
Palette and the right-click
menu.

PSCAD User’s Guide 339


Chapter 8: Designing Components

As shown above, graphical features such as styles and colours can be


adjusted.

Line:

• Colour: Select the down arrow to bring up the colour


palette shown below. Left-click on a colour button to
change the colour of the arc line.

• Weight: Select the down arrow to bring up the line


weight palette shown below. Left-click on a weight
button to change the weight or thickness of the arc line.
If By Node Type is selected, the type of node to which
the object is associated with will determine the line
weight. See the Node input for more details.

340 PSCAD User’s Guide


PSCAD

• Style: Select the down arrow to bring up the line style


palette shown below. Left-click on a style button to
change the style of the arc line. If By Node Type is
selected, the type of node to which the object is
associated with will determine the line style. See the
Node input for more details.

Angles:

• Start: Enter the angle in degrees at which the arc has its
starting point. This angle is based on a standard, four-
quadrant system.
• Sweep: Enter the angular distance through which the arc
is to sweep. Sweep distance is always in the counter-
clockwise direction.

Other:

• Visible When: Enter a conditional statement to


determine under what input conditions the object is to be
visible. See the section entitled ‘Conditional Statements,
Layers & Filters’ in this chapter for more details.
• Connection: Enter the name of a Connection to which
this object is to be associated. This input is used to
associate graphical properties, such as colour, thickness
and style, with a particular type of Connection, to which it
is connected. For example, if the node indicated in this
field happens to be a single-line, electrical node (i.e.,
dimension of 3), then the line weight will become greater
when the project is compiled.

PSCAD User’s Guide 341


Chapter 8: Designing Components

In addition to the Format Arc Object dialog, you can change the line/
border colour, weight and style from the Graphic Palette. First, select
the Arc with a left-click (grips appear). Then adjust any of the above
properties by using the appropriate buttons.

If you cannot see this tool bar, go to the Main Menu bar and select
View | Graphic Palette.

Cut, Copy, Paste and Delete Objects


You can cut, copy or paste any graphic object by using one of two
methods:

• Select the object with a left mouse click so that grips


appear. Click the Cut or Copy buttons from the Main
Cut, Copy and Toolbar. Click the Paste button Main Toolbar to paste.
Paste Buttons • Right-click on the object and select Cut or Copy from the
pop-up menu. Right-click over a blank area of the
Graphic window and select Paste from the pop-up menu.

Text Labels
Text can be displayed on component graphics using a text label object.
Text labels can be one line of text only, and the user may select
justification and size.

Adding Text Labels


To add a text label object to your component definition, you must first
ensure that you are in the Graphic Section. The most straightforward
method is to use the Graphic Palette.

New Text Label


If you cannot see this toolbar, go to the main menu bar and select
Button
View | Graphic Palette. Simply left-click the New Text Label button
on the toolbar, drag the label to where you want it placed and left-click
again.

342 PSCAD User’s Guide


PSCAD

Another method is to use the right-click menu: Move the mouse pointer
over a blank area of the Graphic Window. Right-click and select New
Graphic | Text.

A text label should appear attached to your mouse pointer. With your
mouse, move the label to the desired location within the Graphic
window and left-click to place the object.

Rotate, Flip or Mirror Text Labels


Text labels can be rotated, flipped or mirrored once they have been
placed in the Graphic window. This can be accomplished in one of
three ways: The first is to use the speed buttons on the Rotation Bar.

If you cannot see this toolbar, go to the Main Menu bar and select
View | Rotation Bar. Select the object with a left-click of your mouse.
Then, click one of the four buttons shown above.

You can also use the right-click menus: Select the label with a left-click
of your mouse. Right-click over the selected object and select Rotate.
Choose one of the options given.

PSCAD User’s Guide 343


Chapter 8: Designing Components

As an alternative to the right-click menu and toolbar, you can also use
keyboard shortcuts r, f and m for rotate, flip and mirror respectively.
Make sure that the mouse pointer is over top the label before using
these keys. If you select the label first, then the label will rotate, flip
and mirror centred on the label itself.

Changing Text Label Properties


Text label properties can be adjusted through the Format Text Label
dialog window.

To change the Text Label properties: Right-click over the Text Label
(without selecting it) and select Properties….

344 PSCAD User’s Guide


PSCAD

As shown above, text features such as size and style can be adjusted.

• Text: Enter the text you wish to appear on the label.


• Size: Select Small, Medium or Large sizes for your text.
• Style: Select Left, Centre or Right justification for your
text.
• Visible When: Enter a conditional statement to
determine under what input conditions the object is to be
visible. See the section entitled ‘Conditional Statements,
Layers & Filters’ in this chapter for more details.

Cut, Copy, Paste and Delete Labels


You can cut, copy or paste a Text Label by using one of two methods:
Cut, Copy and
• Select on the Label with a left mouse click. Click the Cut Paste Buttons
or Copy buttons from the Main Toolbar. Click the Paste
button Main Toolbar to paste.
• Right-click on the Label and select Cut or Copy from the
pop-up menu. Right-click over a blank area of the
Graphic window and select Paste from the pop-up menu.

Linking a Text Label to an Input Field


It is possible to link a Text Label to a specific input parameter within the
same definition. Once linked, the Text Label can be used to graphically
display the parameter value (and unit). For example, you can display
the MVA rating of a transformer model according to what is entered in
its ‘Rated MVA’ input field.

Linking is accomplished by simply entering the ‘Symbol’ name of an


associated input parameter into the text label, preceded by either a
See the Parameters section
percent (%) or a dollar ($) symbol. If the $ prefix is used, just the value in this chapter for more
of the linked input field will be displayed. If the % prefix is used, both details on input fields.
the value and the specified unit will be displayed. The following
example illustrates how to link to an input field.

EXAMPLE 8-1:

A user wants to display the value of an input parameter with symbol


name ‘timec,’ which represents the component time constant. The

PSCAD User’s Guide 345


Chapter 8: Designing Components

user adds a Text Label to the component field and adds the following to
the Text input field in the Format Text Label dialog window:

%timec

If the ‘timec’ input field has a value of 10.0 seconds, then the resulting
If the % prefix above is
replaced by the $ prefix, the display would be similar to:
units will not be displayed.

10.0 [s]

Connections
Connections are used to provide an interface to or from your component
and the external system. They provide a means to either read in data
from, or output data to the external system each simulation time step.
These nodes play an essential part in the construction of circuits in
PSCAD, and are the graphical signal communication avenue between
models.

Adding Connections
To add a connection object to your component definition, you must first
ensure that you are in the Graphic section. The most straightforward
method is to use the Graphic Palette.

If you cannot see this tool bar, go to the Main Menu Bar and select
New Connection View | Graphic Palette. Simply left-click the New Connection button
Button on the toolbar, drag the connection to where you want it placed and
left-click again.

Another method is to use the right-click menu: Move the mouse pointer
over a blank area of the Graphic window. Right-click and select New
Graphic | Connection.

346 PSCAD User’s Guide


PSCAD

You may notice that


Connections are always
snapped to the PSCAD
drawing grid. This is to
ensure that when other
components are connected
to yours, their respective
connection points will
overlap.

A connection should appear attached to your mouse pointer. With your


mouse, move the node to the desired location within the Graphic
window and left-click to place the object.

Changing Connection Properties


Connection properties can be adjusted through the Format
Connection dialog window.

To change the Connection properties: Right-click over the Connection


(without selecting it) and select Properties....

PSCAD User’s Guide 347


Chapter 8: Designing Components

As shown above, Connection Node features, such as name and type,


can be adjusted.

• Symbol: Enter a name for the connection node. Note that


this name must be compatible with standard Fortran naming
conventions (i.e. it must begin with a non-numeric character,
do not include spaces, etc.).
• Dimension: If this node is to carry a signal that is defined as
a standard Fortran array, then this is the dimension of the array
signal. For example, if node N1 is defined as REAL N1(3), then
this field should be specified as 3. You may also substitute the
Symbol Name of an integer Input Field or Choice Box in this
field. The connection will assume a dimension equal to this
value upon compilation.
• Connection Type: Select Input Data, Output Data or
Electrical node. If this connection is to be part of the EMTDC
System Dynamics (i.e. a control signal), then you must either
choose Input or Output Data (an input data signal is that which
is coming into or being accepted by your component). Only
select Electrical Node if this connection to be part of an
electrical circuit.
• Node Type: Select Fixed, Removable, Switched or
Ground. This parameter is only enabled if the Connection
Type is an Electrical Node (see the following Electrical Node
Types section).
• Data Type: Select Integer or Real. This input defines the
type of data signal that will be passing through this connection
and is based on the standard Fortran INTEGER or REAL
declarations. It is only enabled if Connection Type is Input or
Output Data.
• Enabled When: Enter a conditional statement to determine
under what input conditions the connection is to be enabled.
See Conditional Statements, Layers & Filters in this chapter for
more details.

Cut, Copy, Paste and Delete Connections


You can cut, copy or paste a Connection by using one of two methods:

Cut, Copy and • Select on the Connection with a left mouse click. Click
Paste Buttons the Cut or Copy buttons from the Main Toolbar. Click the
Paste button Main Toolbar to paste.

348 PSCAD User’s Guide


PSCAD

• Right-click on the Connection and select Cut or Copy from


the pop-up menu. Right-click over a blank area of the
Graphic window and select Paste from the pop-up menu.

Electrical Node Types


When the connection is selected as an electrical node, there are four
electrical node types available to the user. These are described below:

• Fixed: A fixed node is the most common type of electrical


node and should be the default chosen when in doubt. It
represents a simple electrical node.
• Removable: A removable node is that which may be
‘removed’ by PSCAD, if it is to be part of a collapsible branch.
For example a branch with separate series RLC elements can
be collapsed by PSCAD into an equivalent, single element
See the EMTDC User’s
impedance branch (Z) (effectively removing two extra nodes). Guide for more details on
Select removable if you would like to take advantage of this collapsing branches.
feature.
• Switched: If your node is to be part of a switching branch,
that is a branch whose equivalent conductance is changing
many times during a simulation (thyristor, GTO, etc.), then this
option should be chosen. Switched nodes are included in the
Optimal Node Ordering algorithm, which makes matrix
decomposition more efficient, and thereby speeding up the
See Chapter 6 for more
simulation. details on the Optimal Node
• Ground: Select this option if your node is to be a ground Ordering algorithm.

node.

Undo and Redo


To undo or redo any changes in the Graphics section, select the Undo
or Redo buttons in the Main Toolbar, press Ctrl + Z or Ctrl + Y, or right-
Undo and Redo
click over a blank part of the Graphics window and select Undo or
Buttons
Redo.

PSCAD User’s Guide 349


Chapter 8: Designing Components

Zooming
Zoom features are available when working in the Graphic section of the
Design Editor. There are a few different methods for zooming available:

• From the Main Menu, select View | Zoom. You then


Zoom In and Zoom have a choice to select either In, Out or a specified zoom
Out Buttons percentage.
• From the Main Toolbar, select either the Zoom In or
Zoom Out buttons, or select a percentage zoom directly
Zoom In/Out Drop from the Zoom In/Out drop down list.
List • Right-click on a blank part of the page and select Zoom
In or Zoom Out.

350 PSCAD User’s Guide


PSCAD

Saving and Reloading Graphics


Any changes made to your component graphics should be saved
regularly. To save changes, simply exit the component definition (i.e.,
go back to the Circuit window). To do this, either left double-click the
project name in the Workspace window, or click the Return to Circuit
View button in the Graphic Palette. Return to Circuit
View Button

If you cannot see this tool bar, go to the main menu bar and select
View | Graphic Palette.

If desired, you can at any time reload the graphics from the time at
which they were last saved, by pressing the Reload Graphics button.
Reload Graphics
Another method is to use the right-click menu: Move the mouse Button
pointer over a blank area of the Graphics window. Right-click and
select Reload Graphics.

Caution should be exercised with this function, as once the graphics are
reloaded, all changes will be lost.

Adjusting Graphic Page Size


In order to accommodate very large component graphics (usually
imported from PSCAD V3), an option to change the Graphic canvas
size is given. Move the mouse pointer over a blank area of the
Graphics window. Right-click and select Page.

PSCAD User’s Guide 351


Chapter 8: Designing Components

The default canvas size is Smaller.

PARAMETERS SECTION
The Parameters section is an area of the Component Definition, for
which the primary purpose is to allow users to interact with the
component. This is accomplished through the use of programmable
dialog windows know as Categories, where users may input everything
from model parameters to model conditions and appearance.
Category windows are the only sections accessible to users once the
component design is completed.

If you are not sure where you are in the Design Editor, simply look at
the horizontal tab bar below for an indication. If the Parameters section
is not enabled, click on the ‘Parameters’ tab as shown below:

Categories
Within the Parameters section of the Design Editor, Categories are
ordered similar to pages in a book. You may include several pages,
each containing inputs pertaining to a similar function, or you may
place all inputs in one Category page. There are three different types
of input fields that may be added to Category pages. These include:

• Text Box
• Input Field
• Choice Box

352 PSCAD User’s Guide


PSCAD

These input fields are described in detail in the following sections.

Adding a New Category


To add a new Category page to your Component Definition, you must
first ensure that you are in the component Parameters section. The
most straightforward method is to use the Parameters Bar.

If you cannot see this tool bar, go to the main menu bar and select
View | Parameters Bar. Left click the New Category button.
New Category
Another method is to use the right-click menu: Move the mouse Button
pointer over a blank area of the Parameters window. Right-click and
select New Category.

In either case, the Category Properties dialog should appear.

PSCAD User’s Guide 353


Chapter 8: Designing Components

Select a descriptive name for the Category page in the Name field. If
desired, you can add a conditional statement in the Enabled When:
input. Click the OK button. A new Category should then appear
displaying the Name in the top-left corner: The following image shows
a new Category named ‘Test.’
See the section entitled
‘Conditional Statements,
Layers & Filters’ in this
chapter for more details.

You can edit the parameters of the Category Properties dialog at any
time. See Changing Category Properties below for more details.

Viewing Categories
As mentioned above, categories are organized similar to pages in a
book. Once you have added more than one category, there may be a
need to navigate through these pages. The most straightforward
method is to use the Parameters Bar. Simply left-click the down
arrow on the View Category drop list as shown below:

Another method is to use the right-click menu: Move the mouse


pointer over a blank area of the Parameters window. Right-click and
select View Category.

354 PSCAD User’s Guide


PSCAD

Ordering Categories
Once you have added more than one category, there may be a need to
re-order the sequence of the category pages. The most straightforward
method is to use the Parameters Bar. Simply left-click either the Move Category
Up and Move
Move Category Up or the Move Category Down buttons. To move Category Down
a certain Category directly to the top or bottom of the list, select either Buttons
the Move Category To Top or the Move Category To Bottom
button.

Another method is to use the right-click menu: Move the mouse pointer
over a blank area of the Parameters window. Right-click and select Move Category
To Top and Move
Order. Choose one of the given options from the sub-menu. Category To
Bottom Buttons

Previewing Categories
For convenience, a preview function exists so that the look and feel of
the category pages can be viewed, as they would appear to someone

PSCAD User’s Guide 355


Chapter 8: Designing Components

using the component - without leaving the Component Definition. The


most straightforward method is to use the Parameters Bar. Simply left
Preview Dialog click Preview Dialog button.
Button
Another method is to use the right-click menu: Move the mouse
pointer over a blank area of the Parameters window. Right-click and
select Preview….

Changing Category Properties


Category properties can be adjusted through the Category Properties
dialog window. The most straightforward method is to use the
Parameters Bar. Simply left click Category Properties button.
Category
Properties Button
Another method is to use the right-click menu: Move the mouse
pointer over a blank area of the Parameters window. Right-click and
select Properties….

356 PSCAD User’s Guide


PSCAD

Either of these operations should bring up the Category Properties


dialog:

• Name: Enter a descriptive name for display on the


Category page.
• Enabled When: Enter a conditional statement to
determine under what input conditions the Category page
is to be enabled. If a Category is disabled, the user will
still be able to view the contents, but all input fields will be
disabled. See the section entitled ‘Conditional
Statements, Layers & Filters’ in this chapter for more
details.

Deleting a Category
To delete a particular Category page, you must first ensure that you are
in the Parameters section of the Design Editor and have the Segment
open in the Script window. The most straightforward method is to use
the Parameters Bar.

If you cannot see this toolbar, go to the main menu bar and select
View | Parameters Bar. Left click the Delete Category button. Delete Category
Button
Text Field
Text fields are used primarily to add descriptive comments as input, or
to define signals to be used as internal output variables within the
component. See ‘Internal Output Variables’ in this chapter for more
details.

PSCAD User’s Guide 357


Chapter 8: Designing Components

Adding Text Fields


To add a Text Field, you must first ensure that you are in the Parameters
section of the Design Editor, and on the required category page. The
most straightforward method is to use the Parameters Bar.

If you cannot see this toolbar, go to the main menu bar and select
View | Parameters Bar. Left click the New Text Field button – a Text
New Text Field Field should appear within the Category page.
Button
Another method is to use the right-click menu: Move the mouse pointer
over a blank area of the Category page itself (preferably near over the
Category Name). Right-click and select New Control | New Text
Field.

The new Text Field should appear somewhere within the Category
page.

Moving and Resizing Text Fields


To move the new Text Field, left-click overtop the field to select it (grips
appear).

The Text Field Can now be moved in one of two ways

1. Click again and hold down the left button. Move your mouse
around.

358 PSCAD User’s Guide


PSCAD

2. Use the arrow keys on your keyboard. Press and hold an


arrow key to move the field in large increments. Tap the
arrow key to move the field in small increments.

To resize the new Text Field, left-click overtop the field to select it (grips
appear). Select a grip, hold down the left button and move in an
outwards direction.

Changing Text Field Properties


Text Field properties can be adjusted through the Format Text Label
dialog window. To change the Text Field properties: Right-click over
the Text Field and select Properties….

As shown above, features such as name and width can be adjusted.

• Symbol: Enter a name for the Text Field. Note that this
name must be compatible with standard Fortran naming
conventions (i.e., it must begin with a non-numeric
character, do not include spaces, etc.).
• Caption: Enter text to describe the Text Field. What is
entered here will be displayed in the Category page
directly to the left of the Text Field box.
• Default: Use this field to add text, which will show up as
default text in the Text Field box.

PSCAD User’s Guide 359


Chapter 8: Designing Components

• Enabled When: Enter a conditional statement to


determine under what input conditions the Text Field is to
be enabled. See the section entitled ‘Conditional
Statements, Layers & Filters’ in this chapter for more
details.

Options:

• Show Symbol: Select this to display the contents of


Symbol directly to the left of the Text Field box.
• Show Caption: Select this to display the contents of
Caption directly to the left of the Text Field box.

Cut, Copy, Paste and Delete Text Fields


You can cut, copy or paste a Text Field by using one of two methods:

Cut, Copy and • Select on the Text Field with a left mouse click so that
Paste Buttons grips appear. Click the Cut or Copy buttons from the
Main Toolbar. Click the Paste button Main Toolbar to
paste.
• Right-click on the Text Field and select Cut or Copy from
the pop-up menu. Right-click over a blank area of the
Category page and select Paste from the pop-up menu.

Input Field
Input Fields allow the user to add the required numerical input to the
component. They can also be used (instead of an external input
connection) to import a defined signal from elsewhere in the system
directly as on-line input to the component (i.e., for signal feedback).

Adding Input Fields


To add an Input Field, you must first ensure that you are in the
Parameters section of the Design Editor, and on the required category
page. The most straightforward method is to use the Parameters Bar.

New Input Field If you cannot see this toolbar, go to the main menu bar and select
Button View | Parameters Bar. Left click the New Input Field button – an

360 PSCAD User’s Guide


PSCAD

Input Field should appear within the Category page.

Another method is to use the right-click menu: Move the mouse pointer
over a blank area of the Category page itself (preferably near over the
Category Name). Right-click and select New Control | New Input
Field.

The new Input Field should appear somewhere within the Category
page.

Moving and Resizing Imput Fields


To move the new Imput Field, left-click overtop the field to select it
(grips appear).

The Input Field Can now be moved in one of two ways

1. Click again and hold down the left button. Move your mouse
around.
2. Use the arrow keys on your keyboard. Press and hold an
arrow key to move the field in large increments. Tap the
arrow key to move the field in small increments.

To resize the new Imput Field, left-click overtop the field to select it
(grips appear). Select a grip, hold down the left button and move in an
outwards direction.

Changing Input Field Properties


Input Field properties can be adjusted through the Format Text Label
dialog window. To change the Text Field properties: Right-click over

PSCAD User’s Guide 361


Chapter 8: Designing Components

the Text Field and select Properties….

As shown above, features, such as name and width, can be adjusted.

• Symbol: Enter a name for the Input Field. Note that this
name must be compatible with standard Fortran naming
conventions (i.e., it must begin with a non-numeric
character, do not include spaces, etc.).
• Caption: Enter text to describe the Input Field. What is
entered here will displayed in the Category page directly
to the left of the Input Field box.
• Width: Select the character width of the Input Field box
itself.
• Data Type: Select Integer, Real or Logical. This input
defines the type of input variable and is based on the
standard Fortran INTEGER or REAL declarations
• Default: Use this field to add a value, which will show up
as the default value in the Input Field box. Assume that a
user who is not familiar with this component might simply

362 PSCAD User’s Guide


PSCAD

accept your default value for lack of a better value. So,


do your best to enter an appropriate value.
• Units: Add a unit (if any) for the input value. The unit
has no effect on the value itself, and is used simply for
reference and display purposes. The unit field will accept
most standard units, to which you may add metric prefix
(i.e., kV, MV, mA, etc.).
• Min / Max: Enter the maximum and minimum value
limits. If you are unsure of what these limits should be, or
limits are not required, simply enter -1e+038 and 1e+038
respectively. If a user enters a value outside this range,
PSCAD will provide a warning in the Output Window.
• Enabled When: Enter a conditional statement to
determine under what input conditions the Input Field is
to be enabled. See the section entitled ‘Conditional
Statements, Layers & Filters’ in this chapter for more
details.

Options:

• Show Symbol: Select this to display the contents of


Symbol directly to the left of the Input Field box.
• Show Caption: Select this to display the contents of
Caption directly to the left of the Input Field box.
• Allow Variables: If this option is selected, then this input
will accept non-numerical user input. This option is
selected when the Input Field is to be controlled by an
externally defined signal (either constant or variable). See
the ‘Allowing Variables’ section in this chapter for more
details.

Cut, Copy, Paste and Delete Input Fields


You can cut, copy or paste a Input Field by using one of two methods:

• Select the Input Field with a left mouse click so that grips Cut, Copy and
appear. Click the Cut or Copy buttons from the Main Paste Buttons
Toolbar. Click the Paste button Main Toolbar to paste.
• Right-click on the Input Field and select Cut or Copy from
the pop-up menu. Right-click over a blank area of the
Category page and select Paste from the pop-up menu.

PSCAD User’s Guide 363


Chapter 8: Designing Components

Allowing Variables
The allowance of variable signals can be a useful feature for reducing
the amount of external connections in the component graphic, as well
as adding flexibility to the component input parameters.

By selecting the Allow Variables feature, the Input Field will accept
either numerical or non-numerical user input. In other words, you can
either enter a numerical constant value, or you can enter the symbol
name of a signal that has been defined elsewhere in the project. In this
way, Input Fields can be used in the same manner as external
See the section in this connections.
chapter called Connections
for more details.

EXAMPLE 8-2:

A user needs to use an instantaneous measured voltage, from a remote


location in the system, as feedback to a user-defined source component.
The first step is to ensure that the measured voltage signal is actually
defined somewhere in the system. That is, it is being generated by a
Voltmeter component similar to that shown below:

Va

The second step is to define an Input Field that will accept the measured
signal Va as input: In the Parameters section of the Component
Definition, add a new Input Field on an existing category page. Change
the properties of the Input Field as follows:

Note that the Symbol input has been labelled as ‘Va’ and that the
Allow Variables option has been selected.

364 PSCAD User’s Guide


PSCAD

The Allow Variables option should remain deselected if the particular


Input Field is intended to be a constant value only.

Choice Box
Choice boxes are used to allow the user to set conditions within the
component, according to a selected choice. Choice boxes can be
included in a category page as either a Drop Style, or Radio Style. In
each case, the choice of selection selected will have an associated
integer number, for use internally for conditional statements.

Adding Choice Boxes


To add a Choice Box, you must first ensure that you are in the
Parameters section of the Design Editor, and on the required category
page. The most straightforward method is to use the Parameters Bar.

If you cannot see this tool bar, go to the main menu bar and select
View | Parameters Bar. Left click the New Choice Box (Radio Style) New Choice Box
or the New Choice Box (Drop Style) button - a new Drop List or set of (Radio and Drop
Radio Buttons should appear within the Category page. Style) Buttons

Another method is to use the right-click menu: Move the mouse


pointer over a blank area of the Category page itself (preferably near
over the Category Name). Right-click and select New Control |
Choice Box (Radio Style) or New Control | Choice Box (Drop
Style).

The new Choice Box should appear somewhere within the Category
page.

PSCAD User’s Guide 365


Chapter 8: Designing Components

Moving and Resizing Choice Boxes


To move the new Choice box, left-click overtop the field to select it
(grips appear).

The Choice Box can now be moved in one of two ways

1. Click again and hold down the left button. Move your mouse
around.
2. Use the arrow keys on your keyboard. Press and hold an
arrow key to move the field in large increments. Tap the
arrow key to move the field in small increments.

To resize the new Choice Box, left-click overtop the field to select it
(grips appear). Select a grip, hold down the left button and move in an
outwards direction.

Changing Choice Box Properties


Choice Box properties can be adjusted through the Choice Box
Properties dialog window. To change the Choice Box properties:
Right-click over the Choice Box and select Properties….

366 PSCAD User’s Guide


PSCAD

As shown above, features, such as name and width, can be adjusted.

• Symbol: Enter a name for the Choice Box. Note that this
name must be compatible with standard Fortran naming
conventions (i.e., it must begin with a non-numeric
character, do not include spaces, etc.).
• Caption: Enter text to describe the Choice Box. What is
entered here will be displayed in the Category page
directly to the left of the Choice Box.
• Width: Select the character width of the Choice Box
itself.
• Choices: Configure the choice list as described in the
section entitled ‘Adding Choices to a Choice Box’ below.
• Style: Select Drop List or Radio Buttons.
• Enabled When: Enter a conditional statement to
determine under what input conditions the Choice Box is
to be enabled. See the section entitled ‘Conditional
Statements, Layers & Filters’ in this chapter for more
details.

Options:

• Show Symbol: Select this to display the contents of


Symbol directly to the left of the Choice Box.
• Show Caption: Select this to display the contents of
Caption directly to the left of the Choice Box.

Cut, Copy, Paste and Delete Choice Boxes


You can cut, copy or paste a Choice Box by using one of two methods:

• Select the Choice Box with a left mouse click so that grips
Cut, Copy and
appear. Click the Cut or Copy buttons from the Main
Paste Buttons
Toolbar. Click the Paste button Main Toolbar to paste.
• Right-click on the Choice Box and select Cut or Copy
from the pop-up menu. Right-click over a blank area of
the Category page and select Paste from the pop-up
menu.

Adding Choices to a Choice Box


The choice input area can be broken down into three main parts:

PSCAD User’s Guide 367


Chapter 8: Designing Components

Choice editing field, the choice list and the control buttons. When a
new Choice Box is created, one choice is added by default.

To add more choices to the list, click the Dup button.

To edit the contents of a choice: Left-click on the choice name within


the list to select it, or use the Up or Dn buttons to scroll up or down
the choice list respectively. The contents of the selected choice will
appear in the choice-editing field at the top. Left-click within the edit
field so that a flashing cursor appears, and then edit the contents.

368 PSCAD User’s Guide


PSCAD

Note that when adding choices to the choice box, the most important
thing to remember is that a unique number must be assigned to each
entry in the choice list. This is accomplished by simply adding a prefix
to each entry in the form of:

<Assigned Number>=

It is this assigned number that will be associated with the Symbol name
of this choice box.

You can set the choice that will appear as the default selection, as
follows: Left-click on a choice name within the list to select it, or use
the Up or Dn buttons to scroll up or down the choice list respectively.
Once selected, left-click the Default button – the associated integer
will appear in the field directly to the right of the Default button.

To delete a choice in the choice list, left-click on a choice name within


the list to select it, or use the Up or Dn buttons to scroll up or down
the choice list respectively. Left-click the Del button.

Undo and Redo


To undo or redo any changes in the Parameters section, select the Undo
or Redo buttons in the Main Toolbar, press Ctrl + Z or Ctrl + Y, or right-
click over a blank part of the Parameters window and select Undo or
Redo
Undo and Redo
Buttons

PSCAD User’s Guide 369


Chapter 8: Designing Components

Find Symbol
The Parameters section includes a search feature for finding parameter
Symbol Names in all Category pages that exist. To invoke this feature,
you must first ensure that you are in the Parameters section of the
Design Editor. The most straightforward method is to use the
Parameters Bar.

If you cannot see this toolbar, go to the main menu bar and select
View | Parameters Bar. Left click the Find Symbol button.
Find Symbol
Button Another method is to use the right-click menu: Move the mouse
pointer over a blank area of the Parameters window. Right-click and
select Find Symbol.

370 PSCAD User’s Guide


PSCAD

In either case, the Find Symbol dialog should appear.

Enter the Symbol Name of the Text Field, Input Field, or Choice Box you
are looking for (do not enter the Caption) and click OK.

If the Symbol Name exists in any of the Category pages, you will
automatically be brought to that Category, and the corresponding field
will appear selected (i.e., with grips).

Saving and Reloading Parameters


Any changes made to your component parameters should be saved
regularly. To save changes, simply exit the component definition (i.e., Return to Circuit
go back to the Circuit window). To do this, either left double-click the View Button
project name in the Workspace window, or click the Return to Circuit
View button in the Parameters Bar.

If you cannot see this toolbar, go to the main menu bar and select
View | Parameters Bar.

If desired, you can at any time reload the parameter Categories from
the time at which they were last saved, by pressing the Reload
Parameters button. Reload Parameters
Button
Another method is to use the right-click menu: Move the mouse
pointer over a blank area of the Graphics window. Right-click and
select Reload Dialog.

PSCAD User’s Guide 371


Chapter 8: Designing Components

Caution should be exercised with this function, as once the graphics are
reloaded, all changes will be lost.

CONDITIONAL STATEMENTS, LAYERS & FILTERS


All objects associated with either the Graphical Interface or the
Parameters Sections will include an input field labelled either Enabled
When or Visible When. Within these fields, the user may add
statements to either enable/disable the object, or make the object
visible/invisible according to specified logical conditions.

Conditional Statements
The primary purpose of the conditional statement is to either enable or
disable an object (as in an Input Field), or to make an object visible or
invisible (as in a Graphical Object).

Conditional statements can specify a logical condition by using both


Arithmetic and Logical Operators, and usually exist as an input
parameter either in a Graphical Object, a Category or an Input Field
properties dialog. They are always based on the value of either an Input
See the section on Logical
Operators in Chapter 9 for
Field or Choice Box, which has been previously defined in the
more details on logical component definition.
statements.
In this way, the component graphic will change, and certain inputs can
be enabled or disabled according to user input. This functionality tends
to add another dimension to the component, and can make it easier to
use and understand.

372 PSCAD User’s Guide


PSCAD

EXAMPLE 8-3:

A component designer wants to change the appearance of a


component according to user-selected input. The component graphic is
to be either an ellipse or a rectangle, depending on a Choice Box with
Symbol Name Type. The Choice Box specifies two choices: Ellipse,
which is given the value ‘0,’ and Rectangle, which is given the value
‘1.’

In the component graphic section, the designer draws a simple ellipse


and a simple rectangle:

In the properties dialog for the ellipse object, the following conditional
statement is added to the Graphic is Visible When input field:

Type == 0

In the properties dialog for the rectangle object, the following


conditional statement is added to the Graphic is Visible When input
field:

Type == 1

Now, if a user selects ‘Ellipse’ in the Choice Box, only the ellipse will
appear in the component graphic. If ‘Rectangle’ is chosen, only the
rectangle will appear.

Conditional statements are not only limited to one logical truth. You
may actually use several logical conditions in one statement. For

PSCAD User’s Guide 373


Chapter 8: Designing Components

example, say there was another Choice Box added to the component of
Example 8-3 with Symbol Name Type2. Now assume that in order for
the ellipse to be visible on the component graphic, it is required that
Type2 also have a value of ‘3’ (in addition to Type having a value of
‘0’). Then the following conditional statement would need to appear in
Graphic is Visible When input field of the ellipse object properties
dialog:

(Type == 0) && (Type2 == 3)

The above states: If Type equals 0 and Type2 equals 3, then make the
ellipse visible.

Arithmetic Operators may also be used in conditional statements. For


example the following statement is also valid:

(Type + Type2 ==3)

The above states: If the sum of Type and Type2 equals 3, then make the
ellipse visible.

NOTE: Care must be exercised when using the divide (/) function, as a
‘divide by zero’ error can occur.

Layers
As component graphics become larger and more complicated, the
graphical working environment can become quite unruly – especially
when many conditional statements are used.

Fortunately, there is a way to avoid all of this clutter by using the


graphical Layers available in the Graphics section of the Design Editor.
Layers are based on conditional statements, in that whenever a
Conditional Statement is entered into Graphic Object, a new layer is
created. Any other Graphic Object, which utilizes an identical
conditional statement, will also be included in that particular Layer.

Viewing Layers
By default, all Layers will be visible in the Graphics window unless you
adjust Layer visibility manually. To adjust the visibility, you must first
ensure that you are in the Graphic section of the Design Editor. Move
the mouse pointer over a blank area of the Graphic window. Right-
click and select Layers. If we right-click within the Graphic window of
the component shown in the ‘Conditional Statements’ section above,
then we would see:

374 PSCAD User’s Guide


PSCAD

Be sure when adding


Conditional Statements that
the statements themselves
are identical in format, as
well as logical truth. If the
statements vary slightly in
format, a separate layer will
be created, even though the
statements may indicate the
same thing.

Simply select or deselect each Layer to make visible or invisible


respectively. You can also select Show All to make all Layers visible.

There is also a button on the Graphic Palette, which will allow you
toggle between showing and hiding all Layers called Show/Hide All
Layers. Show/Hide All
Layers Button

If you cannot see this toolbar, go to the Main Menu bar and select
View | Graphic Palette.

Setting Layers
Instead of turning layers on and off through the right-click menu, you
can also perform this function graphically using the defined Category
pages and fields in the Parameters section.

To set the Layers graphically, you must first ensure that you are in the
Graphic section of the Design Editor. The most straightforward method
is to use the Parameters Bar.

If you cannot see this toolbar, go to the main menu bar and select View
Set Layers Button
| Parameters Bar. Left click the Set Layers button.

PSCAD User’s Guide 375


Chapter 8: Designing Components

Another method is to use the right-click menu: Move the mouse


pointer over a blank area of the Parameters window. Right-click and
select Set Layers.

In either case, the Parameters dialog window should appear as it would


if a user was accessing the component properties. You may then
proceed to change the various fields directly. When the OK button is
selected, the viewable Layers in the Graphic window will adjust
themselves according to the new conditions.

Graphic Filters
In addition to the Layers, you can also use the Graphic Filter function to
help alleviate graphical clutter. Graphic Filters allow the user to view
objects based on the Graphic Object type (i.e., Connections, Text
Labels, etc.).

To adjust the Graphic Filters, you must first ensure that you are in the
Graphic section of the Design Editor. Move the mouse pointer over a
blank area of the Graphic window. Right-click and select Graphic
Filters.

376 PSCAD User’s Guide


PSCAD

THE SCRIPT SECTION


Contained within the Script section is the heart of the Component
Definition, that is, where the characteristics of what the component is
supposed to do. There are many features in this section to help the
user to program components efficiently so as to make best use of
EMTDC.

The Script section is used exclusively for code entry and consists of a
variety of Segments, each performing a specific function. Not all
Segments need be utilized in every component: For example, the
Transformers Segment is used only for defining mutually coupled
circuits, or the T-Lines Segment for constructing transmission line tower
properties. The most commonly used Segments are Fortran,
Computations and Branch, and these are included by default in every
new Component Definition.

The Segments that your Component Definition will require depend on


what function your component is to perform. Are pre-calculations
required? Is it an electrical component? Is there Fortran code
involved? The following sections describe each available Segment in
detail.

Segments
Within the Script section of the Design Editor, Segments are ordered
similar to pages in a book. Segments are essentially simple text files,
where data, script or code is added to perform a specific task.

PSCAD User’s Guide 377


Chapter 8: Designing Components

Segments may be added or deleted, but must follow a strict naming


convention.

Adding a New Segment


To add a new Segment to your Component Definition, you must first
ensure that you are in the Script section of the Design Editor. The most
straightforward method is to use the Script Bar.

If you cannot see this toolbar, go to the main menu bar and select
New Segment View | Script Bar. Left click the New Segment button - the Add
Button
New Segment dialog should appear.

From the Data Segment drop list, select the desired Segment and then
press the Add button.

378 PSCAD User’s Guide


PSCAD

A new Segment should then be added to the Script section. Note also,
that the Add New Segment dialog provides a short description of each
selected Segment. Press Cancel to cancel the operation.

Viewing Segments
As mentioned above, categories are organized similar to pages in a
book. Once you have added more than one Segment, there may be a
need to navigate through them. The most straightforward method is
to use the Script Bar.

If you cannot see this toolbar, go to the main menu bar and select
View | Script Bar. Left click the down arrow on the View Segment
View Segment
drop list, as shown below: Drop List

Deleting a Segment
To delete a particular Segment, you must first ensure that you are in the
Script section of the Design Editor and have the Segment open in the
Script window. The most straightforward method is to use the Script
Bar.

If you cannot see this toolbar, go to the main menu bar and select
View | Script Bar. Left click the Delete Segment button. Delete Segment
Button
Segment Types
As mentioned previously, there are several Segment types available,
each existing for a specific purpose, but are only required if that specific
function is required for the component. Most of the time, a
component will only need to make use of two or three of these
Segments.

PSCAD User’s Guide 379


Chapter 8: Designing Components

Computations
Values entered into the component properties dialogs by the user are
not always in the most convenient form, or they need to be
manipulated or combined with other values in order to be utilized by
the component. The Computations Segment allows the component
designer to perform these operations on data, during a pre-compilation
process (i.e., at time = 0.0).

A typical Computations segment entry would have the following


standard format:

<RESULT_TYPE> <Name> = <Expression>

Where <ResultType> may be either a REAL or INTEGER type value. If


omitted, it is assumed to be REAL. <Expression> must contain constant
parameters.

EXAMPLE 8-4:

A designer wants to convert an input parameter with Symbol Name


Vset in kV, to a per-unit value called SetPU, before it is used in
component Fortran code. An additional input parameter with Symbol
Name Vbase in kV is also available in order to define the system
voltage base.

The Computations Segment should then contain the following:

REAL SetPU = Vset / Vbase

See Chapter 9 for more


details on the PSCAD Script Notice that the Substitution Prefix Operator ($) is not used here.
Operators.

Branch
The Branch Segment is where the user can define what type of
elements that should be placed between electrical Connections defined
in the Graphic section of the Component Definition. Branch statements
can be used to place resistors, capacitors, and inductors (in series and
parallel), as well as define switching branches and those that contain an
ideal voltage source.

380 PSCAD User’s Guide


PSCAD

The Branch Segment provides an easy method to set-up complicated


electrical systems, and alleviates the need for coding EMTDC Internal
Variable definitions. This Segment could be considered as a graphical
user’s interface to the Branch-Based Electric Interface in EMTDC.

A typical Branch Segment entry would have the following standard See the EMTDC User’s
format: Guide for more details on
the Branch-Based Electric
Interface.
[<Branchname> = ] <TO> <FROM> [<Keyword>] <R> [<L>] [<C>]

Where <TO> and <FROM> are electrical Connections (nodes) defined in


the Interface section of the Design Editor, <R> is the resistance value of
the branch [Ω], <L> is the inductance of the branch [H], and <C> is the
capacitance of the branch [µF]. [<Branchname> = ] is an optional
statement, and is used to give the branch a name, which can be used to
refer to the branch (instead of its nodes) in other sections. [<Keyword>]
can be either ‘SOURCE’ or ‘BREAKER’ and is explained in the following
sections. Many EMTDC subroutines require the branch name as an
argument.

It is possible to define a RLC branch in one statement. If, however, a


branch does not contain all three types of elements, simply substitute
0.0 for the value of the element that is not present.

EXAMPLE 8-5:

A designer wants to define a component, which represents an RC series


branch, connected in parallel with a purely inductive branch, between to
electrical Connections (nodes) N1 and N2. These two nodes have
already been defined in the Interface section of the Component
Definition.

The values of R and C are to be entered though Input Fields (with


Symbol Names R and C respectively) in the Parameters section of the
Component Definition. The inductance value is not accessible to the

PSCAD User’s Guide 381


Chapter 8: Designing Components

user and is given a value of 0.001 H directly.

The Branch Segment should then contain the following two statements:

$N1 $N2 $R 0.0 $C


$N1 $N2 0.0 0.001 0.0

The designer then decides to refer to the branches separately in other


sections of the Component Definition, and gives them names BRN1 and
BRN2. The above Branch statements should then be modified as
follows:

BRN1 = $N1 $N2 $R 0.0 $C


BRN2 = $N1 $N2 0.0 0.001 0.0
If BRN1 and BRN2 are used
in other EMTDC sections,
they must be preceded by
the Substitution Prefix
Operator ($).

As mentioned previously, the branch may also contain a voltage source


in series with the R, L and C elements. The Branch Segment syntax
allows you to indicate to PSCAD that there is a voltage source in a
particular branch as follows:

[<Branchname> = ] <TO> <FROM> SOURCE <R> <L> <C>

Now that PSCAD knows that there is a source in a branch, control of


the source (i.e., magnitude, etc.) is then up to the user. This is
accomplished by defining the EMTDC Internal Variable ‘EBR’ every time
See Chapter 5 in the EMTDC step, directly in the model code itself. The EBR definition statement
User’s Guide for more
details on the EBR Internal would appear similar to the following:
Variable.
EBR(<Branchname>,<Subsystem>) = <Voltage_Expression>

Where <Subsystem> is the subsystem number, which is pre-defined


automatically by PSCAD. <Voltage_Expression> is the expression used
to define the voltage source magnitude.

382 PSCAD User’s Guide


PSCAD

EXAMPLE 8-6:

A designer adds a source branch to the component in Example 8-5,


which is to be connected between node N1 and a ground electrical
Connection GND. The source possesses a source resistance RS, which
can be entered as an input parameter.

The Branch Segment should then contain something similar to the


following:

BRNS = $GND $N1 SOURCE $RS 0.0 0.0


BRN1 = $N1 $N2 $R 0.0 $C
BRN2 = $N1 $N2 0.0 0.001 0.0

The source is controlled using ‘EBR’ in the designer’s code and would
appear similar to the following for a standard AC source:

EBR(BRNS,SS) = V*SIN(THETA)

The variables ‘V’ and ‘THETA’ are defined within the same code.

The Branch Segment syntax also allows you to indicate to PSCAD that a
particular branch is a switching branch:

[<Branchname> = ] <TO> <FROM> BREAKER <Initial_Value>

Where <Initial_Value> is the initial resistance of the switch [Ω]. This


value is used for initialization purposes and does not affect the
simulation. A good default value to use is 1.0.

Fortran
The Fortran section is where any Fortran code, defining what the
component is to model, is placed. Code entered in this section should
either be in the form of standard formatted Fortran 77, or PSCAD Script
(or a combination of these two). Fortran 90 format is not recommended
here, as some incompatibility problems can occur during compilation
(line breaks for example). It is also possible to define a function, or call
an external subroutine from this section.

PSCAD User’s Guide 383


Chapter 8: Designing Components

Although Fortran segment code must be in Fortran 77 format, PSCAD


will convert it to a form that is compatible with both Fortran 77 and 90
formats when the project is compiled. Code existing in external source
files (i.e., subroutines or functions) should be compatible with both
Fortran 77 and Fortran 90 however. This will avoid compatibility
See Chapter 5 of the problems between the various Fortran compilers available for use with
EMTDC User’s Guide for
more details on writing
PSCAD. When using formatted Fortran in the Fortran segment, it is
custom code. important to note that all lines of code should be preceded by six
spaces.

EXAMPLE 8-7:

The following code is a simple example of how standard formatted


Fortran would appear in the Fortran section. This code defines an
instantaneous voltage source magnitude VT, according to the value of
an input parameter Type. If Type = 0, then the magnitude is
calculated using the standard equation for a sinusoidal source with
phase shift:

v ( t ) = V peak ⋅ sin( 2π f ⋅ t + φ )

If Type = 1, then the source magnitude is a constant given by VDC.


FREQ and PHI are also input parameters defined in the Parameters
section of the Component Definition. TWO_PI is an EMTDC Internal
Constant.

! Calculation of an AC or DC voltage source magnitude


!
!23456 Remember to precede code by at least six spaces!
!
IF ( $TYPE .EQ. 0 ) THEN
!
! AC source
!
$VT = $VPEAK*SIN( TWO_PI*$FREQ*TIME + $PHI )
ELSE
!
! DC source
!
$VT = $VDC
ENDIF

384 PSCAD User’s Guide


PSCAD

This same code could also be written as a combination of standard


Fortran and PSCAD Script as follows:

! Calculation of an AC or DC voltage source magnitude


!
#IF $Type == 0
!
! AC source
!
$VT = $VPEAK*SIN( TWO_PI*$FREQ*TIME + $PHI )
#ELSE
!
! DC source
!
$VT = $VDC
#ENDIF

Note that the above two examples have been simplified slightly.
Generally speaking, the value for 2πf ⋅ t function should never be
allowed to simply grow larger and larger as the simulation progresses.
It should be reset to zero whenever is reached.

2πf ⋅ t = 2π

There are pros and cons to adding standard Fortran code directly into
the Fortran Segment, as opposed to calling a subroutine or function.
Here are some key points to consider:

• All EMTDC Internal Variables may be utilized, without the


need to declare them or add files, when coding in the
Fortran section.
• PSCAD Script may only be utilized when coding in the
Fortran section.
• All code placed in the Fortran Segment will be added
directly to the module Fortran file (<module>.f), when the
project is compiled. If there is a large amount of code
and/or there are many instances of this component in the
project, the Fortran file can become huge and difficult to
debug. In such cases, it would be wise to create a
See Chapter 2 of the
function or subroutine, which could then be called from EMTDC User’s Guide for
the Fortran Segment. Also, if standard Fortran line more details on EMTDC
Program Structure.
numbers are used in your code, these same numbers may
appear multiple times in the Fortran file (<module>.f),
causing compiler errors.

PSCAD User’s Guide 385


Chapter 8: Designing Components

The Fortran Segment is a ‘smart’ segment, in that code placed here will
be intelligently placed in the EMTDC System Dynamics, in order to
avoid problems with time step delays. In other words, PSCAD will
choose to place the code in either the DSDYN or DSOUT subroutines,
according to what variables are being defined in the code, and what this
component is connected to in the project.

DSDYN
This Segment is identical to the Fortran Segment, except that all code
will be forced into the DSDYN subroutine in the EMTDC System
Dynamics.

DSOUT
This Segment is identical to the Fortran section, except that all code will
be forced into the DSOUT subroutine in the EMTDC System Dynamics.

Checks
The Checks Segment is used to ensure that data entered into the
component input parameters by the user is reasonable. If a specific
condition is true, then a given warning or error message can be made
to appear in the Output Window when the case is compiled.

A typical Checks Segment entry would have the following standard


format:

<MESSAGE TYPE> <Message> : <Expression>

<MESSAGE TYPE> is the first word in the message line and must be
chosen as either WARNING or ERROR depending on how severe the
problem is. If chosen as a warning, the message will appear as a
warning in the Output Window. If specified as an error, then the
simulation will be stopped until the condition is rectified.

<Message> is the diagnostic message that is printed if an error or


warning is produced. This message should be descriptive enough for
another user to determine what the problem is, and where it is coming
from.

<Expression> is the test used to determine if an error or warning


message should be generated. This expression is based on negative
logic, which means the message is generated only if the expression
evaluates to False.

386 PSCAD User’s Guide


PSCAD

EXAMPLE 8-8:

A designer’s component contains an input for frequency with Symbol


Name F. The designer wants to ensure that only a value greater than
zero is entered.

The Checks Segment should then contain the following:

ERROR System frequency must be greater than zero : F > 0.0

Both Logical and Arithmetic Operators may be used in the expression.


For Example:

WARNING R1 / R2 must be greater than 100 : R1 > 100*R2

Remember that negative logic is used in the above examples!

Help
The Help Segment is useful when the user wants to provide an external
HTML based help file for a particular component. For example if the
user has created an HTML document entitled ‘[Link]’ for a particular
component, then all that is required is that the name and extension be
added to the Help Segment as shown below:

[Link]
See Chapter 4 for more
details on how to access
help.
Then, when a user right-clicks on the component in the Circuit window
and selects Help from the pop-up menu, the external document
indicated will open.

In order to reduce confusion when linking components to help


documents, the path to the Library Project (*.psl) file in which the
Component Definition is located, will be appended to the filename.
Therefore, the external help file must always be located in the
same directory as the parent Library Project.

PSCAD User’s Guide 387


Chapter 8: Designing Components

Comments
Add your comments / reminders / notes about the design of this
component here. Do not use this Segment as a means of providing
help to users. This Segment is ignored by PSCAD and is accessible only
when you are editing the definition.

FlyBy
The FlyBy Segment provides an avenue to allow the designer to
incorporate the PSCAD FlyBy help feature to a Component Definition.
FlyBy windows can help to provide users with a quick description of the
model itself, or even individual Connections on the component.

The FlyBy section syntax is straightforward:

<Descriptive text for the component>

: <Connection_Symbol_Name>

<Descriptive text for the connection>

EXAMPLE 8-9:

A designer wants to add FlyBy help to the component below:

A
User C
B Component

In addition to a general description of the component, the designer

This is my User Component


:A
This is input A
:B
This is input B

wants to provide a FlyBy for each of the input Connections A and B.

The FlyBy section should then contain the following:

388 PSCAD User’s Guide


PSCAD

If the mouse pointer is now moved over the component in normal


Circuit view, the following FlyBy windows will appear:

Transformers
The Transformers Segment is used both to define data for any existing
mutual impedance matrices, as well as to provide dimensioning
information to EMTDC regarding transformers and windings. A single
component may contain multiple mutual impedance matrices.

The user must include transformer information in three main parts:

PSCAD User’s Guide 389


Chapter 8: Designing Components

• Number of transformers (matrices): This is


accomplished through the use of a #TRANSFORMERS
directive. See Chapter 9 for more details on this directive.
• Number of Windings: This number will define the
dimension of each matrix. If this number is given as a
positive value, then PSCAD will assume that the matrix is
in non-inverted format, and therefore the matrix data
See the EMTDC User’s must be entered directly. If the number is negative, it
Guide for more on signifies that this transformer is ‘ideal’ (i.e., contains only
transformer modelling
theory and the difference inductance) and PSCAD will assume that the matrix is
between ‘ideal’ and non- already inverted. The matrix data must therefore be
ideal in PSCAD.
entered accordingly.
• Matrix Data: The matrix data is entered here, depending
on whether the transformer is ‘ideal’ or not.

According to the above description, a basic Transformers Segment


would appear as follows (for a classical type transformer) in general
format:

#TRANSFORMERS <Number_of_Transformers>
Note that the Transformers <Prefix><Number_of_Windings> /
segment format is different <Node_1> <Node_2> <R_11> <L_11> /
when defining a UMEC type
transformer. For more <Node_2> <Node_3> <R_12> <L_12> <R_22> <L_22> /
information on the UMEC ...
format, see the UMEC
transformer component
definitions in the Master
Library, or contact PSCAD
Support Services
<Prefix> is not mandatory, but is required to indicate an ‘ideal’
(support@[Link]). transformer matrix (i.e., already inverted). Also, resistance values (i.e.,
<R_xx>) are not required if the transformer is ‘ideal.’

Note that only the diagonal and the data below the diagonal need to
be entered. The matrix is assumed to be symmetrical.

EXAMPLE 8-10:

A user wants to create a non-ideal single-phase, two-winding


transformer. The component Graphics, Parameters and other Script
Segments, have already been included. The component electrical
Connections have been set-up, as shown below in the Graphic section.

390 PSCAD User’s Guide


PSCAD

The winding self and mutual resistance and inductance parameters have
been defined and given Symbol Names ‘R11,’ ‘L11,’ ‘R12,’ ‘L12,’ ‘R22’
and ‘L22.’

The Transformers Segment should then appear similar to the following:

#TRANSFORMERS 1
!
2 /
$A1 $B1 $R11 $L11 /
$A2 $B2 $R12 $L12 $R22 $L22 /
!

When designing a component with more than one transformer, you can
use a special syntax (called simply 888 syntax) so that, if all the matrix
elements are identical, you can avoid entering the repetitive data. This
is especially useful if the mutual impedance matrices are very large and
numerous.

EXAMPLE 8-11:

In the example above, the user wants to modify the component, so that
it contains two identical single-phase transformers within it. The

PSCAD User’s Guide 391


Chapter 8: Designing Components

component electrical Connections have been set-up, as shown below in


the Graphic section.

The Transformers Segment should then appear similar to the following:

#TRANSFORMERS 2
!
2 /
$A1 $B1 $R11 $L11 /
$A2 $B2 $R12 $L12 $R22 $L22 /
!
888 /
!
$A3 $B3 /
$A4 $B4 /

Model-Data
The Model-Data segment is used as a way to bring input data into a
user-defined subroutine, without having to declare an argument for
each bit of data. There is no specific format for text in this Segment, as
this format depends on READ statement within the users code.

392 PSCAD User’s Guide


PSCAD

When the project is compiled, PSCAD will include all text within this
Segment in the corresponding Data File, under the headings DATADSD
or DATADSO. If the subroutine is called from DSDYN, the Model-Data
contents will appear in the DATADSD section, and DATADSO otherwise.

In order to read this information, a standard Fortran READ statement See the EMTDC User’s
must be added to the user-defined subroutine as follows: Guide for more on Data
Files.

!
! Add include file to define IUNIT
!
INCLUDE ‘fnames.h’
!
! ...
!
READ(IUNIT,*) ...
!

Matrix-Fill
When a Project is initially compiled, PSCAD will construct a temporary
logical matrix for the purpose of indicating how the electrical system is
connected (i.e., how nodes and branches are put together). The
Optimize Node Ordering algorithm in PSCAD then uses this information
to optimize node placement in the actual system conductance matrix.
However, only electrical nodes and branches, defined within the Branch
Segments of each component present in the system, are considered.

Any internal node connections defined in Segments other than Branch


will not be included in this matrix. Therefore, the logical matrix may
have missing information, thereby reducing the effectiveness of the
Optimize Node Ordering algorithm. The Matrix-Fill Segment can be
used to ‘help’ this algorithm by providing the omitted connection
information for any internal component nodes.

The general format for a Matrix-Fill Segment statement would appear


as follows:

<Node_1> <Node_2> <Node_3> <Node_4> ...

Where <Node_#> is the Symbol Name of the Connection involved


with Matrix-Fill. All Connections in a single statement are assumed as
connected to each other.

PSCAD User’s Guide 393


Chapter 8: Designing Components

EXAMPLE 8-12:

A user creates a single-phase electrical circuit in PSCAD, which includes


a classical transformer component connected as follows:

As can be seen above, there are six electrical nodes in this system, and
therefore the system matrix will have dimension 6 x 6. Internal
connections internal to the transformer component cannot be
determined initially by PSCAD, and so when a logical matrix for the
Optimize Node Ordering algorithm is created, the transformer appears
as a ‘black box,’ as shown below:

The logical matrix for the Optimize Node Ordering algorithm would
appear as follows, where X indicates a known connection:

394 PSCAD User’s Guide


PSCAD

⎡X X 0 0 0 0⎤
⎢X X 0 0 0 0⎥
⎢ ⎥
X X
⎢0 0 0 0

⎢0 0 X X 0 0⎥
⎢0 0 0 0 X 0⎥
⎢0 ⎥
⎣ 0 0 0 0 X⎦

The matrix above does not contain all of the connection information
required, however. We know through the Transformers Segment in the
transformer component, that nodes N2, N3, N5 and N6 are all part of a
mutual impedance matrix and are hence all connected together, as
shown below:

By adding in Matrix-Fill information, we can tell PSCAD to add


connection information to the matrix, so it will appear as follows,
where ‘+’ indicates a connection added by Matrix-Fill:

⎡X X 0 0 0 0⎤
⎢X X + 0 + +⎥
⎢0 + X X + +

⎢ ⎥
⎢0 0 X X 0 0⎥
⎢0 + + 0 X +⎥
⎢0 + + + X ⎥⎦
⎣ 0

PSCAD User’s Guide 395


Chapter 8: Designing Components

If the four electrical Connections on the transformer were given as


follows in the Graphic section of the Component Definition,

then the Matrix-Fill Segment should appear as:

$A1 $B1 $A2 $B2

Note that in the above example, it assumed that all connections


between the four nodes involved are possible. If, however, only
connections, as shown below, are needed,

then the Matrix-Fill Segment should appear as:

$A1 $B2
$A2 $B1

396 PSCAD User’s Guide


PSCAD

T-Lines
The T-Lines Segment is used to specify any electrical Connections,
defined in the component Graphic section, to be used as sending or
receiving end electrical Connections for a Transmission Line or Cable.
The T-Lines Segment is rarely needed in component design. The
general format of a T-Lines Segment statement is given below:

<Subsystem_#> <Cond_1> <Cond_2> <Cond_3> ...

<Cond_#> signifies that any Connection Symbol Name that is entered


in this position will be the sending or receiving end Connection for that
particular conductor number in the T-Line or Cable properties.

This Segment is used only within the Transmission Line and Cable
Interface components in the Master Library.

Undo and Redo


To undo or redo any changes in the Script section, select the Undo or
Redo buttons in the Main Toolbar, press Ctrl + Z or Ctrl + Y, or right-
click over a blank part of the Script window and select Undo or Redo. Undo and Redo
Buttons

Text Colouring
In order to make component code easier to understand when read
from within the Script section, a colour-coding feature has been added.
Similar to Fortran viewed in popular developer software programs, all
PSCAD Script commands will appear in blue, while all commented code
will appear in green.

PSCAD User’s Guide 397


Chapter 8: Designing Components

INTERNAL OUTPUT VARIABLES


An Internal Output Variable is internal component data, which has been
made available as a signal to be plotted or monitored in PSCAD. Before
any internal quantities are made available however, they must be
defined within the component Fortran Segment using an #OUTPUT
directive.
For more on #OUTPUT
directives, see Chapter 9.
Internal data used as output can either come from an internal
component variable, from an EMTDC Storage Array, or as a measured
branch current or voltage from EMTDC.

Outputting EMTDC Measured Voltages and Currents


There are a couple of substitution operators that can be used with
#OUTPUT directives to extract measured quantities directly from
electrical system nodes and branches. These are described below.

CBR
CBR is a special substitution operator that will output the current
measured in a specified branch. A special syntax is used for this – see
the example below:

EXAMPLE 8-13:

A user wants to measure the current in a branch called ‘BRN.’ A Text


Field has been added to the component Parameters section with
Symbol Name ‘Ia.’

The following should then appear in the Fortran segment:

#OUTPUT REAL Ia {$CBR:BRN}

Note that ‘BRN’ is not preceded by a $ Prefix Operator.

VDC
VDC is a special substitution operator that will take the voltage
difference between two different electrical nodes. A special syntax is
used for this – see the example below:

398 PSCAD User’s Guide


PSCAD

EXAMPLE 8-14:

A user wants to measure the voltage difference between two


Connections defined within a user component, called ‘N1’ and ‘N2.’ A
Text Field has been added to the component Parameters section with
Symbol Name ‘Vdiff.’

The following should then appear in the Fortran Segment:

#OUTPUT REAL Vdiff {$VDC:N1:N2}

Note that ‘N1’ and ‘N2’ are not preceded by a $ Prefix Operator.

ADDING A REFERENCE TO A SOURCE FILE


In PSCAD, you may call a subroutine or function defined in an external
source file (i.e., *.f, *.f90, *.for or *.c file) from within the Fortran,
DSDYN or DSOUT sections of your component definition. In order to
have this code included when the project is built and compiled, you
must ensure a reference to this file is provided. This can be done in one
of two ways:

1. Add a File Reference component: Right-click over a blank


area of your project page in Circuit View and select Add
Component | File Reference. Open the File Reference and
select the source file. For more on this component, see the
online help.
2. Add a reference from the Project Settings dialog: Right-click
over a blank area of your project page in Circuit view and
select Project Settings…. In the Fortran section, add a
reference to the file in the Additional Source Files input
field. See Chapter 6 for more details.

INTERFACING TO C SOURCE CODE


For more details on
In PSCAD, you may interface to C language source code in the form of interfacing to C source
code, see the example
a subroutine or function. As C code cannot be used directly within projects in the
component definition Fortran, DSDYN or DSOUT segments, it must be …\examples\C_interface
directory in your installation
provided in the form of an external source (*.c) file or object file. directory.

PSCAD User’s Guide 399


Chapter 8: Designing Components

There are subtle differences between how C source code is handled


between the EGCS/GNU Fortran 77 compiler and the Fortran 90
compilers compatible with PSCAD. The method for each is described in
the following sections.

NOTE: Before running the case, the user must ensure that the *.c (and
*.f) file(s) be referrenced in the Additional Source Files input field.
Alternatively, object files (*.obj) or a library file (*.lib) (made from the
source files) should be referenced in the Additional Library (*.lib) and
Object (*.obj) files input field.

For more details on interfacing to C source code, see the example


projects in the ...\examples\C_interface directory within your installation
directory.

Using the GNU Compiler


The most straightforward method to utilizing source code written in C is
to use the EGCS/GNU Fortran 77 compiler. This is simply due to the fact
that this program converts Fortran code to C anyway before creating the
executable. Providing C source code then makes relatively little
difference from the prospective of the GNU compiler.

C subroutines and functions can be called directly from within the


Fortran, DSDYN, or DSOUT segments of a component definition, just as
you would do it for Fortran. The following examples illustrate this for
calling both a C subroutine and a C function.

EXAMPLE 8-16:

A user has written the following simple subroutine in C, and wants to


call this source code from a user-defined component:

/* User C Source Code */

void test_csub__(int* arg, int* res)


{
*res = 6*(*arg);
}

400 PSCAD User’s Guide


PSCAD

A standard call statement can be made from within the Fortran, DSDYN
or DSOUT segments of the component definition.

CALL TEST_CSUB($IN,$OUT)

Where $IN and $OUT are input and output Connections on the
component respectively.

EXAMPLE 8-17:

A user has written the following simple function in C, and wants to use
this source code in a user-defined component:

/* User C Source Code */

int test_cfun__(int *arg)


{
return 2*(*arg);
}

The function must be declared before it is used within the component.


Then, the function is used as it normally would in Fortran in the
Fortran, DSDYN or DSOUT segments of the component definition.

#FUNCTION INTEGER TEST_CFUN


$OUT = TEST_CFUN($IN)

Where $IN and $OUT are input and output Connections on the
component respectively.

Note that you can use a C++


compiler to compile your C
source code into an object
Using a Fortran 90 Compiler file. If so, make sure to
disable ‘name mangling’ by
When using either the Digital Fortran or Compaq Fortran 90 compilers, using the ‘extern “C”’
some extra steps are involved in interfacing with the C source code. declaration in your C code.

PSCAD User’s Guide 401


Chapter 8: Designing Components

An auxiliary Fortran subroutine must be provided for the purpose of


constructing an interface (or ‘wrapper’) to the C code. It is this Fortran
subroutine that is called from the Fortran, DSDYN or DSOUT segments
of your user-defined component.

The following examples illustrate how to call a C subroutine when


using the Fortran 90 compilers.

EXAMPLE 8-18:

A user has written the following simple subroutine in C, placed it into a


C file (*.c).

/* User C Source Code */

void test_csub(int* arg, int* res)


{
*res = 6*(*arg);
}

The user then defines an interface subroutine in a Fortran (*.f) source


file as follows:

SUBROUTINE AUX_CSUB(in, out)

INTEGER in, out


!
! Fortran 90 interface to a C procedure
!
INTERFACE
SUBROUTINE TEST_CSUB (in, out)
!DEC$ ATTRIBUTES C :: TEST_CSUB
!DEC$ ATTRIBUTES REFERENCE :: in
!DEC$ ATTRIBUTES REFERENCE :: out
!
! in, out are passed by REFERENCE
!
INTEGER in, out
END SUBROUTINE
END INTERFACE
!
! Call the C procedure
!
CALL TEST_CSUB(in, out)

END

402 PSCAD User’s Guide


PSCAD

A standard call statement is then added to the Fortran segment of the


user component definition:

CALL AUX_CSUB($IN,$OUT)

Where $IN and $OUT are input and output Connections on the
component respectively.

TUTORIAL: CREATING A NEW COMPONENT


The objective of this section is to give you a chance to create a new
component from scratch. You will build a simple single-phase voltage
source component, and use an existing EMTDC subroutine to define the
source characteristics.
It would be a good idea to
keep Chapter 9 on hand, it
This tutorial attempts to exercise most aspects of Graphic, Parameters will come in handy to
and Script sections of the Design Editor discussed above, as well as reference the PSCAD Script
topics from Chapter 9. Let’s begin! used in this tutorial.

Creating a New Component


Open PSCAD, create a new Case Project and give it a descriptive
name. Create a new component using the Component Wizard
according to methods described in Chapter 4.

Adding Graphics
Open the Component Definition and in the Graphic section, draw the
following diagram; where $R is a Text Label, and NA and NB are
Connections configured as fixed electrical nodes.

Make sure the graphics are


of a reasonable size in
relation to other
components.

PSCAD User’s Guide 403


Chapter 8: Designing Components

For example, the properties for NA would be configured as:

Save your changes.

Adding a User Interface


Open the Component Definition and in the Parameters section, add a
new Category page. Give the new Category a name in the Name field
(say, Configuration).

Add and define Input Fields to the Category with the following
Captions: ‘Voltage Magnitude (RMS),’ ‘Frequency,’ ‘Ramp Up Time’
and ‘Resistance.’ These are to have Units set to kV, Hz, sec and ohm
respectively. Give each field a short, but descriptive Symbol Name (say
‘Vrms,’ ‘f,’ ‘tr’ and ‘R’ respectively) and provide a reasonable Default
value (see the image below), as well as Min and Max settings.

Add a Choice Box to the Category with the Caption ‘Is This Source
Grounded?.’ Give it an appropriate Symbol Name (say, ‘gnd’) and
then add two Choices: ‘1=Yes’ and ‘0=No.’ Decide on whether to use
Radio Buttons or a Drop List format.

Arrange the fields in a neat manner and once completed, your new
Category page should look something like the following:

404 PSCAD User’s Guide


PSCAD

Save your changes.

Adding Conditional Statements to the Graphic Objects


In order to make our component more convenient to use, we should
give the user the option to ground the source at one end. This will be
the primary purpose of the ‘Is This Source Grounded?’ Choice Box.
Using the condition of this field (i.e., Yes or No), we can alter both the
appearance and the electrical properties of the component.

Open the Component Definition and in the Graphic section, modify the
component graphics as shown in the diagram below. Where G is a
Connection configured as an electrical ground node.

In the Visible When field of all the newly added Graphic Objects, add
conditional statements so that they become Visible/Invisible according
to the setting specified in the ‘Is This Source Grounded?’ Choice Box.
That is, when ‘Is This Source Grounded?’ is set to Yes, the ground
symbol graphics above should be visible.

PSCAD User’s Guide 405


Chapter 8: Designing Components

In the Enabled When field of the ground node G and the fixed node
NB, add conditional statements so that they become Enabled/Disabled
according to the setting specified in the ‘Is This Source Grounded?’
Choice Box. That is, when ‘Is This Source Grounded?’ is set to Yes, the
ground node G should be enabled and the fixed node NB should be
disabled. For example, the properties for G would be configured as:

You may be wondering at this point about the placement of the


Connections G and NB in the above Graphic section diagram: When
placing your Connections within your component graphic, it is
important to consider where the most intuitive position for the
Connection is. That is, it would be best to have the Connection NB at

406 PSCAD User’s Guide


PSCAD

the end of the Line Object, as this would be an obvious connection


point.

Save your changes.

Pre-Processing User Input


Open the Component Definition and in the Script section, navigate to
the Computations Segment. If for some reason this Segment is not
New Segment
there, simply add it using the New Segment button.
Button

In the Computations Segment text window, add lines of script to


convert your ‘Voltage Magnitude (RMS)’ input from RMS to peak kV
and to convert your ‘Frequency’ input from Hz to peak radians per
second. Your Computations Segment should then appear similar to the
following:

REAL Vp = SQRT(2.0)*Vrms
REAL f_rad = 2.0*pi*f

The EMTDC Subroutine that we will be using to define the voltage


source requires these values as defined above. You could of course,
simply let the user enter these values in kV peak and rad/s directly.
Then, the need for the Computations Segment will be removed, but
this form for the values may not be the most convenient to those using
the component. As the designer, this is up to you.

Save your changes.

Defining the Electrical Branch


Open the Component Definition and in the Script section, navigate to
the Branch Segment. If for some reason this Segment is not there,
New Segment
simply add it using the New Segment button.
Button
Add statements to the Branch Segment to define a Branch-Based
Electric Interface to EMTDC. This branch is to be purely resistive with
resistance R, as defined by the Parameters input ‘Resistance.’ Add
conditional statements so that the branch will be defined between NA
and NB or NA and G, depending on the condition of the ‘Is this source
grounded?’ Choice Box. Your Branch Segment should then look similar
to the following:

PSCAD User’s Guide 407


Chapter 8: Designing Components

#IF gnd == 1
$NA $G $R 0.0 0.0
#ELSE
$NA $NB $R 0.0 0.0
#ENDIF

The above simply defines a source resistance value to the branch where
we will place the source. Of course, the branch itself will be defined
according to whether the user has grounded the source directly or not.

Save your changes.

Adding Code to Define the Source


As mentioned above, instead of writing our own code to define the
voltage source, we can use an existing EMTDC Subroutine to do it for
us. Then we simply need to ensure that all of the subroutine
arguments are defined in the component, and then call the subroutine.
The subroutine we will use is called ‘EMTDC_1PVSRC,’ and is the same
model used in the ‘Single Phase Voltage Source Model 2’ in the PSCAD
Master Library.

Open the Component Definition and in the Script section, navigate to


the Fortran Segment. If for some reason this Segment is not there,
simply add it using the New Segment button.
New Segment
Button
Add a subroutine declaration statement at the top of the Fortran
Segment text window, using the #SUBROUTINE directive. Make sure to
include the exact name of the subroutine along with a brief description.

#SUBROUTINE EMTDC_1PVSRC ‘Single Phase Source’

Add a standard Fortran call statement in the Fortran Segment, in order


to call the EMTDC subroutine. Be sure to include all the required
arguments in the following format:

CALL EMTDC_1PVSRC(SS, BRN, RAMP, AC, MAG, F, Ph)

The arguments required by this model are described below:

408 PSCAD User’s Guide


PSCAD

• SS: Subsystem number. This is extracted automatically


from the Data File, so you do not need to worry about
defining its value. As it is a pre-defined variable, it must
be preceded by the $ Substitution Prefix Operator.
• BRN: Branch number. This will be defined in the Branch
Segment of your component definition, which we will get
to in the following section. For now, enter ‘BRN.’ As it is
a pre-defined variable, it must be preceded by the $
Substitution Prefix Operator.
• RAMP: Ramp-Up Time in seconds. This value is defined
by the Parameters Segment input ‘Ramp-Up Time.’ Enter
the Symbol Name for this Input Field here. As it is a pre-
defined variable, it must be preceded by the $
Substitution Prefix Operator.
• AC: AC or DC source, where 0 = DC and 1 = AC. As this
is to be an AC source, enter ‘1.’
• MAG: Source magnitude in kV peak. This value is
defined in the Computations Segment. Enter the variable
name for this value given to it in Computations. As it is a
pre-defined variable, it must be preceded by the $
Substitution Prefix Operator.
• F: Frequency in radians per second. This value is defined
in the Computations Segment. Enter the variable name
for this value given to it in Computations. As it is a pre-
defined variable, it must be preceded by the $
Substitution Prefix Operator.
• Ph: Initial phase shift in radians. We are not adjusting
the initial phase of the source in this tutorial, so just enter
‘0.0’

Once completed, your Fortran Segment text window should look


similar to:

#SUBROUTINE EMTDC_1PVSRC Single Phase Source


!
CALL EMTDC_1PVSRC($SS,$BRN,$tr,1,$Vp,$f_rad,0.0)

PSCAD User’s Guide 409


Chapter 8: Designing Components

The subroutine ‘EMTDC_1PVSRC’ transfers variables to storage each


time step and so a storage directive must be added, as well. The
amount of variables stored by this model are LOGICAL = 1, REAL = 8
and INTEGER = 6. Add a #STORAGE directive to define this storage
allocation as follows in your Fortran Segment text window:

#SUBROUTINE EMTDC_1PVSRC Single Phase Source


#STORAGE LOGICAL:1 REAL:8 INTEGER:6
!
CALL EMTDC_1PVSRC($SS,$BRN,$tr,1,$Vp,$f_rad,0.0)

Note that storage allocation is necessary only when using a Fortran 90


compiler, in order to provide memory allocation information for Dynamic
Dimensioning in EMTDC. It is a good idea to always include #STORAGE
statements however, to maintain component compatibility with all
compilers.

Save your changes.

Setting the Branch Source


According to the subsystem number (SS) and the branch number (BRN),
PSCAD can determine where in the electric network to place the
source. We have not yet defined this in our Branch Segment however,
so we will do that now by simply giving a name (i.e., ‘BRN’) to our
defined branch as follows:

#IF gnd == 1
BRN = $NA $G $R 0.0 0.0
#ELSE
BRN = $NA $NB $R 0.0 0.0
#ENDIF

Also, so that PSCAD knows this is a branch with a source, you must
simply add the word ‘SOURCE’ as follows:

#IF gnd == 1
BRN = $NA $G SOURCE $R 0.0 0.0
#ELSE
BRN = $NA $NB SOURCE $R 0.0 0.0
#ENDIF

410 PSCAD User’s Guide


PSCAD

Save your changes.

Sanity Checks
It is always a good idea to provide sanity checks on the users input, so
as to avoid erroneous results. This is accomplished using the Checks
Segment.

Open the Component Definition and in the Script section, add a new
Checks Segment by using the New Segment button. Add a statement
to the Checks Segment text window that will give an error, when the New Segment
entered source resistance is less than or equal to 1. Note that you must Button
use negative logic in this section, and so this statement should appear
as follows:

ERROR Source Resistance must be greater than zero : R > 0.0

Save your changes.

Testing Your New Component


At this point it would be a good idea to check if your component will
actually run, and if it does, whether the results are correct. Below are
what the results should be if the source model was connected to the
indicated circuit, and if the source is set to:

• Voltage Magnitude (RMS) = 0.7071 kV


• Frequency = 60 Hz
• Ramp-Up Time = 0.2 seconds
• Resistance = 1.0 Ω

PSCAD User’s Guide 411


Chapter 8: Designing Components

The results are shown below:

Save your changes.

Adding Internal Output Variables


It is possible to monitor quantities internal to the component, for
display on plots and meters. This is accomplished by setting up an
‘Internal Output Variable.’ In this tutorial, we will set-up internal
variables to monitor source voltage and branch current.

Open the Component Definition and in the Parameters section, add


two Text Fields: One with Symbol Name ‘Isource’ and Caption ‘Source
Current.’ The other with Symbol Name ‘Vsource’ and Caption
‘Source Terminal Voltage.’

Arrange the fields in a neat manner and once completed, your


Category page should look something like the following:

412 PSCAD User’s Guide


PSCAD

Open the Component Definition and navigate to the Fortran Segment.


With an #OUTPUT directive, extract the current in this source branch
(i.e., from branch ‘BRN’), using the ‘CBR’ special substitution operator.

#SUBROUTINE EMTDC_1PVSRC ‘Single Phase Source’


#STORAGE LOGICAL:1 REAL:8 INTEGER:6
!
CALL EMTDC_1PVSRC($SS,$BRN,$tr,1,$Vp,$f_rad,0.0)
!
#OUTPUT REAL Isource {$CBR:BRN}

The #OUTPUT statement above will define a variable ‘Isource’ and


output to it the current flowing in branch ‘BRN.’

Extract the node voltage from Connection node NA to Connection


node G with another #OUTPUT directive and using the ‘VDC’ special
substitution operator. Your Fortran Segment should then look similar to
the following:

PSCAD User’s Guide 413


Chapter 8: Designing Components

#SUBROUTINE EMTDC_1PVSRC ‘Single Phase Source’


#STORAGE LOGICAL:1 REAL:8 INTEGER:6
!
CALL EMTDC_1PVSRC($SS,$BRN,$tr,1,$Vp,$f_rad,0.0)
!
#OUTPUT REAL Isource {$CBR:BRN}
#OUTPUT REAL Vsource {$VDC:NA:G}

Any Text Field with a Symbol Name identical to those defined above
(i.e., ‘Isource’ and ‘Vsource’), will act as Internal Output Variables for
the component. Now any variable name entered into either the
‘Source Current’ or ‘Source Terminal Voltage’ Text Fields in the
Parameters section will create signals which, when connected to an
Output Channel, can be plotted.

Running Your Component


Keeping the test circuit used in the ‘Testing Your New Component’
section above, remove the ammeter and voltmeter from the circuit.
Replace these two signals by entering ‘Vs’ and ‘Is’ into the Internal
Output Variable Text Fields that were created in the component
Category page.

Run the case again. You should see identical results as before.

414 PSCAD User’s Guide


PSCAD

Chapter 9:

PSCAD Script
PSCAD Script was originally introduced back in PSCAD V2, primarily to
provide a more flexible, functional work environment for the
programming of custom components. Any PSCAD Script existing in a
component is pre-processed into standard formatted Fortran, and
inserted directly into the project Fortran file (or data file) before
compilation.

By using the various script directives and conditional statements


available, the appearance, structure and functionality of a component
can be manipulated according to user input, before the case is run.
Numerical user input for instance, can be massaged or transformed
according to pre-compilation expressions (i.e. multiplying by a
conversion factor to change units).

This chapter is closely linked with Chapter 8 entitled Designing


Components. It is recommended that you read both chapters before
attempting to design your own component.

The following sections describe the available PSCAD Script functions,


and provide examples on how each can be used.

THE PRE-PROCESSOR
Standard formatted Fortran code is allowed when writing EMTDC
System Dynamics code (i.e. code entered into either the Fortran,
DSDYN or DSOUT segments). However, it is recommended that PSCAD
Script be used whenever possible so that the behaviour of custom
component definitions is independent of the compiler used. Any standard Fortran code
entered directly must be
PSCAD uses a combination of expression evaluation and pre-processor preceded by six empty
spaces, according to
substitution to generate custom formatted Fortran code. formatted Fortran standards.

By using a combination of PSCAD Script and actual formatted Fortran


code, the user can program virtually any type of model. However, if the
need does arise, subroutines or functions (written in Fortran or C) can be
called from within the component, using standard Fortran calls.

PSCAD User’s Guide 415


Chapter 9: PSCAD Script

OPERATORS
There are some important Script operators that can appear in many
sections of the component definition. These are:

• Variable Substitution Prefix: $


• Text Substitution Prefix: %
• Expression Braces: { }
• Comment Indicator: !

$ Variable Substitution Prefix Operator


The dollar symbol ‘$’ is very important, in that it is used often as a prefix
in PSCAD Script to indicate that the text following the operator
represents a substitution. Although this operator is used mostly for the
substitution of pre-defined variables and constants into Script code, it
If a new variable is to be can also be used to substitute the numerical value of an Input Field, Text
defined in your PSCAD
Script, you must define it as Field, or Choice Box directly into a Text Label, or as part of a Comment.
a local variable. See the
#LOCAL directive for more
‘$’ can be used in Text Labels within the Graphic Section, as well as the
details.
Fortran, DSDYN, DSOUT, Branch, Model-Data, Matrix-Fill, Transformers,
or T-Lines segments of the Script Section.

‘$’ may only precede variable names defined as one of the following:

• Connections
• Input Parameters
• Any variable defined in the Computations Segment

Substituting Pre-Defined Variables or Constants into Script


One form of possible substitution is that of pre-defined variables or
constants into component Fortran code. Here, the numerical value of
the pre-defined variable (i.e. Connection, Input Parameter or any
variable defined in the Computations Segment) will be directly
substituted upon compilation by PSCAD. If the pre-defined variable is a
Connection or variable Input Parameter, then the variable name will be
substituted in lieu of the actual value.

Substitutions may also be performed within Commented Script, in case


the user would like to display certain pre-defined values in the compiled
Fortran files for the Project.

416 PSCAD User’s Guide


PSCAD

EXAMPLE 9-1:

A user component calls an external function, which requires a


frequency input argument. The frequency input parameter, in the
Parameters Section of the component definition, has a Symbol Name
‘F’. The function output ‘OUT’ is defined as an output Connection in
the Graphic Section.

The function call should then appear as follows in either the Fortran,
DSDYN or DSOUT segments:

#FUNCTION REAL F_CON Frequency Converter


!
$OUT = F_CON($F)
!
! When this Script is compiled by PSCAD, the value See the #FUNCTION
! entered in the Input Field 'F' will be directive for more details on
! substituted for $F. For example, if F = 60.0 external function calls.
! [Hz], then the right side of the equation would
! appear as ... = F_CON(60.0) in the Project
! Fortran file following compilation.
!

EXAMPLE 9-2:

A user-defined component has been programmed to display certain key


input parameters within Comments provided in the component Fortran
segment, namely: Frequency with Symbol Name ‘freq’, value 60.0 and
units in Hz, and Voltage with Symbol Name ‘volts’, value 120.0 and
units in kV.

Something similar to the following comments could then appear in


either the Fortran, DSDYN, or DSOUT segments:

! User-Defined Component
!
! Frequency: $freq Hz, Voltage: $volts kV
!
!

PSCAD User’s Guide 417


Chapter 9: PSCAD Script

The above comment would appear as follows in the Project Fortran file
following compilation by PSCAD:

! User-Defined Component
!
! Frequency: 60.0 Hz, Voltage: 120.0 kV
!
!

Substituting Pre-Defined Constants into Text Labels


Pre-defined constants can be substituted directly into Text Labels in the
Graphic Section using the ‘$’ operator. This is a convenient feature, as
it allows users to change text appearing on the component graphic
according to input parameters. Note that when substitutions are done in
this way, it is only prudent to use variables pre-defined as input
parameters: The reason being that variables from the Computations
Segment are not defined until following compilation.

EXAMPLE 9-3:

A user wishes to display both the primary and secondary winding


voltage ratings directly on his/her component graphic. The primary
voltage rating input parameter ‘Vprim’ is set as 25.0 [kV] and the
secondary input ‘Vsec’ is set to 4.0 [kV] as shown below:

In the component Graphic Section, the user adds two new Text Labels
(positioned accordingly) and enters the following in the Text field of the
Text Label Properties dialog:

418 PSCAD User’s Guide


PSCAD

When the component is viewed in Circuit view, values of the input


parameters ‘Vprim’ and ‘Vsec’ should appear on the component
graphic. For example,

See Text Labels for more


details on adding and
editing Text Labels.

% Text Substitution Prefix Operator


The percent symbol ‘%’ can be used to make a simple text substitution
into Commented Fortran Script, as well as into graphical Text Labels.
This operator is very similar to the $ Variable Substitution Prefix
Operator, except that it substitutes the exact contents of an input
parameter as text.

‘%’ can be used in Text Labels within the Graphic Section, as well as
within Commented code in the Fortran, DSDYN, DSOUT, Branch,
Model-Data, Matrix-Fill, Transformers, or T-Lines segments of the Script
Section.

‘%’ should only precede variable names defined as Input Parameters.

Substituting Pre-Defined Variable Text into Commented Script


One form of substitution is that of pre-defined variable text into
Commented component Script. Unlike the $ Variable Substitution
Prefix Operator, the entire text contents of an input parameter

PSCAD User’s Guide 419


Chapter 9: PSCAD Script

(including the units) will be directly substituted upon compilation by


PSCAD.

EXAMPLE 9-4:

Consider Example 9-2 above, but replace the ‘$’ operator with the %
Text Substitution Prefix Operator.

The following comments could then appear in either the Fortran,


DSDYN or DSOUT segments:

! User-Defined Component
!
! Frequency: %freq, Voltage: %volts
!
!

The above comment would appear as follows in the Project Fortran file
following compilation by PSCAD:

! User-Defined Component
!
! Frequency: 60.0 [Hz], Voltage: 120.0 [kV]
!
!

Substituting Pre-Defined Variable Text into Text Labels


Input parameter text can be substituted directly into Text Labels in the
Graphic Section using the ‘%’ operator. This is a convenient feature, as
it allows users to change text appearing on the component graphic.

EXAMPLE 9-5:

Consider Example 9-3 above, but replace the ‘$’ operator with the %
Text Substitution Prefix Operator in the new Text Labels. When the
component is now viewed in Circuit view, values of the input
parameters ‘Vprim’ and ‘Vsec’ should appear on the component
graphic as follows:

420 PSCAD User’s Guide


PSCAD

{ } Expression Braces
Expression braces can appear all over the component Definition and can
be used to perform a mathematical operation, insert Script or define
variables according to a conditional statement.

It is important to note that mathematical operations within expression


braces are performed prior to the insertion of formatted code into the
EMTDC System Dynamics (or the electrical system Data File).
Subsequently, these operations cannot involve variables – only constants
(such as constant user input parameters, local constants, or constants
defined in the Computations segment).

EXAMPLE 9-6:

The following example code illustrates a few ways in which expression


braces can be used:

The following example shows how expression braces are used with the
#CASE Conditional Directive and ~ Line Continuation Operator to insert
a function argument according to the value of ‘Ftype’.
See the #CASE directive and
Line Continuations for more
!
details.
$OUT = F_CON(~
!
#CASE FType {~$Fhz)} {~$Frad)}
!

The following example shows how expression braces can be used to


multiply an input Connection ‘In’, by a pre-defined constant ‘K’,
provided that a Logical Expression is true (i.e. if ‘mult’ does not equal 1).
Note that 6 spaces precede the contents of the expression braces
(according to formatted Fortran standards).
See the #IF, #ELSEIF, #ELSE,
#ENDIF conditional directive
for more details.

PSCAD User’s Guide 421


Chapter 9: PSCAD Script

!
#IF mult != 1 { $Out = $K * $In}
!

The following example shows how expression braces can be used within
Text Labels to perform a mathematical operation on substituted values
from the $ Variable Substitution Prefix Operator. Say that two input
variables are entered as ‘A1 = 2.0’ and ‘A2 = 3.0’. The user wants to
display a value based on these values directly on the component
graphic as follows:

Text Label = A1*A2 = 6.0

The following should then be entered into the Text Label:

Commented code that is


written to the data file,
requires that the ‘!’
Comment Indicator be in
the first column from the
left. ! Comment Indicator
The exclamation point ‘!’ is used throughout the component definition
segments to indicate that a particular line of code is a comment. All
lines of script, which is preceded by ‘!’, will be written as standard
Fortran comments in the project Fortran or data files.

EXAMPLE 9-7:
Comments should be used to describe the user’s code, as well as to
provide spacers and section breaks in order to enhance the readability
of the user’s code. The ‘!’ comment indicator may be used everywhere
except the Branch segment.

The following example illustrates the use of comments in the Fortran or


See the #STORAGE
DSDYN segments in the a user component definition:
conditional directive for
more details.

422 PSCAD User’s Guide


PSCAD

! MY FIRST PSCAD SCRIPT


! ---------------------
!
! Storage:
!
#STORAGE REAL:1
!
! Main body of script:
!

DIRECTIVES
Script directives are used to facilitate the creation of Fortran code. Each
directive type has a specific purpose, as explained in the following
sections.

Script directives always begin with a pound ‘#’ symbol prefix. Spaces
before and after the ‘#’ symbol are allowed for flexibility in code
formatting.
If using a Fortran 90
compiler, the #STORAGE
#STORAGE directive must be included
This directive was first introduced with PSCAD V3 in order to provide for dynamic memory
allocation.
custom component compatibility with the Fortran 90 dynamic
dimensioning feature, also introduced in V3. Its purpose is to specify
what type and how many storage elements should be dynamically
allocated for a specific component.

The #STORAGE directive is closely related to the EMTDC STORx internal


variables. That is, if EMTDC STORx variables are used in component
code, they must be specified here to ensure that the component storage
is properly dimensioned by PSCAD.

The #STORAGE directive is used only in the Fortran, DSDYN or DSOUT


segments, and should appear as follows:

#STORAGE <TYPE>:<Number>

<TYPE> can be one of four types of STORx variable: These are REAL,
INTEGER, LOGICAL and COMPLEX. <Number> is the amount of
elements to be stored.

PSCAD User’s Guide 423


Chapter 9: PSCAD Script

EXAMPLE 9-8:

A user’s custom component code specifies that ten REAL, four INTEGER
and one LOGICAL element, are to be stored each time step. The user
wants to ensure that storage is dynamically allocated by PSCAD.

The storage statement should appear as follows, in either the Fortran,


DSDYN or DSOUT segments:

#STORAGE REAL:10 INTEGER:4 LOGICAL:1

The actual #STORAGE statement can appear anywhere in script, but


should be placed near the top.

All three variable types above do not need to appear in the #STORAGE
statement if they are not needed. For example, if only REAL variables
need to be stored, only the REAL type needs to be specified.

#LOCAL
This directive is used to define any local variables that are not classified
Care should be exercised
when using #LOCAL. Make as pre-defined. That is, any variables introduced within the code that do
sure to give your variable a not require the pre-defined variable prefix ‘$.’
unique name, so as to avoid
the same name being used
in different variable types. The #LOCAL directive is used only in the Fortran, DSDYN or DSOUT
segments, and should appear as follows:

#LOCAL <TYPE> <Name> <Array_Size>

<TYPE> can be either REAL, INTEGER, or LOGICAL. <Name> is the


given name for the local variable. <Array_Size> is an optional integer
that defines the size of the array. If the variable has only a single
dimension, then leave <Array_Size> blank.

EXAMPLE 9-9:

A user’s custom component requires two local variables for use as


subroutine arguments. According to a conditional statement based on a
pre-defined variable ‘A,’ a local INTEGER variable ‘X’ and a local REAL
array ‘Error’ are defined before the subroutine is called.

424 PSCAD User’s Guide


PSCAD

The local variable definitions should then appear as follows, in the


Fortran, DSDYN or DSOUT segments:

#LOCAL INTEGER MY_X


#LOCAL REAL Error 2
!
#IF A > 1
‘A > 1’ is a logical
MY_X = 1 expression. See the
Error(1) = 0.2 Expression Evaluation
#ELSE section in this chapter for
MY_X = 0 more details.
Error(2) = 0.8
#ENDIF
!
CALL SUB1(MY_X, Error)
!

#FUNCTION
This directive is used to declare the existence of a function, and the
argument type it returns. #FUNCTION is mandatory if a function is
called within the component definition.

The #FUNCTION directive is used only in the Fortran, DSDYN or DSOUT


segments, and should appear as follows:

#FUNCTION <TYPE> <Name> <Description>

<TYPE> can be either REAL, INTEGER, or LOGICAL. <Name> is the


given name of the function. <Description> will be included as a
comment line near the beginning of the EMTDC Fortran File.

EXAMPLE 9-10:

The ‘Hard Limiter’ component in the PSCAD Master Library utilizes a


REAL function called ‘LIMIT’ to determine the output signal to be sent to
an external connection ‘O,’ according to pre-defined inputs ‘LL,’ ‘UL,’
and ‘I.’

PSCAD User’s Guide 425


Chapter 9: PSCAD Script

The following code appears in the Fortran segment of the Hard Limiter
component definition:

#FUNCTION REAL LIMIT Hard Limiter


!
$O = LIMIT($LL, $UL, $I)
!

#SUBROUTINE
This directive is used to provide a description for a subroutine that is
being called from the component. #SUBROUTINE is used simply for
cosmetic purposes, and is not mandatory (although its use is
recommended anyway).

The #SUBROUTINE directive is used only in the Fortran, DSDYN or


DSOUT segments, and should appear as follows:

#SUBROUTINE <Name> <Description>

<Name> is the given name for the subroutine. <Description> will be


included as a comment line near the beginning of the EMTDC Fortran
File.

EXAMPLE 9-11:

A user includes a call to a subroutine, named ‘SUB1,’ within the


component code. It is desired that a description be added for clarity.

The following code should appear in the Fortran, DSDYN or DSOUT


segment of the component:

!
#SUBROUTINE SUB1 User Subroutine
CALL SUB1($X, $Y, $Z)
!

Where ‘X,’ ‘Y’ and ‘Z’ are pre-defined variables.

426 PSCAD User’s Guide


PSCAD

#OUTPUT
This directive was first introduced in PSCAD V3 and was added to
provide a method of extracting certain quantities for the purpose of
monitoring, plotting, or for use externally by other components.

#OUTPUT performs two tasks: It first defines a variable according to a


given name, and then gives it a value according to an expression.

The #OUTPUT directive is used only in the Fortran, DSDYN or DSOUT


segments, and should appear as follows:

#OUTPUT <TYPE> <Name> <Array_Size> {<Expression>}

<TYPE> can be either REAL, INTEGER, or LOGICAL. <Name> is the


given name for the variable. <Array_Size> is an optional integer, which
defines the size of the array. If the variable has only a single dimension,
then leave <Array_Size> blank. <Expression> can be a mathematical
expression, a storage location, or simply a defined variable.

EXAMPLE 9-12:

The manner, in which the value of the named output variable may be
defined, can appear in many different ways. The following list shows
some of the possibilities:

! Defines a REAL variable ‘freq’ and substitutes


! the value of a pre-defined variable ‘Fout.’
!
#OUTPUT REAL freq {$Fout}
!
! Defines an INTEGER variable ‘Xon’ and assigns
! it the value of a storage location.
!
#OUTPUT INTEGER Xon {STORI(NSTORI+1)}
!
! Defines a REAL variable ‘POut’ and assigns
! it the value of a given mathematical
! expression.
!
#OUTPUT REAL POut {$V*$I}
!

PSCAD User’s Guide 427


Chapter 9: PSCAD Script

#TRANSFORMERS
This directive should be included whenever mutually coupled coils are to
be represented in a model. Examples of Master Library models that use
this directive are (of course) the transformers and the PI Section line
components.
Assigning #TRANSFORMERS
correctly is important even if
you are not using the
#TRANSFORMERS has two primary purposes:
dynamic version of EMTDC,
as the information for 1. Provides a method to sequentially number all models that
monitoring winding currents
is still needed.
contain mutually coupled coils for the purpose of dynamic
dimensioning (when using a Fortran 90 compiler).
2. The same number provides addressing information for the
monitoring of mutually coupled winding currents. Transformer
winding currents are measured using the EMTDC CDCTR(M,N)
matrix. CDCTR(M,N) is the current through the Mth winding of
the Nth transformer.

The #TRANSFORMERS directive is used only in the Transformers


segment, and should appear as follows:

#TRANSFORMERS

<Number> indicates the total number of transformers within the


component.

EXAMPLE 9-13:

The 3-Phase, 2-Winding classical transformer component, located in the


Transformers section of the Master Library, consists of three, 1-Phase
transformers.
See the Transformers
segment in Chapter 8 for
more details. The directive would appear as follows in the Transformers segment:

#TRANSFORMERS 3

#WINDINGS
This directive was first introducted in PSCAD v4.02 in order to remove a

428 PSCAD User’s Guide


PSCAD

fixed limitation on the number of coupled coils in a transformer, which


was previously set to 10.

#WINDINGS can be used to assign the number of coupled windings in a


transformer. PSCAD will look for the highest number associated with all
existing #WINDINGS directives and then assign that number (as the
maximum number of windings) to the Map (.map) file.

The #WINDINGS directive is used only in the Transformers segment, and


should appear as follows

#WINDINGS <Number>

<Number> indicates the maximum number of coupled windings within


that specific component.

EXAMPLE 9-14:

The 3-phase, 2-winding classical transformer component, located in


the Transformers section of the Master Library, consists of three, 1-
phase transformers.

The directive would appear as follows in the Transformers segment:

#WINDINGS 2

#IF, #ELSEIF, #ELSE, #ENDIF DIRECTIVES


#IF, #ELSEIF, #ELSE, #ENDIF directives are a special type of script
directive that provide one way for the user to alter the component
definition, according to component input parameters, before
compilation.

These directives can be used to change the electrical configuration, or


act as standard Fortran IF-THEN-ELSE keywords in the EMTDC System
Dynamics (i.e. DSDYN and DSOUT). Similar to normal script directives,
#IF, #ELSEIF, #ELSE, #ENDIF directives always begin with a ‘#’ prefix.

#IF, #ELSEIF, #ELSE, #ENDIF directives can be used in all segments and

PSCAD User’s Guide 429


Chapter 9: PSCAD Script

should appear as follows:

#IF <Logic>

...Application_Code...

#ELSEIF <Logic>

#IF <Logic>

...Application_Code...

#ELSE

...Application_Code...

#ENDIF

#ELSE <Logic>

...Application_Code...

#ENDIF

If just a simple IF-THEN condition is required, the following shortcut using


expression braces may be used:

#IF <Logic> {<Expression>}

<Logic> is a logical expression using logical operators. <Expression> can


be a variable definition.

EXAMPLE 9-15:

A user needs to change the output of a signal generator model,


according to whether a sine or cosine output is required. The
component definition provides an input parameter choice box in the
Parameters section, called ‘Type.’ If this parameter is 1, then the output
is sinusoidal (if 0 then cosinusoidal).

The following code should appear in the Fortran, DSDYN or DSOUT


segments of the component:

430 PSCAD User’s Guide


PSCAD

!
! Signal Generator
!
#IF Type == 1
$OUT = SIN(TWO_PI*$F)
#ELSE ‘Type == 1’ is a logical
expression. See the
$OUT = COS(TWO_PI*$F) Expression Evaluation
#ENDIF section in this chapter for
! more details.

Where ‘F’ is a pre-defined variable and ‘OUT’ is an output Connection in


the Graphic section.

Using expression braces, the above example could also be written as:

!
! Signal Generator
!
#IF Type == 1 { $OUT = SIN(TWO_PI*$F)}
#IF Type != 1 { $OUT = COS(TWO_PI*$F)}
!

EXAMPLE 9-16:

A user has created an electrical component that can either be a simple


resistor, inductor or capacitor. The component definition provides an
input parameter choice box in the Parameters section, called ‘Type.’
This parameter can either be 1, 2 or 3 to represent a resistor, inductor or
capacitor respectively. Three other input text boxes also exist (called ‘R,’
‘L’ and ‘C’) in order to specify the respective values of these elements.

The following code should appear in the Branch segment of the


component:

PSCAD User’s Guide 431


Chapter 9: PSCAD Script

#IF Type == 1
$N1 $N2 $R 0.0 0.0
#ELSEIF Type==2
$N1 $N2 0.0 $L 0.0
#ELSE
See the Branch section later $N1 $N2 0.0 0.0 $C
in this chapter for more
#ENDIF
details on syntax used here.

Where ‘N1’ an ‘N2’ are electrical Connections in the Graphic section.

Using expression braces, the above example could also be written as:

!
#IF Type == 1 {$N1 $N2 $R 0.0 0.0}
#IF Type == 2 {$N1 $N2 0.0 $L 0.0}
#IF Type == 3 {$N1 $N2 0.0 0.0 $C}
!

~ LINE CONTINUATION OPERATOR


Occasionally, it may be desirable to split a segment line over multiple
lines. This is particularly useful when a line is very long, or if a variable
in a central portion of the line may vary according to conditional
statements.
The Line Continuation
Operator must always Line continuations are used in PSCAD Script mostly for clarity. That is,
appear in the first column of
the connecting section line. PSCAD will automatically break segment lines that exceed the
See the format shown in formatted Fortran standard of 72 columns anyway, and so the user does
Example 9-16 not normally need to worry about this. However, to ensure that code is
easily readable to everyone, line continuations should be used.

The line continuation operator is used as follows: A line ending in the


‘~’ symbol will be joined with the next line if it starts with a ‘~’ symbol,
as well. This processing is performed after conditional statements have
been interpreted and is used in formatting the text for output into the
Fortran or data files.

432 PSCAD User’s Guide


PSCAD

The line continuation operator can appear anywhere on the segment


line, and it can be used with the #CASE Conditional Directive (described
in this chapter).

EXAMPLE 9-17:

In Example 9-14, conditional statement directives were used in order to


determine the output of a signal generator model. As a simple
illustration of how line continuations can be used, the code in Example
9-10 has been re-written below:

!
! Signal Generator
!
$OUT = ~
#IF Type==1
~SIN~
#ELSE
~COS~
#ENDIF
~(TWO_PI*$F)
!

If Type is “2,” after condition statement processing and line


continuation, the PSCAD Script would appear as follows, before being
transformed into formatted Fortran:

!
! Signal Generator
!
$OUT = COS(TWO_PI*$F)

#CASE CONDITIONAL DIRECTIVE


The #CASE conditional directive is essentially a short-form notation
method to be used instead of #IF, #ELSEIF, #ELSE, #ENDIF directives. It
is used in conjunction with the ‘~’ line continuation method to provide a
space saving alternative, especially when a great number of #IF, #ELSEIF,

PSCAD User’s Guide 433


Chapter 9: PSCAD Script

#ELSE, #ENDIF directives are required.

The #CASE directive can be used in all segments, and should appear as
follows:

#CASE <Expression> {<Clause_0>} {<Clause_1>} ...

<Expression> must return an integer from 0 to n, and can either be a


mathematical expression or simply a defined variable. <Clause_n>
represents what is to occur given the value of the expression, and where
in the sequence of clauses it resides. For example, the results of
<Clause_0> will occur if <Expression> is equal to 0. If <Expression> is
equal to 1, <Clause_1> will occur, etc.

EXAMPLE 9-18:

Once again referring to Examples 9-10 and 9-12, a simple illustration of


how the #CASE directive can be used instead of the #IF, #ELSEIF, #ELSE,
#ENDIF directives.

!
! Signal Generator
!
$OUT = ~
#CASE Type {~COS~} {~SIN~}
~(TWO_PI*$F)
!

Note that ‘Type can be either 0 or 1.

EXAMPLE 9-19:

The following illustrates how the #CASE directive is used in the


Transformers segment of the 3-Phase, 2-Winding classical transformer
component, located in the Master Library.

Here, ‘YD1’ and ‘Lead’ are both input parameters. ‘YD1’ can be either 0
or 1 and ‘Lead’ is either 1 or 2. Multiplying of these two integers can
result in 0, 1 or 2, and this information is used to determine which clause
to select:

434 PSCAD User’s Guide


PSCAD

!
#CASE YD1*Lead {$A1 $G1~} {$A1 $B1~} {$A1 $C1~}

EXPRESSION EVALUATION
In addition to various arithmetic and logical operators, PSCAD possesses
the ability to perform a limited set of mathematical functions.

Mathematical expression evaluation is used mostly in the Computations


segment, while Arithmetic and logical operators are used throughout the
entire component definition.

Mathematical Functions
Mathematical computations can be performed on input parameters,
input signals, or on results of other computations.

Table A-1 below lists all of the available mathematical functions:

Function Description

SIN(x) Sine function

COS(x) Cosine function

TAN(x) Tangent function

ASIN(x) Inverse sine function

ACOS(x) Inverse cosine function

ATAN(x) Inverse tangent function

SINH(x) Hyperbolic sine function

COSH(x) Hyperbolic cosine function

PSCAD User’s Guide 435


Chapter 9: PSCAD Script
yp

TANH(x) Hyperbolic tangent function

LOG(x) Natural logarithm

EXP(x) Exponential

LOG10(x) Base 10 logarithm

SQRT(x) Square root

ABS(x) Absolute value

REAL(x) Real part of complex number

IMAG(x) Imaginary part of complex number


2 2
NORM(x) Norm of complex number (x + y )

CEIL(x) Rounds fraction to next upper integer

FLOOR(x) Rounds fraction to next lower integer

Adds 0.5 to a REAL value and then performs an


ROUND(x) INT function (i.e. ROUND(X) = INT(X+0.5)). Do
not use with negative numbers

Removes fractional part of REAL value (right side


INT(x)
of decimal)

Removes integer part of REAL value (left side of


FRAC(x)
decimal)

RAND(x) Random value between 0 and x

P2RX(m,θ) Polar to rectangular conversion (θ in degrees)

P2RY(m,θ) Polar to rectangular conversion (θ in degrees)

R2PM(x,y) Rectangular to polar conversion (θ in degrees)

R2PA(x,y)
Rectangular to polar conversion (θ in degrees)

436 PSCAD User’s Guide


PSCAD

Arithmetic Operators
Listed below are the arithmetic operators available in PSCAD. These
operators are used to perform mathematical calculations primarily in the
Computations, Fortran, DSDYN and DSOUT segments.

Operator Description

+ Add

- Subtract

* Multiply

/ Divide

% Remainder

** Raise to power

\ Parallel (xy) / (x +y)

Logical Operators
Listed below are the logical operators available in PSCAD. Logical
expressions are primarily used in conjunction with #IF, #ELSEIF, #ELSE,
#ENDIF Directives and the ternary operator. They are also used in the
Checks segment.
Logical expressions will
return a value of 1 if true,
Operator Description and a value of 0 if false.

== Equal to

!= Not equal to

< Less than

> Greater than

<= Less than or equal to

>= Greater than or equal to

|| OR

&& AND

PSCAD User’s Guide 437


Chapter 9: PSCAD Script

______________________________________________________________

EXAMPLE 9-20:

Logical Operators can appear in many different areas. The following


examples illustrate the various ways these operators can be used:

!
! ...with #IF, #ELSEIF, #ELSE, #ENDIF Directives
!
#IF F >= 60.0
Fout = 60.0
See the Ternary Operator #ENDIF
section below for more !
details. ! ...with a Ternary Operator in the Computations
! segment
!
REAL L = X == 0.0 ? Y*2.0 : Y/3
!
! ...in the Checks segment
!
ERROR Value too small : R < 0.001
!

Ternary Operator
The ternary operator is yet another short form method offered in PSCAD
Script for representing an IF-ELSE-ENDIF type expression. It allows the
user to define a variable, according to certain conditions, in a single line.

The ternary operator is used only in the Computations segment, and


should appear as follows:

<Logic> ? <Value_if_True> : <Value_if_False>

<Logic> is a logical expression using logical operators. <Value_if_True>


and <Value_if_False> can either be a single constant, or a mathematical
expression.

438 PSCAD User’s Guide


PSCAD

EXAMPLE 9-21:

A user wants to define a REAL variable ‘X’ in the Computations


segment of a component definition. The value of ‘X’ is to be equal to
1.0 if an input parameter ‘N’ is 2 or 3, or defined by a mathematical
expression otherwise.

The following code should appear in the Computations segment of the


component definition:

REAL X = (N==2 || N==3) ? 1.0 : SQRT(2)*V

Where ‘V’ is a pre-defined constant.

EXAMPLE 9-22:

A user wants to define a REAL variable ‘Torq’ in the Computations


segment of a component definition. The value of ‘Torq’ is defined by a
mathematical expression, where one element of this expression varies
according to a condition. This can be accomplished by using the ternary
operator as follows:

REAL Torq = (X > 1 ? 0.0 : Tm) + Te*100

Where ‘X,’ ‘Tm’ and ‘Te’ are pre-defined constants.

PSCAD User’s Guide 439


Chapter 9: PSCAD Script

440 PSCAD User’s Guide


PSCAD

Chapter 10:

Debugging and Finalizing


Ironing out the bugs in a project can be the most challenging part of the
design process. No matter how carefully a system is constructed, there
are almost always a few errors or warnings issued when the project is
compiled and run. This chapter describes the reasons for some of the
most common errors and warnings, as well as how to deal with them.

Debugging a project can become even more difficult when user written
code is present. PSCAD does not include a debugging mechanism for
user code, and so an integrated debugger must be used. Some
methods of accomplishing this are described in this chapter.
In finalizing a project, the user may want to protect any user code when
supplying projects and components to other users. A section is included
in this chapter, which describes how to pre-build any user source code
into library or object files. These files can then be provided along with
the project without running the risk of giving away the secrets of your
hard work.

COMPILING AND BUILDING THE PROJECT


PSCAD does not presently include a pre-compilation message system,
and so to view any warnings or errors, you must first compile your
project. As a matter of fact, it is always a good idea to compile and
make your project first, before actually running the simulation. This is
especially true if this is the first run!

You can compile your project by simply pressing the Compile All button
in the Main Toolbar. To make your project, press the Make button. If
there are any problems with compilation or making your project, these
errors will appear in the Output Window.
Compile All and
Make Buttons
As described in Chapter 4, you can locate the source of any of the
messages through a simple left double-click on the message itself.
PSCAD will point to the source with an arrow icon.
Arrow Icon

PSCAD User’s Guide 441


Chapter 10: Debugging and Finalizing

Compiling an Individual Module


PSCAD allows users to narrow down the debugging process to individual
modules. In other words, you can compile modules separately from the
rest of the project.

Modules can be compiled a few different ways:

• On the project page in Circuit view, select the module to


be compiled. Right-click and select Compile Module
from the pop-up menu.
• In the Workspace window, expand the Definitions branch
of the project tree. Right-click on the module definition
and select Compile Module from the pop-up menu.
• In the Workspace window, expand the Main Working Page
branch of the project tree. Right-click on the module
instance and select Compile Module from the pop-up
menu.

COMMON OUTPUT WINDOW MESSAGES


There are a large number of possible error and warning messages that
can be generated and displayed in the Output Window. Messages can
See Chapters 3 and 4 for come from PSCAD, EMTDC or individual components. Most of these
more on the Output messages however, will never occur if a project is judiciously
Window and locating a
problem source. constructed in the first place.

442 PSCAD User’s Guide


PSCAD

The following descriptions outline the most common occurring


messages.

Warning: Suspicious isolated node detected


This warning is issued if PSCAD detects an open electrical circuit
connection on a component - usually caused by an electrical node that
is not connected to anything.

The suggested method to deal with this warning is to connect a large


resistance (approximately 1 MΩ) to ground at the node. This will
ensure numerical stability and will not have a great affect on the
simulation results.

Parser: Suspicious substitution of empty key ‘<name>’


This warning is issued if PSCAD detects an empty text input field in a
component instance. This warning most commonly occurs when
forgetting to name a source or transformer instance, or when a
component input parameter field called Fortran Comment is left
blank. <name> is the name of the text input field.

Signal ‘<name>’ type conversion may lose accuracy


This warning is issued if PSCAD detects a REAL signal being sent to an
input expecting an INTEGER. PSCAD will automatically convert the
REAL signal value to the nearest integer, hence the warning. <name>
is the name of the signal.

Signal ‘<name>’ source contention -> ‘<source_1>’ and


‘<source_2>’
This error is issued if PSCAD detects a signal of the same name being
generated from more than one source. This error is most commonly
caused when component instances with defined internal output
variables are copied, hence duplicating the internal output variable.
<name> is the name of the signal. <source_1> and <source_2> are
the devices generating the signal.

Signal ‘<name>’ dimension mismatch -> <dim_1> != <dim_1>


This error is issued if PSCAD detects that a signal of dimension
<dim_1> is being sent to an input expecting a signal of dimension
<dim_2>. This error commonly occurs with the Power Electronic
Switch components, which expect a 2-dimensional input gate signal
when set for interpolation. <name> is the name of the signal.

PSCAD User’s Guide 443


Chapter 10: Debugging and Finalizing

Signal ‘<name>’ size mismatch at connection ‘<con>’


This error is usually accompanies the previous error message. <name>
is the name of the signal, and <con> is the name of the connection to
which the signal is being input.

Array ‘<Name>’ cannot be typecasted


This error is issued if PSCAD detects an array signal type mismatch. For
example, if a data signal array was defined as type INTEGER and the
user attempted to tap off a single element with the Data Signal Array
Tap component set to type REAL (or vice-versa). Or, if an array of type
REAL is input into a component, where the external input Connection in
question is defined as an INTEGER array.

Invalid breakout connection to ground at ‘<Node>’. Node array


elements cannot be individually grounded.
This error is related to the use of the Breakout component: Ground
components cannot be directly connected to Breakout terminals. The
Breakout is designed specifically for mapping multiple connections on
See the SLD components in
the online help for more on the scalar side to a single array. Since Ground nodes cannot be
valid connections. mapped, the compiler will issue this warning. The suggested work
around is to use an Current Meter as a series element between the
Breakout terminal and ground.

<Node> is the name of the Breakout reference node connected to


ground.

Short in breakout at ‘<Node>’. Node array elements must be


uniquely defined.
This error is related to the use of the Breakout component: The nodes
on the 3-phase side of this component are not actual electrical nodes,
but references that will assume the node number to which they are
connected. This error is posted if these reference nodes are shorted
(i.e. electrically connected together). Each node on the 3-phase side of
the Breakout component must be unique.

<Node> is the name of the Breakout connection which is shorted.

Branch imbalance between breakouts at ‘<Node>’. Node array


elements cannot be shared between signals.
This error is related to the use of the Breakout component: The nodes
on the 3-phase side of this component are not actual electrical nodes,
but references that will assume the node number to which they are
connected. A special condition that cannot be referenced is referred
to as an ‘unbalanced’ condition, where the imbalance refers to

444 PSCAD User’s Guide


PSCAD

electrical nodes, not actual impedance. The basic rule to remember


here is that all branches on the 3-phase side must include at least one
series impedance.

<Node> is the name of the Breakout connection which is shorted.

FIND FEATURE
If the user wishes to search a project for a signal name, connection
name, node number, etc., the Find feature in PSCAD can be used. To
bring up the Find dialog window, simply select Edit | Search… from the
Main Menu bar, press the Find button in the Main Toolbar or press Ctrl
+ F on your keyboard, while in Circuit view. Any of the above
operations will open the Find dialog.

The various input parameters for this dialog are described below.

Find What
Enter the character string that you would like to search for. Be sure to
check the selection boxes at the bottom of the dialog to modify your
search options: If All Pages is selected, then Find will search the entire
project, as opposed to just the current page. If Whole Word is
selected, then Find will only look for the Find What string as a whole
word, as opposed to part of a word. If Match Case is selected, then the
search will be case sensitive.

Note that if you are performing a Node Number search, this input is
disabled.

Search
It is possible to narrow a search to just a certain type of object in the
project. The following is a list of the available options:

• All

PSCAD User’s Guide 445


Chapter 10: Debugging and Finalizing

• Cables
• Control Panel Devices
• Graphs/Curves/Plots
• Imports/Exports
• Node Labels
• Output Channels
Arrow Icon • Transmission Lines
• Data Labels
• Component Names
• Node Numbers
• Component Sequence Number

Node Numbers is a special type of search, where you can look directly
for an electrical node, by node and subsystem number, as opposed to a
character string. Some additional selections and fields become enabled
if this option is selected: Enter the subsystem number for the node in
the Subsystem # input field. Enter the node number in the Node #
input field.

Viewing Search Results


Search results can be viewed in the Search section of the Output
window. The Search section will automatically open upon invoking the
Find feature. Any instance matching the search criteria will appear in a
list form as shown below:

Each entry in the list will have a description including the location of the
object plus the object type. Simply left double-click on a particular list
entry and PSCAD will automatically point to the source with an arrow
icon in Graphic view.

446 PSCAD User’s Guide


PSCAD

VIEWING BUILD AND DATA FILES


Whenever a project is compiled and built, several files involved in this
process are created and stored in the temporary (*.emt) directory
associated with the project. Some of these files, such as Fortran, Data
and Make files can be useful in debugging projects. See the EMTDC User’s
Guide for a more detailed
description of the Fortran,
Most of these are simple text files, which can be opened manually by Map and Data files.
using a simple text editor program. However, some of these files can be
viewed directly from within PSCAD.

Fortran and Data Files


As described in Chapter 3, these files can be viewed by simply clicking
the Fortran or Data tabs at the bottom of the Design Editor window
Fortran and Data
(following compilation, of course). tabs

These files are module specific, hence their corresponding tabs in the
Design Editor. Note that these files are automatically generated by
PSCAD. Any editing will be overwritten following the next compilation.

Map and Make Files


Map and Make files involve the entire project, and are therefore not
included in the Design Editor tab bar. To view either of these files, right-
click on the project title in the Workspace window and select either
View Map File… or View Make File….

This will invoke a separate file viewer window, which will temporarily
replace the Design Editor window. This viewer has its own tab bar,
which allows you switch between files quickly.

PSCAD User’s Guide 447


Chapter 10: Debugging and Finalizing

Note that these files are automatically generated by PSCAD. Any


editing will be overwritten following the next compilation. The Log file
is a simple file created by the compiler to log the compilation process.

WIRE COLOUR CODE


Following the compilation of a case, you may notice that some data
signal Wires have turned colour. PSCAD uses these colours so that the
user may visually differentiate signals types directly from Circuit view.

The colour legend is as follows:

• Green: Indicates a Wire representing a signal of type REAL


• Blue: Indicates a Wire representing a signal of type INTEGER
• Magenta: Indicates a Wire representing a signal of type
LOGICAL
• Black: Indicates a Wire representing an electrical node

COMPONENT ORDERING
Component ordering functions are performed by PSCAD on a per
Module basis. By default, the Order Components Automatically option is
enabled in all new and existing Modules. This option may be disabled
by the user in selected Modules, and yet still maintain automatic
ordering in others.

PSCAD V4 now includes a smart algorithm, which will automatically


sequence (order) all components in the EMTDC System Dynamics. This
is done to ensure that variables are calculated in the proper sequence,
and that single time step delays are minimized.
Component ordering functions
are performed by PSCAD per Module The ordering method in PSCAD V3 was simple: The components were
basis. By default the Order
Components enabled in all new and ordered from left to right and from top to bottom of where they
existing Modules. This option may appeared in the project page. In PSCAD V4, the algorithm iteratively
be disabled by the user in selected
Modules, and yet still scans the entire project and then assigns sequence numbers to all
maintain automatic ordering in existing blocks. Input constants are moved to the top of the sequence,
others.
whereas outputs are moved to the bottom.

This function should be left on by default at all times, however there


may be instances where it is desirable to turn it off and manually order

448 PSCAD User’s Guide


PSCAD

the components during the debugging process. This may be the case if
you wish to manually control the feedback points. Alternatively, a
feedback can be introduced by inserting a Feedback Loop Selector
component in the signal path.

Component Ordering features may be accessed through the Module


Settings Dialog. See Editing Module Settings in Chapter 4 for more
details.

Showing Sequence Numbers


Before manually ordering any components, you must first compile the
case and then ensure that the Show Sequence Numbers setting is
enabled in the Module Settings dialog: To bring-up the Module Settings
dialog, right-click on a blank part of the Circuit page and select Module
Settings...

Once this option is enabled, each component instance in your project


should have numbers overlaid on top of their graphic, similar to that
shown below:

There are two possible locations within the EMTDC System Dynamics
(i.e. DSDYN or DSOUT) where the code for a particular component can
reside. As a result, the sequence numbers are colour coded so that the
user can graphically determine where code is. These colours are listed
below:

Colour Legend: For more on EMTDC System


Dynamics, see Chapter 2 in
• Aqua: Indicates that the component code appears in the EMTDC Manual.

sequence within DSDYN for that Module.


• Olive: Indicates that the component code appears in
sequence within DSOUT for that Module.

PSCAD User’s Guide 449


Chapter 10: Debugging and Finalizing

Showing Signal Locations


Another feature that is helpful when ordering components is the Show
Signal Locations option in the Module Settings dialog. When this option
is enabled, PSCAD will use icons placed on connections and wire
termination points to allow for easy, graphical determination of where
time step delays are present. In addition, icon colour is used to
represent the signal type.

The icons used are listed below with explanations:

• <[Link]> Feed-Forward Connection: This symbol


indicates that the signal passing through the connection point is
classified as a feed-forward signal. This means that the value
of the signal is always defined within the present time step.
• <[Link]> Feedback Connection: This symbol indicates that
the signal passing through the connection point is classified as
a feedback signal. This means that the value of the signal was
defined in the previous time step t - Dt. Due to this fact,
feedback signals must be written to, and then extracted from
storage each time step.
• <[Link]> Feed Fixed Connection: This symbol indicates
that the signal passing through the connection point is
classified as a feed fixed signal. Feed fixed signals are similar
to feedback signals, in that their value is always extracted from
storage. The difference is that their values are usually defined
by an online control, such as a slider or switch.

Colour Legend:

• Green: Indicates a signal of type REAL


• Blue: Indicates a signal of type INTEGER
• Magenta: Indicates a signal of type LOGICAL
• Grey: Indicates an electrical signal

Manually Setting Sequence Numbers


To manually set sequence numbers, first ensure that the Show
Sequence Numbers option is enabled (as described above), and that
You should first compile the the Order Components Automatically option is disabled in the
case with Order
Components Automatically Module Settings dialog.
enabled so as to setup a
preliminary code structure
before manually adjusting.
Right-click on the component and select Set Sequence from the pop-up
menu.

450 PSCAD User’s Guide


PSCAD

This will bring up the Sequence Number dialog.

Enter the desired sequence number and click the OK button. Repeat
this process for the remaining components and modules.

CONTROL SIGNAL FLOW INDICATORS


Control signal flow indicators can be used to help visualize the flow of
control signals (i.e. from source to sink) following compilation of the
Project. The indicators will appear on Wire components that are part of
a control signal path. The signal flow indicators appear as arrowheads
directly on the Wire.

PSCAD User’s Guide 451


Chapter 10: Debugging and Finalizing

To enable this feature go to Edit | Workspace Settings... in the


PSCAD Main Toolbar to bring up the Workspace Settings dialog. Click
the Views tab and select Show control signal flow on wires.

The indicator colour will appear according to the legend below:


The indicators are orientated
by default according to the Colour Legend:
Wire component direction
(i.e. towards the End Point
of the Wire), not the actual
• Green: Indicates a signal of type REAL
control signal flow. If a flow • Blue: Indicates a signal of type INTEGER
indicator appears reversed, • Magenta: Indicates a signal of type LOGICAL
simply Reverse the Vertexes
of the Wire. • Grey: Indicates an electrical signal

USING AN INTEGRATED DEBUGGER


If you are using the Digital Fortran 5 or the Compaq Visual Fortran 6
compiler, then it is possible to use either of these programs as an
integrated debugger. The following sections describe how to preset
relevant project settings, as well as step-by-step instructions on how to
link EMTDC with your chosen debugging program.

Project Options to Preset


There are a few project settings that must be preset before attempting
to use an integrated debugger. All of which are set in the Project
Settings dialog. This dialog can be accessed through a right-click on the
project title itself (either a case or a library) in the Workspace window,
and selecting Project Settings… from the pop-up menu.

For more details on the


Project Settings dialog and
the options contained
within, see Chapter 6.

452 PSCAD User’s Guide


PSCAD

Navigate to the Diagnostics section of the dialog. Make sure that the
Allow Use of Integrated Debugger option is enabled. Enabling this
option allows EMTDC to be started manually.

The remaining three options are not mandatory and it is up to the user’s
discretion to enable or disable them. If you are not sure, it is suggested
that all options are enabled.

Next, navigate to the Fortran section of the Project Settings dialog and
enable the Insert Debug Information option in the Compile Options
area.

Ensure that any user source files are referenced in the Additional
Source Files field, as well. If you fail to do this, your source files will not
be included when the project is compiled, and you will not be able to
debug your code. See Chapter 6 for more
information on the
Additional Source Files
Linking to the Debugger project setting.
The following procedure outlines how to set-up an integrated debugger
with your project. Note that the following steps are described using the
Compaq Visual Fortran 6. If you are using Digital Fortran 5, the steps are
very similar.

PSCAD User’s Guide 453


Chapter 10: Debugging and Finalizing

1. Ensure that the project settings described in the ‘Project


Options to Preset’ section above are enabled. Run the
simulation (press the Run button in the Main Toolbar). A pop-
Run Button up message should appear as follows:

2. Select the No button to continue with debugging.


3. On the Status Bar (at the bottom of the PSCAD Work
Environment) you should see a command line indicated. If you
cannot see the Status Bar, select View | Status Bar from the
Main Menu. The general format of this command is as
follows:

Command: <project_name> -v4 localhost ####

Write down the four-digit number at the end of the command


line so as to not forget it (you will need it soon).

4. Open Compaq Visual Fortran and select File | Open form the
Main Menu. Change the Files of Type drop list to
‘Executable Files.’ Navigate to the temporary directory (*.emt)
associated with your project file (located in the same
directory), select the executable file (*.exe) for your project
and then click the Open button. For example, if your project
is entitled ‘[Link],’ then you would select ‘[Link]’ from the
‘[Link]’ directory as shown below:

454 PSCAD User’s Guide


PSCAD

5. While still in Compaq Visual Fortran, select Project |


Settings… to bring up the Project Settings dialog. Click the
Debug tab and in the Program Arguments field, enter the
following:

-v4 localhost ####

Note that the four-digit number (####) must be the same as


that in Step 3. Click the OK button.

6. While still in Compaq Visual Fortran, open the appropriate


Fortran source file (*.f) by selecting File | Open form in the
Main Menu. Change the Files of Type drop list to ‘Fortran
Files’ and then navigate to the required Fortran file.
7. Insert a breakpoint at the appropriate place in the source code
and press the Go button.
Please note that it is assumed that the user is familiar with the
debugging software and can continue from here. Also, Steps 1 through
7 must be followed for subsequent runs.

Once debugging is complete and the code is clean, make sure that all
debugging options outlined in the ‘Project Options to Preset’ section are
disabled. Failure to do so may affect simulation speed.

PROTECTING USER CODE


There are occasions where user written code may contain trade secrets,
or simply represent a large corporate investment in development time.

PSCAD User’s Guide 455


Chapter 10: Debugging and Finalizing

In instances such as this, it may be in the best interest of the user or


company to protect the product code, especially when models are to be
sold or used by clients or partners in joint ventures.

The way in which this is accomplished in PSCAD is by pre-building the


It is important to note that user code into a binary file called an object file (*.obj) - it is also
all user code requiring possible to combine a number of models into a binary file called a
protection should be placed
in the form of an external library (*.lib) file. A library file is more or less a collection of object
subroutine file (written in files.
either Fortran or C). If the
code for the component is
placed in the Fortran section Once the object or library file is created, it simply needs to be included
of the component along with the PSCAD Library Project (*.psl) containing the user-defined
definition, protection is
impossible.
components. Additionally, the path to the object or library file must be
set in the Additional Library (*.lib) and Object (*.obj) Files input
field, in the library Project Settings dialog.

Creating Library (*.lib) and Object (*.obj) Files


The procedure for creating library or object files depends on whether
the Fortran compiler used is Fortran 77 (EGCS/GNU) or Fortran 90
(Digital or Compaq) standard. The procedures are presented below for
See Chapter 6 for more both compiler types.
information on the
Additional Library (*.lib) and
Object (*.obj) Files project Fortran 90 Compiler
setting. In order to create library and object files, you must start with a pre-
formatted Make (*.mak) file. A make file can be easily created by
compiling any case project (*.psc) file and extracting the make file from
the corresponding *.emt directory.

1. Save the make file into a work directory (say C:\temp) - you
can change the file name if you wish, just leave the *.mak
extension.
Ensure that all Fortran
models to be included in the 2. Open the make with a standard text editor for modifying.
library or object files are Modification of the make file can be broken down into the
debugged before
proceeding.
various sections of the file itself:

#-------------------------------------------------------------
# Project '<filename>' make using the 'df90' compiler.
#-------------------------------------------------------------

DO NOT MODIFY

456 PSCAD User’s Guide


PSCAD

#-------------------------------------------------------------
# All project
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# Directories, Architecture, and Version
#-------------------------------------------------------------

EmtdcDir = C:\PROGRA~1\PSCAD400\emtdc\cf6
EmtdcInc = $(EmtdcDir)\inc
EmtdcBin = $(EmtdcDir)\windows

Modify as shown above. EmtdcDir is the path to the proper EMTDC


library. It could be something like ‘C:\Program Files\PSCAD400\emtdc
\cf6’, but this depends on where it is located on your hard drive. Note
that the path must be entered in 8-character DOS equivalent format.

#-------------------------------------------------------------
# Fortran Compiler
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# C Compiler
#-------------------------------------------------------------

DO NOT MODIFY

PSCAD User’s Guide 457


Chapter 10: Debugging and Finalizing

#-------------------------------------------------------------
# Linker
#-------------------------------------------------------------

Link_Lib = [Link]
Link_Lib_Opt = /out:$@ /nologo
DebugLib =
Library = $(Link_Lib) $(Link_Lib_Opt) $(DebugLib)

Modify as shown above. [Link] is a file used by the Fortran 90


compiler.

#-------------------------------------------------------------
# Build rules for PSCAD generated files
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# Build rules for file references
#-------------------------------------------------------------

DO NOT MODIFY

458 PSCAD User’s Guide


PSCAD

#-------------------------------------------------------------
# Dependencies
#-------------------------------------------------------------

FC_Objects = \
ffile1.$(FC_Suffix) \
ffile2.$(FC_Suffix)

CC_Objects =

UserLib = [Link]

$(UserLib): $(FC_Objects) $(CC_Objects)


@echo !--Making Library: $@
$(Library) $(FC_Objects) $(CC_Objects)

targets: $(UserLib)

clean:
-del *.lib
-del *.obj
@echo !--Make clean: succeeded.

Modify as shown above. FC_Objects indicates the Fortran files


(containing user written subroutines) to be included in this library file.
For example, if two Fortran files are entitled ‘ffile1’ and ‘ffile2,’ then
modifications should appear as shown above. UserLib specifies the
name of the library file to be generated.

3. Save the changes and make sure that all of the linked Fortran
files specified in FC_Objects are moved into the same
directory as the make file.
4. Open a Command Prompt and navigate to the directory in
A similar syntax may be used
which the make file resides. for C source files. Simply
5. Run the following command, where <filename> is the name modify CC_Objects instead
of FC_Objects. For example:
of the make file: ‘cfile1.$(CC_Suffix)’

nmake –f <filename>.mak

This procedure will create a library (*.lib) file, as well as a separate


object (*.obj) file for each linked Fortran or C file. If you plan to use the
library file, the object files can be discarded.

PSCAD User’s Guide 459


Chapter 10: Debugging and Finalizing

Fortran 77 Compiler
In order to create library and object files, you must start with a pre-
formatted make (*.mak) file. A make file can be easily created by
compiling any PSCAD Case Project (*.psc) file and extracting the make
file from the corresponding *.emt directory.

1. Save the make file into a work directory (say C:\temp) - you
can change the file name if you wish, just leave the *.mak
extension.
2. Open the make with a standard text editor for modifying.
Modification of the make file can be broken down into the
various sections of the file itself:

#-------------------------------------------------------------
# Project '<filename>' make using the 'gnu' compiler.
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# All project
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# Directories, Architecture, and Version
#-------------------------------------------------------------

EmtdcDir = C:\PROGRA~1\PSCAD400\emtdc\gnu
EmtdcInc = $(EmtdcDir)\inc
EmtdcBin = $(EmtdcDir)\windows

Modify as shown above. EmtdcDir is the path to the proper EMTDC


library. It could be something like ‘C:\Program Files\PSCAD400\emtdc
\gnu’, but this depends on where it is located on your hard drive. Note
that the path must be entered in 8-character DOS equivalent format.

460 PSCAD User’s Guide


PSCAD

#-------------------------------------------------------------
# Fortran Compiler
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# C Compiler
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# Linker
#-------------------------------------------------------------

Link_Lib = [Link]
Link_Lib_Opt = -rv $@
DebugLib =
Library = $(Link_Lib) $(Link_Lib_Opt) $(DebugLib)

Modify as shown above. [Link] is a file used by the Fortran 77


compiler.

#-------------------------------------------------------------
# Build rules for PSCAD generated files
#-------------------------------------------------------------

DO NOT MODIFY

#-------------------------------------------------------------
# Build rules for file references
#-------------------------------------------------------------

DO NOT MODIFY

PSCAD User’s Guide 461


Chapter 10: Debugging and Finalizing

#-------------------------------------------------------------
# Dependencies
#-------------------------------------------------------------

FC_Objects = \
ffile1.$(FC_Suffix) \
ffile2.$(FC_Suffix)

CC_Objects =

UserLib = [Link]

$(UserLib): $(FC_Objects) $(CC_Objects)


@echo !--Making Library: $@
$(Library) $(FC_Objects) $(CC_Objects)

targets: $(UserLib)

clean:
-del *.lib
-del *.o
@echo !--Make clean: succeeded.

Modify as shown above. FC_Objects indicates the Fortran files


(containing user written subroutines) to be included in this library file.
For example, if two Fortran files are entitled ‘ffile1’ and ‘ffile2,’ then
modifications should appear as shown above. UserLib specifies the
name of the library file to be generated.

3. Save the changes and make sure that all of the linked Fortran
files specified in FC_Objects are moved into the same
directory as the make file.
4. Open a Command Prompt and navigate to the directory in
A similar syntax may be used which the make file resides.
for C source files. Simply 5. Run the following command, where <filename> is the name of
modify CC_Objects instead
of FC_Objects. For example: the make file:
‘cfile1.$(CC_Suffix)’
make –f <filename>.mak

This procedure will create a library (*.lib) file, as well as a separate


object (*.obj) file for each linked Fortran or C file. If you plan to use the
library file, the object files can be discarded.

462 PSCAD User’s Guide


PSCAD

Chapter 11:

MATLAB/Simulink Interface
PSCAD provides users with the ability to interface and utilize the
functionality of MATLAB commands and toolboxes (including all
graphical commands) through a special interface. This is achieved by
calling a special subroutine from within a standard component in
PSCAD.

Components that interface to MATLAB/Simulink are not offered as part


of the Master Library, and must be specially developed for this purpose.
In other words, if a specific MATLAB/Simulink component is required,
the user must design his or her own to do the job. Once designed
however, this component will be treated as a normal component in
PSCAD, and may be used interactively with other components in a
particular project.

There are two important things to remember before attempting to


interface with MATLAB from PSCAD:

1. The MATLAB Interface is only compatible with the dynamic


version of EMTDC. That is, it will not function when using the
free EGCS/GNU Fortran 77 Compiler.
2. MATLAB must be installed on your computer in order to use
the MATLAB interface.
3. PSCAD can be interfaced with both MATLAB versions 5 and 6
library files.

THE MATLAB INTERFACE SUBROUTINE


PSCAD interfaces to MATLAB through a single Fortran subroutine called
MLAB_INT. This routine is included in the main EMTDC library and may
therefore be called from any user-defined component. This routine
performs the following functions:

• Launches the MATLAB engine using MATLAB Fortran API


‘engOpen’ commands.
• Changes the working directory to where MATLAB “*.m”
files are located.

PSCAD User’s Guide 463


Chapter 11: MATLAB/Simulink Interface

• Accesses EMTDC variables from the PSCAD STORF and


STORI arrays.
• Converts Fortran variables to C-style pointers and
allocates/de-allocates memory locations.
• Uses the MATLAB Fortran API to pass the variables/
See the EMTDC User’s
Guide for more on EMTDC
pointers to the MATLAB engine so they can subsequently
storage arrays. be accessed from ‘*.m’ files.
• Gets MATLAB output variables using MATLAB Fortran API
and places them into the STORF and STORI arrays.

Arguments

SUBROUTINE MLAB_INT(MPATH, MFILE, INPUTS, OUTPUTS)

Inputs

Argument Type Description

MPATH CHARACTER Character string of MATLAB ‘*.m’ file path

Name of module within ‘*.m’ file (the .m


MFILE CHARACTER
extension should not be added)

INPUTS CHARACTER Format string for all input variables

Outputs

Argument Type Description

OUTPUTS CHARACTER Format string for all output variables

464 PSCAD User’s Guide


PSCAD

The formatting for the INPUTS and OUTPUTS’ variables should be as


follows:

• R for REAL type


• I for INTEGER type
• R(dimension) or I(dimension) for array variables
• Ensure that a space is placed between variables

In PSCAD V4, INPUTS and OUTPUTS’ variables can be empty strings, in


which case the ‘*.m’ file will run without arguments. This is helpful in
initializing the MATLAB environment and designing a component that
runs MATLAB ‘*.m’ files and Simulink ‘*.mdl’ files simultaneously.

EXAMPLE 11-1:

A MATLAB module is called by [D] = TEST(A,B,C), where TEST is a


module in a MATLAB file ‘TEST.m’, that is located in C:\TEMP
MLAB_FILES. The input ‘A’ is a REAL variable, ‘B’ is a REAL array of
dimension 31 and ‘C’ is an INTEGER. The output ‘D’ is a REAL array of
dimension 10.

The MATLAB interface subroutine call would then appear as follows:

CALL MLAB_INT("C:\TEMP\MLAB_FILES", "TEST", "R R(31) I", "R(10)")

EXAMPLE 11-2:

A MATLAB file entitled ‘TEST.m’ is located in C:\TEMP\ MLAB_FILES. It


consists of MATLAB commands that may take a snapshot of MATLAB
results, or initialize the environment (such as setting global variables or
changing directory, etc.).

The MATLAB interface subroutine call would then appear as follows:

PSCAD User’s Guide 465


Chapter 11: MATLAB/Simulink Interface

CALL MLAB_INT("C:\TEMP\MLAB_FILES", "TEST", "", "")

THE SIMULINK INTERFACE SUBROUTINE


PSCAD interfaces to Simulink through a single Fortran subroutine called
‘SIMULINK_INT.’ This routine is included in the main EMTDC library and
may therefore be called from any user-defined component. This
routine performs the following functions:

• Launches the MATLAB Fortran API functions the same as


the MATLAB Interface Subroutine.
• Changes the working directory to where the Simulink
‘*.mdl’ files are located.
• Accesses EMTDC variables from the PSCAD STORF and
STORI arrays.
• Uses the MATLAB Fortran API to pass the variables/
pointers to the MATLAB engine so they can subsequently
be accessed from ‘*.mdl’ files.
• Sets the simulation data, specified by the Workspace I/O
See the EMTDC User’s
Guide for more on EMTDC pane of the Simulation Parameters dialog box, and runs
storage arrays. the Simulink module using the MATLAB command
‘set_param’.
• Synchronizes Simulink to the PSCAD. That is, PSCAD
proceeds only after the Simulink module simulation is
completed each time step, which ensures that the correct
results from Simulink are passed to PSCAD.
• Gets Simulink output variables and places them into the
EMTDC STORF arrays. This is done in two steps; first, the
MATLAB command ‘get_param’ is employed to get the
variable name of Simulink outputs from the Workspace
I/O pane in the Simulation Parameters dialog box, and
then MATLAB Fortran API is utilized to exact and place
them into EMTDC STORF arrays.

Arguments

SUBROUTINE SIMULINK_INT(MPATH, MFILE INPUTS)

466 PSCAD User’s Guide


PSCAD

Inputs

Argument Type Description

Character string of MATLAB ‘*.mdl’ file


MPATH CHARACTER
path

Name of module within ‘*.mdl’ file (the


MFILE CHARACTER
*.mdl extension should not be added)

INPUTS CHARACTER Format string for all input variables

The formatting for the INPUTS’ variable is the same as that in the
MATLAB interface subroutine. Note that the OUTPUT of the SIMULINK
interface is automatically handled inside the subroutine and is always
put into the corresponding EMTDC STORF array.

EXAMPLE 11-3:

A Simulink module called ‘[Link],’ has external inputs A, B and C


and is located in C:\TEMP\SIMULINK_FILES. The input ‘A’ is a REAL
variable, ‘B’ is a REAL array of dimension 31 and ‘C’ is an INTEGER.

The Simulink interface subroutine call would then appear as follows:

CALL SIMULINK_INT("C:\TEMP\SIMULINK_FILES", "TEST", "R R(31) I")

DESIGNING A MATLAB COMPONENT


Designing a MATLAB component involves two simple steps:

1. Create a new component.


2. Write a MATLAB file (.m) to perform the required modeling.

PSCAD User’s Guide 467


Chapter 11: MATLAB/Simulink Interface

Component Design
Any number of signals or parameters can be passed to or from a
MATLAB component. The Fortran code inserted into the Fortran
segment of the component definition should perform four tasks:

See Chapter 8 for more


1. Input variables for the MATLAB function should be transferred
details on designing to STORF and/or STORI arrays.
components. 2. The MLAB_INT subroutine must be called with arguments for
the MATLAB module and path name, input format string and
output format string (more information to follow).
3. Output variables should be transferred from STORF and/or
STORI arrays into the PSCAD component output connection
nodes.
4. Increment the NSTORF and/or NSTORI index pointers by the
total number of variables used.

EXAMPLE 11-4:

Consider a simple example for a PSCAD component, which has 2 REAL


input connection nodes (A and B), and a single REAL output connection
node (C).

A
M ATLAB C
B Component

The following code should then appear in the Fortran segment of the
component definition:

#STORAGE REAL:3
STORF(NSTORF) = $A
STORF(NSTORF+1) = $B
!
CALL MLAB_INT("$Path", "$Name", "R R", "R")
!
$C = STORF(NSTORF+2)
NSTORF = NSTORF + 3
!

468 PSCAD User’s Guide


PSCAD

The component definition will need to define at least two input fields in
a Parameters’ section category page. In this case for example, $Path is
a text field symbol name expecting the pathname to where the *.m files
are located. $Name is also a text field symbol name expecting the
name of the MATLAB module. For example, if the MATLAB function is
called ‘TEST1,’ contained within a file called ‘TEST1.m,’ then the
$Name parameter should then be entered as ‘TEST1.’

More complex input and output arguments can also be used. If an


array signal is used, the input or output format string arguments should
contain the type and dimension. For example, a REAL array of
dimension 31 would appear as R(31), or an INTEGER array of dimension
10 as I(10). Each variable should be separated by one or more spaces,
and the order of variables should be identical to the order expected in
the MATLAB function.

A good mechanism in Fortran to transfer array variables into or out of


the EMTDC STORF or STORI arrays is the DO/ENDDO loop.

EXAMPLE 11-5:

Here is an example illustrating a MATLAB component, which has a


single REAL input connection array of dimension 31, and a single
output connection of dimension 2.

The following code should then appear in the Fortran segment of the
component definition:

PSCAD User’s Guide 469


Chapter 11: MATLAB/Simulink Interface

#STORAGE REAL:33
#LOCAL INTEGER I_CNT
!
! First Input Array (REAL(31))
!
DO I_CNT = 1,31,1
STORF(NSTORF+I_CNT-1) = $INPUT(I_CNT)
ENDDO
!
CALL MLAB_INT("$Path","$Name","R(31)","R(2)")
!
! First Output Array (REAL(2))
!
DO I_CNT=1,2,1
$OUTPUT(I_CNT) = STORF(NSTORF+31+I_CNT-1)
ENDDO
!
! Increment STORF pointer
!
NSTORF = NSTORF + 33
!

Note that when the output variables are extracted from the STORF array,
the offset 31 must be added, as 31 input variables were already used to
put the INPUT variables into the STORF array. In the entire routine, 33
STORF locations were used (31 inputs, 2 outputs).

DESIGNING A MATLAB/SIMULINK COMPONENT


The design steps and principles used in creating a MATLAB/Simulink
component, are similar to that explained in the preceding section.
Here, an example is provided to illustrate how to design a component
that utilizes both the MATLAB and the Simulink interface.

EXAMPLE 11-6:

The figure below illustrates a MATLAB/Simulink component in PSCAD.


The input to the component is an array of four variables, named ‘TIME,’
‘Freq,’ ‘Phase,’ and ‘Mag.’ The output from the component is an array
of six variables as labelled.

470 PSCAD User’s Guide


PSCAD

The following code appears in the Fortran segment of the component


definition:

#STORAGE REAL:12
#LOCAL INTEGER I_CNT, M_CNT
!
! PSCAD MATLAB INTERFACE
! MODULE: Matlab Interface with Simulink
!
I_CNT = 1
M_CNT = 0
!

PSCAD User’s Guide 471


Chapter 11: MATLAB/Simulink Interface

! Call *.m files in order to initialize the


! environment...
!
IF (TIMEZERO) THEN
#IF "$mName1" != ""
CALL MLAB_INT("$Path", "$mName1", "", "")
#ENDIF
#IF "$mName2" != ""
CALL MLAB_INT("$Path","$mName2","" , "")
#ENDIF
ENDIF
!
! TIME info to run either *.m or *.mdl module
!
#IF ($OPTSEC == 0 )
STORF(NSTORF) = TIME
STORF(NSTORF + 1) = DELT
M_CNT = 2
#ELSE
STORF(NSTORF) = TIME
M_CNT = 1
#ENDIF
!
! Transfer inputs to EMTDC STORF array
!
DO I_CNT = 1, $#DIM(sig_in)
STORF(NSTORF + M_CNT + I_CNT-1) = $sig_in(I_CNT)
END DO
M_CNT = M_CNT + I_CNT - 1
!
! CALL PSCAD MATLAB INTERFACE
!
#IF $OPTSEC == 0
CALL MLAB_INT("$Path","$mfile","R(6)","R($#DIM(sig_out))")
#ELSE
CALL SIMULINK_INT("$Path","$simfile","R(5)")
#ENDIF
!
! Transfer MATLAB output variables
!
I_CNT = 1
DO WHILE (I_CNT .LE. $#DIM(sig_out))
$sig_out(I_CNT) = STORF(NSTORF + M_CNT + I_CNT - 1)
I_CNT = I_CNT + 1
END DO
!
! Update storage array
!
NSTORF = NSTORF + M_CNT + I_CNT - 1

472 PSCAD User’s Guide


PSCAD

Various Parameters’ category pages within the component definition


define the variables used in the above code. This category page would
appear similar to that shown below:

Each of the input fields above defines a variable (preceded by a $


symbol) in the component code.

INTERFACING NOTES
The MATLAB engine performs operations very slowly, compared with
the same equivalent operation hard-coded directly into a PSCAD
component. The MATLAB source code is interpreted each time it is
called, allowing users to dynamically edit the ‘*.m’ file in the middle of
a run and see its effect immediately. This interactivity is also possible in
PSCAD through the use of on-line sliders, switches, dials and buttons.
Any combination of the two methods can be used simultaneously.

PSCAD User’s Guide 473


Chapter 11: MATLAB/Simulink Interface

Alternative Simulink Interface


There is an alternative way to invoke a Simulink module. Instead of
calling the ‘SIMULINK_INT’ subroutine, users may call ‘MLAB_INT’
subroutine to invoke an ‘*.m’ file, which uses the MATLAB command
‘sim’ to handle the Simulink module. However, the use of
‘SIMULINK_INT’ is highly recommended due to the synchronization
mechanism between MATLAB and PSCAD implemented within this
subroutine. This is especially true for Simulink modules that run longer
than the time step defined inside EMTDC.

Simulation Speed
To try and speed up the MATLAB solution, it is often a good idea to try
and use a larger time step when invoking MATLAB components
(wherever possible or practical). An enable/disable switch can also be
implemented, so as to allow PSCAD to operate at close to full speed.

EXAMPLE 11-7:

The figure below illustrates one way to speed up your PSCAD/MATLAB


simulation. Here, an impulse train is applied to an additional enable/
disable input to control how often the MATLAB solution engine is
invoked.

A
M ATLAB C
B Component

Enable

The Impulse Train frequency can be varied for optimal speed/accuracy


considerations.

474 PSCAD User’s Guide


PSCAD

Conversion to C
It should also be possible to convert ‘*.m’ source code directly to ‘C’
code using the MATLAB ‘C’ compiler, and then directly compile and link
the ‘C’ source code into the EMTDC executable. This has not been
tested thoroughly, but no obvious technical reasons exist as to why it
should not. With this ‘hard-compiled’ approach, you lose the ability to
edit the MATLAB ‘*.m’ interpreted file during simulations. The ‘hard-
compiled’ approach also may not work with any MATLAB graphical
functions.

A good compromise can be reached by first using MATLAB components


to develop and test algorithms, but in the end to optimize the speed of
the final design by hard-coding the algorithms in Fortran or C (either
manually or using the MATLAB ‘C’ compiler). The final hard-coded
algorithms are linked directly with the EMTDC solution engine and are
very fast (as they can be optimized using modern compilers).

Plotting Enhancements
The MATLAB graphics functions are a very powerful addition to the
PSCAD plots and graphical interface. Three-dimensional plots, active
graphics and rotating images are possible and integrate seamlessly with
the PSCAD graphical libraries.

ENABLING AND USING THE INTERFACE


In order to make use of the MATLAB/Simulink interface, you must first
enable it in the project you are working with. This is accomplished by
selecting the option Use MATLAB Interface in the Fortran section of
the Project Settings dialog – see Chapter 6 for more on this.

Also, you must ensure that your MATLAB/Simulink Workspace options


are properly set. These are adjusted in the Fortran section of the
Workspace dialog – see Chapter 2 for more details.

Note that you may find discontinuations when starting from a snapshot
file if you use complex models in MATLAB/Simulink. If this is the case,
it can be prevented adding extra code in the *.m or *.mdl file and the
component definition calling the interface.

PSCAD User’s Guide 475


Chapter 11: MATLAB/Simulink Interface

476 PSCAD User’s Guide


PSCAD

Chapter 12:

Migrating from Older Versions


During the development of PSCAD V4, compatibility with older versions
(especially with V3) was a primary concern. As a result, migrating
PSCAD V3 projects into V4 is quite simple and straightforward.
Although not much has changed with the PSCAD V2 migration
process, V2 users may now load transfer files (*.dfx) directly into V4.
This eliminates the need for extra steps in migrating user components
and libraries – these definitions can simply be included in the V2
transfer file.

This chapter discusses topics in migrating PSCAD related projects from


older versions. For more information on migrating user-defined code
and other EMTDC related issues, see the EMTDC User’s Guide.

CONVERTING PSCAD V2 PROJECTS


PSCAD V2 projects can be migrated directly into PSCAD V4 without too
much difficulty. This, of course, mainly depends on the complexity of
the V2 project, the components used and the condition of any user- See Chapter 3 for more
written code involved. Unlike V2, PSCAD V4 stores all information information on case and
library projects.
pertaining to a project in a single portable project file (either a case
project (*.psc) or a library project (*.psl) file).

Some V2 some files cannot be directly imported into PSCAD V4. The
following is a list of which file types can, and which file types cannot be
migrated:

Can be migrated:

• Draft circuit files (*.dft and *.dfx)


• Runtime batch files (*.rtb)
• Draft component definitions (for example in xdraft_lib)
If you have EMTDC source
• EMTDC Fortran source code code written in C, then you
must upgrade this code
• Line constants solved data (*.tlb or tline files) manually.

PSCAD User’s Guide 477


Chapter 12: Migrating from Older Versions

Cannot be migrated:

• Cable files (*.cbl)


• Multiplot or Uniplot batch files

This section describes the procedures involved when importing PSCAD


V2 circuits, components and associated files into PSCAD V4.

User-Written EMTDC Source Code


Fortran source code written specifically for use with EMTDC in PSCAD
V2 must be filtered before it can be used in PSCAD V4. For more
information on importing user-written Fortran source code, see the
EMTDC User’s Guide.

Conversion Issues
The following sections describe a general overview and background of
some important conversion issues. Please review these sections first
before attempting to upgrade to PSCAD V4.

V2 Control Type Components


All control type components (i.e., components whose code appears in
the EMTDC System Dynamics only) should be mainly upgradeable. One
important fact to consider however, is that using the EMTDC internal
variable for time step (i.e., DELT) in the Computations portion of a
component definition is no longer allowed in PSCAD V4.

V2 Electrical Interface Components


There have been many changes made to EMTDC since V2, mostly
associated with electrical signals and their interface to user-written
components. It is possible that these types of components may cause
some compatibility problems when upgrading to V4. For instance,
electrical branches in EMTDC were originally referenced using a branch
TO and FROM node convention. This tended to cause problems with
parallel branches (as they have identical connection nodes), and
resulted in numerous workarounds to avoid the problem. One example
For more information on was the output of the calculated current in faults, breakers, thyristors,
obsolete subroutines,
interface arrays and diodes, GTOs, arresters, etc. - all of these had a single time step delay.
upgrading code to V4 This was because all parallel switching branches were combined into a
standards, see Chapter 10 in
the EMTDC User’s Guide.
single branch for solution in the main program. One side effect was
that the current had to be output as an argument of the DSDYN
subroutine call, and could not be placed in DSOUT.

In PSCAD V4, the above problem is circumvented, as each branch is


given a unique branch number and the current in each branch is

478 PSCAD User’s Guide


PSCAD

referenced directly in DSOUT. This system of referencing electrical


branches directly by a branch number (instead of by node numbers)
results in some obsolete function calls. These include all switching
routines, as well as any electrical interface array names.

V2 Component Libraries
Since V2, PSCAD has allowed users to create their own components to
represent custom models. In V2, this was accomplished by editing a
text file, where graphical information, parameter form data, and Data/
Fortran output code were entered. Each component was contained
within its own file, which resided in either the user’s library (~/PSCAD/
xdraft_lib) or in a Group Library (only two libraries were allowed).

Those who received a project from other users always experienced


difficulties in maintaining these components and great confusion, as to
what the most recent version of the component was, generally
resulted. If two or more components by the same name were kept,
then the PSCAD V2 Draft program would search first in the User’s
xdraft_lib directory, then in the Group directory (if one has been
specified), and then finally in the Master library. This allowed users to
overwrite the functionality of Master Library components, often with
confusing or inconsistent results.

In PSCAD V4, the Design Editor is used to graphically manipulate


custom components. Component definitions are stored within a single
library project file (*.psl), where any number of library projects can be
loaded in the Workspace simultaneously. Users who wish to transfer
custom components to other users need only to supply the library
project containing the components.

When PSCAD V4 loads a project, it knows not only the name of the
component, but that it came from a library project. This allows users to
copy a component definition from any other library, customize it, and
then place it in their own library. Whenever either of these
components is used, PSCAD will keep track of which library each is
from. PSCAD V4 also allows components to be kept directly in case
projects (*.psc), so that a temporary component can be developed for a
specific case, without having to clog up a library with the test code.

Password protection is currently not available for libraries or cases, but


in future versions of PSCAD, read-only libraries will be possible to
prevent undesirable edits being performed on libraries and/or
components.

PSCAD User’s Guide 479


Chapter 12: Migrating from Older Versions

Component Definitions
If a required component definition cannot be found when a V2 draft
project is loaded into PSCAD V4 (i.e., the definition is not included in
any loaded V4 library project or the specific V2 draft project), the draft
project will still load successfully. However, any component instances
based on the missing definition will be displayed with a ‘placeholder’
component. To rectify this situation, ensure that a V4 library project
already containing the required component definition is loaded before
the draft project, or that draft project itself was saved in V2 as a
transfer file (*.dfx).

The PSCAD V4 Master library is automatically loaded when PSCAD V4


is started. It contains many new components, in addition to all PSCAD
V2 components from the following libraries:

• PSCAD V2 Master library


• PSCAD V2 PEMISC library
• PSCAD V2 Machines library

Note that it is important to always use unique names for user-defined


component definitions. This will avoid unwanted interactions between
user and Master Library component definitions.

Importing V2 Draft and Runtime Batch Files


Most PSCAD V2 draft projects can be directly imported into PSCAD V4.
Projects containing more complex circuits however, may require some
manual adjustments. This section describes procedures for importing
PSCAD V2 draft files (*.dft or .dfx) and runtime batch files (*.rtb) into
PSCAD V4.

Before attempting to import your PSCAD V2 projects, please ensure the


following:

• All obsolete PSCAD V2 components are replaced with the


latest versions from the most current V2 Master Library.
If a V2 draft project
• All PSCAD V2 files associated with the draft project itself
containing undefined (i.e., *.rtb, *.tlb, and tline_out) must be located in the
components is loaded into
PSCAD V4, all undefined same directory as the draft file. Note that runtime batch
components will be files must have an identical base name as the draft file
substituted with a
temporary ‘placeholder’
being imported.
component. • If the draft project contains custom written components
(i.e., from user or group libraries), then ensure that the

480 PSCAD User’s Guide


PSCAD

draft file has been saved as transfer (i.e., *.dfx file).


Otherwise, see the section entitled ‘Importing V2
Component Libraries’ in this chapter.

Please follow these steps to avoid problems:

1. To load a V2 draft file, start PSCAD V4 and select File | Load


Project… from the Main Menu bar. The Load Project dialog
window should appear.
2. Near the bottom of the Load Project dialog, change the Files
of Type drop list to ‘PSCAD V2 Case (*.dft, *.dfx)’ so as to
view PSCAD draft files only. If you do not have a direct Note your V2 files may still
be in UNIX format. In order
network connection from your PC to your UNIX system, then to successfully import the
you must first copy (or ftp) the files to your PC from UNIX. file to PSCAD V4, you must
ensure that all files are in
DOS format. This can be
accomplished by using the
‘unix2dos’ UNIX utility, or
FTP in ASCII mode.

3. Navigate to the directory containing your V2 project files,


select the V2 draft file to be loaded, and then press the Open
button.

PSCAD User’s Guide 481


Chapter 12: Migrating from Older Versions

4. Check for warning or error messages in the Output window.


See the section entitled ‘Common Warning Messages’ below
for details. Save the new PSCAD V4 case project (right-click
on the project name in the Workspace window and select
Save).

Common Warning and Error Messages


There are some common warnings and error messages that may appear
in the Output window following the migration of a V2 draft file. Some
of these are described below:

482 PSCAD User’s Guide


PSCAD

Warnings:

• Unresolved keyword ‘xxxxx’: This warning indicates


that data in a PSCAD V2 component was stored, but is
not required in the PSCAD V4 component. This often
occurs in components, which can be used in both EMTDC
and RTDS, where some of the data is not required for
EMTDC runs.
• Component aliased from ‘xxx’ to ‘yyy’: This warning
indicates that a component has been renamed in PSCAD
V4, but the data from the old V2 component has been
converted.

Errors:

• Component type ‘xx’ not found: This means that a


custom component was used in PSCAD V2 but was not
available in any of the library projects loaded in the
PSCAD V4 Workspace. If you have previously converted
your PSCAD V2 libraries into PSCAD V4 library projects,
then simply ensure that the libraries are loaded in PSCAD
V4 first before converting the PSCAD V2 draft project. If
you have not yet converted PSCAD V2 libraries into
PSCAD V4 library projects, then follow the procedure
outlined in the ‘Importing V2 Component Libraries’
section of this chapter. You can also go back to PSCAD
V2 and save your draft project as transfer (i.e., *.dfx file),
so as to incorporate any custom components into it before
importing to V4.

Importing V2 User Libraries


The PSCAD V2 Draft program used a library (*.lib) file as a palette
(appears on the right-hand side of the V2 Draft program canvas) for the
actual component library.

To transfer this palette into PSCAD V4:

1. Open PSCAD V2 on your UNIX terminal and run the Draft


program. Press the LIBRARY button in the main menu and
select LOAD | USER.

PSCAD User’s Guide 483


Chapter 12: Migrating from Older Versions

Make sure that any of the


components included in
your PSCAD User Library file
have a unique component
definition name. Otherwise
these components may be
overwritten by other
component definitions. 2. Select the desired user library file from the Load User Library
dialog and then press the PROCEED button.
3. Copy the desired component instances from the user library
palette over to the Draft canvas. From the FILE menu, select
SAVE AS… | TRANSFER to save the Draft project as a transfer
file (i.e., as a *.dfx file). This will ensure that the component
definitions are included within the V2 draft file.

4. Transfer this V2 project file to a location where it can be


accessed from your Windows PC. If you do not have a direct
network connection from your PC to your UNIX system, then
you must copy (or ftp) the files to your PC from UNIX.
5. Follow Steps 1 to 4 in the section entitled ‘Importing V2 Draft
and Runtime Batch Files’ of this chapter to load the V2 draft
project into PSCAD V4.
6. In the PSCAD V4 Workspace, right-click on the project
filename and select Save As… from the pop-up menu.

484 PSCAD User’s Guide


PSCAD

7. Rename the case project to a library project in the File Name


field of the Save Project As dialog window. Press the Save
button.

You now have converted your V2 user library to a PSCAD V4 library


project!

Importing Individual V2 Components


It is possible to import individual PSCAD V2 component definition files,
directly into a PSCAD V4 library project. Once this is accomplished, an
instance of the definition may be created and displayed within the
library.

PSCAD User’s Guide 485


Chapter 12: Migrating from Older Versions

Please follow these steps to avoid problems:

1. Create a new library project in PSCAD V4 (or open an existing


library). To create a new library, select File | New | Library. A
new library called ‘noname’ should appear in the Workspace
window.

2. Expand the new library project tree by clicking on the ‘+’


symbol beside its name. Right-click on the Definitions branch,
and select Import Definition….

3. In the Import Definition dialog window, change the Files of


Type drop list to ‘All Files’.

486 PSCAD User’s Guide


PSCAD

4. Navigate to the directory where you have stored your PSCAD


V2 component definition files (‘~/PSCAD/xdraft_lib’ for
example). If you do not have a direct network connection
from your PC to your UNIX system, then you must first copy
(or ftp) the files to your PC from UNIX.

Do not select any PSCAD V2


macro files (*.g), library files
(*.lib), or any file beginning
with a ‘period.’

5. Select one or more files, and then click on the Open button.
The new definition(s) should appear within the Definitions
branch in the Workspace window.
6. Check for warning or error messages in the Output window.
If you receive an error message similar to “Macro file ‘xxx.g’
not found,” you need to move all associated V2 macro files
(*.g) from the ‘~/PSCAD/script’ directory on your UNIX system
to the same directory from where you are importing your V2
definition files. Unload the new library and start over from
Step #1.
7. Expand the Definitions branch in the Workspace window by
clicking on the ‘+’ symbol beside its name. Select a definition,
right-click and select Create Instance from the pop-up menu.

PSCAD User’s Guide 487


Chapter 12: Migrating from Older Versions

8. Open the library project main page in Circuit view. Right-click


on the page and select Paste from the pop-up menu. A new
graphical instance of the component should appear.
9. Right click on the ‘noname’ library in the Workspace window
and select Save As… to rename and save the library project.

Manual Revisions to the New PSCAD V4 Project


Open the new PSCAD V4 project in Circuit view (left double-click on
the project name in the Workspace window) and you should see a
parent (top-level) module that did not exist in your PSCAD V2 project.
This module will contain other modules representing each page that
existed in your original V2 draft project. A separate module will also be
included, which contains all information from the associated runtime
batch (*.rtb) file.

488 PSCAD User’s Guide


PSCAD

Depending on whether or not there were any associated import or


export connections in the original V2 draft project, each module may
now possess external input and output connections on their respective
graphics. Each of these connections corresponds to an import or
export connection in PSCAD V2. PSCAD V4 uses this input/output
information to order modules in such a way as to minimize any PSCAD V2 always called
pages in the order they were
feedback paths in signals. drawn in Draft, and inserted
a single time step delay
Too Many External Connections where necessary.

If the parent module is visually unreadable (due to too many external


connection graphics on the module), then this is probably because the
original V2 Draft page had an excessive number of import or exports
(i.e., > 100). The auto-routing of these connections in PSCAD V4
becomes too complex in such situations, but the connections are still
functionally correct. To simplify matters, you can go back to the PSCAD
V2 Draft circuit, and manually collapse related import and export
signals into arrays. Then go through the import procedure again. This
will reduce the number of connections in the parent module and help
to keep things organized.

Import/Export Tags with Array Variables


Each module may also require editing if you used any import or export
tags with array variables in the original PSCAD V2 draft project. The
old import and export components did not contain any information
regarding the dimension or type of variable (all import/exports were
performed with REAL numbers).

PSCAD V4 now allows import/exports to be performed with the original


variable type, thus avoiding needless (and potentially incorrect) data
conversions. The user must manually enter the import/export variable
type and dimension information into the modules (there will be at least
two modules that must be edited - one for the import and one for the
export).

If you already know which signals are affected (i.e., imported or


exported signals using arrays, or of a type other than REAL), then you
must edit the definition of the module in PSCAD V4 to identify the
signal types.

1. Open the definition of the module: Right-click over the


module and select Edit Definition….
2. In Graphic view (appears by default), double-click on the
Connection, having the incorrect type or dimension, to bring
up the Format Connection dialog.

PSCAD User’s Guide 489


Chapter 12: Migrating from Older Versions

3. Modify the Data Type and Dimension. Press the OK button


to save changes and then go back to Circuit view. Note that
the Connection Type will be ‘Input Data’ if the signal in the
original PSCAD V2 project was being imported, and will be
‘Output Data’ if the original signal was being exported.
4. Repeat steps 1- 3 for any other existing connections for this
signal.

To find out if there are any more connection errors for a particular
module, compile the module manually (i.e., right-click on the module
and select Compile Module). This will force PSCAD to generate the
data and Fortran files for this module alone, and any error or warning
messages should appear in the Output window.

Examples of such errors are:

• Signal ‘ABC’ dimension mismatch at signal ‘XYZ’: This


indicates a dimension mismatch between two connected
signals.
• Signal ‘DEF’ type mismatch at signal ‘UVW’: This indicates
a data type mismatch between two connected signals.

Runtime Module
The Runtime module represents the contents of the V2 runtime batch
file. This module may require some ‘house cleaning’ and re-
organization (i.e., re-size graph frames, etc.). Control panels are used

490 PSCAD User’s Guide


PSCAD

to contain sliders, dials, switches and meters. Grouped components in


the PSCAD V2 Runtime program are now added merely as additional
modules.

Migrating V2 Cable Systems


PSCAD V2 cable migration into V4 is not supported. Any cable systems
in your V2 project (i.e., defined in *.clb files) must be reconstructed
from scratch once the project is migrated into PSCAD V4.

Migrating V2 Transmission Line Systems


There are fundamental differences in how transmission line systems are
represented between PSCAD versions 2 and 4. In V4, transmission line
systems are interfaced to the rest of the electric circuit through special
See Chapter 7 for more
interface components. The properties of the actual transmission details on transmission line
corridor are defined within a special properties component (i.e., tower and cable systems in PSCAD
V4.
geometry, conductor properties, etc.).

When a PSCAD V2 draft project containing transmission line systems is


migrated into V4, the above described transmission system is not
automatically constructed. Instead, the transmission line system is
inserted into the V4 project using special V2 alias components called
‘V2 Style T-Line Connection.’ The transmission system properties
remain based on the transmission line batch (*.tlb) file created by V2. V2 Style T-Line
Connection component
Although this substitution will provide correct results when the
simulation is run, it may prove cumbersome if the transmission system
properties need to be changed (must edit the *.tlb file), or if the project
file is transferred to other users (must move the *.tlb file with it). It is
therefore recommended that V2 style transmission systems be
eventually converted to V4 format.

Although this process must be performed manually, it is


straightforward. Simply replace the V2 Style T-Line Connection
components with an equivalent V4 transmission line interface
component. The transmission line properties can then be read directly
from the V2 transmission line batch file, and inserted into a properly
constructed transmission line corridor. See Chapter 7 for more details
on constructing a V4 transmission line.

CONVERTING PSCAD V3 PROJECTS


Loading PSCAD V3 projects into PSCAD V4 is normally straightforward,
and for the most part will be accomplished without incident. Simply
load the V3 case or library project exactly as you would a V4 project.

PSCAD User’s Guide 491


Chapter 12: Migrating from Older Versions

Conversion Issues
As is normal when software is updated, there are changes made to
existing features, which may or may not affect your case. There are a
few important issues to be aware of before starting to use your V3
projects in PSCAD V4. These are described in the following sections.
System Dynamics Component Ordering
Components used in the EMTDC System Dynamics (i.e. CSMF
components, modules, etc.) are automatically ordered in V4 with a
sophisticated new sequencing algorithm. In PSCAD V3, these types of
components were simply ordered based on where they were located
on the page.

This important feature should be considered when initially verifying


your V3 project results in PSCAD V4. The new sequencing algorithm
may adjust the order in which components appear in the Fortran code.
Depending on where the components within the EMTDC System
See Component Ordering in
Chapter 10 for more details. Dynamics (i.e. DSDYN or DSOUT), a single time step delay may be
added or removed in comparison with V3 results.

If this does indeed occur in your case, PSCAD V4 allows you to


manually adjust the component sequence.

Additional Libraries and Object Files


In PSCAD V3, additional library and object file paths entered in the
Additonal .obj and .lib Files’ field in the Project Settings dialog, were
relative to the respective temporary (*.emt) directory for the project. In
PSCAD V4, these paths are now relative to the User Library Path (set
in the Project Settings dialog window – see Chapter 4).

The paths must be changed accordingly in your V4 projects. Open the


See Chapter 6 for more
respective Project Settings dialog for the project (right-click on the
details on the Project project filename in the Workspace and select Project Settings…) and
Settings dialog. select the Fortran tab. Modify the paths in the Additional Fortran
Library (*.lib) and Object (*.obj) input field. For example, a V3
reference shown below:

would appear as follows in PSCAD V4:

492 PSCAD User’s Guide


PSCAD

Flyby Windows
A new feature was added to PSCAD V4, which optimizes variable
storage between time steps during a simulation. Unfortunately, when
this optimization algorithm is enabled, it also disables Flyby window
functionality. To enable Flyby windows while debugging your project,
the optimize storage feature must be turned off.
Right-click anywhere on the project page in Circuit view and select
Module Settings…. Deselect the option called Optimize Storage of
Feed-Forward Signals.

Node Loop Component Output Format


The output format of the Node Loop component was altered to reflect
changes made to the subsystem splitting algorithm in PSCAD V4. This
becomes important if your PSCAD V3 user components utilize the
Node Loop for input. If this is the case, then you must alter your
components before running any V4 projects.
Since the subsystem splitting is now accomplished in PSCAD V4
regardless of the presence of distributed transmission lines, the local
subsystem number (SS) was added to the Node Loop output as
follows:
V3 format

$Loop:NA, $Loop:NB, $Loop:NC

V4 format:

$Loop:SS, $Loop:NA, $Loop:NB, $Loop:NC

PSCAD User’s Guide 493


Chapter 12: Migrating from Older Versions

MATLAB Libraries and Interface


Project and Workspace settings should be adjusted slightly when
migrated V3 projects that used the MATLAB interface. Please perform
the following adjustments:

1. Open the respective Project Settings dialog for the project


(right-click on the project filename in the Workspace and
See Chapter 2 for more select Project Settings…) and select the Fortran tab. In the
details on the Workspace Link Options area, delete all of the MATLAB installation library
Settings dialog.
paths in the Additional Fortran Library (*.lib) and Object
(*.obj) input field. Ensure that the Use MATLAB Interface
check box is selected.
2. Open the Workspace Settings dialog by selecting Edit |
Workspace Settings… and click the Directories tab. In the
MATLAB Interface area, select the MATLAB version and
location of the MATLAB installation libraries.

Note also that MATLAB version 6 is now supported in PSCAD V4.

494 PSCAD User’s Guide


PSCAD

Appendix A:

References
1. Hydraulic Turbine and Turbine Control Models for System
Dynamic Studies, Working Group on Prime Mover and Energy
Supply Models for System Dynamic Performance Studies,
Transactions on Power Systems, Vol. 7, No. 1, February 1992.
2. Dynamic Models for Fossil Fuelled Steam Units on Power
System Studies, Working Group on Prime Mover and Energy
Supply Models for System Dynamic Performance Studies,
Transactions on Power Systems, Vol. 6, No. 2, May 1991.
3. P. Kundur, Power System Stability and Control, McGraw Hill
Inc., 1994.
4. IEEE Recommended Practice for Excitation System Models for
Power System Stability Studies, IEEE Std 421.5-1992.
5. Computer Models for Representation of Digital-Based
Excitation Systems, IEEE Transactions, 1996.
6. Franz Karlecik-Maier, A New Closed Loop Control Method for
HVDC Transmission, IEEE Transactions on Power Delivery, Vol.
11, No. 4, October 1996, pp 1955-1960.
7. W. Tinney, N. Sato, Techniques for Exploiting the Sparsity of
the Network Admittance Matrix, IEEE PAS Vol. 82, Dec. 1963,
pp 944-950.
8. W. Tinney, J. Walker, Direct Solutions of Sparse Network
Equations by Optimally Ordered Triangular Factorization, Proc.
IEEE Vol-55, pp 1801-1809, Nov 1967.
9. [Link], [Link], [Link], The Implementation and
Effectiveness of Linear Interpolation Within Digital Simulation,
Proceedings, International Conference on Power Systems
Transients (IPST ‘95), Lisbon, September 3-7, 1995, pp. 499-
504.
10. [Link], [Link], [Link], [Link], Modeling of
Power Electronic Apparatus: Additional Interpolation Issues,
Proceedings, International Conference on Power Systems
Transients (IPST ‘97), Seattle, June 22-26, 1997, pp. 23-28.

PSCAD User’s Guide 495


Appendix A: References

496 PSCAD User’s Guide


PSCAD

Index
Symbols \ 437
|| 437
!= 437 3-phase view 183
#CASE 433, 434
#ELSE 425, 429, 431, 433, 437, A
471
#ELSEIF 429, 433, 437 Above/below 234
#ENDIF 425, 429, 431, 433, 437, ABS (x) 436
438, 471 ACOS (x) 436
#FUNCTION 401, 425 Active curve 255
#IF 425, 429, 431, 433, 437, Active project 150
438, 471 Additional fortran library (*.lib)
#LOCAL 424, 425, 470, 471 494
#OUTPUT 398, 399, 413, 427 Additional fortran object (*.obj)
#STORAGE 410, 423, 468, 470, 494
471 Additional library files 456
#SUBROUTINE 408, 426 Additional object files 456
#TRANSFORMERS 390, 428 Additional source files 399, 453
$ 345 All Extents and Limits 263
$ substitution prefix operator 409 Allow use of integrated debugger
% 345, 437 453
&& 437 Allowing variables 363, 364
* 437 Aperture Settings 248
** 437 Arc 333, 341
*.m file 465, 473, 475 Arc line 340, 341
*.m files 464, 469 Arc object 339
*.mdl' file 466, 467, 475 Area 234
*.tlb or tline files 477 Arithmetic operators 437
+ 437 ASIN (x) 436
- 437 ATAN (x) 436
.emt 138 Axis 221
/ 437 B
< 437
<= 437 Bergeron 305
== 437 Bergeron model 322, 323
> 437 Bookmarks 258
>= 437 Border colour 337, 342

PSCAD User’s Guide 497


Index

Border style 338 Compiler 56


Border weight 337 Complex 423
Box zoom 260 Component 85
Branch number 409 Component definitions 86, 332
Branch source 410 Component instance 86, 125
Branch statements 380 Component ordering 448, 492
Branch-based electric interface Component Wizard 196, 197,
407 403
Bundled conductors 310 Component workshop 331
By node type 337, 338, 341 Conditional statement 338, 341,
345, 354, 357, 360, 363,
C 367, 372, 373, 374, 405,
C language source code 399 415, 432
Cable configuration component Conductance matrix 393
311, 313 Connection 339, 341
Cable cross-section components Connection nodes 333
321 Connections 432
Cable files (*.lbl) 478 Constants' file 329
Cable length 313 Constants file (*.tlo) 326
Cable properties 313 Control Interface 266, 269
Cable system corridor 310 Control interface order 268
Cable systems 491 Control palette 121
CALL statement 299 Control Settings 207
Calling a subroutine or function Copy data 224
385 Copy group as meta-file 169
Case project (*.psc) 477 COS (x) 435
Case projects 87 COSH (x) 436
Categories 352, 354 Create library files 456
Category 353, 355, 372, 375 Create object files 456
CBR 398, 413 Cross hair 227
CDCTR(M,N) 428 Current run number 286
CEIL (x) 436 Curve Legend. 230
Chatter 290 Curve order 230
Choice box 352, 367, 371, 372, Curve-fitting algorithm 329
373, 405, 431 Custom models 300, 331
Choice boxes 365 D
Circuit window 121
Colour 337, 340 Data file 393, 409, 415
Comma separated variables 243 Data Files 291, 447
Comments 388 Data type 362
Comparator 286 Data window 122
Compile 126 DATADSD 393
Compile module 442 DATADSO 393

498 PSCAD User’s Guide


PSCAD

Debugger 452, 453 Enter license key 54


Debugging 283, 291, 298, 441, Entry of ground data 316
442, 454, 455 Environment variables 55, 56
DELT 478 Error 119, 442
Design editor 120, 331 Error messages 90, 441, 444
Designing a new component 331 EXP (x) 436
Dial component 270 Explorer 90
Dimension 372, 443 Expression Braces 421, 432
Dimension Limits 14 Expression evaluation 415, 435
Dimension mismatch 490 Extern "C" 402
Direct connection 308, 309, 310 External source file 384, 399
Docked windows 137 Externally defined signal 363
Draft circuit files (*.dft and *.dfx)
477 F
Draft component definitions 477 File reference component 399
Drop lists 180 Fill 338
Drop style 365 Find feature 445
DSDYN 386, 393, 399, 415 FLOOR (x) 436
DSOUT 386, 399, 415 Flybys 205
Duration of Run 283, 287 Fortran code 383, 385, 415
Dynamic aperture 220, 221 Fortran Comment 443
Dynamic scroll 158 Fortran compiler 20, 296, 299,
E 301
Fortran debugger 298
EBR 382, 383 Fortran file 415
Editing a cable system configura- Fortran files 447, 462
tion 318 Fortran object 300
Editing a transmission line configu- Fortran window 122
ration 314 Frequency Dependent (Mode)
Editing tower properties 318 305
EGCS/GNU fortran 77 compiler Frequency Dependent (Phase)
56 305
Electric Network 295 Frequency-dependent (mode)
Electrical palette 121 model 322, 324
Ellipse 333, 373 Frequency-dependent (phase)
EMTDC Electric Network Solution model 316, 322, 324
288 Functions 384
EMTDC storage array 398
EMTDC STORx internal variables G
423 Global constant 211
EMTDC system dynamics 386, Glyphs 226
415, 478 Graph frame properties 219
EMTDC Users' Group 16

PSCAD User’s Guide 499


Index

Graph order 223 Internal output variable 398, 412


Graph Properties 227 interpolation 289
Graphic filter 376 Invert colours 226
Graphic is visible when 373, 374 IUNIT 393
Graphic object properties 336
Graphic objects 333, 405 K
Graphic window 121 Keyboard Shortcuts 7
Graphical object 372
Grid 221 L
Grip 335, 342
Ground return path 320 Layers 374, 375, 376
Ground wires 310 Length of line 313
Group library 479 Length of time 309
Library 279, 299, 441
H Library file 456, 460
Library file (*.lib) 456, 483
Hard limiter component 425 Library project (*.psl) 477
Harmonic Impedance 5 Library projects 87
Hatch 338 Library. 286
Help documents 387 Line 233, 333
Help toolbar 140 Line colour 337
Horizontal zoom 261 Line constants' files 325, 327
HTML document 387 Line constants' imput file 327
I Line constants input (*.tli) file
326
Ideally transposed conductors Line continuation operator 432
324 Line length 309, 313
IMAG (x) 436 Line model general data 316
Import definition 486 Line style 338, 341
Incremental snapshot 285 Line weight 337, 339, 340
infinite bus 290 Linking a text label 345
initial start 287 Locking/unlocking 257
Initial Start Time Always Zero LOG (x) 436
287 Log file 329, 448
Input Data 216 Log file (*.log) 326
Input field 352, 360, 362, 363, LOG10 (x) 436
365, 371, 372 Logical 423, 424, 425, 427
Input file 327 Logical expression 431
INT (x) 436 Logical operators 372, 435, 437
INTEGER 362, 423, 424, 425,
427, 443, 465 M
Integrated debugger 441, 452 Machine name 54
Interface component 312 Make 55, 126

500 PSCAD User’s Guide


PSCAD

Make (*.mak) file 456 Number of coupled cables 313


Make files 447, 460
Manual entry of Y, Z component O
323 Object files 441, 456, 460, 492
Map File 291, 447 Omarker 221
Marker legends 254 On-line help 85, 138
Markers 221, 251 Operating system 56
Master Library 8 Optimize node ordering algorithm
Mathematical functions 435 393, 394
MATLAB 299, 302, 463, 464, Orientation 168
465, 466, 467, 468, 469, Output Data 216
470, 473, 474, 475 Output file (*.out) 326
MATLAB interface (*.obj) 494 Output files 329
Matlab Libraries 302 Output window 118
MATLAB/Simulink 463, 470, 475 Overlay Graphs 225
matrix sparsity 295
Max 221 P
Message tree 118
Meter order 272 Page setup dialog 168
Meters 271 Page size 351
Min 221 Paper size 168
Minor grids 221 Parameters window 121
MOD (x) 436 Paste graph 224
Module settings 161 Pause 126
Modules 86 PEMISC 480
Moving gears 127 PI section 305, 323, 428
Multiple run output file 286 Point 233
Multiple runs 286 Poly Graphs 227
Multiplot files 478 Pre-compilation 380
Mutual impedance matrices 389, Pre-processing 407
391 Pre-processor 415
Mutual impedance matrix 395 Pre-processor substitution 415
Prefix operator 398
N Project settings 155, 399
Project Tree 4
Naming convention 213 PSCAD environment 85
Nmake 55 PSCAD Limits 14
Node number 120, 446 PSCAD script 385, 415, 432
Nodes window 122 PSCAD Users’ Group 16
NORM (x) 436 PSCAD V2 477, 478, 479, 480,
Note text xxvii 481, 483, 488, 489, 490, 491
Number of cables 313 PSCAD V2 draft files (*.dft or .dfx)
Number of conductors 309, 310, 480
313

PSCAD User’s Guide 501


Index

PSCAD V2 runtime batch files simulation speed 283, 287, 292


(*.rtb) 480 Simulink 463, 465, 466, 467,
PSCAD V3 477 470, 474
Simulink interface 466
R SIN (x) 435
Radio buttons 180 Single-line 183
Radio style 365 SINH (x) 436
READ statement 392 Slider component 267, 270
REAL 362, 423, 424, 425, 427, Snap 220, 221
443, 465 Snapshot 126, 165
REAL (x) 436 Source code 441
Rectangle 333, 373 Source files 296
References xxvii Specifications 19
Refresh 161 SQRT (x) 436
Reloading graphics 351 Status 90
Reloading parameters 371 Status bar 127
Revision Tracking 281 Stop 126
Right-click 124 STORx variables 423
ROUND (x) 436 Student edition 22
Run 126 Subroutines 384
run-ahead time 289 Subsystem 120
Runtime 156, 165, 282, 490 Subsystem number 409, 446
Runtime batch files 484 subsystem splitting 295
Runtime batch files (*.rtb) 477, subsystems 295
488 SUL 21
Runtime section 120 Sweep distance 341
Switching 295
S Switching branches 380
Switching devices 289
Sanity checks 411
Script bar 133 T
Script directives 415
Script window 122 T-line/cable configuration editor
Search 120, 141, 445 314
Search feature 370 tab bar 160
Segment 379 Tabs 160
Segments 377, 378, 379 TAN (x) 436
Show bands 228 TCP/IP 55
Show Connection Grid: 163 Template 207
Show cross hair 264 Temporary directory 138, 454
Show Sequence Numbers 163 Ternary operator 438
Show Signal Locations 163 Text box 352
Signals window 122 Text boxes xxvii
Text colouring 397

502 PSCAD User’s Guide


PSCAD

Text field 358, 359, 371 V


Text label 342, 343, 344, 345
Thick/thin lines 228 V2 style t-line connection 491
Threshold 234 Variable Substitution Prefix
Ticks 226 Operator 416
Tinney algorithm 295 VDC 398, 413
Title 220, 221 Version 280, 281, 302
TLine interface 307 Vertical zoom 260
Toolbars 125 Virus scanner 55
Total number of multiple runs Visible data 243
286, 287 Voltage divider 92
Trace Style 247
Transfer file 477
W
Transfer file (*.dfx) 480, 483 Warning 90, 119, 441, 442
Transformer matrix 390 Wire Mode 178
Transmission corridor 306
Transmission line 306, 307, 316 X
Transmission line batch file (*.tlb)
491 X-intercept 227
Transmission line configuration xdraft_lib 487
component 306, 307, 309 Xmarker 221
Transmission line interface Y
component 307, 318
Transmission line properties 309 Y-intercept 227
Transmission line tower 317 Ymax 227
Transmission tower 316 Ymin 227
Trapezoidal integration 290
Trial license 22 Z
Tutorial 91 Zero resistances 290
Tutorial projects 143 Zoom 8
U Zoom actual 8
Zoom Extents 262
Unbalanced line 324 Zoom in 259
Uncalled Routines 299 Zoom Limits 262
Underground cable systems 310 Zoom out 259
Uninitialized Variables 299 Zooming 160, 350
Uniplot files 478
Units 363
UNIX 487
UNIX system 484
Unload project 153
User Library Path 301
User written subroutines 300

PSCAD User’s Guide 503


Index

504 PSCAD User’s Guide

You might also like