Abstract

Frequency control, especially when incorporating distributed generation units such as wind and solar power plants, is crucial for maintaining grid stability. To address this issue, a study proposes a method for controlling the connection status of electric vehicles (EVs) to prevent frequency fluctuations. The method utilizes an adaptive neural-fuzzy inference system (ANFIS) and a whale optimization algorithm to regulate the charging or discharging of EV batteries based on frequency fluctuations. The objective is to minimize and adjust the frequency fluctuations to zero. The proposed method is evaluated using a real microgrid composed of a wind power plant, a solar power plant, a diesel generator, a large household load, an industrial load, and 711 electric vehicles. The ANFIS system serves as the primary controller, taking inputs such as electric vehicle and battery status and generating outputs that determine the charging or discharging of the electric vehicles. Several investigations are conducted to assess the effectiveness of this model, and the results obtained are compared with the normal state where electric vehicles only consume power. By implementing this method, it is expected that the connection status of electric vehicles can be optimized to help stabilize the grid and minimize frequency fluctuations caused by the integration of distributed renewable energy sources. This study highlights the importance of automatic frequency control in smart grids and offers a potential solution using ANFIS and the whale optimization algorithm.

1. Introduction

New issues have been raised with the expansion of power networks, attaching renewable sources, and the emergence of new technologies, such as electric vehicles (EVs) connected to the network. Due to environmental concerns and the fossil fuel crisis, renewable energy sources have been widely employed worldwide in countries’ energy baskets, leading to many opportunities and challenges for power system operators [1]. On the other hand, according to [2], the number of electric cars in America will reach 35%, 51%, and 62% of all cars in 2025, 2030, and 2050, respectively. The simultaneous connection of an enormous number of EVs can impose a massive load on the network and change the peak load and intervals [3]. However, considering EVs-related power demand, they can be seen as an additional consumer and a concern for network stability rooted in disturbing grid frequency while, from a diverse perspective, if the method and periods of charging/discharging EVs are planned purposefully, the capabilities of these cars can be used to improve the network undertaking [4], and the reliability of renewable power generation will increase when assuming EVs as a power storage section on the scale of megawatts.

Notably, a minor imbalance between generated power and demand in grids causes a significant change in frequency; therefore, the system’s frequency is a perfect indicator of the balance of the system [5]. Power system frequency adjustment methods are aimed at providing a balance between consumed and generated power and power flows between lines [6]. The main goal of constant power system frequency adjustment methods is to keep the system’s actual frequency in the power system’s reference frequency [7]. Frequency response is one of the essential parameters in power networks, and various methods, such as using FACTS tools or other compensation methods, have been proposed to enhance it [8]. According to the IEEE/CIGRE standard, frequency stability depends on the actual power balance of the load between production and consumption [9]. In recent years, various methods have been proposed to manage these loads to reduce their adverse effects on the network and improve network characteristics, such as reducing losses, reducing peak load, and improving frequency stability [10] (see Table 1).

This study first presents the introduction and the necessity of the research. In the second section, a review of the literature is performed. In the third section, ANFIS and the optimization algorithm are introduced. At the end of the third section, the proposed method is introduced. In the next section, the simulation results are presented. MATLAB software is used for the simulations. Finally, the overall conclusion and suggestions for future work are presented.

2. Literature Review

In recent years, various methods have been proposed to manage the loads imposed on grids as EVs to reduce their adverse effects on the network stability and to use them to improve network characteristics, such as reducing losses and reducing peak load. In [14], a new method is proposed to improve frequency stability using the stored power of EVs connected to a grid. The proportional-integral (PI) controller is the most widely used in the industry, so more than 31% of the utilized controllers are of this type. This controller has a simple structure and good performance for linear systems. Considering that the frequency stability problem in controlling grid-connected EVs is a nonlinear problem with multiple variables, it is impossible to use linear methods. In another study, the load frequency control and the effects of grid-connected EVs on the frequency control of interconnected smart grids in the presence of wind power plants have been investigated. The PI controller controls EVs’ charging mode in this method to reduce network frequency fluctuations [15]. According to [11], proportional and integral coefficients are essential, and their optimal values should be determined to give the controller the best performance. Thus, in this method, the particle swarm algorithm (PSO) is operated to determine the parameters’ optimal value. The proposed method has been implemented on a smart grid, and the results indicated good performance in controlling the grid-connected EVs [16]. A new method to control the frequency of smart grids using grid-connected EVs has been presented in [17], and frequency control of a small power network by aggregating and modelling the EVs has been investigated. The genetic algorithm (GA) has been used to control and plan the electric vehicles connected to the network in this method. The presented method is tested on a 9-base system, and the results revealed adequate control of frequency fluctuations [12]. Frequency control in a microgrid has been investigated, including renewable resources, controllable heating and cooling loads, and an EV that can be connected to the grid. The unique point about this microgrid is its hybridity (AC/DC) and ability to exchange energy with the upstream network. The proposed controller is a PID controller, in addition to a PSO used to increase the efficiency of this controller. This study is conducted in MATLAB software, and the simulation results are analyzed [13]. In [18], a new application of the coefficient diagram method controller, based on virtual inertia in an island microgrid, considers the penetration of high-level renewable energy sources to increase the reliability and robustness of the system against disturbances and uncertainty. The reliability of this controller is compared with the infinite H controller using MATLAB software. In [19], the frequency control of a microgrid including fuel cell, solar system, wind generator, and CHP is considered, and the multi-input and single-output (MISO) phase controller technique is utilized. The authors of [20] used a model predictive control (MPC) for an off-grid microgrid along with a virtual-impedance droop control that successfully improved the power quality at the connection point of the converters. In [21], the frequency control of a microgrid comprising renewable energies (solar system and wind turbine) has been carried out with an independent frequency and voltage control method. This reference also investigates the effect of using energy storage devices for frequency control. In [22], the effect of power oscillations of a solar plant on the frequency of the microgrid is investigated and tried to stabilize the frequency. The authors of [23] present a wind-solar hydrogen energy production system that includes a photovoltaic arrangement, wind turbine, battery, hydrogen storage unit, and an automatic control system for battery charging and discharging. The mathematical model for each system component has been extracted by running this system on a real sample system. The robust controller is developed using the linear matrix inequalities (LMI) method [24, 25] and optimized using the genetic algorithm. In this process, the power system is considered indeterminate, and the controller is of a high order. In [26], a sliding mode controller is presented for frequency control in a four-zone power system with different turbines, such as non-preheated and water turbines. In [27], using a fuzzy PID controller, the load frequency control (LFC) system is designed in a power system with two thermal and water zones. In [28], a hybrid optimization method based on particle swarm and firefly (PSO-FF) is proposed to adjust the parameters of the PID controller to minimize the frequency deviation in the microgrid system under different operating conditions, such as changes in wind speed and load demand. Also, a comparative analysis is accomplished to adjust the PID controller using particle swarm optimization (PSO) and firefly algorithms to minimize the deviation in frequency. A hierarchical control system is presented in reference [29, 30], and all measurements are based on the Clarke transformation. This research introduces microgrid control in three levels: primary, secondary, and tertiary. The purpose of primary control is to maintain the stability of voltage source inverters, secondary control is to eliminate steady-state errors caused by primary control, and the task of tertiary control is to power management, expressed in terms of economic market plans. Correspondingly, all the test loads connected to the network are considered resistive. In [31], the robust model, by describing the general behaviour of the data directly instead of using past data, has led to remarkably accurate solutions. In order to compare the accuracy of direct measurement, three years of solar radiation data have been evaluated, and differences between hourly samples have been observed. In [32], a dc-dc transmitter for EV batteries with grid-to-vehicle service (V2G-PVBP) is proposed. It relies on the energy storage performance of EVs not only to meet the everyday needs of owners but also to provide the function of load adjustment and microgrid management. In [33, 34], the optimal performance of the fuzzy controller for balancing production and consumption in an independent microgrid with electric vehicles is introduced. In [35], a new modified optimal algorithm is presented for setting the scale factors and membership functions of a fuzzy-type 2-PI controller by effectively reducing the frequency deviation of the microgrid system against load disturbances. In [36], a main frequency control through a V2G system is introduced in an industrial microgrid, which includes the coordination of the charging station operator and EV operator. In [37], the regional share load frequency control system by plug-in vehicles (PEVs) tries to adjust the frequency in different load disturbances. The proposed LFC successfully removes the frequency fluctuations while considering the delays and uncertainties. In [38, 39], the simulation results obtained from MATLAB prove that using the hybrid energy storage system (HESS) can stabilize the frequency of the interconnected multizone system, and the proposed controller is reasonably practical. In [40], a new energy storage system based on pumped hydro energy storage (PHES) is proposed for an integrated microgrid, and the accuracy and reliability of the LFC in the investigated system are calculated. The authors of [41, 42] discuss virtual inertia simulation based on energy storage system derivatives and its effect on power system frequency control. An efficient optimization strategy called the conflict-based Volleyball Premier League (OVPL) algorithm optimizes the required energy storage system (ESS) and controller parameters. In [43], an atom search optimization algorithm (ASO) is described for setting fractional-order proportional integral derivative (FOPID) parameters and automatic load frequency control of a heat pump system (HPS). This study tries to analyze the frequency stability of an HPS with the help of Matignon’s theorem. In [44, 45], an electric device and a heat pump with HPS control the frequency and the operation of consumer electrical appliances such as EVs and heat pumps (HP), reducing the use of independent energy storage units. As stated in [46], as long as EVs are connected to the grid, they can act as a controllable load or production source. Also, the reliability of renewable resources increases with a large number of electric vehicles. In fact, the large number of electric vehicles in the network can be considered a large storage battery in the scale of several megawatts, called vehicle-to-grid or V2G systems. V2G systems can create a backup storage source that balances power in the grid by quickly responding to disturbances. Accordingly, in [47, 48], smart charging for electric vehicles is used in microgrids as a frequency control approach. In this article, the proposed method is a fuzzy optimized by the colonial competition algorithm. In [39, 49], an independent microgrid with a heating turbine, wind turbine, photovoltaic, and electric vehicle system has been studied using a fuzzy-PI method and adaptive control. In [50], V2G provides frequency and voltage support based on integrated EVs in the power grid. While providing necessary ancillary services, EV battery failure issues are also considered. The charging stations are considered in [51, 52] in which batteries are supplied with photovoltaic and battery energy systems (BES). BES is used as a backup unit by storing excess energy in low-demand conditions and supplying the station when in power shortage. In this regard, a control unit activates the bidirectional DC-to-DC converter for charging and discharging. Also, a maximum power point tracking technique is used to offer suitable pulses for the DC-to-DC converter to extract the maximum output power from the PVs in distinct conditions. In [53, 54], an adaptive FOPID fuzzy controller is proposed for the renewable infiltration power system. The main part of this research is allocated to adjusting all the possible parameters of the fuzzy controller and FO and PID controller simultaneously to solve the uncertainties created by renewable resources, loads, and parameter changes. The authors of [55] present a distributed coordinated model predictive control (DMPC) for the LFC of a power system that includes wind power generation with inherent challenges. The authors of [56, 57] construct a hierarchical distributed model predictive control (HDMPC) for frequency regulation. The authors of [58] stated that V2G technology can be used as a mobile energy storage unit and is presented as a good solution for LFC. Thus, an adaptive neural-fuzzy system ANFIS is used. This research shows that the LFC based on the ANFIS adaptive neural system has a better response than other controllers. In this study, a novel method for controlling grid-connected electric vehicles (EVs) to reduce grid frequency fluctuations is proposed. The proposed method uses an adaptive neurofuzzy inference system (ANFIS) as a controller. In this method, the grid frequency and the battery charge state of EVs are considered as the ANFIS inputs, and the battery charging or discharging state is considered as the ANFIS output. The ANFIS should control the battery charging/discharging state in accordance with the frequency fluctuations in such a way that the frequency fluctuations are minimized and ideally reduced to zero. In the adaptive neurofuzzy inference system, the learning algorithm is of high importance. In the proposed method, a learning method based on the whale optimization algorithm (WOA) is used to improve the performance of the adaptive neurofuzzy inference system. This learning algorithm was proposed in 2018 and has a better and faster performance than classic learning algorithms [16]. The proposed method will be evaluated using a real model of a microgrid with different loads and grid-connected EVs.

In general, the key points considered in this paper can be summarized as follows:(i)The performance of a fuzzy and finite-time controller is compared(ii)A chaotic whale algorithm has been used as a superior learning algorithm(iii)The performance of the control system is enhanced using ANFIS(iv)The proposed ANFIS provides more satisfactory damping than the fuzzy controller(v)The proposed controller is consistent and robust(vi)The proposed controller eliminates network frequency deviation in a shorter time

3. Chaotic Whale Optimization Algorithm (CWOA)

Studies have shown that metaheuristic optimization algorithms lead to convergence speed and accuracy [22, 23] and prevent the system from getting stuck in the local minima. Therefore, the chaotic whale optimization algorithm (CWOA) is introduced in [24] to improve the performance of the standard whale algorithm. In a CWOA, the whales move towards the prey using chaotic maps. The logistic chaos map function is shown by equation (1). This chaos map function is the control parameter to generate a random number between zero and one.where is its control parameter and is the mapping’s output.

The tent map function is shown by the following equation:

The iterative chaotic map function with infinite descent (ICMIC) is shown by equation (3) which generates a random number between zero and one, as it should be regarding the control parameter.

The sinusoidal chaotic map function is shown by the following equation:

The sine chaos map function is shown by the following equation:

The function of the Sheff chaotic map is shown by the following equation:

The function of the Singer chaos map is shown by the following equation. This chaos map function generates a random number between zero and one, and should be chosen between 0.9 and 1.08.

The function of the piecewise chaotic map is shown by equation (8). This chaos map function generates a random number between zero and one, and should be chosen between 0 and 0.5.

Bernoulli’s chaotic map function is shown by equation (9). This chaos map function generates a random number between zero and one, and should be chosen between 0 and 1.

4. ANFIS

Fuzzy logic is considered an effective tool in complex systems that are difficult to understand or issues that depend on human reasoning, decision-making, and inference. Choosing an appropriate method and approach for modelling a system depends entirely on the complexity of that system, which has an inverse connection with our knowledge and understanding of that system. Experts have always tried to model the system with the highest possible accuracy. However, without enough knowledge about the system’s behaviour, the desired accuracy cannot be obtained, and related problems will arise [2632].

ANFIS is a neurofuzzy system based on a combined learning process, which emits the input data to the output space based on fuzzy if-then rules. This operation is performed by assigning suitable membership functions for the inputs [13]. Considering the learning ability of neural networks and the proper functioning of fuzzy systems, combining these two concepts leads to the emergence of a powerful tool used in various problems with high speed and satisfactory accuracy. ANFIS systems are often implemented using a Takagi-Sugeno-Kang fuzzy system as a progressive network structure. If the output of each layer is (the output in the the node of the L layer), which is described by two membership functions, the ANFIS structure will be five layers as follows (Figure 1).

4.1. Layer 1 (Fuzzy Layer)

In this layer, the degree of the input membership related to different fuzzy intervals is determined as follows:where represents the membership function of variable x. This member function can be picked out of various shapes, for instance, triangular and trapezoidal, but mostly bell-shaped or Gaussian. The mathematical form of these functions is shown in the following equations:where and are the range that the fuzzy set supports.where is the standard deviation and is the curve-fitting constant.

4.2. Layer 2 (Normalized Layer)

Each node in this layer calculates the gain of a rule, and the output of this layer can be calculated as follows:

4.3. Layer 3 (Product Layer)

In this layer, the node normalizes the gain of the rule to the sum of the activity degree of all the rules in the following way:where is the normalized weight of the rule.

4.4. Layer 4 (Defuzzy Layer)

In this layer, the output of each node is equal towhere is the output of the third layer and are known as parameter sets. The number of conclusion parameters for each fuzzy rule is one more than the number of inputs. For example, if the constructed ANFIS has four inputs, the number of inference parameters of each fuzzy rule is five.

4.5. Layer 5 (Total Output Layer)

In this layer, each node calculates the final output value as follows (the number of nodes is equal to the number of outputs):

The training of these systems is based on using the training data to determine the nonlinear parameters related to the fuzzy membership functions so that the desired output is obtained for the applied input. The hybrid training method is one of the most critical training methods for fuzzy inference systems based on adaptive neural networks. This method uses the backward propagation of errors for training in the first layer, and the least-squares estimation method is used in the fourth layer of the system.

4.5.1. Proposed Method

This study proposes a new fuzzy controller to control the charging of EVs connected to the grid to enhance frequency stability. Consequently, each electric vehicle is connected to a charging station, which is connected to an intelligent network that can dispatch the consumption and charging rate of the electric vehicle’s battery. This point is pictured in Figure 2.

Ideally, it is assumed that there is no delay in sending information. Also, smart network information, such as frequency-related measurements, is sent to the charging station. As can be seen, all components, including EVs, charging stations, and networks, are linked.

The structure of the charging station is shown in Figure 3. At the charging station, decisions are made by fuzzy rules, and a control command is disseminated; accordingly, either the batteries charged (charging status) or discharged (discharging status) are determined.

The inputs and outputs must be determined through any control system, and a control command should be administered regarding the inputs and outputs. In the system under study, the state of charge (SOC) and frequency fluctuations are the controller’s inputs. A fuzzy system uses sets of fuzzy rules to model the problem. The input and output variables enter the fuzzy system changed to be useable by the fuzzy subsets. Therefore, a fuzzifier, a knowledge base, an inference engine, and a defuzzifier should be determined. In this study, the Mamdani method is used for fuzzy inference, and the minimum and product implication method is used. Since more than one rule is usually used in each fuzzy model to calculate the output, the results of each rule should be combined with rule aggregation methods that is a maximum and algebraic summation methods in the designed controller.

One of the essential parts of an ANFIS system is determining the membership functions (first layer) and conclusion parameters (fourth layer). This task has no specific steps and is highly dependent on the designer’s decision. So, a chaotic whale optimization algorithm is proposed to determine the optimal values, as shown in Figure 4.

For example, if a Gaussian membership function is used as the membership function and ANFIS includes two inputs and two fuzzy rules, the process is as follows (Figure 5).

5. The Network under Study

In this section, the performance of the proposed method is investigated. The general structure of the designed microgrid is shown in Figure 6. This microgrid consists of EVs, a wind power plant (4.5 megawatts), a solar power plant (8 megawatts), a diesel generator (15 megawatts), a large household load of 10 megawatts, an industrial load of 0.15 megawatts, and 100 electric vehicles (40 kW/each). Apart from the mentioned sources and loads, small linear and nonlinear loads are connected to the system in different buses. The simulation is performed for one day and one night, and all the results presented, such as sun intensity, wind speed changes, and frequency fluctuations, are related to the mentioned period.

5.1. Limitations and Boundaries

During the charge/discharge process, the relationship between SOC and charging rate is as follows [38]: is the electric vehicle charging current, Q is the permissible battery capacity of the electric vehicle, is the amount of charging status at the time of , and is the charging rate of the electric vehicle (positive values are for charging mode and negative values are for discharge mode.

If the charging time in a parking lot is sufficient for the electric car to be fully charged, the SOC battery is not less than the target value of the before leaving the car [37]. The minimum charging time is determined by the maximum charging rate as follows:

It is noteworthy that at any time , the departure time is supposed to be larger than ; otherwise, a full-charge state cannot be achieved.

In calculating the limitation of the dual-directional DC/DC charger, should be considered as follows:

The maximum charging time ( is determined by the time of calculation (t) and the departure time :

So, the minimum charge can be calculated as follows:

The ability to reach the target charging state of an electric vehicle () is a fundamental factor that is determined based on the classification of an electric vehicle and influences the determination of energy and power strategy. This variable is defined as follows:

If , electric vehicles act as flexible electric vehicles at the time of , and the charging rate can be set in the range of . Otherwise, , electric vehicles act as nonflexible electric vehicles at the time of , and the must be equal to charge the battery as much as possible.

The energy demand of an electric car during the charging process varies with the charging time, which can be calculated using the following equation:where E is the nominal energy in kilowatt-hours, U is the nominal voltage of the battery, and the total energy demand is equal to the following equation:where (n) is the number of EVs charged within the n timeframe. The power charging and energy supplied from the electric vehicle in the n timeframe can be obtained by the following equations:where is the required power to charge the EV within the n timeframe, is the demand for EV energy within the n timeframe, is the battery voltage, and is the uncertain capacity of the battery.

The minimum and maximum energies required for EVs are defined by the following equations:

Also, the minimum and maximum energies required by the charging station at n intervals are defined by the following equations:

5.2. Renewable Power Resources
5.2.1. Wind Turbine

Figure 7 shows the changes in wind speed during the test. In this figure, the horizontal axis represents time in hours, and the vertical axis represents wind speed in meters per second. The wind turbine has a maximum production power of 13.5 meters per second, and the maximum allowed speed is 15 meters per second. As can be seen, the wind speed is unpredictable.

5.2.2. Photovoltaic System

Sun power SPR-305E-WHT-D is assumed as the solar power plant in the simulation. More complete specifications of the panel are listed in Table 2. In a solar power plant, the most effective parameter in determining the amount of power produced is sun intensity. The higher the intensity, the higher the amount of power produced by the solar power plant, whereas an increase in temperature inversely influences the production. Notably, in reality, the weather is sometimes cloudy and leads to partial shade conditions. Figure 8 shows the intensity changes during the test. In this figure, the horizontal axis shows the time in hours, and the vertical axis shows the intensity in watts per square meter. Although a slight shadow occurred at noon and led to a decrease in intensity, for the rest of the period, panels received an average intensity.

5.2.3. Electric Vehicles

The vehicles are divided into five equal groups (each group consists of 20 electric vehicles) with characteristics listed as follows:First group: vehicle owners drive to work every day, and it is possible to charge the batteries at the workplaceSecond group: vehicle owners drive a longer distance to work, and charging the batteries at the workplace is possibleThird group: vehicle owners drive to work every day, and charging the batteries at the workplace is impossibleFourth group: vehicle owners stay at homeFifth group: vehicle owners go to work at night

In order to evaluate the performance of the proposed method, the following three different scenarios are assumed:First scenario: at 3 a.m., the industrial load enters the circuit, so the balance between the production and consumed power is disturbed; as a result, frequency fluctuation occursSecond scenario: at noon, there is a partial shadow in which the sun’s intensity decreases from 525 to 380 watts per square meter; consequently, the production power of the solar power plant is reduced, and the balance between the production and consumption power is disturbedThird scenario: at 22:00, the wind speed exceeds the maximum speed; consequently, the production of the wind power plant stops, so the balance between production and consumption power is disturbed

The results obtained from the proposed scenarios are given as follows. In order to investigate the impact of EVs on the network frequency stability, the mode of not using electric vehicles has also been investigated. At this point, EVs are only charged and considered consumers. The performance of the proposed case has been compared with the artificial bee colony algorithm (ABC).

6. Performance of the Proposed Method

6.1. Fuzzy Logic System

In this section, the performance of the proposed method is reviewed, considering the three scenarios introduced in the previous section. In each of these scenarios, the balance of production power and consumption load is disturbed, and as a result, the frequency of the system fluctuates. The proposed method should be able to minimize the range of frequency fluctuations in the shortest time.

In order to use the fuzzy system, first, its structure must be determined. The proposed method uses the Gaussian membership function for the first input and the triangular function for the second input. The Mamdani inference engine and the centre of gravity defuzzifier have been utilized, and the chaotic whale optimization algorithm determines other parameters. The mathematical form of the Gaussian membership function is in equation (32) and is illustrated in Figure 9. In this membership function, coefficients a and b must be determined and are equal to 2 and 5, respectively.

The mathematical form of the triangular membership function is presented in equation (11) and is shown in Figure 9. In this membership function, coefficients a, b, and c must be determined and are equal to 3, 6, and 8, respectively. Figure 10 presents the shape of the triangular membership function.

Considering that Gaussian and triangular membership functions are used in the constructed fuzzy system, the parameters of the fuzzifier and defuzzifier are as follows.

6.2. Parameters of the Fuzzifier

These parameters include parameters of Gaussian and triangular membership functions.

Considering that seven membership functions are assumed for each input, the number of parameters in the first part equals 35. There are two parameters for each Gaussian membership function, so 14 parameters must be determined for seven Gaussian functions. Also, there are three parameters for each triangular membership function, so 21 parameters must be determined. Accordingly, there are a total of 35 parameters the chaotic whale optimization algorithm must determine. In Figures 11 and 12, the input membership functions of both inputs are shown, which are built based on the optimal parameters the chaotic whale optimization algorithm resolves.

In the defuzzifier, four fuzzy rules are used. The number of parameters for each fuzzy rule is one more than the number of inputs. Here, there are two inputs and four rules. Therefore, the number of parameters in the defuzzifier for each fuzzy rule equals 3. There are 12 parameters in the final section. Therefore, the total number of optimization variables is equal to 47. The selected values for the parameters of the chaotic whale optimization algorithm are listed in Table 3.

7. Results

The results are indicated in Figures 1317. Figure 13 displays the system’s frequency after starting the first scenario. In this figure, the horizontal axis shows the time in seconds, the vertical axis shows the system’s frequency in Hertz, and the second zero indicates the scenario start point. In order to investigate the charging control efficiency and discharging of EVs on the frequency stability, the normal mode (absence of EVs) is also shown in this figure. Through the normal mode, EVs are only charged and function as consumers; therefore, there is no control over the charge and discharge of EVs.

As can be seen, since the first scenario starts, the frequency fluctuations of the proposed method introduced as the first mode are around 0.08 Hz (black line). With the passage of time and employing charge stored in the EVs, the range of fluctuations is decreased. Finally, the range of frequency fluctuations reaches less than 0.03 Hz. The amplitude of oscillations in the second state, where electric vehicles are the only consumers, is more than 0.2 Hz at the beginning and has reached 0.13 in the steady state (red line). The results showed that the proposed method reduced the fluctuations by 70% compared to the second mode. Figure 14 shows the proposed method’s frequency deviation and the normal mode.

Figure 15 shows the frequency since the second scenario started, in which there is a partial shadow at noon where the sun’s intensity increases from 525 W/m2 to 380 W/m2, and Figure 16 illustrates the frequency deviation. With the decrease of irritations, the production power of the solar power plant is reduced, and the balance between the amount of production and consumption power is disturbed. In this figure, the frequency of the system in the first mode (presence of EVs) is significantly more stable than that in the second mode (absence of EVs).

In the third scenario, at 22:00, the wind speed exceeds the maximum speed, so the wind farm production stops; consequently, the balance between the generated power and demand is disrupted. Figure 17 shows the frequency in the third scenario. As can be seen, the frequency fluctuations using the proposed method are around 0.16 Hz, and with the passage of time and the use of the stored power in the battery, the range of fluctuations starts to decrease. Finally, the range of frequency fluctuations reaches less than 0.03 Hz, while this value for the normal mode reaches 0.18 in the steady state. The results showed that the proposed method reduced the fluctuations by 83%. Figure 18 displays frequency deviation using the proposed method and normal mode.

7.1. Performance of the Optimizer Algorithm

ANFIS controls how electric vehicles are charged and discharged in this method to stabilize the system’s frequency. In order to increase the accuracy of ANFIS, the chaotic whale optimization algorithm is used for the training process. Since a satisfactory optimization algorithm should be fast and able to reach the desired solution in the least number of iterations, the performance of the chaotic whale optimization algorithm is investigated in different cases. Figure 19 shows the convergence of the CWOA. In this figure, the horizontal axis represents the iteration, and the vertical axis represents the minimum squared error (MSE) for the difference between the reference and actual frequency in the first scenario. Due to training the algorithm with ANFIS, the range of frequency fluctuations is minimized and ideally reaches zero. It is noteworthy that the training is completed in less than 60 iterations.

In Figures 2024, the changes in the parameters of the preliminary and conclusion sections are shown. The changes in the parameters of the first part of one of the Gaussian membership functions (the second membership function) are shown in Figures 20 and 21, assuming C = 0.314 and 0.233. As can be seen, the algorithm can find the optimal value of Gaussian membership function parameters in fewer than 60 iterations. Similar results are obtained for the rest of the membership functions (see Table 4).

Figures 2224 illustrate changes in the parameters of the first part of one of the triangular membership functions (the third membership function). In this membership function, b = 71.25, a = 35.16, and c = 90.46. As can be seen, the CWOA can find the optimal value of the parameters of the triangular membership function in fewer than 60 iterations. Similar results are obtained for the rest of the membership functions.

8. Conclusion

The presence of EVs on a large scale, despite upbringing challenges, can be used to improve the characteristics of the power system, such as frequency stabilization and power compensation, if properly managed and controlled. A new method based on fuzzy systems has been introduced to control EV charging to reduce system frequency fluctuations, and the chaotic whale algorithm is used as the training algorithm of the ANFIS. In order to evaluate the performance and reliability of the designed approach, it is tested under several scenarios with several other methods. The results showed that by utilizing the charge stored in the battery of electric vehicles, the range of oscillations is decreased by 83% to a value of approximately 0.2 Hz. Also, the chaos whale algorithm can train ANFIS in less than 60 iterations. Moreover, the chaotic whale algorithm has outstanding accuracy and speed of convergence. The results show the proposed method’s good performance in governing electric vehicles’ stored power to reduce fluctuations.

Abbreviations

MG:Microgrid
DER:Distributed energy resources
CHP:Combined heat and power
PV:Photovoltaic
EV:Electric vehicle
CDM:Controller diagram method
MISO:Multi-input and single-output
MPC:Model predictive control
LMI:Linear matrix inequalities
LFC:Load frequency control
FF-PSO:Firefly and particle swarm optimization
EV:Electric vehicle
GT2FL:General type-2 fuzzy logic
PEV:Plugin electric vehicle
HESS:Hybrid energy storage system
PHES:Pumped hydropower energy storage
OVPL:Opposition-based Volleyball Premier League
ASO:Atom search optimization
FOPID:Fractional-order proportional integral derivative
HPS:Heat pump system
BES:Battery energy system
DMPC:Distributed model predictive control
ANFIS:Adaptive neural-fuzzy inference system
GT2FLS:General type II fuzzy logic sets
IT2FLS:Several interval type II fuzzy logic systems
OFPI:Optimal fuzzy PI
RL:Rule layer
NL:Normalization layer
CP:Conclusion parameters
DL:Defuzzification layer
SL:Summation layer
WOA:Whale optimization algorithm
CWOA:Chaotic whale optimization algorithm
SOC:State of charge
ICMIC:Iterative chaotic map with infinite collapses
FI:Fuzzy inference
FI:Fuzzy implication
ABC:Artificial bee colony
MSE:Mean square error
DMPC:Distributed model predictive control
HDMPC:Hierarchical distributed model predictive control
DG:Diesel generator
ANN:Artificial neural networks
FIS:Fuzzy inference system.

Data Availability

Data will be available upon request. For data-related queries, kindly contact Baseem Khan [email protected].

Conflicts of Interest

The authors declare that they have no conflicts of interest.