You are on page 1of 7

SIEMENS Power Transmission and Distribution

Power Technology Issue 102

Comparison of Conventional and “Elementary Block” Method of


Handling Transfer Function Blocks in PSS®E Dynamic Models

Jay Senthil Leonardo G. Lima Sallehhudin Yusof


Senior Staff Software Engineer Senior Staff Consultant President
Siemens PTI Siemens PTI Advanced Power Solutions
jayapalan.senthil@siemens.com leonardo.lima@siemens.com salleh@aps-my.com

Abstract
At PSS®E-31, a new feature called “Elementary Blocks” was introduced for handling of various transfer
functions in PSS®E dynamic models. This article shows the comparison of the conventional and the
elementary block method of creating PSS®E dynamic models.

General
Transfer functions are commonly used in dynamic models and are usually presented in the block
diagrams of the various PSS®E dynamic simulation models. In general, these block diagrams describe
complex models in terms of simpler (first or second order) transfer functions. The following transfer
functions are commonly encountered:

BLOCK TRANSFER FUNCTION PSS®E ‘ELEMENTARY


BLOCK’ FUNCTION NAMES

Integrator
U (s ) 1 Y (s ) INT_MODE1
INT_MODE2
sTI INT_MODE3

Integrator with non-windup limit VRmax NWINT_MODE1


NWINT_MODE2

U (s ) 1 Y (s ) NWINT_MODE3

sTI

VRmin

First order (lag) filter U (s ) K Y (s ) LAG_MODE1


LAG_MODE2
1 + sT LAG_MODE3
Power Technology July 2008

First order (lag) filter with non- VRmax NWLAG_MODE1


windup limit NWLAG_MODE2

U (s ) Y (s ) NWLAG_MODE3
K
1 + sT
VRmin

Washout U (s ) sK Y (s ) WSHOUT_MODE1
WSHOUT_MODE2
1 + sT WSHOUT_MODE3

Lead-lag LDLG_MODE1
1 + sT1 LDLG_MODE2
K
1 + sT2 LDLG_MODE3

Lead-lag with non-windup limit Vmax NWLDLG_MODE1


NWLDLG_MODE2
NWLDLG_MODE3
1 + sT1
K
1 + sT2

Vmin

Proportional-integral (PI)
U (s ) Y (s ) PI_MODE1
controller K PI_MODE2
KP + I
s PI_MODE3

Proportional-integral (PI) VRmax NWPI_MODE1


controller with non-windup limit NWPI_MODE2

U (s ) Y (s ) NWPI_MODE3
K
KP + I
s

VRmin

Proportional-integral-derivative
U (s ) Y (s ) PID_MODE1
(PID) controller K sK D PID_MODE2
KP + I +
s 1 + sTD PID_MODE3

Proportional-integral-derivative VRmax NWPID_MODE1


(PID) controller with non- NWPID_MODE2
Y (s )
windup limit NWPID_MODE3
U (s ) K sK D
KP + I +
s 1 + sTD

VRmin

Page 2
Power Technology July 2008

Second order transfer function U (s ) As 2 + Bs + C Y (s ) ORD2_MODE1


ORD2_MODE2
Ds 2 + Es + F ORD2_MODE3

One common approach in handling the transfer function blocks is to write the state equations. In PSS®E
implementation, the dynamic models calculate the derivative of the states (called DSTATE), which are
then used to calculate the state variables (called STATE in PSS®E) using the Modified Euler integration
method.
The computation of DSTATEs involves writing the appropriate equations. Since there could be several
ways of formulating the STATE equations, the expressions for initializing the STATE variables and the
equations involved in obtaining the DSTATE could also vary. In addition, implementation of non-windup
limits could also prove to be tricky.
In order to provide for an easy and a consistent method of handling of transfer function STATE and
DSTATE equations along with the associated non-windup limits, the concept of ‘Elementary Blocks’ was
introduced in PSS®E-31. Simply stated, the elementary blocks are simply a library of functions (provided
with PSS®E) that can be invoked in dynamic models to initialize the model STATE, for the calculation of
DSTATE, to impose non-windup limits (if any), and to calculate the transfer block output.
The description given below shows an AVR model implementation as it is done conventionally compared
with the ‘Elementary Block’ method of achieving the same end. Since the ‘Elementary Block’ method
applies only to the PSS®E simulation MODEs (i.e., MODE 1, 2 & 3), the relevant code for these three
MODEs only are presented below.

Page 3
Power Technology July 2008

Comparison of Conventional and Elementary blocks


The AVR model used for illustrating the use of ‘Elementary Block’ is shown in Figure 1.

VR
VMAX
+
EC 1 – KA E FD
1 + sTR ES VE 1 + sTA
+
VMIN
VS
Figure 1 - Simplified AVR (DEMOEX)

The various steps involved in writing a PSS®E model DEMOEX are as follows:
1. Identify the CONs,

TR = CON(J)
KA = CON(J+1)
TA = CON(J+2)
VRMAX = CON(J+3)
VRMIN = CON(J+4)

2. Identify the states,

ES = STATE(K)
EFD = STATE(K+1)

3. At initialization (MODE = 1), we need to calculate input of each block from the known
outputs and inputs. In case of DEMOEX, the known output is EFD and the known input is EC
(in PSS®E this is ECOMP),

Conventionally we would write,


EFD/VE = KA, and
VE = EFD/KA
Since at the start
ES = EC
VR = VE + ES -VS

STATE(K+1) = EFD
STATE(K) = EC
VR = STATE(K+1)/KA + STATE(K)

Using elementary block,


VE = NWLAG_MODE1( KA, TA, VRMAX, VRMIN, EFD, K+1, IERR )
ES = EC
VINP = LAG_MODE1( 1.0, TR, ES, K, IERR )
VR = VE + ES -VS

In the above, IERR is the error code (for various values of IERR, see PSS®E -31 Program
Application Guide, volume II, chapter on “Elementary Blocks for Handling Transfer Functions in
PSS Dynamic Models”).

Page 4
Power Technology July 2008

4. For calculating the derivatives (in MODE=2), one needs to establish the first differential
equation for each state,

Using conventional method (where ‘s’ is the Laplace operator),


s ES = (EC – ES)/TR , or
DSTATE(K) = (EC – STATE(K))/CON(J)
VE = VR + VS - ES , or
VE = VR + VS – STATE(K)

s EFD = (KA x VE – EFD)/ TA, or


DSTATE(K+1) = (KA*VE – STATE(K+1))/CON(J+2)

We need to apply non-windup limit


IF (STATE(K+1) .GE. VRMAX .AND. DSTATE(K+1) .GT. 0.0) THEN
DSTATE(K+1) = 0.0
ELSEIF (STATE(K+1) .LE. VRMIN .AND. DSTATE(K+1) .LT. 0.0) THEN
DSTATE(K+1) = 0.0
ENDIF

Using the elementary blocks, in MODE=2, using the appropriate function, we will provide input to
get the block output as follows:

ES = LAG_MODE2(1.0, TR, EC, K)


VE = VR + VS - ES
VOUT = NWLAG_MODE2(KA, TA, VRMAX, VRMIN, VE, K+1)
5. In MODE=3, we will calculate the outputs or states,

Based on conventional method, we would write,


EFD = STATE(K+1)

Using the elementary block, we will need to write,


ES = LAG_MODE3(1.0,TR,EC,K)
VE = VR + VS - ES
VOUT = NWLAG_MODE3(KA, TA, VRMAX, VRMIN, VE, K+1)
EFD=VOUT

Comparison Table

The comparison table below illustrates the differences between the conventional method versus the
’Elementary Blocks’ approach

Page 5
Conventional Using Elementary Blocks

Page 6
IF (MODE.EQ. 1) THEN IF (MODE.EQ. 1) THEN
STATE(K+1) = EFD(I) VE = NWLAG_MODE1(KA,TA,VRMAX,VRMIN,EFD(I),K+1,IERR)
STATE(K) = ECOMP(I) ES = ECOMP(I)
VR = STATE(K+1)/KA + STATE(K) VOUT = LAG_MODE1(1.0,TR,ES,K,IERR)
Power Technology

VR = VE + ES –VS

RETURN RETURN
ENDIF ENDIF

IF (MODE .EQ. 2) THEN


DSTATE(K) = (ECOMP(I) – STATE(K))/CON(J) IF (MODE.EQ.2) THEN
VE = VR + VS – STATE(K) ES = LAG_MODE2(1.0,TR,ECOMP(I),K)
DSTATE(K+1) = (KA*VE – STATE(K+1))/CON(J+2) VE = VR + VS - ES
IF(STATE(K+1).GE.VRMAX.AND.DSTATE(K+1).GT.0.0) THEN VOUT = NWLAG_MODE2(KA,TA,VRMAX,VRMIN,VE,K+1)
DSTATE(K+1) = 0.0
ELSEIF(STATE(K+1).LE.VRMIN.AND.DSTATE(K+1).LT.0.0) THEN
DSTATE(K+1) = 0.0
ENDIF

RETURN
ENDIF RETURN
ENDIF

IF (MODE.EQ. 3) THEN IF (MODE.EQ.3) THEN


EFD(I) = STATE(K+1) ES = LAG_MODE3(1.0,TR,ECOMP(I),K)
VE = VR + VS - ES
EFD(I) = NWLAG_MODE3(KA,TA,VRMAX,VRMIN,VE,K+1)
RETURN RETURN
ENDIF ENDIF
July 2008
Power Technology July 2008

Conclusion
Siemens PTI has implemented functions to handle the PSS®E calculations associated with some
elementary transfer functions often used as building blocks of complex dynamic models in PSS®E. These
functions provide a simplification in the process of writing new models for PSS®E and also ensure a
consistent definition of these transfer functions and, more important, the application of non-windup limits.
Several new models in PSS®E have already been implemented using these elementary block functions,
including the new models associated with the IEEE Std. 421.5 (2005) – IEEE Recommended Practice for
Excitation System Models for Power System Stability Studies.
Siemens PTI considers that these functions are very useful and has made them accessible (via the
INCLUDE of COMON4.INS) for users writing new PSS®E dynamic models. Please refer to the PSS®E -31
Program Application Guide – Vol. II – Chapter 22 for detailed documentation about these functions.
The use of the elementary blocks would greatly simplify the process of writing PSS®E dynamic models,
and in addition, the application of non-windup limits would be consistent with the IEEE recommendations.

Page 7

You might also like