Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
u y +
e
G
1
G
s
Figure 8.3 First-order lag
written in FORTRAN, C, C++, MATLAB or BASIC, and link this with EMTDC.
Interpolation of controls is also an important issue for accurate results [6].
8.3.1 Example
The rst-order lag control system, depicted in Figure 8.3, is used to demonstrate the
use of the z-domain for the prediction of instabilities.
The corresponding transfer function is:
y
u
=
1
1 +fg
=
G
1 +s
(8.1)
where
f = feedback path = 1/G
g = forward path = G/(s)
= time lag.
The equations for the two blocks are:
e = u
1
G
y (8.2)
y =
Ge
s
(8.3)
Substitution of the trapezoidal rule to form difference equations gives:
e
k
= u
k
1
G
y
k
(8.4)
y
k
=
t (e
k
+e
k1
)G
2
(8.5)
The difference in data paths becomes apparent. If solved as two separate difference
equations, then e
k
must be calculated from y at the previous time step as y
k
is not
available and this introduces one time-step delay in the y data path. Swapping the
order of equations will result in the same problemfor the e data path. Substituting one
equation into the other and rearranging, results in a difference equation with no delay
Control and protection 199
in data path. This is equivalent to performing integrator substitution on the transfer
function for the complete controller
Time-step delay in data path
If there is a time-step delay in the feedback path due to the way the difference equation
for each block is simulated, then
e
k
=
_
u
k
1
G
y
k1
_
y =
G
s
e
(8.6)
Applying trapezoidal integration gives:
y
k
= y
k1
+
t G
2
(e
k
+e
k1
)
= y
k1
+
t G
2
_
u
k
1
G
y
k1
+u
k1
1
G
y
k2
_
=
_
y
k1
t
2
y
k1
t
2
y
k2
_
+
t G
2
(u
k
+u
k1
) (8.7)
Transforming equation 8.7 into the z-plane yields:
Y
_
1 z
1
_
1
t
2
_
+z
2
t
2
_
=
t G
2
(1 +z
1
)U (8.8)
Rearranging gives:
Y
U
=
(t G/(2))(1 +z
1
)
_
1 z
1
(1 t /(2)) +z
2
t /(2)
_
=
(t G/2)z(z +1)
_
z
2
z
1
(1 t /(2)) +t /(2)
_ (8.9)
The roots are given by:
z
1
, z
2
=
b
b
2
4ac
2a
(8.10)
z
1
, z
2
=
1
2
_
1
t
2
_
_
_
1
t
2
_
2
4
t
2
=
1
2
_
1
t
2
_
_
_
1 3
t
_
+
t
2
4
2
(8.11)
Stability is assured so long as the roots are within the unit circle |z| 1.
200 Power systems electromagnetic transients simulation
No time-step delay in data path
If there is no delay in the feedback path implementation then e
k
= (u
k
(1/G)y
k
)
Applying trapezoidal integration gives:
y
k
= y
k1
+
t G
2
(e
k
+e
k1
)
= y
k1
+
t G
2
_
u
k
1
G
y
k
+u
k1
1
G
y
k1
_
=
_
y
k1
t
2
y
k
t
2
y
k1
_
+
t G
2
(u
k
+u
k1
) (8.12)
Transforming equation 8.12 into the z-plane yields:
Y
__
1 +
t
2
_
+z
1
_
t
2
1
__
=
t G
2
(1 +z
1
)U (8.13)
Rearranging gives:
Y
U
=
(t G/(2))(1 +z
1
)
(1 +t /(2)) +z
1
(t /(2) 1)
=
(t G/(2))(z +1)
z(1 +t /(2)) +(t /(2) 1)
(8.14)
The pole (root of characteristic equation) is:
z =
(1 t /(2))
(1 +t /(2))
(8.15)
Note that |z
pole
| 1 for all t /2 > 0, therefore this method is always stable.
However this does not mean that numerical oscillations will not occur due to errors
in the trapezoidal integration.
Root-matching technique
Applying the root-matching technique to this control system (represented mathemat-
ically by equation 8.1) gives the difference equation:
Y(z)
U(z)
=
G(1 e
t /
)
(1 z
1
e
t /
)
(8.16)
hence multiplying both side of equation 8.16 by U(z)(1 z
1
e
t /
)
Y(z) = e
t /
z
1
Y(z) +G(1 e
t /
)U(z) (8.17)
Transforming to the time domain yields the difference equation:
y
k
= e
t /
y
k1
+G
_
1 e
t /
_
u
k
(8.18)
Control and protection 201
The pole in the z-plane is:
z
pole
= e
t /
(8.19)
Note that |z
pole
| 1 for all e
t /
1 hence for all t / 0.
Numerical illustration
The rst-order lagsystemof Figure 8.3is analysedusingthe three difference equations
developed previously, i.e. the trapezoidal rule with no feedback (data path) delay, the
trapezoidal rule with data path delay and the exponential formusing the root-matching
technique. The step response is considered using three different time-steps, t =
/10, , 10 ( = 50 s) and the corresponding results are shown in Figures 8.48.6.
When t / = 1/10 the poles for trapezoidal integration with delay in the data
path are obtained by solving equation 8.11; these are:
z
1
, z
2
=
19
20
_
_
_
19
20
_
2
4
20
_
= 0.0559 and 0.8941
Since two real roots exist (z
1
= 0.0559 and z
2
= 0.894) and both are smaller than
one, the resulting difference equation is stable. This can clearly be seen in Figure 8.4,
which also shows that the exponential form (pole = 0.9048) and the trapezoidal
rule (pole = 0.9048) with no data path delay are indistinguishable, while the error
introduced by the trapezoidal rule with data path delay is noticeable.
0
0.2
0.4
0.6
0.8
1
1.2
y
Time (s)
Trapezoidal Trapezoidal (time-step delay) Exponential form
0.0009 0.001 0.0011 0.0012 0.0013
Figure 8.4 Simulation results for a time step of 5 s
202 Power systems electromagnetic transients simulation
y
Time (s)
Trapezoidal Trapezoidal (time-step delay) Exponential form
0 0.001 0.002 0.003 0.004 0.005
0
0.35
0.7
1.05
1.4
Figure 8.5 Simulation results for a time step of 50 s
y
Time (s)
Trapezoidal Trapezoidal (time-step delay) Exponential form
0
400
800
1200
400
0 0.001 0.002 0.003 0.004 0.005
Figure 8.6 Simulation results for a time step of 500 s
Control and protection 203
The poles when t / = 1 are given by:
z
1
, z
2
=
1
2
1
2
_
_
_
1
2
_
2
4
1
2
_
= 0.25 j0.6614
Hence a pair of complex conjugate roots result (z
1
, z
2
= 0.25 j0.6614). They
lie inside the unit circle (|z
1
| = |z
2
| = 0.7071 < 1) which indicates stability.
Figure 8.5 shows that, although considerable overshoot has been introduced by the
time-step delay in the data path, this error dies down in approximately 20 time steps
and the difference equations are stable. A slight difference can be seen between the
trapezoidal integrator with no data delay (pole = 0.3333) and the exponential form
(pole = 0.3679).
Finally when t / = 10 the poles for the trapezoidal rule with time delay in the
feedback path are:
z
1
, z
2
=
4
2
_
((4)
2
4 5)
2
= 2.0 j1.0
hence two complex poles exist, however they lie outside the unit circle in the z-plane
and therefore the system of difference equations is unstable. This is shown in the
simulation results in Figure 8.6.
The poles for the trapezoidal method with no time delay and exponential form are
0.6667 and 4.5400e005 respectively. As predicted by equation 8.15, the difference
equation with no data path delay is always stable but close examination of an expanded
view (displayed in Figure 8.6) shows a numerical oscillation in this case. Moreover,
this numerical oscillation will increase with the step length. Figure 8.6 also shows
the theoretical curve and exponential form of the difference equation. The latter gives
the exact answer at every point it is evaluated. The exponential form has been derived
for the overall transfer function (i.e. without time delays in the data paths).
If a modular building block approach is adopted, the exponential form of dif-
ference equation can be applied to the various blocks, and the system of difference
equations is solved in the same way as for the trapezoidal integrator. However, errors
due to data path delays will occur. This detrimental effect results fromusing a modular
approach to controller representation.
This example has illustrated the use of the z-domain in analysing the difference
equations and data path delays and shown that with z-domain analysis instabilities
can be accurately predicted. Modelling the complete controller transfer function is
preferable to a modular building block approach, as it avoids the data path delays
and inherent error associated with it, which can lead to instabilities. However the
error introduced by the trapezoidal integrator still exists and the best solution is to
use instead the exponential form of difference equation derived from root-matching
techniques.
As well as control blocks, switches and latches, the PSCAD/EMTDC CSMF
library contains an on-line Fourier component that is used to derive the frequency
components of signals. It uses a Discrete Fourier Transform rather than an FFT. This
204 Power systems electromagnetic transients simulation
1.0
Magnitude
Phase
Freq
Mag
sin
0.0
Phase
50.0
Frequency
0
.
0
0
1
1
2
D
0
.
0
0
1
D
4
2
D
2
2
D
1
0
0
0
.
0
0
.
1
V_load
I_load
I_load
V_load
GTO_AP
GTO_AN
12
0
.
0
12
0
.
0
Vs1
Vt
Monitoring of a load
GTO_AP
GTO_AP
GTO_AN
GTO_AN
3
2
A
B
Compar-
ator
+