Algorithms For The Accounting of Multiple Switching Events in Digital Simulation of Power-Electronic Systems
Algorithms For The Accounting of Multiple Switching Events in Digital Simulation of Power-Electronic Systems
Abstract—Digital simulation of power systems containing power switching event is not known a priori (since it is controlled by
electronics apparatus is challenging due to the need to account processes external to the simulator) and it seldom coincides
multiple switching events within one simulation time-step. This exactly with thereby creating a switching delay which
paper describes a family of algorithms, with varying levels of
computational complexity, for accounting such switching events produces erroneous simulation results.
in digital simulations. The proposed algorithms are applicable Various techniques are available in literature to deal with
for both off-line and real-time simulations. A comparative study single inter-step switching events in digital simulation under
on their performance such as harmonic content, errors in funda- both off-line and real-time conditions. State-space methods
mental component and simulation time requirement is presented. [4], [5] have been effectively used to simulate thyristor based
A Pulse Width Modulated (PWM) Voltage Source Converter
(VSC) based D-STATCOM system is used as a case study for circuits. Fixed time-step methods based on nodal analysis have
simulations. Simulation results indicate excellent performance been used for traditional power system transient simulation
(accuracy and efficiency) in comparison with a fixed time-step [6], [7] as well as power-electronic circuit simulation [8], [9]
algorithm using a small step-size. under both off-line and real-time conditions. The advantage of
Index Terms—Digital control, discrete event simulation, extrap- such methods is that the admittance matrix of the simulated
olation, interpolation, power electronics. network remains unchanged. Combined with a fixed time-step
nodal method, linear interpolation has proved to be a very
effective technique in estimating the circuit variables at the
I. INTRODUCTION
switching instant. Some of the pioneering research in this area
(1)
represents the history of the network since depends on the A. Fixed Time-Grid Algorithms
state and input at the previous time-step. This formulation is Once the exact instant of switching event is detected, these
identical to that of Dommel’s method [6] using trapezoidal rule. algorithms implement post-event corrections. For all the algo-
and can be interpreted as the discrete time equivalent net- rithms, the interpolated variables include the state variables,
work parameters dependent not only on the original network (inductor currents and capacitor voltages) and the inputs (AC
parameters and but also on the time-step . Therefore, system voltages). These variables are interpolated to the point
a change in the time-step would necessitate a recalculation of switching and then the power-electronic converter model (1)
of and . is updated in accordance with the switching changes. The up-
dating procedure depends on the model used to simulate the
switches. Using the switching function models, the switch status
III. ALGORITHMS FOR THE ACCOUNTING OF MULTIPLE
are flipped and the voltage levels are decided.
SWITCHING EVENTS
1) Algorithm I: This algorithm is similar to the Double in-
As shown in Fig. 1, two switching events and arrive in terpolation technique that has been used by PSCAD/EMTDC
the time interval while the simulator computes and [15].
emits state at time . Although, real-time operation does After calculating state , when the simulator has acknowl-
not allow changing state , it does allow the simulator to take edged that two events have arrived in the previous simulation
certain corrective action before proceeding to calculate the next interval at times and , the following steps can be taken to
state at time provided that the simulator has the timing correct the subsequent state calculation:
information of the switching events relative to the simulation 1) Based on states and , state at time is
time-grid. The earliest time at which this information can be linearly interpolated as
made available to the simulator is at the instant an event occurs
(i.e., and , and the latest is at the end of time . The al- (11)
gorithms described in this section can be broadly classified into
two categories). 2) Once the interpolation is performed, the power-elec-
1) Fixed Time-Grid Algorithms: In these algorithms the tronic model (1) is updated according to switching
output data of the simulation is obtained at equal in- event . This will yield which is different from
tervals of time thereby fixing the time-grid. If is .
varied internally, then a re-synchronization is performed 3) State at time is calculated using (6).
to get the simulation back on the original time-grid. 4) Now, based on and , state is interpo-
Therefore, these algorithms can have a fixed or a vari- lated as
able simulation time-step. Algorithms I through VII in
Fig. 2 belong to this category. For the sake of clarity (12)
these algorithms are illustrated with only two switching
events.
5) The power-electronic model (1) is again updated using
2) Variable Time-Grid Algorithms: In these algorithms, the
switching event and state is calculated in accor-
real-time simulator is interrupted in its normal opera-
dance with the switching changes at .
tion at the instant a switching event occurs, effectively
6) State at time is calculated using (6).
varying the external simulation time-grid. However, the
7) The corrected state at time is now interpolated
internal time-step of the simulation is always fixed.
Algorithm VIII belongs to this category. based on states and as
At the beginning of each time-step, the simulator takes one of
the two operational paths based on the information it receives (13)
about any switching events:
1) Normal Operation described in Section II is executed This step puts the simulation on the original time-grid.
in case of no switching event has been detected in the 8) Finally, state is calculated from using (6).
previous time-step. There are 3 interpolations and 3 full-state calculations and
2) In case of one or more switching events in the previous two model updates involved in going from time to time ,
time step, Post-event Correction Operation is executed. with no change in , after the simulator receives the informa-
Depending on the algorithm, correction involves linear tion about the switching events. Step 7 is solely an internal cal-
interpolation, linear extrapolation or a change of time- culation since it is not possible to change in real-time. This
step. The correction variables include the state variables step may be used in off-line simulations to produce more accu-
of the system and the inputs (voltage or current sources). rate results.
After correction to the point of switching, the system is 2) Algorithm II: After Step 6 in Algorithm I:
updated before proceeding to the next time-step. During 7. Using and , state is linearly extrapo-
the updates, inductor currents and capacitor voltages are lated.
kept unchanged. The following algorithms explain more For this step, states and have been chosen, in par-
details of this mode of operation. ticular, because they are fully corrected states. Note that state
1160 IEEE TRANSACTIONS ON POWER DELIVERY, VOL. 20, NO. 2, APRIL 2005
Fig. 2. Digital simulation algorithms for multiple switching events based on a fixed time-grid. : Full-state calculation, : Linear
Interpolation, : Linear Extrapolation.
is left uncorrected, however, for off-line simulator state 4. The power-electronic model (1) is updated to obtain
can be corrected to have more accurate results. Thus, in this al- using switching event .
gorithm there are 2 interpolations, 2 full-state calculations and 5. at time is calculated using (6).
1 extrapolation with a fixed . 6. Based on and state is extrapolated as
3) Algorithm III: After Step 5 in Algorithm I (i.e., once
has been determined)
(15)
6. The step-size of the simulation is changed from to
and is calculated.
7. State is calculated using (6). This algorithm is a variation of Algorithm II in which 1 inter-
Therefore, there are 2 interpolations, 2 full-state calculations polation and 1 full-state calculation has been substituted by one
and 1 recalculation in this algorithm. additional extrapolation with remaining fixed.
4) Algorithm IV: After Step 2 in Algorithm I, i.e., after 5) Algorithm V: After Step 4 in Algorithm IV (i.e., after ob-
has been obtained, this algorithm uses the following steps: taining by extrapolation from and and updating
switching at ), this algorithm uses the following steps:
3. is extrapolated based on and
5. The step-size of the simulation is changed from to
and is calculated.
(14)
6. is calculated using (6).
FARUQUE et al.: ALGORITHMS FOR THE ACCOUNTING OF MULTIPLE SWITCHING EVENTS 1161
(16)
Euler yields at a step of . Then, the system state IV. CASE STUDY: D-STATCOM SYSTEM
at time is extrapolated from the state and . The state A. System Model
at is then updated with the switching events. Now, with the
updated state , the simulation is transferred to Time-Grid 2 Fig. 4 illustrates a generic experimental set-up of the
and proceeds with a fixed time-step from time onward D-STATCOM power system and its digital controller. The
system consists of a three-phase insulated-gate bipolar tran-
and expected to reach at time . However, the simulation is
sistor (IGBT) bridge (switching frequency kHz)
interrupted again by a second switching event at time . connected via a series impedance ( and
As the distance between and is less than (Case mH) to the ac bus assumed to be a balanced voltage source
I), a single extrapolation is performed based on the state at ( V rms Hz). represents the filter induc-
at and at to find the state at . The state tance and the leakage inductance of the converter transformer.
at is then updated with the switching changes and the accounts for the converter and transformer conduction
simulation moves to Time-Grid 3 and starts from . From losses. The dc side capacitor is F. The switches
we assume that there is no switching event in the next time step in the voltage-source converter (VSC) are modeled as ideal
and a full time-step calculation is performed to reach the state bi-directional switches with gate turn-on and turn-off controls.
at time . From the time the simulation starts for a The VSC model is based on discrete switching functions. Three
full step but is interrupted by an event at time . Since switching signals control the upper switches
the distance between the time and is greater than in each leg of the converter. The lower switches in each leg
but less than (Case III), first a trapezoidal integration is of the converter are switched in a complementary manner.
performed to calculate the state at . Thereafter, Accordingly, the output voltages of the converter with respect
linear extrapolation between and is performed to reach to the negative dc bus are given as
the state at . The simulator then updates the switching
(18)
changes and moves to a new time-grid (not shown in the
figure). The simulation follows the similar approach for all the Under balanced conditions the converter output voltages with
future switching events and the states are recorded. Clearly, the respect to the AC system neutral are given as
output data of the simulation will be unevenly spaced due to the
changes in the original time-grid. Linear interpolation is used
(19)
to get an evenly spaced data set.
The benefits of implementing this variable time grid algo-
rithm are as follows:
Taking , and as the states, the time-domain model of
• No post event correction is necessary as the algorithm al- the system can be represented by three differential equations
ways uses the corrected states.
• The algorithm is suitable for implementing in real-time as (20)
it always advances with correct state values needed for the
controller to produce gating signals. (21)
• The internal simulation time step remains always un-
changed and recalculation of is obviated. (22)
FARUQUE et al.: ALGORITHMS FOR THE ACCOUNTING OF MULTIPLE SWITCHING EVENTS 1163
(23)
B. Digital Controller
The control design [25] has been carried out in the syn-
chronous frame. The control algorithm is executed every
which is the controller sampling period. First a coordinate
transformation from frame to frame is performed on the
system signals. Then a decoupled control of the currents and
Fig. 5. Illustration of multiple switchings through a detailed view of one
is performed using P-I compensator’s for each of the current complete cycle of PWM for D-STATCOM system.
loops. The DC-link voltage is regulated through an external
feedback loop. The resulting control quantities- modulation
TABLE I
index and phase angle of the control signal -are then sent to the VARIATION OF SWITCHING EVENTS WITH SIMULATION STEP-SIZE FOR A
pulsewidth modulator (PWM) for the generation of switching SIMULATION PERIOD OF 2 S WITH CARRIER FREQUENCY OF 1 kHz
signals based on the sampling technique approach [26]. A
delay of one sampling period is introduced in the controller
implementation in order to account for the finite execution time
taken by the DSP.
TABLE II
FUNDAMENTAL ERROR " AND THD OF I FOR VARYING 1t AND THE TOTAL SIMULATOR OPERATIONS. (A) FULL-STATE COMPUTATION, (B)
LINEAR INTERPOLATION, (C) LINEAR EXTRAPOLATION, (D) [; ] RE-CALCULATION
of current with 1 s time-step. The percentage THD for the cur- algorithm. Even at a smaller time-step such as
rent waveform simulated using a certain time-step is defined as s, the error is less than 0.8% for all the proposed
algorithms, whereas fixed time-step algorithm shows an
error of 2.4%. The decreases to a range of 0.5%–9%
% (25) from 38.2% for the fixed time-step algorithm when
s.
• Algorithms II through VII are less accurate in comparison
For the fixed time-step algorithm A and the with Algorithm I, and therefore produce significant har-
%. The and THD for different algorithms monic current at higher time-steps. However, they are still
with step-sizes of 10, 50, 100, and 150 s are also presented in able to compensate for the fundamental current and keep
Table II. The table also summarizes the number of operations its value low. Therefore, the percentage rms error is small
required by each of the proposed algorithms. Algorithm I and but the THD for these algorithms remains high at higher
II are the most rigorous and accurate while other algorithms time-steps. Furthermore, Algorithms II to VII do not use
bear relatively less computational burden and are therefore less the corrected state as the the output at time in order
accurate in comparison. The accuracy of these algorithms (III to conform to the real-time condition that it would not be
through VII) can be further improved through a correction of possible to send the corrected value to the controller.
state by interpolation. A remarkable improvement in per- • If state is allowed to be corrected, a significant im-
formance especially in THD was observed when state was provement in THD is observed. The results in Table II
corrected (as seen from Table II). The following conclusions for a 150- s time-step reveal that all algorithms (except
can be drawn from the results: Algorithm VIII) show THD in the range of 18% to 24%,
• In the fixed time-step algorithm, as the time-step is in- whereas fixed time-step algorithm shows a THD of 46%.
creased from s to s, we find that the Offline simulators can exploit the benefit of correcting
fundamental current increases drastically (from 17.1 A to state .
24.7 A), due to not accounting the switching events at their For any given , the accuracy of all the algorithms was found
right instants, hence the percentage fundamental error to be similar to that of the fixed time-step algorithm using one-
increases from 2.4% to 33.66%. The harmonic current tenth . Using similar simulation parameters and environment,
also increases at almost the same rate. Therefore, THD re- the algorithm used in HYPERSIM [19] has been extended for
mains almost unchanged (around 16%). However, at much multiple switching events. A comparative study revealed that all
higher time-steps e.g., s, the harmonic cur- the proposed algorithms produce results that are in close agree-
rent increases at a faster rate than the fundamental current, ment with the results obtained using the HYPERSIM algorithm
which is why we get a higher THD (46%) at that time-step. until s. At 10-, 50-, and 100- s time-steps, the HY-
• A time-step of over 50 s (for the study system with a PERSIM algorithm yielded an error of 0.34, 0.98, and 4.6 (%)
switching frequency of 1 kHz) is inadequate for simulation respectively, however, at 150 s or higher it produced an in-
using the fixed time-step approach due to a high error (the creasing error (higher than 30%).
error increases to 38.25% for s. A comparison of steady-state current for fixed time-step algo-
• As the time-step varies from s to s, rithm and Algorithm VII is shown in Fig. 6. The current wave-
Algorithm I treats the switching events accurately, thereby form with fixed time-step algorithm differs significantly when
reducing both the fundamental and the harmonic currents. the time-step is changed from 10 s to 150 s. However Al-
Therefore, both the percentage rms error and THD remain gorithm VII with 150 s is in close conformity with the 10- s
small (close to their values at s. case of fixed time-step algorithm. The difference is more ob-
• For Algorithms II through VII, both THD and increase, vious from the Fig. 7, where the frequency spectrum is plotted.
with the increase of time-step, however, the increase in Fixed time-step algorithm with s shows a substan-
is less pronounced compared to that for the fixed time-step tial difference in fundamental component in comparison with
FARUQUE et al.: ALGORITHMS FOR THE ACCOUNTING OF MULTIPLE SWITCHING EVENTS 1165
Fig. 6. Detailed view of the steady–state current I . Curve 1: Fixed time-step "
4
algorithm with t = 10 s, Curve 2: Fixed time-step algorithm with t = 4 Fig. 8. Plot of percentage fundamental error with respect to simulation
4
150 s, Curve 3: Algorithm VII with t = 150 s.
time-step.
Fig. 11. Execution time for the time-step involving multiple switching events,
4
for various algorithms with t = 100 s.