Abstract

This study proposes a hybrid AC/DC microgrid with plugin EVs, leveraging PSO-tuned ANFIS for voltage and power control. With the existing control, which faced challenges such as instability and complexity, the proposed approach is aimed at simplifying control through PSO, efficient power sharing, and reduced sample requirements. This innovative method contributes to improved energy management in hybrid microgrids, bridging existing research gaps. This approach streamlines neural transmission in microgrid control, addressing challenges in distributed generation power, load demand, energy storage system SOC, and AC grid power integration. Notably, the proposed PSO-ANFIS simplifies electric vehicle power references using distinct inputs for each mode, trained through PSO. This methodology is tailored for microgrids with varying power profiles, presenting a promising solution for efficient energy management. The proposed EMS was experimentally verified using MATLAB simulations of a small-scale hybrid AC/DC microgrid for every operating mode. The financial dynamics of a microgrid’s power exchange with the main grid are examined through three distinct methodologies: fuzzy logic, ANFIS (adaptive neurofuzzy inference system), and PSO-ANFIS (ANFIS optimized using particle swarm optimization). In case 1, the PSO-ANFIS approach demonstrates its superiority by achieving the lowest grid purchase power cost of 1995.24 Rs/day compared to fuzzy (2243.63 Rs/day) and ANFIS (2150.45 Rs/day), while also yielding the highest revenue from power selling to the microgrid: PSO-ANFIS (668.84 Rs/day) surpassing fuzzy (536.12 Rs/day) and ANFIS (575.35 Rs/day). Similarly, in case 2, PSO-ANFIS proves its efficiency with the lowest net price of 8619.192 Rs/day, showcasing its effectiveness in optimizing financial dynamics. Furthermore, in case 3, the revenue aligns precisely with net prices, indicating the PSO-ANFIS method’s financial advantage, generating the highest revenue of 6544.0224 Rs/day compared to fuzzy (6025.36 Rs/day) and ANFIS (6153.214 Rs/day). These findings underscore the potential utility of the PSO-ANFIS approach in optimizing microgrid operations and enhancing cost-effectiveness across various scenarios.

1. Introduction

The environment is harmed due to increase in road transport industry; it results in the excess release of greenhouse gases and increases pollution [1]. Battery electric vehicles (BEVs) have been developed as an alternative option to reduce reliance on fossil fuels and associated carbon dioxide (CO2) emissions [2]. With the increasing adoption of BEVs in various modes of transportation, their importance has grown. However, the growing popularity of microgrids and their dependence on intermittent renewable energy sources (RES) and unpredictable EV activities have raised concerns about voltage stability and frequency control [3]. It is crucial to address the issues related to voltage stability and frequency control in order to ensure harmless and hardy operation. Large-scale integration of renewable sources without coordination and the fast adoption of electric vehicles with stochastic charging and discharging operations can result in voltage breakdown, power quality issues, frequency and stability fluctuations, and other problems. The heterogeneous mix of characteristics associated with various power sources further emphasizes the need for appropriate control and operation of microgrids, and the implementation of coordinated control mechanisms is critical [4]. Research on the management and operation of microgrids has garnered significant attention in recent years.

[5] explored various types of microgrid design, management, and control, while [6] conducted a comprehensive review of studies on microgrids and distributed energy resources from multiple countries. In order to ensure effective management in the event of downstream component failure, [7] examined a decentralised energy regulator system for independent polygeneration microgrid architecture. By employing fuzzy cognitive maps for decentralised agent coordination, [8] examined a game-theoretic, multi-agent-based microgrid energy management system (FCM). Additionally, [9] provided a useful review study on different graded control schemes of microgrids on the three control layers, namely, primary, secondary, and tertiary, with the aim of reducing global operation costs while increasing the control technique and consistency of microgrids.

Efficient and effective renewable energy conversion is achieved through photovoltaic (PV) solar and wind power. However, there are still operational challenges that must be addressed before microgrids can rely on PV and wind energy systems. The main issue with PV and wind energy conversion systems is their output variability throughout the day. This study focuses on investigating how increasing the energy transfer to the microgrid through electric vehicles’ discharge can mitigate energy supply shortages from PV and wind energy systems. Researchers have been working on developing PV and wind energy conversion technologies in recent decades. To account for the stochastic nature of PV systems, several optimization problems have been developed and validated. The aforementioned studies examined the DC-DC converter used in PV systems that is explained in [10], who looked at how cell temperature and solar irradiance changed the design of these converters. A new DC/DC converter topology for enhancing the efficiency of photovoltaic (PV) systems was proposed in [11], from the investigation of the characteristics of PV modules. An algorithm was presented in [12] for the dynamic control of a variety of distributed energy resources, including PV systems, microwind turbines, energy storage units, and controlled loads. [13] demonstrated the versatility of PV systems by presenting an energy management plan for a PV-powered desalination station connected to DC microgrids. These examples illustrate the diversity of applications that can be addressed by research on PV systems.

In [14], energy management approach for integrated rural energy systems (IRES) with greenhouses addresses the inefficiency and environmental concerns of traditional rural energy sources. The proposed method incorporates local renewable resources like biogas and wind power while optimizing electricity and heat supply. It presents a two-stage robust optimization model to handle uncertainties in electric load and wind power output, ensuring system resilience. The approach involves a cooperative framework for IRES with greenhouses, utilizing forecast scenarios to enhance economic dispatch outcomes. The optimizing home energy usage within smart grid (SG) scenarios through a home energy management system (HEMS) is presented in [15]. It introduces novel-limited and multilimited planning approaches, utilizing time-of-use pricing (TOUP) to minimize power costs, peak-to-average ratios (PAR), and peak load demands. The wind-driven optimization algorithm (WDOA) is employed to solve the optimization problem and is compared with other algorithms. The integration of a rooftop photovoltaic (PV) system is demonstrated for enhanced cost-effectiveness.

In [16], a secure management framework for optimizing energy system operations in smart cities addresses challenges arising from the integration of energy systems and the high data transfer rate. It explores efficient energy management considering smart transportation systems and proposes a bilateral power flow strategy (V2S and V2G) for enhanced efficiency. The model employs a novel stochastic architecture based on unscented transformation (UT) to handle uncertainties and incorporates blockchain technology for secure data transfer. The secure and efficient management of energy systems in smart cities by focusing on interconnected energy hubs and their operation within a smart microgrid system is presented in [17]. It explores false data injection attacks (FDIA) in energy hub systems and proposes an intelligent priority selection-based reinforcement learning (IPS-RL) approach for FDIA detection. The study incorporates the uncertainties of various energy carriers through the unscented transformation (UT) method.

An important aspect of the investigation is the influence of EV incorporation on the functioning of hybrid microgrids. To model EVs’ real-time operations on residential feeders, [18] provides a linearization approach using the Kirchhoff voltage and current laws, nodal analysis, and modulation index. The potential for EVs to function as mobile backup storage units and enhance grid resilience through smart grid applications has been noted in [19]. A MATLAB-based Monte Carlo simulation algorithm is available in [20] to evaluate the dependability of the distribution network using DERs, including electric vehicles. Studies have also investigated the potential of EVs in regulating the frequency and controlling the system operation. In [21], a brainy collector to coordinate the charging and discharging of a fleet of EVs for frequency control and to make up for any power shortfall is presented. In addition, in [22], a real-time frequency regulation based on the Markov decision process (MDP) (dynamic decision-making system) to enable intelligent frequency management through energy assistance from EVs is demonstrated. In [23], a multi-variable-generalised predictive controller for load frequency management in a decentralised microgrid that utilizes V2G integration is investigated. The controller’s aim is to prevent frequency shortages while maintaining enough energy exchange in the face of potential load perturbations. With the intention of reducing GHG emissions from the transportation sector, recent policies have been put in place to encourage the adoption of EVs [24]. In regions where the weather and energy grid mix make EVs a feasible option, a significant increase in EV usage is expected in the coming years. However, the rapid and uncoordinated deployment of EVs may lead to a range of issues, including phase imbalance, equipment failure, and increased active and reactive power losses [25]. Therefore, it is essential to carefully consider the potential problems that are due to the debatable property of the energy sources in hybrid microgrids.

The objective of the hybrid AC/DC microgrid with plugin electric vehicle system is to ensure stable power supply and effective consumption. However, predicting the amount of power generation from distributed sources such as solar and wind power and determining the remaining capacity of the EVB is crucial to achieving these goals. Nevertheless, the accuracy of such predictions is hindered by the instantaneous fluctuations in power generation, which makes it challenging to obtain precise data. Even with medium- and long-term load demand profiles and distributed power source generation data, accurate estimation remains difficult. For instance, accurately estimating the energy production of photovoltaic power based only on solar radiation has been a difficult task, and various studies have attempted to address this issue. Moreover, existing load demand prediction studies have mostly focused on large loads that exhibit low variability and uncertainty, leaving a gap in knowledge for smaller customers and buildings with significant load fluctuations. The energy management system (EMS) for an energy storage system (ESS) calculates the power reference using only the power produced by the distributed generation (DG) and the demand, in load side while disregarding the amount of power supplied by the AC grid and the ESS’s state of charge (SOC). This approach is not optimal, and the EMS algorithm may be too complex for practical use.

In [26], a hybrid vehicle system was examined, and fuzzy logic was employed for voltage and power control. However, the complexity of the fuzzy rule led to increased oscillations during sudden changes in operating conditions, potentially causing system instability. In [27], a hybrid AC/DC microgrid utilized an artificial neural network for voltage and power control. Although this method demonstrated effectiveness, it highlighted the challenge of requiring a substantial number of samples for model training and control, which in turn could complicate the overall system control process. With the hybrid AC/DC microgrid scenario, as explored in [28], an adaptive neural network combined with a fuzzy logic-based system was implemented for voltage and power control. Despite the advantages of online adaptive control, the system encountered instability issues, possibly due to the dynamic nature of the neural network and fuzzy logic integration. Investigating a grid-connected hybrid system that integrates renewable energies [29], it utilized an adaptive neurofuzzy system for voltage and power control. However, the reliance on a substantial number of samples for model training was identified as a drawback, contributing to increased complexity in the control process. Additional information on prior research and proposed solutions is provided in Table 1.

The previous studies discussed in Table 1 reveal a recurring challenge in the implementation of energy management methods for voltage and power control in hybrid systems, including hybrid vehicles and AC/DC microgrids. Specifically, these studies highlighted the need for a substantial number of samples to effectively train the control models, leading to increased complexity in system control and potential instability. This research gap underscores the requirement for more efficient and streamlined control techniques that can achieve stable voltage and power control without the drawbacks associated with extensive sample needs and system complexity. To address the identified research gap, this study proposes a novel approach in the context of a hybrid AC/DC microgrid integrated with plugin electric vehicles (PEVs). The method leverages a PSO- (particle swarm optimization-) tuned ANFIS (adaptive neurofuzzy inference system) for voltage and power control. By incorporating PSO, the proposed method reduces the number of required training samples for the ANFIS model. Additionally, the introduction of PEVs into the microgrid allows for effective power sharing among renewable energy sources and PEVs, further enhancing the overall system control. In contrast to previous methods that struggled with sample-intensive training and potential instability, the proposed approach offers a more efficient solution for voltage and power control in hybrid microgrid systems. By combining PSO and effective power sharing through PEVs, the proposed method is aimed at providing stable and reliable control while minimizing the complexity associated with extensive sample requirements. This research contributes to bridging the existing research gap and offers a promising avenue for improved energy management in hybrid AC/DC microgrid systems.

This study introduces an integrated energy management strategy tailored for efficient power regulation within small-scale microgrids. Utilizing particle swarm-optimized artificial neurofuzzy inference system (PSO-ANFIS) theory and central control, the method simplifies the intricate neural transmission process observed in biological organisms. The ANFIS model identifies optimal operating modes for converters involved in energy management within distribution networks. This novel approach takes into account distributed generation power, load demand, state of charge (SOC) of the energy storage system (EVB), and AC grid power to establish EVB’s power reference. Notably, the PSO-ANFIS-based energy management system is well suited for microgrids with regular power variations. By encompassing DG power, load demand, EVB’s SOC, and AC grid power, the proposed method optimizes power converter modes for efficient energy management. The process is streamlined as ANFIS calculates EVB’s power output based on distinct input data for each operating mode, trained through PSO.

The structure of the paper is outlined as subsequent sections. Section 2 elucidates the centralised distribution system’s power flow and system design, along with the introduction of the proposed PSO-ANFIS algorithm. Section 3 details the simulated training environment for the PSO-ANFIS theory, followed by an analysis of the conducted experiments for approach validation in Section 4. The paper concludes with final remarks presented in Section 5.

2. Hybrid AC/DC Microgrid along with Plugin Electric Vehicle

In this section, we will describe the functioning of the proposed EMS and the arrangement of the hybrid AC/DC microgrid with a plugin electric vehicle used in this study. Figure 1 illustrates the layout of the distribution network of the hybrid microgrid, which includes a PV array with a battery storage system (DC grid), a doubly fed induction generator-based wind energy conversion system, three plugin electric vehicle batteries, home and industrial loads, and the main AC grid.

2.1. PV with Battery Storage System

The DC-DC boost converter is responsible for connecting the PV array to the voltage source converter. To ensure that the maximum power is extracted from the PV array, the converter is controlled using a perturb and observe (P&O) maximum power point tracking (MPPT) algorithm, which is depicted in Figure 2. The algorithm uses the PV voltage and current readings from the array, which are processed via the P&O MPPT. The P&O MPPT is implemented using four conditions, which are expressed in Algorithm 1.

             
            
        
  
else
  
  

The duty cycle of the P&O MPPT generator is determined by the PV voltage and current, and it is converted into PWM pulses by the PWM generator to drive the boost converter and extract the maximum power from the PV array. The PV array used in this study comprises ten modules in series and 22 parallel strings, with each panel having a power rating of 228.375 W, a maximum power point voltage of 29.9 volts, and a maximum power point current of 7.65 A. Figure 3 shows the P-V and I-V characteristics of the PV array, which has a total power rating of 50.32 kW. Details of the PV array and the boost converter are presented in Table 2.

The battery is linked through a bidirectional converter to the DC link of the voltage source converter, serving as the DC bus. To regulate the DC bus voltage, a proportional integral (PI) controller compares the actual voltage with the reference voltage. The PI controller generates the duty cycle, which is then sent to the PWM generator. The PWM generator produces the pulse necessary for the bidirectional DC-DC converter to maintain the DC bus voltage constant at the reference DC bus voltage. The battery has a maximum operating voltage of 300 V and a capacity rating of 400 Ah. Table 3 presents the battery and bidirectional DC-DC converter specifications.

The voltage source converter operates on a feed-forward decoupling control concept with a switching frequency of 20 kHz. The inverter current is transformed into D-Q form using park transformation and compared with reference direct axis current based on the state of charge (SOCSB) of the storage battery. If SOCSB is greater than 70%, 50% PV power is sent to the AC grid and the remaining power is utilized for battery charging. If SOCSB is less than 30%, 50% power is taken from the AC grid to charge the battery along with PV power. The PI controller processes the error among actual and reference current, and the output is added to the feed-forward decoupling control logic to generate the control signal in the form of D-Q. The inverse park transform is used to convert the D-Q control voltage into ABC control voltage form. The sinusoidal PWM generator processes the control voltage and generates the pulse for the voltage source converter to control the real power flow in both directions based on the reference current. Figure 4(a) illustrates the control logic of the voltage source converter. The control modelling of the voltage source inverter is presented below.

Assuming uniform voltage throughout the three-phase electrical system, we can obtain the following equations:

The equations presented above allow us to determine the maximum voltage () and the power grid’s angular frequency, assuming that the voltage across the three-phase electrical system is constant.

Equation (4) outlines the process of converting coordinates from the fixed frame of the three-phase system to the synchronously rotating two-phase system.

In the equations mentioned earlier, and represent the -axis and -axis elements of the output current of a three-phase grid-connected inverter, while and represent the -axis and -axis elements of the three-phase grid voltage, and and represent the -axis and -axis elements of the three-phase grid current (see the following equations for the description).

Creating a controller for the system is difficult due to the interdependence of the -axis and -axis variables in the mathematical model described earlier. However, it is feasible to achieve closed-loop stable control of the system by employing a PI regulator and the feed-forward decoupling control technique, as shown in the following control equations:

The feed-forward decoupling control method allows for independent control of active power and reactive power in the inner-loop current of a three-phase solar grid-connected inverter. Figure 4(b) depicts the inner-loop current controller. To achieve this, the proportional gain is set to 0.3 and the integral gain to 20.

2.2. Wind Energy Conversion System

This advanced technology enables wind power to contribute to both active and reactive power regulation, thus making it a promising source of energy. In modern variable-speed turbines, the doubly fed induction generator (DFIG) is a widely used arrangement, as shown in Figure 5. The DFIG is an induction generator in which the windings are directly connected to the power grid and the rotor is connected to a back-to-back power converter. This back-to-back power converter can operate in both directions to achieve partial generator output.

The amount of energy produced by a wind turbine generator system (WTGS) can be computed using the kinetic energy of wind, which is multiplied by a factor known as Betz’s factor or power coefficient. The power coefficient, , is mainly influenced by the wind’s average velocity in the swept area, which is determined by the blade’s rotational speed and geometrical characteristics (including the instantaneous pitch angle setting). The formula for calculating the energy output of a wind turbine is

To find the energy obtained by a wind turbine, the kinetic energy of the wind can be multiplied by Betz’s factor or power coefficient, which depends on the wind’s average speed in the area covered by the turbine blades. The power coefficient () can be calculated using various modeling methods, including lookup tables and observed data. In some cases, it is treated as a constant for simulations of steady-state and small-signal responses. The analytical expression for is given as a function of the wind blade’s angular speed and other symmetrical parameters, such as the instantaneous pitch angle configuration. The air stream kinetic power is denoted by , air density is represented by , the area covered by the wind blade is denoted by , and the wind’s average speed is denoted by .

The tip speed ratio is denoted by and expressed by the following equation: . The radius of the turbine is denoted by , the speed of the turbine is denoted by , and is expressed by the following equation: . Wind turbine characteristic coefficient is denoted by to , and wind turbine blade pitch angle is denoted by . Perceptively, the wind speed, blade pitch angle, and the wind turbine’s angular speed angle allow you to readily compute the turbine shaft mechanical torque.

Wind speed can vary significantly from one location to another, and it can also fluctuate randomly over time, which needs to be considered while modeling the dynamics of a wind turbine generator system (WTGS) appropriately. Previous studies have shown a direct correlation between the torque on the turbine and the power output of the WTGS. However, one challenge is to generate a realistic wind speed signal for simulations. One approach is to use logs of actual wind speed measurements taken at the WTGS’s location. However, this method has some drawbacks as it requires measurements at each simulated location. Alternatively, Slootweg suggests using a mathematical model based on landscape parameters to generate a sequence of wind speeds for any location. The expression for wind speed is

Constant wind speed component is symbolized as , wind speed ramp component is symbolized as , wind speed gust component is symbolized as , and wind speed turbulence component is symbolized as .

The drive train of a WTGS consists of the wind wheel, turbine shaft, gearbox, and rotor shaft of the generator. The gearbox in a wind turbine typically has a product ratio ranging from 50 to 150, and the wind wheel contributes to about 90% of the overall system’s inertia. Due to the high torque experienced by the turbine shaft, it undergoes deformation and elastic behavior that cannot be neglected. To simulate the gearbox’s function, an elastic coupling with linear stiffness, damping ratio, and mass-to-mass dispersion factor can be used.

In a double-fed WTGS, an asynchronous generator with a wounded rotor is used. Assuming sinusoidal and symmetrical positioning of all the windings, neglecting magnetic saturation effects, and considering the floating neutral of all windings, the relationship between the voltage, current, and its first derivative can be expressed in the frame.

The self-inductance of the doubly fed induction generator is represented by and . The mutual inductance of the machine’s stator and rotor is denoted by . Meanwhile, the resistance of the stator and rotor is denoted by and . The slip of the machine is represented by , and the angular synchronous speed of the machine is represented by . The voltage in the rotor and stator side is represented by , , , and , while the current in the rotor and stator side is represented by , , , and . The electromechanical torque of the machine is expressed in terms of control parameters, which is given in the following equation:

The stator’s reactive power may be calculated using the following formula:

The number of pole pair of the generator is denoted by .

In a two-feed system, a commonly used converter layout involves connecting two inverters, with one acting as an active rectifier, in series with a three-phase grid through a filter inductance. The WTGS employs an IGBT voltage source back-to-back converter. To prevent DC bus overvoltage caused by excessive power flowing from the rotor inverter to the grid-side converter, crow bars may be connected on the rotor side or in the DC bus before the converter. Various assumptions can be made regarding the converter’s performance to achieve different levels of information in the modelling process. If the switching frequency is high enough, we assume that the voltage signal generated by the inverters is entirely filtered out and that switching energy losses may be ignored. The wind energy system used in this work has a rating of 45 kW, 400 V, and 50 Hz. Figure 6 shows the power versus wind speed, tip speed versus wind speed, and power coefficient versus wind speed of the considered wind energy system.

2.3. Electric Vehicle Battery Operation and Control

The electric vehicle battery is connected directly to the AC bus through a voltage source converter. Figure 7 illustrates the control logic of the electric vehicle battery, which uses feed-forward decoupling control. The inverter’s actual real power is measured and compared to the real power reference from the PSO-ANFIS energy management system, which determines the reference power based on parameters like the electric vehicle battery’s state of charge (SOCEVB), load power, grid power tariff, and operation time. The error power is processed through a PI controller, which generates a direct axis reference current. This reference current is compared to the inverter’s actual direct axis current, and the error between them is processed through another PI controller. The output of this PI controller is added to the feed-forward decoupling control logic to generate a D-Q control signal. The D-Q control voltage is converted into ABC control voltage using an inverse Park transform, and the control voltage is then processed by a sinusoidal PWM generator. The PWM generator generates pulses for the voltage source converter, controlling the real power flow in both directions based on the reference current and reference power from the PSO-ANFIS EMS. This paper considers three electric vehicle batteries with a rating of 33.33 kW, 480 V, and 500 Ah.

3. Particle Swarm-Optimized ANFIS-Based Energy Management System

3.1. Adaptive Neurofuzzy Inference System

The ANFIS architecture shown in Figure 8 consists of five levels. Unlike scatter partition, tiered partition, and fuzzy -mean, grid partition divides the input space into subsets that are likely to contain input vectors, reducing the number of rules to practical levels.

The first layer of the system is known as layer 1, where input is fuzzified. In this layer, each subset of the input space in the fuzzy system is assigned a membership value based on a mathematical expression, which is given by the following equation:

Layer 2 is known as the fuzzy AND operation layer. In this layer, all nodes perform fuzzy AND operations using the algebraic product’s -norm operator. The outcome of each node is the output.

Layer 3 is known as the normalizing layer. It calculates the output of each node based on the sum of the activation values of all the rules in the fuzzy system. This ensures that the activation value of each fuzzy rule is normalized.

Layer 4 of the ANFIS model consists of nodes with linear parameters. Each node in this layer applies the direct function represented by the equation and has a set of adjustable parameters (, ,..., , ) associated with it.

Layer 5 is the output layer, which consists of one node. This node sums up all the inputs algebraically to generate the network’s output. To tune the ANFIS parameters, horse herd optimization is employed, and the algorithm for this is explained in the following section.

Calculating the mean squared error may be done in many different ways (MSE).

The goal value is , the output value is , and the number of outputs in the network’s output layer is . This mean squared error is minimized using PSO algorithm by adjusting the tunable parameter of the ANFIS network.

3.2. Particle Swarm Optimization (PSO)

Kennedy proposed PSO in 1995, which is a stochastic algorithm stimulated by the social behavior of animals such as herds and flocks. The decision to employ the particle swarm optimization (PSO) method in this study, as opposed to alternative mathematical approaches, is rooted in several distinctive advantages. PSO’s suitability for intricate search spaces, nonsmooth and noisy functions, and global optimization stands out. It excels in scenarios where traditional gradient-based methods struggle due to sensitivity to initial conditions and limitations with nonconvex functions, which can be common in complex, multidimensional problems. PSO’s population-based nature enables it to explore a wider range of solutions concurrently, which is essential for avoiding local optima. Unlike gradient-based methods, PSO does not rely on gradient information, making it more robust for situations involving nondifferentiable or noisy objective functions. Another strength lies in PSO’s capability to uncover global optima, setting it apart from methods that are susceptible to getting stuck in local optima due to reliance on local gradient information. Additionally, PSO’s flexibility and simplicity in implementation make it adaptable across diverse domains without necessitating complex mathematical derivations or constraints. These advantages collectively support the rationale for selecting PSO as the preferred optimization method in this study.

Initially, PSO fixes the population size with each particle representing a unique solution candidate. Each particle in the swarm acquires the velocity associated with its position to reach the ideal location. However, PSO may get stuck in a cycle of local minima. Researchers have introduced additional formula variables to manage and direct the optimal search procedure, including filtering the flock’s initialization, the constriction coefficient, the inertia weight, and the mutation operation. PSO primarily uses two mechanisms, cognitive and social, to improve its exploitation and exploration features.

Equations (22) and (23) provide mathematical expressions for the velocity and location in PSO, respectively.

The formulas provided in (17) and (18) can be used to express PSO mathematically, where “” represents the particle number, denotes the number of spatial dimensions, and denotes the number of discrete time intervals. Additionally, the particle population is denoted by , and the particle size is denoted by . Notably, represents the inertia weight factor, and denote the randomization parameters, and and represent the social and cognitive factors, respectively.

3.3. Steps for PSO-ANFIS

In this section, the training process of ANFIS with PSO is outlined in several steps. The first step involves initializing various parameters such as the number of particles, decision variables, maximum number of iterations, social and cognitive parameters, objective function (refer to Equation (21)), and inertia weights. In the second step, the weights and biases for the ANFIS are randomly initialized, and the fitness function value is calculated using the objective function for all input and target pairs. Next, the local particles and local fitness as well as the global particles and global fitness are determined for initializing the weights and biases. Subsequently, the velocity is calculated based on Equation (22), and the weights and biases are updated using Equation (23). The fitness function value is recalculated using the objective function for all input and target pairs, and the local and global particles and fitness values are again determined. The process iterates until the maximum number of iterations is reached or the stopping criteria are met. The optimal values for the weights and biases of the ANFIS model are displayed, and the ANFIS model is created based on these optimal values. Finally, the PSO algorithm is terminated. The flowchart of the particle swarm-optimized ANFIS is shown in Figure 9.

4. Simulation Results and Discussion

The present section focuses on the implementation of the energy management system based on ANFIS, utilizing particle swarm optimization in MATLAB. Furthermore, the results of the energy management-controlled hybrid AC/DC microgrid with the plugin EV system are analyzed and measured using MATLAB software, employing the PSO-ANFIS optimization method.

4.1. Training of ANFIS Using Particle Swarm Optimization in MATLAB

Figure 10 shows the input and target data taken to train the ANFIS network, consisting of 104125 samples for SOC of EV battery, load power, grid power tariff, operation time, and reference power. The data was split into 70% for training, 15% for testing, and 15% for validation. The PSO parameters included 100 maximum iterations, 100 swarm particles, personal learning coefficient of 1.5, global learning coefficient of 2, and an inertia weight of 0.9. The merging graph of the PSO algorithm is presented in Figure 11, and the final optimal fitness value obtained was 2.18%. PSO effectively trained the neural network with a small error. Figure 12 shows the regression plot after ANFIS training by PSO, with a regression value of 0.98908. This indicates that the trained ANFIS network output has less error with the target data, demonstrating that ANFIS trained well using particle swarm optimization. The results were measured and analyzed using MATLAB software for a hybrid AC/DC microgrid in a plugin EV scheme.

The application of the particle swarm optimization (PSO) technique was pivotal in refining the parameters of the adaptive neurofuzzy inference system (ANFIS) network. To ascertain the PSO algorithm’s optimality, an extensive parameter tuning process was conducted across 200 trials. The resulting metrics, encompassing values such as best fitness (0.0218), worst fitness (0.0356), mean (0.0234), and standard deviation (0.00014), underwent a rigorous analysis. Notably, the comprehensive evaluation consistently demonstrated that the PSO algorithm consistently surpassed alternative methods across a significant portion of the trials, thus underscoring its remarkable efficiency in elevating the ANFIS training procedure. Importantly, from these analyses, it became evident that the PSO algorithm’s optimality was consistently upheld, strengthening the confidence in its effectiveness in generating optimal solutions. For a more in-depth perspective, refer to Table 4, which outlines the performance parameters of the PSO algorithm over the 200 trials. This table encompasses pivotal metrics including best fitness, worst fitness, mean, standard deviation, and an average computation time of 45 seconds.

The sensitivity analysis of the particle swarm optimization (PSO) method was conducted by manipulating key parameters—the inertia weight, social factor, and cognitive factor—across a series of tests and presented in Table 5 and convergence graph shown in Figure 13. Test 1 involved setting the inertia weight () to 0.5, the social factor () to 2, and the cognitive factor () to 2, resulting in a mean squared error (MSE) of 0.021844. Test 2 maintained the same inertia weight but adjusted the social and cognitive factors to 1.5, yielding an MSE of 0.021862. In test 3, the inertia weight was increased to 0.8 while keeping the social and cognitive factors constant at 2, leading to an MSE of 0.021894. For test 4, the inertia weight ranged from 0.9 to 0.1 incrementally, with iteration increase, while maintaining the social and cognitive factors at 2, resulting in an MSE of 0.021845. Impressively, despite variations in parameter values, the MSE outcomes consistently clustered within a narrow range (0.021844 to 0.021894), showcasing the algorithm’s resilience. This remarkable stability substantiates the PSO algorithm’s suitability for optimization tasks, given its consistent performance across different parameter configurations.

4.2. Simulation Results of PSO-ANFIS Energy Management-Controlled Hybrid AC/DC Microgrid with Plugin EV System

The following section presents the simulation outcomes of a hybrid AC/DC microgrid with a plugin electric vehicle system in MATLAB software. The simulation analysis was carried out using 24-hour data of the wind turbine’s wind speed, PV array’s irradiance, and DC and AC load power profile. The data used for the analysis is displayed in Table 6.

Table 6 presents a comprehensive dataset spanning 24 hours, encompassing key parameters like irradiance, wind speed, PV power, wind power, DC load, and AC load. Each row corresponds to an hour, providing valuable insights into the day’s variations. The time of day ranges from 0 to 24 hours. Irradiance, indicative of solar radiation, exhibits fluctuations, with a peak at 950 W/m2. Wind speed ranges between 8 and 12 m/s. The PV power, influenced by sunlight, and wind power, determined by wind speed, are captured in kilowatts. The DC load remains relatively consistent, reflecting stable energy consumption, while the AC load exhibits varying patterns. Accompanying Figure 14 visually depicts the 24-hour trends.

The simulation results have been examined across three different scenarios. Case 1 involves an analysis of the hybrid AC/DC microgrid, excluding the consideration of the plugin EV battery. In case 2, the results are evaluated while taking into account the plugin EV battery with a state of charge (SOC) exceeding 70%. This entails EV1’s battery SOC being at 70%, EV2’s at 80%, and EV3’s at 85%. Finally, case 3 entails an analysis of the simulation results involving the plugin EV battery with an SOC of less than 10%. In this instance, EV1’s battery SOC is 9%, EV2’s is 8%, and EV3’s is 8.5%.

4.2.1. Case 1

Figure 15 illustrates the outcomes for case 1 of the hybrid AC/DC microgrid system, specifically focusing on the behavior of the storage battery and the grid. Table 7 presents a comprehensive dataset detailing the results of the hybrid AC/DC microgrid system analysis, with a specific emphasis on the scenario where plugin electric vehicles (EVs) are not considered. Each row corresponds to an hour of the day, and the columns represent various parameters, notably the power of the storage battery (SB) and the power exchanged with the grid. The numerical values within the SB column carry dual significance: positive values indicate the battery discharging, while negative values signify the battery charging. Similarly, values within the grid column demonstrate the power interactions with the grid: positive values denote power being drawn from the grid, whereas negative values indicate power being injected back into the grid. This comprehensive dataset offers a detailed insight into the intricate dynamics of the hybrid microgrid system, highlighting the variations in battery charge and discharge as well as the bidirectional power flow with the grid.

From the analysis depicted in Figure 15 and Table 7, it becomes evident that the PV array contributed power during the timeframe of 7 to 17 hours, while no power generation occurred during the remaining hours. The storage battery, interconnected with the DC grid, provided power during 0 to 10 hours and 13 to 24 hours. Charging of the battery transpired from 11 to 12 hours due to the PV array operating at its peak power. The wind generator’s power output varied, aligning with the wind speed profile. The highest power generated was 38.2 kW, contrasting with the minimum of 15.45 kW. The microgrid drew power from the grid between 24 and 8 hours, while contributing power to the grid from 9 to 23 hours.

In the given case 1, it can be observed that the PSO-ANFIS approach leads to the lowest grid purchase power cost of 1995.24 Rs/day, as compared to fuzzy and ANFIS which result in higher costs of 2243.63 Rs/day and 2150.45 Rs/day, respectively. Similarly, the PSO-ANFIS approach yields the highest revenue from selling power to the microgrid, generating 668.84 Rs/day, while fuzzy and ANFIS produce lower values of 536.12 Rs/day and 575.35 Rs/day, respectively. Consequently, the net price achieved through the PSO-ANFIS optimization is also the most favorable at 1326.4 Rs/day, indicating its superiority in terms of cost-effectiveness and financial performance in this particular scenario.

4.2.2. Case 2

Figure 16 presents the outcomes of the hybrid AC/DC microgrid system, focusing on case 2 where plugin electric vehicle (EV) batteries are taken into account. Table 8 provides a detailed depiction of the results for this scenario. The table showcases data for different times of the day, with corresponding values indicating the power generated or consumed by the EVB1, EVB2, EVB3 (electric vehicle batteries), storage battery (SB), and grid. The optimization techniques of PSO-ANFIS, fuzzy, and ANFIS are utilized to derive these values. Notably, the EV batteries display distinct charging and discharging patterns throughout the day, with variations based on the optimization technique. The storage battery follows a similar pattern, with fluctuations in charging and discharging influenced by the optimization approach. The grid’s behavior is also observed, indicating whether power is being purchased or sold to the microgrid. This comprehensive dataset aids in understanding the performance of the microgrid system in case 2, shedding light on the interaction of different energy sources and loads and the effectiveness of the optimization techniques.

In this scenario, power generation from the PV array and wind generator is similar to that of case 1. The storage battery linked to the DC grid commences power supply during intervals of low PV array generation, spanning from 0 to 10 hours and 13 to 24 hours. This aligns with the diminished power output of the PV array. During the 11- to 12-hour period, the storage battery enters the charging phase, coinciding with the PV array operating at maximum power. The EV batteries contribute to the microgrid’s power dynamics, providing energy from 8 to 24 hours, with the peak supply recorded between 13 and 14 hours. The microgrid sees power influx from the grid between 24 and 8 hours, while it exports power from 9 to 23 hours. Notably, grid power procurement is lower than in case 1, attributable to the substantial role played by the EV batteries in enhancing microgrid dynamics.

The grid’s financial interactions within the microgrid are documented in Table 8, including the purchase of power and the selling of power. Notably, the data reveals that in this scenario, the microgrid purchases power from the grid, with varying values across the fuzzy, ANFIS, and PSO-ANFIS approaches. The purchase values are 9156.47 Rs/day, 8854.23 Rs/day, and 8619.192 Rs/day for the fuzzy, ANFIS, and PSO-ANFIS methods, respectively. Interestingly, the grid does not engage in selling power to the microgrid in this case, as indicated by the zeros across the board. Analyzing the net price, which signifies the financial outcome, it becomes evident that the PSO-ANFIS approach yields the lowest net price of 8619.192 Rs/day, demonstrating its favorable impact on optimizing the financial dynamics of the hybrid microgrid system. This indicates that the PSO-ANFIS approach is particularly effective in managing the power flow and financial exchanges within the microgrid, leading to a more efficient and cost-effective operation.

4.2.3. Case 3

Figure 17 and Table 9 showcase the outcomes of case 3 in the hybrid AC/DC microgrid system, focusing on the incorporation of plugin EV batteries with state of charge (SOC) values below 10%. Specifically, EV1 battery exhibits a SOC of 9%, EV2 battery stands at 8%, and EV3 battery maintains a SOC of 8.5%. This situation gives rise to distinct behavioral patterns within the system. The EV batteries depict a consistent power draw pattern spanning from -7.45 kW to -4.27 kW, indicating their charging from the main grid and battery. Concurrently, the storage battery engages in charging activities within specific hours, fluctuating between -6.62 kW and -3.79 kW. This stems from the lower SOC of the EV batteries, compelling higher grid supply intake and battery utilization.

Of particular interest is the revelation that the grid supplies power to the microgrid during certain time frames, ranging from 3.37 kW to 51.1 kW. This forward power transmission underscores the grid’s supportive role within the microgrid during these periods, effectively enhancing its overall operation. The microgrid’s internal power flow showcases a dynamic blend of sources and exchanges, contributing to dynamic fluctuations in power consumption and provision. Notably, the impact of the PSO-ANFIS approach is discernible within these findings, exerting influence on power dynamics and intricate interactions among system components. These dynamics collectively shape the microgrid’s behavior in the given scenario. In essence, the outcomes shed light on the intricate synergy between diverse energy sources, storage units, and grid integration in case 3. In this context, the presence of plugin EV batteries with modest SOC values emerges as a pivotal determinant of the microgrid’s comprehensive power flow and operational efficiency.

In case 3, Table 9 outlines the intricate financial dynamics associated with power exchange between a microgrid and the main grid. The comparison is conducted across three distinct methodologies: fuzzy logic, ANFIS (adaptive neurofuzzy inference system), and PSO-ANFIS (ANFIS optimized using particle swarm optimization). The data in the table captures the daily costs and revenues in terms of Indian rupees (Rs). Interestingly, the microgrid’s expenditure on purchasing power from the microgrid remains consistent at 0 Rs/day for all three techniques, suggesting an intriguing aspect of self-sufficiency or potentially another underlying factor that mitigates the necessity for external power procurement.

However, the cost of grid selling power to microgrid varies considerably across the techniques. The revenue amounts to 6025.36 Rs/day under the fuzzy logic approach, slightly higher at 6153.214 Rs/day under ANFIS, and peaks at 6544.0224 Rs/day when employing the PSO-ANFIS technique. It is particularly noteworthy that the revenue figures align precisely with the net prices, implying that the costs of power purchases do not impact the net earnings. In this context, the PSO-ANFIS method stands out as the most financially advantageous approach, generating the highest revenue among the three methods considered. This outcome underscores the potential utility of PSO-ANFIS in optimizing microgrid operations, specifically in scenarios akin to case 3.

5. Conclusions

The study proposes a new energy management approach grounded in PSO-ANFIS theory to effectively run small-scale hybrid AC/DC microgrids with plugin electric vehicle. The approach involves selecting an EMS operating mode, developing an operation profile within each mode, and training an ANFIS within each mode using PSO. Inputs into the PSO-ANFIS-based EMS comprises the state of charge (SOC) of the EVB, load power, grid electricity tariff, and time of operation. The EMS uses training weight and bias of the ANFIS to establish the ideal power reference for the EVB. Laboratory tests were conducted on a small-scale microgrid, and the proposed EMS operating algorithm was tested with varied power production, load power, and EVB state of charge. Findings showed that the EVB discharged flexibly in relation to load demand in the EVB discharge mode, and the EVB power reference was dynamically adjusted to account for power output variations and the cumulative power needed to charge the EVB. The suggested operation for each mode was effectively carried out, and the PSO-ANFIS-based EMS resulted in a reduction in the cost of power purchase from the grid. The straightforward method used in the system’s implementation is a definite plus. The PSO-ANFIS-based algorithm is seen as a promising alternative for managing energy in small-scale microgrids with plugin electric vehicles, given the complexity of formalizing the pattern of load and DG. It is anticipated that the method for operating the EMS may be even made better if the PSO-ANFIS-based algorithm is used in the stand-alone operation mode.

Data Availability

No data is available for this paper.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Authors’ Contributions

The authors confirm contribution to the paper as follows: study conception and design: V. Ashokkumar and C.B. Venkatramanan; data collection: V. Ashokkumar and C.B. Venkatramanan; analysis and interpretation of results: V. Ashokkumar and C.B. Venkatramanan; and draft manuscript preparation: V. Ashokkumar and C.B. Venkatramanan. All authors reviewed the results and approved the final version of the manuscript.