A direct current micro-grid energy management method combining MPC and LSTM-TCN model

By combining the energy management methods of MPC and LSTM-TCN models, the power imbalance problem caused by the instability of renewable energy and load fluctuations in independent DC microgrids is solved, achieving high-precision prediction and optimized control, and improving system stability and energy storage protection.

CN122371068APending Publication Date: 2026-07-10SUQIAN ELECTRIC POWER DESIGN INSTITUTE CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUQIAN ELECTRIC POWER DESIGN INSTITUTE CO LTD
Filing Date
2026-04-15
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Independent DC microgrids suffer from power imbalances caused by unstable renewable energy output and rapid fluctuations in load demand. Existing control strategies such as PID, fuzzy logic controllers, and single deep learning models are insufficient to effectively address system stability and energy storage protection issues.

Method used

By combining the MPC and LSTM-TCN models, a DC microgrid architecture is constructed. Through a photovoltaic system, a composite energy storage system, and a DC-DC converter, the state of charge is estimated in real time using the Coulomb counting method. The LSTM-TCN model is used for disturbance prediction, and energy management is achieved by combining the S-function and the MPC controller. The duty cycle of the DC-DC converter is optimized to stabilize the system.

Benefits of technology

It improves the accuracy of load demand forecasting and system stability, effectively prevents overcharging/over-discharging of energy storage, extends equipment life, adapts to different load fluctuations and environmental conditions, and enhances system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122371068A_ABST
    Figure CN122371068A_ABST
Patent Text Reader

Abstract

This invention discloses a DC microgrid energy management method combining MPC and LSTM-TCN models. The method includes the following steps: S1, constructing a DC microgrid architecture; S2, using the Coulomb counting method to estimate the state of charge of the composite energy storage system in real time, dividing the power management system into five operating modes; S3, using the LSTM-TCN model to collect historical data on solar irradiance, temperature, and load demand, and training the model after data preprocessing; S4, equating the PV unit model to an equivalent circuit with five parameters, and calculating the reference currents for the photovoltaic, flow battery, and supercapacitor under the five operating modes; S5, constructing an MPC controller to find the optimal duty cycle for each DC-DC converter in the microgrid to track the reference currents of the photovoltaic, flow battery, and supercapacitor. This invention exhibits strong voltage stability, fast response capability, and low overshoot characteristics, demonstrating particularly outstanding performance in dealing with high load fluctuations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microgrid control technology, and specifically to a DC microgrid energy management method that combines MPC and LSTM-TCN models. Background Technology

[0002] With the rapid development of renewable energy, independent DC microgrids, due to their simple structure and high efficiency, have been widely used in scenarios such as power supply in remote areas and distributed energy utilization. However, independent DC microgrids rely on renewable energy sources such as photovoltaics, and their output is intermittent due to environmental factors such as light intensity and temperature. At the same time, rapid fluctuations in load demand further exacerbate system power imbalance, leading to problems such as unstable DC bus voltage and overcharging / over-discharging of energy storage systems, seriously affecting the stability and reliability of the system. Among existing control strategies, PID controllers have a simple structure but weak disturbance resistance and are prone to overshoot; fuzzy logic controllers rely on expert experience and have high computational complexity; traditional model predictive control (MPC) can handle constrained problems but lacks the ability to predict future disturbances and performs poorly in high load fluctuation scenarios; single deep learning models (such as LSTM and TCN) can achieve disturbance prediction, but are difficult to integrate directly with control algorithms and cannot meet real-time control requirements. Therefore, there is an urgent need for an intelligent solution that integrates predictive and control technologies to solve the stability and energy storage protection problems of independent DC microgrids. Summary of the Invention

[0003] To address the shortcomings of the aforementioned technologies, this invention provides a DC microgrid energy management method that combines MPC and LSTM-TCN models.

[0004] To address the above technical problems, the technical solution adopted in this invention is: a DC microgrid energy management method combining MPC and LSTM-TCN models, comprising the following steps:

[0005] S1. Construct a DC microgrid architecture, which includes a photovoltaic system, a composite energy storage system, loads and a DC-DC converter. The photovoltaic system is equipped with the MPPT algorithm, i.e., the perturbation-observation method. The composite energy storage system includes a flow battery and a supercapacitor. Each component is connected to the DC bus through a DC-DC converter.

[0006] S2. The state of charge of the composite energy storage system is estimated in real time using the coulomb counting method. Based on the state of charge of the flow battery and supercapacitor in the charging and discharging mode, the power management system is divided into five operating modes from mode I to mode V. Then, real-time voltage regulation and power balancing are performed for each of these five operating modes to avoid the problem of shortened lifespan of energy storage equipment caused by overcharging and discharging.

[0007] The S3 and LSTM-TCN models are perturbation prediction models. They collect historical data on light intensity, temperature, and load demand. After data preprocessing, the models are trained and output the predicted values ​​of irradiance, flow battery temperature, and load demand at future times with a prediction step size of 5 minutes.

[0008] S4. The PV unit model is equivalent to an equivalent circuit with 5 parameters. The photovoltaic current is calculated using the temperature and irradiance predicted in S3. At the same time, the reference currents of the photovoltaic, flow battery and supercapacitor are calculated under the five operating modes from mode I to mode V. Furthermore, an S-type function is introduced to achieve a smooth transition between the reference current at time k=h+ε and the predicted reference current at time k=h+1 under different modes.

[0009] S5. Construct an MPC controller to find the optimal control input of the system by minimizing the cost function. Integrate the optimal control input into pulse width modulation to find the optimal duty cycle for each DC-DC converter in the microgrid to track the reference current of photovoltaic, flow battery and supercapacitor, thereby realizing the optimal real-time energy flow in the DC microgrid system.

[0010] In step S1, the perturbation-observation method involves real-time acquisition of photovoltaic voltage. With photovoltaic current And calculate using the following formula:

[0011] (1)

[0012] (2)

[0013] (3)

[0014] (4)

[0015] in, Let K be the photovoltaic power, photovoltaic voltage, and photovoltaic current at time k. The photovoltaic power, photovoltaic voltage, and photovoltaic current at time k-1, and the change in power. Voltage change Current change When | When | < C = 0.0005, maintain the reference current; when >0 and When the current is greater than 0, increase the reference current; otherwise, adjust it.

[0016] In step S2, the coulomb counting method is used to estimate... The formula is:

[0017] (5)

[0018] (6)

[0019] in, Let t represent the state of charge of the flow battery and the supercapacitor at time t. This refers to the nominal capacity of the flow battery. This refers to the nominal capacitance of the supercapacitor. This is the current of the flow battery. The current is for the supercapacitor; the five operating modes include:

[0020] Mode I, Flow Battery Charging: The photovoltaic system is operating at full power, the flow battery is charging, and the supercapacitor is off.

[0021] Mode II, Supercapacitor Charging: The photovoltaic system is operating at full power, the supercapacitor is charging, and the flow battery is off.

[0022] Mode III, Power Reduction: Photovoltaic power is reduced, and energy storage system is shut down;

[0023] Mode IV, supercapacitor discharge: The supercapacitor discharges, and the flow battery shuts down;

[0024] Mode V, flow battery discharge: The flow battery discharges, and the supercapacitor shuts down.

[0025] In step S3, the LSTM-TCN model is used to predict environmental conditions and loads. Essentially a deep learning model, its accuracy is closely related to the quality of the dataset. Therefore, the data preprocessing in this invention uses linear interpolation to fill in missing data. Furthermore, to improve the computational speed of the algorithm during the training phase and accelerate convergence, the data is mapped to the [0,1] interval using a MinMax scaler. The formula used is as follows:

[0026] , (7)

[0027] in, This represents the scaled value. For measured values, These are the maximum and minimum values ​​of the dataset, respectively.

[0028] In step S3, the metrics used to evaluate the LSTM-TCN model are the root mean square error (RMSE), the mean absolute error (MAE), and the coefficient of determination (R²). 2 The specific calculation formula is as follows:

[0029] (8)

[0030] (9)

[0031] , (10)

[0032] in, and These represent the predicted and actual values ​​at time step i, respectively. n represents the sample size. This represents the mean of the true values.

[0033] In step S4, the five parameters of the PV unit model are: photovoltaic voltage. Diode D, two resistors Current source The formula for calculating photovoltaic current is as follows:

[0034] (11)

[0035] in, Indicates saturation current. Photovoltaic current, Photocurrent, Thermoelectric voltage, Photovoltaic voltage, Indicates the number of photovoltaic cells connected in parallel. Indicates the number of photovoltaic cells in series, and represents the diode's ideality factor. and This represents the equivalent value of the series and shunt resistances.

[0036] In step S4, the reference current under different operating modes is calculated. In order to stabilize the DC microgrid, the power balance equation between DC bus power supply and power consumption is used, which is expressed as follows: , (12)

[0037] , (13)

[0038] in, P represents the power-providing part and the power-consuming part of the DC microgrid, respectively. bat and P sc These represent the power provided by the flow battery and the supercapacitor, respectively. PV For photovoltaic power, P cap This is the reference power for the supercapacitor, and P... cap The estimate was made using measured data from the microgrid and is assumed to be constant, with a value of 25W, P. Load The power absorbed by the load is calculated using the following formula:

[0039] (14)

[0040] (15)

[0041] (16)

[0042] (17)

[0043] in, These are, respectively, photovoltaic voltage, flow battery voltage, supercapacitor voltage, and DC bus voltage. These represent the photovoltaic current filtered by the inductor through a unidirectional DC-DC converter, the flow battery current filtered by the inductor through a bidirectional DC-DC converter, and the supercapacitor current filtered by the inductor through a bidirectional DC-DC converter, respectively. This is the equivalent resistance of the load.

[0044] The reference current calculation method for Mode I and Mode V in step S4 is as follows:

[0045] when hour,

[0046] (18)

[0047] (19)

[0048] (20)

[0049] in, For numbers less than 1 To simulate the step size, it is equal to 4 * 10. -6 s, They are respectively The photovoltaic reference current is constantly passing through the filter inductor of the unidirectional DC-DC converter. The supercapacitor current is constantly filtered through the inductor of the bidirectional DC-DC converter. The current of the liquid battery is constantly filtered by the inductor of the bidirectional DC-DC converter. These represent the photovoltaic reference current calculated using the MPPT algorithm at time k, the equivalent load resistance at time k, the photovoltaic voltage at time k, the flow battery voltage at time k, and the photovoltaic current passing through the filter inductor of the unidirectional DC-DC converter at time k, respectively. This is the reference power of the supercapacitor;

[0050] when hour,

[0051] The PV and flow cell are determined by the following equations. and These values ​​are used in the calculation of the sigmoid function: where This represents the value at the start of the S-shaped function, i.e. Measured value at time: This represents the value at the end of the S-curve, i.e., the predicted value at time k=h+1;

[0052] ,(twenty one)

[0053] ,(twenty two)

[0054] ,(twenty three)

[0055] ,(twenty four)

[0056] in, Let K represent the photovoltaic current through the filter inductor of the unidirectional DC-DC converter at time k, and the flow battery current through the filter inductor of the bidirectional DC-DC converter at time k, respectively. It is the predicted reference PV current at k=h+1. It is the predicted reference flow cell current at k=h+1;

[0057] when hour,

[0058] Using an S-curve to achieve... and arrive and For a smooth transition, where k equals k = h+1, this transition is achieved using the following equation, and the reference current at each time step is calculated up to h+1. The S-function is shown below:

[0059] (25)

[0060] (26)

[0061] in, and These represent the S-curve values ​​of the PV and flow cells at point k, respectively. These represent the PV and flow batteries at k= The actual value at time, These represent the PV and flow batteries at k= The predicted value at time z represents the steepness of the S-curve, also known as the growth rate. It is the midpoint of the S-curve, and its value is 0.5. The expression for the degree of completion or progress of the S-function within a discrete time interval is as follows:

[0062] (27)

[0063] in, Let be the starting time point of the S-function. 1 represents the end time point of the S-function; ;1 when hour , representing the initial state of the corresponding S-function, when hour , indicating the completion state of the corresponding S-function;

[0064] The reference currents for the PV, flow battery, and supercapacitor during this period are:

[0065] (28)

[0066] (29)

[0067] (30)

[0068] in, and These represent the S-curve values ​​of the PV and flow cells at point k, respectively. These represent the PV and flow batteries at k= The actual value of the reference current at any given time.

[0069] The reference current calculation method for Mode II and Mode IV in step S4 is as follows:

[0070] when hour,

[0071] (31)

[0072] (32)

[0073] (33)

[0074] in, For numbers less than 1 To simulate the step size, it is equal to 4 * 10. -6 s, They are respectively The photovoltaic reference current is constantly passing through the filter inductor of the unidirectional DC-DC converter. The supercapacitor current is constantly filtered through the inductor of the bidirectional DC-DC converter. The current of the liquid battery is constantly filtered by the inductor of the bidirectional DC-DC converter. These represent the photovoltaic reference current calculated using the MPPT algorithm at time k, the equivalent load resistance at time k, the photovoltaic voltage at time k, the flow battery voltage at time k, and the photovoltaic current passing through the filter inductor of the unidirectional DC-DC converter at time k, respectively. This is the reference power of the supercapacitor;

[0075] when hour,

[0076] (34)

[0077] (35)

[0078] (36)

[0079] (37)

[0080] in These are the predicted reference currents of the supercapacitor and the PV at k=h+1, respectively. These represent the PV and flow batteries at k= Always refer to the actual value of the current. These represent the PV and flow batteries at k= The predicted value of the reference current at time [time]. It can be calculated using the following formula;

[0081] (38)

[0082] in, DC bus voltage reference value, The reference power of the supercapacitor Let be the photovoltaic voltage at time k. Let k be the voltage of the supercapacitor at time k. These are the predicted equivalent resistance of the load at k=h+1 and the reference current of PV, respectively.

[0083] when hour,

[0084] During this time interval, the S-shaped function is used to make the curve from and arrive and The smooth transition begins at k=h+1, and the S-function is shown below:

[0085] (39)

[0086] (40)

[0087] in, and These represent the S-curve values ​​of PV and supercapacitor at point k, respectively. These represent PV and supercapacitor at k= The actual value of the reference current at that moment. These represent PV and supercapacitor at k= The predicted value of the reference current at time t, z represents the steepness of the S-curve, also known as the growth rate, and x is the midpoint of the S-curve, with a value of 0.5. It represents the degree of completion or progress of the S-function within a discrete time interval;

[0088] The reference currents for the PV, flow battery, and supercapacitor during this period are:

[0089] (41)

[0090] (42)

[0091] (43)

[0092] in, and These represent the S-curve values ​​of PV and supercapacitor at point k, respectively. These represent PV and supercapacitor at k= The actual value of the reference current at any given time.

[0093] The reference current calculation method under Mode III in step S4 is as follows:

[0094] when hour

[0095] (44)

[0096] (45)

[0097] (46)

[0098] in, For numbers less than 1 To simulate the step size, it is equal to 4 * 10. -6 s, They are respectively The photovoltaic reference current is constantly passing through the filter inductor of the unidirectional DC-DC converter. The supercapacitor current is constantly filtered through the inductor of the bidirectional DC-DC converter. The current of the liquid battery is constantly filtered by the inductor of the bidirectional DC-DC converter. Let K represent the load equivalent resistance at time k, the photovoltaic voltage at time k, and the flow battery voltage at time k, respectively. DC bus voltage reference value, This is the reference power of the supercapacitor;

[0099] when hour

[0100] (47)

[0101] (48)

[0102] in, Represents the time at k=h+ε The measured value; This indicates the time at k=h+1. The predicted value, It is the predicted reference PV current at k=h+1;

[0103] It can be calculated using the following formula:

[0104] (49)

[0105] in, DC bus voltage reference value, The reference power of the supercapacitor Let be the photovoltaic voltage at time k. These are the predicted equivalent resistance values ​​of the load at k=h+1;

[0106] when hour,

[0107] During this time interval, use a sigmoid function to implement the transition from... arrive A smooth transition, where k = h + 1, the S-function is shown below:

[0108] (50)

[0109] in, This represents the S-curve value of PV at point k. This indicates that PV is at k= The actual value of the reference current at that moment. This indicates that PV is at k= The predicted value of the reference current at time z, where z represents the steepness of the S-curve, also known as the growth rate. It is the midpoint of the S-curve, and its value is 0.5. It represents the degree of completion or progress of the S-function within a discrete time interval;

[0110] The reference currents for the PV, flow battery, and supercapacitor during this period are:

[0111] (51)

[0112] (52)

[0113] (53)

[0114] in, This represents the S-curve value of PV at point k. This indicates that PV is at k= The actual value of the reference current at any given time.

[0115] In step S5, the MPC controller includes an optimizer for predicting the future state space of the system and solving optimization problems. The MPC finds the optimal control input of the system by minimizing the cost function, which reflects the error between the system's expected state, i.e., the reference value, and the actual state.

[0116] State-space models describe the dynamic characteristics of a system. Kirchhoff's laws are used to analyze the dynamic characteristics of DC-DC converters, resulting in state-space models for PV, DC-DC, flow battery DC-DC converters, and supercapacitor DC-DC converters:

[0117] (54)

[0118] (55)

[0119] (56)

[0120] in, These are respectively represented as photovoltaic voltage, flow battery voltage, supercapacitor voltage, and DC bus voltage. These represent the photovoltaic system current, the flow battery current, and the supercapacitor current, respectively. These represent the photovoltaic reference current filtered by the inductor of the unidirectional DC-DC converter, the flow battery current filtered by the inductor of the bidirectional DC-DC converter, and the supercapacitor current filtered by the inductor of the bidirectional DC-DC converter, respectively. , and These are the control inputs for PV, supercapacitors, and flow batteries, respectively.

[0121] in, , and These are the control inputs for the PV, supercapacitor, and flow battery, respectively. The system state-space model can be represented as follows:

[0122] (57)

[0123] (58)

[0124] (59)

[0125] in ;

[0126] The state-space model described by the above equations is defined in the continuous-time domain. By applying the forward Euler approximation method, the following results can be obtained in the discrete-time domain:

[0127] (60)

[0128] (61)

[0129] (62)

[0130] in, The step size is used to define the MPC step size. The goal of MPC is to track the reference current values ​​of photovoltaic, flow battery, and supercapacitor by minimizing the cost function. To achieve this, MPC solves an optimization problem at each time step, as shown in the following expression:

[0131] (63)

[0132] (64)

[0133] The above formulas are subject to the following constraints:

[0134] (65)

[0135] (66)

[0136] (67)

[0137] in, , It is a cost function. , , and These are the adjustment weights of each control term. The first three terms of the cost function are used to track the reference current values ​​of the photovoltaic system, flow battery, and supercapacitor, while the last term is used to minimize the variation in the control input. After the MPC solves the optimization problem, it integrates the optimal control input into a pulse width modulation (PWM) signal to generate a switching signal for each DC-DC converter in the microgrid, thereby achieving the optimal real-time energy flow in the DC microgrid system.

[0138] Compared with the prior art, the present invention has the following beneficial effects:

[0139] 1. High prediction accuracy: The LSTM-TCN model has an R² of 99.6% in predicting load demand, and can accurately capture the trends of environmental and load disturbances, providing a reliable basis for control decisions;

[0140] 2. Superior control performance: steady-state error <0.6V, maximum overshoot <2.6%, settling time 15.7ms. In high-load fluctuation scenarios, VRI is 16% lower than traditional MPC and 16.75% lower than PI controller, significantly improving system stability.

[0141] 3. Effectively prevents overcharging / over-discharging of energy storage: Through real-time estimation by SoC and multi-operation mode design, it effectively prevents overcharging / over-discharging of energy storage, extending the service life of batteries and supercapacitors;

[0142] 4. High adaptability: It is suitable for different load fluctuations and environmental conditions, and can be extended to grid-connected microgrids or AC microgrids, with broad application prospects. Attached Figure Description

[0143] Figure 1 Diagram of a microgrid architecture;

[0144] Figure 2 This is a flowchart of the power management system strategy.

[0145] Figure 3 This is a schematic diagram of a power management system method;

[0146] Figure 4 This is a schematic diagram of an LSTM cell structure;

[0147] Figure 5 This is a diagram of the TCN residual block structure.

[0148] Figure 6 Flowchart for training the LSTM-TCN model;

[0149] Figure 7 This is a schematic diagram of the sliding window technology;

[0150] Figure 8 The equivalent circuit diagram for five parameters of a photovoltaic cell;

[0151] Figure 9 This is a schematic diagram of the smooth transition of an S-shaped function;

[0152] Figure 10 This is a diagram of the MPC controller architecture. Detailed Implementation

[0153] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0154] This invention relates to a DC microgrid energy management method combining MPC and LSTM-TCN models, comprising the following steps:

[0155] 1. Microgrid architecture construction

[0156] Figure 1 The architecture of the microgrid is shown. This DC microgrid consists of a photovoltaic system, battery bank, supercapacitor, and load equipment. Each component is connected to the DC bus via a DC-DC converter. A boost converter connects to the photovoltaic panels to regulate current / voltage. The MPPT algorithm, a perturbation-observation method, is used. The MPPT algorithm is as follows: Real-time acquisition of photovoltaic voltage. With current The calculation is performed using the following formula:

[0157] (1)

[0158] (2)

[0159] (3)

[0160] (4)

[0161] When | When | < C = 0.0005, maintain the reference current; when >0 and When the current is greater than 0, increase the reference current; otherwise, adjust it.

[0162] 2. LSTM-TCN Model and its Training and Prediction

[0163] LSTM models store temporal states using self-connected memory cells, and their structure is as follows: Figure 4 As shown, the Temporal Convolutional Network (TCN) is a variant of the Convolutional Neural Network (CNN) specifically designed for modeling time series with causal constraints. This model network obtains a nonlinear mapping function through supervised learning and must utilize historical input sequences rather than future sequences to satisfy causal constraints. TCN employs a one-dimensional fully convolutional network architecture and incorporates residual blocks to optimize the training process and avoid the vanishing gradient problem. The specific structure is shown below. Figure 5As shown. This invention employs an LSTM-TCN hybrid model. The specific steps for constructing the prediction system using the LSTM-TCN model are as follows. Figure 6 As shown, firstly, time-series features are extracted from the data using an LSTM model layer; then, a TCN layer is used to improve prediction accuracy and establish a correlation between the output and the features. Finally, a fully connected layer is added to the last layer of the model for dimensionality transformation.

[0164] In the dataset preprocessing, cases where the nighttime solar irradiance value was zero were removed. Additionally, due to the existence of missing data in real-world scenarios, linear interpolation was used to fill in the missing data. Furthermore, to improve the computational speed and accelerate convergence during the algorithm's training phase, data scaling techniques were employed to adjust the dataset's range. The MinMax scaler method was selected to adjust the data range to between 0 and 1, mapping the data to [0, 1] using the following equation:

[0165] (5)

[0166] in, This represents the scaled value. For measured values, and These represent the maximum and minimum values ​​of the dataset. Time series data contains values ​​at different time steps, a format that cannot be directly used for training or predicting machine learning models. Therefore, the time series problem must be transformed into a supervised learning problem, meaning that features and labels need to be explicitly defined. To achieve this, a sliding window approach is used to define features and labels from the time series data. Figure 7 The process of a sliding window is demonstrated: the first feature is a sequence of 1 to 5 (input window size 5), and the first label is a sequence of 6 to 8 (output window size 3); the second feature is a sequence of 2 to 6, with labels of 7 to 9. This process is repeated cyclically across the entire dataset. Data partitioning after preprocessing involves dividing the dataset into training and test sets. The training set is used for model training, while the test set is used for prediction and evaluating model performance.

[0167] Define the hyperparameters and training parameters of the LSTM-TCN model to initiate model training. After the training phase is complete, evaluate the model using regression metrics. The metrics used to evaluate the LSTM-TCN model include root square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²). 2 The specific calculation formula is as follows:

[0168] (6)

[0169] (7)

[0170] (8)

[0171] in, and They represent the time steps respectively. The predicted and actual values ​​at that time. n represents the sample size. This represents the mean of the true values.

[0172] 3. Power Management and MPC Control Implementation

[0173] The state of charge (SoC) of flow batteries and supercapacitors is estimated using coulomb counting technology, and the calculation formula is shown below:

[0174] (10)

[0175] (11)

[0176] in, and This is the nominal capacity of batteries and supercapacitors. and It is the current in the battery and supercapacitor.

[0177] In this invention, photovoltaic power generation serves as the main power source for the microgrid, while flow batteries and supercapacitors act as backup power sources, activating when the electrical load exceeds the photovoltaic output. Their primary function is to store excess energy and maintain microgrid balance. However, overcharging and discharging can shorten the lifespan of energy storage devices; therefore, the control strategy must consider the state of charge (SoC) of both the flow battery and supercapacitor in both charge and discharge modes. Furthermore, due to the rapid discharge characteristics of supercapacitors, they can adapt to rapid power changes. Moreover, flow batteries have a higher energy density than supercapacitors, allowing them to store more energy for longer periods. Therefore, in this study, the discharge mode is prioritized when the supercapacitor's SoC is above 20%, while the charging mode is only activated when the flow battery's SoC is below 80%. Figure 2 The flowchart of the power management system strategy is shown. Based on the flowchart, five working modes of the PMS can be derived. The specific working conditions of the PMS are shown below.

[0178] Mode I (flow battery charging): The photovoltaic system is operating at full power, the flow battery is charging, and the supercapacitor is off.

[0179] Mode II (Supercapacitor Charging): The photovoltaic system is operating at full power, the supercapacitor is charging, and the flow battery is off.

[0180] Mode III (Power Reduction) Photovoltaic power is reduced, and energy storage system is shut down;

[0181] Mode IV (Supercapacitor Discharge): The supercapacitor discharges, and the flow battery shuts down;

[0182] Mode V (flow battery discharge): The flow battery discharges, and the supercapacitor shuts down.

[0183] 4. Photovoltaic current calculation

[0184] The five parameters of the PV cell model constitute an equivalent circuit, such as... Figure 8 As shown. Five of the parameters are: photovoltaic voltage. Diode (D), two resistors Current source ( Using Kirchhoff's theorem, the formula for calculating photovoltaic current is as follows:

[0185] (12)

[0186] in, Indicates saturation current. Photovoltaic current, Photocurrent, Thermoelectric voltage,

[0187] This is the photovoltaic voltage. Indicates the number of photovoltaic cells connected in parallel. Indicates the number of photovoltaic cells in series

[0188] Quantity. 'a' represents the diode's ideality factor. and This represents the equivalent value of the series and shunt resistances.

[0189] 5. Generate reference currents for photovoltaic, flow battery, and supercapacitor applications.

[0190] The MPC controller tracks reference current values ​​for the following components: photovoltaics, flow batteries, and supercapacitors. Therefore, the reference current must be calculated for each operating mode. To stabilize the DC microgrid, a power balance equation between DC bus power supply and consumption is used. It is expressed as follows:

[0191] (13)

[0192] (14)

[0193] in, These are the parts that provide power and the parts that consume power in a DC microgrid, respectively. and These represent the power provided by the flow battery and the supercapacitor, respectively. For photovoltaic power, To absorb power for capacity, Power is absorbed by the load. This power is calculated using the following formula:

[0194] (15)

[0195] (16)

[0196] (17)

[0197] (18)

[0198] The S-shaped function is also frequently used in power balance equations. This function, due to its mathematical properties, forms an S-shaped curve known for its smooth transition. Figure 9 This demonstrates the application of the sigmoid function in reference current calculation. The core objective of using this function is to achieve a smooth transition from the reference current at time k=h+ε to the predicted reference current at time k=h+1.

[0199] Operating mode I and V reference currents: (flow battery charging and discharging)

[0200] In this mode, the PV panel operates at maximum power, the flow battery provides (discharge mode) or absorbs (charge mode) power, and the supercapacitor is off. ). It is the simulation step size, equal to ,and It is a number less than 1. The reference currents for PV, flow batteries, and supercapacitors are shown below:

[0201] when

[0202] During this period, the reference current is calculated using the MPPT algorithm for photovoltaics, and the power balance is calculated using the DC bus equation for the flow battery:

[0203] (19)

[0204] (20)

[0205] (twenty one)

[0206] when

[0207] During this period, the PV and flow cell are determined using the following equations. and Values. These parameters are used for sigmoid function calculations: where This represents the value at the start of the S-type function (i.e. (Measured value at time) This represents the value at the end of the S-curve (i.e., the predicted value at time k=h+1).

[0208] (twenty two)

[0209] (twenty three)

[0210] (twenty four)

[0211] (25)

[0212] in It is the predicted reference PV current at k=h+1. It is the predicted reference flow cell current at k=h+1.

[0213] (26)

[0214] when

[0215] During this time period, an S-curve is used to achieve the transition from... and arrive and A smooth transition is achieved when the value of k equals k = h+1. This transition is achieved using the following equation, with the reference current calculated for each time step up to h+1.

[0216] (27)

[0217] (28)

[0218] in, and Let represent the S-curve values ​​of the PV and flow batteries at point k, respectively. The parameter z represents the steepness of the S-curve, also known as the growth rate. A larger z value makes the curve steeper, resulting in a sharper transition between the upper and lower boundaries; while a smaller z value produces a smoother, more gradual curve. Therefore, the optimal z value was first determined by testing different values ​​and evaluating their impact on system overshoot and stability. After analysis, a z value of 10 was ultimately set, achieving the best balance between steepness and stability. x is the midpoint of the S-curve, with a value of 0.5. The expression for the degree of completion or progress of the S-function within a discrete time interval is:

[0219] (29)

[0220] in, Let be the starting time point of the S-function. 1 represents the end time point of the S-function; ,when hour This represents the initial state of the corresponding S-function, when hour This indicates the completion status of the corresponding S-function;

[0221] (30) (31)

[0223] (32)

[0224] Operating mode II and IV reference currents: (supercapacitor charging and discharging)

[0225] The PV panels are still operating at maximum power, the supercapacitors are delivering or absorbing power, and the flow batteries are off. The reference currents for PV, flow batteries, and supercapacitors are shown below:

[0226] when

[0227] (33)

[0228] (34)

[0229] (35)

[0230] when

[0231] (36)

[0232] (37)

[0233] (38)

[0234] (39)

[0235] in It is the predicted reference supercurrent at k=h+1. It can be calculated using the following formula.

[0236] (40)

[0237] when

[0238] During this time interval, the S-shaped function is used to make the curve from and arrive and The smooth transition begins at k=h+1:

[0239] (41)

[0240] (42)

[0241] The reference currents for the PV, flow battery, and supercapacitor during this period are:

[0242] (43)

[0243] (44)

[0244] (45)

[0245] Operating Mode III Reference Current: (Power Reduction)

[0246] In this mode, the supercapacitor and flow battery are fully charged (SoC = 80%), therefore they are in the off state. In this scenario, the photovoltaic panel is not operating at maximum power to regulate the DC bus voltage. The reference currents for the supercapacitor, photovoltaic panel, and flow battery are shown below:

[0247] when

[0248] (46)

[0249] (47)

[0250] (48)

[0251] when

[0252] (49)

[0253] (50)

[0254] in It is the reference PV current predicted at (h+1) based on the power balance equation. It can be calculated using the following formula:

[0255] (51)

[0256] when

[0257] During this time interval, use a sigmoid function to implement the transition from... arrive A smooth transition, where k = h + 1:

[0258] (52)

[0259] The reference currents for the PV, flow battery, and supercapacitor during this period are:

[0260] (53)

[0261] (54)

[0262] (55)

[0263] like Figure 10 The diagram shows the structure of an MPC controller: This controller typically includes a state space for predicting the future state of the system, and an optimizer for solving the optimization problem. MPC finds the optimal control input to the system by minimizing a cost function. This cost function reflects the error between the desired state (reference value) and the actual state of the system.

[0264] A state-space model describes the dynamic characteristics of a system. Using Kirchhoff's laws to analyze the dynamic characteristics of a DC-DC converter, the following state-space model is obtained:

[0265] For PV DC-DC converters:

[0266] (56)

[0267] For flow battery DC-DC converters:

[0268] (57)

[0269] For supercapacitor DC-DC converters:

[0270] (58)

[0271] in, , and These are the control inputs for PV, supercapacitors, and flow batteries, respectively.

[0272] The system state space can be represented as follows:

[0273] (59)

[0274] (60)

[0275] (61)

[0276] in

[0277] The state-space model described by the above equations is defined in the continuous-time domain. By applying the forward Euler approximation method, the following results can be obtained in the discrete-time domain:

[0278] (62)

[0279] (63)

[0280] (64)

[0281] in, The step size is used to define the MPC step size. The goal of MPC is to track the reference current values ​​for photovoltaic, flow battery, and supercapacitor systems by minimizing the cost function. To achieve this, MPC solves an optimization problem at each time step, as shown in the following expression:

[0282] (65)

[0283] (66)

[0284] The above formulas are subject to the following constraints:

[0285] (67)

[0286] (68)

[0287] (69)

[0288] in, , It is a cost function. , , and These are the adjustment weights of each control term. The first three terms of the cost function are used to track the reference current values ​​of the photovoltaic system, battery, and supercapacitor, while the last term is used to minimize the change in the control input. The constraints of this optimization problem include the system dynamic characteristics, the duty cycle u ranging from 0 to 1, and... It must be positive. After MPC solves the optimization problem, it integrates the optimal control input into pulse width modulation (PWM) to generate switching signals for each DC-DC converter in the microgrid.

[0289] The above embodiments are not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the technical solutions of the present invention are also within the protection scope of the present invention.

Claims

1. A DC microgrid energy management method combining MPC and LSTM-TCN models, characterized in that, Includes the following steps: S1. Construct a DC microgrid architecture, which includes a photovoltaic system, a composite energy storage system, loads and a DC-DC converter. The photovoltaic system is equipped with the MPPT algorithm, i.e., the perturbation-observation method. The composite energy storage system includes a flow battery and a supercapacitor. Each component is connected to the DC bus through a DC-DC converter. S2. The state of charge of the composite energy storage system is estimated in real time using the coulomb counting method. Based on the state of charge of the flow battery and supercapacitor in the charging and discharging mode, the power management system is divided into five operating modes from mode I to mode V. Then, real-time voltage regulation and power balancing are performed for each of these five operating modes to avoid the problem of shortened lifespan of energy storage equipment caused by overcharging and discharging. The S3 and LSTM-TCN models are perturbation prediction models. They collect historical data on light intensity, temperature, and load demand. After data preprocessing, the models are trained and output the predicted values ​​of irradiance, flow battery temperature, and load demand at future times with a prediction step size of 5 minutes. S4. The PV unit model is equivalent to an equivalent circuit with 5 parameters. The photovoltaic current is calculated using the temperature and irradiance predicted in S3. At the same time, the reference currents of the photovoltaic, flow battery and supercapacitor are calculated under the five operating modes from mode I to mode V. Furthermore, an S-type function is introduced to achieve a smooth transition between the reference current at time k=h+ε and the predicted reference current at time k=h+1 under different modes. S5. Construct an MPC controller to find the optimal control input of the system by minimizing the cost function. Integrate the optimal control input into pulse width modulation to find the optimal duty cycle for each DC-DC converter in the microgrid to track the reference current of photovoltaic, flow battery and supercapacitor, thereby realizing the optimal real-time energy flow in the DC microgrid system.

2. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 1, characterized in that: In step S1, the perturbation-observation method involves real-time acquisition of photovoltaic voltage. With photovoltaic current And calculate using the following formula: (1) (2) (3) (4) in, Let K be the photovoltaic power, photovoltaic voltage, and photovoltaic current at time k. The photovoltaic power, photovoltaic voltage, and photovoltaic current at time k-1, and the change in power. Voltage change Current change When | When | < C = 0.0005, maintain the reference current; when >0 and When the current is greater than 0, increase the reference current; otherwise, adjust it.

3. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 1, characterized in that: In step S2, the coulomb counting method is used to estimate... The formula is: (5) (6) in, Let t represent the state of charge of the flow battery and the supercapacitor at time t. This refers to the nominal capacity of the flow battery. This refers to the nominal capacitance of the supercapacitor. This is the current of the flow battery. The current is for the supercapacitor; the five operating modes include: Mode I, Flow Battery Charging: The photovoltaic system is operating at full power, the flow battery is charging, and the supercapacitor is off. Mode II, Supercapacitor Charging: The photovoltaic system is operating at full power, the supercapacitor is charging, and the flow battery is off. Mode III, Power Reduction: Photovoltaic power is reduced, and energy storage system is shut down; Mode IV, supercapacitor discharge: The supercapacitor discharges, and the flow battery shuts down; Mode V, flow battery discharge: The flow battery discharges, and the supercapacitor shuts down.

4. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 1, characterized in that: In step S3, the LSTM-TCN model is used to predict environmental conditions and loads. Essentially a deep learning model, its accuracy is closely related to the quality of the dataset. Therefore, the data preprocessing in this invention uses linear interpolation to fill in missing data. Furthermore, to improve the computational speed of the algorithm during the training phase and accelerate convergence, the data is mapped to the [0,1] interval using a MinMax scaler. The formula used is as follows: , (7) in, This represents the scaled value. For measured values, These are the maximum and minimum values ​​of the dataset, respectively.

5. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 4, characterized in that: In step S3, the metrics used to evaluate the LSTM-TCN model are the root mean square error (RMSE), the mean absolute error (MAE), and the coefficient of determination (R²). 2 The specific calculation formula is as follows: ,(8) ,(9) , (10) in, and These represent the predicted and actual values ​​at time step i, respectively. n represents the sample size. This represents the mean of the true values.

6. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 1, characterized in that: In step S4, the five parameters of the PV unit model are: photovoltaic voltage. Diode D, two resistors Current source The formula for calculating photovoltaic current is as follows: ,(11) in, Indicates saturation current. Photovoltaic current, Photocurrent, Thermoelectric voltage, Photovoltaic voltage, Indicates the number of photovoltaic cells connected in parallel. Indicates the number of photovoltaic cells in series, and represents the diode's ideality factor. and This represents the equivalent value of the series and shunt resistances.

7. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 6, characterized in that: In step S4, the reference current under different operating modes is calculated. In order to stabilize the DC microgrid, the power balance equation between DC bus power supply and power consumption is used, which is expressed as follows: , (12) , (13) in, P represents the power-providing part and the power-consuming part of the DC microgrid, respectively. bat and P sc These represent the power provided by the flow battery and the supercapacitor, respectively. PV For photovoltaic power, P cap This is the reference power for the supercapacitor, and in addition, P cap The estimate was made using measured data from the microgrid and is assumed to be constant, with a value of 25 W, P. Load The power absorbed by the load is calculated using the following formula: ,(14) ,(15) ,(16) ,(17) in, These are, respectively, photovoltaic voltage, flow battery voltage, supercapacitor voltage, and DC bus voltage. These represent the photovoltaic current filtered by the inductor through a unidirectional DC-DC converter, the flow battery current filtered by the inductor through a bidirectional DC-DC converter, and the supercapacitor current filtered by the inductor through a bidirectional DC-DC converter, respectively. This is the equivalent resistance of the load.

8. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 7, characterized in that: The reference current calculation method for Mode I and Mode V in step S4 is as follows: when hour, ,(18) ,(19) ,(20) in, For numbers less than 1 To simulate the step size, it is equal to 4 * 10. -6 s, They are respectively The photovoltaic reference current is constantly passing through the filter inductor of the unidirectional DC-DC converter. The supercapacitor current is constantly filtered through the inductor of the bidirectional DC-DC converter. The current of the liquid battery is constantly filtered by the inductor of the bidirectional DC-DC converter. These represent the photovoltaic reference current calculated using the MPPT algorithm at time k, the equivalent load resistance at time k, the photovoltaic voltage at time k, the flow battery voltage at time k, and the photovoltaic current passing through the filter inductor of the unidirectional DC-DC converter at time k, respectively. This is the reference power of the supercapacitor; when hour, The PV and flow cell are determined by the following equations. and These values ​​are used in the calculation of the sigmoid function: where This represents the value at the start of the S-shaped function, i.e. Measured value at time: This represents the value at the end of the S-curve, i.e., the predicted value at time k=h+1; ,(21) ,(22) ,(23) ,(24) in, Let K represent the photovoltaic current through the filter inductor of the unidirectional DC-DC converter at time k, and the flow battery current through the filter inductor of the bidirectional DC-DC converter at time k, respectively. It is the predicted reference PV current at k=h+1. It is the predicted reference flow cell current at k=h+1; when hour, Using an S-curve to achieve... and arrive and For a smooth transition, where k equals k = h+1, this transition is achieved using the following equation, and the reference current at each time step is calculated up to h+1. The S-function is shown below: ,(25) ,(26) in, and These represent the S-curve values ​​of the PV and flow cells at point k, respectively. These represent the PV and flow batteries at k= The actual value at time, These represent the PV and flow batteries at k= The predicted value at time z represents the steepness of the S-curve, also known as the growth rate. It is the midpoint of the S-curve, and its value is 0.

5. The expression for the degree of completion or progress of the S-function within a discrete time interval is as follows: ,(27) in, Let be the starting time point of the S-function. 1 represents the end time point of the S-function; ;1 when hour , representing the initial state of the corresponding S-function, when hour , indicating the completion state of the corresponding S-function; The reference currents for the PV, flow battery, and supercapacitor during this period are: ,(28) ,(29) ,(30) in, and These represent the S-curve values ​​of the PV and flow cells at point k, respectively. These represent the PV and flow batteries at k= The actual value of the reference current at any given time.

9. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 7, characterized in that: The reference current calculation method for Mode II and Mode IV in step S4 is as follows: when hour, ,(31) ,(32) ,(33) in, For numbers less than 1 To simulate the step size, it is equal to 4 * 10. -6 s, They are respectively The photovoltaic reference current is constantly passing through the filter inductor of the unidirectional DC-DC converter. The supercapacitor current is constantly filtered through the inductor of the bidirectional DC-DC converter. The current of the liquid battery is constantly filtered by the inductor of the bidirectional DC-DC converter. These represent the photovoltaic reference current calculated using the MPPT algorithm at time k, the equivalent load resistance at time k, the photovoltaic voltage at time k, the flow battery voltage at time k, and the photovoltaic current passing through the filter inductor of the unidirectional DC-DC converter at time k, respectively. This is the reference power of the supercapacitor; when hour, ,(34) ,(35) ,(36) ,(37) in These are the predicted reference currents of the supercapacitor and the PV at k=h+1, respectively. These represent the PV and flow batteries at k= Always refer to the actual value of the current. These represent the PV and flow batteries at k= The predicted value of the reference current at time [time]. It can be calculated using the following formula; ,(38) in, DC bus voltage reference value, The reference power of the supercapacitor Let be the photovoltaic voltage at time k. Let k be the voltage of the supercapacitor at time k. These are the predicted equivalent resistance of the load at k=h+1 and the reference current of PV, respectively. when hour, During this time interval, the S-shaped function is used to make the curve from and arrive and The smooth transition begins at k=h+1, and the S-function is shown below: 。(39) 。(40) in, and These represent the S-curve values ​​of PV and supercapacitor at point k, respectively. These represent PV and supercapacitor at k= The actual value of the reference current at that moment. These represent PV and supercapacitor at k= The predicted value of the reference current at time t, z represents the steepness of the S-curve, also known as the growth rate, and x is the midpoint of the S-curve, with a value of 0.

5. It represents the degree of completion or progress of the S-function within a discrete time interval; The reference currents for the PV, flow battery, and supercapacitor during this period are: ,(41) ,(42) ,(43) in, and These represent the S-curve values ​​of PV and supercapacitor at point k, respectively. These represent PV and supercapacitor at k= The actual value of the reference current at any given time.

10. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 7, characterized in that: The reference current calculation method under Mode III in step S4 is as follows: when hour ,(44) ,(45) ,(46) in, For numbers less than 1 To simulate the step size, it is equal to 4 * 10. -6 s, They are respectively The photovoltaic reference current is constantly passing through the filter inductor of the unidirectional DC-DC converter. The supercapacitor current is constantly filtered through the inductor of the bidirectional DC-DC converter. The current of the liquid battery is constantly filtered by the inductor of the bidirectional DC-DC converter. Let K represent the load equivalent resistance at time k, the photovoltaic voltage at time k, and the flow battery voltage at time k, respectively. DC bus voltage reference value, This is the reference power of the supercapacitor; when hour ,(47) ,(48) in, Represents the time at k=h+ε The measured value; This indicates the time at k=h+1. The predicted value, It is the predicted reference PV current at k=h+1; It can be calculated using the following formula: ,(49) in, DC bus voltage reference value, The reference power of the supercapacitor Let be the photovoltaic voltage at time k. These are the predicted equivalent resistance values ​​of the load at k=h+1; when hour, During this time interval, use a sigmoid function to implement the transition from... arrive A smooth transition, where k = h + 1, the S-function is shown below: ,(50) in, This represents the S-curve value of PV at point k. This indicates that PV is at k= The actual value of the reference current at that moment. This indicates that PV is at k= The predicted value of the reference current at time z, where z represents the steepness of the S-curve, also known as the growth rate. It is the midpoint of the S-curve, and its value is 0.

5. It represents the degree of completion or progress of the S-function within a discrete time interval; The reference currents for the PV, flow battery, and supercapacitor during this period are: ,(51) ,(52) ,(53) in, This represents the S-curve value of PV at point k. This indicates that PV is at k= The actual value of the reference current at any given time.

11. The DC microgrid energy management method combining MPC and LSTM-TCN models according to claim 1, characterized in that: In step S5, the MPC controller includes an optimizer for predicting the future state space of the system and solving optimization problems. The MPC finds the optimal control input of the system by minimizing the cost function, which reflects the error between the system's expected state, i.e., the reference value, and the actual state. State-space models describe the dynamic characteristics of a system. Kirchhoff's laws are used to analyze the dynamic characteristics of DC-DC converters, resulting in state-space models for PV, DC-DC, flow battery DC-DC converters, and supercapacitor DC-DC converters: ,(54) ,(55) ,(56) in, These are respectively represented as photovoltaic voltage, flow battery voltage, supercapacitor voltage, and DC bus voltage. These represent the photovoltaic system current, the flow battery current, and the supercapacitor current, respectively. These represent the photovoltaic reference current filtered by the inductor of the unidirectional DC-DC converter, the flow battery current filtered by the inductor of the bidirectional DC-DC converter, and the supercapacitor current filtered by the inductor of the bidirectional DC-DC converter, respectively. , and These are the control inputs for PV, supercapacitors, and flow batteries, respectively. in, , and These are the control inputs for the PV, supercapacitor, and flow battery, respectively. The system state-space model can be represented as follows: ,(57) ,(58) ,(59) in ; The state-space model described by the above equations is defined in the continuous-time domain. By applying the forward Euler approximation method, the following results can be obtained in the discrete-time domain: ,(60) ,(61) ,(62) in, The step size is used to define the MPC step size. The goal of MPC is to track the reference current values ​​of photovoltaic, flow battery, and supercapacitor by minimizing the cost function. To achieve this, MPC solves an optimization problem at each time step, as shown in the following expression: ,(63) ,(64) The above formulas are subject to the following constraints: ,(65) ,(66) ,(67) in, , It is a cost function. , , and These are the adjustment weights of each control term. The first three terms of the cost function are used to track the reference current values ​​of the photovoltaic system, flow battery, and supercapacitor, while the last term is used to minimize the variation in the control input. After the MPC solves the optimization problem, it integrates the optimal control input into pulse width modulation (PWM) to generate switching signals for each DC-DC converter in the microgrid, thereby achieving the optimal real-time energy flow in the DC microgrid system.