Received: 1 January 2021 Revised: 16 July 2021 Accepted: 10 August 2021 IET Power Electronics DOI: 10.1049/pel2.12184 ORIGINAL RESEARCH PAPER Effects of clock deviations on the performance of microgrids based on virtual synchronous generators Miguel Castilla1Jaume Miret1Luis García de Vicuña1Ramón Guzmán2 Manel Velasco2Pau Martí2 1Electronic Engineering Department, Technical University of Catalonia, Vilanova i la Geltrú, Spain 2Automatic Control Department, Technical University of Catalonia, Vilanova i la Geltrú, Spain Correspondence Miguel Castilla, Electronic Engineering Department, Technical University of Catalonia, Vilanova i la Geltrú, Spain. Email:
[email protected] Funding information Ministry of Science, Innovation and Universities of Spain, Grant/Award Number: RTI2018-100732-B- C22 Abstract An inverter-based microgrid is a small-scale power network governed by a distributed control system. In this system, the nodes are the digital controllers of the power inverters, normally located at separate points within the microgrid. A relevant issue is that these controllers operate at different frequencies due to inherent clock deviations in the local hardware oscillators. This paper evaluates the effects of these clock deviations on the performance of microgrids equipped with inverters that emulate the operation of synchronous machines. A systematic procedure is presented to derive steady-state expressions of the inverter active power and microgrid frequency as a function of clock drift rates. This procedure is applied to swing and governor equations of the virtual synchronous generators, revealing the mechanism that allows clock drifts to be absorbed, making their presence negligible. In addition, it allows recognising the controllers that should never be implemented in a distributed control system, since they cause an unsatisfactory behaviour that can even lead to a blackout in the microgrid. Therefore, the relevance of this study is the identification of the control schemes that are most sensitive to clock drifts, which makes it easier to choose the most suitable control implementation for a particular application. Furthermore, technical guidelines are reported to help researchers on developing control solutions more robust to clock drifts. In this study, the theoretical results are validated by experimental tests in a laboratory microgrid. 1 INTRODUCTION Power inverters are essential elements in microgrids. They are responsible for integrating energy sources by injecting the active and reactive power demanded by the control system. In this mode of operation, the inverters are known as grid-feeding inverters [1]. Conversely, as grid-forming inverters, they are responsible for interfacing storage devices to ensure adequate energy reserved in the system. In addition, in this mode of operation, they participate in the frequency control of the microgrid by collaborating in the power balance between generation and demand [2]. In the literature, there are two families of gridforming inverters: the first one with inverters that base their operation on the droop method and, the second one with inverters that emulate the operation of synchronous machines. Some attempts have been made to find the equivalence between both This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. © 2021 The Authors. IET Power Electronics published by John Wiley & Sons Ltd on behalf of The Institution of Engineering and Technology families with good results for the basic control implementations [3, 4]. Nowadays, the current trends in droop control are the development of distributed approaches for both frequency regulation and economic dispatch [5, 6]. In virtual synchronous generator (VSG) control, an emerging topic is the improvement of system inertia in order to satisfy the frequency transientresponse requirements [7]. These different trends have motivated the development of both families along separate path, giving rise to algorithms with different compensators for droop and VSG control schemes [5–7]. As described above, the control schemes determine the mode of operation of inverters, as grid-feeding or grid-forming. These schemes are programmed in computing devices, mainly digital signal processors (DSP). These devices internally run with control signals synchronized by a crystal-based hardware oscillator. In this situation, clock drifts are unwanted variations in IET Power Electron. 2021;14:2337–2349. wileyonlinelibrary.com/iet-pel 2337
2338 CASTILLA ET AL. FIGURE 1 Control system of a grid-forming inverter the oscillator frequency measured over time [8]. Due to clock drifts, slightly different clock frequencies are noticed in distributed DSPs [8]. Typical clock drift rates for these computing devices are less than about 20 parts per million (ppm) [9]. This small deviation causes different effects in microgrids. In grid-feeding inverters, the effect is negligible since the injected active and reactive powers coincide with their references. Therefore, the power supplied by the energy sources is independent of the clock drifts of the distributed DSPs. The main reason for this desired behaviour is that grid-feeding inverters do not participate in the regulation of the grid frequency [1]. In droopbased grid-forming inverters which interface energy sources, the impact is unequal. In systems equipped with only primary control layers, the droop method provides an accurate frequency and power sharing even in the presence of clock drifts [10, 11]. Conversely, the operation of the microgrid deteriorates in some cases when secondary control layers are activated for the reduction of steady-state errors in voltage and frequency in droop-based inverters. The worst cases identified correspond to inverters that do not use the communication system for secondary control purposes [12]. In particular, large deviations in steady-state power sharing were noticed in this scenario for droop-controlled grid-forming inverters subject to clock drifts, as reported in [13]. A partial solution to this problem, valid only for high-load conditions, was presented in [14]. The study in [13] also revealed that frequency and power sharing was good enough for communication-based secondary control schemes. Focusing on VSG grid-forming inverters, it is worth mentioning that the impact of clock drifts on these inverters has not been studied in the literature. As noted above, the compensators used in the new algorithms of droop and VSG control are clearly different today [5–7]. That is why the impact of clock drifts on droop control (as in [12–14]) and VSG control (as in this paper) should be studied separately. Therefore, the novelty of this paper is the study of the clock drift effects on microgrids equipped with VSG grid-forming inverters. The four contributions of the study are (i) A classification of VSG schemes in three control families according to the response to clock drifts. (ii) A systematic procedure to derive theoretical expressions that characterize the performance of the microgrid in steady-state as a function of the clock drifts. (iii) A framework for identifying the mechanisms that allow clock drifts to be absorbed by control schemes. (iv) A set of technical guidelines to develop robust control schemes to clock drifts. The rest of the paper is organised as follows: Section 2 reviews the control schemes of the VSG inverters according to the compensators used in the swing and governor equations. Section 3models the control schemes as a function of the clock drift rates and derives the steady-state expressions of the active power and frequency. This section includes technical guidelines to develop robust solutions to clock drifts. Section 4validates the theoretical study with experimental results in a laboratory microgrid. Section 5is the conclusion. 2CONTROL SCHEMES OF VSG INVERTERS Figure 1shows the control system of a grid-forming inverter [1]. The subscript iin the variables denotes the number of the VSG inverter, going from 1 to n, being nthe total number of VSG inverters in the microgrid. The system in Figure 1is a cascading combination of external and internal control loops with specific control objectives. External control loops regulate the angular frequency 𝜔iand the amplitude Viof the output voltage of inverter iby sharing the active piand reactive qipowers supplied by the inverter [2, 5]. A virtual impedance Zvi is included in the external control loops to improve both inverter controllability and online limitation of the inverter output current ii[15, 16]. Internal control loops ensure fast tracking of both reference voltage v∗ iand reference current i∗ i with a typical transient response of approximately 100 times faster than external control loops [1]. The reference voltage for the voltage tracking loop v∗ iis generated by the reference angular frequency 𝜔∗ i, reference amplitude V∗ iand the virtual impedance. Finally, the space-vector pulse-width modulator (SVPWM) generates the driving pulses of the inverter switches uifrom the duty cycle signals siprovided by the current tracking loop. Grid-forming inverters operate as synchronous generators when swing and governor equations are implemented in the frequency control block of Figure 1. Typical compensators used in
CASTILLA ET AL.2339 TABLE 1 Compensators in VSG inverters Swing Governor Comm.-based References PP no [17–20] PD no [21, 22] PI no [23, 24] PPI no [25, 26] P LPF(P) no [27–33] P LPF(PD) no [34] P LPF(PI) no [35, 36] D LPF(P) no [37] D LPF(PI) no [38] P C yes [39, 40] these equations are listed in Table 1. In the swing equation, the damping effect in the active power is often emulated using a proportional (P) controller of the frequency error [17–36]. In some studies, a derivative (D) controller is used to accelerate the transient response of the virtual generator [37, 38]. Both P and D compensators introduce a steady-state frequency error when the governor equation is not equipped with an integral compensator [4, 23–26]. In the governor equation, the basic compensators are considered first, including P, D, integral (I), and proportional-integral (PI) [17–26]. The use of a low-pass filter at the output of a P, PD or PI compensator, hereafter referred to as LPF(P), LPF(PD) or LPF(PI), provides a degree of freedom in the design of these controllers and facilitates the achievements of their dynamic specifications [27–38]. All the compensators presented so far use only locally measured signals, which makes VSG inverters operate without communications. However, microgrid performance improves considerably with the exchange of locally measured signals between distributed controllers, as reported in [39, 40]. These last two studies are based on using the consensus (C) compensator in the governor equation, which requires the communication service for control purposes; see Table 1. Table 2shows the swing and governor equations with the particular implementation of each compensator. In these equations, the variables are written as a function of the local time ti.On the one hand, the swing equation is responsible for providing virtual inertia to the inverter by emulating the operation of the synchronous machine. To achieve this end, it calculates the reference angular frequency 𝜔∗ ias the integral of a linear combination of the errors in active power and angular frequency, where P∗ iis the reference active power and pithe active power; see Table 2. The control parameters in these equations are the nominal angular frequency 𝜔0, the inertia factor Jiand the damping factor Di. Note the different role that Diplays in the swing equations. It is a proportional gain in the equation with P compensator while it is a derivative gain in the equation with D compensator. On the other hand, the governor equation provides frequency control by calculating the reference active power that each inverter must supply. In Table 2, the implementation of the compensators P, D, I, PI, LPF(P), LPF(PD), LPF(PI), and C for the governor equation is shown. For these compensators, the control parameters are the proportional kPi , derivative kDi and integral kIi gains of the compensators, the low-pass-filter cut-off frequency 𝜔LPFi and the gain of the C compen-sator kCi .Note that almost all compensators use integral terms, including I, PI, LPF(P), LPF(PD), LPF(PI) and C. In this regard, it is worth mentioning that the LPF(PI) compensator has a double integral, with the output of the frequency error integral as an input to a second integral that provides the value of the reference power; see Table 2. In addition, in the C compensator, the input of the integral term is a combination of two terms: the frequency error and a weighted sum of the reference active powers. This second term is introduced to improve the power sharing between VSG inverters [39, 40]. As indicated in Table 1, the C compensator is the only one that uses control signals received by the communication service. In particular, it receives each P∗ j∕Djsignal at a transmission rate of Tr. In this signal, jcan take the values from 1tonand j≠i. The presented control system has its computing devices located at separate points within the microgrid. The challenge with this control system is the presence of distributed integrals TABLE 2 Compensators for swing and governor equations in VSG inverters Equation Compensator Implementation Swing P 𝜔∗ i(ti)=𝜔 0+1 Ji𝜔0 ∫(P∗ i(ti)−pi(ti)+Di(𝜔0−𝜔 ∗ i(ti)))dti Swing D 𝜔∗ i(ti)=𝜔 0+1 Ji𝜔0 ∫(P∗ i(ti)−pi(ti)+Di d(𝜔0−𝜔∗ i(ti)) dti )dti Governor P P∗ i(ti)=kPi (𝜔0−𝜔 ∗ i(ti)) Governor D P∗ i(ti)=kDi d(𝜔0−𝜔∗ i(ti)) dti Governor I P∗ i(ti)=kIi ∫(𝜔0−𝜔 ∗ i(ti))dti Governor PI P∗ i(ti)=kPi (𝜔0−𝜔 ∗ i(ti)) +kIi ∫(𝜔0−𝜔 ∗ i(ti))dti Governor LPF(P) P∗ i(ti)=𝜔 LPFi ∫(kPi (𝜔0−𝜔 ∗ i(ti)) −P∗ i(ti))dti Governor LPF(PD) P∗ i(ti)=𝜔 LPFi ∫(kPi (𝜔0−𝜔 ∗ i(ti)) +kDi d(𝜔0−𝜔∗ i(ti)) dti −P∗ i(ti))dti Governor LPF(PI) P∗ i(ti)=𝜔 LPFi ∫(kPi (𝜔0−𝜔 ∗ i(ti)) +kIi ∫(𝜔0−𝜔 ∗ i(ti)))dti−P∗ i(ti))dti Governor C P∗ i(ti)=kIi ∫(𝜔0−𝜔 ∗ i(ti)+kCi n ∑ j=1 (P∗ j(ti) Dj −P∗ i(ti) Di ))dti
2340 CASTILLA ET AL. that are calculated locally with computing devices with clock drifts [41]. This problem is analysed and discussed in detail in next section. 3THEORETICAL ANALYSIS The four contributions of this paper are listed at the end of Section 1. All these contributions are presented in this section through a theoretical analysis of the microgrid. 3.1 Model considering a global reference time The analysis is based on considering a global time tfor all the computing devices of the VSG inverters. Each local time can be expressed in terms of the global time as [10] ti=dit,(1) where diis defined as the clock drift rate. Ideally, di=1. However, in practice, small deviations around this ideal value are noticed. In this study, the limits for the DSPs used in the laboratory microgrid are [9] 1−20 ppm <di<1+20 ppm.(2) The assumptions for the analysis are listed below: (i) The frequency control loop forces the inverter to exactly follow the reference angular frequency 𝜔i(ti)=𝜔 ∗ i(ti). In terms of global time, the angular frequency is written as [10] 𝜔i(ti)=2𝜋 Ti =2𝜋 diT=𝜔i(t) di ,(3) where Tiand Tare the periods of the sinusoidal signals (voltages and currents) of inverter iexpressed in local and global times, respectively. Therefore, it is also true that 𝜔∗ i(ti)=𝜔i(t) di .(4) (i) The power balance equation relates the total power generated by the energy sources PG, the total power in the loads PL, the total power losses Ploss and the total power supplied by the storage devices. In this equation, this last term can be written as the contribution of the power supplied by each VSG inverter pi. In this way, the power balance equation is expressed as PG+ n ∑ i=1 pi=PL+Ploss.(5) (ii) The properties of the communication system are ideal, so time delays and packet losses are considered negligible when analysing the effect of clock drifts on microgrid performance. Of course, these properties are important in the analysis of the dynamic response of the microgrid. For instance, excessive time delays in the communication network can lead the system to instability [41–43]. However, as shown below, the impact of clock drifts is identified in the theoretical analysis of the steady-state operation, that is, when all the variables involved remain in their equilibrium point. In this state, the assumption about the communication system presented in this point is valid, as reported previously in [10]and[11]. 3.2 Steady-state active power and frequency Clock drifts move the position of the poles of the closed-loop system almost imperceptibly [12, 13]. Therefore, the impact of clock drifts must be analysed in steady-state operation. A systematic procedure to derive the steady-state expressions of the active power supplied by the VSG inverters Pi,ss and the microgrid frequency 𝜔ss is presented below: (i) Write all the swing and governor equations as a function of the global time tby inserting (1)and(4) in the equations listed in Table 2. (ii) Particularize the above equations for steady state. Note that all VSG inverters operate at the same frequency 𝜔i,ss =𝜔 ss .(6) because the steady-state frequency is a global variable in a power system [2, 5]. (i) In steady state, the input of the integral term of a wellregulated system is 0 [44]. Apply this principle to the steadystate swing and governor equations obtained in the previous step. Following this principle, two set of equations as a function of P∗ i,ss,P∗ j,ss and 𝜔ss are obtained Pi,ss =fswi (P∗ i,ss,𝜔 ss),(7) P∗ i,ss =fgov (P∗ j,ss,𝜔 ss),(8) where fswi and fgov denote swing and governor equations, respectively. In other words, the steady-state values of the active power Pi,ss and its reference P∗ i,ss rely on the microgrid frequency 𝜔ss and the reference power of the other inverters P∗ j,ss.Aspecial situation is observed in the governor equations using I and PI compensators. In these equations, the input of the integral term is the frequency error only; see Table 2. The same is true for the inner integral of the governor equation with the LPF(PI) compensator. In these three cases, the input of the integral term cannot be 0 in steady-state since the left-side of (9)
CASTILLA ET AL.2341 TABLE 3 Steady-state microgrid angular frequency Family Swing Governor Steady-state angular frequency 𝝎ss 1 1 1 1 1 P P P P D P D LPF(P) LPF(PD) LPF(P) (𝜔0 n ∑ j=1 (Dj+kPj )−PL−Ploss +PG)∕ n ∑ j=1(Dj+kPj dj) 2 2 2 2 P P P D I PI LPF(PI) LPF(PI) 𝜔0 n ∑ j=1 (kIjdj)∕ n ∑ j=1 (kIj) 3PC 𝜔0 n ∑ j=1(1 kCj )∕ n ∑ j=1(1 kCjdj) TABLE 4 Steady-state active power supplied by the VSG inverters as a function of the clock drift rates Family Steady-state active power P i,ss 1(PL+Ploss −PG)∕ n ∑ j=1((Dj+kPj Di+kPi )(di dj))+ 𝜔0(Di+kPi )(1− n ∑ j=1 (Dj+kPj )∕ n ∑ j=1 (Dj+kPj dj )) 2(PL+Ploss −PG)∕ n ∑ j=1(kIj kIi )+𝜔 0(di− n ∑ j=1 (kIjdj)∕ n ∑ j=1 (kIj))(Di+kPi +dikIi t di) 3(PL+Ploss −PG)∕ n ∑ j=1(Dj Di)+ 𝜔0Di nkCi (1− n ∑ j=1(nkCi kCjdi)∕ n ∑ j=1(1 kCjdj)(1+1 nkCi − n ∑ j=1(Dj dj)∕ n ∑ j=1(Dj di))) cannot be 0 simultaneously for all DSPs. The reason of this is that, in practice, the clock drift rates are different (d1≠d2≠ ⋯≠dn) 𝜔0−𝜔ss di ≠0.(9) Note that (9) is obtained by inserting (4)and(6) in the integral term of the compensators in Table 2with frequency error only; see the governor equations with I, PI and LPF(PI) compensators. Consequently, the output of these integral terms increase or decrease continuously over time depending on the sign of 𝜔0−𝜔 ss∕di kIi ∫(𝜔0−𝜔ss di)dt =kIi (𝜔0−𝜔ss di)t.(10) This situation is not repeated in the rest of governor equations with integral terms, that is, compensators LPF(P), LPF(PD) and C. In these three cases, the input of the integral is a linear combination of the frequency error and another term that depends on the reference power; see Table 2. This second term absorbs the impact of clock drifts, giving a very small error in active power, as will be seen in the next subsection. For this reason, the active power is properly regulated with LPF(P), LPF(PD) and C compensators, even though they use distributed integral terms. In other words, these compensators prevent the continuous increase or decrease of the active power over time produced by clock drifts. (i) Particularize the power balance equation for steady state PG+ n ∑ j=1 Pi,ss =PL+Ploss.(11) (ii) Solve the system of Equations (7), (8)and(11) for Pi,ss and 𝜔ss. Tables 3and 4show the results of applying this procedure to the VSG control schemes listed in Table 2. 4DISCUSSION From the above analysis, VSG control schemes are classified in three families, which are defined in the left column of Table 3. The control schemes of each family share the same expressions of frequency and active power in steady state, as shown in Tables 3and 4. Therefore, the elements of each family have a common response to clock drifts. Below is a discussion of the impact of clock drifts on these families. As shown in Table 3, in family 1, the microgrid frequency deviates from the nominal value depending on the power
2342 CASTILLA ET AL. TABLE 5 Steady-state active power for di=1 Family Steady-state active power P i,ss 1(PL+Ploss −PG)∕ n ∑ j=1(Dj+kPj Di+kPi ) 2(PL+Ploss −PG)∕ n ∑ j=1(kIj kIi ) 3(PL+Ploss −PG)∕ n ∑ j=1(Dj Di) balance. The compensators of this family produce this deviation, because they are not based on integral terms of the frequency error; see Table 2. In this family, the deviation is insignificant only when generation and consumption coincide, that is, PG=PL+Ploss. This condition is only possible in generators with a load following control strategy [45]. In microgrids with energy storage devices, this strategy is not advantageous and, therefore, this situation is not considered in this study. Consequently, notable frequency deviations are normally expected in family 1 when generation is higher than consumption or vice versa. However, in families 2 and 3, the frequency is independent of power balance, as shown in Table 3. This is because the compensators in these families use integral terms of the frequency error. Active power has two terms in all families; see Table 4.The term on the left depends on the power balance, as expected for the correct distribution of power among grid-forming inverters. The term on the right is an offset produced by clock drifts. In fact, this offset disappears in the ideal situation where di=1, for i=1,…,n. Table 5shows the steady-state active power in this situation. In this case, the only difference between families is that power sharing depends on different control parameters. This is not an important issue because the design of these parameters can be done in such a way that the same behaviour is achieved in the three families. Returning to the discussion of the offset term in the active power, it is worth mentioning that in families 1 and 3 this term is negligible. In other words, the expressions in Tables 4and 5 for families 1 and 3 nearly coincide. This point can be easily verified with a numerical example using the data presented in next section for the laboratory microgrid. However, for family 2, the offset is directly dependent on time through the term (see Table 4) 𝜔0(di− n ∑ j=1(kIjdj)∕ n ∑ j=1(kIj))kIit=𝜔 0eikIit,(12) where eiis an error defined between the clock drift rate diand an averaged term that takes into account the clock drift rate of all DSPs and the integral gains of the governor equations. The expression in (12) causes the active power to increase (if eiis positive) or decrease (if eiis negative) continuously, being the dominant term of the active power injected by the inverters belonging to family 2. From a practical point of view, this behaviour will inevitably lead to the shutdown of the inverters when they reach the limit for the maximum power, probably causing a blackout in the microgrid. Consequently, the control schemes of family 2 cannot be used in this application. It is worth mentioning that this practical problem was not previously reported in the operation of VSG inverters in microgrids. 4.1 Technical guidelines to develop robust control schemes to clock drifts Distributed integrals calculated using local DSPs can cause performance problems in networked control systems. This a common phenomenon formulated in a general framework in [44]. In microgrids, problems in droop-based grid-forming inverters arise in frequency regulation when the input of the distributed integrals is only based on the frequency error [12–14]. This phenomenon is observed again in this paper in the study of VSG grid-forming inverters; see the compensators I, PI and LPF(PI) in Table 2. Several state-of-the-art control schemes alleviate this problem. The easiest way to do this is by using a low-pass filter, as in LPF(P) and LPF(PD) compensators. These implementations include the reference active power as an additional input to the integral, which absorbs the deviations caused by the clock drifts. A more sophisticated solution is the communication-based C compensator that uses the reference active power of the other inverters to compensate for practical differences between them. Current research on VSG inverters focuses on improving the inertia of microgrids. New control schemes are needed to meet stringent transient response specifications. In this scenario, robustness is achieved by implementing distributed integrals with a combination of input terms that includes the frequency error and other terms responsible for absorbing the effects of clock drifts. The choice of these additional terms will mark the performance of the distributed control system. This study can be a guide for the synthesis of these new control schemes. 5EXPERIMENTAL VALIDATION The theoretical results of this study can be summarised as (i) The active powers of VSG inverters with control schemes classified in family 2 diverge over time. (ii) The active powers of VSG inverters with control schemes classified in families 1 and 3 coincide in steady state. In this section, these results are experimentally validated with tests conducted in a laboratory microgrid. 5.1 Laboratory microgrid Figure 2shows the diagram of the laboratory microgrid. The grid-forming converters are represented as voltage sources and are connected to nodes 1 and 2 through a transformer. In these converters, the primary source is a DC source (Amrel, SPS800- 19), which emulates the battery banks BAT1 and BAT2. The
CASTILLA ET AL.2343 FIGURE 2 Diagram of the laboratory microgrid (the colour of each element identifies its experimental waveforms in Figures 4–8) grid-feeding converters are represented as current sources and are connected to nodes 3, 4 and 5 also through a transformer. These converters were programmed to imitate the operation of wind (WIND1 and WIND2) and photovoltaic (PV) generators. Two loads are connected to nodes 6 and 7. The described setup is suitable for evaluating the impact of clock drifts in inverterbased microgrids [10–12]. The clock drift problem occurs in the distributed DSPs that control each of the five inverters considered. Primary sources can be emulated as in this setup or using real wind and PV sources, but in no case will they have an effect on the operation of the DSPs. Therefore, clock drift effects on microgrid response are independent of the nature of the primary sources. Figure 3shows two photos with the complete microgrid setup and a detailed view of some components. The inverters were built with three-phase IGBT full-bridge configurations (Guasch, MTL-CBI0060F12IXHF); see blue boxes in Figure 3. Each inverter was controlled with a dual-core DSP, which is formed by a C28 control processor and a M3 communication processor (TI, Concerto F28M36P63C); see the vertical green card on the left side of Figure 3b. For control purposes, the communication among M3 processors was done through an Ethernet link with User Datagram Protocol (UDP)/Internet Protocol (IP). For monitoring purposes, the communication of the M3 processors with the supervisory personal computer was performed with Transmission Control Protocol (TCP)/IP. 5.2 Details on the control implementation The control system in Figure 1was programmed in the C28 processors of the grid-forming inverters. The frequency control was implemented with the swing and governor equations shown FIGURE 3 Photo of the laboratory microgrid. (a) Complete setup, (b) detail of one DSP, sensing board, and inverter in Table 2. The voltage control is based on generating the reference voltage amplitude as follows [20] V∗ i(ti)=V0+kVi ∫(−qi(ti)+Ei(V0−Vi(ti)))dti,(13) where Viis the amplitude of the inverter output voltage and V0its nominal value, qithe reactive power supplied by the inverter, Eithe damping factor of the reactive power, and kVi the gain of the integral compensator. Note that (13)is
2344 CASTILLA ET AL. TABLE 6 Nominal values of the microgrid components Symbol Quantity Nominal value V0Phase-to-neutral voltage 155 V (peak) 𝜔0Angular frequency 2π60 rad/s VDC DC voltage at battery side 400 V Z1Impedance of transformer T10.50 +j0.38Ω Z2Impedance of transformer T21.95 +j0.68Ω Z3,Z4,Z5Impedance of transformers T3,T4and T51.13 +j0.23Ω Z16,Z35,Z47 Impedance of lines L16,L35 and L47 0.04 +j0.75Ω Z25,Z34,Z36 Impedance of lines L25,L34 and L36 0.02 +j0.30Ω TsSampling and switching period 100 μs TrTransmission period 100 ms J1,J2Inertia of swing equation 0.27 Ws/(rad/s)2 D1,D2Damping of swing equation 500 W/(rad/s) kP1,kP2Proportional gain of governor equation 1000 W/(rad/s) kI1,kI2Integral gain of governor equation 50 W/rad 𝜔LPF 1,𝜔 LPF 2Low-pass-filter cut-off frequency of governor equation 2π1.2 rad/s kC1,kC2Consensus gain of governor equation 50 E1,E2Damping of voltage equation 100 A kV1,kV2Integral gain of voltage equation 0.2 (As)-1 Zv1,Zv2Virtual impedance j 3.77 Ω similar to the swing equation with P compensator shown in Table 2, but in the voltage/reactive-power channel instead of the frequency/active-power channel. The reference voltage in Figure 1was generated as [15] v∗ i(ti)=V∗ i(ti)sin (𝜔∗ i(ti)ti)−Zvi ii(ti),(14) where Zvi =𝜔 iLvi is the virtual impedance and Lvi is the virtual inductance. With the presented control schemes for frequency and voltage control, a dominant inductive impedance is needed to ensure controllability, which is achieved by the proper design of the virtual inductance Lvi [16]. The internal control loops in Figure 1were programmed in stationary reference frame with proportional-resonant (PR) compensators. This choice is based on the excellent voltage and current tracking properties of these compensators for reference sinusoidal signals operating at fundamental frequency [1]. In grid-feeding inverters, the current tracking loop was also programmed in stationary reference frame using PR compensators. The reference current for this loop was calculated as [1] i∗ i(ti)=P∗ i(ti) Vi(ti)vi(ti),(15) where viis the output voltage and Viits amplitude. In (15), the reference power P∗ i(ti) is particularized for the wind and PV generators included in Figure 2as P∗ WIND1,P∗ WIND2,andP∗ PV , respectively. TABLE 7 Clock drift rates of DSPs for VSG inverters DSPs d1d2 Pair 1 1 −12.7 ppm 1 +15.2 ppm Pair 2 1 −12.7 ppm 1 +11.3 ppm Pair 3 1 −12.7 ppm 1 +6.6 ppm Pair 4 1 −12.7 ppm 1 +0.9 ppm 5.3 Values of the microgrid components Table 6lists the nominal values of the microgrid components, including microgrid voltage and frequency, DC voltage at battery side, parasitic elements of transformers and power lines, sampling, switching and transmission periods, and control parameters of grid-forming inverters (with subscripts 1 and 2). The experimental results presented in the next sections were obtained using several pairs of DSPs. These pairs were formed by always keeping the same DSP for inverter 1 and changing the DSP device for inverter 2. In this way, a rich set of practical experiences was achieved due to the different clock drift rates for DSP2. 5.4 Measurement of clock drift rates Table 7lists the clock drift rates measured for the four pairs of DSPs considered. The test performed to measure these drift rates is described below.