Calculation method and system for inductive current
By sampling the inductor current during timing interruption, and calculating the average current with the input and output voltage and the on-time of the switch tube, the problem of inaccurate sampling when the inductor current is discontinuous is solved, and precise control and stability guarantee of the digital power output is achieved.
Patent Information
- Application Number
- CN202510259841.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing inductor current sampling methods cannot accurately sample when the inductor current is discontinuous, resulting in inaccurate and unstable output current control.
By sampling the inductor at a timing interruption, combining the input and output voltage and the on-time of the switch tube, the average current of the inductor during the switching cycle is calculated, and the duty cycle of the PWM signal is dynamically adjusted through the PID controller to accurately control the output voltage of the power supply.
It realizes that the inductor current value can be accurately calculated in both continuous and discontinuous modes of inductor current, adapting to different working conditions, and providing guarantees for the stable output of digital power.
Smart Images

Figure CN119757835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of current detection, and more particularly, to a method and system for calculating inductor current. Background Art
[0002] In digital power control, inductor current sampling is an important link. Sampling accuracy and sampling real-time performance will affect control accuracy and stability. In the existing technology, the switching cycle of the microcontroller is used to trigger the inductor current sampling. The sampling is performed at the midpoint of each switching cycle. The midpoint of the ramp current is sampled to achieve high accuracy, and the real-time value without filtering is also sampled to achieve real-time performance. When the inductor current is continuous, this sampling method is very accurate. However, when the inductor current is discontinuous, although the sampling is triggered at the midpoint of each switching cycle, the current is not at the midpoint, and the accuracy of the sampled current is reduced or even completely inaccurate. Therefore, when the inductor current is discontinuous, the sampling value obtained by this method will have a large error, resulting in inaccurate output current control and even unstable output.
[0003] Based on this, a new solution is needed. Summary of the invention
[0004] The purpose of the present invention is to provide a method for calculating the inductor current in order to address the shortcoming of the existing inductor current sampling method that the inductor current cannot be accurately sampled when the inductor current is discontinuous. The method can calculate the accurate current value regardless of whether the inductor current is continuous or discontinuous, thereby providing a basic guarantee for the stable output of the digital power supply.
[0005] According to one aspect of the present invention, a method for calculating an inductor current is provided, comprising the following steps: When entering the timing interruption, current sampling is performed on the inductor to obtain a sampled inductor current; Obtaining an input voltage and an output voltage of a circuit where the inductor is located; Reading the conduction time of the switch tube connected to the inductor in the switching cycle; According to the sampled inductor current , the conduction time , the input voltage , the output voltage and the switching cycle time T, calculate the average current of the inductor in the switching cycle .
[0006] In the calculation method for inductor current provided by the present invention, the timing interrupt is entered at the midpoint of the conduction time of the switch cycle of the switch tube connected to the inductor.
[0007] In the calculation method for inductor current provided by the present invention, when the calculation method is applied to a step-down circuit, .
[0008] In the calculation method for inductor current provided by the present invention, when the calculation method is applied to a boost circuit, .
[0009] The method for calculating the inductor current provided by the present invention further includes: According to the error between the output voltage and the target voltage, the adjustment value is calculated using the PID controller; According to the adjustment value of the PID controller, the duty cycle of the next switching cycle is adjusted and the on-time is saved.
[0010] According to another aspect of the present invention, there is also provided a system for calculating an inductor current, comprising: A sampling module, used for sampling the current of the inductor to obtain a sampled inductor current when entering a timing interruption; A voltage acquisition module, used for acquiring an input voltage and an output voltage of a circuit where the inductor is located; A conduction time acquisition module, used to read the conduction time of the switch tube connected to the inductor in a switching cycle; A calculation module is used to calculate the sampled inductor current according to the , the conduction time , the input voltage , the output voltage and the switching cycle time T, calculate the average current of the inductor in the switching cycle .
[0011] In the inductor current calculation system provided by the present invention, the timing interrupt is entered at the midpoint of the conduction time of the switch cycle of the switch tube connected to the inductor.
[0012] In the calculation system for inductor current provided by the present invention, when calculating the average current of the buck circuit, .
[0013] In the calculation system for inductor current provided by the present invention, when calculating the average current of the boost circuit, .
[0014] The system for calculating the inductor current provided by the present invention further includes: A PID controller is used to calculate a regulation value based on the error between the output voltage and the target voltage; The adjustment module is used to adjust the duty cycle of the next switching cycle and save the on-time according to the adjustment value of the PID controller.
[0015] The implementation of the method and system for calculating the inductor current of the present invention has the following beneficial effects: by real-time sampling of the inductor current, combined with the input and output voltages and the on-time of the switch tube, the average value of the inductor current is calculated, and the duty cycle of the PWM signal is dynamically adjusted through the PID controller, thereby accurately controlling the output voltage of the power supply; this calculation method can accurately calculate the inductor current value in both the continuous and discontinuous modes of the inductor current, adapt to different working conditions, and provide a guarantee for the stable output of the digital power supply. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative work: Figure 1 FIG. 1 is a schematic circuit diagram of a method for calculating an inductor current proposed by the present invention applied to a buck circuit; Figure 2 The figure shows the relationship between the PWM drive waveform, current and sampling point in the buck circuit; Figure 3 FIG. 1 is a schematic circuit diagram of a method for calculating an inductor current proposed by the present invention applied to a boost circuit; Figure 4 The figure shows the relationship between the PWM drive waveform, current and sampling point in the boost circuit; Figure 5 FIG. 4 is a flow chart of a method for calculating inductor current proposed by the present invention. DETAILED DESCRIPTION
[0017] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Typical embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0019] Figure 1FIG. 1 is a schematic circuit diagram of a method for calculating inductor current proposed by the present invention and applied to a buck circuit. In the buck circuit, Figure 1 As shown, including the input capacitor C in , output capacitor C out , switch tube Q1, diode D1 and inductor L1. When the switch tube Q1 is turned on, the current of the inductor L1 increases, and when the switch tube Q1 is turned off, the current of the inductor L1 decreases. The relationship between the PWM drive waveform and the current and sampling points is as follows: Figure 2 As shown. The current sampled by the MCU is , the actual current is ,from Figure 2 We can see that when the inductor current is continuous, the sampled current truly represents the average current of the inductor current, but when the inductor current is discontinuous, the sampled current is not equal to the average current.
[0020] Figure 3 FIG. 1 is a schematic circuit diagram of a method for calculating inductor current proposed by the present invention and applied to a boost circuit. In the boost circuit, Figure 3 As shown, including the input capacitor C in , output capacitor C out , switch tube Q2, diode D2 and inductor L2. When switch tube Q2 is turned on, the current increases, and when switch tube Q2 is turned off, the current decreases. The relationship between the PWM drive waveform and the current and sampling points is as follows: Figure 4 As shown. The current sampled by the MCU is , the actual current is ,from Figure 4 We can see that when the inductor current is continuous, the sampled current truly represents the average current of the inductor current, but when the inductor current is discontinuous, the sampled current is not equal to the average current.
[0021] Figure 5 FIG. 1 is a schematic diagram of a method for calculating inductor current proposed by the present invention. Figure 5 As shown, the method for calculating the inductor current provided by the present invention comprises the following steps: Step S1, when entering the timing interrupt, sampling the current of the inductor to obtain the sampled inductor current; Specifically, in one embodiment of the present invention, Figure 1 As shown, the inductor L1 is connected to the switch tube Q1, and the on and off of Q1 is controlled by applying a PWM pulse modulation signal to the switch tube Q1. Figure 3As shown, the inductor L2 is connected to the switch tube Q2, and the on and off of Q2 is controlled by applying a PWM pulse modulation signal to the switch tube Q2. Therefore, a timing interrupt is entered at the midpoint of the on time of the switch cycle of the switch tube connected to the inductor, and the current of the inductor is sampled.
[0022] Furthermore, in one embodiment of the present invention, sampling can be performed by a Hall sensor or a sampling resistor. The Hall sensor realizes non-contact measurement of current through the principle of electromagnetic induction, while the sampling resistor measures the current through the voltage drop caused by the current. Subsequently, the sampled inductor current is an analog signal input into the analog-to-digital conversion module (ADC) of the microcontroller for discrete sampling. The analog signal is converted into a digital signal by the ADC for subsequent digital processing and analysis. Therefore, step S1 includes: Using Hall or sampling resistor ratio to sample the analog current signal of the inductor; The analog current signal is discretely sampled by an analog-to-digital conversion module of the single-chip microcomputer to obtain the sampled inductor current.
[0023] Step S2, obtaining an input voltage and an output voltage of a circuit where the inductor is located; Step S3, reading the conduction time of the switch tube connected to the inductor in the switching cycle; Step S4: sampling the inductor current according to the , the conduction time , the input voltage , the output voltage and the switching cycle time T, calculate the average current of the inductor in the switching cycle .
[0024] Specifically, in one embodiment of the present invention, for Figure 1 The step-down circuit shown in the figure takes the input voltage as , the output voltage is , the PWM cycle value is T, and the Q1 conduction time is , the duty cycle is , the off time is ; When Q1 is turned off, the time it takes for the current to drop from the maximum peak current is According to the volt-second formula, we have: (1), Find as follows: (2) The average value of the inductor current is given by: (3) Substitute equation ② into equation ③ (4) In the DC step-down conversion circuit, when the inductor current is continuous, there is: (5) (6) Substituting (5) and (6) into (4), we can obtain (7) From formula (7), we can know that when the inductor current is continuous, the sampled current is the average current, which is consistent with the existing technology. Formula (7) is only correct when the inductor current is continuous, while formula (4) is correct regardless of whether the inductor current is continuous mode or discontinuous mode.
[0025] In digital power control, when PWM is sent at a fixed frequency, the period value T is known. Each time PWM is sent, It is calculated by the PID controller and is also known. , and They are all sampled in real time and are known. Therefore, no matter the inductor current is in continuous mode or discontinuous mode, the inductor current obtained according to formula (4) is the actual inductor current value.
[0026] Specifically, in one embodiment of the present invention, for Figure 3 The boost circuit shown in the figure takes the input voltage as , the output voltage is , the PWM cycle value is T, and the Q2 conduction time is , the duty cycle is , the off time is , when Q2 is turned off, the time it takes for the current to drop from the maximum peak current is .
[0027] For the boost circuit, according to the volt-second formula, we have: (8), Find as follows: (9) The average value of the inductor current is given by: (10) Substitute equation (9) into equation (10) (11) In the DC boost converter circuit, when the inductor current is continuous, we have: (12) (13) Substituting (12) and (13) into (11), we can obtain (14) From formula (14), we can know that when the inductor current is continuous, the current sampled by the MCU is the average current, which is consistent with the existing technology. Formula (14) is only correct when the inductor current is continuous, while formula (11) is correct regardless of whether it is in the inductor current continuous mode or the inductor current discontinuous mode.
[0028] In digital power control, when PWM is sent at a fixed frequency, the period value T is known. Each time PWM is sent, It is calculated by the PID controller and is also known. , and are all sampled in real time and are known. According to formula (11), (11) Regardless of whether the inductor current is in continuous mode or discontinuous mode, the actual inductor current value can be calculated.
[0029] Step S5, calculating the adjustment value using the PID controller according to the error between the output voltage and the target voltage; Step S6: According to the adjustment value of the PID controller, adjust the duty cycle of the next switching cycle and save the on-time.
[0030] Specifically, in one embodiment of the present invention, in a switching power supply, PID control can adjust the duty cycle of a PWM (pulse width modulation) signal to make the output voltage or current close to the desired value. This is very effective in dealing with interference such as load changes and voltage fluctuations, and can ensure that the system always works stably and provides a stable output.
[0031] The method for calculating the inductor current provided by the present invention calculates the average value of the inductor current by real-time sampling of the inductor current, combining the input and output voltages and the on-time of the switch tube, and dynamically adjusts the duty cycle of the PWM signal through a PID controller, thereby accurately controlling the output voltage of the power supply. This calculation method can accurately calculate the inductor current value in both the continuous and discontinuous modes of the inductor current, adapt to different working conditions, and provide a guarantee for the stable output of the digital power supply.
[0032] Accordingly, the present invention provides a system for calculating inductor current, comprising: a sampling module, used to sample the current of the inductor when entering a timing interruption, and obtain the sampled inductor current; a voltage acquisition module, used to obtain the input voltage and output voltage of the circuit where the inductor is located; a conduction time acquisition module, used to read the conduction time of a switch tube connected to the inductor in a switching cycle; a calculation module, used to calculate the conduction time of the switch tube connected to the inductor according to the sampled inductor current; , the conduction time , the input voltage , the output voltage and the switching cycle time T, calculate the average current of the inductor in the switching cycle , a PID controller, used to calculate an adjustment value according to an error between an output voltage and a target voltage; an adjustment module, used to adjust the duty cycle of the next switching cycle and save the on-time according to the adjustment value of the PID controller.
[0033] Specifically, in one embodiment of the present invention, the timing interrupt is entered at the midpoint of the conduction time of the switching cycle of the switch tube connected to the inductor.
[0034] Specifically, in one embodiment of the present invention, the sampling module includes: an analog current sampling unit, which is used to sample the analog current signal of the inductor using Hall or sampling resistor ratio; an analog-to-digital conversion module, which is used to discretely sample the analog current signal to obtain the sampled inductor current.
[0035] Specifically, in one embodiment of the present invention, when calculating the average current of the step-down circuit, .
[0036] Specifically, in one embodiment of the present invention, when calculating the average current of the boost circuit, .
[0037] In each of the descriptions provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0038] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0039] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0040] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A method for calculating an inductor current, characterized in that: The following steps are involved: When entering the timing interruption, current sampling is performed on the inductor to obtain a sampled inductor current; Obtaining an input voltage and an output voltage of a circuit where the inductor is located; Reading the conduction time of the switch tube connected to the inductor in the switching cycle; According to the sampled inductor current , the conduction time , the input voltage , the output voltage and the switching cycle time T, calculate the average current of the inductor in the switching cycle .
2. The method for calculating the inductor current according to claim 1, characterized in that: The timing interruption is entered at the midpoint of the conduction time of the switching cycle of the switch tube connected to the inductor.
3. The method for calculating the inductor current according to claim 1, characterized in that: When the calculation method is applied to a step-down circuit, .
4. The method for calculating the inductor current according to claim 1, characterized in that: When the calculation method is applied to a boost circuit, .
5. The method for calculating the inductor current according to claim 1, characterized in that: Also includes: According to the error between the output voltage and the target voltage, the adjustment value is calculated using the PID controller; According to the adjustment value of the PID controller, the duty cycle of the next switching cycle is adjusted and the on-time is saved.
6. A system for calculating inductor current, characterized in that: include: A sampling module, used for sampling the current of the inductor to obtain a sampled inductor current when entering a timing interruption; A voltage acquisition module, used for acquiring an input voltage and an output voltage of a circuit where the inductor is located; A conduction time acquisition module, used to read the conduction time of the switch tube connected to the inductor in a switching cycle; A calculation module is used to calculate the sampled inductor current according to the , the conduction time , the input voltage , the output voltage and the switching cycle time T, calculate the average current of the inductor in the switching cycle .
7. The system for calculating inductor current according to claim 6, characterized in that: The timing interruption is entered at the midpoint of the conduction time of the switching cycle of the switch tube connected to the inductor.
8. The system for calculating inductor current according to claim 6, characterized in that: When calculating the average current of a buck circuit, .
9. The system for calculating inductor current according to claim 6, characterized in that: When calculating the average current of the boost circuit, .
10. The system for calculating inductor current according to claim 6, characterized in that: Also includes: A PID controller is used to calculate a regulation value based on the error between the output voltage and the target voltage; The adjustment module is used to adjust the duty cycle of the next switching cycle and save the on-time according to the adjustment value of the PID controller.
Citation Information
Patent Citations
Digital power factor converter with fast transient response function and control method of digital power factor converter
CN103078530A
Method, system and device for detecting inductance current of step-up / step-down circuit
CN110045170A
Inductive current sampling calibration method and system and computer readable storage medium
CN112782633A
Automatic voltage regulation inverter current source control method and system for testing low-voltage circuit breaker
CN118783802A