Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 72 RESD © 2015 http://apc.aast.edu Modelling Of Diesel Generator Sets That Assist Off- Grid Renewable Energy Microgrids J. Salazar, F. Tadeo, Prada, C. Dept. of System Engineering and Automatic Control, Dr. Mergelina S/N, University of Valladolid, 47005 Valladolid, Spain. Abstract - This paper focuses on modelling diesel generators for off-grid installations based on renewable energies. Variations in Environmental Variables (for example, Solar Radiation and Wind Speed) make it necessary to include these auxiliary systems in off-grid renewable energy installations, in order to ensure minimal services when the produced renewable energy is not sufficient to fulfill the demand. This paper concentrates on modelling the dynamical behaviour of the diesel generator, in order to use the models and simulations for developing and testing advanced controllers for the overall off-grid system. A diesel generator is assumed to consist of a diesel motor connected to a synchronous generator through an electromagnetic clutch, with a flywheel to damp variations. Each of the components is modelled using physical models, with the corresponding control systems also modelled: these control systems include the speed and the voltage regulation (in cascade regulation). Keywords - Microgrids, Off-grid, Speed and voltage control, Diesel generators, Variable dead time, Governors. I. INTRODUCTION Remote areas are not frequently connected to a reliable grid supply, so their usual method of electricity generation is the use of diesel generator sets in off-grid configurations. Unfortunately, logistics, safety and environmental concerns impulse the use of electrical energy locally generated using renewable sources, mainly based on the conversion of solar and wind energy, as they are clean, silent and reliable, with low operation costs and small environmental impact. Sunlight and the kinetic energy of the wind are free, inexhaustible, and involve only a small amount of residues or greenhouse gases emissions. Despite these advantages, however, electric power production systems that use as primary sources exclusively solar and wind energy pose technical problems due to uncontrollable wind speed and radiation fluctuations [1,2,3]. As a consequence, the power supply continuity of an off-grid system should be backed-up by other reliable and non-fluctuant sources of primary energy, generally diesel generator sets. Such systems, designed for the decentralized production of electric power using combined sources of primary energy, are called hybrid systems [4, 5]. A typical configuration is shown in Figure 1, based on an off-grid system designed as part of the Open- Gain project and installed in Borj Cedria (Tunisia): see [6] for more details. The three-phase power supply system comprises photovoltaic panels, maybe a wind turbine, a battery bank for voltage regulation, and a small Diesel Generator. A central role in the operation of the system is provided by the control power electronics. The Solar Inverter changes the direct current electricity (DC) from a photovoltaic array into alternating current (AC), which is injected into the main AC bus of the system. The Wind Inverter converts the variable frequency voltage from wind generators into grid- conforming AC voltage. The Bidirectional Battery Inverter functions as inverter or rectifier charger mode. In the inverter mode, it converts direct current (DC) from the battery bank into alternating current (AC) which is injected into the main AC bus of the system. In rectifier charger mode, if the total power generated by the PV generator and the wind turbine exceeds the load needs, it will be used to charge the battery bank. In this system, there are two main operation modes [7]. The first is the island mode, in which the battery inverter defines the operating grid frequency and voltage (The diesel generator might be switched off). In the second operation mode, the diesel generator is the one that defines the frequency and voltage, so the battery inverter acts as a “grid parallel” unit, by synchronizing its output voltage to http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 73 RESD © 2015 http://apc.aast.edu the grid voltage. In both cases, wind and solar inverters operate as “grid parallel” units, without any participation in the voltage or frequency regulation. Fig .1. Off-grid Hybrid Energy Generation frequently carried out in these Micro Grids by small modifications of the grid frequency (for example, by the droop algorithm in [8, 9]). Solar and wind inverters limit their output power based on this grid frequency. In island mode, this is automatically carried out by the battery inverter [10]. In genset mode, only specific diesel generators use the frequency for communications; standard diesel generators supply the voltage and frequency specified in the rating plate, without using a droop factor to operate in parallel with another energy source. Thus, when standard generator sets are connected, the frequency is 50Hz, so solar and wind inverter produce always the maximum available power. When the batteries are fully charged, the battery inverter temporarily increases significantly the grid frequency, to disconnect solar and wind sources from the local grid [11]. This paper focuses on modelling and simulation of the response of the diesel generator for start-up and load disturbances. Models of other components of microgrids have been presented elsewhere (see [12] and references therein). The modelling concentrates on reproducing the dynamic response (especially at start-up). Thus, the models are selected to be precise enough in the time scale of tens of seconds (given by the time dynamics of the loads), but quick enough so that the operation during many months can be evaluated in reasonable time using standard computers. The diesel generator is then assumed to consist of three main components: the diesel engine, the synchronous generator and the excitation system (see Figure 2). Thus, Models of the diesel engine, the diesel engine governor, the synchronous generator, its excitation system, and the automatic voltage regulation (AVR) module are now presented. Synchronous Generator fdE Diesel Engine System sgT r tV Excitation System Fig .2. The overall block diagram of diesel generator II. A MODEL OF DIESEL ENGINE SYSTEM Although detailed models are available to simulate the complete dynamics of a diesel engine, that include thermodynamic aspects, as the focus here is in electricity production as auxiliary system, it is sufficient to use a much lower order model, so thermodynamic variables may be considered to be constant, but unknown. This approach has been adopted in other internal-combustion engine simulation studies, such as in [13]. The general structure of the diesel engine model is then shown in Figure 3. It can be seen that it is assumed to consist of four main sub-models: the controller, the actuator, the engine and the flywheel. The model of each component is now briefly described. mechTi K3 2 2 1 s K  s eK 11  Hs2 1Speed Controller Current Driver Actuator Engine sgT  r  Flywheel u D K ref r  Fig .3. Block diagram of a typical diesel engine system http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 74 RESD © 2015 http://apc.aast.edu A. A Controller Model A “controller” consists of a standard PID speed controller (presented in detail in Section 5), followed by a “current driver” module, represented by a scalar value K3, which depends on the operating point of the system, transforming the control signal into a current sent to the actuator. B. AN Actuator Model The “actuator” block represents the governor (actuator) system of the diesel engine. A governor can be defined as a mechanical or electromechanical device for controlling the speed of an engine automatically by relating the intake of fuel. The input driving current () controls the fuel rack position, which in turn determines the amount of fuel () to be injected into the combustion chamber. The actuator is usually represented by a first order phase lag function, which is characterized by a gain  and a variable time constant (). Here,  is the actuator constant, that is considered to be fixed,  is the actuator time constant, which is a complicated function of the temperature of the fuel. For simplicity, the variation of the parameters is ignored and  is assumed to be constant. C. A Diesel Engine Model The “Engine” block comprises the combustion system of the diesel engine. The injected fuel is ignited by the compressed hot air in the combustion chamber, causing the movement of the piston during the power strokes. This action drives the crankshaft, so the mechanical torque Tmech is produced. For modelling, this engine combustion system is represented as an engine torque constant with a dead time element , which is the result of having several cylinders. For each individual cylinder, this has essentially two components. The “ignition delay” represents the time taken by the fuel-air mixture to reach combustion point at the particular operating temperature and pressure; it can be shown to have a hyperbolic variation with speed deviation. The “power stroke delay” represents the time that elapses from a load disturbance to the time at which a particular engine cylinder responds to the disturbance. This delay is random and depends on the crank angle value at which a load disturbance is imposed. Its effect can be reduced by increasing the number of cylinders. Since for a particular load disturbance, the time after which the cylinders responds goes down inversely with speed, it may be approximated by an inverse function of speed. The engine dead time () is a function of the speed deviation  (pu) through a nonlinear function. An adequate non-linear function to represent the dead time variation is (see Figure 4): 2 2 r C r B r A 1      , (1) where A, B and C are parameters that are determined by curve fitting techniques to reproduce empirically determined curves, such as those in [14]. Fig .4. Typical variation of dead time with engine speed D. A Flywheel Model The “Flywheel” block comprises the rotating system, so it comprises the dynamics of the engine inertia, the flywheel, the damping factor (KD) and the loaded alternator. The mechanical motion of equation is then: r ω D K sg T mech T dt r ωd H   2 (2) r dt d   0  (3) 1 rr  (4) Where time t is in seconds, rotor angle  is in radians, rated generator speed 0 is in rad/s, r is the speed deviation (pu), r is the angular velocity of the rotor (pu),Tsg is the generator torque (pu), H is the per unit inertia constant (s). 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 speed (pu) d e a d t im e ( s ) http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 75 RESD © 2015 http://apc.aast.edu III. A SYNCHRONOUS GENERATOR MODEL The equations of synchronous generator are obtained from Park Transformation, after a per unit representation and some simplifications. The most important simplification is that stator transients are neglected because it is much faster compared to the rotor ones. Considering a salient pole synchronous generator, rotor consists of three windings. A field and a damping winding are considered on the direct axis in order to take into account the transient and subtransient behavior respectively in this axis. Meanwhile, a damping winding is considering on the quadrature axis. The terminal voltage phasor is determined by, Vt=Vd + jVq, that can be evaluated from: qq IXd I s R d E d V  (5) dd IX q I s R q E q V  (6) where Rs is the armature resistance, Iq and Id are the currents flowing in the stator winding, the X”d,q are the so-called subtransient d and q-axis reactances and E”d,q are given by [15]. qI s qo q X q X d E           1 (7)   dq I s do d X d X E s do q E       11 1 (8) where Xd,q and X’d,q are the synchronous and transient reactances, the ’’d,qo are the open circuit subtransient time constants and E’q is given by qfd E s do d X d X d X d X d X d X d X d X E s do d X d X d X d Xq E                                     1 (9) where Efd is the exciter field voltage and ’do is the open circuit transient time constant. As it can be seen in Figure 2, there is an additional feedback term from the generator to the diesel engine given by the electromagnetic torque that in flywheel mode can be evaluated from: q I d I q X d X q I q E d I d E sg T        (7) IV. AN EXCITATION SYSTEM MODEL The main function of an excitation system is to supply and automatically adjust the field current of the synchronous generator considering control and protective functions essential to the satisfactory performance of the system. The control functions include the control of voltage and the enhancement of system stability. The protective functions ensure that the capability limits of the synchronous machine, excitation system, and other equipment are not exceeded. The functional block diagram of a typical excitation control system is shown in Figure 5. tV ~ Self- Excited DC Exciter Synchronous Generator Voltage Controller RV fdE CV rV FV Excitation system stabilizing ciruits F F sT sK 1   t I c jX c R t V ~~  Load compensator tI ~ RsT1 1 C1V Voltage transducer A A sT K 1 MAXRV MINRV Amplifiers Fig .5. Functional Block diagram of a synchronous generator excitation control system [16]  Excitation System Stabilizing Circuits: Excitation systems comprised of elements with significant time delays have poor dynamic performance. Hence, excitation system stabilizing circuits is used to improve the dynamic performance of the control excitation control system. A derivative feedback is the most commonly used form of compensation. The aim of the compensation is to minimize the phase shift introduced by the time delays over a selected frequency range.  Load Compensation: The compensator has adjustable resistance (Rc) and inductive reactance (Xc) that simulate the impedance http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 76 RESD © 2015 http://apc.aast.edu between the generator terminals and the point at which the voltage is being effectively controlled. Using this impedance and the measured armature current, a voltage drop is computed and added to or subtracted from the terminal voltage. The magnitude of the resulting compensated voltage (Vc1), which is fed to the AVR, is given by:   t I c jX c R t V c1 V ~~  (11) This is used to ensure proper sharing of reactive power between generators placed together at their terminals, sharing a common step-up transformer. The compensator functions as a reactive current compensator by creating an artificial coupling between the generators. Without this provision, one of the generators would try to control the terminal voltage slightly higher than the other; hence, one generator would tend to supply all of the required reactive power while the other would absorb reactive power to the extent allowed. When load compensator is not used, Rc and Xc are set to zero.  Voltage transducer: The time constant TR represents rectification and filtering of the synchronous machine terminal voltage. The voltage transducer output (Vc) forms the principal control signal to the excitation system. If a load compensator is not used and Vc is negligible, Vc =Vt.  Amplifiers: Amplifiers may be magnetic, rotating, or electronic type. Magnetic and electronic amplifiers are characterized by a gain and may also include a time constant. A. A Self-Excited Dc Exciter The excitation systems of this category utilize dc generators as source of excitation power and provide current to the rotor of the synchronous machine through slip rings. The self-excited DC exciter is represented in block diagram form as shown in Figure 6. All variables are in per unit.   dt dE TEESEKV fd EfdfdEfdER  (12) There are several mathematical expressions that may be used to approximate the effect of exciter saturation. A commonly used expression is the exponential function   fdEX EB EXfdfdE eAEES  (13) E sT 1 E K   fdEfd ESE R V fdE Fig .6. Block Diagram of a self- excited DC exciter V. A SPEED CONTROLLER The speed controller is designed to keep constant the internal combustion engine speed by changing the quantity of fuel consumed by the motor. The direct result of this speed controller is a stable frequency for the voltage at the generator terminals. A constant frequency requires good precision and a short response time from the speed controller. Detailed models of diesel engines are characterized by nonlinear, time-varying parameters including a nonlinear input dead-time variation that introduces an unknown delay () between the injection of fuel and the production of engine torque. The presence of this dead time together with some other system parameters gives rise to a serious control problem and significantly degrades the performance especially under varying loads. The dead time is an unknown time delay and is commonly considered as a complicated function of operating conditions and the engine speed [17,18]. Conventional PID controllers are widely employed in diesel engine speed control, which gives acceptable performance. However, PID schemes might not be able to handle large variations in the engine dead time. Here, several advanced control techniques for the speed control of the diesel engine systems have http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 77 RESD © 2015 http://apc.aast.edu been reported in the literature, based on the methods of H∞ [19], adaptive control [20] and neural network [21]. VI. AN AUTOMATIC VOLTAGE REGULATOR (AVG) The Automatic voltage regulator (AVG) controls the exciter field to provide a constant terminal voltage. In the past, the generator response using an analog excitation system was a matter of adjusting potentiometers or adding or deleting capacitors and resistors in the control loops of the voltage regulator stability circuit. Adjustment could be very time consuming because changes would often involve turning the excitation system on and off many times in order to make modifications. Today, the digital excitation system provides the means to easily access the challenging parameters of the analog system. The most important point of digital controllers is the embedded microprocessors that perform various control functions for the excitation system. These control functions include the automatic voltage regulator, field current regulator, Var/Power factor control, and a host of excitation limiters to regulate and maintain the generator within safe operating limit of the machine [22]. Conventional PID controllers are employed in digital AVG. VII. A SIMULATION EXAMPLE To show the typical responses of diesel generators, data from the Open-Gain prototype (see Figure 7) have been used. This prototype included a Diesel Generator of 17/20KVA continuous/emergency power (Pramac GBW 22Y), shown in Figure 8. For this installation the parameters are given in Tables 1 to 3. The main issue for off-grid renewable energy installations is the connection/disconnection transient, so some simulation results are presented for this situation in Figures 8 to 10: the engine is assumed to be running at 80% of the nominal speed before connection to the grid, at t=0s. The responses presented in Fig. 8 to 10 correspond to a worst case condition (cold oil), that gave an actuator time constant of 0.198 s and a droop of 5% (for comparison the hot oil time constant is 0.072 s. It can be seen that the simulations reproduce accurately the expected results. Voltage is regulated to the desired output voltage in around 4 seconds, without significant oscillations in torques and speeds. The model was then integrated into the Micro-grid library (see Figure 11), developed in the EcosimPro© language (selected as it simplifies developing multi- domain simulations thanks to the object oriented and non-causal approach). Results using simulations of the complete installation are presented in [12]. Diesel Generator [20KVA] Photovoltaic Modules [185 Wp] SAFETY SUBSYSTEM WIND SUBSYSTEM BACKUP SUBSYSTEM RENEWABLE POWER SUPPLY SYSTEM Battery Bank [30.24kWh] Battery Inverter Wind Inverter Resistance Protection Box Wind Turbine [15KW] Solar Inverter SOLAR SUBSYSTEM Rejected Brine Freshwater Membranes REVERSE OSMOSIS (RO) PLANT Fig .7. Renewable Energy System proposed in the European Project Open Gain Fig .8. Diesel generator Pramac GBW 22 A complete set of parameter values and ranges is given in Table 1 and Table 2. http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 78 RESD © 2015 http://apc.aast.edu Table 1. System parameters of a typical diesel engine [19] Parameter Value Unit Definition K1 1.15 pu Engine torque constant K2 1 pu Actuator torque K3 1 pu Current Driver Torque 2 0.125 s Actuator time constant A,C -0.085 ----- Parameters for delay variation B 0.08 ----- Parameter for delay variation H 1 s Inertia constant KD 0.1 pu Damping Factor Table 2. System parameters of a synchronous generator model E1S13M F/4 provided by Linz Electric. Parameter Value Unit Definition dX 1.57 pu Synchronous d-axis reactances dX  0.21 pu Transient d-axis reactances dX  0.076 pu Subtransient d-axis reactances qX 1.35 pu Synchronous q-axis reactances 0dT 0.4 s Transient d-axis open circuit time constant dT 0.053 s Transient d-axis short circuit time constant 0dT  0.0064 s Subtransient d-axis open circuit time constant g enJ 0.083 Kgm 2 Moment of inertia of Generator Table 3. Data for Self-Excited dc exciter Parameter Value Definition A K 187 Gain amplifiers A T 0.89 Time constant amplifiers E T 1.15 Time constant exciter E X A 0.014 Parameter for exciter saturation function E X B 1.55 Parameter for exciter saturation function F K 0.058 Gain for stabilizing circuits F T 0.62 Time constant for stabilizing circuits B T 0.06 Voltage Regulator C T 0.173 Voltage Regulator R T 0.05 Time constant for Voltage transducer R M A X V 1.7 Amplifier limitation R M IN V -1.7 Amplifier limitation Fig .9. Terminal Voltage Response [V] Fig .10. Engine Speed Response [rad/s] Fig .11. Electromagnetic Torque Response [Nm] Fig .12. Integration of the models into the EcosimPro Microgrids Library [12] http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 79 RESD © 2015 http://apc.aast.edu VIII. CONCLUSION The paper discusses the modeling of diesel generators in order to integrate them in the simulation of off-grid renewable energy systems. As the objective is to develop models to test Energy Management Systems and High-level control systems (such as those discussed in [23] and references therein), a model is developed as simple as possible, but with the precision required by this application. For this transfer-function based models have been developed with static nonlinear terms that take into account the possible variations in gains due to changes in the operating conditions. The final model consists of sub-models of the controllers, the diesel engine, the synchronous generator and the excitation system. It is expected to be capable of simulating a number of different events. Some simple simulation results are presented to show the applicability of the model to the problem at hand. REFERENCES [1] Chaabene, M. and Annabi, M. (1997) Dynamic Model for Predicting Solar Plant Performance and Optimum Control, Energy Vol. 22, No. 6, pp. 567- 578. [2] Chaabene, M. (2008) Measurements Based Dynamic Climate Observer, Science Direct, Solar Energy Vol.82 pp.763–771. [3] Mohandes, M. A., Rehman, S. and Halawani T. O. (1998) A Neural Networks Approach for Wind Speed Prediction, Renewable Energy, Vol. 13, No. 3, pp. 345-354. [4] Deshmukh, M. K. and Deshmukh, S. S. (2008) Modelling of Hybrid Renewable Energy Systems, Renewable and Sustainable Energy Reviews Vol. 12 pp. 235–249. [5] Nfah, E.M. and Ngundam, J.M. (2008) Modelling of Wind/Diesel/Battery Hybrid Power Systems for Far North Cameroon, Energy Conversion and Management Vol. 49 pp.1295–1301. [6] Salazar,J., Tadeo F. and Prada, C. (23th to 25th March, 2010) Renewable Energy for Desalinization Using Reverse Osmosis, International Conference on Renewable Energies and Power Quality (ICREPQ’10), Granada (Spain). [7] Palizban, O., and Kauhaniemi, K. (2015). “Hierarchical Control Structure in Microgrids with Distributed Generation” Island and grid- connected mode. Renewable and Sustainable Energy Reviews, Vol. 44, pp.797-813. [8] Loix,T. De Brabandere, K., Driesen, J. and Belmans, R. (Nov. 5-8, 2007) A Three-Phase Voltage and Frequency Droop Control Scheme for Parallel Inverter . The 33rd Annual Conference of the IEEE Industrial Electronics Society (IECON), Taipei, Taiwan [9] De Brabandere, K., Bolsens, B. J., Den Keybus,V., Woyte, A., Driesen J. and Belmans,R.F. (July 2007) A Voltage and Frequency Droop Control Method for Parallel Inverters, IEEE Transactions on power electronics, Vol. 22, Nº 4. [10] Engler, A. (2005) Applicability of Droops in Low Voltage Grids, International Journal of Distributed Energy Resources. Vol. 1(1), pp. 3- 15. [11] Sunny Island installation and instruction manual, Operation Together with Sunny Boys, Version 2.1, SI5048-12:EE3107, chapter 14, Section 14.1.8, page 116. [12] Salazar, J., Tadeo, F., & de Prada, C. (2014, August). A Micro-grid Library in a General Simulation Language. In IFAC World Congress, Cape Town, South Africa (Vol. 19, No. 1, pp. 3599-3604). [13] Morris, R. L., Hopkins, H. G. and Borcherts, R. H. An Identification Approach to Throttle Torque Modelling, Soc. of Automotive Engrs., paper # 810448. [14] Mina, T. I. A Detailed Study of the Start and Machinery, McGraw Hill. [15] Krause, P. C. (1987) Analysis of Electric Machinery, McGraw Hill. [16] Kundur, P. Power System Stability and Control, McGraw-Hill, Inc. [17] Haddad, S. and Watson, N. (1984) Principles and Performance in Diesel Engineering, Chichester [West Sussex] : Ellis Horwood,. [18] Choe ,Y. W. and Jung, B. G. (1994) An H∞ Controller Design for the Speed Control of Large Size and Low Speed Diesel Engine. Proceedings of the SICE Annual Conference, pp. 747-752. [19] Kuang, B., Wang, Y,and Tan, Y. L. (2000) An http://apc.aast.edu/ Journal of Renewable Energy and Sustainable Development (RESD) June 2015 - ISSN 2356-8569 80 RESD © 2015 http://apc.aast.edu H∞ Controller Design for Diesel Engine System. [20] Roy,S., Malik, O. P. and Hope, G. S. (1991) A Low Order Computer Model for Adaptive Speed Control of Diesel Driven Power-Plants, IEEE Transactions on Energy Conversion, pp. 1636- 1642. [21] Yacoub,Y. (1999) Mean Value Modeling and Control of a Diesel Engine Using Neural Networks, Ph.D. Dissertation, West Virginia University. [22] Richard, S. and Kim, K. (March-April 2001) Excitation Control of the Synchronous Generator, IEEE Industry Applications Magazine, Vol 7, no2, pp. 37-43. [23] Salazar, J., Tadeo, F., and Valverde, L. (2013, November). Predictive Control of a Renewable Energy Microgrid with Operational Cost Optimization. In 39th Annual Conference of the IEEE Industrial Electronics Society, IECON 2013 (pp. 7950-7955). http://apc.aast.edu/