Unified power closed-loop control method and system for charging and discharging of low-voltage energy storage treatment device
Patent Information
- Application Number
- CN202611417288.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-16
AI Technical Summary
传统方案通常使用两套独立的控制器、两组独立参数,代码分支复杂,模式切换时易出现指令突变和不连续性
[0077] This invention relates to a unified power closed-loop control method and system for charging and discharging in low-voltage energy storage governance devices. By defining a unified error for charging and discharging, a single set of PID formulas and the same set of control parameters can simultaneously support both charging and discharging modes, eliminating the need for dual controllers or dual parameter switching. During mode switching, the error sign automatically flips, the integral term does not need to be zeroed, and the power command remains continuous without abrupt changes, significantly reducing the amount of code.
Smart Images

Figure CN122931929A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to smart grid control technology, specifically to a method and system for unified power closed-loop control of charging and discharging of low-voltage energy storage devices. Background Technology
[0002] Low-voltage management devices inject or absorb active power into the grid through a power storage converter (PCS) to maintain local voltage. This requires a stable and reliable closed-loop controller that accepts the target voltage and control parameters as input and generates PCS charging and discharging power commands based on the measured voltage deviation.
[0003] Closed-loop controllers present the following unique challenges in low-voltage treatment systems:
[0004] First, there is a need for bidirectional control. The device operates in both charging and discharging modes simultaneously. Traditional solutions typically use two independent controllers and two sets of independent parameters, resulting in complex code branches and a tendency for instruction abrupt changes and discontinuities during mode switching.
[0005] Second, the differential noise caused by the short control cycle. The control cycle is usually 80ms. If the D term uses the simple difference between adjacent sampled values inside the controller, i.e., D=Kd×(V_now−V_last) / dt, the sampling noise will be amplified by 1 / dt, causing the D term to jitter violently or even triggering the controller to oscillate.
[0006] Third, steady-state deviation within the dead zone. Most controllers directly return to zero when the error enters the dead zone (typically ±2V). However, when there are slight changes in line impedance or load, the error will remain at the dead zone boundary, resulting in a sustained steady-state deviation of 1-2V. In extreme low-voltage governance scenarios, this will reduce the end-user qualification rate.
[0007] Fourth, integral saturation and sudden change response. The integral term of energy storage devices is prone to saturation when there is a large deviation, leading to overshoot and repeated oscillations when approaching the target. If the integral is not quickly withdrawn when the error sign reverses, the overshoot will be more severe. At the same time, during the device startup phase or when the load increases rapidly, a fast response to high-power commands is required; however, conventional PID controllers are slow to respond before accumulating integrals.
[0008] Fifth, the impact of sudden power changes on equipment and the power grid. When a PCS receives a sudden power command (e.g., jumping directly from 0W to 4000W), it will cause device stress, battery surges, and transient disturbances to the power grid. Strict limits on the rate of power change are necessary, but excessive limits will result in a slow response.
[0009] Sixth, decouple battery SOC limiting from the controller. Charging should stop when SOC is too high, discharging should stop when SOC is too low, and the SOC range should be segmented and limited according to the C-rate. If these SOC limits are written inside the PID controller, changes to control parameters require simultaneous changes to the limits, resulting in severe code coupling. Furthermore, SOC limiting will clip the PID output; if the PID controller is not informed, the integral will continue to accumulate, releasing the overshoot instantaneously once the SOC recovers.
[0010] Seventh, scheduling delays cause a surge in the integral term. In embedded systems, the control cycle is not strictly fixed. When lower-level Flash operations, memory defragmentation, or other long-running tasks block the main loop, the actual control interval may increase from 80ms to 1-2 seconds. If the integral is accumulated based on the actual time interval (dt), it will cause a surge in the integral term; if the control cycle is skipped directly, it will cause a response interruption.
[0011] Eighth, the sources of targets and parameters differ. The target voltage of the device may come from a multi-timescale collaborative module, from manual settings, or from user debugging mode; control parameters may come from manual configuration, learned values, impedance identification values, or cold start default values. If the controller needs to be aware of each of these sources, the code will grow exponentially.
[0012] Therefore, a two-way closed-loop control method for low-voltage treatment devices is needed, which has a unified charging and discharging framework, resistance to D-term noise, dead-zone fine-tuning capability, integral anti-saturation, power limiting and SOC safety layering, scheduling delay protection, and receives targets and parameters through a unified interface to shield differences in sources. Summary of the Invention
[0013] In order to at least overcome the above-mentioned deficiencies in the prior art, the purpose of this application is to provide a method and system for unified power closed-loop control of charging and discharging of low-voltage energy storage governance devices.
[0014] In a first aspect, embodiments of this application provide a method for unified power closed-loop control of charging and discharging in a low-voltage energy storage governance device, including:
[0015] Obtain the effective target voltage, the measured voltage, and the control parameters; the control parameters include at least the proportional gain, integral gain, and derivative gain.
[0016] The control error is calculated based on the effective target voltage and the measured voltage; in discharge mode, the control error is the effective target voltage minus the measured voltage; in charging mode, the control error is the measured voltage minus the effective target voltage.
[0017] Calculate the actual time interval of the current control cycle, and truncate the actual time interval to the preset upper limit value when the actual time interval exceeds the preset upper limit value;
[0018] When the absolute value of the control error is greater than the dead zone voltage, the power command value is calculated based on the control error and the control parameters;
[0019] When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value.
[0020] Power control is performed using the power command value.
[0021] In one possible implementation, when the absolute value of the control error is greater than the dead zone voltage, calculating the power command value based on the control error and the control parameters includes:
[0022] Calculate the proportional term, integral term, and differential term according to the following formula:
[0023] p_term = Kp × error;
[0024] i_term = Ki × ∫(error × dt);
[0025] In charging mode, d_term = Kd × slope;
[0026] In discharge mode, d_term = -Kd × slope;
[0027] In the formula, Kp is the proportional gain, error is the control error, p_term is the proportional term, i_term is the integral term, d_term is the differential term, Ki is the integral gain, dt is the actual time interval, Kd is the differential gain, and slope is the voltage slope.
[0028] The power command value is obtained by summing the proportional term, integral term, and derivative term.
[0029] In one possible implementation, obtaining the voltage slope includes:
[0030] A fast Fourier transform is performed on the instantaneous voltage sampled from the energy storage converter to extract the amplitude of the 50Hz fundamental voltage and obtain the effective voltage value.
[0031] The effective voltage value is smoothed by an exponentially weighted moving average to obtain a smoothed voltage value;
[0032] The voltage slope is calculated using the following formula:
[0033] slope=(V(t)−V(t−1)) / dt;
[0034] In the formula, V(t) is the smoothed voltage value of the current cycle, and V(t−1) is the smoothed voltage value of the previous cycle.
[0035] In one possible implementation, when the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value, including:
[0036] When the absolute value of the control error is less than or equal to the dead zone voltage, the dead zone fine-tuning mode is entered.
[0037] In the dead-zone fine-tuning mode, the scaling term is set to zero: p_term=0;
[0038] In the dead-zone fine-tuning mode, the differential term is set to zero: d_term = 0;
[0039] The integral term is retained and accumulated periodically: i_term = Ki × ∫(error × dt);
[0040] In the formula, error is the control error, p_term is the proportional term, i_term is the integral term, d_term is the derivative term, Ki is the integral gain, and dt is the actual time interval;
[0041] The power command value is obtained by summing the proportional term, integral term, and derivative term.
[0042] In one possible implementation, in the dead-zone fine-tuning mode, the amplitude of the integral term is limited by line impedance constraints.
[0043] The limits include:
[0044] The maximum permissible amplitude of the integral term is calculated using the following formula:
[0045] Imax = deadband / R × target;
[0046] In the formula, Imax is the maximum allowable amplitude of the integral term, deadband is the dead zone voltage, R is the line impedance, and target is the effective target voltage;
[0047] When the calculated value of the integral term exceeds the maximum allowable amplitude, the integral term will be clamped to the maximum allowable amplitude.
[0048] In one possible implementation, the power command value is the sum of the proportional term, the integral term, and the derivative term;
[0049] The calculation of power command values also includes:
[0050] When the power command value output in the previous control cycle reaches the limit, the accumulation of the integral term in the current cycle is paused.
[0051] When the sign of the control error is opposite to the sign of the integral term, the integral term decays at a preset multiple of the normal accumulation rate;
[0052] When the power command value is reduced by the downstream limiting module, the integral term will be reduced by the reduction value of that reduction.
[0053] When the absolute value of the control error enters the dead zone, the integral term is decayed according to the decay coefficient that changes linearly with the error amplitude.
[0054] In one possible implementation, the attenuation of the integral term according to an attenuation coefficient that varies linearly with the error magnitude includes:
[0055] The attenuation coefficient is calculated using the following formula:
[0056] ratio=|error| / deadband
[0057] decay = 0.9 + 0.1 × ratio
[0058] In the formula, error is the control error, deadband is the dead zone voltage, decay is the attenuation coefficient, and ratio is the dead zone position coefficient;
[0059] The product of the attenuation coefficient and the integral term is calculated as the attenuated integral term.
[0060] One possible implementation also includes:
[0061] When the current output power is zero and the deviation between the measured voltage and the effective target voltage exceeds a preset threshold, the initial feedforward power is calculated according to the following formula:
[0062] P_ff = |target - Vm| × Kp × α;
[0063] In the formula, P_ff is the initial feedforward power, target is the effective target voltage, Vm is the measured voltage, Kp is the proportional gain, and α is the startup acceleration factor;
[0064] The initial feedforward power is clamped to within a preset upper limit value and then superimposed on the power command value.
[0065] In one possible implementation, power control via the power command value includes:
[0066] A two-stage power change rate limit is applied to the power command value to obtain a power command value after the change rate is limited; the two-stage power change rate limit is to limit the initial power command change amplitude to within a first threshold, and then limit the power change amplitude in each subsequent control cycle to within a second threshold, wherein the second threshold is less than the first threshold;
[0067] The power command value after the rate of change limit is subjected to a safe power limit based on the battery state of charge to obtain the final power command value of the energy storage converter; the safe power limit is to reduce the power command value to the maximum power allowed by the current state of charge when the power command value exceeds the maximum power allowed by the current state of charge.
[0068] The final power command value of the energy storage converter is sent to the energy storage converter to execute power output.
[0069] Secondly, this application also provides a unified power closed-loop control system for charging and discharging of a low-voltage energy storage governance device, including:
[0070] The acquisition unit is configured to acquire the effective target voltage, the measured voltage, and control parameters; the control parameters include at least proportional gain, integral gain, and derivative gain.
[0071] An error unit is configured to calculate a control error based on the effective target voltage and the measured voltage; in discharge mode, the control error is the effective target voltage minus the measured voltage; in charging mode, the control error is the measured voltage minus the effective target voltage.
[0072] The time interval unit is configured to calculate the actual time interval of the current control cycle, and to truncate the actual time interval to the preset upper limit value when the actual time interval exceeds the preset upper limit value;
[0073] The calculation unit is configured to calculate a power command value based on the control error and the control parameters when the absolute value of the control error is greater than the dead zone voltage;
[0074] When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value.
[0075] The control unit is configured to perform power control based on the power command value.
[0076] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0077] This invention relates to a unified power closed-loop control method and system for charging and discharging in low-voltage energy storage governance devices. By defining a unified error for charging and discharging, a single set of PID formulas and the same set of control parameters can simultaneously support both charging and discharging modes, eliminating the need for dual controllers or dual parameter switching. During mode switching, the error sign automatically flips, the integral term does not need to be zeroed, and the power command remains continuous without abrupt changes, significantly reducing the amount of code. Attached Figure Description
[0078] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0079] Figure 1 This is a schematic diagram of the method steps in an embodiment of this application. Detailed Implementation
[0080] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0081] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0082] Please refer to the following: Figure 1 This is a flowchart illustrating the unified power closed-loop control method for charging and discharging of a low-voltage energy storage governance device provided in an embodiment of the present invention. Further, the unified power closed-loop control method for charging and discharging of a low-voltage energy storage governance device may specifically include the contents described in steps S1-S5.
[0083] S1: Obtain the effective target voltage, measured voltage, and control parameters; the control parameters include at least proportional gain, integral gain, and derivative gain;
[0084] S2: Calculate the control error based on the effective target voltage and the measured voltage; in discharge mode, the control error is the effective target voltage minus the measured voltage; in charging mode, the control error is the measured voltage minus the effective target voltage.
[0085] S3: Calculate the actual time interval of the current control cycle, and truncate the actual time interval to the preset upper limit value when the actual time interval exceeds the preset upper limit value;
[0086] S4: When the absolute value of the control error is greater than the dead zone voltage, calculate the power command value based on the control error and the control parameters;
[0087] When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value.
[0088] S5: Power control is performed using the power command value.
[0089] When implementing the embodiments of this application, it is necessary to first read three key inputs from the upstream module: the effective target voltage, the measured voltage, and the control parameters. The effective target voltage is the voltage setpoint given by the upstream decision module, which means that the voltage needs to be controlled as close as possible to the effective target voltage. The control parameters are the PID control parameters generated by the upstream module. For details, please refer to the Chinese patent application number 202611063300.3 previously filed by the applicant. These three inputs constitute the basic data for closed-loop control.
[0090] In the implementation of this application embodiment, the error definition is unified. Based on the current charging and discharging mode, the error is calculated according to different formulas. In both the discharging and charging modes, a positive error indicates that the power in that direction needs to be increased, while a negative error indicates that the power in that direction needs to be decreased. This unified definition allows a single PID formula to serve both modes simultaneously. At the same time, it is also necessary to calculate the actual time interval dt between the current control cycle and the previous control cycle. In embedded systems, Flash operations, task blocking, etc., may cause dt to increase abnormally. The normal 80ms is stretched to 1-2 seconds. If dt exceeds the preset upper limit, it is truncated to the upper limit to prevent the integral term from accumulating too much dt and causing a surge.
[0091] In the implementation of this application embodiment, full PID control is performed outside the dead zone. When the absolute value of the error is greater than the dead zone voltage, such as 2V, the voltage deviation is large, requiring complete three-term PID calculation to generate a power command to drive the voltage to quickly return to the target value. Inside the dead zone, only the I term is fine-tuned. When the absolute value of the error is less than or equal to the dead zone voltage, the voltage is close to the target. At this time, the P and D terms are set to zero to avoid power fluctuations caused by noise, and only the I term is retained to slowly accumulate to eliminate residual steady-state deviation. Then, based on the generated power command, it is sent to the energy storage converter for execution to form a closed loop. In this embodiment, by unifying the physical meaning of the error sign, the same set of PID parameters and formulas are applicable to both charging and discharging modes simultaneously, without the need for if / else branch switching; at the same time, the error sign automatically flips when switching between charging and discharging modes, the integral term does not need to be returned to zero, and the power command remains continuous without jumps; the I-term is retained for fine-tuning within the dead zone, so that the voltage can converge to near the target value, rather than remaining at the dead zone boundary and generating a continuous deviation of 1-2V; dt truncation protection prevents the integral from surging when the embedded system task is blocked, while not abandoning the output of the current control cycle; the controller is completely unaware of the target source and parameter source, and the upper-level module can be replaced independently.
[0092] In one possible implementation, when the absolute value of the control error is greater than the dead zone voltage, calculating the power command value based on the control error and the control parameters includes:
[0093] Calculate the proportional term, integral term, and differential term according to the following formula:
[0094] p_term = Kp × error;
[0095] i_term = Ki × ∫(error × dt);
[0096] In charging mode, d_term = Kd × slope;
[0097] In discharge mode, d_term = -Kd × slope;
[0098] In the formula, Kp is the proportional gain, error is the control error, p_term is the proportional term, i_term is the integral term, d_term is the differential term, Ki is the integral gain, dt is the actual time interval, Kd is the differential gain, and slope is the voltage slope.
[0099] The power command value is obtained by summing the proportional term, integral term, and derivative term.
[0100] In the implementation of this application embodiment, a complete PID calculation process outside the dead zone is given. At this time, the voltage deviates far from the target and a fast response is required. Therefore, the controller calculates three independent terms according to the classic PID structure. In the proportional term p_term=Kp×error, the P term directly responds to the current error. The larger the error, the larger the output, providing an immediate instruction on how much force to apply. This is the most intuitive response term in PID. In the integral term i_term=Ki×∫(error×dt), the I term accumulates historical errors and solves the steady-state deviation that the P term cannot eliminate. Even if the current error is very small, the I term can still continue to output power until the deviation is completely zero. In the derivative term d_term=±Kd×slope, the D term does not directly respond to the error itself, but responds to the trend of error change. The controller reads the slope from the external voltage sampling module and flips the sign according to the charging and discharging mode. The essence of the D term is to predict the future trend of the voltage. When the voltage drops rapidly, the D term predicts the deviation that is about to occur and outputs power in advance to curb it. The sum of the three terms yields the power command value, realizing fast, zero steady-state error, and predictable control. In this embodiment, the P term is responsible for the current response, the I term is responsible for eliminating historical deviations, and the D term is responsible for predicting future trends. Each term plays an independent role and works together to achieve high-quality control. Meanwhile, the slope is provided by an external module, avoiding the problem of internal differential amplification of sampling noise in traditional PID controllers with a short 80ms cycle. Furthermore, the D term can be adaptively oriented, automatically flipping its sign according to the charging and discharging mode. When the voltage rises, the charging direction d_term is positive, increasing charging to absorb overvoltage, and the discharging direction d_term is negative, reducing discharging to avoid overshoot. At the same time, when the error is greater than a certain value, such as 10V, the D term needs to be directly set to zero to avoid power surges caused by noise amplification in the D term during periods of large errors.
[0101] In one possible implementation, obtaining the voltage slope includes:
[0102] A fast Fourier transform is performed on the instantaneous voltage sampled from the energy storage converter to extract the amplitude of the 50Hz fundamental voltage and obtain the effective voltage value.
[0103] The effective voltage value is smoothed by an exponentially weighted moving average to obtain a smoothed voltage value;
[0104] The voltage slope is calculated using the following formula:
[0105] slope=(V(t)−V(t−1)) / dt;
[0106] In the formula, V(t) is the smoothed voltage value of the current cycle, and V(t−1) is the smoothed voltage value of the previous cycle.
[0107] In the implementation of this application embodiment, the energy storage converter samples the instantaneous voltage at high speed and extracts the amplitude of the 50Hz power frequency fundamental voltage through a fast Fourier transform. This step is essentially a bandpass filter, retaining only the component consistent with the grid frequency, filtering out high-frequency noise and harmonic interference, and obtaining a stable effective voltage value. Then, an exponentially weighted moving average is applied to the extracted effective value, with the current value having a higher weight and historical values having decreasing weights, which can filter out random spikes while being sensitive to the true trend. Then, the smoothed voltage value of the current period is subtracted from the smoothed voltage value of the previous period, and then divided by the time interval dt to obtain the voltage change rate. In this application embodiment, noise amplification caused by short control cycles can be avoided. With an 80ms control cycle, if the original voltage is simply differentially analyzed, the sampling noise will be amplified by 1 / dt, reaching as high as 1 / 0.08 = 12.5 times, which will cause severe jitter or even self-excited oscillation in the D term. This scheme has significantly attenuated the noise before entering the differential process. At the same time, the slope after smoothing represents the effective trend of the voltage rather than instantaneous spikes, and the D term can accurately predict the voltage trend.
[0108] In one possible implementation, when the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value, including:
[0109] When the absolute value of the control error is less than or equal to the dead zone voltage, the dead zone fine-tuning mode is entered.
[0110] In the dead-zone fine-tuning mode, the scaling term is set to zero: p_term=0;
[0111] In the dead-zone fine-tuning mode, the differential term is set to zero: d_term = 0;
[0112] The integral term is retained and accumulated periodically: i_term = Ki × ∫(error × dt);
[0113] In the formula, error is the control error, p_term is the proportional term, i_term is the integral term, d_term is the derivative term, Ki is the integral gain, and dt is the actual time interval;
[0114] The power command value is obtained by summing the proportional term, integral term, and derivative term.
[0115] In the implementation of this application, a special processing mode within the dead zone is given. When the absolute value of the error is less than or equal to the dead zone voltage, the voltage is very close to the target value. If the complete PID calculation is continued at this time, the following problems will occur: the P term still outputs for small errors, and any small voltage noise will be amplified; the D term also responds to small slopes, which will also introduce noise jitter. This will cause the power command to oscillate back and forth, and the voltage cannot truly stabilize near the target. The dead zone fine-tuning mode of this application adopts the following strategy: the error is already very small, and there is no need for the proportional term to drive a rapid approach. The P term will instead generate unnecessary power fluctuations due to noise, so it is set to zero; the voltage change rate within the dead zone is very small, and the D term is sensitive to small slope noise, so it is set to zero; although P and D are set to zero, there may be residual deviations in the system such as voltage drop caused by line impedance and slight load changes. Only the historical accumulation of the I term can continue to output power until the deviation disappears completely. Therefore, the integral term is retained to continue to accumulate periodically. The embodiments of this application can effectively eliminate dead-zone noise oscillation. After P and D return to zero, small voltage fluctuations and sampling noise will not cause power command jitter. At the same time, steady-state deviation elimination is not abandoned. The I term is retained so that the voltage in the dead zone can still slowly converge to the target value, instead of directly returning to zero and stopping at the dead zone boundary as in most traditional solutions. Moreover, the transition is smooth, the I term continues to exist at the edge of the dead zone, and the power command is naturally connected from outside the dead zone to inside the dead zone without abrupt changes.
[0116] In one possible implementation, in the dead-zone fine-tuning mode, the amplitude of the integral term is limited by line impedance constraints.
[0117] The limits include:
[0118] The maximum permissible amplitude of the integral term is calculated using the following formula:
[0119] Imax = deadband / R × target;
[0120] In the formula, Imax is the maximum allowable amplitude of the integral term, deadband is the dead zone voltage, R is the line impedance, and target is the effective target voltage;
[0121] When the calculated value of the integral term exceeds the maximum allowable amplitude, the integral term will be clamped to the maximum allowable amplitude.
[0122] In the implementation of this application embodiment, the upper limit of the amplitude of the I term in the dead-zone fine-tuning mode is further given and bound to the line impedance. The I term continues to accumulate within the dead zone to eliminate steady-state deviation. However, without amplitude limiting, two problems may occur: First, the I term slowly climbs over time, eventually pushing up the power command and causing the voltage to exceed the target and cause overshoot. Second, the line impedance of different substations varies greatly. On low-impedance lines, a small power can cause a significant voltage change. If the I term has no amplitude limit, the same accumulation will cause overshoot on low-impedance lines. The impedance constraint amplitude limiting of this solution solves this problem. According to Ohm's law, the voltage change ΔV = P × R / V, where P is the power, R is the line resistance, and V is the current voltage. To correct a voltage deviation over a deadband width, the required power is P = deadband × V / R. Therefore, in this embodiment, correction is performed using a limiting formula, where the value represents the maximum power required to correct a deadband width deviation. As impedance increases, Imax decreases, leading to conservative limiting of the I-term; conversely, as impedance decreases, Imax increases, allowing for a larger I-term output. This embodiment can adaptively adapt to line impedance, with Imax automatically adjusting with impedance, eliminating the need for manual configuration of limiting parameters for different transformer substations. It also avoids overshoot on low-impedance lines, with a smaller Imax in strong network substations to prevent overshoot caused by pushing up I-term power; simultaneously, it ensures sufficient output on high-impedance lines, with a larger Imax in weak network substations, providing sufficient power margin for I-term to eliminate deviations.
[0123] In one possible implementation, the power command value is the sum of the proportional term, the integral term, and the derivative term;
[0124] The calculation of power command values also includes:
[0125] When the power command value output in the previous control cycle reaches the limit, the accumulation of the integral term in the current cycle is paused.
[0126] When the sign of the control error is opposite to the sign of the integral term, the integral term decays at a preset multiple of the normal accumulation rate;
[0127] When the power command value is reduced by the downstream limiting module, the integral term will be reduced by the reduction value of that reduction.
[0128] When the absolute value of the control error enters the dead zone, the integral term is decayed according to the decay coefficient that changes linearly with the error amplitude.
[0129] In the implementation of this application, a four-fold conditional anti-saturation mechanism for the integral term is defined. Integral saturation is the most common problem in PID control. When the integral term accumulates to its upper limit under large deviations, the saturated integral cannot fall back in time when the actual value approaches the target, leading to overshoot and repeated oscillations. This solution addresses integral runaway in different scenarios through four independent but coordinated mechanisms: First: Limiting and pausing. When the power command output in the previous cycle has been clipped by downstream limiting, such as SOC limiting, it means that the current system cannot output more power. If the integral term continues to accumulate, it will only idle, increasing the integral value but not the actual output. When the limiting is lifted, it will release instantly, so the integral is paused. The process involves four stages: First, cumulative decay. Second, accelerated decay with reversed sign: When the error sign is opposite to the integral sign, it indicates the voltage has exceeded the target. At this point, the integral direction is opposite to the actual demand direction; the integral is no longer a boost but a drag. Therefore, it can decay at three times the normal rate, allowing for rapid regression and shortening the overshoot recovery time. Third, downstream clipping and regression: When the power command is reduced by downstream limiting, the integral value may still remain at a high level. For example, for an integral value corresponding to 800W, the actual output is only 0W. If not adjusted, the integral will instantly release 800W after the limiting is lifted. Therefore, the integral value is actively regressed. Fourth, dead-zone approach decay: When the error enters the dead zone, the voltage is close to the target. At this time, the integral decays linearly according to the error amplitude; the closer the error is to zero, the stronger the decay. This prevents the integral inertia from pushing the voltage beyond the target. This application's embodiments cover the entire process from large deviation, approaching the target, zero crossing, and reversal by using amplitude limiting pause to prevent saturation, inversion attenuation to prevent overshoot, clipping back to prevent sudden release, and dead zone attenuation to prevent inertia. At the same time, the integral state is always aligned with the physical output. Through clipping back, the integral value does not exceed the level corresponding to the actual allowed output, eliminating hidden integrals. In addition, overshoot recovery is fast, with 3 times the attenuation speed during inversion, which is much faster than the speed of natural integral back-off in traditional schemes. Furthermore, convergence is smooth, with linear attenuation within the dead zone. When the error approaches zero, the integral automatically shrinks without hard switching.
[0130] In one possible implementation, the attenuation of the integral term according to an attenuation coefficient that varies linearly with the error magnitude includes:
[0131] The attenuation coefficient is calculated using the following formula:
[0132] ratio=|error| / deadband
[0133] decay = 0.9 + 0.1 × ratio
[0134] In the formula, error is the control error, deadband is the dead zone voltage, decay is the attenuation coefficient, and ratio is the dead zone position coefficient;
[0135] The product of the attenuation coefficient and the integral term is calculated as the attenuated integral term.
[0136] In the implementation of this application embodiment, when the error enters the dead zone, the integral term is attenuated by the attenuation coefficient decay, which is determined by the dead zone position coefficient ratio. The dead zone position coefficient ranges from 0 to 1, where 0 indicates exactly at the target point and 1 indicates at the dead zone boundary. The attenuation coefficient ranges from 0.9 to 1.0, where 0.9 is the maximum attenuation intensity and 1.0 is the minimum attenuation intensity. When decay is 0.9, the integral term is multiplied by 0.9, retaining 90% and losing 10%; when decay is 1.0, it is multiplied by 1.0, retaining everything without attenuation. In this application embodiment, the attenuation intensity is precisely related to the magnitude of the deviation; the larger the deviation, the weaker the attenuation, and the smaller the deviation, the stronger the attenuation, achieving error-driven soft landing. At the same time, the attenuation coefficient changes continuously from 0.9 to 1.0, rather than abruptly at the dead zone boundary, resulting in a smooth transition. It also avoids inertial overshoot, with the strongest attenuation when closest to the target, preventing the integral inertia from overshooting.
[0137] One possible implementation also includes:
[0138] When the current output power is zero and the deviation between the measured voltage and the effective target voltage exceeds a preset threshold, the initial feedforward power is calculated according to the following formula:
[0139] P_ff = |target - Vm| × Kp × α;
[0140] In the formula, P_ff is the initial feedforward power, target is the effective target voltage, Vm is the measured voltage, Kp is the proportional gain, and α is the startup acceleration factor;
[0141] The initial feedforward power is clamped to within a preset upper limit value and then superimposed on the power command value.
[0142] In the implementation of this application embodiment, an acceleration mechanism for the device startup phase is defined. When the PID controller starts from zero power, it needs to go through the process of error generation, P-term response, and integral accumulation to establish sufficient power output. In the initial stage before integral accumulation, the response will be slow. Therefore, this solution superimposes a feedforward power at the moment of startup to directly skip the waiting time of integral accumulation and quickly enter the working state. Its triggering condition is that the current output power is zero, that is, it has just started from zero; the voltage deviation exceeds a preset threshold, such as 0.5V, and there is indeed an adjustment requirement; α is the startup acceleration multiple, with a typical value of 1.5. This formula is actually an amplified version of the P-term, with the feedforward being 1.5 times that to provide additional startup acceleration. The embodiments of this application can significantly shorten the start-up adjustment time, bypass the waiting time of integral accumulation, and quickly enter the working state from zero; Kp is inversely proportional to the line impedance, so a large impedance and a small Kp result in conservative feedforward; a small impedance and a large Kp result in aggressive feedforward, automatically matching different distribution areas; at the same time, the PID can take over after one activation, triggering only once during the start-up phase, without interfering with subsequent closed-loop regulation, avoiding power redundancy caused by continuous feedforward.
[0143] In one possible implementation, power control via the power command value includes:
[0144] A two-stage power change rate limit is applied to the power command value to obtain a power command value after the change rate is limited; the two-stage power change rate limit is to limit the initial power command change amplitude to within a first threshold, and then limit the power change amplitude in each subsequent control cycle to within a second threshold, wherein the second threshold is less than the first threshold;
[0145] The power command value after the rate of change limit is subjected to a safe power limit based on the battery state of charge to obtain the final power command value of the energy storage converter; the safe power limit is to reduce the power command value to the maximum power allowed by the current state of charge when the power command value exceeds the maximum power allowed by the current state of charge.
[0146] The final power command value of the energy storage converter is sent to the energy storage converter to execute power output.
[0147] In the implementation of this application, a downstream processing flow for power commands after PID calculation is provided. The power commands calculated by PID cannot be directly sent to the PCS (energy storage device) for execution; they must pass through two safety filters: rate of change limitation and SOC limiting. In the dual-stage rate of change limitation, the essence of rate of change limitation is to slow down the power change. If the PCS receives a sudden power command, such as jumping from 0W to 4000W instantly, it will cause stress on the power devices, battery impact, and grid disturbance. However, if the limitation is too strict, it will cause the device to start up too slowly and respond sluggishly. Therefore, this solution adopts a dual-stage strategy. The first power command allows a larger step size, i.e., the first threshold, preferably 4000W, to allow the device to quickly enter the working state from zero. Thereafter, the step size is strictly limited to a small step size each cycle, preferably 1000W, i.e., the second threshold, to ensure smooth steady-state following. In the SOC safety limiting stage, continuing to charge when the battery state of charge (SOC) is too high will damage the battery, and continuing to discharge when the SOC is too low is also dangerous. Therefore, an independent SOC limiting module is needed to determine the maximum allowable charging and discharging power based on the current SOC, and to cut off the power if it exceeds the limit. This application's embodiment balances startup and steady-state performance through a two-stage limiting mechanism. The initial large step size ensures rapid startup, while subsequent small step sizes ensure smooth steady-state operation, which a single limiting scheme cannot simultaneously satisfy. Furthermore, SOC limiting is decoupled from the PID controller; SOC limiting is an independent upstream and downstream serial module. The PID controller is unaware of the SOC threshold, and the SOC limiting mechanism is also unaware of the PID controller's internal state. Modifying the limiting parameters does not affect the PID code. Simultaneously, limiting feedback prevents sudden integral release. When clipping occurs, a saturation flag is fed back to the integrator, pausing integral accumulation or causing a rollback, thus avoiding power surges caused by instantaneous integral release after SOC recovery.
[0148] For example, a device operates in discharge mode with a target voltage of 210V, a measured voltage of 207V, and an error of 3V. The controller outputs a positive power command. Subsequently, the user's heavy load is removed, and the voltage rises back to 213V, with an error of -3V. The controller outputs a negative power command to reduce discharge. The voltage further rises to 215V, and the device switches to charging mode. The error is calculated using the charging formula: error = Vm − target = 215 − 210 = 5V. The controller outputs a positive power command to increase charging and absorb energy. The entire process uses the same set of PID parameters (Kp = 30, Ki = 9, Kd = 3), requiring no switching of controller instances and exhibiting no sudden changes in commands.
[0149] For example, when a device starts up, the measured Vm=198V, target=210V, error=12V, and current power is 0W. Step 1: Feedforward trigger, feedforward power=12×30×1.5=540W, clamping limit within 3000W, no limiting required.
[0150] Step 2: PID Calculation:
[0151] P term: Kp×error=30×12=360;
[0152] I term: Ki×Σ(error×dt)=0 (for the first time, the integral value is 0);
[0153] D term: error=12V>10V, disabled, D=0;
[0154] PID output=360;
[0155] Step 3: Total command=feedforward 540+PID 360=900W.
[0156] Step 4: First-stage amplitude limiting: from 0 to 900W, the variation of 900W is less than 4000W, passed.
[0157] Step 5: SOC amplitude limiting: SOC=60%, charge_mode=false (discharging), no amplitude limiting is triggered.
[0158] Final output: 900W discharging command.
[0159] For example, the voltage rises to Vm=209.2V, target=210V, error=0.8V<deadband=2V, entering the deadband branch:
[0160] P=0;
[0161] D=0;
[0162] The I term continues to accumulate: integral increment=0.8×0.08×1.0=0.064 (assuming dt=80ms); the 1.0 here is a preset multiple, which is 1.0 under normal conditions and 3.0 during reverse acceleration;
[0163] Approaching target attenuation: ratio=0.4, decay=0.94, the attenuated integral=0.94×the integral before attenuation;
[0164] I term=Ki×integral increment;
[0165] Impedance constraint: Imax=2 / 3×210=140W, the I term is clamped to ±140W, that is, the line impedance is 3Ω, the deadband voltage is 2V, and the target voltage is 210V.
[0166] Controller output=I term, which slowly eliminates the steady-state deviation without overshoot.
[0167] Fourth Embodiment: Fast rollback with inverted error sign
[0168] The voltage continues to rise to Vm=211V, error=-1V, and the integral is still positive (accumulated previously).
[0169] error × integral increment < 0 → preset multiplier = 3
[0170] Integral increment = -1 × 0.08 × 3 = -0.24 / / 3 times rate backoff
[0171] The points are quickly rolled back to 0 to avoid overshooting.
[0172] Example of DT protection under Flash blocking:
[0173] The main loop is blocked for 1.5 seconds, dt=1.5s.
[0174] Step 1: dt>0.2s, truncate to 0.2s.
[0175] Step 2: Integral increment = error × 0.2 × preset multiplier, use truncated dt to accumulate.
[0176] Step 3: The controller continues to output PID commands normally.
[0177] In contrast, without truncation, accumulating points by pressing dt=1.5 for 1.5 seconds would cause a surge in points; skipping directly would result in the loss of 1.5 seconds of control response. The truncation solution balances both.
[0178] Example of SOC limiting triggering and integral feedback:
[0179] The device is charged to 97% SOC and then returns to 0W.
[0180] Step 1: PID calculation output 800W.
[0181] Step 2: Rate of change limit passed (800W < 4000W).
[0182] Step 3: Limit the SOC to 0W.
[0183] Step 4: Power = 0 < 800, set is_output_saturated = true.
[0184] Step 5: In the next control cycle, if the PID check is_output_saturated==true, skip the integral accumulation until the SOC recovers or the voltage deviation disappears.
[0185] Step 6: After the SOC drops below 94%, is_output_saturated=false, and the PID resumes integral accumulation.
[0186] Based on the same inventive concept, this application also provides a unified power closed-loop control system for charging and discharging of a low-voltage energy storage governance device, including:
[0187] The acquisition unit is configured to acquire the effective target voltage, the measured voltage, and control parameters; the control parameters include at least proportional gain, integral gain, and derivative gain.
[0188] An error unit is configured to calculate a control error based on the effective target voltage and the measured voltage; in discharge mode, the control error is the effective target voltage minus the measured voltage; in charging mode, the control error is the measured voltage minus the effective target voltage.
[0189] The time interval unit is configured to calculate the actual time interval of the current control cycle, and to truncate the actual time interval to the preset upper limit value when the actual time interval exceeds the preset upper limit value;
[0190] The calculation unit is configured to calculate a power command value based on the control error and the control parameters when the absolute value of the control error is greater than the dead zone voltage;
[0191] When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value.
[0192] The control unit is configured to perform power control based on the power command value.
[0193] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, or may be electrical, mechanical or other forms of connection.
[0195] The units described as separate components may or may not be physically separate. As will be apparent to those skilled in the art, the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0196] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0197] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or grid device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0198] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A closed-loop control method for unified power control of charging and discharging in a low-voltage energy storage and treatment device, characterized in that, include: Obtain the effective target voltage, the measured voltage, and the control parameters; the control parameters include at least the proportional gain, integral gain, and derivative gain. The control error is calculated based on the effective target voltage and the measured voltage; in discharge mode, the control error is the effective target voltage minus the measured voltage; in charging mode, the control error is the measured voltage minus the effective target voltage. Calculate the actual time interval of the current control cycle, and truncate the actual time interval to the preset upper limit value when the actual time interval exceeds the preset upper limit value; When the absolute value of the control error is greater than the dead zone voltage, the power command value is calculated based on the control error and the control parameters; When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value. Power control is performed using the power command value.
2. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage and treatment device according to claim 1, characterized in that, When the absolute value of the control error is greater than the dead zone voltage, the calculation of the power command value based on the control error and the control parameters includes: Calculate the proportional term, integral term, and differential term according to the following formula: p_term = Kp × error; i_term = Ki × ∫(error × dt); In charging mode, d_term = Kd × slope; In discharge mode, d_term = -Kd × slope; In the formula, Kp is the proportional gain, error is the control error, p_term is the proportional term, i_term is the integral term, d_term is the differential term, Ki is the integral gain, dt is the actual time interval, Kd is the differential gain, and slope is the voltage slope. The power command value is obtained by summing the proportional term, integral term, and derivative term.
3. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage and treatment device according to claim 2, characterized in that, The voltage slope is obtained by: A fast Fourier transform is performed on the instantaneous voltage sampled from the energy storage converter to extract the amplitude of the 50Hz fundamental voltage and obtain the effective voltage value. The effective voltage value is smoothed by an exponentially weighted moving average to obtain a smoothed voltage value; The voltage slope is calculated using the following formula: slope=(V(t)−V(t−1)) / dt; In the formula, V(t) is the smoothed voltage value of the current cycle, and V(t−1) is the smoothed voltage value of the previous cycle.
4. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage and treatment device according to claim 1, characterized in that, When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value, which includes: When the absolute value of the control error is less than or equal to the dead zone voltage, the dead zone fine-tuning mode is entered. In the dead-zone fine-tuning mode, the scaling term is set to zero: p_term=0; In the dead-zone fine-tuning mode, the differential term is set to zero: d_term = 0; The integral term is retained and accumulated periodically: i_term = Ki × ∫(error × dt); In the formula, error is the control error, p_term is the proportional term, i_term is the integral term, d_term is the derivative term, Ki is the integral gain, and dt is the actual time interval; The power command value is obtained by summing the proportional term, integral term, and derivative term.
5. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage and treatment device according to claim 4, characterized in that, In the dead-zone fine-tuning mode, the amplitude of the integral term is limited by the line impedance constraint; The limits include: The maximum permissible amplitude of the integral term is calculated using the following formula: Imax = deadband / R × target; In the formula, Imax is the maximum allowable amplitude of the integral term, deadband is the dead zone voltage, R is the line impedance, and target is the effective target voltage; When the calculated value of the integral term exceeds the maximum allowable amplitude, the integral term will be clamped to the maximum allowable amplitude.
6. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage treatment device according to claim 1, characterized in that, The power command value is the sum of the proportional term, integral term, and derivative term; The calculation of power command values also includes: When the power command value output in the previous control cycle reaches the limit, the accumulation of the integral term in the current cycle is paused. When the sign of the control error is opposite to the sign of the integral term, the integral term decays at a preset multiple of the normal accumulation rate; When the power command value is reduced by the downstream limiting module, the integral term will be reduced by the reduction value of that reduction. When the absolute value of the control error enters the dead zone, the integral term is decayed according to the decay coefficient that changes linearly with the error amplitude.
7. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage treatment device according to claim 6, characterized in that, The integral term is attenuated using an attenuation coefficient that varies linearly with the error magnitude, including: The attenuation coefficient is calculated using the following formula: ratio=|error| / deadband decay = 0.9 + 0.1 × ratio In the formula, error is the control error, deadband is the dead zone voltage, decay is the attenuation coefficient, and ratio is the dead zone position coefficient; The product of the attenuation coefficient and the integral term is calculated as the attenuated integral term.
8. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage and treatment device according to claim 1, characterized in that, Also includes: When the current output power is zero and the deviation between the measured voltage and the effective target voltage exceeds a preset threshold, the initial feedforward power is calculated according to the following formula: P_ff = |target - Vm| × Kp × α; In the formula, P_ff is the initial feedforward power, target is the effective target voltage, Vm is the measured voltage, Kp is the proportional gain, and α is the startup acceleration factor; The initial feedforward power is clamped to within a preset upper limit value and then superimposed on the power command value.
9. The closed-loop control method for unified charging and discharging power of the low-voltage energy storage and treatment device according to claim 1, characterized in that, Power control via the power command value includes: A two-stage power change rate limit is applied to the power command value to obtain a power command value after the change rate is limited; the two-stage power change rate limit is to limit the initial power command change amplitude to within a first threshold, and then limit the power change amplitude in each subsequent control cycle to within a second threshold, wherein the second threshold is less than the first threshold; The power command value after the rate of change limit is subjected to a safe power limit based on the battery state of charge to obtain the final power command value of the energy storage converter; the safe power limit is to reduce the power command value to the maximum power allowed by the current state of charge when the power command value exceeds the maximum power allowed by the current state of charge. The final power command value of the energy storage converter is sent to the energy storage converter to execute power output.
10. A unified power closed-loop control system for charging and discharging of a low-voltage energy storage management device using the method described in any one of claims 1 to 9, characterized in that, include: The acquisition unit is configured to acquire the effective target voltage, the measured voltage, and control parameters; the control parameters include at least proportional gain, integral gain, and derivative gain. An error unit is configured to calculate a control error based on the effective target voltage and the measured voltage; in discharge mode, the control error is the effective target voltage minus the measured voltage; in charging mode, the control error is the measured voltage minus the effective target voltage. The time interval unit is configured to calculate the actual time interval of the current control cycle, and to truncate the actual time interval to the preset upper limit value when the actual time interval exceeds the preset upper limit value; The calculation unit is configured to calculate a power command value based on the control error and the control parameters when the absolute value of the control error is greater than the dead zone voltage; When the absolute value of the control error is less than or equal to the dead zone voltage, the proportional and derivative terms are set to zero, and the integral term is adjusted to form the power command value. The control unit is configured to perform power control based on the power command value.
Citation Information
Patent Citations
Intrinsic voltage estimation and parameter self-tuning method and system for low-voltage governance
CN122600156A