A digital power supply PID control method and device, formation and distribution equipment and medium

CN122553680APending Publication Date: 2026-08-11GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0005]本发明提供了一种数字电源PID控制方法、装置、化成分容设备及介质,解决了模拟环路参数固化、受温漂影响且控制逻辑单一的技术问题

Benefits of technology

[0016]从以上技术方案可以看出,本发明具有以下优点:本发明提供的一种数字电源PID控制方法、装置、化成分容设备及介质,其通过获取数字电源的当前工作模式以及电流环路的环路反馈数据和当前环路模式,并基于当前工作模式和环路模式,将环路反馈数据与预设阈值进行比较以实时切换环路模式,避免了模式切换过程中的电流或电压过冲,从而有效保护了电池和设备的安全;其次,根据切换后的环路模式,采用对应的外环PID控制计算电流内环目标值,实现了电压环与电流环的解耦与协同工作,提升了稳态精度;最后,通过电流内环PID控制,结合电流内环目标值和环路反馈数据中的实时电流值计算脉宽调制占空比并输出,使电流内环能够以更高的带宽快速抑制负载扰动和输入电压变化,显著提升了系统对电池化成过程中非线性、时变特性的适应能力。因此,本发明实现了PID控制的全数字化,可在线调整控制参数,从而提升了控制精度、长期稳定性以及模式切换的平滑可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122553680A_ABST
    Figure CN122553680A_ABST
Patent Text Reader

Abstract

The application discloses a kind of digital power supply PID control method, device, formation and medium of partial volume equipment, the method includes: obtaining the current working mode of digital power supply and the loop feedback data and current loop mode of current loop;In the current working mode, based on the current loop mode, the loop feedback data is compared with preset threshold value, and according to the comparison result, the current loop mode is switched;According to the current loop mode after switching, by corresponding outer loop PID control, the current inner loop target value is calculated based on the loop feedback data;By current inner loop PID control, according to the current inner loop target value and the loop feedback data, pulse width modulation duty cycle is calculated and is output for the present application can realize the full digitization of PID control, control parameters can be adjusted on line, thereby improve control precision, long-term stability and the smooth reliability of mode switching, can be widely applied in digital power supply control technical field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital power supply control technology, and in particular to a digital power supply PID control method, device, formation and capacity testing equipment, and medium. Background Technology

[0002] The formation and capacity testing processes for lithium-ion batteries place extremely high demands on the voltage and current control accuracy of the charging and discharging power supply, as well as the smoothness of constant current / constant voltage mode switching. Digital power supply PID control, with its advantages of programmable parameters and strong anti-interference capabilities, has been widely used in the field of general-purpose switching power supplies. However, in the power modules of formation and capacity testing equipment, loop control still mainly adopts analog methods.

[0003] The existing fractionation power module uses an analog control loop for loop control. The hardware circuit is built with analog electronic components such as operational amplifiers, resistors, capacitors, inductors, and comparators. PID regulation is achieved through an RC compensation network to control the output voltage and current.

[0004] However, the compensation parameters of the analog control loop are determined by the physical RC network, and once the parameters are fixed, they cannot be adjusted online. At the same time, analog components are susceptible to temperature drift and aging, which leads to a decrease in control accuracy and long-term stability. In addition, analog circuits are difficult to implement complex adaptive or nonlinear control algorithms. Summary of the Invention

[0005] This invention provides a digital power supply PID control method, device, formation and capacity testing equipment and medium, which solves the technical problems of fixed analog loop parameters, susceptibility to temperature drift and simple control logic.

[0006] In a first aspect, the present invention provides a digital power supply PID control method, comprising: Acquire the current operating mode of the digital power supply, as well as the loop feedback data and current loop mode of the current loop; In the current working mode, the loop feedback data is compared with a preset threshold based on the current loop mode, and the current loop mode is switched according to the comparison result; Based on the current loop mode after switching, the target value of the inner loop current is calculated based on the loop feedback data through the corresponding outer loop PID control. The pulse width modulation duty cycle is calculated and output based on the target value of the current inner loop and the loop feedback data through current inner loop PID control.

[0007] In some embodiments, the loop feedback data includes a current voltage sample value and a current current sample value. The step of comparing the loop feedback data with a preset threshold based on the current loop mode in the current operating mode, and switching the current loop mode according to the comparison result, includes: When the current operating mode is charging mode, if the current loop mode is constant current mode and the current voltage sample value is equal to or greater than the preset voltage upper limit threshold, then the current loop mode is switched to constant voltage mode. When the current operating mode is charging mode, if the current loop mode is constant voltage mode and the current current sampling value is equal to or greater than the preset current upper limit threshold, then the current loop mode is switched to constant current mode. When the current operating mode is discharge mode, if the current loop mode is constant current mode and the current voltage sample value is less than or equal to the preset voltage lower limit threshold, then the current loop mode is switched to constant voltage mode. When the current operating mode is discharge mode, if the current loop mode is constant voltage mode and the current current sampling value is less than or equal to the preset current lower limit threshold, then the current loop mode is switched to constant current mode.

[0008] In some embodiments, the outer-loop PID control includes voltage outer-loop PID control and current outer-loop PID control. The step of calculating the inner-loop current target value based on the loop feedback data using the corresponding outer-loop PID control according to the switched current loop mode includes: If the current loop mode after switching is constant voltage mode, then the target value of the current inner loop is calculated based on the current voltage sample value through voltage outer loop PID control. If the current loop mode after switching is constant current mode, then the target value of the current inner loop is calculated based on the current sample value through the current outer loop PID control.

[0009] In some embodiments, before performing the steps of comparing the loop feedback data with a preset threshold based on the current loop mode in the current operating mode, and switching the current loop mode according to the comparison result, the method further includes: Obtain the loop control enable signal; If the loop control enable signal is in an invalid state, a PID loop regulation prohibition command is generated; If the loop control enable signal is active, a PID loop regulation allow command is generated.

[0010] In some embodiments, switching the current loop mode based on the comparison result further includes: If the number of consecutive detections of mode switching failure signals reaches a preset number, the loop control enable signal will be set to an invalid state.

[0011] In some embodiments, the step of calculating and outputting the pulse width modulation duty cycle based on the current inner loop target value and the loop feedback data through current inner loop PID control includes: Obtain the current bus voltage of the digital power supply; The pulse width modulation duty cycle is calculated based on the target value of the current inner loop, the loop feedback data, and the current bus voltage through current inner loop PID control. The pulse width modulation duty cycle is output to adjust the voltage and current of the main circuit of the capacitor bank.

[0012] In some embodiments, the pulse width modulation duty cycle is calculated using the following formula: ; ; ; in, This is the output value of the inner loop PID control. This is the preset proportional coefficient for the inner loop PID control of the current. This is the preset integral coefficient for the current inner-loop PID control. This is the preset derivative coefficient for the current inner loop PID control. This represents the current inner loop error. For the first The inner loop error of the wheel's current. The value ranges from 1 to , This refers to the current inner loop error from the previous cycle. This is the current sampled value in the loop feedback data. This is the target value for the inner current loop. This is the current bus voltage. This refers to the duty cycle of pulse width modulation.

[0013] Secondly, the present invention provides a digital power supply PID control device for executing the above-mentioned digital power supply PID control method, comprising: The data acquisition module is used to acquire the current operating mode of the digital power supply, as well as the loop feedback data and current loop mode of the current loop. The mode switching module is used to compare the loop feedback data with a preset threshold based on the current loop mode in the current working mode, and switch the current loop mode according to the comparison result; The outer loop calculation module is used to calculate the target value of the inner loop current based on the loop feedback data through the corresponding outer loop PID control, according to the current loop mode after switching. The inner loop adjustment module is used to calculate and output the pulse width modulation duty cycle based on the target value of the current inner loop and the loop feedback data through current inner loop PID control.

[0014] Thirdly, the present invention provides a batching and capacity-setting device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described digital power supply PID control method.

[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the above-described digital power supply PID control method.

[0016] As can be seen from the above technical solutions, the present invention has the following advantages: The digital power supply PID control method, device, formation and capacity testing equipment, and medium provided by the present invention acquire the current operating mode of the digital power supply, the loop feedback data of the current loop, and the current loop mode. Based on the current operating mode and the loop mode, the loop feedback data is compared with a preset threshold to switch the loop mode in real time, avoiding current or voltage overshoot during mode switching, thereby effectively protecting the safety of the battery and equipment. Secondly, according to the switched loop mode, the corresponding outer loop PID control is used to calculate the target value of the inner current loop, realizing the decoupling and collaborative operation of the voltage loop and the current loop, improving steady-state accuracy. Finally, through the inner current loop PID control, the pulse width modulation duty cycle is calculated and output by combining the target value of the inner current loop and the real-time current value in the loop feedback data, enabling the inner current loop to quickly suppress load disturbances and input voltage changes with a higher bandwidth, significantly improving the system's adaptability to the nonlinear and time-varying characteristics during battery formation. Therefore, the present invention achieves full digitalization of PID control, allowing online adjustment of control parameters, thereby improving control accuracy, long-term stability, and the smooth reliability of mode switching. Attached Figure Description

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

[0018] Figure 1 A flowchart of a digital power supply PID control method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a digital power supply PID control device provided in an embodiment of the present invention; Figure 3This is a schematic diagram of the hardware structure of a chemical composition and capacity testing device provided in an embodiment of the present invention. Detailed Implementation

[0019] This invention provides a digital power supply PID control method, device, formation and capacity testing equipment, and medium to solve the technical problems of fixed analog loop parameters, susceptibility to temperature drift, and simple control logic.

[0020] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0021] Please see Figure 1 , Figure 1 An optional flowchart of a digital power supply PID control method provided in an embodiment of the present invention includes steps 101 to 104.

[0022] Step 101: Obtain the current operating mode of the digital power supply, as well as the loop feedback data and current loop mode of the current loop. The operating mode refers to the charging and discharging state of the battery by the formation and capacity equipment, including charging mode and discharging mode. The operating mode is determined by the upper-level MCU (Microcontroller Unit) according to the battery formation process requirements and sent to the DSP (Digital Signal Processor).

[0023] Loop mode refers to the operating state of the digital power supply control loop, including constant current mode (CC) and constant voltage mode (CV). The loop mode is determined and switched autonomously by the DSP based on the comparison results of real-time collected voltage and current data with preset thresholds, without the need for MCU intervention.

[0024] Loop feedback data refers to the current loop electrical parameters acquired in real time by the DSP through the analog-to-digital converter (ADC), including the current voltage sample value (such as bus voltage, battery terminal voltage) and the current current sample value (such as inductor current, battery current).

[0025] PID control refers to proportional-integral-derivative control. In this invention, all PID control is implemented in the DSP through software algorithms. PID parameters (such as proportional coefficient, integral coefficient, and derivative coefficient) can be adjusted online as software variables.

[0026] For example, the DSP receives the operating mode command sent by the MCU through the SPI communication interface. If the command is 0x01, the current operating mode is charging mode; if the command is 0x02, it is discharging mode. At the same time, the DSP starts the ADC module to collect loop feedback data at a sampling frequency of 100kHz: voltage sampling value (battery terminal voltage) and current sampling value (inductor current). The DSP's internal register stores the current loop mode, which is set to constant current mode by default upon initial power-up.

[0027] This invention achieves dual-mode separation: decoupling the charge / discharge operating mode (determined by the MCU) from the constant current / constant voltage loop mode (determined autonomously by the DSP). Specifically, the MCU issues operating mode commands to the DSP, indicating either the charging or discharging mode; the DSP autonomously determines the switching timing between the constant current and constant voltage modes based on real-time collected battery voltage and current data. This improves the flexibility of upper-level process scheduling while leveraging the high-speed response advantage of the DSP.

[0028] Step 102: In the current working mode, compare the loop feedback data with the preset threshold based on the current loop mode, and switch the current loop mode according to the comparison result; The mode switching logic in step 102 is related to the charging and discharging direction. Optionally, during the charging process, when the current loop mode is constant current mode, if the battery voltage is detected to rise to the preset upper voltage threshold, the mode is switched to constant voltage mode; when the current loop mode is constant voltage mode, if the battery current is detected to rise to the preset upper current threshold, the mode is switched back to constant current mode.

[0029] During discharge, if the battery voltage drops to a preset lower voltage threshold when the current loop mode is constant current mode, it switches to constant voltage mode; if the battery current drops to a preset lower current threshold when the current loop mode is constant voltage mode, it switches back to constant current mode. This switching logic effectively prevents overcharging or over-discharging of the battery.

[0030] In some embodiments, the loop feedback data includes the current voltage sample value and the current current sample value, and step 102 includes the following sub-steps: When the current operating mode is charging mode, if the current loop mode is constant current mode and the current voltage sample value is equal to or greater than the preset voltage upper limit threshold, then the current loop mode will be switched to constant voltage mode. When the current operating mode is charging mode, if the current loop mode is constant voltage mode and the current current sampling value is equal to or greater than the preset current upper limit threshold, then the current loop mode will be switched to constant current mode. When the current operating mode is discharge mode, if the current loop mode is constant current mode and the current voltage sample value is less than or equal to the preset voltage lower limit threshold, then the current loop mode will be switched to constant voltage mode. When the current operating mode is discharge mode, if the current loop mode is constant voltage mode and the current current sampling value is less than or equal to the preset current lower limit threshold, then the current loop mode will be switched to constant current mode.

[0031] For example, the DSP selects the corresponding comparison data and threshold according to the current operating mode and the current loop mode, and switches the current loop mode according to the comparison result. The specific process is as follows: When the operating mode is charging mode and the current loop mode is constant current mode, the DSP compares the voltage sample value with a preset charging voltage threshold (e.g., 4.2V). If the voltage sample value is greater than or equal to the charging voltage threshold, it is determined that the battery is close to full charge, and the current loop mode is switched to constant voltage mode. When the operating mode is charging mode and the current loop mode is constant voltage mode, the DSP compares the current sample value with a preset charging current threshold (e.g., 0.05C). If the current sample value is greater than or equal to the charging current threshold, it indicates that the battery charging current has increased abnormally, and the current loop mode is switched back to constant current mode. When the operating mode is discharge mode and the current loop mode is constant current mode, the DSP compares the voltage sample value with a preset discharge voltage threshold (e.g., 2.8V). If the voltage sample value is less than or equal to the discharge voltage threshold, it indicates that the battery voltage is too low, and the current loop mode is switched to constant voltage mode. When the operating mode is discharge mode and the current loop mode is constant voltage mode, the DSP compares the current sample value with a preset discharge current threshold (e.g., 0.02C). If the current sample value is less than or equal to the discharge current threshold, it indicates that the discharge current is very small, and the current loop mode is switched back to constant current mode.

[0032] After each successful switch, the DSP updates the internal loop mode register and resets the switch failure counter.

[0033] In some embodiments, before performing step 102, the following steps are also included: Obtain the loop control enable signal; If the loop control enable signal is invalid, a PID loop regulation disable command is generated; If the loop control enable signal is active, a PID loop regulation allow command is generated.

[0034] The loop control enable signal is a control flag signal stored in an internal register of the DSP, used to indicate whether PID loop adjustment is permitted. This signal has two states: active (e.g., logic "1" or high level) and inactive (e.g., logic "0" or low level). The DSP can only perform loop mode determination, mode switching, and PID adjustment when the enable signal is active; when inactive, all loop-related operations are prohibited.

[0035] The PID loop control disable instruction is an internal control instruction generated by the DSP when the loop control enable signal is invalid. It is used to disable the PID controller from performing error calculation and output update, and lock the PWM output to a safe value (such as 0% duty cycle or drive off), that is, stop enabling loop mode judgment and subsequent PID adjustment.

[0036] The PID loop control enable command is an internal control command generated by the DSP when the loop control enable signal is active. It is used to enable the PID controller to work normally, that is, to enable loop mode judgment and subsequent PID control.

[0037] Optionally, before performing any loop mode judgment and PID adjustment, the DSP first reads the loop control enable signal. This signal acts as the master switch for the entire loop control and is set by the system's initial power-on state or fault protection logic. When the enable signal is invalid, the DSP generates a PID loop adjustment disable command, forcibly locking the PID controller output to prevent uncontrollable PWM waveforms from being output during loop abnormalities, which could lead to damage to circuit components.

[0038] In some embodiments, when performing the above-described switching of the current loop mode based on the comparison result, the following steps are further included: If the number of consecutive mode switching failure signals detected reaches a preset number, the loop control enable signal will be set to invalid.

[0039] The mode switching failure signal indicates that during the process of switching the current loop mode based on the comparison result, if the switching conditions are not met (e.g., the voltage does not reach the threshold in charging constant current mode, or the current does not reach the threshold in discharging constant voltage mode), or if the loop mode becomes unstable after switching due to system disturbances and cannot be maintained, a status flag generated internally by the DSP indicates that the switching attempt was unsuccessful. This signal can be automatically cleared by the DSP or recorded by the corresponding counter.

[0040] During mode switching, the DSP monitors the result of each switching attempt in real time. If the switching conditions are met and the switching is successful, the current loop mode is updated normally; if the switching conditions are not met or the loop cannot be stabilized after the switching, a mode switching failure signal is generated.

[0041] Meanwhile, the DSP has an internal counter that increments each time a failure signal is generated. Once the number of consecutive failures reaches a preset threshold (e.g., 5 times), the DSP determines that there is a persistent fault in the loop and automatically disables the loop control enable signal, achieving loop self-locking protection. This protection state can only be released after the MCU sends a fault clearing command.

[0042] Step 103: Based on the current loop mode after switching, calculate the target value of the inner loop current using the corresponding outer loop PID control and the loop feedback data. The target value for the inner current loop refers to the output of the outer loop PID controller (voltage outer loop or current outer loop). This value serves as the given input for the inner current loop and reflects the current level required to achieve the outer loop control target (constant voltage or constant current).

[0043] In some embodiments, step 103 includes the following sub-steps: If the current loop mode after switching is constant voltage mode, then the target value of the current inner loop is calculated based on the current voltage sampling value through voltage outer loop PID control. If the current loop mode after switching is constant current mode, then the target value of the current inner loop is calculated based on the current sample value through the current outer loop PID control.

[0044] Voltage outer-loop PID control refers to a digital PID control algorithm applied in constant voltage mode. Its input is the deviation between the voltage setpoint and the current sampled voltage value, and its output is the target value for the current inner loop. This control is responsible for maintaining a stable output voltage, and its output serves as the command for the current inner loop.

[0045] Current outer-loop PID control refers to a digital PID control algorithm applied when the loop mode is constant current. Its input is the deviation between the current setpoint and the current sampled value, and its output is the target value of the inner-loop current. This control is responsible for maintaining a stable output current.

[0046] When the digital power supply needs to maintain a constant voltage output (such as during the battery charging phase), the DSP switches the loop mode to constant voltage mode, at which point the outer voltage loop PID is activated. The outer voltage loop calculates the required current command (i.e., the target value of the inner current loop) based on the deviation between the target voltage and the actual voltage, and indirectly controls the output voltage through the inner current loop.

[0047] When the digital power supply needs to maintain a constant current output (such as during the initial charging or discharging phase of a battery), the DSP switches the loop mode to constant current mode, at which point the outer current loop PID is activated. The outer current loop directly calculates the target value of the inner current loop based on the deviation between the target current and the actual current.

[0048] In some embodiments, if the current loop mode after switching is constant current mode, the target value of the inner current loop is calculated by the following formula: ; ; in, This is the target value for the inner current loop. This is the preset proportional coefficient for the outer loop PID control of the current. This is the preset integral coefficient for the outer loop PID control of the current. This is the preset derivative coefficient for the outer loop PID control of the current. This represents the current outer loop error. For the first The outer loop error of the wheel's current. The value ranges from 1 to , This refers to the outer loop error of the current from the previous cycle. This is the current sampled value in the loop feedback data. This is the preset target value for the outer loop current in the loop feedback data. This is the cumulative sum of the outer loop error of the current.

[0049] In some embodiments, if the current loop mode after switching is constant voltage mode, the target value of the inner current loop is calculated by the following formula: ; ; in, This is the target value for the inner current loop. This is the preset proportional coefficient for the voltage outer loop PID control. This is the preset integral coefficient for the voltage outer loop PID control. This is the preset derivative coefficient for the voltage outer loop PID control. For the current number The voltage outer loop error corresponding to the wheel, For the first The outer loop error of the wheel's current. The value ranges from 1 to , This refers to the voltage outer loop error from the previous round. This is the current voltage sample value in the loop feedback data. The preset outer loop voltage target value in the loop feedback data. This is the cumulative sum of the voltage outer loop error, used to eliminate steady-state error.

[0050] Step 104: Calculate and output the pulse width modulation duty cycle based on the target value of the current inner loop and the loop feedback data through current inner loop PID control.

[0051] Pulse Width Modulation Duty Cycle (PWM Duty Cycle): This refers to the ratio of the high-level time of the PWM signal to the switching period. This duty cycle directly controls the on-time of the power switch, thereby regulating the voltage and current of the main circuit.

[0052] Step 104 enables the inner current loop to quickly track the target value and generates the final PWM duty cycle.

[0053] In some embodiments, step 104 includes the following sub-steps: Obtain the current bus voltage of the digital power supply; The pulse width modulation duty cycle is calculated by using the current inner loop PID control, based on the target value of the current inner loop, combined with the loop feedback data and the current bus voltage. The output pulse width modulation duty cycle is used to regulate the voltage and current of the main circuit of the capacitor bank.

[0054] Feedforward compensation refers to introducing the reciprocal of the current bus voltage as a multiplicative factor on the output of the inner current loop PID controller, in order to offset the effect of bus voltage changes on the current loop gain and improve the system's ability to resist input disturbances.

[0055] Optionally, in step 104, firstly, the DSP samples the DC bus voltage of the digital power supply in real time through the ADC channel. The sampled value is synchronized with the current inner loop control cycle and stored in the internal register after digital filtering. Then, the current inner loop PID control is adopted to calculate the current control quantity based on the current inner loop target value and the current sampled value in the loop feedback data. Finally, the current control quantity is fed forward to compensate based on the current bus voltage, and the pulse width modulation duty cycle is calculated.

[0056] In some embodiments, the pulse width modulation duty cycle is calculated using the following formula: ; ; ; in, This is the output value of the inner loop PID control. This is the preset proportional coefficient for the inner loop PID control of the current. This is the preset integral coefficient for the current inner-loop PID control. This is the preset derivative coefficient for the current inner loop PID control. This represents the current inner loop error. For the first The inner loop error of the wheel's current. The value ranges from 1 to , This refers to the current inner loop error from the previous cycle. This is the current sampled value in the loop feedback data. This is the target value for the inner current loop. This is the current bus voltage. This refers to the duty cycle of pulse width modulation.

[0057] The calculated pulse width modulation duty cycle is directly written into the comparator register of the DSP's internal ePWM module, and the PWM waveform is automatically generated by the hardware, eliminating the need for additional analog circuitry. Furthermore, since the entire calculation is performed in the digital domain, advanced functions such as dead time, complementary output, and fault blocking can be flexibly added.

[0058] For example, suppose that in a certain formation and capacity testing step, the loop mode is switched to constant current mode during charging to require constant current charging of the lithium battery. The corresponding PID control flow is as follows: The corresponding target value for the inner current loop is 10A, which is given by the stable output of the outer current loop PID in step 103. The actual inductor current was detected to drop to 9.5A due to load disturbance, and the current deviation was calculated to be 0.5A. By performing PID calculations within the current loop, the current control quantity is obtained based on the current deviation, and this control quantity is appropriately increased. The current bus voltage is sampled as 48V. The increased current control quantity is divided by the bus voltage and multiplied by a per-unit factor. Through feedforward compensation calculation, the pulse width modulation duty cycle is increased from 0.21 to 0.22. The calculated duty cycle is written into the ePWM module's comparator register, outputting a wider pulse to drive the power switch, causing the inductor current to quickly rise back to 10A.

[0059] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0060] The digital power supply PID control device provided in the embodiments of this application is described below. The digital power supply PID control device described below can be referred to in correspondence with the digital power supply PID control method described above.

[0061] Reference Figure 2, Figure 2 This is an optional structural diagram of a digital power supply PID control device provided in an embodiment of the present invention. This device is used to implement the aforementioned digital power supply PID control method and may include: The data acquisition module 200 is used to acquire the current operating mode of the digital power supply, as well as the loop feedback data and current loop mode of the current loop. The mode switching module 300 is used to compare the loop feedback data with a preset threshold based on the current loop mode in the current working mode, and switch the current loop mode according to the comparison result. The outer loop calculation module 400 is used to calculate the target value of the inner loop current based on the loop feedback data through the corresponding outer loop PID control, according to the current loop mode after switching. The inner loop adjustment module 500 is used to calculate and output the pulse width modulation duty cycle based on the target value of the current inner loop and the loop feedback data through current inner loop PID control.

[0062] In some embodiments, the mode switching module 300 specifically performs the following functions: When the current operating mode is charging mode, if the current loop mode is constant current mode and the current voltage sample value is equal to or greater than the preset voltage upper limit threshold, then the current loop mode will be switched to constant voltage mode. When the current operating mode is charging mode, if the current loop mode is constant voltage mode and the current current sampling value is equal to or greater than the preset current upper limit threshold, then the current loop mode will be switched to constant current mode. When the current operating mode is discharge mode, if the current loop mode is constant current mode and the current voltage sample value is less than or equal to the preset voltage lower limit threshold, then the current loop mode will be switched to constant voltage mode. When the current operating mode is discharge mode, if the current loop mode is constant voltage mode and the current current sampling value is less than or equal to the preset current lower limit threshold, then the current loop mode will be switched to constant current mode.

[0063] In some embodiments, the outer ring calculation module 400 specifically performs the following functions: If the current loop mode after switching is constant voltage mode, then the target value of the current inner loop is calculated based on the current voltage sampling value through voltage outer loop PID control. If the current loop mode after switching is constant current mode, then the target value of the current inner loop is calculated based on the current sample value through the current outer loop PID control.

[0064] In some embodiments, the inner loop adjustment module 500 specifically performs the following functions: Obtain the current bus voltage of the digital power supply; The pulse width modulation duty cycle is calculated by using the current inner loop PID control, based on the target value of the current inner loop, combined with the loop feedback data and the current bus voltage. The output pulse width modulation duty cycle is used to regulate the voltage and current of the main circuit of the capacitor bank.

[0065] In some embodiments, the digital power supply PID control device further includes an enable control module, which specifically performs the following functions: Before switching the current loop mode based on the comparison result when comparing the loop feedback data with the preset threshold in the current working mode, the loop control enable signal is obtained. If the loop control enable signal is invalid, a PID loop regulation disable command is generated; If the loop control enable signal is active, a PID loop regulation allow command is generated.

[0066] When performing the step of switching the current loop mode based on the comparison result, if the number of consecutive detections of mode switching failure signals reaches a preset number, the loop control enable signal will be set to an invalid state.

[0067] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0068] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0069] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0070] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0071] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a modular capacity device to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0072] This invention also provides a formation and capacity testing device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described digital power supply PID control method.

[0073] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0074] Please see Figure 3 , Figure 3 The hardware structure of a formation and capacity testing device according to another embodiment is illustrated, including: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and called by the processor 901 to execute the digital power supply PID control method of the embodiments of this invention. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0075] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned digital power supply PID control method.

[0076] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0077] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0078] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A digital power supply PID control method, characterized by, include: Acquire the current operating mode of the digital power supply, as well as the loop feedback data and current loop mode of the current loop; In the current working mode, the loop feedback data is compared with a preset threshold based on the current loop mode, and the current loop mode is switched according to the comparison result; Based on the current loop mode after switching, the target value of the inner loop current is calculated based on the loop feedback data through the corresponding outer loop PID control. The pulse width modulation duty cycle is calculated and output based on the target value of the current inner loop and the loop feedback data through current inner loop PID control.

2. The digital power supply PID control method of claim 1, wherein, The loop feedback data includes the current voltage sample value and the current current sample value. In the current operating mode, comparing the loop feedback data with a preset threshold based on the current loop mode, and switching the current loop mode according to the comparison result, includes: When the current operating mode is charging mode, if the current loop mode is constant current mode and the current voltage sample value is equal to or greater than the preset voltage upper limit threshold, then the current loop mode is switched to constant voltage mode. When the current operating mode is charging mode, if the current loop mode is constant voltage mode and the current current sampling value is equal to or greater than the preset current upper limit threshold, then the current loop mode is switched to constant current mode. When the current operating mode is discharge mode, if the current loop mode is constant current mode and the current voltage sample value is less than or equal to the preset voltage lower limit threshold, then the current loop mode is switched to constant voltage mode. When the current operating mode is discharge mode, if the current loop mode is constant voltage mode and the current current sampling value is less than or equal to the preset current lower limit threshold, then the current loop mode is switched to constant current mode.

3. The digital power supply PID control method of claim 2, wherein, The outer-loop PID control includes voltage outer-loop PID control and current outer-loop PID control. The step of calculating the inner-loop current target value based on the loop feedback data, according to the switched current loop mode and the corresponding outer-loop PID control, includes: If the current loop mode after switching is constant voltage mode, then the target value of the current inner loop is calculated based on the current voltage sample value through voltage outer loop PID control. If the current loop mode after switching is constant current mode, then the target value of the current inner loop is calculated based on the current sample value through the current outer loop PID control.

4. The digital power supply PID control method of claim 1, wherein, Before performing the steps described in the current operating mode, such as comparing the loop feedback data with a preset threshold based on the current loop mode, and switching the current loop mode according to the comparison result, the method further includes: Obtain the loop control enable signal; If the loop control enable signal is in an invalid state, a PID loop regulation prohibition command is generated; If the loop control enable signal is active, a PID loop regulation allow command is generated.

5. The digital power supply PID control method of claim 4, wherein, The step of switching the current loop mode based on the comparison result further includes: If the number of consecutive detections of mode switching failure signals reaches a preset number, the loop control enable signal will be set to an invalid state.

6. The digital power supply PID control method of claim 1, wherein, The method of using current inner-loop PID control to calculate and output the pulse width modulation duty cycle based on the target value of the current inner loop and the loop feedback data includes: Obtain the current bus voltage of the digital power supply; The pulse width modulation duty cycle is calculated based on the target value of the current inner loop, the loop feedback data, and the current bus voltage through current inner loop PID control. The pulse width modulation duty cycle is output to adjust the voltage and current of the main circuit of the capacitor bank.

7. The digital power supply PID control method of claim 6, wherein, The pulse width modulation duty cycle is calculated using the following formula: ; ; ; in, This is the output value of the inner loop PID control. This is the preset proportional coefficient for the inner loop PID control of the current. This is the preset integral coefficient for the current inner-loop PID control. This is the preset derivative coefficient for the current inner loop PID control. This represents the current inner loop error. For the first The inner loop error of the wheel's current. The value ranges from 1 to , This refers to the current inner loop error from the previous cycle. This is the current sampled value in the loop feedback data. This is the target value for the inner current loop. This is the current bus voltage. This refers to the duty cycle of pulse width modulation.

8. A digital power supply PID control device, characterized in that, A method for performing the digital power supply PID control method as described in any one of claims 1 to 7, comprising: The data acquisition module is used to acquire the current operating mode of the digital power supply, as well as the loop feedback data and current loop mode of the current loop. The mode switching module is used to compare the loop feedback data with a preset threshold based on the current loop mode in the current working mode, and switch the current loop mode according to the comparison result; The outer loop calculation module is used to calculate the target value of the inner loop current based on the loop feedback data through the corresponding outer loop PID control, according to the current loop mode after switching. The inner loop adjustment module is used to calculate and output the pulse width modulation duty cycle based on the target value of the current inner loop and the loop feedback data through current inner loop PID control.

9. A formation and dispensing apparatus, characterized by, The device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the steps of the digital power supply PID control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed, it implements the digital power supply PID control method as described in any one of claims 1 to 7.