3.4.2. Control Design

To control and ensure the compensation of the EVSE reactive power consumption, the EBox communicates with a grid analyzer to know the reactive power value and send the calculated set-point to the emulator AFE, which generates the desired current. As shown in Figure 9, there are three different grid analyzer configurations: in the output of the V2G charger under test, in the Point of Common Coupling (PCC) of the facility or in both (V2G and PCC).

Depending on the location of the analyzer, the control algorithm implemented in the EBox has to be changed, achieving different performances:


reactive power of the charger is measured and directly compensated at the output of the regulator. In order to avoid the integration of the error produced by the charger, the derivative of this measure is compensated in the input of the regulator. In this way, the controller achieves a better time response capability. However, it has to be highlighted that the use of two grid analyzers increases close to 2% the final price of the solution.

**Figure 9.** Representation of the two possible locations of the grid analyzer in order to compensate the reactive power injected by the EVE.

**Figure 10.** Three types of different reactive compensation control strategies: (**a**) Open loop control, measuring reactive power at the output of the V2G charger. (**b**) Closed loop control, measuring reactive power at the PCC of the facility. (**c**) Closed loop control with V2G compensation, measuring both V2G charger and the PCC of the facility.

Figure 11 shows the simulation in MATLAB/Simulink of the reactive power consumption of the three different types of control that have been shown in previous Figure 10. It can be seen that in Figure 11a without any external loads, the reactive consumption in the PCC with open control loop as well as with closed control loop with V2G compensation are the same, while with closed control loop the response is slower than the previous case. However, if there is reactive power consumption by an external load, Figure 11b shows different behaviour. On one hand, with open control loop the reactive power consumption at the PCC in steady-state is determined by the external loads. On the other hand, with closed control loop, the power at the PCC can be fully compensated by the EVE, with a better time response to the V2G power demand by compensating it using two grid analyzers.

Comparing the last two control modes in Figure 11b, it should be noticed that the reactive power error given by the abrupt change of the V2G power at time *t* = 32 s, is quickly balanced with the third type of reactive control strategy. The reason is that the compensation of the V2G power avoids the error integration in the PI control, improving the time response and performance of the reactive power control at the PCC.

**Figure 11.** Simulation of the reactive power consumption using the same V2G consumption profile with abrupt consumption changes. Two scenarios have been considered: (**a**) without power consumption of the external loads; (**b**) with power consumption of the external loads. In every scenario, all three different control strategies have been tested: open loop, closed loop, and closed loop with V2G compensation.
