## 1 Introduction
Furthermore, when two modes of the MG are offered in the model then switching between the islanding and grid-connected mode will fluctuate the DC and AC bus which can be devastating for the power system. Hence, a more accurate, adaptive, and efficient control law is compulsory for the stability of the microgrid under capricious generation, loads demand, and operating conditions. Therefore, this work proposes a barrier function-based adaptive sliding mode (BFASMC) controller for hybrid renewable energy sources based AC/DC microgrid with an energy storage system. Simple SMC and Lyapunov controllers are not preferred because the hit and trial method is used to tune their parameters which may cause chattering and fluctuations in its operation and shows high transient values during initial and varying conditions which are not admissible in the MG system. Double integral SMC eliminates the chattering issue but still shows high transients, and during the switching between the modes of the MG, there may occur huge oscillations at the DC and AC bus. The integral back-stepping controller becomes very complex due to the virtual controller's introduction, and there may come computational restrictions for multiple DGs. Therefore, a barrier function-based adaptive SMC is proposed which offers simple structure, chattering free operation, adaptive nature, enhanced robustness to different disturbances, the inessential limit of upper-bound uncertainties, and better performance than exiting controllers and, also, this technique is not implemented on such models before. The adaptive behavior of the controller will cause fewer transients during the mode switching of the MG. Figure 1 reveals the proposed hybrid AC/DC microgrid model. It carries a wind energy system (WES), PV panels stack, energy storage system (battery), a common AC/DC bus, and AC/DC loads. The wind energy unit is comprised of a wind turbine attached with PMSG, and its output is forwarded to the bridge rectifier, and then a DC-DC boost converter connects the system with a DC-link bus. The PV stack connects with the DC-link bus via a non-inverting buck-boost converter. Additionally, the battery as an energy storage unit connects with the DC bus via a buck-boost converter. The control unit is divided into two parts. 1. **Low-Level Control:** It ensures the regulation of input and output current flow from power converters referred to their reference signals produced by the high-level controller;
2. **High-Level Control:** It ensures the AC/DC microgrid's stability by monitoring the state of charge (SoC). In this research work, common AC and DC bus voltage regulation under load varying conditions, external disturbances or uncertainties, and impulsiveness of RES are studied. Furthermore, the practical performance of the controller's efficiency is validated using real-time hardware-in-loop analysis. This study offers the following significant contributions:  
1. Multiple control laws to ensure the stability of the DC bus and AC bus under the load varying conditions, external disturbances, and impulsiveness of RESs;
2. Global modeling of the system and implementation of BFASMC controller;
3. Real-time hardware-in-loop (HIL) analysis, which, validates the efficiency for the practical implementation of the controller. This manuscript is organized in the following sections as AC/DC microgrid with mathematical modeling and global modeling is presented in Section 3. Section 3.2 introduces the BFASMC and designs the control strategies. Section 4 presents the experimental and simulation-based results, and finally, the manuscript is concluded in Section 5.