A micro-grid system cabinet based on parallel and off-grid bidirectional seamless switching and a control method thereof

CN122951208APending Publication Date: 2026-10-20SHENZHEN YONGTAI DIGITAL ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611424425.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

传统切换方式多采用被动式触发切换,并网切换时微电网与大电网之间存在电压幅值、相位和频率偏差,合闸瞬间会产生数倍于额定电流的冲击电流,极易造成逆变器、断路器、储能变流器等电力设备过载损坏,同时引发电网谐波畸变,影响系统电能质量;离网切换瞬间功率供需突变,易产生负荷侧冲击电流,导致保护装置误动作跳闸

Benefits of technology

[0012]本发明解决了背景技术中存在的技术缺陷,本发明具备以下有益效果:通过预同步调控、无间断供电控制、自适应限流与阻尼闭环控制以及稳态修正的协同配合,在并网与离网双向切换过程中避免了直接分合闸引起的冲击电流和短时停电,有效抑制了切换瞬间的功率振荡和电压频率波动,实现了微电网的无缝无冲击切换,显著提升了重要负荷的供电连续性和供电可靠性;同时,通过MGCC模块的工况预判、分级减载、柴发重启自愈及光伏功率协调控制,增强了系统对电网故障、负荷突变和能源波动的适配能力与容错能力,降低了设备过载损坏风险,提高了微电网整体运行稳定性和安全性,并有利于提升可再生能源消纳水平和降低系统运行成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a microgrid system cabinet and control method based on seamless bidirectional switching between grid-connected and off-grid environments, relating to the field of energy storage technology. The control method includes: real-time acquisition of operating parameters; the MGCC module predicting switching needs in advance and outputting a pre-regulation trigger signal; responding to the pre-regulation signal to perform pre-synchronization regulation; locking steady-state parameters and pre-loading the energy storage main control unit from PQ control to VSG control parameters during grid-connected to off-grid transition; fine-tuning based on grid parameters during off-grid to grid-connected transition; locking the bus voltage through the STS module and PCS in collaboration during pre-synchronization; initiating adaptive current limiting and damping closed-loop control at the moment of switching; controlling the STS module to operate without impact after parameter stabilization; and dynamically fine-tuning control parameters by the steady-state correction module after switching. This invention achieves seamless bidirectional switching between grid-connected and off-grid environments in microgrids, improving power supply reliability and system stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy storage technology, and in particular to a microgrid system cabinet and control method based on seamless bidirectional switching between grid and off-grid. Background Technology

[0002] As a core carrier for distributed energy consumption and independent regional power supply, microgrids possess two core modes: grid-connected operation and off-grid islanded operation. They can flexibly switch between these modes based on the operating status of the main grid, load demand, and energy output, making them an important component of smart grids and integrated energy systems. In grid-connected mode, microgrids rely on the main grid to clamp voltage and frequency, smoothing out fluctuations in distributed energy output. In off-grid mode, microgrids rely on energy storage, diesel generator sets, and other main control units to independently stabilize voltage and frequency, ensuring power supply to local loads.

[0003] Currently, existing microgrid grid-connected / off-grid switching control technologies still have the following core defects, which seriously restrict the power supply reliability and operational safety of microgrids: 1. Large inrush current during switching, resulting in severe equipment losses. Traditional switching methods mostly use passive triggering switching. During grid-connected switching, there are voltage amplitude, phase, and frequency deviations between the microgrid and the main grid. At the moment of closing, an inrush current several times the rated current will be generated, which can easily cause overload damage to power equipment such as inverters, circuit breakers, and energy storage converters. At the same time, it will cause harmonic distortion of the grid and affect the power quality of the system. During off-grid switching, the power supply and demand change suddenly, which can easily generate inrush current on the load side, causing the protection device to trip malfunction.

[0004] 2. Short-term power outages exist, making it impossible to guarantee uninterrupted power supply. Traditional software and hardware switching has millisecond-level action delays. During mode switching, there is a time difference between the main control unit's control strategy switching and the circuit breaker's opening and closing actions, which can cause short-term power outages for critical loads. This cannot meet the uninterrupted power supply requirements of first-level critical loads such as medical facilities, data centers, and industrial precision equipment, and can easily lead to safety accidents such as production failures, data loss, and equipment damage.

[0005] 3. High risk of system oscillation and instability after switching. At the moment of switching from grid connection to off-grid, the system loses the support of the main power grid for voltage and frequency stabilization. The output fluctuation of distributed energy and the sudden change of load will cause low-frequency oscillation of voltage and frequency. At the moment of switching from off-grid to grid connection, the bidirectional interactive change of power can easily lead to system power oscillation and excessive voltage deviation. In severe cases, it can cause microgrid disconnection and system paralysis.

[0006] 4. Poor adaptability and weak fault tolerance of control strategies. Existing switching control is mostly based on fixed threshold triggering and single parameter regulation. It does not realize full-process control of pre-switching prediction and pre-regulation, dynamic adaptation during switching, and steady-state correction after switching. When faced with complex operating conditions such as grid voltage drop, frequency deviation, and sudden load change, it is very easy to encounter problems such as switching failure and system instability.

[0007] In addition, some existing technologies achieve synchronous switching through simple phase-locked control, but can only optimize phase matching and cannot take into account amplitude and frequency coordinated calibration, making it difficult to completely eliminate inrush current; some uninterruptible power supply solutions rely on hardware redundancy backup, which is costly, difficult to modify, and cannot effectively suppress switching oscillations.

[0008] Therefore, there is an urgent need to develop a seamless and shock-free switching control technology for microgrids during the grid connection and disconnection process that is full-process, high-precision, and highly fault-tolerant, in order to solve the three core problems of switching impact, short-term power outage and oscillation instability, and achieve uninterrupted power supply to important loads. Summary of the Invention

[0009] This invention overcomes the shortcomings of the prior art and provides a microgrid system cabinet and control method based on seamless bidirectional switching between grid and off-grid systems.

[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The first aspect of this invention discloses a control method for a microgrid system cabinet based on seamless bidirectional switching between grid and off-grid systems. The system cabinet includes an MGEMS module, an MGCC module, an STS module, an ATS module, a renewable energy distribution module, a mains power connection switch, a diesel generator connection switch, a load switch, a load shedding module, and a power quality acquisition meter. The system cabinet is connected to an energy storage unit, a photovoltaic inverter unit, and a diesel generator. The MGCC module includes a pre-synchronization control module, an uninterrupted power supply control module, a current-limiting damping module, and a steady-state correction module. The control method includes the following steps: The MGCC module collects the operating parameters of the large power grid and microgrid in real time. Based on the collected parameters, it determines the operating conditions of the large power grid fault, power grid recovery or load change in real time, predicts the switching demand in advance and outputs the pre-control trigger signal and mode switching command. It does not directly execute the opening or closing of the switch when the switching is triggered. In response to the pre-regulation trigger signal, the pre-synchronization regulation module performs pre-synchronization regulation: when switching from grid connection to off-grid, the steady-state voltage, frequency, and phase parameters of the current microgrid are locked, and the energy storage main control unit is preloaded from the grid-connected PQ control mode to the off-grid VSG control parameters; when switching from off-grid to grid connection, the output parameters of the microgrid are gradually fine-tuned based on the voltage, frequency, and phase parameters of the main grid until the voltage deviation, frequency deviation, and phase deviation meet the preset grid connection conditions. During the pre-synchronization control process, the uninterrupted power supply control module, through the STS module and the PCS of the energy storage unit, performs uninterrupted power supply control to lock the bus output voltage and maintain continuous power supply to the load. At the moment of switching, the current limiting and damping module initiates adaptive current limiting to suppress power surges and engages damping closed-loop control to smooth voltage fluctuations. Once the parameters of the microgrid and the main grid stabilize, the STS module is controlled to perform shockless tripping or closing, completing the bidirectional mode switching between grid-connected and off-grid modes. After the switch is completed, the steady-state correction module dynamically fine-tunes the control parameters to bring the system into steady-state operation.

[0011] The second aspect of this invention discloses a microgrid system cabinet based on seamless bidirectional switching between grid and off-grid operation, comprising: The MGEMS module is used to track the SOC, charge and discharge power, and voltage of energy storage batteries in real time, perform photovoltaic prediction and real-time power detection, and upload data to the cloud server. The MGCC module has a built-in power grid anomaly detection threshold and mode switching trigger logic. It is used to determine the power grid fault, power grid recovery, and load change conditions in real time based on the collected parameters, predict the switching needs in advance, and output the pre-control trigger signal and mode switching command. The STS module, in conjunction with the PCS of the energy storage unit, is used to switch between off-grid and grid-connected modes. The ATS module is used to select between mains power supply and diesel generator power supply. The new energy distribution module is used for access and distribution of energy storage power supply and photovoltaic power supply, as well as AC coupling. The load shedding module is used to cut off the power supply to non-critical loads under conditions of energy shortage, so as to ensure uninterrupted power supply to critical loads. Mains power connection switch, diesel generator connection switch, load switch; Power quality acquisition meter; The MGCC module is communicatively connected to the MGEMS module, STS module, ATS module, new energy distribution module, load shedding module, mains power access switch, diesel generator access switch, load switch, and power quality acquisition meter, respectively; the STS module is connected to the PCS, ATS module, and load switch of the energy storage unit; the ATS module is connected to the mains power access switch and diesel generator access switch, respectively; the new energy distribution module is connected to the energy storage unit, photovoltaic inverter unit, and load switch; The MGCC module is also used to execute any of the control methods described above.

[0012] This invention addresses the technical deficiencies in the prior art and offers the following advantages: Through the coordinated operation of pre-synchronous regulation, uninterrupted power supply control, adaptive current limiting and damping closed-loop control, and steady-state correction, it avoids inrush currents and short-term power outages caused by direct switching during grid-connected and off-grid bidirectional switching. This effectively suppresses power oscillations and voltage frequency fluctuations during switching, achieving seamless and shock-free switching of the microgrid and significantly improving the continuity and reliability of power supply to critical loads. Simultaneously, through the MGCC module's condition prediction, graded load reduction, diesel generator restart self-healing, and photovoltaic power coordination control, it enhances the system's adaptability and fault tolerance to grid faults, load mutations, and energy fluctuations, reducing the risk of equipment overload damage, improving the overall operational stability and safety of the microgrid, and contributing to increased renewable energy consumption and reduced system operating costs. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained from these drawings without creative effort.

[0014] Figure 1 Schematic diagram of the first process for grid connection startup; Figure 2 Schematic diagram of the second process for grid connection startup; Figure 3 This is a flowchart illustrating the first step of the grid-connected to off-grid transition process. Figure 4 This is a flowchart illustrating the second process for switching from grid connection to off-grid operation. Figure 5 Flowchart for the off-grid to on-grid conversion process; Figure 6 This is a flowchart of the shutdown procedure. Detailed Implementation

[0015] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit the scope of protection of this application.

[0016] To facilitate understanding, we will first explain some of the English abbreviations that appear in the instruction manual: MGEMS (Microgrid Energy Management System): microgrid energy management system module; MGCC (Microgrid Central Controller): microgrid central controller module; STS (Static Transfer Switch): static transfer switch module; ATS (Automatic Transfer Switch): automatic transfer switch module; PCS (Power Conversion System): energy storage converter, that is, the power conversion device in the energy storage unit; SOC (State of Charge): battery state of charge; VSG (Virtual Synchronous Generator): virtual synchronous generator; PQ control: constant power control, that is, active / reactive power control; EMS (Energy Management System): energy management system; THDU: total voltage harmonic distortion rate; N phase: neutral line; diesel generator: diesel generator.

[0017] I. System Architecture This embodiment provides a microgrid system cabinet based on grid-connected / off-grid bidirectional seamless switching. The system cabinet includes an MGEMS module, an MGCC module, an STS module, an ATS module, a new energy distribution module, a utility power access switch, a diesel generator access switch, a load switch, a load shedding module, and a power quality acquisition electric meter. The external devices supporting the system cabinet include an energy storage unit, a photovoltaic inverter unit, and a diesel generator, which together form a complete microgrid system.

[0018] Wherein, the MGEMS module is used for real-time tracking of the SOC, charging and discharging power, and voltage of the energy storage battery, for photovoltaic prediction and real-time power detection, and for uploading data to the cloud server. The MGEMS module can obtain the operating states of the energy storage unit and the photovoltaic inverter unit, providing a data basis for energy management.

[0019] The MGCC module is built-in with a grid abnormality determination threshold and mode switching trigger logic, which is used to determine operating conditions such as large grid faults, grid recovery, and load sudden changes in real time according to collected parameters, predict switching demands in advance, and output pre-regulation trigger signals and mode switching instructions. As the core control unit, the MGCC module is communicatively connected with the MGEMS module, STS module, ATS module, new energy distribution module, load shedding module, utility power access switch, diesel generator access switch, load switch, and power quality acquisition electric meter, and performs data interaction with the PCS of the energy storage unit and the photovoltaic inverter unit through the communication bus at the same time.

[0020] The STS module works in conjunction with the PCS of the energy storage unit to switch between off-grid and grid-connected modes. The STS module preferably uses a thyristor- or IGBT-based static transfer switch, enabling microsecond-level power circuit switching and thus seamless switching between grid-connected and off-grid modes. The input terminals of the STS module are connected to the mains side (via the ATS module) and the output terminal of the energy storage unit's PCS, respectively, while the output terminal is connected to a load switch to supply power to critical loads.

[0021] The ATS module is used to select between mains power and diesel generator power supply. The input side of the ATS module is connected to both the mains power supply switch and the diesel generator power supply switch, while the output side is connected to the mains power input terminal of the STS module. When the mains power is normal, the ATS module selects mains power supply; when the mains power is lost and the diesel generator is required to provide load, the ATS module switches to diesel generator power supply.

[0022] The new energy distribution module is used for the access and distribution of energy storage power supply and photovoltaic power supply, as well as AC coupling, to achieve the design of maximizing the power of new energy access. The input side of the new energy distribution module is connected to the output of the energy storage unit PCS and the output of the photovoltaic inverter unit, and the output side is connected to the load switch or AC bus to achieve AC coupling.

[0023] The load shedding module is used to cut off power to non-critical loads under conditions of energy shortage, ensuring uninterrupted power supply to critical loads. The load shedding module includes multiple controllable switches or contactors, which control the connection of general loads and critical loads respectively. The MGCC module performs graded load shedding control based on the system status.

[0024] The mains power supply switch, diesel generator supply switch, and load switch are used to control the on / off state of the mains power, diesel generator, and load circuits, respectively.

[0025] The power quality acquisition meter is used to collect parameters such as bus voltage, current, frequency, phase, and harmonics, and transmits the collected data to the MGCC module.

[0026] The connections between the modules are as follows: the MGCC module is connected to the MGEMS module, STS module, ATS module, new energy distribution module, load shedding module, mains power access switch, diesel generator access switch, load switch, and power quality acquisition meter; the STS module is connected to the PCS, ATS module, and load switch of the energy storage unit; the ATS module is connected to the mains power access switch and diesel generator access switch; and the new energy distribution module is connected to the energy storage unit, photovoltaic inverter unit, and load switch.

[0027] The mains power is connected to the ATS module via the mains power connection switch, and the diesel generator is connected to the ATS module via the diesel generator connection switch. The ATS module output is connected to the mains power input of the STS module. The output of the energy storage unit PCS and the photovoltaic inverter unit are connected to the renewable energy distribution module, and the output of the renewable energy distribution module is connected to the off-grid input of the STS module. The output of the STS module is connected to critical loads and general loads via load switches. The MGCC module is connected to each module via a communication bus to realize data acquisition and control command issuance. All modules are integrated in the system cabinet, and external devices are connected through the cabinet interface.

[0028] II. Core System Functions The core functions of this system cabinet include: Seamless millisecond-level switching between parallel and off-grid modes: Through collaborative processing of PCS and STS, the goal of switching time between parallel and off-grid modes is achieved to ≤100ms. Specifically, PCS completes control mode preloading before switching, and STS performs rapid and shockless opening and closing after parameters stabilize.

[0029] Adaptive droop control and VSG virtual synchronous machine control: By coordinating the work of the controller and the PCS, adaptive droop control, VSG virtual synchronous machine, and secondary voltage and frequency regulation are achieved to maintain the system power frequency and achieve the goals of voltage deviation ±3%, frequency deviation ±0.2Hz, harmonic distortion rate THDU≤3%, and three-phase imbalance meeting the standard requirements.

[0030] Multi-energy complementary optimized dispatch: Energy is rationally dispatched based on principles such as economy and capacity priority. During grid connection, the power allocation of the station-level EMS uses the grid side as the grid-connecting source, photovoltaic as the primary utilization source, and energy storage as an auxiliary source to achieve uninterrupted power supply to the load and avoid grid overload, with a safe SOC of energy storage ≥ 20%. During off-grid operation, the power allocation of the station-level EMS uses the converter as the grid-connecting source, photovoltaic as the primary utilization source, and diesel generator as an auxiliary source to achieve uninterrupted power supply to the load and avoid grid overload, with a safe SOC of energy storage ≥ 50%.

[0031] Active safety protection and self-healing control: The site EMS, through the connection of low-level sampling, feedback and execution devices such as electricity meters, STS, N-phase grounding relays, and load shedding relays, can achieve overload current detection, accurate islanding detection, off-grid N-phase grounding, rapid fault clearing, graded load reduction and black start self-healing control in weak grid scenarios, so as to ensure the safety of equipment and personnel.

[0032] Multiple application modes: Based on the system's ability to switch between on-grid and off-grid, it forms business functions such as timed charging and discharging, self-generation and self-consumption, scheduled charging and discharging, and backup power to meet the needs of customer application scenarios.

[0033] III. Control Methods This embodiment provides a control method for a microgrid system cabinet based on seamless bidirectional switching between grid and off-grid, executed by the MGCC module. This control method includes seamless, shock-free switching procedures from grid to off-grid and from off-grid to grid, and is implemented throughout the system operation process.

[0034] (I) Overall Control Process like Figure 1 , Figure 2 As shown, the MGCC module collects the operating parameters of the large power grid and microgrid in real time. Based on the collected parameters, the module determines the operating conditions of the large power grid fault, power grid recovery or load change in real time, predicts the switching demand in advance and outputs the pre-control trigger signal and mode switching command. When the switching is triggered, the MGCC module does not directly execute the opening or closing of the circuit breaker.

[0035] In response to the pre-regulation trigger signal, pre-synchronization regulation is performed: when switching from grid connection to off-grid, the steady-state voltage, frequency, and phase parameters of the current microgrid are locked, and the energy storage main control unit is preloaded from the grid-connected PQ control mode to the off-grid VSG control parameters; when switching from off-grid to grid connection, the output parameters of the microgrid are gradually fine-tuned until the voltage deviation, frequency deviation, and phase deviation meet the preset grid connection conditions, based on the voltage, frequency, and phase parameters of the main grid.

[0036] During the pre-synchronization control process, the STS module and the PCS of the energy storage unit work together to perform uninterrupted power supply control, lock the bus output voltage, and maintain continuous power supply to the load.

[0037] Adaptive current limiting is activated at the moment of switching to suppress power surges, and damping closed-loop control is engaged to smooth voltage fluctuations.

[0038] Once the parameters of the microgrid and the main grid stabilize, the STS module is controlled to perform shockless tripping or closing, completing the bidirectional mode switching between grid-connected and off-grid modes.

[0039] After the switch is completed, the steady-state correction module dynamically fine-tunes the control parameters to bring the system into steady-state operation. The steady-state correction module can be integrated into the MGCC module and is achieved through secondary voltage and frequency regulation and droop control.

[0040] (II) Specific procedures for grid-connected to off-grid switching like Figure 3 , Figure 4 As shown, when the main grid voltage is detected to drop to 80% of the rated value, the MGCC module triggers a pre-switching command and does not directly trip the circuit breaker. The parameter acquisition module monitors the main grid voltage, frequency, and phase in real time, and determines that the grid voltage exceeds the limit when the voltage drops to 80% of the rated value.

[0041] The pre-synchronization control module locks the current microgrid's steady-state voltage of 380V, frequency of 50Hz, and phase steady-state parameters, pre-loading the energy storage main control unit from grid-connected PQ control mode to off-grid VSG control parameters. Specifically, the pre-synchronization control module sends a mode switching command to the energy storage unit's PCS via the communication interface. While maintaining power output, the PCS switches its control algorithm from PQ control to VSG control parameter pre-loading, enabling the PCS to simulate the inertia and damping characteristics of a synchronous generator, providing voltage and frequency support for off-grid operation.

[0042] The uninterruptible power supply (UPS) control module locks the bus output voltage to maintain continuous power supply to the load. During the pre-synchronization process, the STS module keeps both the grid side and the off-grid side connected simultaneously, and the energy storage PCS continuously supplies power to the load. The bus voltage is supported by both the grid power and the energy storage PCS, so there are no power outages for the load.

[0043] The current-limiting damping module initiates adaptive current limiting to suppress the power surge during grid disconnection and engages damping closed-loop control to smooth voltage fluctuations. Adaptive current limiting dynamically adjusts the PCS current reference limit by detecting the rate of change of the PCS output current, thus limiting the inrush current during switching. Damping closed-loop control suppresses voltage oscillations through proportional-derivative adjustment using a virtual damping resistor or feedback bus voltage deviation.

[0044] Once the parameters stabilize, the STS module trips without impact, and the microgrid enters off-grid islanded operation mode. At this time, the mains power is disconnected, and the energy storage PCS independently stabilizes voltage and frequency in VSG mode to supply power to the load. The steady-state correction module dynamically fine-tunes the control parameters to ensure that the bus voltage fluctuation is ≤±1% and the frequency fluctuation is ≤±0.05Hz, while ensuring uninterrupted power supply to important loads throughout the process.

[0045] (III) Specific procedures for switching from off-grid to on-grid like Figure 5 As shown, when the power grid fault is recovered, and the voltage, frequency, and phase return to their rated standards and remain stable for 300ms, the MGCC module determines that the power grid meets the grid connection conditions. Specifically, the MGCC module continuously monitors the voltage, frequency, and phase of the power grid. When all three are within their rated range and remain stable for 300ms, the power grid is considered to meet the grid connection conditions.

[0046] The pre-synchronization process is initiated, using the main grid parameters as a benchmark, and gradually fine-tuning the microgrid output parameters to ensure that the voltage deviation is ≤2%, the frequency deviation is ≤0.1Hz, and the phase deviation is ≤1°. During the pre-synchronization process, the MGCC module adjusts the voltage and frequency reference values ​​of the energy storage PCS to make the microgrid output voltage track the main grid voltage, gradually reducing the deviation.

[0047] The soft-start current limiting strategy is activated in advance to predict the power difference between the microgrid and the grid and set a dynamic current limiting threshold. The MGCC module calculates the power difference after grid connection based on the current microgrid load power and the output power of the energy storage PCS, and sets the soft-start current limit value of the PCS to ensure that the current at the moment of closing does not exceed the set threshold.

[0048] After parameter synchronization is completed, the energy storage main control unit is switched from VSG control to PQ control. During the switching process, the voltage output remains stable and the load is not interrupted. Specifically, the MGCC module sends a mode switching command to the energy storage PCS. While maintaining voltage output, the PCS switches the control algorithm from VSG control to PQ control, ensuring a smooth transition.

[0049] The STS module accurately closes the circuit breaker, completing the grid connection switchover. Since the voltage, frequency, and phase already meet the grid connection conditions before closing, and the PCS has been switched to PQ control mode, the instantaneous inrush current upon closing is ≤1.2 times the rated current, with no harmonic distortion or power oscillation.

[0050] The steady-state correction module continuously optimizes system parameters, entering fully steady-state operation within 100ms. At this point, the microgrid is integrated into the main grid, which provides voltage and frequency support, and the energy storage PCS operates according to preset power commands.

[0051] (iv) Control of grid-connected operation conditions When the mains circuit breaker is closed, the mains power is available, and the current operating mode is suitable for grid-connected operation, the system operates according to the grid-connected operation mode.

[0052] like Figure 1 , Figure 2 As shown, the startup sequence is as follows: Control all energy storage devices to enter standby mode; control the ATS to switch to the grid; wait for the STS to close; close the general load contactor; start all energy storage devices; start all photovoltaic inverters. If reverse current protection is enabled, the photovoltaic inverters will start after at least one energy storage device has successfully started; otherwise, both energy storage and photovoltaic inverters will start simultaneously. Startup is considered complete once at least one energy storage device has successfully started and a startup command has been issued to all photovoltaic inverters. If the STS requires off-grid activation for energy storage, the startup sequence changes to: ATS to switch to the grid; off-grid startup of all energy storage devices; wait for the STS to close; close the general load contactor; start all photovoltaic inverters.

[0053] like Figure 6 As shown, the shutdown sequence is as follows: reduce the power target of the photovoltaic inverter and energy storage equipment to 0; shut down all photovoltaic inverters and energy storage equipment; switch the control ATS to the off state; disconnect the general load contactor.

[0054] Under grid-connected operation, the following working modes can be selected through the strategy template: timed charging and discharging, backup power, scheduled charging and discharging, manual control, self-generation and self-consumption enhancement mode, battery maintenance, and peak shaving and valley filling.

[0055] like Figure 3 , Figure 4 As shown, the transition from grid-connected operation to off-grid energy storage with load is as follows: If the mains circuit breaker trips, mains power is lost, or the current operating mode is set to off-grid operation or diesel generator load mode, and the minimum SOC of the energy storage device is greater than the off-grid start-up SOC of the diesel generator by the site's EMS, then the EMS will automatically switch to off-grid energy storage with load mode. The switching sequence is: disconnect the ATS to the disconnected state; wait for the STS to automatically disconnect; enter the off-grid energy storage with load mode.

[0056] Switching from grid-connected operation to diesel generator load operation: If the mains circuit breaker is open, mains power is lost, or the current operating mode is set to off-grid operation or diesel generator load operation, and the minimum SOC of the energy storage device is less than or equal to the off-grid start point of the diesel generator via the site's EMS, and the diesel generator circuit breaker is closed, then the EMS will automatically switch to diesel generator load operation. The switching sequence is as follows: control the ATS to switch to the off state; wait for the STS to automatically disconnect; start the diesel generator; control the ATS to switch to the diesel generator end; wait for the STS to automatically close; enter the diesel generator load operation mode.

[0057] (v) Off-grid energy storage under load operation control When the mains circuit breaker is disconnected, mains power is lost, or the current time period's strategy template is off-grid operation or diesel generator load, and the battery SOC is greater than the site EMS off-grid start diesel generator SOC start point, the system operates according to the energy storage off-grid load condition.

[0058] The startup sequence is as follows: switch the ATS to the off state; start all energy storage devices; close the general load contactors; start all photovoltaic inverters, and only start the photovoltaic inverters after the main energy storage device has successfully started. Startup is considered complete once a startup command has been issued to all photovoltaic inverters.

[0059] The shutdown sequence is as follows: shut down all photovoltaic inverters; shut down all energy storage devices; disconnect the general load contactors.

[0060] Under off-grid load conditions, the energy storage system can only operate in off-grid mode. Users can actively enter the off-grid load scenario by selecting either off-grid operation or diesel generator load mode through a policy template, provided the battery SOC meets the requirements. If the grid is lost and the battery SOC meets the requirements, the system will automatically enter the off-grid load condition and execute the off-grid operation mode, displaying the operating mode as off-grid operation.

[0061] Energy storage off-grid load operation to grid-connected operation: If the mains circuit breaker is closed, the mains power is available, and the current operating mode is set to grid-connected operation, the EMS will automatically switch to grid-connected operation. The switching sequence is as follows: control the ATS to switch to the grid side; wait for the STS to close automatically; enter grid-connected operation. If the general load contactor has been disconnected before switching to grid-connected operation, then after detecting the STS closure, the general load contactor should be closed before entering grid-connected operation.

[0062] Switching from off-grid energy storage to diesel generator on-grid operation: If the minimum SOC of the energy storage device is less than or equal to the diesel generator SOC starting point of the site's EMS off-grid startup and the diesel generator circuit breaker is closed, the EMS will automatically switch to diesel generator on-grid operation. The switching sequence is as follows: start the diesel generator; control the ATS to switch to the diesel generator end; wait for the STS to close automatically; enter the diesel generator on-grid operation. If the general load contactor has been disconnected before switching to diesel generator on-grid operation, then after detecting the STS closure, the general load contactor should be closed before entering the diesel generator on-grid operation.

[0063] Under off-grid load conditions, when the maximum SOC of the energy storage device exceeds the off-grid start-up SOC of the photovoltaic system at the site's EMS, to prevent excessive photovoltaic power generation and battery overcharging leading to site shutdown, the EMS can be configured to select one of two handling methods. If the photovoltaic inverter's power response speed is slow, the site EMS will shut down all photovoltaic inverters; if the photovoltaic inverter's power response speed is fast, the site EMS will set the power limit of all photovoltaic inverters to 0 but will not shut them down. When the maximum SOC of the energy storage device is less than 5% (configurable) of the off-grid start-up SOC of the photovoltaic system at the site EMS, the photovoltaic inverter power limit will be restored or the photovoltaic inverter will be restarted.

[0064] (vi) Off-grid diesel generator under load operation control When the mains circuit breaker is disconnected, mains power is lost, or the current time period's strategy template is off-grid operation or diesel generator load, and the minimum SOC of the energy storage device is less than or equal to the off-grid start diesel generator SOC start point of the site EMS and the diesel generator circuit breaker is closed, the system operates according to the diesel generator load condition.

[0065] The startup sequence is as follows: Start the diesel generator; switch the ATS to the diesel generator end; wait for the STS to close; close the general load contactor; start all energy storage devices; start all photovoltaic inverters.

[0066] The shutdown sequence is as follows: shut down all photovoltaic inverters; shut down all energy storage devices; shut down the diesel generator; disconnect the general load contactors; and switch the ATS control system to the off state.

[0067] Under diesel generator load conditions, only the diesel generator load operating mode can be executed. Users can actively enter the diesel generator load operating mode by selecting off-grid operation or diesel generator load operating mode through the policy template, provided that the minimum SOC of the energy storage device meets the requirements. If the grid is lost and the minimum SOC of the energy storage device meets the requirements, the system will automatically enter the diesel generator load operating mode and execute the diesel generator load operating mode, and the operating mode will be displayed as diesel generator load.

[0068] Switching from diesel generator on-grid operation to off-grid energy storage on-grid operation: If the minimum SOC of the energy storage device is greater than the sum of the SOC start-up point of the off-grid diesel generator and the recovery hysteresis of the off-grid backup power SOC of the site's EMS, the EMS will automatically switch to off-grid energy storage on-grid operation. The switching sequence is as follows: shut down the diesel generator; switch the ATS to the off state; wait for the STS to automatically disconnect; enter the off-grid energy storage on-grid operation.

[0069] Diesel generator switching from on-load operation to grid-connected operation: If the mains circuit breaker is closed, the mains power is available, and the current operating mode is set to grid-connected operation, the EMS will automatically switch to grid-connected operation. The switching sequence is as follows: shut down the diesel generator; switch the ATS to the off state; wait for the STS to automatically disconnect; switch the ATS to the grid end; wait for the STS to automatically close; enter grid-connected operation.

[0070] Under off-grid load conditions or diesel generator load conditions, if the minimum SOC of the energy storage device is less than the SOC of the off-grid forced load reduction, the general load contactor shall be disconnected; the general load contactor shall be closed only after the minimum SOC of the energy storage device is greater than the sum of the difference between the start point of the off-grid diesel generator of the site EMS and the recovery difference of the off-grid backup power SOC of the site EMS.

[0071] If the minimum SOC of the energy storage device is less than or equal to the SOC start point of the diesel generator when the EMS is forced to start off the grid and the diesel generator circuit breaker is closed, then all energy storage devices will be shut down, the diesel generator will be started, the ATS will be switched to the diesel generator end, and the STS will be waited for to close automatically. Then all energy storage devices will be started and the diesel generator will enter the load-bearing condition.

[0072] Under diesel generator load conditions, if a loss of diesel engine output is detected, the diesel engine should be shut down and restarted after 3 minutes. If 5 restarts (configurable) fail, a diesel engine start-timeout fault should be set, and the system should switch back to off-grid energy storage load conditions. If the system meets the conditions to enter diesel generator load conditions, the site EMS should check for a diesel engine start-timeout fault (i.e., whether there have been previous instances of multiple unsuccessful diesel engine restarts leading to a return to off-grid energy storage load conditions). If the fault is set, the site EMS should not execute the off-grid to diesel generator switch procedure. Users can issue a "diesel generator load restart command" to clear the diesel engine start-timeout fault.

[0073] (vii) Photovoltaic power limitation and backflow prevention control Under grid-connected operation, if anti-reverse flow control is enabled, the photovoltaic inverter will be started after at least one energy storage unit has been successfully started; otherwise, the energy storage and photovoltaic units will be started simultaneously.

[0074] Under off-grid diesel generator load conditions, if it is necessary to limit the power of the photovoltaic inverter, then modify the power limit of all photovoltaic inverters. If the photovoltaic inverter power does not decrease within 60 seconds (configurable) after the new power limit is issued, then the photovoltaic inverter is shut down and can only be restarted after at least 15 minutes (configurable). Considering the different reverse current tolerance capabilities of the grid and the diesel engine, the time parameters here need to be configured separately from the time parameters for grid-connected operation.

[0075] Under off-grid load conditions, when the maximum SOC of the energy storage device is greater than the off-grid start-up SOC of the photovoltaic system at the site's EMS, to prevent excessive photovoltaic power generation from causing the battery to fully charge and shut down, if the photovoltaic inverter's power response speed is slow, all photovoltaic inverters will be shut down; if the photovoltaic inverter's power response speed is fast, the power limit of all photovoltaic inverters will be set to 0 but they will not be shut down. When the maximum SOC of the energy storage device is less than the off-grid start-up SOC of the photovoltaic system at the site's EMS minus 5% (configurable), the photovoltaic inverter power limit will be restored or the photovoltaic inverter will be restarted. IV. Specific Implementation Examples The following uses a typical 400V photovoltaic-storage microgrid system as an example, including a microgrid control cabinet, photovoltaic array, energy storage unit, important load and ordinary load, to further illustrate the seamless and shock-free switching system and method of this application.

[0077] Example 1: Seamless handover from grid-connected to off-grid fault The microgrid is operating normally connected to the grid, but a sudden voltage drop fault occurs in the main grid (voltage drops to 80% of the rated value), triggering a grid-to-off-grid switchover: The parameter acquisition module detects that the grid voltage exceeds the limit in real time, and the status prediction module immediately triggers a pre-switching command without directly tripping the circuit breaker. The parameter acquisition module detects the grid voltage every 10ms. When the voltage is lower than 80% of the rated value for three consecutive sampling cycles, the MGCC module determines it as a voltage drop fault.

[0078] The pre-synchronization control module locks the current microgrid steady-state voltage of 380V, frequency of 50Hz, and phase steady-state parameters, pre-loading the energy storage main control unit from grid-connected PQ control mode to off-grid VSG control parameters. The pre-synchronization control module reads the current energy storage PCS output voltage, frequency, and phase through the communication interface and uses these parameters as the initial reference values ​​for VSG control, achieving a smooth transition in control mode.

[0079] The uninterruptible power supply (UPS) control module locks the bus output voltage, maintaining continuous power supply to the load without any power outages. Since the STS module remains conductive on both the mains and off-grid sides, the energy storage PCS continuously outputs power, and the load bus voltage is supported by both the mains power and the energy storage PCS.

[0080] The current-limiting damping module initiates adaptive current limiting to suppress the power surge during grid disconnection, while simultaneously engaging damping closed-loop control to smooth voltage fluctuations. The module dynamically adjusts the PCS current limit value by detecting the rate of change of the PCS output current, limiting the surge current to no more than 1.2 times the rated current; it also introduces a virtual damping resistor to suppress voltage oscillations.

[0081] Once the parameters stabilize, the STS module trips without impact, and the microgrid enters off-grid islanded operation mode. The STS module performs tripping near the voltage zero-crossing point, further reducing switching arcing and transient impacts. The steady-state correction module dynamically fine-tunes the control parameters, ensuring that bus voltage fluctuations are ≤±1% and frequency fluctuations are ≤±0.05Hz, with no oscillations or impacts, and uninterrupted power supply to critical loads throughout the entire process.

[0082] Example 2: Seamless handover restoration from off-grid to on-grid The microgrid operates stably in off-grid islanded mode, recovers from large-grid faults, and voltage, frequency, and phase return to rated standards and remain stable for 300ms. The system determines that the power grid meets the grid connection conditions and initiates the pre-synchronization process. The MGCC module continuously monitors the voltage, frequency, and phase of the main power grid. When all three are within the rated range and remain stable for 300ms, the system determines that the power grid meets the grid connection conditions.

[0083] Based on the parameters of the main power grid, the output parameters of the microgrid are gradually fine-tuned to ensure that the voltage deviation is ≤2%, the frequency deviation is ≤0.1Hz, and the phase deviation is ≤1°. During the pre-synchronization process, the MGCC module adjusts the voltage and frequency reference values ​​of the energy storage PCS in steps of 100ms to ensure smooth tracking.

[0084] The soft-start current limiting strategy is activated in advance to predict the power difference between the grid and the grid and set a dynamic current limiting threshold. The MGCC module calculates the power difference based on the current microgrid load power, the output power of the energy storage PCS, and the expected power absorbed from the main grid after grid connection, and sets the soft-start current limit value of the PCS to ensure that the inrush current at the moment of closing is ≤1.2 times the rated current.

[0085] After parameter synchronization is completed, the main control unit seamlessly switches from VSG control to PQ control, maintaining stable voltage output throughout the switching process without power interruption to the load. The PCS switches its control algorithm from VSG control to PQ control while keeping the output voltage amplitude and frequency constant.

[0086] The STS module achieves precise closing and completes grid connection switching. The STS module closes when the voltage phase difference is ≤1°, and the instantaneous inrush current is ≤1.2 times the rated current, with no harmonic distortion and no power oscillation.

[0087] The steady-state closed-loop module continuously optimizes system parameters, and the system enters a fully steady-state operating state within 100ms.

[0088] Actual measurements show that this application can achieve zero short-term power outages, zero significant inrush currents, and zero system oscillation instability during bidirectional switching of microgrids. The power quality throughout the switching process meets national standards, and the power supply reliability for important loads reaches over 99.99%. Compared with traditional switching technologies, it solves the three core problems of switching impact, power outage, and oscillation instability.

[0089] In this embodiment, it also includes: From the historical successful grid connection switching records stored in the MGCC module, the voltage amplitude deviation, frequency deviation, phase deviation, phase deviation change rate, and reactive power output of the energy storage PCS between the microgrid side and the main grid side within the pre-synchronization window of each switching are extracted to form historical source domain sample features; at the same time, the actual phase fine-tuning direction and fine-tuning step size executed in each switching are extracted to form historical source domain sample labels, and a historical experience sample set is constructed. Collect the same set of operating condition variables within the current off-grid to grid-connected pre-synchronization window, namely the voltage amplitude deviation, frequency deviation, phase deviation, phase deviation change rate, and reactive power output of the energy storage PCS between the current microgrid side and the large grid side, to form the target domain sample to be migrated. The features of historical source domain samples and the target domain samples to be transferred are jointly mapped to a regenerating kernel Hilbert space. In the regenerating kernel Hilbert space, the feature transfer mapping relationship is learned by minimizing the statistical distance between the marginal distribution of historical source domain samples and the marginal distribution of target domain samples to be transferred. The feature transfer mapping relationship is used to transform the features of historical source domain samples and the target domain samples to be transferred, respectively, to obtain the transferred source domain features and the transferred target domain features; Using the transferred source domain features as input and the historical source domain sample labels as output, a regression relationship is established between the transferred source domain features and the phase fine-tuning direction and fine-tuning step size in the transferred source domain feature space; the transferred target domain features are input into this regression relationship to generate the phase fine-tuning direction and fine-tuning step size corresponding to the current operating condition. The phase fine-tuning direction and fine-tuning step size corresponding to the current operating condition are converted into incremental adjustment commands for the phase reference angle of the virtual synchronous generator control of the energy storage main control unit. The phase reference angle is incrementally adjusted in each pre-synchronization control cycle until the phase deviation falls within the preset grid connection condition range.

[0090] It should be noted that during the off-grid to grid-connected pre-synchronization phase, the quality of phase synchronization adjustment directly affects the closing inrush current and pre-synchronization time. If the phase fine-tuning direction and fine-tuning step size are always set according to fixed rules or empirical values, overshoot or slow convergence can easily occur when operating conditions such as voltage amplitude deviation and reactive power level change, resulting in the inability to stably meet grid connection conditions within the pre-synchronization window. Therefore, this embodiment uses historical successful grid connection switching records stored in the MGCC module to construct training samples. Specifically, the voltage amplitude deviation, frequency deviation, phase deviation, phase deviation change rate, and reactive power output of the energy storage PCS between the microgrid side and the main grid side are extracted as historical source domain sample features within the pre-synchronization window of each switching, and the actual phase fine-tuning direction and fine-tuning step size executed in each switching are used as historical source domain sample labels. For the current off-grid to grid-connected process, the same set of operating condition variables are collected as the target domain samples to be migrated.

[0091] Considering the inherent differences in feature distributions between historical and current operating conditions, directly using historical samples to train a regression model may introduce significant bias. This embodiment maps historical source domain sample features and target domain samples to be transferred to a regenerating kernel Hilbert space, using the maximum mean difference (MMD) between the marginal distributions of the source and target domains as the statistical distance. The feature transfer mapping relationship is learned by minimizing this distance. A feasible solution is as follows: Select a suitable kernel function (e.g., a Gaussian radial basis kernel) to calculate the kernel matrices for the source and target domains, construct an objective function containing MMD and regularization terms, and obtain the mapping matrix by solving the generalized eigenvalue problem corresponding to this objective function. Project this mapping matrix onto the source and target domain features respectively to obtain the transferred source and target domain features. Then, in the transferred source domain feature space, using the transferred source domain features as input and historical source domain sample labels as output, a regression model (e.g., a support vector regression model) is trained to establish the regression relationship between features and the phase fine-tuning direction and fine-tuning step size. By inputting the migrated target domain features into the regression model, the phase fine-tuning direction and fine-tuning step size corresponding to the current operating condition can be generated. The MGCC module converts this direction and step size into incremental adjustment commands for the phase reference angle of the virtual synchronous generator control unit of the energy storage master control unit. In each pre-synchronization control cycle, the phase reference angle is incrementally adjusted until the phase deviation falls within the preset grid connection condition range. In this way, the pre-synchronization phase adjustment can adaptively adjust based on historical successful experience, improving the convergence speed and resistance to operating condition disturbances of grid connection pre-synchronization, and further ensuring shock-free grid connection.

[0092] In this embodiment, it also includes: The three-phase voltages of the main grid and the microgrid are obtained in real time from the power quality acquisition meter. The three-phase voltages of the main grid in the same sampling period are combined to obtain the main grid voltage phasor, and the three-phase voltages of the microgrid in the same sampling period are combined to obtain the microgrid voltage phasor. Using the real part of the voltage phasor of the large power grid as the abscissa and the imaginary part as the ordinate, the voltage phasors of the large power grid are arranged in chronological order, and the voltage phasors of the microgrid are arranged in the same chronological order in the same coordinate system to form a joint voltage phasor point cloud. For the joint voltage phasor point cloud, starting from the zero neighborhood radius, the neighborhood radius is gradually increased according to the preset neighborhood radius growth step size; each time the neighborhood radius is changed, the points in the joint voltage phasor point cloud with Euclidean distance less than the current neighborhood radius are connected to form an edge, and the edges that meet the conditions are used to enclose a triangle and a higher-dimensional simplex to obtain the simplex complex under the current neighborhood radius. Calculate the one-dimensional homology dimension of each simple complex, record the neighborhood radius corresponding to the appearance of the one-dimensional homology feature and the neighborhood radius corresponding to the disappearance of the one-dimensional homology feature, and obtain the one-dimensional homology feature persistence spectrum; The one-dimensional homology feature with the longest survival time is selected from the one-dimensional homology feature persistence spectrum and marked as the trajectory loop connection feature; the difference between the neighborhood radius corresponding to the appearance of the trajectory loop connection feature and the neighborhood radius corresponding to its disappearance is recorded as the lifetime length of the trajectory loop connection feature. The lifetime length of the trajectory loop connection feature is compared with the preset topology persistence threshold. When the lifetime length of the trajectory loop connection feature is lower than the topology persistence threshold, it is determined that the loop connection feature of the voltage phasor trajectory between the microgrid and the main grid has disappeared, and a pre-synchronization start signal is generated and sent to the MGCC module. The MGCC module initiates the off-grid to grid-connected pre-synchronization control process based on the pre-synchronization start signal. It fine-tunes the phase of the microgrid voltage phasor with the voltage phasor of the main grid as a reference until the phase deviation meets the grid connection conditions.

[0093] In actual operation, even if the voltage amplitude and frequency of the main grid have recovered, the voltage phasor on the microgrid side may still be in a state of rapid phase rotation due to load fluctuations and changes in distributed power generation output. If pre-synchronization is initiated immediately at this time, the rapid change in phase difference may easily lead to regulation oscillation or repeated loss of closing conditions, affecting the reliability of grid connection switching. To address the above problems, this embodiment uses a continuous co-homology method to perform topological analysis on the joint point cloud of the two voltage phasor trajectories to adaptively determine the timing of pre-synchronization initiation. Specifically, the three-phase voltages of the main grid side and the microgrid side within the same sampling period are obtained from the power quality acquisition meter. The voltage phasors are synthesized through Park transform or symmetrical component method. The main grid voltage phasors and the microgrid voltage phasors are plotted in chronological order on the same complex plane coordinate system to form a joint voltage phasor point cloud. The geometry of this point cloud reflects the relative motion relationship between the two voltage phasor trajectories. Then, starting from the zero neighborhood radius, the neighborhood radius is gradually increased by a preset step size. Pairs of points whose Euclidean distance is less than the current neighborhood radius are used as edges, and triangles and higher-dimensional simplexes are enclosed by these satisfying edges to construct simplex complexes. A simplex complex can be understood as a geometric composite composed of basic units such as points, edges, and triangles, used to describe the connectivity and loop structures of a point cloud. For each simplex complex, its one-dimensional homology dimension is calculated, which characterizes the number of closed loop structures in the point cloud. The neighborhood radius corresponding to the appearance and disappearance of each one-dimensional homology feature is recorded to obtain the one-dimensional homology feature persistence spectrum. Each feature in the persistence spectrum corresponds to the persistence interval of a loop structure during the neighborhood radius increase process. The above simplex complex construction and homology dimension calculation can be implemented using existing persistent homology algorithms, and the corresponding topological data analysis functions can be integrated into the MGCC module.

[0094] Features with the longest survival time are selected from the persistence spectrum and marked as trajectory loop connection features, and their lifetime length is calculated. This feature corresponds to the loop connection relationship formed between the voltage phasor trajectories of the large power grid and the microgrid. When there is a significant phase difference change or relative rotation between the two voltage phasors, a significant loop structure will appear in the joint point cloud, and the lifetime length of this structure is relatively long. When the two voltage phasor trajectories tend to be in the same direction or the phase difference change tends to be gradual, the loop structure gradually degenerates and disappears, and its lifetime length decreases accordingly. Therefore, when the lifetime length of the trajectory loop connection feature is lower than the preset topology persistence threshold, it can be determined that the loop connection relationship between the two voltage phasor trajectories has disappeared, indicating that the phase difference between the microgrid voltage phasor and the large power grid voltage phasor has entered a relatively stable window, which is suitable for starting pre-synchronization control. Based on this, the MGCC module generates a pre-synchronization start signal and initiates the off-grid to grid-connected pre-synchronization process to reduce the adjustment oscillation and grid connection impact during the subsequent phase fine-tuning process. Through the above continuous coherence analysis, pre-synchronous startup no longer relies solely on fixed delay or amplitude-frequency recovery criteria, but adaptively determines the startup timing from the perspective of voltage phasor trajectory topology evolution, which improves the accuracy and robustness of pre-synchronous startup and further ensures shock-free grid connection.

[0095] In summary, this application achieves an adaptive droop and VSG fusion control strategy through hierarchical collaborative precision control technology, balancing steady-state accuracy and transient stability; the millisecond-level seamless on-grid / off-grid switching technology achieves a switching time of less than 100ms, with voltage fluctuations ≤±3% and frequency fluctuations ≤±0.1Hz. Multi-energy complementarity and optimized scheduling innovatively construct a multi-energy coupled prediction-scheduling integrated system, achieving a day-ahead prediction accuracy of ≥93% and a real-time prediction accuracy of ≥96%, reducing physical energy storage configuration capacity by 20%-30%. Active safety protection and self-healing control technology proposes an active islanding detection algorithm of "impedance identification + voltage surge," accurately identifying unplanned islands within 10ms with 100% accuracy; and develops a "storage priority + distributed collaboration" black-start technology, achieving a system restart time of ≤8min and rapid fault self-healing. Dual AC source load switching control technology connects to a diesel generator via an ATS module for AC coupling load, while the EMS controls the energy storage convergence power to ensure safe power supply; once the mains power stabilizes, it connects to the mains via the ATS module for AC coupling load.

[0096] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A control method for a microgrid system cabinet based on seamless bidirectional switching between grid and off-grid, the system cabinet comprising an MGEMS module, an MGCC module, an STS module, an ATS module, a renewable energy distribution module, a mains power access switch, a diesel generator access switch, a load switch, a load shedding module, and a power quality acquisition meter, wherein the system cabinet is connected to an energy storage unit, a photovoltaic inverter unit, and a diesel generator; characterized in that, The MGCC module includes a pre-synchronization control module, an uninterrupted power supply control module, a current limiting damping module, and a steady-state correction module; the control method includes the following steps: The MGCC module collects the operating parameters of the large power grid and microgrid in real time. Based on the collected parameters, it determines the operating conditions of the large power grid fault, power grid recovery or load change in real time, predicts the switching demand in advance and outputs the pre-control trigger signal and mode switching command. It does not directly execute the opening or closing of the switch when the switching is triggered. In response to the pre-regulation trigger signal, the pre-synchronization regulation module performs pre-synchronization regulation: when switching from grid connection to off-grid, the steady-state voltage, frequency, and phase parameters of the current microgrid are locked, and the energy storage main control unit is preloaded from the grid-connected PQ control mode to the off-grid VSG control parameters; when switching from off-grid to grid connection, the output parameters of the microgrid are gradually fine-tuned based on the voltage, frequency, and phase parameters of the main grid until the voltage deviation, frequency deviation, and phase deviation meet the preset grid connection conditions. During the pre-synchronization control process, the uninterrupted power supply control module, through the STS module and the PCS of the energy storage unit, performs uninterrupted power supply control to lock the bus output voltage and maintain continuous power supply to the load. At the moment of switching, the current limiting and damping module initiates adaptive current limiting to suppress power surges and engages damping closed-loop control to smooth voltage fluctuations. Once the parameters of the microgrid and the main grid stabilize, the STS module is controlled to perform shockless tripping or closing, completing the bidirectional mode switching between grid-connected and off-grid modes. After the switch is completed, the steady-state correction module dynamically fine-tunes the control parameters to bring the system into steady-state operation.

2. The control method according to claim 1, characterized in that, The grid connection to off-grid transition includes: When the main grid voltage is detected to drop to 80% of the rated value, the MGCC module triggers a pre-switching command and does not directly trip the circuit breaker; The pre-synchronization control module locks the microgrid steady-state voltage of 380V, frequency of 50Hz and phase steady-state parameters, and preloads the energy storage main control unit from the grid-connected PQ control mode to the off-grid VSG control parameters. The uninterruptible power supply control module locks the bus output voltage to maintain continuous power supply to the load. The current limiting damping module initiates adaptive current limiting to suppress the power surge during grid disconnection and engages damping closed-loop control to smooth voltage fluctuations. Once the parameters stabilize, the STS module trips without impact, and the microgrid enters the off-grid islanding operation mode. The steady-state correction module dynamically fine-tunes the control parameters to ensure that the bus voltage fluctuation is ≤±1% and the frequency fluctuation is ≤±0.05Hz, and that important loads are supplied with uninterrupted power throughout the process.

3. The control method according to claim 1, characterized in that, The off-grid to on-grid conversion includes: When the power grid fault is recovered, and the voltage, frequency, and phase return to the rated standard and stabilize for 300ms, the power grid is deemed to meet the grid connection conditions. Initiate the pre-synchronization process, using the parameters of the main power grid as a benchmark, and gradually adjust the output parameters of the microgrid to ensure that the voltage deviation is ≤2%, the frequency deviation is ≤0.1Hz, and the phase deviation is ≤1°. Activate the soft-start current limiting strategy in advance, predict the grid-connected power difference, and set a dynamic current limiting threshold. After parameter synchronization is completed, the energy storage main control unit is switched from VSG control to PQ control. During the switching process, the voltage is continuously stabilized and the load is not interrupted. The STS module accurately closes the circuit breaker and completes the grid connection switchover, with the instantaneous inrush current being ≤1.2 times the rated current. The steady-state correction module continuously optimizes system parameters and enters fully steady-state operation within 100ms.

4. The control method according to claim 1, characterized in that, It also includes grid-connected operation condition control: When the mains circuit breaker is closed, the mains power is available, and the current operating mode is suitable for grid-connected operation, the system operates according to the grid-connected operation mode. The startup sequence is as follows: control all energy storage devices to enter standby mode, control the ATS to switch to the grid side, wait for the STS to close, close the general load contactor, start all energy storage devices, and start all photovoltaic inverters. If anti-reverse current control is enabled, the photovoltaic inverter will start after at least one energy storage device has started successfully; otherwise, both energy storage and photovoltaic will start simultaneously. The shutdown sequence is as follows: reduce the power target of the photovoltaic inverter and energy storage equipment to 0, shut down all photovoltaic inverters and energy storage equipment, switch the ATS to the off state, and disconnect the general load contactor.

5. The control method according to claim 1, characterized in that, The grid-connected to off-grid transition includes switching from grid-connected operation to energy storage off-grid load operation and switching from grid-connected operation to diesel generator load operation: If the mains circuit breaker is disconnected, the mains power is lost, or the current operating mode is set to off-grid operation or diesel generator load, and the minimum SOC of the energy storage device is greater than the off-grid start point of the diesel generator EMS at the site, then switch to the off-grid load operation mode of the energy storage device. The switching sequence is: disconnect the ATS to the disconnected state, wait for the STS to disconnect automatically, and enter the off-grid load operation mode of the energy storage device. If the mains circuit breaker is open, mains power is lost, or the current operating mode is set to off-grid operation or diesel generator load operation, and the minimum SOC of the energy storage device is less than or equal to the off-grid start point of the diesel generator by the site EMS, and the diesel generator circuit breaker is closed, then switch to diesel generator load operation mode. The switching sequence is as follows: control ATS to switch to the open state, wait for STS to automatically disconnect, start the diesel generator, control ATS to switch to the diesel generator end, wait for STS to automatically close, and enter diesel generator load operation mode.

6. The control method according to claim 1, characterized in that, It also includes off-grid energy storage load-bearing operation condition control: When the mains circuit breaker is disconnected, mains power is lost, or the current time period's strategy template is off-grid operation or diesel generator load, and the battery SOC is greater than the site EMS off-grid start diesel generator SOC start point, the system operates according to the energy storage off-grid load condition; the start-up sequence is: control ATS switch to the disconnected state, start all energy storage, close the general load contactor, start all photovoltaic inverters, and only start the photovoltaic inverter after the main energy storage device has started successfully; The shutdown sequence is as follows: shut down all photovoltaic inverters, shut down all energy storage devices, and disconnect the general load contactors; When the minimum SOC of the energy storage device is less than the SOC starting point of the off-grid diesel generator of the site EMS and the diesel generator circuit breaker is closed, the system switches to diesel generator load mode. The switching sequence is as follows: start the diesel generator, control the ATS to switch to the diesel generator end, wait for the STS to close automatically, and enter the diesel generator load mode. When the mains circuit breaker is closed, the mains power is on, and the current time period is set to the grid-connected operation mode, the system switches to the grid-connected operation mode. The switching sequence is as follows: the ATS is switched to the grid end, the system waits for the STS to close automatically, and then the system enters the grid-connected operation mode.

7. The control method according to claim 6, characterized in that, It also includes off-grid diesel generator load-bearing operation condition control: When the mains circuit breaker is disconnected, mains power is lost, or the current time period's strategy template is off-grid operation or diesel generator load operation, and the minimum SOC of the energy storage device is less than or equal to the off-grid start diesel generator SOC start point of the site EMS and the diesel generator circuit breaker is closed, the system operates according to the diesel generator load operation condition; the start-up sequence is: start the diesel generator, control the ATS to switch to the diesel generator end, wait for the STS to close, close the general load contactor, start all energy storage devices, and start all photovoltaic inverters; The shutdown sequence is as follows: shut down all photovoltaic inverters, shut down all energy storage devices, turn off the diesel generator, disconnect the general load contactor, and switch the ATS control to the off state; When the minimum SOC of the energy storage device is greater than the sum of the SOC start point of the off-grid diesel generator of the site EMS and the recovery difference of the SOC of the off-grid backup power of the site EMS, the device switches to the off-grid load condition of the energy storage. The switching sequence is as follows: turn off the diesel generator, control the ATS to switch to the disconnected state, wait for the STS to disconnect automatically, and enter the off-grid load condition of the energy storage. When the mains circuit breaker is closed, the mains power is available, and the current operating mode is set to grid-connected operation mode, switch to grid-connected operation mode. The switching sequence is as follows: shut down the diesel generator, control the ATS to switch to the open state, wait for the STS to automatically disconnect, control the ATS to switch to the grid end, wait for the STS to automatically close, and enter the grid-connected operation mode.

8. The control method according to claim 7, characterized in that, Under off-grid load conditions or diesel generator load conditions, if the minimum SOC of the energy storage device is less than the SOC of the off-grid forced load reduction, the general load contactor shall be disconnected. The general load contactor is closed only after the minimum SOC of the energy storage device is greater than the sum of the SOC of the off-grid start-up diesel generator of the site EMS and the recovery hysteresis of the off-grid backup power SOC of the site EMS. If the minimum SOC of the energy storage device is less than or equal to the SOC start point of the diesel generator when the EMS is forced to start off the grid and the diesel generator circuit breaker is closed, then control all energy storage devices to stop, start the diesel generator, control the ATS to switch to the diesel generator end, wait for the STS to close automatically, start all energy storage devices, and enter the diesel generator load condition. If a loss of diesel engine output is detected, the diesel engine will be shut down and restarted after 3 minutes. If the restart fails 5 times, a diesel engine start-up timeout fault will be set, and the system will switch back to the off-grid load operation mode of the energy storage system.

9. The control method according to claim 1, characterized in that, It also includes photovoltaic power limiting and reverse current protection control: Under grid-connected operation, if anti-reverse flow control is enabled, the photovoltaic inverter will be started after at least one energy storage unit has been successfully started; otherwise, the energy storage and photovoltaic units will be started simultaneously. Under off-grid diesel generator load conditions, if it is necessary to limit the power of photovoltaic inverters, then modify the power limit of all photovoltaic inverters; if the power of photovoltaic inverters does not decrease within 60 seconds after the new power limit is issued, then shut down the photovoltaic inverters and wait at least 15 minutes before restarting them. When the maximum SOC of the energy storage device is greater than the off-grid start-up point of the photovoltaic system via the site's EMS, to prevent excessive photovoltaic power generation from causing the battery to fully charge and shut down, if the photovoltaic inverter's power response speed is slow, all photovoltaic inverters will be shut down; if the photovoltaic inverter's power response speed is fast, the power limit of all photovoltaic inverters will be set to 0 but they will not be shut down. When the maximum SOC of the energy storage device is less than the off-grid start-up point of the photovoltaic system via the site's EMS minus 5%, the photovoltaic inverter power limit will be restored or the photovoltaic inverter will be restarted.

10. A microgrid system cabinet based on seamless bidirectional switching between grid and off-grid operation, characterized in that, include: The MGEMS module is used to track the SOC, charge and discharge power, and voltage of energy storage batteries in real time, perform photovoltaic prediction and real-time power detection, and upload data to the cloud server. The MGCC module has a built-in power grid anomaly detection threshold and mode switching trigger logic. It is used to determine the power grid fault, power grid recovery, and load change conditions in real time based on the collected parameters, predict the switching needs in advance, and output the pre-control trigger signal and mode switching command. The STS module, in conjunction with the PCS of the energy storage unit, is used to switch between off-grid and grid-connected modes. The ATS module is used to select between mains power supply and diesel generator power supply. The new energy distribution module is used for access and distribution of energy storage power supply and photovoltaic power supply, as well as AC coupling. The load shedding module is used to cut off the power supply to non-critical loads under conditions of energy shortage, so as to ensure uninterrupted power supply to critical loads. Mains power connection switch, diesel generator connection switch, load switch; Power quality acquisition meter; The MGCC module is communicatively connected to the MGEMS module, STS module, ATS module, new energy distribution module, load shedding module, mains power access switch, diesel generator access switch, load switch, and power quality acquisition meter, respectively; the STS module is connected to the PCS, ATS module, and load switch of the energy storage unit; the ATS module is connected to the mains power access switch and diesel generator access switch, respectively; the new energy distribution module is connected to the energy storage unit, photovoltaic inverter unit, and load switch; The MGCC module is also used to perform the control method as described in any one of claims 1 to 9.