Mobile charging and discharging system bidirectional energy control and grid connection method supporting V2G

By employing dynamic periodic model predictive control and source-load pulse synchronization cancellation mechanism, the grid connection impact problem of mobile charging and discharging systems in high-fluctuation renewable energy microgrid scenarios is solved, thereby improving system stability and equipment durability.

CN122068529APending Publication Date: 2026-05-19YIHE (LUJIANG) NEW ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610237091.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-28
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing mobile charging and discharging systems struggle to achieve rapid response and smooth transition in microgrid scenarios with highly volatile renewable energy sources. This results in large inrush currents during grid connection, affecting grid stability. Furthermore, traditional pulse charging and discharging strategies cause severe ripple superposition conflicts and dispatch fatigue during bidirectional energy flow.

Method used

The Dynamic Periodic Model Predictive Control (MPC) algorithm is adopted, combined with multi-source data acquisition and preprocessing, to shorten the optimization cycle, execute pre-synchronous tracking grid-connected control, utilize buffer power and slope transition mechanism to achieve zero-impact smooth grid connection, and eliminate power ripple oscillation through source-load pulse synchronization cancellation mechanism.

Benefits of technology

It achieves zero-impact smooth grid connection under dynamic boundary conditions, significantly eliminates power ripple oscillations on the grid side, extends the service life of battery packs and power devices, and ensures system stability and equipment durability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122068529A_ABST
    Figure CN122068529A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of mobile charging and discharging control, and particularly discloses a bidirectional energy control and grid connection method of a mobile charging and discharging system supporting V2G (Vehicle-to-Grid), in which V2G: Vehile-to-Grid, a vehicle is connected to a power grid. The method comprises the steps of collecting multi-source data of a battery state, a power grid operation state and renewable energy output, and performing preprocessing such as filtering and coordinate transformation on the multi-source data to evaluate a current safe operation boundary of a system; based on the operation boundary, calculating target charging and discharging power of the system by adopting a dynamic periodic model predictive control (MPC) algorithm; and in response to a grid-connected request, starting a grid-connected control flow according to the target charging and discharging power. Zero-impact smooth grid connection under the dynamic boundary condition is achieved, a source-load pulse synchronous counteracting mechanism based on flow direction hedging is provided, the traditional peak shifting thinking is broken, source and load attribute vehicle pulse synchronous conduction is forcibly controlled, direct self-balance of internal energy of a system is achieved, and power ripple oscillation of a power grid side is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mobile charging and discharging control technology, specifically to a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G. Background Technology

[0002] Current mobile charging and discharging systems typically employ fixed-parameter control strategies for energy dispatch and grid connection during vehicle-to-grid (V2G) interactions. However, this traditional control approach presents significant technical limitations and conflicts when dealing with microgrid scenarios that include highly volatile renewable energy sources such as solar and wind power. On the one hand, the system often cannot balance rapid response and smooth transition during the grid connection pre-synchronization stage. When the grid voltage or renewable energy output fluctuates drastically, the fixed-cycle control algorithm cannot accurately capture phase changes, resulting in a large inrush current at the moment of grid connection, which affects grid stability. On the other hand, existing pulse charging and discharging strategies are mainly designed for unidirectional flow, which simply involves staggering the conduction times of all vehicles to reduce peak load.

[0003] However, in the actual operation of V2G bidirectional energy flow, the aforementioned simple peak-shaving strategy can lead to severe ripple superposition conflicts and scheduling fatigue conflicts. Specifically, when there are vehicles with both charging and discharging needs in the system, forced peak-shaving will cause the current at the grid connection point to jump sharply between positive and negative maxima at high frequency, resulting in severe power ripple oscillations and damaging power electronic devices. Summary of the Invention

[0004] This invention aims to at least partially address one of the technical problems in related technologies. Therefore, the objective of this invention is to propose a bidirectional energy control and grid connection method for a V2G-enabled mobile charging and discharging system, thereby improving system stability and device durability.

[0005] To achieve the above objectives, a first aspect of the present invention proposes a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G, comprising the following steps: Collect multi-source data on battery status, grid operation status, and renewable energy output, and preprocess the multi-source data to assess the current operating boundary of the system; Based on the aforementioned operating boundary, the target charging and discharging power of the system is calculated using the dynamic periodic model predictive control (MPC) algorithm. In response to the grid connection request, the grid connection control process is initiated according to the target charging and discharging power to realize bidirectional energy interaction between the mobile charging and discharging system and the power grid; The process of initiating the grid connection control procedure includes: shortening the optimization period of the MPC algorithm from a first duration to a second duration, and performing pre-synchronization tracking of the grid voltage phase, wherein the second duration is shorter than the first duration; When the phase difference meets the preset phase threshold, the power calculation of the MPC algorithm is frozen, the buffer power at the moment of grid connection is determined, the control system connects to the grid with the buffer power, and transitions to the target charging and discharging power at a preset slope.

[0006] To achieve the above objectives, a second aspect of the present invention provides a bidirectional energy control and grid connection system for a mobile charging and discharging system supporting V2G, the system comprising: The multi-source data acquisition and preprocessing module is used to acquire multi-source data on battery status, grid operation status, and renewable energy output, and to preprocess the multi-source data to assess the current operating boundary of the system. The target power calculation module is used to calculate the target charging and discharging power of the system based on the operating boundary and using the dynamic periodic model prediction control MPC algorithm. The grid connection control execution module is used to respond to the grid connection request and initiate the grid connection control process according to the target charging and discharging power to realize bidirectional energy interaction between the mobile charging and discharging system and the power grid. Specifically, when executing the grid connection control execution module, the following functions are employed: shortening the optimization cycle of the MPC algorithm from a first duration to a second duration, and performing pre-synchronization tracking of the grid voltage phase, wherein the second duration is less than the first duration; when the phase difference meets a preset phase threshold, freezing the power calculation of the MPC algorithm, determining the buffer power at the moment of grid connection, controlling the system to connect to the grid with the buffer power, and transitioning to the target charging and discharging power at a preset slope.

[0007] To achieve the above objectives, a third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the above-described method for bidirectional energy control and grid connection of a V2G-enabled mobile charging and discharging system.

[0008] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention provides a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G, which effectively resolves the technical conflicts in the background art. First, this method utilizes the mechanism of compressing the optimization cycle and reserving buffer power during grid connection to achieve zero-impact smooth grid connection under dynamic boundary conditions. More importantly, this invention proposes a source-load pulse synchronization cancellation mechanism based on flow direction offsetting, breaking the traditional peak-shifting thinking, forcibly controlling the pulse synchronization of source and load attribute vehicles, realizing direct self-balancing of energy within the system, and significantly eliminating power ripple oscillations on the grid side. Meanwhile, this method combines a dynamic hysteresis priority algorithm based on state inertia to introduce state switching penalties when dealing with high-frequency fluctuations in renewable energy, effectively suppressing frequent polarity reversals of high-priority vehicles. While ensuring power balance in the power grid, it maximizes the lifespan of battery packs and power devices, achieving dual optimization of system stability and equipment durability. Attached Figure Description

[0009] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings, the same reference numerals are used to refer to the same parts. Wherein: Figure 1 This is a schematic flowchart of a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G provided by the present invention. Figure 2 This is a target power tracking response curve based on the MPC algorithm under dynamic weight adjustment in a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G provided by the present invention. Figure 3 This is a schematic diagram illustrating the adaptive mapping relationship between battery polarization degree, pulse frequency, and duty cycle in a bidirectional energy control and grid connection method for a V2G-enabled mobile charging and discharging system provided by the present invention. Figure 4 This is a timing simulation diagram of phase difference convergence and buffer power smooth transition in the grid connection control process of a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G provided by the present invention. Figure 5 This is a simulation diagram comparing the power ripple at the grid connection point PCC in a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G provided by the present invention, using a source-load pulse synchronization cancellation strategy and a traditional staggered strategy. Figure 6 This is a comparison diagram of vehicle charging and discharging state switching before and after introducing hysteresis adjustment under the high-frequency fluctuation condition of renewable energy in a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G provided by the present invention. Figure 7 This is a schematic diagram illustrating the implementation of a bidirectional energy control and grid connection system for a mobile charging and discharging system supporting V2G provided by the present invention. Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0010] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0011] The following description, with reference to the accompanying drawings, describes a bidirectional energy control and grid connection method, system, and electronic device for a V2G-enabled mobile charging and discharging system according to embodiments of the present invention.

[0012] Example 1: This embodiment provides a bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G (Vehicle-to-Grid). This method is configured to run in the central controller of the mobile charging and discharging system. The central controller, as the core computing and scheduling unit, interacts with various sub-modules in the system in real time through a high-bandwidth, low-latency communication bus (such as CAN-FD or industrial Ethernet) and maintains a communication connection with the upper-level power grid dispatch center.

[0013] It should be noted that this embodiment aims to address the problems of lag response, large inrush current, and difficulties in multi-vehicle coordinated control in existing mobile charging and discharging systems when facing highly volatile renewable energy grid connection. Through a hierarchical, progressive, and multi-dimensionally coupled control strategy, it achieves efficient, smooth, and safe bidirectional interaction between vehicle energy and grid energy.

[0014] like Figure 1 As shown, the method in this embodiment specifically includes the following steps: S1: Multi-source data acquisition and system boundary assessment.

[0015] Specifically, the execution process of this method begins with a precise perception of the overall system status. The central controller performs the following steps: collecting multi-source data on battery status, grid operation status, and renewable energy output, and preprocessing the multi-source data to assess the current operating boundaries of the system.

[0016] In practical operation scenarios, the accuracy and real-time performance of data are fundamental to the effectiveness of control strategies. Specifically, for battery status data acquisition, the central controller obtains basic state of charge (SOC, measurement accuracy ±2%), state of health (SOH, measurement accuracy ±1%), individual cell voltage (measurement accuracy ±0.01V), and real-time temperature (measurement accuracy ±0.5℃) data through the battery management system (BMS). Simultaneously, it monitors the charging and discharging current of the battery pack in real time using current sensors connected in series in the battery circuit (sampling frequency ≥10Hz, measurement range -200A~200A). For grid operation status data acquisition, the system uses smart meters at the grid connection point (PCC) to sample the three-phase voltage (measurement range 0~450V), frequency (measurement range 49.5Hz~50.5Hz), active power, and reactive power of the grid at a high frequency of ≥10Hz. It also collects grid voltage stability indicators, line impedance, and frequency deviation data, providing a quantitative reference for grid strength for grid-connected control.

[0017] For example, to address the uncertainty of renewable energy output in microgrid or weak grid environments, this embodiment refines the data collection of renewable energy. The collection of multi-source data on battery status, grid operation status, and renewable energy output specifically includes, in the renewable energy dimension, real-time output data and short-term predicted output data. Based on these two sets of data, the controller further calculates the output volatility and prediction deviation. The output volatility is the ratio of the absolute value of the difference between the current output and the output at the previous sampling time to the rated power. This parameter quantifies the degree of drastic change in photovoltaic or wind power within a short period, such as the instantaneous drop in photovoltaic output under cloudy weather conditions. Furthermore, regarding grid stability, the system also specifically collects grid voltage stability indicators (commonly referred to as L-index), frequency deviation, and line impedance data, thereby providing a quantitative reference for grid strength in subsequent grid-connected control.

[0018] After the initial data acquisition is complete, rigorous data preprocessing must be performed to eliminate sensor noise and extract the key features required for control. This preprocessing of the multi-source data to assess the system's current operating boundaries mainly includes three core processing logics: First, for the electrical signals on the AC side, the controller performs coordinate transformation on the three-phase AC voltage and current to extract the direct-axis and quadrature-axis components. This process typically involves Clarke and Park transformations, converting the time-varying AC quantities in the stationary coordinate system into direct quantities in the rotating coordinate system, namely the d-axis and q-axis components, thereby achieving decoupled control of active and reactive currents and providing a foundation for subsequent vector control.

[0019] Secondly, to accurately quantify the dynamic characteristics of the battery under pulsed operating conditions, this embodiment introduces polarization as a key state variable. Specifically, the polarization degree of the battery is calculated, which is characterized by the ratio of the difference between the pulse peak voltage and the pulse steady-state voltage to the pulse steady-state voltage. This physical quantity can keenly reflect the difference between the lithium-ion diffusion rate and the electrochemical reaction rate inside the battery. When a high-current pulse is applied, if the voltage rapidly jumps to the peak value and deviates significantly from the steady-state voltage, it indicates severe polarization inside the battery. In this case, further increasing the power will lead to the risk of lithium plating or thermal runaway.

[0020] Finally, the system needs to establish a safe operating space at the current moment. Specifically, based on the battery's State of Health (SOH), real-time temperature, and State of Charge (SOC), a dynamic charge / discharge power upper limit model is constructed as a constraint condition for the operating boundary. This model is a multi-dimensional lookup table or function mapping relationship. For example, in low-temperature environments (lower temperatures), the power upper limit will be significantly reduced to protect battery activity; similarly, when the SOH is low (battery aging), the maximum throughput power will be limited. The boundary determined by this model constitutes the hard constraint baseline for all subsequent control algorithms.

[0021] S2: Target power calculation based on MPC.

[0022] After defining the system's operating boundaries, the control strategy enters the core optimization phase. The central controller executes the following steps: based on the operating boundaries, it uses the Dynamic Periodic Model Predictive Control (MPC) algorithm to calculate the system's target charging and discharging power.

[0023] The core advantage of model predictive control lies in its ability to handle multivariable, constrained optimization problems and its forward-looking adjustment capability. The core of the method described for calculating the target charging and discharging power of the system using the Dynamic Periodic Model Predictive Control (MPC) algorithm is to construct a cost function that comprehensively considers the interests of multiple parties.

[0024] Specifically, the controller constructs an MPC objective function, which includes a renewable energy prediction bias term, a grid voltage fluctuation term, a battery polarization term, and a deviation term between the total power of multiple vehicles and grid acceptance capacity. These four sub-objectives correspond to the four key dimensions of microgrid energy management: 1. Renewable Energy Forecast Bias Term: This term aims to mitigate the forecast errors of wind and solar power as much as possible through the charging and discharging behavior of the system. When the actual output is less than the forecast, the system tends to discharge to make up for it; otherwise, it charges to absorb the power. 2. Grid voltage fluctuation item: This item aims to maintain voltage stability at the PCC point by adjusting reactive or active power, and to prevent overvoltage or undervoltage. 3. Battery polarization level: This is a battery life-friendly penalty item that limits control commands from causing excessive battery polarization, thereby extending battery life. 4. Deviation between total power of multiple vehicles and grid acceptance capacity: Ensure that the total output of the system strictly matches the current grid acceptance or dispatch instructions to prevent overload tripping.

[0025] It is also important to note that the importance of these four sub-objectives changes dynamically under different operating conditions. Therefore, this embodiment dynamically adjusts the weight coefficients of each term in the MPC objective function based on the current system state. For example, in an emergency when the grid voltage exceeds the limit alarm, the weight coefficient of the voltage fluctuation term is significantly increased, forcing the optimizer to prioritize sacrificing other performance indicators to stabilize the voltage; while when the grid is stable and in nighttime charging mode, the weight of the battery polarization term increases to achieve the gentlest charging strategy. Finally, by solving the MPC objective function using a quadratic programming (QP) solver, the optimal target charge / discharge power sequence for the next prediction time domain can be obtained, and only the first control variable is issued as the current execution instruction.

[0026] like Figure 2 This paper intuitively demonstrates the multi-objective optimization dynamic response process of the dynamic periodic model predictive control algorithm in response to sudden voltage fluctuations in the power grid. Figure 2 The three sub-graphs arranged from top to bottom correspond to the per-unit value of the grid voltage, the weight coefficient values ​​of different objective functions within the algorithm, and the actual reactive power output value of the system.

[0027] like Figure 2 As shown, when the real-time grid voltage, represented by the first red curve, suddenly drops and deviates from its rated value during operation, the central controller immediately identifies a threat to the system's safety boundary through the preprocessing module. The second curve clearly reflects the algorithm's adaptive decision-making logic. The solid blue line representing the voltage fluctuation weight increases dramatically after detecting the anomaly, while the dashed black line representing the renewable energy prediction deviation weight decreases simultaneously. This indicates that the controller is proactively sacrificing tracking accuracy for renewable energy output to prioritize grid voltage stability. Driven by this weight redistribution strategy, the system's reactive power output, represented by the third green curve, rapidly rises from zero to a high level, injecting emergency reactive power support into the grid to suppress further voltage drops.

[0028] The simulation results strongly demonstrate that the present invention can not only achieve optimized energy scheduling, but also achieve millisecond-level rapid response and active support in emergency situations such as voltage overruns in the power grid by dynamically adjusting the weight configuration of the objective function, thereby ensuring the inherent safety and stability of the mobile charging and discharging system in the interaction process with the power grid.

[0029] S3: Multi-vehicle Coordination Optimization and Power Allocation MPC only calculates the total power demand at the system level. How to scientifically allocate this total command to each vehicle participating in V2G is another innovation of this embodiment. Therefore, the method also includes a multi-vehicle coordination optimization step.

[0030] Specifically, to ensure fair and efficient vehicle dispatching, the central controller first calculates the priority of each vehicle based on its State of Health (SOH), State of Charge (SOC) deviation, temperature, and urgency of demand. This priority calculation is a weighted evaluation process: vehicles with high SOH indicate better battery quality and are more suitable for high-frequency throughput tasks, thus receiving a higher score; SOC deviation reflects the difference between the vehicle's current charge level and the user's desired charge level or the system's optimal charge level—the greater the deviation, the more urgent the need for a return to charging; vehicles with suitable temperatures are prioritized over those that are too cold or too hot; and the urgency of demand is directly determined by the user-set off-grid time, with vehicles about to leave having the highest charging priority.

[0031] For example, priority evaluation indicators and weights are set. Based on the vehicle's health status (SOH, weight 0.3), SOC deviation (weight 0.3), real-time temperature (weight 0.2), and demand urgency (weight 0.2), a priority score for each vehicle is calculated by weighted summation. The higher the score, the higher the priority. The SOC deviation is the absolute value of the difference between the vehicle's current SOC and the optimal SOC (50%-60%). The demand urgency is determined based on the user-set offline time. The shorter the offline time, the higher the urgency.

[0032] After obtaining the priority ranking of each vehicle, the system allocates the target charging and discharging power according to the priority based on a distributed resource consensus algorithm. The use of a distributed algorithm instead of centralized allocation improves the system's robustness, allowing vehicle controllers to reach consensus through neighbor negotiation even in the event of partial communication link failures.

[0033] For example, the allocation logic follows the principles of peak shaving and valley filling, and rewarding the strongest vehicles. Excess power from renewable energy is prioritized for allocation to vehicles with the highest priority, meaning the vehicles in the best condition receive clean energy charging first. Simultaneously, vehicles with high priority and a State of Charge (SOC) above a preset value supplement the power gap in renewable energy. Adding a condition limiting SOC above the preset value is crucial here to prevent vehicles with high State of Charge (SOH) from being forced to discharge even when their battery is already depleted (e.g., vehicles with SOC < 20%), leading to deep over-discharge.

[0034] S4: Pulse Coordination Control and Execution.

[0035] After determining the specific power load for each vehicle, pulse control technology was introduced at the execution level to further improve charging efficiency and suppress lithium plating. The grid-connected control process, initiated based on the target charging / discharging power, also includes the execution of a polarization-sensing pulse coordination strategy at the execution level.

[0036] Specifically, this strategy adaptively adjusts waveform parameters based on the command type and the battery's internal state. When the command corresponding to the target charge / discharge power is a high-power charging mode and the battery polarization is less than a preset polarization threshold, pulse charging is performed using a first frequency and a first duty cycle. At this time, the battery is in good condition, and the system uses a lower frequency and a larger duty cycle, such as a long on-time, to maximize energy transfer efficiency.

[0037] However, when the battery polarization exceeds the preset polarization threshold, the system adjusts to a second frequency and a second duty cycle. To allow sufficient diffusion time for lithium ions and eliminate concentration polarization, the system must reduce the effective action time and accelerate the relaxation rhythm. Therefore, the second frequency is greater than the first frequency, and the second duty cycle is less than the first duty cycle. This dynamic adjustment mechanism ensures that even under high-power conditions, the electrochemical environment inside the battery remains relatively mild.

[0038] like Figure 3 This demonstrates the dynamic parameter adjustment logic of a polarization-sensing pulse-coordinated strategy during high-power battery charging. The horizontal axis represents the charging duration, the left vertical axis indicates the degree of polarization within the battery, and the right vertical axis uniformly represents the ratio of the pulse frequency (Hertz) to the duty cycle.

[0039] Figure 3 As shown by the solid blue line, as the charging process continues, the lithium-ion concentration difference inside the battery gradually accumulates, causing the polarization level to start at 0.02 and increase linearly. In the first half of the region, since the blue polarization curve is below the preset polarization threshold of 0.05 (shown by the black dashed line), the system determines that the battery is in a healthy and efficient receiving state. At this time, the pulse frequency shown by the red stepped line on the right is maintained at a lower first frequency level of 1 Hz, while the duty cycle shown by the green stepped line is maintained at a higher first duty cycle level of 0.5 to maximize energy transfer efficiency.

[0040] When the time advances to three seconds, the blue polarization curve breaks through the threshold warning line of 0.05, and the central controller immediately triggers the protection mechanism. The red curve in the figure instantly jumps to the second frequency of 2 Hz, while the green curve synchronously decreases to the second duty cycle of 0.3.

[0041] This combination of high-frequency, low-duty-cycle parameters effectively suppresses further deterioration of concentration polarization by increasing the number of relaxations per unit time and reducing the single current conduction time. This intuitively demonstrates that the present invention can actively avoid the risk of lithium plating while ensuring charging speed, and achieves dynamic closed-loop protection for battery life.

[0042] Furthermore, to address the grid impact caused by multiple vehicles operating concurrently, the controller implements peak-shaving management. Specifically, the pulse conduction intervals of the multiple vehicles participating in grid connection are staggered to ensure that the total duty cycle meets grid constraints. The controller allocates non-overlapping (or partially overlapping but not exceeding limits) conduction time windows for each vehicle on a microsecond-level time axis. For example, if there are a total of 3 vehicles, each with a duty cycle of 0.3, the controller schedules vehicle A to conduct from 0 to 0.3T, vehicle B from 0.33 to 0.63T, and vehicle C from 0.66 to 0.96T. In this way, from the grid side, the current waveform is approximately a smooth DC or low-ripple current, effectively avoiding the impact of instantaneous power spikes on the transformer caused by multiple vehicles conducting simultaneously.

[0043] S5: Grid connection control process and smooth transition.

[0044] When the system is ready and needs to formally establish an electrical connection with the grid or inject power, the most critical grid connection control process is initiated. The central controller executes the following steps: In response to the grid connection request, it initiates the grid connection control process according to the target charging and discharging power to achieve bidirectional energy interaction between the mobile charging and discharging system and the grid.

[0045] Traditional grid connection often involves a large inrush current. This embodiment solves this problem through a precise timing control system. The grid connection start-up control process includes the following rigorous sub-steps: First, the system enters the pre-synchronization and control acceleration phase. Upon receiving the grid connection command, the controller shortens the optimization cycle of the MPC algorithm from a first duration to a second duration and performs pre-synchronization tracking of the grid voltage phase. Here, the second duration is shorter than the first duration. For example, in off-grid standby mode, MPC might run with a cycle of 100ms (first duration) to save computing power; once grid connection is initiated, the cycle instantly switches to 20ms (second duration), refreshing control commands at a very high frequency to ensure the system can capture millisecond-level fluctuations in grid voltage. Simultaneously, the software phase-locked loop (PLL) begins operation, adjusting the phase, frequency, and amplitude of the inverter output voltage to approximate the grid-side parameters.

[0046] Secondly, the system enters the grid connection determination and freezing phase. When the phase difference meets the preset phase threshold, for example, the phase difference is less than 1 degree, it indicates excellent synchronization. To prevent parameter jumps caused by calculation fluctuations in the control algorithm at the moment the relay is closed, the system performs an operation to freeze the power calculation of the MPC algorithm. This step is equivalent to holding one's breath, keeping the controller output in the optimal state of the last frame, and ensuring that the electrical environment at the moment of closing is deterministic and static.

[0047] Following this, the system enters the buffer calculation phase. During the freeze period, the controller is not inactive; instead, it determines the buffer power at the moment of grid connection. This buffer power is not the target power, but an intermediate transitional value used to offset the circulating current that may occur at the moment of connection. Determining the buffer power at the moment of grid connection involves predicting future states: forecasting the changing trend of grid voltage parameters within a preset time window before grid connection. Simultaneously, the system determines whether renewable energy is currently in a surplus or deficit state.

[0048] If the power supply is in a surplus state, the buffer power is determined based on the surplus power; if the power supply is in a deficit state, the buffer power is determined based on the deficit power. This strategy ensures that the direction of the buffer power is consistent with the current energy demand trend of the power grid, acting in accordance with the trend. It should also be noted that, in order to prevent the buffer power from being too small, which could lead to inverter control instability or entering a dead zone, the calculated buffer power should not be lower than a preset minimum power threshold.

[0049] Finally, the system performs soft grid connection and ramp-up. After determining the buffer power, the relay closes, and the control system connects to the grid at the buffer power. At this point, due to phase synchronization and power preset, the inrush current is minimized. Subsequently, the system transitions to the target charging and discharging power at a preset slope. This preset slope (Slew-Rate) limits the rate of power change, such as an increase of 5kW per second, allowing the grid sufficient time to adapt to the newly injected or extracted energy through primary or secondary frequency regulation, thereby achieving truly seamless grid connection.

[0050] like Figure 4 The figure illustrates the key timing waveforms and parameter changes of the mobile charging and discharging system during the grid connection control process. The horizontal axis represents the system running time, and the three sub-figures arranged from top to bottom reflect the phase difference convergence process, the timing of the grid connection switch action, and the dynamic response of the output current, respectively.

[0051] like Figure 4As shown by the first blue curve, in the initial stage of the system responding to the grid connection request, due to the controller shortening the optimization cycle and initiating pre-synchronous tracking, the phase difference between the inverter output voltage and the grid voltage decays exponentially and rapidly, eventually converging within the preset grid connection allowable phase threshold range shown by the green dashed line. Immediately thereafter, when the phase condition is met, the grid connection relay state, shown by the second black curve, instantly switches from the open state to the closed state at 2 seconds.

[0052] The most critical technical effect is reflected in the red curve in the third row. At the moment the relay closes, the system output current does not jump directly from 0 to the target high value. Instead, it first rises in steps to a smaller pre-calculated buffer power value. This value effectively offsets the circulating current impact at the moment of closing.

[0053] Subsequently, the current curve rises smoothly and strictly according to the preset slope, and after a period of linear transition, finally reaches the target power value. This simulation result clearly demonstrates that the present invention, through a combination of phase pre-synchronization, buffer power preset, and slope control strategies, successfully achieves a zero-impact smooth transition during the electrical connection establishment process, ensuring dual safety on both the grid side and the equipment side.

[0054] S6: Proactive intervention and graded downgrade of abnormalities.

[0055] Although the above control strategies are quite comprehensive, failures are inevitable in complex industrial environments. To ensure the inherent safety of the system, this embodiment introduces a tiered defense mechanism. Specifically, the method further includes proactive intervention for anomalies and tiered degradation steps: The system runs a background monitoring daemon in real time to identify any abnormalities in the system, such as vehicle anomalies, renewable energy anomalies, or grid anomalies. Vehicle anomalies may include BMS communication timeouts and excessive individual voltage differences; renewable energy anomalies may include photovoltaic inverter islanding protection and wind turbine overspeed shutdown; grid anomalies may involve frequency exceeding limits and voltage sag (LVRT), etc.

[0056] The system employs different strategies for different combinations of faults of varying severity: 1. If a single anomaly is identified, such as only one vehicle reporting a fault, but the power grid and energy source are normal, the system initiates the target data stream termination process and schedules the remaining vehicles to adjust their pulse duty cycles. This means that only the faulty node is removed, and other vehicles fill the gap, while the system as a whole continues to operate normally, demonstrating robustness. 2. If a dual anomaly is identified, such as severe fluctuations in renewable energy causing complete forecast failure, and simultaneously unstable grid voltage, continuing complex MPC optimization may lead to dissemination or control oscillations. Therefore, the system performs a second-level degradation, switching the control mode to constant voltage mode and limiting charging and discharging power. Constant voltage mode (CV) or constant current mode (CC) are more traditional but extremely stable control methods, sacrificing efficiency and response speed, but ensuring the system does not crash. 3. If a triple anomaly is identified, such as extreme weather causing simultaneous alarms on the power source, grid, and load sides, then safety becomes the sole objective. The system will implement a three-level degradation mechanism, disconnecting the grid connection of vehicles with non-emergency needs, retaining only the minimum connections required to maintain the system's own power supply or emergency loads, or completely de-isolating the system for islanded operation.

[0057] In summary, this embodiment constructs a complete mobile charging and discharging control system supporting V2G. This system not only deeply protects battery life at the algorithm level through polarization control and frequency adjustment, but also achieves grid-friendly access at the system level through pre-synchronization, freezing, and buffering strategies. Furthermore, it provides comprehensive degradation contingency plans at the safety level, fully meeting the stringent requirements of modern smart microgrids for plug-and-play, two-way interaction, and safety and reliability of mobile energy storage units.

[0058] Example 2: Building upon Example 1, this embodiment further provides a more sophisticated control strategy for the more complex and challenging V2G practical application scenario of multi-vehicle mixed charging and discharging. Specifically, Example 1 mainly addresses the boundary and stability issues of the overall system interaction with the external power grid, as well as peak-shaving control for unidirectional flow; while this embodiment focuses on the heterogeneous source-load characteristics within the system, using an innovative internal hedging mechanism to solve the grid-side power ripple oscillation problem that may be caused by traditional pulse staggering strategies in bidirectional energy flow scenarios.

[0059] The core logic of this embodiment lies in constructing a source-load pulse synchronization cancellation mechanism based on flow offsetting, utilizing the simultaneous charging and discharging demands within the mobile charging and discharging system. This mechanism can significantly reduce power fluctuations at the grid connection point PCC, improve power quality, and alleviate thermal stress on power devices.

[0060] The technical solution of this embodiment will be described below in conjunction with specific control steps and logical judgments: Phase 1: Real-time identification and classification of source load attributes.

[0061] In the actual operation of mobile charging and discharging systems, multiple electric vehicles connected to the DC bus often have drastically different operational states. To achieve refined control, the central controller first needs to identify and classify the operating modes and attributes of all vehicles participating in grid connection in real time.

[0062] Specifically, the central controller periodically scans the BMS status data of each vehicle and the user-defined task instructions. This method includes a source-load pulse synchronization cancellation step to handle multi-vehicle mixed charging and discharging scenarios. As the starting point of this step, the system performs real-time identification of the operating mode of each vehicle participating in grid connection, classifying vehicles in the discharging state as source-attribute vehicles and vehicles in the charging state as load-attribute vehicles.

[0063] For example, the system defines a vehicle as a source attribute vehicle not only based on the direction of current but also incorporating business logic. When a vehicle's State of Charge (SOC) exceeds a preset high-charge threshold, the user has signed a V2G discharge agreement, and the current grid electricity price is high or the grid has issued a peak-shaving command, the central controller sends a discharge command to the vehicle. Once the command is confirmed and executed, the vehicle is marked as a source attribute vehicle at the logic layer. This means that, in terms of electrical characteristics, the vehicle is equivalent to a controllable DC power source, capable of injecting energy into the DC bus.

[0064] Correspondingly, the definition of a load-dependent vehicle refers to those vehicles whose State of Charge (SOC) is lower than the user's expected value, or those in a state of emergency charging demand. Upon receiving a charging command from the system, the power converters of these vehicles operate in rectification or Buck mode (depending on the topology), absorbing energy from the DC bus. At this point, the vehicle is logically marked as a load-dependent vehicle, and its electrical characteristics are equivalent to a dynamic load.

[0065] It is also important to note that this attribute division is dynamically updated. At the beginning of each control cycle (such as the second duration mentioned in Example 1, i.e., the short cycle after grid connection), the controller reconfirms the source attribute vehicle set and the load attribute vehicle set in the list. If at any given moment, only source attribute vehicles or only load attribute vehicles exist in the system, the system maintains the control logic in Example 1; however, once it is detected that both sets are not empty, i.e., the system has both source and load vehicles, the core hedging control process of this example will be triggered.

[0066] Phase Two: Calculation of the offsetting power benchmark.

[0067] Once the system confirms that it has entered a hybrid mode where source and load coexist, the controller needs to perform precise power calculations in order to quantify the scale of energy that it can absorb internally.

[0068] Specifically, when both the source vehicle and the load vehicle exist simultaneously, the total discharge pulse power of the source vehicle and the total charging pulse power of the load vehicle are calculated. The total discharge pulse power mentioned here refers to the absolute value of the sum of the power vectors that all vehicles marked as source vehicles can provide at the instant of pulse discharge. Similarly, the total charging pulse power refers to the absolute value of the sum of the power vectors required by all load vehicles at the instant of pulse conduction.

[0069] To determine the target value for synchronization control, the system executes a comparison logic: the smaller of the two values ​​is defined as the offsetting power benchmark. The physical meaning of this logic is that energy offsetting within the system follows the bottleneck effect; that is, the power flow that can be directly offset internally depends on the smaller of the supply and demand sides. For example, if the source vehicles can provide a total of 100kW of discharge power, while the load vehicles require a total of 80kW of charging power, then theoretically, only 80kW of energy can be directly transferred from source to load within the system, and the remaining 20kW must be injected into the grid. Therefore, the offsetting power benchmark in this case is 80kW. Conversely, if the source vehicles provide 80kW and the load vehicles require 100kW, the offsetting power benchmark is still 80kW, and the remaining 20kW demand must be supplemented by the grid.

[0070] Phase 3: Suspension and control mode switching with staggered logic.

[0071] After determining the offsetting power reference, the controller must switch the mode of the underlying pulse generator (PWM generation unit).

[0072] It is also important to note that in Example 1, to prevent unidirectional high-power surges, the system defaults to a strategy of staggered pulse conduction intervals. However, in bidirectional flow scenarios, continuing with this strategy will lead to severe ripple superposition. For example, in the first time slice, the source vehicle discharges, and the grid experiences a strong reverse current; in the second time slice, the load vehicle charges, and the grid experiences a strong forward current. This violent alternation of positive and negative currents is far more detrimental to the power quality of the grid than a unidirectional high current.

[0073] Therefore, specifically, in this embodiment, the controller performs the step of pausing the staggered conduction intervals of the execution pulses and instead performs pulse synchronization overlap control. This is a high-priority state machine transition instruction. Once issued, the underlying PWM scheduler will no longer force all vehicles' waveforms to be non-overlapping, but will instead enter a special phase-locked mode.

[0074] Fourth stage: Execution of pulse synchronization overlap control.

[0075] This is the core technical aspect of this embodiment, and its purpose is to force the alignment of the source and load actions in the time domain, thereby achieving physical cancellation of current in the spatial domain (DC bus).

[0076] Specifically, the pulse synchronization overlap control includes: using the offset power reference as a target, controlling the pulse conduction phases of the source attribute vehicle and the load attribute vehicle to be forcibly aligned in the time domain.

[0077] At the micro-control timing level, the central controller broadcasts a global synchronization clock signal. For the source and load vehicles participating in the offsetting mechanism, the controller calculates their respective pulse turn-on times. In the conventional staggered mode, these times are evenly distributed throughout the control cycle. However, in the synchronous overlap mode of this embodiment, the controller forces the turn-on times of the power switching devices of all source vehicles to be set to the same phase point as the turn-on times of the power switching devices of the load vehicles.

[0078] For example, assuming the control period is T, the system calculates that the source vehicle needs to be on for 0.4T time, and the load vehicle also needs to be on for 0.4T time. The controller will issue a command to simultaneously close all switching devices related to the vehicles at time 0 and simultaneously open them at time 0.4T.

[0079] The direct physical effect of this control is that the discharge current and charging current cancel each other out within the system. During the period from 0 to 0.4T, the electron flow emitted by the source vehicle flows out of its battery pack and into the DC bus of the mobile charging and discharging system; simultaneously, the battery pack of the load vehicle is absorbing electron flow through the bus. Because the two actions are synchronized, most (or even all, depending on the matching degree) of the current emitted by the source vehicle flows directly into the battery of the load vehicle. For the power grid connected to the other end of the bus, it only needs to provide or receive the difference between the two.

[0080] Therefore, the system only transmits the net power difference that cannot be offset to the grid. Continuing the above example, if the source discharges 100A and the load charges 80A, under synchronous overlap control, the current detected on the grid side is only the net outflow of 20A, and its direction is stable. Compared to the drastic fluctuation of 100A flowing out first and then 80A flowing in under staggered control, synchronous overlap control reduces the current ripple amplitude at the PCC point by several times, greatly smoothing the grid-connected power curve.

[0081] like Figure 5 The stark contrast between the two sub-figures vividly demonstrates the significant technical effectiveness of the source-load pulse synchronization cancellation strategy in suppressing grid-side power ripple.

[0082] Figure 5The horizontal axis represents the system running time, and the vertical axis represents the real-time current value at the grid connection point.

[0083] In the subplot above, the red curve depicts the current waveform when using a traditional peak shifting strategy. It can be seen that there are sharp alternating jumps between the 100 amp peak discharge of the source vehicle and the -80 amp peak charge of the load vehicle, causing the grid to suffer peak-to-peak ripple impacts of up to 180 amps. This corresponds to the ripple superposition conflict mentioned in the background technology.

[0084] In contrast, the sub-figure below shows the blue current waveform after applying the synchronous cancellation strategy of this invention. Because the controller forces the pulse phase alignment of the source and load, the 100 amp discharge current and the 80 amp charging current are directly and physically canceled out within the system's DC bus, resulting in the current monitored on the grid side being only the algebraic sum of the two, a net difference of 20 amps. This smooth, low-amplitude pulse waveform strongly demonstrates that this invention can reduce the current ripple amplitude at the grid connection point by several times, thereby significantly reducing the electrical stress on the transformer and power switching devices and ensuring power quality during bidirectional energy exchange.

[0085] Phase 5: Subsequent handling of remaining vehicles and power.

[0086] In actual operating conditions, the power of the source and the load are often difficult to be completely equal, which means that after the core synchronization offset is completed, there will inevitably be unprocessed residual parts in the system.

[0087] Specifically, after executing the pulse synchronization overlap control, if there are remaining vehicles or remaining power that have not been offset, then the pulse conduction intervals corresponding to the remaining vehicles or remaining power are mutually staggered. This step reflects the completeness and closed-loop characteristics of the control strategy.

[0088] For example, suppose there are three cars in the system: Vehicle A (Source Attributes): Pulse power 50kW, duty cycle 0.5; Vehicle B (source attribute): pulse power 50kW, duty cycle 0.5; Vehicle C (load attribute): pulse power 60kW, duty cycle 0.6.

[0089] First, the system calculates the baseline. The total source power is 100kW, and the total load power is 60kW. The offsetting power baseline is 60kW. The system identifies vehicle A and vehicle B as sources, and vehicle C as a load. During the synchronization overlap phase, the controller schedules vehicle C to conduct during the 0-0.6T time period. To offset vehicle C's 60kW demand, the system schedules vehicle A and vehicle B to provide a total of 60kW of power within the 0-0.6T interval, for example, by adjusting their respective instantaneous currents or partially overlapping.

[0090] However, the total source capacity is 100kW, of which only 60kW is used for offsetting, leaving a net source power of 40kW to be injected into the grid. This 40kW may come from the remaining generating capacity of vehicles A and B, or from a fourth vehicle D in the system that has not yet participated in offsetting. For this 40kW of power purely output to the grid, since there is no internal load to absorb it, allowing them to conduct simultaneously would cause a grid surge. Therefore, the system reactivates staggered logic for the pulses corresponding to this remaining 40kW of power. That is, the release time of this remaining energy is evenly distributed within the control period T to avoid overlapping peak values.

[0091] Phase 6: Analysis of technical effects and advantages.

[0092] By implementing the source-charge pulse synchronization cancellation strategy in Embodiment 2 above, this mobile charging and discharging system demonstrates significant technical advantages in bidirectional energy interaction scenarios: On the one hand, this method fundamentally solves the problem of ripple superposition in V2G scenarios. Traditional control methods often require increasing the capacitance of the filter capacitor on the DC bus side to absorb ripple when dealing with bidirectional current, which increases the size and cost of the system. However, this embodiment achieves the effect of passive filtering by using phase alignment at the algorithm level, utilizing the capacitance characteristics of the battery itself and the circulating current inside the system, thus reducing the dependence on hardware filter parameters. On the other hand, this strategy optimizes the thermal distribution of power devices. In synchronous offset mode, current primarily flows on the DC side between the individual vehicle converters, reducing the proportion of energy flowing to the grid via the grid-connected inverter (AC / DC). This means that the conduction and switching losses of the grid-connected inverter are substantially reduced, thereby extending the lifespan of the core grid-connected equipment and improving the overall energy efficiency ratio of the system.

[0093] In summary, this embodiment constructs an advanced energy control method that can perfectly adapt to the complex operating conditions of V2G. It complements the first embodiment and together ensures that the mobile charging and discharging system can achieve the goal of being most grid-friendly, battery-safe, and system-efficient under any operating condition.

[0094] Example 3: Based on Embodiments 1 and 2, this embodiment further addresses the extreme environmental conditions that mobile charging and discharging systems may encounter in actual grid-connected operation, especially the thorny issue of high-frequency and drastic fluctuations in renewable energy output, by providing a deep protection and optimization strategy based on state inertia.

[0095] It should be noted that Embodiment 1 mainly addresses the multi-objective optimization and smooth grid connection issues under steady-state conditions, while Embodiment 2 mainly addresses the internal ripple cancellation problem during bidirectional energy flow. However, in scenarios such as island microgrids, plateau photovoltaic power stations, or wind farms in windy weather, the output power of renewable energy is often no longer smoothly changing, but exhibits polarity reversals and large oscillations on a second- or even millisecond-level scale. Under such harsh conditions, if the traditional static priority scheduling strategy is still used, the best battery resources in the system will be forced to follow the source power through high-frequency charging and discharging switching, the so-called ping-pong effect. This not only causes serious side reactions inside the battery, but also causes the power relays and contactors in the on-board charger to fail prematurely due to frequent switching. Therefore, this embodiment details a dynamic hysteresis adjustment step based on state inertia, aiming to find the optimal dynamic balance between system stability and equipment lifespan.

[0096] Phase 1: Real-time monitoring and pattern recognition of renewable energy fluctuation characteristics.

[0097] In the top-level design of the control strategy, the central controller first needs to have a keen environmental perception capability, and be able to identify whether the changing characteristics of the current renewable energy have exceeded the scope of conventional regulation.

[0098] Specifically, the method in this embodiment performs the crucial step of real-time monitoring of the fluctuation frequency of renewable energy output. To quantify this physical quantity, the central controller is configured with a sliding time window, the length of which can be set according to the inertia constant of the microgrid. Within the time window, the controller differentiates the collected real-time renewable energy output data, or counts the number of times the power curve crosses the average value line. Through this mathematical processing, the system can calculate the fluctuation frequency index at the current moment.

[0099] For example, when the system detects multiple drops in photovoltaic output from full power to zero power within a minute, such as due to obstruction by rapidly moving cumulus clouds, the calculated fluctuation frequency will increase significantly. The system has a pre-set oscillation frequency threshold, which serves as a dividing line between steady-state and oscillating conditions. When the detected fluctuation frequency exceeds the preset threshold, the central controller determines that the current system environment is adverse and the static scheduling strategy is no longer applicable, and then issues a command to activate the hysteresis control mode.

[0100] Phase Two: Acquisition of Historical States and Introduction of Inertia Factor.

[0101] Once in hysteresis mode, the core control logic of the system shifts from pursuing instantaneous optimization to maintaining the current state. To achieve this, the controller needs to introduce the concept of inertia, which means that the vehicle tends to maintain its previous operating state unless the external driving force is sufficiently large.

[0102] Specifically, when allocating the gap power in the hysteresis adjustment mode, the central controller first performs the operation of acquiring the operating status of each vehicle in the previous control cycle. Here, the control cycle refers to the execution step size of the MPC algorithm, typically on the order of seconds. The operating status mainly includes three types: charging state, discharging state, and standby state. For vehicles that were in the charging state in the previous control cycle, this means that lithium ions inside the vehicle are migrating from the positive electrode to the negative electrode, and the relevant charging relay is in the closed state.

[0103] At this point, the system faces the task of rationally selecting vehicles to discharge and fill the power gap when renewable energy suddenly experiences a power shortage, such as when photovoltaic power is suddenly blocked. According to the static priority algorithm in Implementation Example 1 (based on SOH, SOC, etc.), high-quality vehicles that are currently charging often have the highest discharge priority due to their extremely high SOH scores. Without intervention, these vehicles will be immediately instructed to switch to discharging.

[0104] To suppress this harmful switching, this embodiment performs the core penalty calculation: for vehicles that were in the charging state in the previous control cycle, a preset state switching penalty value is deducted from their originally calculated priority, thereby generating a corrected discharge scheduling priority.

[0105] It should be noted that the priority calculated here refers to the comprehensive score calculated based on static parameters such as battery health, state of charge deviation, temperature, and urgency of demand, as described in Example 1. The state-of-the-art penalty value, on the other hand, is a preset dimensionless scalar value. Its physical meaning represents the resistance or cost imposed by the system forcibly changing the vehicle's operating state. This value is precisely tuned to offset the priority advantage brought by SOH (State of Charge), but not so large that the system completely loses its ability to adjust.

[0106] Phase 3: Priority rearrangement and substitute scheduling mechanism.

[0107] After the aforementioned penalty calculation and processing, the priority sequence of vehicles in the system was fundamentally restructured. This restructuring directly led to the reversal of the scheduling sequence, thereby achieving the control effect of a substitute taking over.

[0108] Specifically, the discharge scheduling priority ensures that high-priority vehicles that were charging in the previous control cycle are placed after low-priority vehicles that are in standby or discharging states in the allocation sequence.

[0109] To explain this process more clearly, we can imagine a scenario: A high-quality vehicle A has a State of Health (SOH) of 95% and was charging at the previous moment; another ordinary vehicle B has a SOH of 80% and was in standby mode at the previous moment. Under static logic, vehicle A has a higher priority than vehicle B. However, in hysteresis mode, because vehicle A needs to cross a large state gap to switch from charging to discharging, its priority score is reduced by a significant state transition penalty. Conversely, vehicle B switching from standby to discharging, or continuing to discharge if it was already discharging, does not incur this penalty, or it is reduced by a very small amount. The result is that the adjusted discharge scheduling priority of vehicle A becomes lower than that of vehicle B.

[0110] Accordingly, the central controller executes the step of sequentially scheduling vehicles to perform discharge commands to fill the power gap, according to the discharge scheduling priority from high to low. This means that, faced with a sudden power gap, the system will prioritize using ordinary vehicles (vehicle B) that were originally idle or were working to fill the gap, while allowing high-performance vehicles (vehicle A) that were charging to continue charging or to standby mode, thus avoiding the violent charging-discharging-charging fluctuations experienced by vehicle A in a short period of time. This strategy sacrifices the instantaneous optimal matching of battery performance in exchange for minimizing losses over the entire battery life cycle.

[0111] like Figure 6 The two corresponding sub-graphs visually demonstrate the control effect of the dynamic hysteresis adjustment strategy based on state inertia in dealing with the high-frequency and drastic fluctuations of renewable energy.

[0112] Figure 6 The horizontal axis represents time uniformly, and the upper subplot shows the real-time change curve of the photovoltaic system output power under simulated cloudy weather. It can be seen that the black curve exhibits high-frequency oscillation characteristics including random noise and multiple large drops, and crosses the power balance baseline shown by the green dashed line multiple times.

[0113] The sub-figure below compares the changes in vehicle operating status caused by two different control strategies under the same power input conditions. The red dashed line represents the traditional control strategy without introducing hysteresis. Its state follows the power curve, switching frequently and densely between charging and discharging, exhibiting a ping-pong effect that is extremely detrimental to battery life.

[0114] In contrast, the solid blue line represents the vehicle state after applying the hysteresis adjustment strategy of this invention. Because the controller introduces a state switching penalty value in the algorithm, it artificially constructs an energy barrier, enabling the vehicle to filter out invalid fluctuations with small amplitude or short duration in the middle section.

[0115] like Figure 6As shown, within a short fluctuation range of 25 to 28 seconds, the blue curve maintained a stable charging state without unnecessary reversals, only performing necessary support actions when the power deficit was large and persistent. This comparative result demonstrates that the present invention can effectively suppress the mechanical losses of vehicle batteries and power relays caused by high-frequency disturbances, significantly extending the service life of the equipment while ensuring the macroscopic stability of the power grid.

[0116] Phase 4: Dead Zone Breakthrough and Forced Balancing Strategy.

[0117] While introducing hysteresis regulation can effectively protect the battery, the primary task of a mobile charging and discharging system is always to maintain the power balance and voltage stability of the microgrid. Excessive hysteresis, resulting in insufficient vehicles willing to switch states to fill the gap, will trigger grid collapse. Therefore, this embodiment sets a necessary safety baseline: a dead-zone breakdown mechanism.

[0118] Specifically, after completing the initial scheduling based on the revised priorities, the controller monitors the power grid's supply and demand balance in real time, calculating the remaining unfilled power gap. This value represents the energy deficit that still exists in the power grid after all willing backup vehicles have been called upon.

[0119] The system has a pre-set allowable power balance deviation range, which typically corresponds to the grid's allowable frequency deviation dead zone or the adjustment dead zone of the automatic generation control (AGC). If the remaining deficit is within this range, the system can tolerate minor frequency fluctuations without further stringent control.

[0120] However, only when the remaining unfilled power gap exceeds the grid's permissible power balance deviation range and no other available vehicles are found does it indicate that the risk to the grid has exceeded the need to protect battery life. In this case, the central controller must execute a decision to forcefully schedule vehicles (after deducting the state transition penalty) for state reversal until power balance is achieved.

[0121] For example, in the case above, if the discharge capacity of ordinary vehicle B is insufficient to fill the huge photovoltaic gap, and the grid frequency has fallen below the safety threshold, the controller will have to ignore the state switching penalty of vehicle A, forcibly command vehicle A to stop charging and immediately reverse to the discharge state. This design ensures that under extreme survival conditions, the system's safety has the absolute highest priority, that is, protecting the grid first, then protecting the battery.

[0122] Phase 5: Summary of Implementation Examples and Extension of Technical Effects

[0123] In summary, this embodiment constructs a robust control system with anti-jitter characteristics by adding a hysteresis element based on state monitoring and inertial penalty to the traditional V2G control loop. From a microscopic perspective, this method utilizes the mathematical tool of state-switching penalty values ​​to artificially set an energy barrier for the charging and discharging state transitions of a vehicle. A state transition only occurs when the external power gap driving force is large enough, exceeding the dead zone, to break through this barrier. This mechanism effectively filters out high-frequency, low-amplitude invalid fluctuation signals from renewable energy sources, ensuring that the vehicle battery receives smoothed low-frequency power commands. From a macro perspective, this strategy achieves a hierarchical mechanism in multi-vehicle collaboration: low-frequency, large-trend fluctuations are handled by high-priority, high-quality vehicles (after dead-zone breakdown), while high-frequency, minor fluctuations are absorbed by low-priority backup vehicles or the inertia of the power grid itself. This not only significantly reduces the number of cycles of expensive, high-performance battery packs and lowers the risk of relay contact burn-out, but also avoids communication bus congestion caused by frequent adjustments.

[0124] Furthermore, the hysteresis adjustment mode described in this embodiment is not static; the magnitude of its state switching penalty value can be adjusted secondaryly based on the vehicle's real-time temperature.

[0125] Optionally, in low-temperature environments, the electrochemical activity of the battery decreases, and frequent switching of polarity makes it easier for lithium to be deposited. Therefore, the controller will automatically increase the state switching penalty value of the vehicle in low temperatures, so that it has greater inertia and is more difficult to change its state, thereby providing adaptive protection for the ambient temperature dimension.

[0126] Through the solution in this embodiment, the present invention not only solves the problem of whether energy can flow bidirectionally, but also the problem of whether it should flow and which flows first under harsh operating conditions, providing a safe, economical and long-life engineering solution for large-scale electric vehicle clusters to participate in ancillary services of high-penetration renewable energy grids.

[0127] Example 4: like Figure 7 As shown, this embodiment provides a V2G-enabled mobile charging and discharging system with bidirectional energy control and grid connection. This system is a hardware and software assembly that implements the methods described in Embodiments 1 to 3, and its physical carrier is typically integrated into the central controller or edge computing gateway of the mobile charging and discharging station. This system aims to address the technical challenges mentioned in the background art, such as high-frequency fluctuations in renewable energy, grid connection impacts, and ripple superposition and battery life loss during bidirectional energy flow, through modular functional design.

[0128] The system described in this embodiment mainly consists of three core functional modules in its logical architecture: a multi-source data acquisition and preprocessing module, a target power calculation module, and a grid-connected control execution module. These three modules are coupled through a high-speed data bus, forming a closed-loop control system from environmental perception to decision-making and planning to precise execution.

[0129] Specifically, the system includes a multi-source data acquisition and preprocessing module. This module acts as the system's sensory nerve ending, responsible for communicating with the underlying sensor network, battery management system (BMS), and smart meters on the grid side. This module is configured to acquire multi-source data on battery status, grid operating status, and renewable energy output. In actual operation, this module can not only acquire basic information such as the battery's state of charge, health status, and individual cell voltage and temperature, but also monitor the grid's three-phase voltage, frequency, and the real-time output of renewable energy in real time. To address the issue mentioned in the background art that fixed parameter control cannot adapt to highly fluctuating environments, this module also possesses edge computing capabilities, i.e., preprocessing the multi-source data to assess the system's current operating boundaries. This preprocessing process encompasses the coordinate transformation and polarization calculation detailed in Embodiment 1, such as converting three-phase AC quantities into direct-axis and quadrature-axis components through coordinate transformation, and calculating polarization indices characterizing the battery's dynamic properties. Through these preprocessing steps, the module can transform the raw physical signals into mathematically understandable constraints for the controller, providing a precise search space for subsequent optimization calculations.

[0130] Furthermore, the system includes a target power calculation module. This module is typically integrated into a high-performance digital signal processor or embedded operating system. Based on the operating boundaries, this module uses a dynamic periodic model predictive control (MPC) algorithm to calculate the system's target charge / discharge power. Unlike traditional PID control, this module internally runs the cost function solver described in Embodiment 1, which can comprehensively consider multiple objectives such as voltage fluctuations, energy deviations, and battery life.

[0131] It is worth mentioning that, in order to implement the state inertia-based protection strategy described in Embodiment 3, this module also integrates priority rearrangement and hysteresis adjustment logic during the calculation process. When high-frequency oscillations of renewable energy are detected, the module automatically adjusts the constraints of the optimization algorithm and introduces a state switching penalty factor, thereby suppressing frequent switching between charging and discharging states of high-priority vehicles. This effectively solves the ping-pong effect problem mentioned in the background technology and protects the lifespan of the battery and power devices.

[0132] As a key component in the system's interaction with the physical world, the system includes a grid-connected control execution module. This module directly controls the pulse generator and relay array of the bidirectional inverter to respond to grid connection requests and initiate the grid-connected control process based on the target charging and discharging power, thereby achieving bidirectional energy interaction between the mobile charging and discharging system and the power grid.

[0133] To address the challenge of inrush currents during grid connection, the grid connection control execution module of this system employs a unique timing control logic when executing the grid connection initiation control process. Specifically, it first shortens the optimization cycle of the MPC algorithm from a first duration to a second duration. This cycle switching signifies an instantaneous transition from a low-power standby inspection mode to a high-frequency standby control mode, and the second duration is shorter than the first duration, ensuring the controller can detect millisecond-level fluctuations in grid voltage. Simultaneously, the module performs pre-synchronization tracking of the grid voltage phase, using software phase-locked loop (PLL) technology to guide the inverter's output voltage phase and amplitude to approximate the grid-side parameters.

[0134] During pre-synchronization, when the phase difference is detected to meet a preset phase threshold, the module immediately triggers a freeze command, freezing the power calculation of the MPC algorithm. This action prevents the output command from jumping due to iterative updates of the control algorithm at the critical moment of closing, thus ensuring that the control quantity at the moment of closing is deterministic and stable. During the freeze period, the module, in conjunction with the logic in Embodiment 1, determines the buffer power at the moment of grid connection based on the current energy supply and demand trend. Subsequently, the module issues a closing command, and the control system connects to the grid with the buffer power. Because the buffer power has been precisely calculated and conforms to the grid trend, the circulating current at the moment of connection is minimal. Finally, the module unfreezes and transitions to the target charging and discharging power at a preset slope, allowing the system to smoothly enter steady-state operation.

[0135] Furthermore, to complement the source-load pulse synchronization cancellation mechanism described in Embodiment 2, the grid-connected control execution module also integrates a pulse coordination unit. When the target power calculation module identifies vehicles with simultaneous charging and discharging needs within the system, the execution module takes over the underlying PWM modulation timing, forcibly aligning the conduction phases of the source vehicle and the load vehicle, thereby directly canceling current ripple on the DC bus side and significantly improving the grid-connected power quality.

[0136] In summary, the V2G-enabled mobile charging and discharging system with bidirectional energy control and grid connection provided in this embodiment perfectly replicates the technical features of the method embodiment through the organic combination of hardware modules and the deep embedding of software logic. It not only achieves adaptive optimization and smooth grid connection in dynamic environments, but also solves the pain points of traditional systems in bidirectional interactive scenarios through innovative internal hedging and inertial protection mechanisms, demonstrating significant engineering application value and beneficial effects.

[0137] Example 5: Corresponding to the above embodiments, the present invention also proposes an electronic device.

[0138] like Figure 8 The diagram shows a structural schematic of an electronic device according to the present invention. The electronic device 100 includes a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, for example, via a bus 102. Optionally, the electronic device 100 may further include a transceiver 104. It should be noted that in practical applications, the transceiver 104 is not limited to one unit, and the structure of this electronic device 100 does not constitute a limitation on the embodiments of the present invention.

[0139] Processor 101 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 101 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0140] Bus 102 may include a pathway for transmitting information between the aforementioned components. Bus 102 may be a PCI bus or an EISA bus, etc. Bus 102 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0141] The memory 103 stores a computer program corresponding to a bidirectional energy control and grid connection method for a V2G-enabled mobile charging and discharging system according to the above embodiments of the present invention. This computer program is executed by the processor 101. The processor 101 executes the computer program stored in the memory 103 to implement the content shown in the aforementioned method embodiments.

[0142] Among them, electronic devices 100 include, but are not limited to: mobile terminals such as laptops and PADs (tablet computers) and fixed terminals such as desktop computers. Figure 8 The electronic device 100 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0143] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A bidirectional energy control and grid connection method for a mobile charging and discharging system supporting V2G, characterized in that, include: Collect multi-source data on battery status, grid operation status, and renewable energy output, and preprocess the multi-source data to assess the current operating boundary of the system; Based on the aforementioned operating boundary, the target charging and discharging power of the system is calculated using the dynamic periodic model predictive control (MPC) algorithm. In response to the grid connection request, the grid connection control process is initiated according to the target charging and discharging power to realize bidirectional energy interaction between the mobile charging and discharging system and the power grid; The process of initiating the grid connection control procedure includes: shortening the optimization period of the MPC algorithm from a first duration to a second duration, and performing pre-synchronization tracking of the grid voltage phase, wherein the second duration is shorter than the first duration; When the phase difference meets the preset phase threshold, the power calculation of the MPC algorithm is frozen, the buffer power at the moment of grid connection is determined, the control system connects to the grid with the buffer power, and transitions to the target charging and discharging power at a preset slope.

2. The method according to claim 1, characterized in that, The multi-source data collected, including battery status, grid operation status, and renewable energy output, includes: Collect real-time power output data and short-term forecast power output data of renewable energy, and calculate power output volatility and forecast deviation; Collect voltage stability indicators, frequency deviation, and line impedance data of the power grid; The power output fluctuation rate is the ratio of the absolute value of the difference between the power output at the current moment and the power output at the previous sampling moment to the rated power.

3. The method according to claim 1, characterized in that, The preprocessing of the multi-source data to assess the current operational boundaries of the system includes: Perform coordinate transformation on the three-phase AC voltage and current to extract the direct-axis and quadrature-axis components; Calculate the degree of polarization of the battery, which is characterized as the ratio of the difference between the pulse peak voltage and the pulse steady-state voltage to the pulse steady-state voltage; Based on the battery health state (SOH), real-time temperature, and state of charge (SOC), a dynamic charging and discharging power upper limit model is constructed as a constraint condition for the operating boundary.

4. The method according to claim 1, characterized in that, The calculation of the target charge and discharge power of the system using the dynamic periodic model predictive control (MPC) algorithm includes: Construct an MPC objective function, which includes a renewable energy prediction bias term, a grid voltage fluctuation term, a battery polarization term, and a multi-vehicle total power and grid acceptance capacity bias term. The weight coefficients of each item in the MPC objective function are dynamically adjusted according to the current system state. Solve the MPC objective function to obtain the optimal target charge / discharge power.

5. The method according to claim 1, characterized in that, The step of initiating the grid connection control process based on the target charge / discharge power further includes executing a polarization-sensing pulse coordination strategy, specifically including: When the instruction corresponding to the target charging and discharging power is a high-power charging mode and the battery polarization degree is less than the preset polarization threshold, pulse charging is performed using the first frequency and the first duty cycle. When the degree of battery polarization is greater than the preset polarization threshold, the frequency is adjusted to a second frequency and a second duty cycle, wherein the second frequency is greater than the first frequency and the second duty cycle is less than the first duty cycle. The pulse conduction intervals of multiple vehicles participating in grid connection are staggered to ensure that the total duty cycle meets grid constraints.

6. The method according to claim 1, characterized in that, The determination of the buffer power at the moment of grid connection includes: Predict the changing trend of grid voltage parameters within a preset time window before grid connection; Determine whether renewable energy is currently in a state of surplus or deficit; If the state is in a surplus state, the buffer power is determined based on the surplus power. If there is a gap, the buffer power is determined based on the gap power; The calculated buffer power is not lower than the preset minimum power threshold.

7. The method according to claim 1, characterized in that, The method also includes a multi-vehicle coordination optimization step, specifically including: The priority of each vehicle is calculated based on its SOH, SOC deviation, temperature, and urgency of demand. Based on the distributed resource consensus algorithm, the target charging and discharging power is allocated according to the priority. The surplus power of renewable energy is prioritized for allocation to vehicles with the highest priority ranking, and the power gap of renewable energy is supplemented by vehicles with the highest priority ranking and a SOC higher than the preset energy value.

8. The method according to claim 1, characterized in that, The method also includes proactive intervention and graded downgrade steps for abnormalities, specifically including: The system identifies whether there are vehicle anomalies, renewable energy anomalies, or power grid anomalies. If a single anomaly is identified, the target data stream termination process is initiated, and the remaining vehicles are dispatched to adjust the pulse duty cycle. If two abnormalities are identified, a second-level degradation is performed, switching the control mode to constant voltage mode and limiting the charging and discharging power; If three anomalies are identified, a three-level downgrade is implemented, disconnecting the grid connection of vehicles with non-urgent needs.

9. The method according to claim 5, characterized in that, The method also includes a source-charge pulse synchronization cancellation step to address multi-vehicle mixed charging and discharging scenarios, specifically including: The system identifies the operating mode of each vehicle participating in grid connection in real time, classifying vehicles in the discharge state as source vehicles and vehicles in the charging state as load vehicles. When the source vehicle and the load vehicle exist simultaneously, calculate the total discharge pulse power of the source vehicle and the total charging pulse power of the load vehicle, and take the smaller value of the two as the offset power benchmark. At this point, the step of staggering the pulse conduction intervals is paused, and pulse synchronization overlap control is executed instead; The pulse synchronization overlap control includes: taking the offsetting power reference as the target, controlling the pulse conduction phase of the source attribute vehicle and the load attribute vehicle to be forcibly aligned in the time domain, so that the discharge current and the charging current cancel each other out inside the system, and only the net difference power that cannot be canceled out is exchanged to the grid. After executing the pulse synchronization overlap control, if there are remaining vehicles or remaining power that have not been offset, then the pulse conduction intervals corresponding to the remaining vehicles or remaining power are mutually staggered.

10. The method according to claim 7, characterized in that, The method further includes a dynamic hysteresis adjustment step based on state inertia, specifically including: Real-time monitoring of the fluctuation frequency of renewable energy output; when the fluctuation frequency exceeds a preset oscillation frequency threshold, a hysteresis adjustment mode is activated. When allocating the gap power in the hysteresis adjustment mode, the operating status of each vehicle in the previous control cycle is obtained; For vehicles that were charging in the previous control cycle, a preset state switching penalty value is deducted from their originally calculated priority to generate a corrected discharge scheduling priority. The discharge scheduling priority ensures that high-priority vehicles that were charging in the previous control cycle are placed after low-priority vehicles that are in standby or discharging state in the allocation sequence. According to the discharge scheduling priority from high to low, vehicles are scheduled to execute discharge commands in sequence to fill the power gap; Calculate the remaining unfilled power gap. Only when the remaining unfilled power gap exceeds the power balance deviation range allowed by the power grid and there are no other available vehicles, force dispatch vehicles after deducting the state switching penalty value to perform state reversal until power balance is satisfied.