A super capacitor charging and discharging control method and system

CN122908392APending Publication Date: 2026-10-13CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611294843.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-10-13

AI Technical Summary

Benefits of technology

1.恒功率充电阶段:电池以恒定功率Pbat_max输出,负载消耗剩余功率充入电容,电容电压逐渐上升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122908392A_ABST
    Figure CN122908392A_ABST
Patent Text Reader

Abstract

The application discloses a super capacitor charging and discharging control method and system, which comprises the following steps: judging the power difference between the target power and the current power; obtaining the current reference current of the capacitor end and the last round iteration current based on the target power and the current power through a power loop algorithm; adjusting the reference current of the capacitor end based on the mode limiting condition to obtain the limited reference current; obtaining the current total duty ratio of the control unit based on the limited reference current, the inductance current of the control unit and the last round iteration current through a current loop algorithm; and performing one charging or discharging on the capacitor based on the total duty ratio. When the super capacitor voltage approaches the upper limit, the current command will automatically decrease due to the constant power, thereby realizing the natural voltage stabilization effect without mode switching and with extremely fast response. The application has no voltage loop, mode switching and switching impact, and slightly sacrifices the voltage stabilization precision to realize extremely fast response and extremely simple structure. The application can automatically stabilize the voltage, continuously controls and improves the response speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power electronics and energy storage control technology, and more specifically, to a supercapacitor charging and discharging control method and system. Background Technology

[0002] The purpose of this invention is to provide a supercapacitor charging and discharging control method and system to solve the above-mentioned problems existing in the prior art.

[0003] In a first aspect, embodiments of the present invention provide a supercapacitor-based charging and discharging control method, comprising: S1: Obtain the current power p(k); the current power is the current output power of the battery; the value of k is a positive integer; S2: Determine whether the power difference between the target power and the current power p(k) is equal to 0; S3: If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power using the power loop algorithm; when k=1, I(k-1)=0; S4: Adjust the reference current I(k) at the capacitor terminal based on the mode constraint conditions to obtain the constrained reference current; S5: The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the limited reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. S6: Charge or discharge the capacitor once based on the total duty cycle.

[0004] Optionally, the capacitor may be charged or discharged once based on the total duty cycle, including: The total duty cycle is mapped to obtain the duty cycles of the left and right bridge arms of the control unit; The supercapacitor is charged or discharged once based on the duty cycle of the left and right bridge arms.

[0005] Optionally, based on the target power and the current power, the current reference current I(k) at the capacitor terminal and the previous iteration current I(k-1) are obtained using a power loop algorithm, including: Based on the power difference and the first adjustment coefficient, the current first current control factor u1(k) is obtained; Based on the current first current control factor u1(k) and the previous round's first current control factor u1(k-1), the current first current increment is obtained; when k=1, u1(k-1)=0; Based on the current first current increment and the previous iteration current I(k-1), the current reference value I(k) is obtained.

[0006] Optionally, prior to S4, the method further includes: Determine whether it is charging mode or discharging mode; The step of adjusting the reference current I(k) at the capacitor terminal based on mode constraints to obtain the constrained reference current includes: If it is in charging mode, determine whether I(k) is within the range of [-15A, 15A]; if I(k) is within the range of [-15A, 15A], the limited reference current is equal to the reference current I(k); if I(k) < -15A, the limited reference current is equal to -15A; if I(k) > 15A, the limited reference current is equal to 15A. If it is in discharge mode, determine whether I(k) is within the range of [-15A, 0.001A]. If I(k) is within the range of [-15A, 0.001A], the limited reference current is equal to the reference current I(k). If I(k) < -15A, the limited reference current is equal to -15A. If I(k) > 0.001A, the limited reference current is equal to 0.001A.

[0007] Optionally, the method further includes: Get the current voltage of the capacitor.

[0008] Optionally, the method further includes: If it is in charging mode, if the current voltage of the capacitor is less than the charging limit voltage, execute t=k, k=t+1, the previous iteration current I(k-1) = the current reference current I(t), execute the S1~S6 operations to charge the capacitor; t is the iteration replacement variable.

[0009] Optionally, the method further includes: If it is in discharge mode, if the current voltage of the capacitor is greater than the discharge limit voltage, execute t=k, k=t+1, the previous iteration current I(k-1)=the current reference current I(t), execute the S1~S6 operations to discharge the capacitor; t is the iteration replacement variable; if the current voltage of the capacitor is less than or equal to the discharge limit voltage, stop discharging.

[0010] Optionally, the overcurrent loop algorithm obtains the current total duty cycle of the control unit based on the constrained reference current, the inductor current of the control unit, and the previous iteration current I(k-1), including: Obtain the inductor current of the control unit; The current difference between the reference current after the limit is obtained and the inductor current of the control unit; Based on the current difference and the second adjustment coefficient, the current second current control factor u2(k) is obtained; Based on the current second current control factor u2(k) and the previous round's second current control factor u2(k-1), the current second current increment is obtained; when k=1, I2(k-1)=0; The feedforward current value is obtained based on the constrained reference current, the previous iteration current I(k-1), and the feedforward coefficients. Based on the feedforward current value, the current second current increment, and the duty cycle of the previous iteration, the current duty cycle of the control unit is obtained; when k=1, the duty cycle of the previous iteration is 0.

[0011] Secondly, embodiments of the present invention also provide a supercapacitor charging and discharging control system, the system comprising a battery, a load terminal, a capacitor terminal, and a controller, the controller being used to perform the following steps: S1: Obtain the current power p(k); the current power is the current output power of the battery; the value of k is a positive integer; S2: Determine whether the power difference between the target power and the current power p(k) is equal to 0; S3: If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power using the power loop algorithm; when k=1, I(k-1)=0; S4: Adjust the reference current I(k) at the capacitor terminal based on the mode constraint conditions to obtain the constrained reference current; S5: The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the limited reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. S6: Charge or discharge the capacitor once based on the total duty cycle.

[0012] Optionally, the control unit is a four-switch buck-boost converter.

[0013] This invention provides a supercapacitor charging and discharging control method and system. The method involves obtaining the current power p(k); determining whether the power difference between the target power and the current power p(k) is equal to 0; if the power difference is greater than or less than 0, a power loop algorithm is used to obtain the current reference current I(k) at the capacitor terminal and the previous iteration current I(k-1) based on the target power and the current power; when k=1, I(k-1)=0; adjusting the reference current I(k) at the capacitor terminal based on mode constraints to obtain a constrained reference current; using a current loop algorithm, based on the constrained reference current, the inductor current of the control unit, and the previous iteration current I(k-1), obtaining the current total duty cycle of the control unit; and charging or discharging the capacitor based on the total duty cycle. The technical solution provided by this invention does not require a separate voltage loop, reducing computation and improving system charging and discharging efficiency. When the supercapacitor voltage approaches its upper limit, the current command automatically decreases due to constant power, achieving a natural voltage regulation effect without mode switching and with extremely fast response. It features no voltage loop, no mode switching, and no switching shock, sacrificing minor regulation accuracy (e.g., ±0.5V) for extremely fast response and a minimalist structure. Automatic voltage regulation is achieved through the inherent characteristics of the power loop, ensuring continuous control and improving response speed. Attached Figure Description

[0014] Figure 1 This is a flowchart of a supercapacitor-based charging and discharging control method provided in an embodiment of the present invention. Detailed Implementation

[0015] In common energy storage control applications, taking the robot in the ROBOMASTER robotics competition as an example, the robot is powered by a battery to drive the motors, gimbal, transmitter, and other loads. When the motors start, stop suddenly, or brake, there will be a momentary high power demand or energy feedback. As a finite power source, the battery's maximum output power is limited by the battery management system (typically current-limited to 40A, corresponding to approximately 960W). When the load demand exceeds the battery's limit, the battery voltage will drop sharply, causing the system's undervoltage protection or even damage.

[0016] The advantages of the current technical solution are: supercapacitors have very low tip discharge loss because the energy storage process does not involve a chemical reaction. This process is reversible, so supercapacitors can be repeatedly charged and discharged hundreds of thousands of times, with an energy cycle life more than five times that of traditional batteries. They charge very quickly, reaching over 95% of their rated capacity in just over ten minutes, and operate within a temperature range of -40°C to 75°C, exhibiting excellent adaptability and covering almost all common temperature conditions.

[0017] The current technological solution has drawbacks: supercapacitors are extremely expensive, but their energy density is conversely low. For the same volume, supercapacitors are far less energy-efficient than lithium iron phosphate batteries. In other words, to achieve the same energy density as lithium iron phosphate batteries, supercapacitors would need to be significantly larger. This means that using supercapacitors would necessitate a complete redesign of the vehicle's battery compartment and body structure, potentially exceeding the original vehicle's intended size, which undoubtedly represents a huge cost.

[0018] Therefore, the combination of supercapacitors (instantaneous kinetic energy recovery) and high-rate, high-energy-density lithium batteries (long-term energy storage) is a good choice. For example, Mazda's i-ELOOP brake energy recovery system, which includes three key elements—recovery, storage, and use—is essentially a set of supercapacitors.

[0019] Existing solutions typically use supercapacitors as buffers and employ a constant current-constant voltage (CC-CV) charging strategy. However, this strategy has the following problems: 1. Cannot adapt to load fluctuations: When the load power is less than the battery's available power, it cannot automatically store the remaining power into the capacitor; when the load power is greater than the battery's limit, it cannot automatically replenish energy from the capacitor.

[0020] 2. Inability to smoothly handle energy feedback: The energy fed back during motor braking cannot be absorbed by the capacitor, causing the battery voltage to rise, which may damage the battery.

[0021] 3. Slow dynamic response: Traditional PID control has large overshoot and long settling time when there is a large current step.

[0022] Therefore, this application provides a supercapacitor charging and discharging control method and system for automatically balancing the power flow between the battery, load and supercapacitor, thereby improving system power utilization, system operating efficiency and service life.

[0023] It should be noted that the supercapacitor charging and discharging control method provided in this application is mainly for charging and discharging in a set power mode and a capacitor balancing mode. Specifically: In power mode, a complete loop operation is performed, involving the outer power loop, inner current loop, and physical duty cycle adjustment. This mode allows for normal closed-loop control of the target power. Capacitor balancing mode is only used when balancing the voltage of capacitors after they are fully charged.

[0024] The complete basis for charging and discharging, as well as the responsibilities of the two modes, are as follows: 1. The capacitor charging and discharging in both modes are directly based on the magnitude and trend of the power disturbance value measured by the outer power loop, which is the target power - current power = ep in the text. When ep is positive, the outer loop outputs a current reference value I2(k) that is smaller than the previous one. Then the feedforward I2(k) - I2(k-1) of the inner current loop is negative, and the calculated result of the second current control factor also decreases. Therefore, the current loop's regulation of output duty ΔDpid is negative, that is, the duty cycle output duty decreases, the current flows from the capacitor side to the power bus side, the capacitor voltage decreases, and the capacitor discharges.

[0025] In summary, we can deduce that when ep is positive as previously assumed, the capacitor discharges; the greater ep increases, the stronger the capacitor discharges, and the smaller ep decreases, the weaker the capacitor discharges; if ep becomes negative, the capacitor charges. The greater the degree to which ep < 0, and the larger the absolute value of the negative number ep, the stronger the capacitor charges.

[0026] Since ep equals target power minus current power ep, if the command from the upper-level controller remains unchanged, the target power is temporarily considered to be constant. The current power is then directly affected by load disturbances: if the load increases, the current power increases in this cycle, and ep decreases, indicating a discharge tendency; conversely, if the load decreases, there is a charging tendency.

[0027] 2. If ep remains positive, the capacitor will continuously receive charge. However, its capacity and voltage rating are limited, and it cannot be charged indefinitely. Therefore, a charging threshold voltage must be set, which is equivalent to entering "capacitor balancing mode". When entering the voltage limit range of "charging threshold -0.5V", the output range of the outer power loop to the reference current changes from ±15A to -15A to 0.001A. This means that only weak forward charging and normal discharging of the capacitor are allowed, ultimately causing the capacitor voltage to cyclically hysteresis around the "charging threshold -0.5V" on a microscopic level, and to stabilize near the "charging threshold -0.5V" on a macroscopic level. The overvoltage discharge logic is based on this mode, and the essential content remains unchanged.

[0028] In three common scenarios, this application provides an implementation method for a supercapacitor charging and discharging control method as follows: Scenario 1: The battery has excess power and needs to charge the capacitor. Before the disturbance occurs, it is assumed that the system has stabilized near the target power. Therefore, the reference current value I2(k-1) output by the outer power loop is basically stable, and the correction amount ΔD(k-1) of the inner current loop for the output duty is also approximately equal to 0. When the load power decreases in the k-th cycle, the current power measured by the power supply side decreases. For example, the current power P(k) = 140W, the target power Ptarget(k) = Ptarget(k-1) = 200W, and the power error in this cycle becomes ep(k) = 200 - 140 = 60W, which is a positive error. The outer loop output I2(k) > I2(k-1), so the feedforward current value (I2(k) - I2(k-1)) * Ai of the inner current loop is positive. This increment is directly fed into the inner current loop as a real-time feedforward, causing the second current control factor to change immediately in the charging direction in this cycle, without having to wait for the actual current error to accumulate cycle by cycle.

[0029] The second current control factor u2(k) = kp_i*ei(k) > u2(k-1) is calculated. Since I2(k) is increasing relative to the previous cycle, the current error and the second current control factor in this cycle both change in the direction of increasing. The duty cycle increment is D(k) - D(k-1) = ΔD(k) = u2(k) + (I2(k) - I2(k-1)) * Ai > 0. Based on this, the FSBB establishes the current flowing from the power bus to the supercapacitor after the kth cycle, that is, charging the capacitor. After entering the k-th cycle, the supercapacitor has begun to absorb some power, and the current power on the power supply side has increased relative to the k-th cycle, i.e., P(k+1) > P(k), while Ptarget(k+1) = Ptarget(k), so ep(k+1) < ep(k). The outer power loop still outputs the reference current in the charging direction, but its change amplitude is reduced, i.e., |ΔI2(k+1)| < |ΔI2(k)|. Subsequently, each cycle repeats the power sampling, power error calculation, reference current update, current loop operation and duty cycle update.

[0030] As P(k+n) → Ptarget, we have: ep(k+n) → 0, ΔI2(k+n) → 0, ΔD(k+n) → 0. The system eventually reaches steady state near the new duty cycle, and the supercapacitor maintains a charging power corresponding to the power difference on the power supply side, i.e., charging power = Ptarget - P(k) = 200 - 140 = 60W.

[0031] If the capacitor voltage enters the "charging threshold minus 0.5V limit range" during this process, it enters the "capacitor balancing mode". In each subsequent cycle, the charging direction reference current calculated by the outer power loop is limited by -15A <= I2(k) <= 0.001A, resulting in weak charging and normal discharging. Therefore, although the above process quantities are still calculated normally in each cycle, the charging reference value can only change within a very small range, and the capacitor voltage eventually rises and falls slightly around the limit voltage cycle by cycle, forming a cyclic hysteresis.

[0032] Scenario 2: The battery power is insufficient to support the load, requiring capacitor discharge. Before the disturbance occurs, it is assumed that the system has stabilized near the target power. Therefore, the reference current value I2(k-1) output by the outer power loop is basically stable, and the correction amount ΔD(k-1) of the inner current loop to the output duty is also approximately equal to 0. When the load power increases in the k-th cycle, the current power measured by the power supply side increases. For example, P(k) = 280W, Ptarget(k) = Ptarget(k-1) = 200W. The power error in this cycle becomes ep(k) = 200 - 280 = -80W, which is a negative error. The outer loop output I2(k) < I2(k-1). Then, the feedforward current value (I2(k) - I2(k-1)) * Ai of the inner current loop is negative. This negative increment is directly fed into the inner current loop as a real-time feedforward, causing the second current control factor to change immediately in the discharge direction in this cycle, without waiting for the actual current error to accumulate cycle by cycle. The second current control factor u2(k) = kp_i * ei(k) < u2(k-1) is calculated. Since I2(k) decreases relative to the previous cycle, both the current error and the second current control factor in this cycle decrease. The duty cycle increment is D(k) - D(k-1) = ΔD(k) = u2(k) + (I2(k) - I2(k-1)) * Ai < 0. Based on this, the FSBB establishes a current flowing from the supercapacitor side to the power bus side after the kth cycle, i.e., the supercapacitor begins to discharge.

[0033] After entering the (k+1)th cycle, the supercapacitor begins to bear part of the load power, and the current power required by the battery side decreases relative to the kth cycle, i.e., P(k+1) < P(k), while Ptarget(k+1) = Ptarget(k), so ep(k+1) > ep(k). At this time, ep(k+1) may still be negative, so the outer power loop still outputs a reference current in the discharge direction; however, the absolute value of the negative error has decreased, so the magnitude of the reference current change in the discharge direction decreases, i.e., |ΔI2(k+1)| < |ΔI2(k)|. Correspondingly, the absolute value of the negative feedforward of the inner current loop decreases, and the magnitude of the decrease in the second current control factor also decreases, so |ΔD(k+1)| < |ΔD(k)|. That is, the output duty is still adjusted in the discharge direction, but its rate of change decreases, the supercapacitor is still discharging, but the trend of enhanced discharge begins to weaken. If the load continues to increase, causing P(k+1) > P(k), then ep(k+1) < ep(k) < 0, and its absolute value increases. The negative feedforward effect of the inner current loop is enhanced, u2(k+1) decreases further, the absolute value of the negative value of ΔD(k+1) increases, output duty decreases further, and supercapacitor discharge is enhanced.

[0034] Therefore, the direction and trend of capacitor discharge under this operating condition can be summarized as follows: when ep < 0, the supercapacitor discharges; when ep < 0 and |ep| increases, the reference current output by the outer power loop further changes in the discharge direction, and the supercapacitor discharge is enhanced; when ep < 0 and |ep| decreases, the supercapacitor still discharges, but the discharge trend weakens; when |ep| decreases to 0 and ep = 0, the supercapacitor reaches equilibrium at this instant and does not charge or discharge; if |ep| crosses the zero point of ep and ep > 0, the supercapacitor changes from discharging and transient equilibrium to charging. The relationship between ep, |ep| and charging / discharging and their intensity can be analyzed by a completely symmetrical analogy.

[0035] Subsequently, under this operating condition, power sampling, power error calculation, reference current update, current loop operation, and duty cycle update are repeatedly performed in each cycle.

[0036] As the supercapacitor gradually takes on the increased power of the load, P(k+n) → Ptarget, then: ep(k+n)→0, ΔI2(k+n)→0, ΔD(k+n)→0. The system eventually reaches a steady state near the new duty cycle. The supercapacitor maintains a discharge power corresponding to the portion of the power supply exceeding the target power: P(k) - P(target) = 280 - 200 = 80W. Macroscopically, the battery continuously provides the target power of 200W, and the supercapacitor provides an additional 80W, together meeting the power demand of the load of 280W.

[0037] If the capacitor has entered the "charging threshold minus 0.5V" limit range when this process occurs, the system is in "capacitor balancing mode". In each subsequent cycle, the reference current output by the outer power loop is limited by -15A <= I2(k) <= 0.001A. Since this range still allows the reference current to change normally in the negative direction, the outer power loop can still reduce I2(k) after the load increases, the inner current loop can still form a negative feedforward current value and a negative ΔD(k), and the supercapacitor can still discharge normally. This also verifies that the "capacitor balancing mode" only limits high-current charging when the capacitor is fully charged, and does not limit normal discharge under this condition. After the supercapacitor discharges, its voltage decreases cycle by cycle. When the capacitor voltage leaves the "charging threshold minus 0.5V" limit range, the reference current output range of the outer power loop returns to -15A <= I2(k) <= +15A, and the system re-enters "set power mode" to continue performing complete bidirectional power closed-loop regulation.

[0038] Scenario 3: Power backflow occurs in the load, requiring charging of the capacitor. Before the disturbance occurs, it is assumed that the system has stabilized near the target power. Therefore, the reference value of the current output by the outer power loop I2(k-1) is basically stable, and the correction amount ΔD(k-1) of the inner current loop to the output duty is also approximately equal to 0. When the motor switches from normal energy consumption to braking and generating state in the k-th cycle, the load changes from absorbing energy from the bus to feeding energy back to the bus. The current power measured on the power supply side drops rapidly, even becoming negative, for example, P(k) = -100W, Ptarget(k) = Ptarget(k-1) = 200W. The power error in this cycle becomes ep(k) = 200 - (-100) = 300W, which is a positive error. The outer power loop outputs I2(k) > I2(k-1), so the feedforward current value of the inner current loop (I2(k) - I2(k-1)) * Ai > 0. This positive increment is directly fed forward into the inner current loop as a real-time feedforward quantity, causing the second current control factor to change immediately in the charging direction in this cycle, without having to wait for the actual charging current error to accumulate cycle by cycle.

[0039] The second current control factor u2(k) = kp_i*ei(k) > u2(k-1) is calculated. Since I2(k) increases relative to the previous cycle, the current error and the second current control factor both increase in this cycle. The duty cycle increment is D(k) - D(k-1) = ΔD(k) = u2(k) + (I2(k) - I2(k-1))*Ai > 0. Based on this, the FSBB establishes the current flowing from the common power bus side to the supercapacitor side after the kth cycle, that is, the supercapacitor begins to absorb the reverse power from the load and charge. After entering the (k+1)th cycle, the supercapacitor has begun to absorb some reverse power. The energy originally injected into the common bus is gradually transferred to the supercapacitor. Therefore, the current power measured on the power supply side begins to rise relative to the kth cycle, that is, P(k+1) > P(k), and at the same time, Ptarget(k+1) = Ptarget(k), then ep(k+1) < ep(k). At this point, ep(k+1) is still positive, so the outer power loop still outputs a reference current in the charging direction; however, the positive error has decreased, so the magnitude of the reference current change in the charging direction is reduced, i.e., |ΔI2(k+1)| < |ΔI2(k)|. Correspondingly, the positive feedforward of the inner current loop decreases, and the increase in the second current control factor also decreases, so ΔD(k+1) > 0. However, ΔD(k+1) < ΔD(k), meaning that the output duty still increases in the charging direction, but the rate of increase decreases. The supercapacitor is still charging, but the charging enhancement trend begins to weaken.

[0040] If the subsequent backflow power continues to increase, causing the current power measured on the power supply side to decrease further, then: P(k+1) < P(k), and I2(k+1) - I2(k) < 0, further increasing the positive error. The outer power loop will further increase I2(k+1), making I2(k+1 - I2(k)) < 0 and increasing its value. The positive feedforward effect of the inner current loop is enhanced, the second current control factor is further increased, the positive value of Δ increases, the output duty is further increased, and the supercapacitor charging is enhanced.

[0041] Therefore, the charging direction and trend of the capacitor under this operating condition can be summarized as follows: When ep > 0, the supercapacitor is charging, indicating that the load backflow is intensifying or the current power is further decreasing. The reference current output by the outer power loop changes further in the charging direction, and the supercapacitor charging is enhanced. When ep decreases, it indicates that the supercapacitor has absorbed some backflow power, or the load backflow is beginning to weaken. The supercapacitor is still charging, but the charging trend is weakening. Subsequently, power sampling, power error calculation, reference current update, current loop operation, and duty cycle update are repeatedly performed in each cycle. As the supercapacitor gradually absorbs backflow energy P(k+n) → P(target), ep(k+n) → 0, ΔI2(k+n) → 0, and ΔD(k+n) → 0.

[0042] The system eventually reaches a steady state near the new duty cycle. The supercapacitor maintains a charging power corresponding to the difference between the target power and the current power, i.e., the recovered charging power = Ptarget - P(k) = 300W. This includes 100W of backflow from the load to the bus, while the system still allows the power supply side to output 200W according to the target value. Macroscopically, the energy fed back to the bus by the brake motor and the energy provided by the power supply side according to the target power are transferred to the supercapacitor via the FSBB, thus preventing backflow energy from continuously raising the bus voltage or causing reverse impact on the battery and other parallel devices.

[0043] Based on the above scenario overview, the supercapacitor charging and discharging control provided in this application will be described in detail below. Please refer to the following embodiments for details.

[0044] Example 1 This application provides a supercapacitor charging and discharging control method, including as follows: Figure 1 The steps shown are as follows: S1: Obtain the current power p(k). The current power is the current output power of the battery. The value of k is a positive integer.

[0045] In this embodiment of the application, the battery voltage Vbat, battery current Ibat, capacitor voltage Vcap, capacitor current Icap, inductor current IL, load voltage Vload, and load current Iload are also obtained.

[0046] In this application, the battery voltage Vbat, battery current Ibat, capacitor voltage Vcap, capacitor current Icap, inductor current IL, load voltage Vload, and load current Iload are obtained by obtaining the original values ​​of the analog-to-digital converter (ADC) and then by the following calculation formula (1): physical value = (ADC value / 4096) × 3.3V × voltage division ratio / gain offset.

[0047] Among them, the physical values ​​represent the battery voltage Vbat, battery current Ibat, capacitor voltage Vcap, capacitor current Icap, inductor current IL, load voltage Vload, and load current Iload; the ADC value represents the original value of the ADC; the voltage division ratio represents the proportion by which the high voltage is reduced to the 0~3.3V range by using two resistors in series to divide the voltage; the gain represents the factor by which the voltage signal is amplified by the operational amplifier using the sampling resistor; and the offset represents the error in the ADC reading a small value when the input signal is 0.

[0048] The current power p(k) is calculated based on the battery voltage and battery current, i.e., p(k) = battery voltage × battery current.

[0049] S2: Determine whether the power difference between the target power and the current power p(k) is equal to 0.

[0050] Optionally, the target power is the battery's rated power, or it can be a set target value. The target power can be explicitly set by transmitting the target to the controller required by this patent via CAN communication from a higher-level controller board outside the system. It is adjustable in real time and can correspond to different scenarios in reality. For example, the higher-level controller, as the host computer, sends the real-time set battery power to the system required by this patent based on the battery's charge level, and this system, as the slave computer, completes the target.

[0051] Specifically, the formula for calculating the power difference is: ep = p² - p(k) Where ep is the power difference between the target power and the current power p(k), p2 is the target power, and p(k) is the current power.

[0052] If the power difference between the target power and the current power p(k) is equal to 0, then the circuit maintains its current operating state.

[0053] S3: If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power through the power loop algorithm; when k=1, I(k-1)=0.

[0054] Optionally, step S3 includes: Based on the power difference and the first adjustment coefficient, the current first current control factor u1(k) is obtained. Specifically, the formula for calculating the first current control factor u1(k) is: u1(k) = Kp_p × ep Where Kp_p is the first adjustment coefficient, u1(k) is the current first current control factor u1(k), and ep is the power difference between the target power and the current power p(k).

[0055] Based on the current first current control factor u1(k) and the previous round's first current control factor u1(k-1), the current first current increment is obtained; when k=1, u1(k-1)=0.

[0056] The formula for calculating the first current increment is: ΔI = u1(k) – u1(k-1) Wherein, ΔI is the current first current increment, u1(k) is the current first current control factor, and u1(k-1) is the first current control factor u1(k-1) of the previous round.

[0057] Based on the current first current increment and the previous iteration current I(k-1), the current reference value I(k) is obtained.

[0058] Optionally, the calculation formula is: I(k) = I(k-1) + ΔI = I(k-1) + (u1(k) – u1(k-1)) where I(k) is the current reference value of the current, I(k-1) is the current of the previous iteration, and ΔI is the current increment of the first current.

[0059] S4: Adjust the reference current I(k) at the capacitor terminal based on the mode constraint conditions to obtain the constrained reference current.

[0060] As an optional implementation, before step S4, the supercapacitor charging and discharging control method further includes: determining whether it is a charging mode or a discharging mode. After determining whether it is a charging mode or a discharging mode, the reference current I(k) at the capacitor terminal is adjusted based on the mode constraint conditions to obtain the constrained reference current.

[0061] Optionally, the charging or discharging mode can be established based on whether the power mode or capacitor balancing mode is set.

[0062] In this embodiment, the charging mode indicates that the controller allows the inductor current to be adjusted in a direction that favors the supercapacitor's energy absorption (capacitor charging). The system is allowed to enter this mode when the supercapacitor voltage has not reached the set upper limit. The discharging mode indicates that the controller allows the inductor current to be adjusted in a direction that favors the supercapacitor's energy release (capacitor discharging). The system is allowed to enter this mode when the supercapacitor voltage has not reached the set lower limit. The set power mode indicates that the controller performs a complete loop operation of outer power loop → inner current loop → physical duty cycle adjustment, normally closing the loop for the target power, and automatically charging or discharging the capacitor based on the sign of the power error ep. The system is in this mode when the supercapacitor voltage has not reached the charging threshold. The capacitor balancing mode indicates that when the supercapacitor voltage enters the range of the charging threshold minus 0.5V, the controller limits the output range of the outer power loop to the reference current to -15A to 0.001A. This mode is only used when balancing the voltage of the capacitor after it is fully charged, allowing weak positive charging and normal discharging.

[0063] As an optional implementation method, the specific way to determine whether it is a charging mode or a discharging mode is as follows: If the target power is greater than the current power, determine whether to enter charging or discharging mode. If the target power is less than the current power, determine whether to enter charging mode.

[0064] As another optional implementation, the specific method for obtaining the current voltage of the capacitor and determining whether it is in charging or discharging mode is as follows: Get the current voltage of the capacitor.

[0065] If the current voltage of the capacitor is less than the charging limit voltage, it is determined to be in charging mode; if the current voltage of the capacitor is greater than the discharging limit voltage, it is determined to be in discharging mode.

[0066] Optionally, the specific method for determining whether to set the power mode or capacitor equalization mode is as follows: If the current voltage of the supercapacitor is less than the charging threshold minus 0.5V, it is determined to be in power setting mode; if the current voltage of the supercapacitor falls within the charging threshold minus 0.5V range, it is determined to be in capacitor balancing mode. Specifically, this includes: obtaining the current voltage of the capacitor. If the current voltage of the capacitor is less than the charging threshold minus 0.5V, it is determined to be in power setting mode; if the current voltage of the capacitor is greater than or equal to the charging threshold minus 0.5V, it is determined to be in capacitor balancing mode.

[0067] As another optional implementation method, the specific way to determine whether it is a charging mode or a discharging mode is as follows: The controller detects that the actual power is lower than the target power, indicating that the battery still has remaining power supply capacity, thus confirming the charging mode. Specifically: Assume the system is set to a target battery output power of 120W. At this time, the robot is in a stable driving state with a relatively small actual load. Initially, the battery's actual output power is only 80W. The controller detects in real time that the actual battery power is 80W, while the target battery power is 120W. Since the actual power is lower than the target power, it indicates that the battery still has remaining power supply capacity.

[0068] The controller calculates the power error: target battery power 120W - actual battery power 80W = 40W. Then, the power loop controller gradually increases the inductor current reference value, causing the bidirectional Buck-Boost converter (control unit) to draw more energy from the battery and store the excess energy in the supercapacitor. As the control process continues, the battery output power gradually increases from 80W to 120W. Upon final stabilization: the battery output power remains at 120W; the load consumes 80W; and the remaining 40W automatically flows into the supercapacitor. Throughout this process, the controller does not need to know the actual power of the load; it can complete energy distribution solely through battery power feedback.

[0069] When the controller detects an increase in load, it determines that it is in discharge mode. Specifically, assume that the system's target battery output power is still set to 120W. The system was originally in a stable state, with the battery output power maintained at 120W.

[0070] The robot then suddenly accelerated, rapidly increasing its load demand. Due to the increased load, a large amount of energy was consumed from the bus, causing the actual output power of the battery to begin to decrease. The controller detected that the actual battery power was 100W, while the target battery power was 120W.

[0071] At this point, the actual battery power deviates from the target battery power by 20W. To restore the battery output power to the target value, the controller changes the direction of the inductor current, causing the supercapacitor to release energy to the bus. As the discharge process continues, the bus receives additional energy support, and the system gradually returns to balance.

[0072] Upon final stabilization: Battery output power returns to 120W; the supercapacitor provides additional energy output; the load receives the required power. The controller never measures the load power, relying solely on battery power deviation for automatic discharge control. When the controller detects braking feedback, it determines it's in charging mode. Assume the system's target battery output power is set to 120W. When the robot brakes, the drive motor enters generator mode, feeding energy back to the DC bus. This feedback energy causes a rapid decrease in the battery's actual output power. The controller detects: actual battery power = 60W, target battery power = 120W. This indicates an additional energy source in the system. The controller automatically increases the supercapacitor's charging current, causing the bidirectional Buck-Boost converter to transfer the feedback energy to the supercapacitor. As the control process continues, excess energy is continuously absorbed. At this point, the battery output power remains near the target range; the feedback energy is stored in the supercapacitor; and the bus voltage remains stable. Throughout the entire process, there's no need to detect the feedback power or load power; energy recovery control is automatically completed solely through battery power feedback.

[0073] In this embodiment of the application, adjusting the reference current I(k) at the capacitor terminal based on mode constraint conditions to obtain the constrained reference current I2(k) includes: If it is in charging mode, determine whether I(k) is within the range of [-15A, 15A]. If I(k) is within the range of [-15A, 15A], the limited reference current I2(k) is equal to the reference current I(k). If I(k) < -15A, the limited reference current I2(k) is equal to -15A. If I(k) > 15A, the limited reference current I2(k) is equal to 15A.

[0074] If it is in discharge mode, determine whether I(k) is within the range of [-15A, 0.001A]. If I(k) is within the range of [-15A, 0.001A], the limited reference current I2(k) is equal to the reference current I(k). If I(k) < -15A, the limited reference current I2(k) is equal to -15A. If I(k) > 0.001A, the limited reference current I2(k) is equal to 0.001A.

[0075] S5: The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the limited reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration.

[0076] Specifically, step S5 includes: Obtain the inductor current of the control unit. Preferably, obtain the average inductor current of the control unit, which is obtained by sampling the inductor current through a resistor after capacitor filtering.

[0077] The calculation formula is based on the current difference between the limited reference current and the inductor current of the control unit: ei=I2(k)–IL Where ei is the current difference, I2(k) is the reference current after limitation, and IL is the inductor current of the control unit.

[0078] Based on the current difference and the second adjustment coefficient, the current second current control factor u2(k) is obtained, and the calculation formula is as follows: u2(k) = Kp_i × ei Where u2(k) is the current second current control factor, Kp_i is the second adjustment coefficient, and ei is the current difference.

[0079] Based on the current second current control factor u2(k) and the previous round's second current control factor u2(k-1), the current second current increment is obtained; when k=1, u2(k-1)=0.

[0080] As an optional implementation method, the formula for calculating the current second current increment is: ΔDpid=u2(k)-u2(k-1) As another optional implementation method, the formula for calculating the current second current increment is: ΔDpid=u2(k) Where ΔDpid is the second current increment, u2(k) is the current second current control factor, and u2(k-1) is the second current control factor of the previous round.

[0081] The feedforward current value is obtained based on the limited reference current I2(k), the previous limited reference current I2(k-1), and the feedforward coefficient.

[0082] The formula for calculating the feedforward current value is: Feedforward current value = (I2(k) – I2(k-1)) × Ai Where I2(k) is the reference current after limitation, I2(k-1) is the reference current after limitation in the previous round, and Ai is the feedforward coefficient.

[0083] Based on the feedforward current value, the current second current increment, and the duty cycle of the previous iteration, the current total duty cycle of the control unit is obtained; when k=1, the duty cycle of the previous iteration is equal to 0.

[0084] The formula for calculating the current total duty cycle of the control unit is: Dtotal(k) = Dtotal(k-1) + ΔDpid + feedforward current value.

[0085] Where Dtotal(k) is the current duty cycle, Dtotal(k-1) is the total duty cycle of the previous iteration, and ΔDpid is the current second current increment. The current total duty cycle ranges from 0.05 to 1.8.

[0086] S6: Charge or discharge the capacitor once based on the total duty cycle.

[0087] As an optional implementation, charging or discharging the capacitor once based on the total duty cycle includes: The total duty cycle is mapped to obtain the duty cycles of the left and right bridge arms of the control unit.

[0088] The supercapacitor is charged or discharged once based on the duty cycle of the left and right bridge arms.

[0089] As an optional implementation, mode mapping is performed on the total duty cycle to obtain the duty cycles of the left and right bridge arms of the control unit, including: Based on the current duty cycle, if the current duty cycle is less than 1, the duty cycle of the left bridge arm is equal to the current duty cycle, and the duty cycle of the right bridge arm is equal to 0.95.

[0090] Based on the current duty cycle, if the current duty cycle is greater than 1, the duty cycle of the left bridge arm is equal to 0.95, and the duty cycle of the right bridge arm is equal to the reciprocal of the current duty cycle.

[0091] As an optional implementation, the supercapacitor is charged or discharged once based on the duty cycle of the left and right bridge arms, including: Based on the duty cycle of the left and right bridge arms, the duty cycles of the left and right bridge arms are mapped to the comparison values ​​of the HRTIM comparison register and written into the corresponding comparison register unit of the HRTIM.

[0092] Configure HRTIM to center-aligned counting mode, generate symmetrical triangular waves through bidirectional counters, and generate four center-aligned PWM output signals during comparison matching.

[0093] The four center-aligned PWM signals drive the four power switching transistors of the FSBB, controlling the on-time and duty cycle of each transistor to achieve one-time charging or discharging control of the supercapacitor.

[0094] In the embodiments of this application, S1 to S6 are the controller performing a charging or discharging operation once. In practical applications, multiple iterations and multiple charging or discharging operations are required to achieve the accumulation of quantitative changes.

[0095] In this embodiment, if it is in charging mode, and the current voltage of the capacitor is less than the charging limit voltage, after executing t=k, k=t+1, the previous iteration current I(k-1) = the current reference current I(t), and the operations of S1~S6 are executed to charge the capacitor; t is the iteration replacement variable.

[0096] Optionally, charging is stopped if the current voltage of the capacitor is greater than or equal to the charging limit voltage. Alternatively, if the current voltage of the capacitor is greater than or equal to the charging limit voltage (but outside the limit voltage range of -15A, +15A), weak forward charging and normal discharging of the capacitor are permitted, ultimately causing the capacitor voltage to hysteresis on a microscopic scale around the "charging threshold -0.5V" and stabilize on a macroscopic scale near the "charging threshold -0.5V". The overvoltage discharge logic is based on this model, with no substantial changes.

[0097] If it is in discharge mode, if the current voltage of the capacitor is greater than the discharge limit voltage, execute t=k, k=t+1, the previous iteration current I(k-1)=the current reference current I(t), execute the S1~S6 operations to discharge the capacitor; t is the iteration replacement variable; if the current voltage of the capacitor is less than or equal to the discharge limit voltage (the current voltage of the capacitor is outside the limit voltage range (-15A, +0.001A)), stop discharging.

[0098] Optionally, in power mode, if the current voltage of the capacitor is less than the charging threshold minus 0.5V, execute t=k, k=t+1, and the previous iteration current I(k-1) equals the current reference current I(t). Then execute operations S1~S6 to charge the capacitor; t is the iteration replacement variable. If the current voltage of the capacitor is greater than or equal to the charging threshold minus 0.5V, switch to capacitor balancing mode. In capacitor balancing mode, if the current voltage of the capacitor is greater than or equal to the charging threshold minus 0.5V, execute t=k, k=t+1, and the previous iteration current I(k-1) equals the current reference current I(t). Then execute operations S1~S6 to limit the reference current output range to -15A to 0.001A to balance the capacitor voltage; t is the iteration replacement variable. If the current voltage of the capacitor is less than the charging threshold minus 0.5V, switch to power mode.

[0099] In summary, the three examples above correspond to three typical operating conditions: charging (excess power storage), discharging (power replenishment), and energy feedback (regenerative braking). All conditions employ the same dual-loop control strategy (power outer loop + current inner loop), automatically achieving constant battery power, capacitor energy buffering, and regenerative braking without switching control targets or requiring an independent voltage loop. The controller continuously and smoothly controls the magnitude and direction of the inductor current by adjusting the duty cycle of the FSBB converter, thereby precisely managing the power flow.

[0100] In actual operation, the controller does not need to detect or calculate load power, nor does it need to establish a load model. The feedback quantities actually used by the controller mainly include battery voltage, battery current, capacitor voltage, and inductor current. Among them, battery power is obtained by real-time calculation of battery voltage and battery current.

[0101] Therefore, from the perspective of control implementation, the present invention is not based on load power feedback for control, but on battery power feedback for control.

[0102] The control objective of this application is not to control load power, but rather to control battery power. The system pre-sets a target battery power value, and by real-time monitoring of the actual battery power and calculating the deviation between the two, automatically adjusts the inductor current in the bidirectional Buck-Boost converter, thereby achieving supercapacitor charging and discharging control. Regardless of changes in the external load, the controller's primary control objective is to maintain the battery power close to the target value. Therefore, from a control principle perspective, this invention is closer to "battery power closed-loop control" than traditional "load power management" or "bus power management."

[0103] In the control logic of this application embodiment, the charging mode is mainly used to define the adjustment direction of the controller and the direction of change of the current reference value. In this mode, the controller allows the inductor current to be adjusted in a direction that is conducive to the supercapacitor absorbing energy. When the supercapacitor voltage does not reach the set upper limit, the system is allowed to enter this mode. The discharging mode is mainly used to define the adjustment direction of the controller and the direction of change of the current reference value. In this mode, the controller allows the inductor current to be adjusted in a direction that is conducive to the supercapacitor releasing energy. As for the set power mode and capacitor balancing mode, the set power mode is mainly used to perform complete bidirectional power closed-loop regulation. Its adjustment direction and the direction of change of the current reference value are determined by the power error ep. When ep>0, the capacitor charges; when ep<0, the capacitor discharges. The controller does not need to manually switch between charging and discharging. When the supercapacitor voltage does not reach the limit range of the charging threshold minus 0.5V, the system is in this mode.

[0104] Capacitor Balancing Mode: This mode is used only for voltage balancing after the capacitor is fully charged. When the supercapacitor voltage enters the charging threshold minus 0.5V, the reference current output range of the outer power loop is limited to -15A to 0.001A, allowing only weak forward charging and normal discharging, causing the capacitor voltage to hysteresis around the limit voltage. When the capacitor voltage leaves this limit range, the system re-enters the set power mode. The system is allowed to enter this mode when the supercapacitor voltage has not reached the set lower limit.

[0105] Therefore, the technical solution of this application can achieve the following technical effects: 1. Constant power charging stage: The battery outputs a constant power Pbat_max, and the load consumes the remaining power to charge the capacitor, causing the capacitor voltage to gradually rise.

[0106] 2. Automatic behavior when approaching the upper limit: If the load power remains constant, Pcap is approximately constant, then Icap = Pcap / Vcap, and the current automatically decreases as the voltage increases. The current command Icmp output from the outer loop directly determines Icap, so Icmp will automatically decrease and eventually approach zero, achieving "floating charge" voltage regulation.

[0107] 3. Slight overshoot self-recovery: If the capacitor voltage is slightly higher than the balance point, the power loop will make the current command negative (discharge) and automatically pull the voltage back.

[0108] Advantages: No voltage loop, no mode switching, no switching shock, sacrificing slight regulation accuracy (such as ±0.5V) in exchange for extremely fast response and extremely simple structure.

[0109] The following describes examples of charging or discharging in three scenarios: charging when available power (load power < battery available power), discharging when limited power (load power > battery limited power), and motor braking regenerative charging (load power is negative).

[0110] Example 2: Charging when available power (load power < battery available power) When the robot moves at a constant speed on flat ground, the drive motor consumes 80W of power. The maximum output power allowed by the battery management system is 120W, i.e., the target power p2 = 120W. At this time, the load power is lower than the battery's available power, and the excess 40W of energy needs to be stored in the supercapacitor.

[0111] The controller measures the following using a three-terminal current sensor: battery current Ibat = 3.33A, battery voltage Vbat = 24V, and inductor current IL = 0A. The current battery power p(k) is calculated as: Vbat × Ibat = 24V × 3.33A ≈ 80W. At this time, the capacitor voltage Vcap and capacitor current Icap are V = P2 / Ibat = 120W / 3.33 = 36V.

[0112] Error: ep = p² - p(k) = 120W - 80W = 40W Since the current power is less than the target power, it indicates that the battery still has remaining energy supply capacity. To bring the current power to the target power, the excess 40W of energy needs to be stored in the supercapacitor, confirming that it is in charging mode.

[0113] The power difference between the target power and the current power is not equal to 0. Based on the target power and the current power, the power loop algorithm is used to obtain the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal. When k=1, I(k-1)=0.

[0114] When k=1: Set the first adjustment coefficient Kp_p=0.0002.

[0115] Based on the power difference and the first adjustment coefficient, the current first current control factor u1(k) is obtained. The calculation process is as follows: u1(k)=Kp_p×ep=0.0002×40=0.008 Assuming the first current control factor in the previous round is equal to 0, i.e., u1(k-1) = 0, based on the current first current control factor u1(k) and the previous round's first current control factor u1(k-1), the current first current increment is obtained, and the calculation process is as follows: ΔI=u1(k)–u1(k-1)=0.008-0=0.008 Assuming the previous iteration current I(k-1) = 0, based on the current first current increment and the previous iteration current I(k-1), the current reference value I(k) is obtained. The calculation process is as follows: I(k)=I(k-1)+ΔI=0+(0.008-0)=0.008 The reference current I(k) at the capacitor terminal is adjusted based on the mode constraint conditions to obtain the constrained reference current.

[0116] In charging mode, I(k) = 0.008A is in the range of [0, 15A]. The limited reference current I2(k) is equal to the reference current I(k), that is, I2(k) = I(k) = 0.008A.

[0117] The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the constrained reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration.

[0118] The calculation process is as follows, based on the current difference between the limited reference current I2(k) and the inductor current IL of the control unit: ei=I2(k)–IL=0.008A-0A=0.008A.

[0119] Set the second adjustment coefficient Kp_i = 0.000013.

[0120] Based on the current difference and the second adjustment coefficient, the current second current control factor u2(k) is obtained. The calculation process is as follows: u2(k)=Kp_i×ei=0.000013×0.008≈1.04×10^-7 Set Ai=0.123.

[0121] Based on the constrained reference current I2(k), the previous constrained reference current I2(k-1), and the feedforward coefficient Ai, the feedforward current value is obtained. The calculation process is as follows: Feedforward current value = (I2(k) – I2(k-1)) × Ai = 0.008 × 0.123 = 9.84 × 10^-4 Assume that the second current control factor u2(k-1) of the previous round is 0.

[0122] The current second current increment is obtained based on the current second current control factor u2(k) and the previous round's second current control factor u2(k-1); the calculation process is as follows: ΔDpid=u2(k)-u2(k-1)=1.04×10^-7 Each increment of the current second current is accumulated to obtain a tiny increment.

[0123] The duty cycle Dtotal(k-1) of the previous iteration is the initial duty cycle Dtotal, which is the ratio of capacitor voltage to battery voltage. The calculation process is as follows: Dtotal(k-1) = Initial duty cycle Dtotal = Vcap / Vbat = 24V / 24V = 1.0 Based on the feedforward current value, the current second current increment, and the duty cycle of the previous iteration, the current duty cycle of the control unit is obtained. The total duty cycle is obtained by adding the previous Dtotal(k-1) and the small increment. The calculation process is as follows: Dtotal(k) = Dtotal(k-1) + ΔDpid + feedforward current value = 1 + 9.84 × 10^-4 + 9.84 × 10^-4 ≈ 1.000984 Mode mapping is performed on the total duty cycle to obtain the duty cycles of the left and right bridge arms of the control unit, including: Based on the current duty cycle Dtotal=1.000984 being greater than 1, the duty cycle of the left bridge arm is equal to 0.95, and the duty cycle of the right bridge arm is equal to the reciprocal of the current duty cycle.

[0124] As the current duty cycle Dtotal gradually increases, the duty cycle of the right bridge arm decreases, the inductor current increases in the positive direction, and the capacitor begins to charge.

[0125] After thousands of cycles (approximately 0.1 seconds), the actual battery power gradually increases to 120W. At this point, the reference current I(k) = (p2 – p(k)) / Vbat = (120W - 80W) / 24V ≈ 1.67A. The inductor current IL follows the reference current I(k), and the capacitor charges at approximately 1.67A, stabilizing the battery output power at 120W. The load consumes 80W, with the excess 40W automatically stored in the supercapacitor. The capacitor voltage slowly rises from 24V, and the charging current automatically adjusts as the voltage increases.

[0126] Example 3: Discharging at the limit power (load power > battery limit power) The robot suddenly accelerated uphill, causing the drive motor's power demand to jump to 180W. The battery's maximum allowable output remained at 120W, meaning the target power was p2 = 120W.

[0127] Based on Implementation Case 1, when the robot is moving at a constant speed on flat ground and the system is in a stable state: battery current Ibat = 1.6A, battery voltage Vbat = 25V, and inductor current IL = 1.6A.

[0128] In the instant of a sudden load change: the load power jumps from 80W to 180W, and the battery output cannot change in time (i.e., target power p2=120W, load power p3=180W). The 60W power deficit causes the battery voltage to drop, and the battery output current will temporarily decrease due to the lower voltage caused by the load. Assume that the current power p(k) is detected to have dropped to 110W. The error ep=p2-p(k)=120W-110W=10W.

[0129] Because of the inherent internal resistance of the battery, a sudden increase in load and a tendency for the short-term current to rise will cause the output current to increase. The larger the output current, the greater the voltage drop due to the internal resistance, which will pull down the output voltage of the battery terminal and cause the current power of the battery to decrease. In order to make the current power reach the target power, the capacitor needs to release energy to the bus, which determines that it is in discharge mode.

[0130] If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power using the power loop algorithm; when k=1, I(k-1)=0.

[0131] When k=1: Set the first adjustment factor Kp_p = 0.0002.

[0132] Based on the power difference and the first adjustment coefficient, the current first current control factor u1(k) is obtained. The calculation process is as follows: u1(k)=Kp_p×ep=0.0002×10=0.002 When the load is too large, the battery power will be lower than the target, the outer loop output is positive, but in the discharge mode, I(k)=-u1(k) is executed, which reduces the reference current.

[0133] Based on implementation case 1, after multiple iterations, the inductor current IL follows the reference current I(k), and the first current control factor u1(k) approaches 0. It is assumed that the second current control factor u(k-1) of the previous round is 0.

[0134] Based on the current first current control factor u1(k) and the previous round's first current control factor u1(k-1), the current first current increment is obtained, and the calculation process is as follows: ΔI=u1(k)–u1(k-1)=0.002-0=-0.002 Based on the measured inductor current of IL = 1.54A when the system is in a steady state, the previous iteration current I(k-1) = 1.6A was obtained. In discharge mode: I(k)=I(k-1)+ΔI=1.6A-0.002A=1.598A The reference current I2(k) at the capacitor terminal is adjusted based on the mode constraint conditions to obtain the constrained reference current.

[0135] In discharge mode, the reference current is limited to the range of [-15A, 0.001A]. The current reference current I(k) = 1.598A is greater than 0.001A, so the reference current at the capacitor terminal is adjusted to I2(k) = 0.001A.

[0136] The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the constrained reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. The calculation process is as follows, based on the current difference between the limited reference current and the inductor current of the control unit: ei=I2(k)–IL=0.001A-1.6A=-1.6A.

[0137] Set the second adjustment coefficient Kp_i = 0.000013.

[0138] Based on the current difference and the second adjustment coefficient, the current second current control factor u2(k) is obtained. The calculation process is as follows: u2(k)=Kp_i×ei=0.000013×(-1.6)≈-2.08×10^-5 Based on the constrained reference current I2(k), the previous constrained reference current I2(k-1), and the feedforward coefficient, the feedforward current value is obtained. The calculation process is as follows: Feedforward current value = (I²(k) – I²(k-1)) × Ai = -1.6A × 0.123 = -0.1968A The feedforward current value becomes negative as the reference current jumps from 1.6A to 0.

[0139] Based on the current second current control factor u2(k) and the previous round's second current control factor u2(k-1), the current second current increment is obtained; the calculation process is as follows: ΔDpid=u2(k)-u2(k-1)=-2.08×10^-5-0=-0.1917778 Each increase in the second current is summed to obtain a small increment, which is a negative number.

[0140] Based on implementation case 2, the duty cycle Dtotal(k-1) of the previous iteration was greater than 1.

[0141] Based on the feedforward current value, the current second current increment, and the duty cycle of the previous iteration, the current duty cycle of the control unit is obtained. The total duty cycle is obtained by adding the previous Dtotal(k-1) and the small increment, as shown in the following formula: Dtotal(k) = Dtotal(k-1) + ΔDpid + feedforward current value Because the small increment is negative and the feedforward current value is also negative, the current duty cycle Dtotal drops rapidly from about 1.0, making the current duty cycle Dtotal less than 1.

[0142] Mode mapping is performed on the total duty cycle to obtain the duty cycles of the left and right bridge arms of the control unit, including: Based on the current duty cycle Dtotal being less than 1, the duty cycle of the left bridge arm is equal to the current duty cycle, and the duty cycle of the right bridge arm is equal to 0.95.

[0143] At this point, the inductor current flows from the capacitor to the bus, and the capacitor begins to discharge.

[0144] The capacitor discharge current gradually increases to compensate for the load shortfall. Upon stabilization, the battery output power remains constant at 120W. The capacitor automatically discharges to compensate for the load shortfall, discharging 2.4A (approximately 60W). The capacitor voltage begins to decrease slowly from 25V.

[0145] Implementation Case 4: Motor Braking Regenerative Charging (Negative Load Power) When the robot goes downhill or brakes suddenly, the motor is driven to act as a generator, feeding back 50W of power. In the first cycle after braking, the battery output hasn't changed, but the fed-back energy increases the bus voltage, causing a decrease in the actual battery output current. This is because some of the fed-back energy directly offsets the battery output, resulting in a detected decrease in p(k). Assume p(k) = 100W is detected.

[0146] Steady-state condition before braking: Battery output p(k) = p2 = 120W, load consumption 80W, capacitor charging 40W. Battery voltage Vbat = 26V, inductor current IL = 1.54A. At the moment of braking: the load power jumps from +80W to -50W (current direction reverses).

[0147] Error: ep = p² - p(k) = 120W - 100W = 20W Because the feedback energy increases the bus voltage, the actual output current of the battery decreases, resulting in a drop in the current power of the battery. In order to make the current power reach the target power, the output energy of the battery needs to be stored in the supercapacitor to determine the charging mode.

[0148] If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power using the power loop algorithm; when k=1, I(k-1)=0; When k=1: Set the first adjustment factor Kp_p = 0.0002.

[0149] Based on the power difference and the first adjustment coefficient, the current first current control factor u1(k) is obtained. The calculation process is as follows: u1(k)=Kp_p×ep=0.0002×20=0.004 Based on implementation case 2, after multiple iterations, the inductor current IL follows the reference current I(k), and the second current control factor u2(k) approaches 0. It is assumed that the second current control factor u2(k-1) in the previous round is 0.

[0150] Based on the current first current control factor u1(k) and the previous round's first current control factor u1(k-1), the current first current increment is obtained, and the calculation process is as follows: ΔI=u1(k)–u1(k-1)=0.004-0=0.004 Based on the steady state before braking, the measured inductor current is IL = 1.54A, and the previous iteration current I(k-1) = 1.54A is obtained.

[0151] Based on the current first current increment and the previous iteration current I(k-1), the current reference value I(k) is obtained. The calculation process is as follows: I(k)=I(k-1)+ΔI=1.54A+0.004A=1.544A The reference current I(k) at the capacitor terminal is adjusted based on the mode constraint conditions to obtain the constrained reference current; In charging mode, I(k) = 1.544A in the range of [0, 15A]. The limited reference current I2(k) is equal to the reference current I(k), that is, I2(k) = I(k) = 1.544A.

[0152] The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the constrained reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. The calculation process is as follows: The difference between the limited reference current and the inductor current of the control unit is used as the basis for the calculation. ei=I2(k)–IL=1.544A-1.54A=0.004A.

[0153] Set the second adjustment coefficient Kp_i = 0.000013.

[0154] Based on the current difference and the second adjustment coefficient, the current second current control factor u2(k) is obtained. The calculation process is as follows: u2(k)=Kp_i×ei=0.000013×0.004≈5.02×10^-8 Based on the current second current control factor u2(k) and the previous round's second current control factor u2(k-1), the current second current increment is obtained; the calculation process is as follows: ΔDpid=u2(k)-u2(k-1)=5.020×10^-8 Set the feedforward coefficient Ai = 0.123.

[0155] Based on the constrained reference current I2(k), the previous constrained reference current I2(k-1), and the feedforward coefficient, the feedforward current value is obtained, and the calculation formula is as follows: Feedforward current value = (I2(k) – I2(k-1)) × Ai = (1.544A - 1.54A) × 0.123 = 4.92 × 10^-4 The incremental value is obtained by summing the values ​​of each second current increase.

[0156] Based on implementation case 2, the duty cycle Dtotal(k-1) of the previous iteration was less than 1.

[0157] Based on the feedforward current value, the current second current increment, and the duty cycle of the previous iteration, the current duty cycle of the control unit is obtained. The total duty cycle is obtained by adding the previous Dtotal(k-1) and the small increment, as shown in the following formula: Dtotal(k) = Dtotal(k-1) + ΔDpid + feedforward current value The total duty cycle is obtained by summing up each duty cycle increment. Since the current small increment and the feedforward current value are both positive, the total duty cycle Dtotal increases, resulting in a total duty cycle Dtotal greater than 1.

[0158] Mode mapping is performed on the total duty cycle to obtain the duty cycles of the left and right bridge arms of the control unit, including: Based on the current duty cycle Dtotal being greater than 1, the duty cycle of the left bridge arm is equal to 0.95, and the duty cycle of the right bridge arm is equal to the reciprocal of the current duty cycle.

[0159] As the current duty cycle Dtotal gradually increases, the duty cycle of the right bridge arm decreases, the inductor current increases in the positive direction, and the capacitor begins to charge.

[0160] Upon final stabilization, the battery outputs 120W, feeds back 50W, and the capacitor absorbs 170W. The capacitor current Icap = 6.54A, and the reference current also converges to this value. The capacitor voltage rises, but the battery output power remains at 120W, unaffected by the feedback energy surge. The motor's braking energy is completely absorbed by the supercapacitor. If the capacitor voltage rises to the upper limit of 29.5V, the system automatically reduces the charging current to achieve overvoltage protection.

[0161] In summary, the technical solution of this application solves the problems of inflexible power allocation, inability to absorb energy feedback, and slow dynamic response in existing low-voltage mobile platforms with limited input power and drastic load changes. It also avoids the additional computational delay and mode switching impact introduced by voltage loops in traditional solutions, achieving technical effects such as no voltage loop, no mode switching, no switching impact, extremely fast response, extremely simple structure, reduced cost, and energy saving. Specifically: Extremely simple control structure: only power loop + current loop, no voltage loop, no mode switching.

[0162] Extremely fast dynamic response: feedforward + dual loop, current step response <100μs.

[0163] Smooth output: The hybrid PID structure avoids abrupt changes in the control input.

[0164] Anti-integral saturation: Only applies to the final amplitude output, requiring no complex processing.

[0165] Parameters are adjustable in real time: Supports segmented PID control.

[0166] Automatic energy recovery: Braking energy is automatically absorbed by the capacitor.

[0167] In summary, traditional voltage loop solutions require mode switching (constant power → constant voltage), which may cause surges during the switching process and increases the complexity of PID tuning for the voltage loop. This invention employs a voltage loop-free design, achieving automatic voltage regulation through the inherent characteristics of the power loop, providing continuous control and improving response speed by approximately 30% to 50%.

[0168] Example 5 Based on the above-mentioned supercapacitor charging and discharging control method, this application provides a supercapacitor charging and discharging control system, which includes a battery, a load terminal, a capacitor terminal, and a controller.

[0169] Optionally, the battery is electrically connected to the load section (which may be a motor), and the capacitor is electrically connected to the battery and the load section respectively through the controller.

[0170] The controller is used to perform the following steps: S1: Obtain the current power p(k); the current power is the current output power of the battery; the value of k is a positive integer; S2: Determine whether the power difference between the target power and the current power p(k) is equal to 0; where the target power is the rated power of the battery; S3: If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power using the power loop algorithm; when k=1, I(k-1)=0; S4: Adjust the reference current I(k) at the capacitor terminal based on the mode constraint conditions to obtain the constrained reference current; S5: The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the limited reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. S6: Charge or discharge the capacitor once based on the total duty cycle.

[0171] In this embodiment, the control unit is a four-switch buck-boost converter.

[0172] In summary, traditional voltage loop solutions require mode switching (constant power → constant voltage), which may cause surges during the switching process and increases the complexity of PID tuning for the voltage loop. This application adopts a voltage loop-free design, achieving automatic voltage regulation through the inherent characteristics of the power loop, ensuring continuous control and improving response speed.

[0173] The supercapacitor charging and discharging control method and system provided in this invention are applicable to the charging and discharging management of supercapacitors in 24V battery-powered electric systems, such as robots used in the ROBOMASTER robotics competition, cordless vacuum cleaners, floor scrubbers, and robotic vacuum cleaners. They are particularly suitable for scenarios with limited input power, drastic load fluctuations, and bidirectional energy flow, such as when fans, roller brushes, and walking motors experience instantaneous high power during startup. Other applications include rapid load increases during carpet pressurization or roller brush stalling and recovery, where the battery or adapter output power is limited, and the supercapacitor compensates for peak loads by discharging. During light loads or when working back at the charging dock, the remaining power is used to charge the supercapacitor, and the walking motor absorbs some feedback energy during braking.

[0174] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0175] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0176] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0177] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0178] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0179] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the apparatus according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

Claims

1. A method for controlling the charging and discharging of a supercapacitor, characterized in that, The method includes: S1: Obtain the current power p(k); the current power is the current output power of the battery; the value of k is a positive integer; S2: Determine whether the power difference between the target power and the current power p(k) is equal to 0; S3: If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power using the power loop algorithm; when k=1, I(k-1)=0; S4: Adjust the reference current I(k) at the capacitor terminal based on the mode constraint conditions to obtain the constrained reference current; S5: The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the limited reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. S6: Charge or discharge the capacitor once based on the total duty cycle.

2. The supercapacitor charging and discharging control method according to claim 1, characterized in that, A single charge or discharge cycle of the capacitor is performed based on the total duty cycle, including: The total duty cycle is mapped to obtain the duty cycles of the left and right bridge arms of the control unit; The supercapacitor is charged or discharged once based on the duty cycle of the left and right bridge arms.

3. The supercapacitor charging and discharging control method according to claim 1, characterized in that, The power loop algorithm obtains the current reference current I(k) at the capacitor terminal and the previous iteration current I(k-1) based on the target power and the current power, including: Based on the power difference and the first adjustment coefficient, the current first current control factor u1(k) is obtained; Based on the current first current control factor u1(k) and the previous round's first current control factor u1(k-1), the current first current increment is obtained; when k=1, u1(k-1)=0; Based on the current first current increment and the previous iteration current I(k-1), the current reference value I(k) is obtained.

4. The supercapacitor charging and discharging control method according to claim 3, characterized in that, Prior to S4, the method further includes: Determine whether it is charging mode or discharging mode; The step of adjusting the reference current I(k) at the capacitor terminal based on mode constraints to obtain the constrained reference current includes: If it is in charging mode, determine whether I(k) is within the range of [-15A, 15A]; if I(k) is within the range of [-15A, 15A], the limited reference current is equal to the reference current I(k); if I(k) < -15A, the limited reference current is equal to -15A; if I(k) > 15A, the limited reference current is equal to 15A. If it is in discharge mode, determine whether I(k) is within the range of [-15A, 0.001A]. If I(k) is within the range of [-15A, 0.001A], the limited reference current is equal to the reference current I(k). If I(k) < -15A, the limited reference current is equal to -15A. If I(k) > 0.001A, the limited reference current is equal to 0.001A.

5. The supercapacitor charging and discharging control method according to claim 4, characterized in that, The method further includes: Get the current voltage of the capacitor.

6. The supercapacitor charging and discharging control method according to claim 5, characterized in that, The method further includes: If it is in charging mode, if the current voltage of the capacitor is less than the charging limit voltage, execute t=k, k=t+1, the previous iteration current I(k-1) = the current reference current I(t), execute the S1~S6 operations to charge the capacitor; t is the iteration replacement variable.

7. The supercapacitor charging and discharging control method according to claim 6, characterized in that, The method further includes: If it is in discharge mode, if the current voltage of the capacitor is greater than the discharge limit voltage, execute t=k, k=t+1, the previous iteration current I(k-1)=the current reference current I(t), execute the S1~S6 operations to discharge the capacitor; t is the iteration replacement variable; if the current voltage of the capacitor is less than or equal to the discharge limit voltage, stop discharging.

8. The supercapacitor charging and discharging control method according to claim 7, characterized in that, The overcurrent loop algorithm obtains the current total duty cycle of the control unit based on the constrained reference current, the inductor current of the control unit, and the previous iteration current I(k-1), including: Obtain the inductor current of the control unit; The current difference between the reference current after the limit is obtained and the inductor current of the control unit; Based on the current difference and the second adjustment coefficient, the current second current control factor u2(k) is obtained; Based on the current second current control factor u2(k) and the previous round's second current control factor u2(k-1), the current second current increment is obtained; when k=1, I2(k-1)=0; The feedforward current value is obtained based on the constrained reference current, the previous iteration current I(k-1), and the feedforward coefficients. Based on the feedforward current value, the current second current increment, and the duty cycle of the previous iteration, the current duty cycle of the control unit is obtained; when k=1, the duty cycle of the previous iteration is 0.

9. A supercapacitor charging and discharging control system, characterized in that, The system includes a battery, a load terminal, a capacitor terminal, and a controller, the controller being used to perform the following steps: S1: Obtain the current power p(k); the current power is the current output power of the battery; the value of k is a positive integer; S2: Determine whether the power difference between the target power and the current power p(k) is equal to 0; S3: If the power difference between the target power and the current power p(k) is greater than 0 or less than 0, the current reference current I(k) and the previous iteration current I(k-1) at the capacitor terminal are obtained based on the target power and the current power through the power loop algorithm. When k=1, I(k-1)=0; S4: Adjust the reference current I(k) at the capacitor terminal based on the mode constraint conditions to obtain the constrained reference current; S5: The current total duty cycle of the control unit is obtained by using the current loop algorithm based on the limited reference current, the inductor current of the control unit, and the current I(k-1) of the previous iteration. S6: Charge or discharge the capacitor once based on the total duty cycle.

10. The supercapacitor charging and discharging control system according to claim 9, characterized in that, The control unit is a four-switch buck-boost converter.