Introduction

In the current scenario, the output power from Distributed Generators (DGs) such as wind, Photovoltaic (PV), small-scale hydro, and biomass is becoming increasingly significant in the power sector as a clean energy alternative. These DG units, ranging from a few kilowatts (kW) to various Megawatts (MW), are generally interconnected at the consumer premises, distributed feeders, or substations. However, the increasing power generation from DGs poses significant challenges in balancing generation and demand in distribution networks due to their intermittent output. To address these issues, the concept of the microgrid (MG) has been introduced as a promising solution. MGs integrate DGs with energy storage systems and local loads, which enable more reliable and flexible operation. MGs offer key advantages such as enhanced reliability, improved power quality, continuous power supply to consumers, and efficient operation in both grid-connected and islanded modes compared with conventional distribution systems1,2,3. The MGs can be classified into AC microgrids (ACMG), DC microgrids (DCMG), and Hybrid Microgrids (HMG). HMGs are becoming increasingly significant due to their competency in incorporating diverse DREs, intelligence, decarbonization, decentralization, and greater transmission capacity. HMGs combine the features of both ACMG and DCMG to interconnect DREs with the existing power grid. As a result, the necessity of additional rectifiers or inverters is minimized, reducing power conversion losses and the overall cost of power electronic components. Furthermore, the HMGs also offer various ancillary services, such as alleviating voltage sags, compensating reactive power, improving the power factor, maintaining voltage and frequency stability, mitigating harmonics, enhancing system resilience against grid disturbances, and thus improving the power quality4,5.

Utility Grid (UG) also faces challenges in efficiently integrating DREs into the grid due to the intermittent nature of power generation. Hence, the interconnection of the utility grid with microgrids requires non-linear power converters to regulate proper power flow between DREs and the existing grid, which in turn deteriorates the overall power quality of the microgrids6,7,8. Therefore, a hybridizing AC/DC grid presents a favorable solution to couple the DC loads with the DCMG and AC loads with the ACMG, which can effectively enhance the management of power to satisfy the demand9,10. In present scenario, the rapid growth of Electric Vehicles (EVs), which represent a significant category of DC loads, has increased the demand for fast charging solutions that rely on advanced power electronic converters. These charging infrastructures place a substantial demand on renewable energy sources (RESs) integrated within microgrids, highlighting the need for efficient control and coordination to ensure stable and reliable power delivery. Recent research on Electric Vehicle (EV) charging converters highlights challenges that closely align with those present in HMGs. In EV charging, cascaded AC/DC and DC/DC stages often face issues such as parameter variations and nonlinear disturbances, which negatively impact stability and reduce battery lifespan. Conventional PI controllers perform poorly under such uncertain conditions, motivating the researchers to explore advanced alternatives, including optimization-based control methods11. In HMGs, a similar situation arises, where the BIC plays a centralized role in coordinating power exchange between the AC and DC microgrids. Similar to converters in EV systems, which demand intelligent control for stable performance, the BIC in HMGs requires intelligent coordination strategies to ensure stable and reliable operation in both islanded and grid-connected modes12,13. In the literature survey, various control strategies for BIC have been propounded so far to serve three purposes: i) To maintain power balance between ACMG and DCMG during heavy and light-loaded conditions14,15. ii) To maintain the frequency and voltage stability in the ACMG during the islanded operation and to regulate voltage in the DCMG. iii) To ensure proper power sharing between the UG and microgrid during grid-connected operation16,17,18,19,20. Numerous centralized control methods have been extensively investigated in different research studies for HMGs, as all the DREs necessitate a central controller to communicate with the microgrid21,22. However, the centralized technique is not robust due to its single-point failure in the communication link. A decentralized control method with local measurements is proposed to overcome the above-mentioned issue and for proper power sharing. The decentralized method incorporates droop control, which estimates the DC link voltage (Vdc), deviation in DCMG, and the frequency (f) deviations in ACMG under heavily loaded conditions. The estimated voltage and frequency deviation make the BIC controller to transfer power between the light and heavy load conditions of the AC and DC subgrids23,24. The HMG’s performance is generally evaluated considering the cascaded linear control technique with PID regulators. The controller mentioned above has drawbacks such as i) Sluggish response due to feedback paths with multiple loops and PWM technique, and ii) Complexity in implementation since PID controller tuning consumes more time. The DREs are intermittent, which causes DC bus voltage oscillations and deteriorates the power quality, making the PID controller ineffective. The Model Predictive Control (MPC) scheme has gained preference in recent research studies for DC link voltage regulation and to minimize the overshoot and oscillations in HMGs. Despite its merits, MPC may cause a current surge during the mode transfer compared to conventional cascaded control techniques, and it also requires additional communication features and sensors25.

Grid-Following (GFL) and Grid-Forming (GFM) are the two control methodologies preferred for the BIC. The GFL strategy employs a Phase-Locked Loop (PLL) to regulate inverter current with rapid set point tracking to enhance system stability and responsiveness. PLL is vulnerable to weak grid conditions due to poor voltage regulation and the absence of inertia support26,27,28,29,30,31,32,33,34,35,36. In recent years, double-stage grid-connected solar PV systems employing grid-following control have become increasingly popular, particularly for rural electrification due to their simple deployment. However, the intermittent nature of solar irradiation often leads to challenges in maintaining power quality and system stability. This makes it essential to incorporate robust control strategies capable of regulating the microgrid voltage and ensuring stable operation under varying irradiance levels, load conditions, and external disturbances37. On the other hand, the GFM approach implements a voltage control technique known as the Virtual Synchronous Generator (VSG), which mimics the inertia of conventional synchronous generators to reduce frequency fluctuations and improve voltage support in weak grids38,39,40. GFM is susceptible to frequency oscillations during transient microgrid operations. The challenging task for the smooth and reliable operation of HMGs is the selection of an appropriate control strategy for the Inter Linking Controller (ILC). The above discussion raises the following question: Can conventional controllers in HMGs with multiple DREs and power converters be tuned by Intelligent Controllers (ICs) during islanded modes and grid-connected modes? Future power grids are expected to have advanced Power Electronics Devices (PEDs) and soft computing techniques that incorporate Artificial Intelligence (AI) based controllers. Soft computing techniques include evolutionary algorithms and Swarm Intelligence, whereas AI includes Artificial Neural Network (ANN), Fuzzy Logic (FL), and Adaptive Neuro-Fuzzy Inference System (ANFIS)41,42.

The industry employs conventional controllers such as proportional control, PI, and PID controllers. The primary challenge of the conventional controller is the precise and efficient tuning of its parameters. Estimation of PI parameters is carried out by precise mathematical modeling or the trial-and-error approach. Deriving a mathematical model is complicated compared to the trial-and-error approach. To overcome these issues, various studies employed Ziegler-Nichols (Z-N), Phase and Gain margins, Cohen-Coon’s, ANN, FL, and many more systematic techniques within microgrid architecture. Though these techniques provide an alternative to the trial-and-error approach, the Z-N method has notable drawbacks, including a time-intensive tuning process and a tendency to introduce delays that can lead to unstable operation phases.

Further, ANN requires more training data, which is time-consuming, and fuzzy mandatorily requires inference rules (If-else), which does not have its self-learning capability. To address these issues, recent advancements focused on implementing Swarm Intelligence (SI) techniques for optimally tuning PI controller parameters by iteratively reducing the performance index till it achieves the best optimal system response, thereby enhancing power quality and MG performance. SI techniques include Ant Colony (AC) optimization, Firefly Algorithm (FFA), Bacterial foraging Optimization (BFO), Seekers algorithm, Whale Optimization Algorithm (WOA), Social Spider, Grasshopper Optimization, Krill herd and PSO algorithm. PSO is widely deployed in autotuning PID parameters owing to its efficiency in handling nonlinearities and straightforward implementation43,44,45,46. PSO is known for its fast convergence and its capability to attain a better solution in a short computational time. Unlike many conventional optimization algorithms, PSO does not depend on learning rates or extensive initialization of parameters. Due to its simplicity, efficiency, and robustness, it has been the most widely adopted swarm intelligence–based metaheuristic method for more than twenty years47.

Optimization is the process of determining the optimal values for variables by either minimizing or maximizing an Objective Function (OF), all within specified constraints. The process begins with identifying parameters to be optimized. Next, an OF is formulated based on these parameters, which must be maximized or minimized to achieve optimal results. Finally, constraints are defined, and an appropriate optimization algorithm is selected. A robust SI optimization algorithm should continually guide search agents toward the global optimal value by exploiting and exploring the search space48,49. Key features of an effective optimization algorithm include:

  1. 1.

    Retaining the best solution after each iteration as the global optimum.

  2. 2.

    Recording the history to avoid losing the best solution even if the population deteriorates.

  3. 3.

    Efficiently explore the search space initially and exploit it towards the end.

  4. 4.

    Avoiding stagnation in local optima.

  5. 5.

    Adaptive parameters to enhance exploration and exploitation at appropriate phases.

The above-mentioned characteristics enable the algorithm to solve optimization problems efficiently. This article presents the design and development of a HMG implementing a PSO technique to ensure a power balance and efficiently integrate DREs. The key contributions of this study are summarized below:

  1. 1)

    Developing an HMG architecture that integrates DREs, BESS, and AC/DC loads. This architecture incorporates an ANFIS-based Maximum Power Point Tracking (MPPT) approach for the PhotoVoltaic (PV) source and MPC of the BESS to enhance DC-bus voltage regulation, improve energy management, and mitigate renewable generation fluctuations.

  2. 2)

    Proposing a particle swarm optimized Bidirectional Interlinking Converter (BIC) control strategy, specifically designed to ensure smooth, coordinated power sharing between the AC and DC microgrids under both grid-connected and islanded modes. This approach offers faster convergence, improved dynamic response, and achieves an optimal control solution within a short computational time compared with conventional PI methods.

  3. 3)

    Demonstrating and validating through MATLAB/Simulink simulations that the proposed PSO-based BIC control with MPC significantly enhances power management, transient stability, and dynamic performance of the DC bus voltage. Quantitative results show significant reductions in overshoot and undershoot, along with smoother power transfer compared with the conventional control method.

This research addresses existing gaps to enhance the reliability and efficiency of hybrid AC/DC microgrid systems. It introduces intelligent controllers in HMG to facilitate renewable energy integration while ensuring stable operation and effective power sharing. The paper is organized into sections covering system architecture, control strategies, PSO-PI-based controllers, modes of operation, and simulation results, with key conclusions presented in the final section.

System architecture of proposed microgrid

Figures 1 and 2 represent the proposed HMG and overall HMG configuration block diagram, respectively. The proposed HMG constitutes AC and DC microgrids interlinked through BIC. The ACMG encompasses a Doubly Fed Induction Generator (DFIG) based wind turbine, diesel generator, utility grid, and AC loads, whereas PV source, Permanent Magnet Synchronous Generator (PMSG) based wind turbine, BESS & DC loads constitute DCMG.

Fig. 1
figure 1

Proposed hybrid microgrid.

Fig. 2
figure 2

Proposed hybrid microgrid configuration.

The proposed HMG supports critical and non-critical loads, ensuring efficient power management across the system when any DREs or utility grid fails. The DC and AC microgrid buses are regulated at 470 V and 400 V, 50 Hz, respectively. PV array and PMSG are interfaced through DC-DC boost converters to the DC bus, where the ANFIS and Perturb and Observe (P&O) MPPT techniques are employed to optimize power output, respectively. The BESS is interfaced through a Bidirectional Buck-Boost Converter (BBBC) to the DC bus and serves two purposes: i) acts as a load during excess generation and source when load demand is high. ii) regulates the voltage in DC bus using MPC. The DC bus voltage is also bucked to 220 V for low-voltage applications. In ACMG, the DFIG-based wind turbine is linked to the corresponding bus via (RSI–LSC) converter. The BIC plays a vital role in power management between the microgrids. The BIC also ensures voltage regulation in the buses through an optimized PSO technique.

Control scheme for proposed microgrid

The proposed HMG’s controlled schemes for various converters are discussed in the below sections.

ANFIS MPPT control for PV source

The ANFIS MPPT technique synergistically merges the advantages of FL and the adaptive learning capabilities of ANN. The FL controller known for its ability to handle uncertainty and imprecise data through rule-based (if-else rules), making them effective for controlling non-linear systems with variable inputs. In contrast, ANN offers higher precision and adaptability due to its multiple nodes and hidden layers. This synergistic ANFIS approach enhances solar PV systems’ accuracy, computational efficiency, and fast-tracking speed.

Figure 3 depicts the ANFIS-based MPPT control block diagram. The input parameters for the ANFIS controller are irradiance and temperature. The ANFIS controller develops the membership function relying on the past knowledge gained from the training dataset. The input parameters are used to train the ANFIS regulator during the training phase.

Fig. 3
figure 3

ANFIS based MPPT control.

The ANFIS network, comprising five layers, was trained with 1000 data samples over 100 epochs and its output is depicted in Fig. 4. The PI controller compares the PV-measured DC voltage \(\left({V}_{dc\_m}\right)\) and the desired reference voltage \(\left({V}_{dc\_ref}\right)\). The necessary duty cycle to regulate the boost converter operation and ensure accurate MPPT is achieved by interfacing the PI controller output with the PWM generator. This proposed scheme attains maximum output power capacity \(\left({P}_{max}\right)\) at 20.5 kW, 25 °C under varying irradiation conditions. The irradiance of the PV system is varied at the rate of 2 W/m2 for every 2 s of simulation time. Table 1 mentioned below provides the details of the PV array.

Fig. 4
figure 4

ANFIS output.

Table 1 PV array specifications.

P&O control method to maximize wind power output

The maximum power extraction of a wind turbine can be achieved through the converter control, which regulates the generator’s speed under varying wind speeds. The MPPT algorithm-based P&O method implemented for converter control is straightforward and easy to implement. The required voltage for maximum power extraction is dynamically achieved through duty cycle variation. The voltage Vrec and current I rec of the diode bridge rectifier in PMSG are measured and fed as inputs to the MPPT controller, as illustrated in the Fig. 5. The Vrec and Irec are processed through the P&O algorithm to determine the MPP. The proposed controller modifies the DC–DC converter duty cycle to ensure the operating voltage remains at MPP. The power fluctuation in the wind turbine is introduced through minor perturbation in the wind speed. If this perturbation results in increased power, it continues in the same direction. Upon reaching the maximum power, any further perturbation that causes a power reduction will prompt a reversal in direction. The size of the perturbation is maintained at a minimum value to minimize the power fluctuation since the algorithm oscillates around the MPP during steady-state conditions.

Fig. 5
figure 5

P & O-based MPPT for PMSG wind turbine.

Figure 6 presents the P&O-based MPPT flowchart. A change in power (dP) occurs in PMSG due to the slight increase in (dV) of operating voltage. The voltage perturbation continues in the same direction if dP is positive with a small increment. Conversely, if dP is negative, the operating point shifts further from the MPP, causing the voltage perturbation to reverse direction with a small increment.

Fig. 6
figure 6

P & O-based MPPT flowchart.

The duty cycle (D) variation inversely affects the converter’s input impedance and voltage. The appropriate command for the next cycle is determined by the control algorithm that monitors the output power due to the change in the duty cycle (∆D). The output power increase represents the voltage increase. The proposed algorithm increments the voltage by decrementing the duty cycle to ensure optimal power extraction. The specifications of the PMSG-based wind turbine are given in Table 2.

Table 2 Specification of the PMSG-based wind turbine.

MPC for BESS

The high energy density is preferred in static energy storage systems with low ripple voltage and current on the DC side. The BESS compensates for the power unbalance between the RES and the load. The specification for the BESS is given in Table 3. When power generation surpasses the load demand, the buck mode operation of the bi-directional converter is performed for charging. When the load demand increases or during a shortfall in the generation, the converter operates in boost mode to discharge. The MPC is predictive in nature, which uses a mathematical model to forecast the system’s future behavior by solving an optimization problem at each time step to determine the optimal control action (duty cycle) by minimizing the objective function.

Table 3 Specification of the BESS.

In Fig. 7, Ibatt and Vbatt represent the output current and voltage from BESS, Lb, and Iob are the battery inductor and battery current, iROM represents the current flowing into DCMG loads, the current flowing from DRES is denoted as iRES, the power required by BESS at k + 1th instant is denoted as Pbatt (k + 1). Pbatt*(k + 1) represents the reference power required by BESS at k + 1th instant, Sa and Sb are switches operated by complementary signals, vdc denotes the DC bus voltage. The expression for the boost operation can expressed as follows,

$$\left\{ {\begin{array}{*{20}c} {S_{b} = 1,S_{a} = 0: L_{b} \frac{{dI_{ob} }}{dt} = V_{batt} } \\ { S_{b} = 0,S_{a} = 1: L_{b} \frac{{dI_{ob} }}{dt} = V_{batt} - v_{dc} } \\ \end{array} } \right.$$
(1)
Fig. 7
figure 7

MPC control block diagram for BESS.

The discrete-time model for a sampling interval Ts can be represented as follows:

$$\left\{ {\begin{array}{*{20}c} {S_{b} = 1,S_{a} = 0: I_{ob} \left( {k + 1} \right) = \frac{{T_{s} }}{{L_{b} }}V_{batt} \left( k \right) + I_{ob } \left( k \right)} \\ {S_{b} = 0,S_{a} = 1: I_{ob} \left( {k + 1} \right) = \frac{{T_{s} }}{{L_{b} }}\left( {V_{batt} \left( k \right) - v_{dc} \left( k \right)} \right) + I_{ob} \left( k \right)} \\ \end{array} } \right.$$
(2)

Similarly, the discrete-time models for buck operation can be expressed as follows:

$$\left\{ {\begin{array}{*{20}c} {S_{b} = 0,S_{a} = 1: I_{ob} \left( {k + 1} \right) = \frac{{T_{s} }}{{L_{b} }}\left( { - V_{batt} \left( k \right) + v_{dc} \left( k \right)} \right) + I_{ob} \left( k \right)} \\ {S_{b} = 1,S_{a} = 0: I_{ob} \left( {k + 1} \right) = - \frac{{T_{s} }}{{L_{b} }}V_{batt} \left( k \right) + I_{ob } \left( k \right)} \\ \end{array} } \right.$$
(3)

Integration of RES in HMG configurations produces variable outputs due to fluctuating weather conditions and power consumption patterns. These fluctuations cause the DC bus voltage to oscillate with increased overshoots. Mitigation of the oscillation enhances the proposed system performance. The MPC maintains the DC bus voltage by tuning the duty cycle of the bidirectional converter. The power required by BESS to maintain the power balance within the HMG can be determined as

$$P_{BESS}^{*} \left( {k + 1} \right) = \left| {i_{DC} \left( {k + 1} \right).v_{dc}^{*} } \right|$$
(4)

where \({v}_{dc}^{*}\) denotes the DC bus voltage reference value (\({v}_{dc}^{*}=470 V\)).

The Fig. 8 shows the relationship between the \({v}_{dc}\) and the effect of a capacitor (Cout). The voltage (\({v}_{dc}\)) depends on the current (IC) flowing through it \(({I}_{c}= {C}_{out }\frac{{dv}_{dc}}{dt}\)). The changes in the \({v}_{dc}\) is determined in terms of the change in the current (Ic). The goal is to maintain \({v}_{dc}\) to its rated value \({v}_{dc }^{*}\), but there is a deviation between the actual \({v}_{dc}\) and the desired \({v}_{dc}^{*}\). The deviation is assumed to follow a linear trend over a short period. A reference prediction horizon (N) is incorporated into the system considering the \({v}_{dc}\) deviation cannot be of larger value. In Fig. 8, the \({v}_{dc}(k)\) can either exceed \({v}_{dc}{(k)}_{v}\) or fall \({v}_{dc}{(k)}_{k}\) relative to the \({v}_{dc}^{*}\). Therefore, it must be reduced (from Ovv to Vv) or increased (from Okv to kv) respectively, to approach its target value \({v}_{dc}^{*}\). Consequently, it varies the Ic (k)v and Ic (k)k to step down or step up respectively. \({v}_{dc}^{*}\) is attained to \({v}_{dc}(k)\) through N steps. By considering the next instant as k + 1, vdc (k + 1) is determined as below:

$$v_{dc} \left( {k + 1} \right) = v_{dc} \left( k \right) + \frac{1}{N} \left( {v_{dc}^{*} - v_{dc} \left( k \right) } \right)$$
(5)
Fig. 8
figure 8

Reference design for next instant.

Here, N serves as an integer coefficient that helps to limit the DC capacitor’s current. The Eq. (5) has a twofold purpose: i) it calculates the average rate of voltage change, which is essential for understanding the dynamic behavior of the DC link voltage, and ii) it computes the incremental adjustment required to minimize the deviation between the actual and desired voltage over multiple time steps. By distributing the correction over the horizon N, the control system aims to achieve gradual and stable regulation of the DC link voltage, ensuring optimal converter performance.

When applying Euler’s forward – difference in a discrete-time system, Ic (k + 1) can be,

$$I_{C} \left( {k + 1} \right) = \frac{{C_{out} }}{{NT_{s} }}\left( {v_{dc}^{*} - v_{dc} \left( k \right)} \right)$$
(6)

Based on the slow variation of Vbatt and the equivalence of Ibatt and Iob in steady state, the prediction of output power can be determined as,

$$P_{BESS} \left( {k + 1} \right) = \left| {I_{ob} \left( {k + 1} \right).v_{batt} \left( k \right)} \right|$$
(7)

The objective function given in Eq. (8) should be minimized to obtain the power required by BESS through the buck-boost converter to maintain the power balance within the HMG.

$$C_{p} = \left| {P_{BESS}^{*} \left( {k + 1} \right) - P_{BESS} \left( {k + 1} \right)} \right|$$
(8)

This approach ensures that the DC bus voltages remain stable with less oscillation and reduced overshoot compared to the traditional PI control technique.

PSO-PI based control technique of BIC

PSO is an intelligent optimization algorithm belonging to the metaheuristic class of optimization algorithms that mimics the social behavior of a fish school’s movement and flocks of birds. PSO is computationally easy in terms of memory and processing time and requires fundamental mathematical operators.

PSO searches for optimal solutions by updating generations (iterations). In PSO, a swarm composed of numerous particles, where each particle denotes a potential solution to the optimization problem. Each particle serves as a candidate solution and adjusts its position using new velocity, which incorporates prior velocity and movement vectors based on the best solutions from the past and the best solutions globally. Once the best solution is attained, each particle moves towards the direction of global and local best solutions. When a particle finds a new potential solution, the other particles adjust their positions close to it, allowing them to explore that area further. The steps followed for the proposed PSO algorithm is shown in Fig. 9.

Fig. 9
figure 9

Flow chart for proposed PSO algorithm.

A swarm comprises m particles that navigate through a D-dimensional space with specific velocities. Each particle updates its position based on its own historical best position as well as the best positions of other particles historical position. xi = (xi1,xi2,…,xiD) denotes the position of the ith particle and the ith particle’s velocity is denoted as vi​ = (vi1​,vi2​,…,viD​). The i varies as 1 \(\le\) i \(\le\) D and 1 \(\le\) i \(\le\) m where D and m represent the search space dimension and the swarm’s size, respectively. The ith particle historical best position (Pbest) is denoted as Pi​ = (Pi1​,Pi2​,…,PiD​). The global best position (Gbest) for the entire swarm is represented as PG = ( PG1, PG2,…, PGm), where G  {1,2,…,m}.

The velocities and positions of the particles are updated with respect to the below equations:

$$v_{id} \left( {{\text{k}} + {1}} \right) \, = \omega v_{id} \left( {\text{k}} \right) \, + C_{1} r_{1} \left( {P_{id} \left( {\text{k}} \right) \, - x_{id} \left( {\text{k}} \right)} \right) \, + C_{2} r_{2} \left( {P_{Gd} \left( {\text{k}} \right) \, - x_{id} \left( {\text{k}} \right)} \right)$$
(9)
$$x_{id} \left( {{\text{k}} + {1}} \right) \, = x_{id} \left( {\text{k}} \right) + v_{id} \left( {{\text{k}} + {1}} \right)$$
(10)

where, learning factors are denoted as C1 and C2 which are positive constants, r1 and r2 are random numbers distributed [0,1], \({{x}_{id}\left(\text{k}\right)\text{ and }x}_{id}\)(k + 1) is the vector representing the position of the ith particle at iteration k and k + 1. The ith particle’s velocity at kth and (k + 1)th iteration is defined by \({v}_{id}\)(k) and \({v}_{id}\)(k + 1), \(\omega\) denotes the inertia weight. Equations 9 and 10 govern how each particle modifies its velocity and position based on its own experience (Pbest) and the collective experience of the swarm (Gbest), facilitating effective exploration and convergence towards optimal solutions in the search space.

The swarm size considered for the optimization is 10 and is executed for 30 iterations with C1 = 2 and C2 = 2. The best-fit values initially fluctuated between 0.90 and 0.85 during the early iterations but gradually stabilized to 0.828 after 10 iterations, indicating the convergence graph, as depicted in Fig. 10(a). The statistical analysis, depicted in Fig. 10(b), shows a mean best-fit value of 0.844 with a standard deviation of 0.027, showing that the results are closely clustered around the mean with minimum variability. The maximum and minimum best-fit values observed were 0.900 and 0.828, respectively, resulting in a narrow range of 0.072. This shows the consistent convergence behavior of the PSO algorithm.

Fig. 10
figure 10

Best fit function for the proposed PSO algorithm (a) Best fit, (b) Statistical analysis of PSO best fit function.

The proposed PSO optimization in the current control loop improves the system performance by minimizing the error shown in Fig. 10(a). The performance index chosen for optimization is Integral Time Absolute Error (ITAE), which is given in the equation below.

$${\text{ITAE }} = \mathop \smallint \limits_{0}^{t} t\left| {e_{t} } \right|{\text{dt}}$$
(11)
$${\text{I}}_{{\text{d}}} {\text{I}}_{{{\text{q }}\_{\text{ref}}}} - {\text{ I}}_{{\text{d}}} {\text{I}}_{{{\text{q }}\_{\text{meas}}}} = {\text{ e}}_{{\text{t}}}$$
(12)

where ‘et’ = error,

IdIq _ref = d and q axis reference current,

IdIq _meas = d and q axis current measured from the grid.

The BIC, connected between the AC and DC microgrid, plays a major role in power sharing and operates in two distinct modes: inverter and rectifier operation. In rectifier mode, active power flows from the AC to DC microgrid, whereas in inverter mode, the power flow is vice versa. The PSO-based control algorithm for the BIC proposed in this paper is shown in Fig. 11.

Fig. 11
figure 11

PSO-PI tuned BIC controller.

The BIC control algorithm includes an outer voltage loop and inner current loop, Uref generator produces the switching pulse for BIC. The DC link voltage is regulated by voltage loop, while the inner current loop regulates the active and reactive components (Idm, Iqm) of grid currents. The reference current (Id*) is generated based on the SOC of the BESS, while the Iq_ref current reference is maintained at zero to ensure a unity power factor. The current controller’s output voltages (Vdconv,Vqconv) are transformed into three-phase modulation signals (Uabc_ref) for the PWM generator. The voltage and current controllers and the PLL synchronization unit operate with 100 μs of sampling time. The pulse generator uses a faster sampling time to ensure appropriate-resolution PWM waveforms for the Boost and BIC converters.

Results and discussion

The proposed HMG system constitutes three AC sources (Utility grid, wind and diesel) in AC microgrid and two DC sources (PV and wind) with a BESS in a DC microgrid. The loads include both critical and non-critical loads in AC and DC bus. The efficient power sharing between AC and DC buses are controlled by BIC. The proposed HMG configuration is analyzed in MATLAB simulink under various power generation and load consumption patterns, with source and load ratings provided in Table 4. The details of PV irradiance, wind speed and load variations are given in Table 5. The HMG operates in various modes depending on the power surplus or deficit conditions, as depicted in Table 6. The system performance is evaluated for grid-connected and stand-alone operations. The generation and load conditions mentioned below are simulated for conventional PI and proposed PSO-based control algorithm. The results illustrate that the propounded control strategy performs better compared to conventional in terms of power-sharing, DC bus voltage regulation, overshoot, undershoot and settling time.

Table 4 Power rating of sources and loads.
Table 5 Details of PV, wind and load variations with respect to time.
Table 6 Operational modes and power transfer in the HMG System.

Event 1 (t = 0–0.5 s)

The AC microgrid has a generated power of 24.2 kW (DFIG = 15 kW & Diesel Generator = 9.2 kW), and the DC microgrid has 37.7 kW (PV = 20.5 kW and PMSG = 17.2 kW), resulting in a total power generation of 61.9 kW. The total load demand of the HMG is 42 kW [AC = 10 kW (critical) + 10 kW (non-critical) & DC = 4 kW (critical) + 18 kW (non-critical)]. In this event, the generation of both microgrids is surplus than the load demand, but the battery SOC is less than 70%. Thus, the battery is charged through DC sources, AC sources, and the utility grid with a power of 29.2 kW to maintain the SOC. The BIC transfers Power of 13.5 kW (Pacsp = 4.2 kW and Pgrid = 9.3 kW) from the ACMG to the DCMG. The power generation, load demand, and power transfer between the microgrids of the proposed system are calculated using Eqs. (13)–(15) and tabulated in Table 7. The waveforms of this event are shown in Fig. 12(a–o). From the above discussion, the propounded control technique ensures effective power management between the grids.

$${\text{P}}_{{{\text{ilc}}}} = {\text{ P}}_{{{\text{grid}}}} + {\text{ P}}_{{{\text{acsp}}}}$$
(13)
$${\text{P}}_{{{\text{acsp}} }} = {\text{ P}}_{{{\text{acg}}}} - {\text{ P}}_{{{\text{acd}}}}$$
(14)
$${\text{P}}_{{{\text{dcsp}} }} = {\text{ P}}_{{{\text{dcg}}}} - {\text{ P}}_{{{\text{dcd}}}}$$
(15)
Table 7 Details of HMG power balance for event 1.
Fig. 12
figure 12figure 12

Performance of HMG for event 1. (a) Pdfig, (b) PPV, (c) PMSG output power Ppmsg, (d) Pgrid, (e) Pdie, (f) SOC, (g) Pbc (Conventional), (h) Pbc (Proposed), (i) PBIC (Conventional), (j) PBIC (Proposed), (k) DC and AC bus voltage (Conventional), (l) DC and AC bus voltage (Proposed), (m) Load power in ACMG during event 1, (n) Load power in DCMG during event 1, (o) Visualization of power distribution in event 1.

The AC and DC bus voltages are regulated tightly. The proposed controller attains the DC bus voltage of 470 V at a settling time (ts) of 0.23 s, whereas the conventional controller at ts = 0.67 s. The proposed method performs better in terms of reduced oscillations, peak overshoot and undershoot in battery, BIC and DC bus voltage than the conventional one, shown in Fig. 12(g–l). From the above discussion, it is inferred that the propounded control strategy ensures effective power management between the microgrids and performs better than the conventional under transient conditions.

Event 2 (t = 0.5–2 s)

In this event, the generation of DCMG and diesel on the AC side remains the same as in event 1, whereas the DFIG is decreased to 13.7 kW. The total generation on both sides of microgrids is 60.6 kW, which is greater than the load demand, i.e., 42 kW. The surplus power of DCMG is utilized to charge the battery with 2 kW, and 13.7 kW is transferred to the utility grid through BIC. Thus, the utility grid absorbs 16.6 kW from AC and DC microgrids. The generated power and load demand details are tabulated in Table 8 and the waveforms are shown in Fig. 13(a–m). The power of 2.9 kW and 13.7 kW from the AC and DC sides are supplied to the utility grid and the values are evaluated using the Eqs. (16) and (17).

$${\text{P}}_{{{\text{grid}}}} = {\text{ P}}_{{{\text{acsp}}}} + {\text{ P}}_{{{\text{ilc}}}}$$
(16)
$${\text{P}}_{{{\text{ilc}}}} = {\text{ P}}_{{{\text{dcsp}}}} {-}{\text{ P}}_{{{\text{bc}}}}$$
(17)
Table 8 Details of HMG power balance for event 2.
Fig. 13
figure 13figure 13

Performance of HMG for event 2. (a) Pdfig, (b) PPV, (c) Ppmsg, (d) Pgrid, (e) Pbc (Conventional), (f) Pbc (Proposed), (g) PBIC (Conventional), (h) PBIC (Proposed), (i) DC and AC bus voltage (Conventional), (j) DC and AC bus voltage (Proposed), (k) Load power in ACMG during event 2, (l) Load power in DCMG during event 2, (m) Visualization of power distribution in event 2.

It is inferred from event 2 that Fig. 13(e–j) shows lower oscillations in the battery, BIC, and DC bus voltage in the proposed system compared to the conventional one.

Event 3 (t = 2–13 s)

In this event, various sources’ power generation variations are considered to prove the efficacy of the propounded control strategies. The following are the scenarios considered.

ACMG

  1. 1.

    The diesel generator is cut off.

  2. 2.

    The generation of DFIG varies from 12.3 to 7.6 kW by wind speed variation.

  3. 3.

    The load connected is 20 kW.

DCMG

  1. 1.

    The PMSG generation varies from 12.5 to 8.5 kW by changing the wind velocity from 10.8 to 9.5 m/s.

  2. 2.

    The solar output ranges from 16.5 to 4 kW due to the variation of irradiance from 800 to 200 W/m2 for a time period of 2–10 s. The remaining 10–13 s period has no generation since the irradiance is 0 W/m2.

  3. 3.

    The load connected is 22 kW

ACMG’s generation is less than the load demand; thus, it operates in power deficit (Pacdef) conditions throughout this event. However, in DCMG, surplus power (Pdcsp) conditions prevail for 2–5 s, whereas a power deficit Pdcdef occurs during 5–13 s, not considering the battery as a source. The control strategy proposed has to balance the power generation and load demand. The battery is in 70% SOC condition due to event 2. The battery manages the balance of power generation and load demand by discharging. The battery discharging power varies from 6.6 to 27.2 kW to maintain the power balance on both microgrids. The Pacdef of ACMG varies from 7.7 to 12.4 kW and is balanced by the battery and the generation sources of DCMG through BIC. The power transferred (Pilc) from DCMG to ACMG ranges from 13.0 to 13.7 kW through BIC based on the load demand and generation on DCMG. The surplus power condition prevails in DCMG with battery support throughout this event. Excessive power condition occurs throughout event 3 after meeting the load demands of both microgrids. The additional power generated by the DCMG after meeting the load demands of microgrids is supplied to the grid via BIC, which ranges from 5.9 to 1.3 kW. This event, power generation and load demand are explained in detail in Table 9 and is formulated with the help of the following Eqs. (18)–(20).

$${\text{P}}_{{{\text{ilc}}}} = {\text{ P}}_{{{\text{dcsp}}}} + {\text{ P}}_{{{\text{bdc}}}}$$
(18)
$${\text{P}}_{{{\text{grid}}}} = {\text{ P}}_{{{\text{ilc}} }} {-}{\text{ P}}_{{{\text{acdef}}}}$$
(19)
Table 9 Details of HMG power balance for event 3.

ACMG

$$\begin{gathered} {\text{P}}_{{{\text{surplus}}}} /{\text{ P}}_{{{\text{deficit}}}} \left( {{\text{ACMG}}} \right) \, =_{{}} {\text{P}}_{{{\text{acg}}}} - {\text{ P}}_{{{\text{acd}}}} \hfill \\ {\text{If }} {\text{P}}_{{{\text{surplus}}}} /{\text{ P}}_{{{\text{deficit}}}} \left( {{\text{ACMG}}} \right) \, > \, 0, \, \left\{ {{\text{i}}.{\text{e}}. \, \left( { + {\text{ve}}} \right),{\text{ then P}}_{{{\text{acsp}}}} } \right\} \hfill \\ {\text{If }} {\text{P}}_{{{\text{surplus}}}} /{\text{ P}}_{{{\text{deficit}}}} \left( {{\text{ACMG}}} \right) \, < \, 0, \, \left\{ {{\text{i}}.{\text{e}}. \, \left( { - {\text{ve}}} \right),{\text{ then P}}_{{{\text{acdef}}}} } \right\} \hfill \\ \end{gathered}$$
(20)

DCMG (Battery is not a source)

$$\begin{gathered} {\text{P}}_{{{\text{surplus}}}} /{\text{ P}}_{{{\text{deficit}}}} \left( {{\text{DCMG}}} \right) \, = {\text{P}}_{{{\text{dcg}}}} {-}{\text{ P}}_{{{\text{dcd}}}} \hfill \\ {\text{If }} {\text{P}}_{{{\text{surplus}}}} /{\text{ P}}_{{{\text{deficit}}}} \left( {{\text{DCMG}}} \right) \, > \, 0, \, \left\{ {{\text{i}}.{\text{e}}. \, \left( { + {\text{ve}}} \right),{\text{ then P}}_{{{\text{dcsp}}}} } \right\} \hfill \\ {\text{If }} {\text{P}}_{{{\text{surplus}}}} /{\text{ P}}_{{{\text{deficit}}}} \left( {{\text{DCMG}}} \right) \, < \, 0, \, \left\{ {{\text{i}}.{\text{e}}.. \, \left( { - {\text{ve}}} \right),{\text{ then P}}_{{{\text{dcdef}}}} } \right\} \hfill \\ \end{gathered}$$
(21)

The waveforms related to event 3 are shown in Fig. 14(a–m). It is inferred from the waveforms that the BIC conventional method has more oscillations for the 4–6 s and 8–12 s, whereas the proposed PSO controller has less oscillations. Similarly, the MPC technique proposed for the BESS has lower oscillations than the conventional technique. The DC and AC bus voltages are tightly regulated by the proposed controller than the conventional one. The waveforms of generations from Fig. 14(a) through (c) and loads from Fig. 14(k) and (l) indicate that the power balance is maintained in the HMG. The efficacy of the propounded control strategy outperforms that of the conventional one, which can be inferred from the waveforms.

Fig. 14
figure 14figure 14

Performance of HMG for event 3. (a) Pdfig, (b) PPV, (c) Ppmsg, (d) Pgrid, (e) Pbdc (Conventional), (f) Pbdc (Proposed), (g) PBIC (Conventional), (h) PBIC (Proposed), (i) DC and AC bus voltage (Conventional), (j) DC and AC bus voltage (Proposed), (k) Load power in ACMG during event 3, (l) Load power in DCMG during event 3, (m) Visualization of power distribution in event 3.

Event 4 (t = 13–15 s)

The event is divided into three time intervals, as specified in Table 10. There is no power generation in the ACMG throughout this event, but the load demand of 20 kW remains the same. In DCMG, the PMSG generation is maintained at 8.5 kW, whereas the PV generation varies as 0, 4 kW, and 8.1 kW for the three time intervals. The power generation in DCMG is insufficient for the load demands; thus, the battery has to act as a source to balance the power. The total load demand of 42 kW in HMG cannot be supplied through DCMG sources and the battery. To overcome this, the grid acts as a source to meet load demand. The battery discharging power ranges from 27.1 to 18.8 kW, and the grid delivering power varies from 6.6 to 6.4 kW. The BIC transfers 13.6–13.4 kW from DCMG to ACMG to meet the load demand on the AC side. In an overview of this event, the generation on both sides of the microgrid cannot meet the load demand. Thus, the battery and grid act as a source for power balance in the microgrids. The waveforms of this event are shown in Fig. 15(a–m), and it can be inferred that power balance is attained. The proposed controllers in BIC and BESS have less oscillations compared to conventional throughout the event, and the DC bus voltage regulation is better in the proposed than the conventional, as depicted in Fig. 15(e–j).

Table 10 Details of HMG power balance for event 4.
Fig. 15
figure 15figure 15

Performance of HMG for event 4. (a) Pdfig, (b) PPV, (c) Ppmsg, (d) Pgrid, (e) Pbdc (Conventional), (f) Pbdc (Proposed), (g) PBIC (Conventional), (h) PBIC (Proposed), (i) DC and AC bus voltage (Conventional), (j) DC and AC bus voltage (Proposed), (k) Load power in ACMG during event 4, (l) Load power in DCMG during event 4, (m) Visualization of power distribution in event 4.

Event 5 (t = 15–20 s)

The main idea behind this event formulation is to operate the proposed HMG in island mode. The critical loads of 10 kW and 4 kW in ACMG and DCMG are considered and the non-critical loads are shed down. The generation is zero on the AC side, whereas the DCMG operates in surplus mode, i.e., the generation exceeds the load demand. The PMSG generation is maintained the same as that of event 4, but PV generation varies from 8.1 to 16.5 kW with respect to changes in irradiance. In this event, the battery is a sink, thus charged with the DC side’s excess power ranging from 2.6 to 11 kW. The BIC supplies power of 10 kW from DCMG to AC side critical load. The grid neither absorbs nor delivers power. The Fig. 16(a–m) depict the waveforms of this event. Table 11 explains the power management of this event. The power balance values in Table 11 are calculated as per the Eqs. (22) and (23).

$${\text{P}}_{{{\text{bc}}}} = {\text{ P}}_{{{\text{dcsp}}}} - {\text{ P}}_{{{\text{acd}}}}$$
(22)
$${\text{P}}_{{{\text{ilc}}}} = {\text{ P}}_{{{\text{dcsp}}}} - {\text{ P}}_{{{\text{bc}}}}$$
(23)
Fig. 16
figure 16figure 16

Performance of HMG for event 5. (a) Pdfig, (b) PPV, (c) Ppmsg, (d) Pgrid, (e) Pbc (Conventional), (f) Pbc (Proposed), (g) PBIC (Conventional), (h) PBIC (Proposed), (i) DC and AC bus voltage (Conventional), (j) DC and AC bus voltage (Proposed), (k) Load power in ACMG during event 5, (l) Load power in DCMG during event 5, (m) Visualization of power distribution in event 5.

Table 11 Details of HMG power balance for event 5.

The comparison of proposed and conventional control in terms of overshoot, undershoot and settling time at time t = 15 s is shown in Table 13. The % overshoot and undershoot of DC bus voltage with the proposed control are 21.5 and 9.5 at 15 s, whereas they are 28.5 and 17.6 with the conventional control. The oscillation in BIC, battery and DC bus voltage are less, exhibiting that the propounded controller performs better than the conventional controller.

Event 6 (t = 20–22 s)

The DCMG generation is 29 kW (Ppmsg = 8.5 kW + Ppv = 20.5 kW), and the generation in ACMG is null. Event 6 is divided into two-time intervals. The load demand on the DC side is 22 kW for the first interval and increased to 24 kW for the second interval. However, on the AC side, the load is constant at 20 kW. The generation is surplus on DC side, but this surplus power is insufficient to supply power to the AC side. Thus, battery and grid act as sources to meet the demand for AC. The grid delivers 6.5 kW, and the BIC transfers 13.5 kW from DC to AC. The battery and DC side sources manage the load demand increase to maintain power balance conditions between the grids. The battery discharges 6.5 kW and 8.5 kW at the 1st and 2nd time interval. Details of this event are given in Table 12. The % overshoot and undershoot of the DC bus voltage for the proposed control is 16.8 and 17.2 at 20 s, whereas the values are higher for conventional control, as shown in Table 13 and Fig. 17. The load variation occurs during the periods mentioned above. The oscillations in the proposed BESS and BIC are less, as indicated in the waveforms Fig. 18(e–h). The above discussions prove the efficacy of the propounded system compared to the conventional system. The waveforms for event 6 are shown in Fig. 18(a–m). The line chart represented in Fig. 19 denotes the consolidated power distribution across all six simulated events. This shows the power generation contributions from all connected sources and the corresponding load demands of HMG.

Table 12 Details of HMG power balance for event 6.
Table 13 Performance comparison on DC bus voltage.
Fig. 17
figure 17

Comparison of the conventional and proposed algorithm.

Fig. 18
figure 18figure 18

Performance of HMG for event 6. (a) Pdfig, (b) PPV, (c) Ppmsg, (d) Pgrid, (e) Pbdc (Conventional), (f) Pbdc (Proposed), (g) PBIC (Conventional), (h) PBIC (Proposed), (i) DC and AC bus voltage (Conventional), (j) DC and AC bus voltage (Proposed), (k) Load power in ACMG during event 6, (l) Load power in DCMG during event 6, (m) Visualization of power distribution in event 6.

Fig. 19
figure 19

HMG generation and load variations.

Conclusion

In this paper, a hybrid microgrid architecture with diverse distributed energy sources, such as solar, wind, and a diesel generator, are integrated with the utility grid and the BESS. The developed PSO-PI-based control strategy for BIC significantly enhances transient stability and maintains the optimal power transfer between AC and DC microgrids. This ensures a reliable and continuous power supply to critical and non-critical loads. An ANFIS-based MPPT controller for the PV system ensures fast and accurate power tracking under varying irradiance conditions. The model predictive controller governs the operation of the bidirectional converter of the BESS, thus effectively maintaining the DC bus voltage regulation amidst various power generation and load conditions under grid-connected and islanding modes of operation. The proposed control strategy is validated in MATLAB/Simulink. The simulated results and analyses prove the superiority of the proposed controllers over the conventional controllers in terms of DC and AC bus voltage regulation and power sharing with less oscillations, overshoot, and undershoot under dynamic operating conditions. These findings show that the proposed HMG control and power management framework enhances flexibility, reliability, and resilience, contributing to the development of sustainable and efficient energy infrastructures.

Future direction of the work

The proposed HMG can be further validated in real time and extended by integrating Hybrid Energy Storage Solutions (HESS), such as solid-state batteries or hydrogen storage systems, to enhance overall efficiency and extend the lifespan of storage units. Moreover, while the present work focuses on dynamic performance under varying generation and load conditions, a comprehensive investigation of balanced and unbalanced fault scenarios will be pursued in future studies to thoroughly evaluate the robustness of the proposed controllers under fault conditions. In addition, Artificial Intelligence (AI) and Machine Learning (ML) algorithms may be incorporated with HESS in HMGs and extended to the multi-microgrid concept for intelligent, adaptive, and predictive energy management.