Inverter-Based Diesel Generator Emulator for the Study of Frequency Variations in a Laboratory-Scale Autonomous Power System

This paper presents the modeling, simulation and practical implementation of an inverter-based diesel generator emulator. The main purpose of this emulator is for the study of frequency variations in diesel-based autonomous power systems in a laboratory environment where the operation of a real diesel generator is not possible. The emulator basically consists in a voltage source inverter with a second order output filter which voltage references are given by the model of the diesel generator. The control of the emulator is based on the digital signal processor TMS320F2812, where the mathematical models of the diesel generator and the control of the inverter are computed in real-time. Parameters for the model were obtained from commercially available components. Experimental results for different values of speed droop showed that the emulator achieves a satisfactory performance in the transient and stationary response. For the stationary response, the measured frequency deviates from theoretical values with a mean absolute error of: 0.06 Hz for 0% droop, 0.037 Hz for 3% droop, and 0.087 Hz for 5% droop. For the transient response, the measured frequency nadir deviates from simulations in: 0.05 Hz for 0% droop, 0.02 Hz for 3% droop, and 0.1 Hz for 5% droop.


Introduction
In conventional power systems electrical energy is primarily generated by means of rotating machinery and supplied in the form of ac voltage, where the frequency of the ac voltage is associated to the rotational speed of generators.Any imbalance between load and generation originates a change in the kinetic energy of rotating generators and therefore a change in frequency.In practice, frequency varies all the time due to a continuous interaction between loads and generators.The characteristics of such frequency variations will mainly depend, among other factors, on the type of disturbance affecting the power system, the performance of the frequency control system, and physical properties of generators.For instance, large interconnected power grids can be considered as stiff systems where a large power disturbance must occur before the frequency will deviate to any significant level.This is not necessarily the case for small power systems.
In general, frequency variations of consequence are more likely to occur in small power systems that are isolated from the utility grid since they feature a relatively small generation capacity, rapid changes in power demand, and low inertia [1].Unwanted frequency variations might affect power system performance and even lead to system instability.The work presented in this paper is part of a research project on dynamic control of frequency variations in diesel-based autonomous power systems (APS).The main objective of this paper is to present the modeling and implementation of a diesel generator emulator based on a voltage source inverter.An early version of the emulator as well as preliminary results was presented in [2].The main motivations for developing the emulator are: the inverter-based emulator offers a more flexible solution for experimental setups than a machine-based emulator [3,4] and because our facilities are not suitable for the operation of a real diesel generator.
The rest of the paper is organized as follows: Section 2 presents a brief review of the frequency variation phenomenon and basic frequency control strategies used in APSs.Section 3 presents a general description of the emulator system, its main components and operation.Then, Section 4 presents the modeling of the diesel generator and Section 5 the control strategy for the inverter.In Section 6 relevant aspects of the digital implementation are discussed and experimental results are presented.

The Frequency Variation Phenomenon
The diesel generator, also called generator set or genset, is one of the main components of the APS since it represents the primary source of energy and establishes the ac voltage in the system.A diesel generator basically consists of a rotating synchronous generator driven by a diesel engine [5].Due to the physical principles involved in the process of energy conversion-from diesel fuel to electrical energy-the frequency of the output ac voltage is strongly coupled with the rotating speed of the diesel engine.Therefore, speed control of the diesel engine is crucial to frequency control.
Figure 1 depicts the block diagram of a basic speed control.In general terms, this control works as follows: a disturbance (e.g. a change in the electrical load) produces a change in the power balance of the genset, rotating speeds within the genset change accordingly, a change in the speed of the diesel engine is sensed by the governor, the control error is processed and then the corresponding control signal is sent to the fuel injection system, which produces the corresponding change in the fuel flow to the engine, finally the resulting interaction between the diesel engine and the synchronous generator produces a variation in the frequency of the output voltage.
For a single genset, frequency variations mainly depend on the following factors: 1) Characteristics of the electrical load and disturbance.
2) Physical characteristics of the electrical generator.
3) Physical characteristics of the coupling shaft.4) Physical characteristics of the actuator and prime mover.
5) Type and performance of the speed controller.
Where the transient regime of a frequency variation is affected by the overall performance of the system, i.e., by a combination of all the factors previously mentioned.On the other hand, the steady-state frequency will be mainly determined by the type of speed controller and its performance.

Frequency Control Strategies
In a small APS frequency control is usually achieved by primary control [6], which is performed by the speed governor of the diesel generator (Figure 1) by means of two strategies: isochronous control and permanent droop control [7].
Isochronous control refers to the ability of the prime mover to return to the original reference speed after a load change.This type of control is usually implemented by integrating the control error, and thus providing the necessary output to the actuator to return to its reference speed after a disturbance (Figure 2(b)).Therefore, an APS with a single generator in isochronous control will operate at fixed steady-state frequency as long as the generator is capable of supplying the power demanded by the load.Figure 2(a) shows the static relationship between power and frequency for a single generator in isochronous control mode.
Permanent droop control refers to the ability of the prime mover to return to a different speed after a load change.This type of control is achieved by a proportional action over the actuator, based on the control error.When the load increases, the generator will stabilize to a speed lower than the original (Figure 2(d)).Conversely, when the load decreases, the generator will stabilize to a higher speed.Therefore, an APS with a single generator in permanent droop control will experience different operating frequencies as the load varies.Figure 2(c) shows the static relationship between power and frequency for a single generator in droop mode.

Overview of the Emulator System
A general diagram of the emulator system is shown in

Modeling of the Diesel Generator
The block diagram of the diesel generator is shown in Figure 4.The model consists of five sub-models: the diesel engine, the synchronous generator, the coupling shaft, the automatic voltage regulator, and the speed governor, which are presented in the following sections.

Fuel Injection System and Diesel Engine
Several models for the diesel engine can be found in the literature [5,[8][9][10] and the majority of them have in common three main elements: a fuel injection system represented as a first order model, a delay time representing the internal combustion delay, and the inertia of the internal rotating parts of the engine and flywheel.The effects of the inertia will be included in the model of the coupling shaft, therefore, the differential equation of the model ( 1) only includes the effects of the combustion delay and the dynamic of the fuel injection.The model equation is: where  is the control signal from the speed governor and m  is the mechanical torque developed by the engine.The parameters are e the time constant of the fuel injection system, e the gain of the engine, and d is the delay that represents the elapsed time until torque is developed at the engine shaft.Since the control signal,  , varies within the range 0,1 k , then the engine gain, e , represents the maximum torque developed by the engine.The values of the parameters, summarized in Table 1, were obtained from the datasheet of a commercial diesel engine [11] and from an experimental setup used in [12].

Coupling Shaft
The coupling shaft of the genset is modeled as two rotational masses coupled by a flexible shaft.The equations of the model are:  electric load.The parameters are en ge , J J and fen , fge the moments of inertia and the frictional losses coefficients of the engine and electrical generator, fs and ss the damping and torsional stiffness coefficients of the shaft, with fens fen fs and fges fge fs .Parameters of model (2) were obtained from datasheets [11,13,14] and they are summarized in Tables 1-3.

Electrical Generator
The electrical generator is represented by model 2.1 of the "IEEE standard for synchronous generator modeling" [15].This model consists of two windings-field and damper windings-in the d-axis of the rotor, and a single damper winding in the q-axis.Inductances for this model were derived from reactances given in the datasheet of the synchronous generator [13].Main parameters are summarized in Table 3.

Automatic Voltage Regulator
The proposed model for the AVR is based on information provided by the IEEE Std.421.5 [16)] and the datasheet of the synchronous generator [13].The model consists of a single-phase thyristor rectifier-modeled as a first order system [17]-controlled by a proportionalintegral (PI) controller (Figure 5

.2. Speed Governor
The speed governor [18] has the structure of a PI controller and the droop function is implemented with the feedback of the controller output (Figure 5(b)).The Copyright © 2013 SciRes.EPE

 
output of the controller is limited to the range 0,1 in order to represent the operating stroke of the actuator [19].As described before for the AVR, the speed governor is also provided with an anti-windup integrator.The equations of the model are: where the variables are:

Simulation
The AVR and speed governor are tuned in order to comply with performance class G3 of the standard ISO 8528:5 [20].Controller parameters are summarized in Tables 4 and 5. Simulations were conducted to verify the transient performance for maximum loading and unloading conditions.Figure 6 shows the the results for different values of droop and Table 6 compares the results with the specifications of the standard.

Control of the Voltage Source Inverter
The model for this inverter (Figure 7) is well documented in the literature, therefore we refer the reader to [21] for more details on the modeling.The equations for the inverter are the following: where , C are the inverter output currents and voltages, Load and Load are the load currents, dc is the dc bus voltage, and the modulation indexes, and i  is the output frequency of the inverter.

Note that by defining
 the output frequency is the generator speed from the genset model.As mentioned in Section 3 the references calculated with the genset model are the genset output voltages s and s v , therefore a voltage control strategy is proposed for the VSC.In order to follow the references with a desired dynamic performance, voltage control requires inner control loops for the output currents L i , q L i .The control strategy is designed in two steps, first the inner current control loops and then the outer voltage loops.

Current Control
The proposed control law-based on input-output linearization [22]-consists in defining the modulation index as: where is the new input.By replacing ( 14) in (10) the following second order transfer function is obtained: where Pi and Ii are the parameters of the control Equation (15).Since (16) has the form of a standard second order transfer function, its parameters can be defined as , where n  is the natural frequency and  the damping ratio.The same control method is used for the q axis current and both controllers are tuned with the same parameters (see Table 7).

Voltage Control
Assuming that the current dynamics have been set suffi- ciently faster than the desired voltage dynamics, then the output currents might be considered equal to its references and therefore they can be used as the control inputs in ( 12) and ( 13).The same control technique used for the output currents can be applied to the output voltages by defining the current reference as: where g is the new input.By replacing (17) in (12) the new equation g must be defined in such a way that the desired dynamics between the voltage C and its reference s -the output voltage of the genset model-are achieved in closedloop.Therefore, by defining the new input in the s-domain as: the following second order transfer function is obtained: where Pv and Iv are the parameters of the control Equation (18).Similarly, as in the case of the output currents, controller parameters can be defined as , where n  is the natural frequency and  the damping ratio.The same control method is used for the q axis voltage and both controllers are tuned with the samsse parameters (see Table 7).

Experimental Tests
Figure 8 shows pictures and the setup.Parameters of the power circuit are summarized in Table 8.Two tests were performed on the emulator: one to verify its static  This test consisted in varying the load of the emulator to r different values of obtained data was com-obtain the steady-state response fo droop factor and load level.The pared with theoretical droop curves.Figure 9 shows the results of this test.Hz.According to simulations, the expected frequency for this case is 48.55 Hz (0.971 pu).In the same way, Figure 10(c) shows the speed nadir (Ch1) for the case of 3% droop.Channel 2 shows the actual phase voltage whose frequency is 48.12 Hz.According to simulations, the expected frequency for this case is 48.1 Hz (0.962 pu).Finally, Figure 10(d) shows the speed nadir (Ch1) for the case of 5% droop.Channel 2 shows the actual phase voltage whose frequency is 47.85 Hz.According to simulations, the expected frequency for this case is 47.75 Hz (0.955 pu).

Comments on the Digital Implementation
The nonlinear co sampling time equal to 100 μs, which is the period of control timer of the DSP.Therefore, the model of the genset was programmed in the following state-space form: The effect of the combustion delay time was neglected in (20) for two reasons: its value is very small compared to the rest of the s representation s at least two state variables (which have to be added t mplexity) in order to have a good approximation of the delay.
The input to the genset model, l R , was calculated from the actual load of the setup, load R .The latter was estimated from the measured voltage and current as follows: where   Load  is the estimated value of the actual load of the setup.This w ted the modeling, simulation, and the practical impl entation of an inverter-based diesel generator emulat the study of freque mous power system the operation of a real genset is not possible.Experimental results for different values of speed droop showed that the emulator achieved a satisfactory performance in the transient and stationary response.For the stationary response, the measured frequency deviated from theoretical values with a mean absolute error of: 0.06 Hz for 0% droop, 0.037 Hz for 3% droop, and 0.087 Hz for 5% droop.As for the transient response, the measured frequency nadir deviated from simulations in: 0.05 Hz for 0% droop, 0.02 Hz for 3% droop, and 0.1 Hz for 5% droop.Further experimentation is required in order to evaluate the performance of the emulator in parallel operation with active components, because future work will consider the use of the emulator in a laboratory-scale mini-grid system.

Figure 1 .
Figure 1.Main components of a typical diesel generator speed control.

Figure 3 .
The voltage source inverter (VSI) is a 2-level topology Semiteach-IGBT from Semikron.It has a 3-phase full wave diode rectifier to provide the dc power.The output filter is not included in the inverter, then additional inductors and capacitors should be connected on each phase.The load is a variable resistor bank.The digital control system is based on the Spectrum Digital development kit eZdsp-F2812 (DSP).All the programming is developed in C. A dedicated computer is needed for programming and monitoring.The voltage and current sensors designed for this project have the same structure: a Hall-effect transducer at the input, a gain and offset conditioning stage, and a buffer at the output.The signal conditioning stage is necessary to adapt the bipolar signals (measured ac currents and voltages) to the unipolar 3 V range of the DSP analog inputs.The PWM signals also have the same dynamic range, therefore it is necessary a voltage step up circuit to achieve the 15 V level of the inverter drivers.In general terms, the emulator works as follows: the model of the diesel generator (genset) is programmed into the DSP and fed with the measured load currents, then the output voltages of the model are calculated and used as references to control the output voltages of the inverter.The controllers of the VSI, which also run in the DSP, produce the corresponding pulse width modulated (PWM) signals for the inverter.The analog outputs of the DSP are used to visualize in the scope internal variables of the genset model such as rotational speeds, torques, etc.

Figure 3 .
Figure 3. Block diagram of the emulator system.
the state variables are en  the rotational speed of the prime mover, ge  rotational speed of the electrical generator, and s  the torque transmitted through the shaft.The inputs are m  the mechanical torque supplied by the engine, and e  the electromagnetic torque due to (a)).The PI controller is provided with anti-windup function which, i.e., the integrative function is disabled  

Figure 5 .
Figure 5. Genset control block diagrams.(a) Automatic voltage regulator; (b) Prime mover speed governor.where the variables are t the measured terminal voltage, t ref the terminal voltage reference, v the integrator state, v the output of the controller, and f the output voltage of the AVR rectifier which is the input for the rotor external winding.The parameters are v v z u v ref  the speed reference, z  the integrator state, and u  the output of the controller.The parameters are p k  the proportional control gain, i k  the integral control gain, and dr the speed droop gain.The speed droop gain is defined as dr en is the static droop slope, and  is the nominal speed of the prime mover in (rad/s). m

Figure 6 .
Figure 6.Genset model transient response for different values of droop.Waveforms for a 50% load increase at t = 1 s and three different values of speed droop.(a) Rms value of the output terminal voltage; (b) Prime mover rotational speed.

Figure 9 (
b) shows the emulator speed when it operates with 0% droop (isochronous control).It can be observed that, for different load levels, there is practically state.In the same way, Figure9(c) shows the emulator speed for different load levels when it operates with 3% droop, where it can be obse at the generator speed  ge k  decreases in steady state as the load increases.Finally, the same test of load variation is repeated with the emulator operating at 5% droop.

Figure 9 (
d) shows ts, where it can be seen that the generator speed  ge k  decreases in steady state as the load increases and, as expected, the steady state variations are greater than in the case of 3% droop.

Figure 9 .Figure 9 (
Figure 9. Emulator steady values of droop factor and els.(a) Experimental and theoretical static droop curv b) 0% droop; (c) 3% droop; (d) 5% droop.-state response for different load lev es; ( (d)), whereas in the case of the frequenc droop curve the data correspond to the instantaneous values displayed on the scope.sudden load increase to obtain the transient response of the emulator and compare it with lator started in steady-state simulation results.The emu with a nominal load of load 31.25 R   per phase.Then, load 4 R was connected at the same time in each phase, resulting in an equivalent nominal load per phase of load 25 R   .Figure 10(a) shows the speed transient response of the emulator for the three values of droop.
Figure 10(b) s ows a d tailed view of the moment when the speed h e na ntinuous-time model of the genset (Section (4)) was linearized and discretized considering a the dir (Ch1) occurs for the case of 0% droop.Channel 2 shows the actual phase voltage whose frequency is 48.6
main purpose of this emulator is for ncy variations in diesel-based autonos in a laboratory environment where [2] M. Torres and rter-Based Virtual Diesel Gener ale Applications," R k