A Novel Control Strategy for the Frequency and Voltage Regulation of Distribution Grids Using Electric Vehicle Batteries

: In this study, a double-loop control strategy is proposed for power grid frequency and voltage regulation using plug-in electric vehicles (PEVs) connected to the grid through a three-level capacitor clamped inverter. The frequency and voltage regulation problem is ﬁrst formulated using vector space analysis and phasor diagrams to ﬁnd the boundaries and constraints in terms of the system parameters. The derived formulas are then utilized to design a double-loop controller using an exclusive phase detector control loop and a novel pulse width modulation (PWM) scheme to effectively regulate the frequency and voltage of the grid. The effectiveness and feasibility of the proposed control strategy are evaluated through simulation and experimental studies. This approach can beneﬁt both the customers and the grid operator, as it facilitates utilizing the batteries of the connected PEVs to supply a portion or all of the active and reactive power demand, hence regulating the frequency and voltage of the grid. The extent to which active and reactive power can be supplied depends on the number of PEVs connected to the local grid.


Introduction
Plug-in electric vehicles (PEVs) provide a promising solution to the worldwide concern about environmental pollution [1]. However, the increasing penetration of PEVs into a distribution power network creates several challenges, such as negative impacts on the distribution power grid's components, including transformers, cables, circuit breakers, and fuses [2,3], as well as the deteriorating voltage profile [4] and increasing harmonics and power losses of the grid [5][6][7][8]. Therefore, the possibility of utilizing PEVs to provide ancillary services to the distribution power grid in managing active and reactive power has been broadly investigated in both industry and academia [9][10][11][12].
Battery chargers play a critical role in integrating PEVs into the distribution grid and can also help in reducing the negative impacts of large-scale PEV penetration by controlling the direction and amount of power flow to and from PEV batteries. Grid-to-vehicle (G2V) and vehicle-to-grid (V2G) technologies were proposed as a reciprocal effective solution to both PEV owners and the grid operator. The excess power supplied from the grid can be stored in the PEVs batteries during off-peak hours in G2V mode. PEVs can sell the power back to the grid during discharging period in the V2G mode of operation [13]. Regulating the grid's voltage and frequency profile and, hence, balancing active and reactive power between the grid generation and demand is achievable by utilizing the energy stored in PEV batteries in such a way that they should inject the active/reactive power to the power grid on some buses in the V2G mode of operation and/or absorb active/reactive power on some other buses in G2V mode.
Frequency regulation and active power compensation using PEV battery storage may not be favorable to the PEV manufacturers and owners due to battery degradation and its warranty issues during continuous charging and discharging cycles [14]. However, voltage regulation and reactive power compensation using PEVs is beneficial for the grid's operation in terms of maintaining the stability of the grid and delivering the required reactive power for residential customers who do not pay for it. This will, in turn, help the grid avoid high reactive power losses through long-distance transmission lines due to remote VAR compensators. Furthermore, reactive power compensation is also advantageous for the PEV owners, if supported by utility incentives, with no major impact on the battery's life and its state of charge (SOC) [15][16][17][18].
PEV battery chargers are essentially bidirectional-power electronic inverters/converters interfaced between the battery and the grid [19][20][21][22], and play a vital role in controlling the direction and amount of power flow between the grid and the battery. Many topologies and technical analyses suitable for PEV chargers have been presented in the literature [23][24][25][26][27][28][29]. Compared to conventional inverters, multilevel inverters (MLIs) offer several attractive features for electric vehicle application despite their high component count, size, and cost, as summarized in Table 1. Among all MLI topologies [30][31][32][33], multi-level capacitor clamped inverters are the most commonly utilized power electronic interface due to their better power quality, higher efficiency, and no need for multiple DC voltage sources [34,35]. Furthermore, the capacitors in the capacitor clamped inverter are able to filter sudden changes in battery current, which provides better protection for the battery and increases the battery's life range [36]. In this paper, a novel double-loop controller is proposed for compensating the active and reactive power of the load, hence regulating the frequency and voltage profile of the grid. Both active and reactive power compensation modes are comprehensively formulated using vector space analysis and phasor diagrams for different nonlinear loads including inductive, capacitive, and resistive loads. Without the loss of generality and to make the analysis and simulation/experimental studies less complex, it is assumed that there are enough PEVs connected to the grid to compensate for the load's required active and/or reactive power. If this is not the case, the difference between the demand and the capacity of the connected PEV batteries shall be supplied by the grid. The required switching signals for a three-level capacitor clamped inverter are generated by the proposed PWM controller, which uses a unique reference selection technique to compensate for the load's active and reactive power requirement. Simulation studies are conducted using the PSIM software v12.0.4 to evaluate the performance of the proposed compensation strategy. Furthermore, to validate the feasibility of the proposed control strategy, the controller is implemented on an industrial control card interfaced with the power stage implemented on a hardware-inthe-loop (HIL) emulator. The simulation and experimental results showcase the voltage and current waveforms of the grid and inverter's filter, which highlights different characteristics and aspects of the proposed control strategy.
Among the advantages of the method proposed in this paper are: (i) enhanced performance in a wide range of operations, (ii) simplicity of the control structure and hence higher reliability, (iii) ease of implementation in industry using phase-locked loop and PI controllers, and (iv) less computational burden making it suitable for real-time applications.
The rest of this paper is organized as follows. The operating principle of the utilized MLI along with the mathematical analysis and formulation of the proposed system is presented in Section 2. In Section 3, a double-loop controller is proposed using an exclusive phase detector control loop and a novel multi-reference PWM strategy. Simulation and experimental results are provided in Section 4 to evaluate the effectiveness and feasibility of the proposed control strategy in both active and reactive compensation modes. Finally, conclusions are drawn from the simulation and experimental studies and discussed in Section 5.

Operating Principle of the Multi-Level Inverter in Active and Reactive Power Compensation Modes
The schematic of the proposed active and reactive power compensation strategy utilizing PEV battery is illustrated in Figure 1. The PEV battery pack is connected to the grid through a three-level capacitor clamped inverter, as shown in Figure 2. The AC grid is conventionally responsible for delivering the required active and reactive power to the load. However, in the proposed strategy, the controller specifies the direction and amount of active/reactive power delivered to the load by controlling the amplitude and phase angle of the inverter output voltage, as illustrated in Figure 1. It is assumed that connected PEVs into the grid cannot provide both active and reactive power simultaneously. Therefore, in such a design, the AC grid will supply active power if the MLI compensates reactive power and vice versa.  All possible switching arrangements and the corresponding output voltage levels are summarized in Table 2. In this table, the "on" and "off" situations for each switch are represented by 1 and 0, respectively. Depending on the four switching arrangements, which are listed in Table 2, there are three voltage levels of ±E bat /2 and 0 for the inverter's output voltage-i.e., V inv . When switches Q 1 and Q 2 are on, switches Q 3 and Q 4 are off. In this case, V inv will be the voltage across capacitor C 1 , which is equal to E bat /2. Similarly, when Q 3 and Q 4 are turned on, Q 1 and Q 2 are switched off. In this switching arrangement, the voltage of inverter V inv will be the voltage across capacitor C 2 , which is equal to −E bat /2. Finally, the output voltage level of the inverter would be zero in two switching arrangements when Q 1 and Q 3 are on and Q 2 and Q 4 are off or vice versa. In these two cases, V inv will be equal to the sum of voltages across capacitors C 1 and C 3 or C 2 and C 3 , which is zero in both cases. It should be noted that in this methodology, switches Q 1 and Q 4 should not be on or off at the same time. Similarly, switches Q 2 and Q 3 cannot be on or off simultaneously. Therefore, the proposed controller, presented in the next section, needs to control only two switches and the other two are switched on and off accordingly.

Reactive Power Compensation for Inductive and Capacitive Loads
The schematic of the utilized strategy, shown in Figure 1, can be simplified as Figure 3 in reactive power compensation mode. In this figure, I L , I Q load , and I P load represent the magnitude of the inductor's current, the imaginary part of the load current, and the real part of the load current, respectively. Additionally, Y l , B l , and G l are the load admittance, the imaginary part (susceptance) of the load, and the real part (conductance) of the load, respectively. Moreover, the load's admittance phase angle is denoted by α l . As it is illustrated in Figure 3, I Q load is supplied by the PEV battery through the inverter and I P load is drawn from the AC grid. In other words, the required reactive power is supplied through the inverter and the AC grid is in charge of delivering any needed active power. Therefore, the magnitude of the inverter's filter current, I L , and the imaginary part of the load's current, I Q load , should be equal-i.e., I L = I Q load . Additionally, considering Figure 3, the magnitude of the imaginary part of the load current, I Q load , can be found as: where V G is the magnitude of the load's voltage-i.e., |V G (t)| = V G . The output voltage of the inverter's filter, V G , should have a 90 degree phase difference with the inductor current, I L , for the reactive power compensation, assuming that all the reactive power is supplied by the PEV battery through MLI, as illustrated in the vector space shown in Figure 4. Considering an inductive load in Figure 3, substituting I Q load from (1), and applying Kirchhoff's circuit laws, we have: where L inv and V inv are the inverter's filter inductance and the magnitude of its voltage, respectively. Additionally, L load = 1/B l represents the inductance of the load.  Considering different switch arrangements summarized in Table 2, it is evident that V inv < E bat /2. Therefore, we have: where E bat represents the voltage level of PEV's battery storage. We know the reactive power of an inductive load, Q load , which is given by: Using (3) and performing some algebraic manipulations, the maximum boundary of the reactive power that can be compensated by the PEV battery is obtained in terms of circuit components, grid frequency, and load parameters as follows: where ω represents the frequency of the AC grid in rad/s. Similarly, for a capacitive load, we have: where C load is the capacitance of the load. Again, knowing V inv < E bat /2, we have: Knowing the reactive power of a capacitive load, Q load , is given by: using (7), and performing some algebraic manipulations, the maximum boundary of the reactive power for a capacitive load can be similarly obtained as follows: Equations (5) and (9) can be combined as: where X inv = ωL inv and X load = ωL load for inductive load or X load = 1/(ωC load ) for capacitive load.

Active Power Compensation for Resistive Load
The circuit model of active power compensation mode is shown in Figure 5. As illustrated in this figure, I P load is supplied by the PEV battery through the inverter and I Q load is drawn from the AC grid. In other words, in this mode, the MLI delivers all the required active power to the load and there is no reactive power exchange between the MLI and the load. To guarantee that the inverter provides the active power required by the load, the vectors V G and I L should have the same phase difference as shown in Figure 6.  Similar to the reactive power compensation mode, and assuming that all the active power demand by the load is only supplied by the PEV's batteries through the inverter, the magnitude of inverter's filter current, I L , and the real part of the load current, I P load , should be equal-i.e., I L = I P load -which can be found based on the load's real power demand, P load , as: Additionally, considering Figure 5, the magnitude of the real part of the load current, I P load , can be found as: Knowing that in active mode compensation I L = I P load and using (12), the magnitude of the voltage across inverter's filter inductor, V L , can be found as: Considering a resistive load in Figure 5, substituting I P load from (12) and V L from (13), and applying Kirchhoff's circuit laws, we have: where R load = 1/G l represents the resistance of the load. Considering V inv < E bat /2, we have: Knowing the active power of a resistive load, Q load , given by: Using (15) and performing some algebraic manipulations, the maximum boundary of the active power that can be compensated by the PEV battery is derived as follows: This can be rewritten as: For an RLC load, where both active and reactive power are needed, the reference angle can be justified to control the share between the AC grid and inverter for active and reactive power balance.

Proposed Double-Loop Control Strategy
The controller's goal is to compensate active and reactive power by deriving boundaries in order to control the switches of the MLI. As shown in Figure 7, the proposed controller is divided into two separate active and reactive modes of operation.
In the reactive power compensation mode, first the phase difference between the voltage and the AC grid current is detected by the controller. The controller then maintains this phase angle at the desired value of φ re f , which is defined based on the shared amount of reactive power between the AC grid and the PEV's battery. In the worst case scenario, when the load is forced to draw all the required reactive power from the PEV's battery through MLI, φ re f is set to zero. To ensure the load's required reactive power is supplied by the inverter, the controller maintains the required magnitude of V inv by calculating the desired duty cycle of PWM control signals. Furthermore, a PI block is utilized to ensure that the desired phase angle, φ re f , is tightly followed. In the active power compensation mode, the controller's set point is the desired active power supplied by the inverter, denoted as P re f in Figure 7. To entirely supply the load's active power by the PEV battery through the three-level capacitor clamped inverter, the desired active power P re f is set to the same value of the load's active power-i.e., P load = P re f . The magnitude of inductor current, I L , is then calculated using (11) based on the desired active power P re f and measured value of the load's voltage magnitude, V G , as: Calculating I L from (19) and measuring the angle of the load voltage, ∠V G , the value of V inv can then be found using (14), which is in turn used to create the required duty cycle for PWM control signals.
To create the required control signals in both active and reactive power compensation modes based on the switching arrangements listed in Table 2, a novel PWM technique is proposed in this work as illustrated in Figure 8. As shown in this figure, three reference sawtooth waveforms are utilized and compared with the sinusoidal reference voltage of V inv whose magnitude or angle is calculated based on the desired angle (in reactive mode) or desired active power (in active mode) as the controller's setpoints. Depending on the value of sinusoidal reference waveform compared to each sawtooth waveform at each time instance, four different regions, denoted as regions 1 to 4 in Figure 8, are defined. If the value of the sinusoidal reference waveform is higher than all three sawtooth waveforms, the circuit is operated in region 1 where both switches Q 1 and Q 2 are turned on, hence, Q 3 and Q 4 remain off. Similarly, when the value of the sinusoidal reference waveform is lower than all three sawtooth waveforms, the circuit is operated in region 4 where both switches Q 1 and Q 2 remain off and consequently Q 3 and Q 4 are turned on. Finally, if the value of the sinusoidal reference waveform falls in region 2 or 3, only one of the switches Q 1 and Q 2 is turned on while the other one remains off. Similarly, in region 2 or 3, only one of the switches Q 3 and Q 4 is turned on while the other one remains off. Table 3 summarizes the switching arrangements in each defined region based on the proposed PWM technique. In this table, "1" and "0" specify the on and off status of the switch, respectively. Since switches Q 1 and Q 4 should not be on or off at the same time, no separate control signal is needed for switch Q 4 and its gate signal would be complimentary to the PWM control signal for Q 1 . Similarly, since switches Q 2 and Q 3 cannot be on or off simultaneously, switch Q 3 does not need a separate control signal.

Simulation and Experimental Results
The proposed system is designed and simulated using PSIM sotware. The voltage amplitude and frequency of the AC grid are considered to be 230 Vrms and 60 Hz, respectively. Additionally, a lithium-ion battery pack with a nominal voltage of 700 V is utilized as the PEV's battery. All the three capacitors of the utilized three-level capacitor clamped inverter, denoted as C 1 , C 2 , and C 3 in Figure 2, are considered to be identical with the capacitance of 220 mF. The switching frequency of the PWM control signals in both active and reactive power compensation modes is chosen to be 10 kHz. These values along with all other values of the simulation parameters are summarized in Table 4.
To evaluate the ability and effectiveness of the proposed strategy in both active and reactive power compensation modes, simulation studies are conducted using an inductive load (RL load) of R load = 13.23 Ω and L load = 70 mH which requires an active power of P load = 2 kW and reactive power of Q load = 1 kVar. In active mode compensation, the controller's set-point, P re f , is set to 2 kW as shown in Figure 7. The magnitude of the voltage across inverter's filter inductor, V L , and its current, I L , are then calculated based on the desired load's active power using (11) and (13).

Parameter Value
Inductor, L inv 27 mH MLI capacitors, C 1 , C 2 and C 3 220 mF AC grid voltage, V S 230 Vrms AC grid frequency, f S 60 Hz PWM switching frequency, f PW M 10 kHz Battery voltage, E bat 700 V Figure 9a shows the current and voltage at the output of the inverter and Figure 9b illustrates the voltage and current of the AC grid after utilizing the proposed control strategy in active power compensation mode. From Figure 9a, it is evident that the load's required active power of P load = 2 kW is supplied by the inverter as its output current and voltage are in the same phase. Additionally, Figure 9b shows that there is a 90 • phase difference between the voltage and current of AC grid in this mode indicating AC grid solely delivers the load's required reactive power of of Q load = 1 kVar.
Similarly, Figure 10a illustrates the current and voltage at the output of the inverter and Figure 10b shows the voltage and current of AC grid after utilizing the proposed controller in reactive power compensation mode. Considering Figure 10a, it is evident that there is 90 degrees phase difference between the inverter's output current and voltage validating that the inverter is supplying only the reactive power of the load. It can be seen from Figure 10b that the current and voltage of AC grid are in the same phase, hence, the active power is solely delivered by the AC source in this mode.  Therefore, the simulation results shown in Figures 9 and 10 validate the effectiveness and functionality of the proposed controller along with the novel switching scheme in both active and reactive power compensation modes. It should be noted that the provided results are selected for the scenarios where either active or reactive power of the load is fully supplied through PEV's inverter and are considered as extreme cases. By changing the set-point of the active and reactive control loops, one can compensate the active/reactive power of the load using a combination of PEVs and AC grid.
To experimentally evaluate the performance and feasibility of the proposed control strategy, the PSIM simulation prototype is utilized to implement the proposed controller on an industrial control card, TI TMS320F28335, manufactured by the Texas Instruments, Dallas, TX, USA.The control card communicates in real-time with the power stage implemented on Typhoon HIL 602 setup through its analog/digital input/output channels (IOs) as shown in Figure 11. The input voltage and current waveforms, shown on the oscilloscope screen, are captured and drawn in MATLAB 2019b for clarity. Figure 12a shows the experimental results for inverter's output voltage and current, and Figure 12b presents the experimental results for AC grid's voltage and current both in active power compensation mode. Similarly, Figure 12c illustrates the experimental results for inverter's output voltage and current, and Figure 12d presents the experimental results for AC grid's voltage and current in reactive power compensation mode. Comparing the simulation results shown in Figures 9 and 10 with the experimental results illustrated in Figure 12, it is evident that the experimental results are in great agreement with the simulation results despite some spikes in the waveforms caused by the latency of HIL setup and sampling frequency of the industrial control card. These results validate the feasibility of the proposed control strategy along with the novel switching scheme. From these figures, it is also evident that the controller can be implemented on an industrial control card and it successfully provides the objectives of supplying the required active or reactive power of the load either through inverter or AC grid. Based on the experimental results, our control system facilitates various operating conditions including two extreme cases: (i) the PEV batteries supplying all of the active power required for the loads and no reactive power, (ii) the PEV batteries supplying all of the reactive power required for the loads and no active power, and any cases that falls within (i) and (ii). In the event that the demand is larger than the capacity of PEV batteries, the active and reactive setpoints in Figure 7 can be adjusted such that the limits of PEV batteries are not violated. The deficit power, shall be supplied by the grid. It should be noted that this is only due to the capacity limitation of PEV batteries and does not deteriorate or restrict the performance of the proposed control strategy.

Conclusions
In this paper, the analytical model of an active and reactive power compensation strategy utilizing a PEV battery was derived using vector space analysis for different inductive, capacitive, and resistive loads. The derived model was then utilized to propose and design a novel double-loop controller using an exclusive phase detector control loop and a novel multi-reference PWM strategy. The simulation and experimental results validated the effectiveness and feasibility of the proposed control strategy in both active and reactive power compensation, hence regulating the grid's frequency and voltage. The proposed approach facilitates the frequency and voltage regulation of the power grid by utilizing the batteries of the connected PEVs to supply a portion or all of the active and reactive power demand. This can benefit the customers as well as helping the grid operator to handle the demand and thus assist with peak shaving. Furthermore, the ability to supply reactive power increases the grid security via providing an improved voltage profile and hence reduces the likelihood of voltage collapse. The number of PEVs connected to the grid specifies the amount of active and reactive power that can be supplied to the grid. The proposed strategy provides enhanced performance through a cost-effective and easyto-implement controller with a lower computational burden, which makes it suitable for real-time applications.