*6.2. Peak Shaving Algorithm*

A di fferent perspective to view or appraise EVs is to consider them not as a passive load, but as possible active elements of the electric network in order to explore their storage capacities. Implementation of a possible "peak shaving" algorithm is attempted in this paragraph. To do this, the energy stored in the batteries of cars connected to the EVSEs will be exploited. Based on the value of the power required by the car park's utilities, the controller will make an evaluation of whether to take the energy required from the network, or extract it from the vehicles.

In order to have a clearer idea of the applied operating principle, let us consider the graph shown in Figure 20.

The red dashed line represents the maximum absorbable power before the protections are activated. The two dotted lines in blue, Pref1 and Pref2, represent the two control values of the algorithm. In particular, if the energy demand is higher than Pref1, then the energy is taken from the car rather than from the grid. If the requested power is below Pref1, then the cars are loaded, on the whole, with a power equal to Pref2. Naturally, the nominal power of the supply equipment must always be respected.

**Figure 20.** Operating principle of the peak shaving algorithm.

In Figure 21, it is possible to appreciate the final result of this algorithm. The dotted grey line represents the old load curve, while the red one shows the new load curve after the "peak shaving" algorithm is applied. The blocks in green represent the energy extracted from EVs to feed the parking in the phases of greater absorption, while the dotted blue line indicates the trend over time of the fleet's State Of Charge (SOC). As noted, through this algorithm, the charging of EVs can be extended for up to 10 or 11 h. For conclusive purposes, the flowchart related to the "peak shaving" algorithm is presented in Figure 22.

**Figure 21.** Comparison between the old load curve and the new load curve.

**Figure 22.** Flowchart of the "peak shaving" algorithm.
