A charging current sampling method
By dynamically adjusting the current sampling time and collecting the supercapacitor charging current according to the compensation formula of the pulse width modulation signal, the problem of charging current sampling deviation is solved, and the accuracy of capacitor charging capacity calculation is improved.
Patent Information
- Application Number
- CN202211007878.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-08-22
AI Technical Summary
In existing technologies, the sampling method for supercapacitor charging current cannot be dynamically adjusted, which leads to deviations in the sampling value of the charging current and affects the accuracy of the calculation of the capacitor charging capacity.
By acquiring the current waveform when a pulse width modulation signal flows through an inductor, dynamically adjusting the current sampling time according to a preset compensation formula, acquiring the intermediate value of the inductor current, and using a current sensor to obtain the accurate charging current.
It achieves accurate acquisition of charging current, reduces fluctuations, and improves the accuracy of capacitor charging capacity calculation.
Smart Images

Figure CN115372680B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of supercapacitor charging, and in particular to a charging current sampling method. Background Art
[0002] The supercapacitor charging technology in wind turbine variable pitch is another key control technology besides the motor control technology. In the charging technology, in addition to the charging algorithm, the charging current sampling is the most critical technical essentials. Because no matter how good a charging algorithm is, if there is a deviation in the charging current sampling, the charging current will not be stable, and there will be a very large error in the calculation of the capacitor charging amount. In the prior art, the capacitor charging adopts IGBT switch, which sends out pulse width modulation signal for charging, and the sampling of charging current generally adopts hardware circuit capacitor filtering, or software for mean filtering, first-order filtering or Kalman filtering. The above technologies do not make dynamic adjustments for the charging capacitor sampling, but simply filter the sampled values. The filtering effects are not ideal, and the sampling values of the charging current will have a relatively large deviation. Summary of the invention
[0003] A charging current sampling method provided by the present invention can dynamically adjust and calculate the sampling time of the charging current, ensure that the sampling current can accurately collect the middle value of the inductor current, and solve the problem of charging current fluctuation caused by the fluctuation of the sampling current.
[0004] In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention provides a charging current sampling method, which is applied to supercapacitor charging, and is characterized by comprising:
[0006] The current waveform generated when the pulse width modulation signal flows through the inductor is collected; the current sampling time is determined according to the preset first compensation formula or the preset second compensation formula; and the charging current is collected according to the current sampling time.
[0007] Optionally, the charging current sampling method also includes: the charging current sampling method also includes: determining whether the duty cycle of the pulse width modulation signal is less than or equal to a preset threshold; if so, determining the current sampling time according to a preset first compensation formula; otherwise, determining the current sampling time according to a preset second compensation formula; collecting the charging current according to the current sampling time.
[0008] Optionally, collecting the charging current according to the current sampling time includes: if the current sampling time is determined according to a preset first compensation formula, the current sensor collects the middle value of the falling edge of the inductor current to obtain the charging current; or, if the current sampling time is determined according to a preset second compensation formula, the current sensor collects the middle value of the rising edge of the inductor current to obtain the charging current.
[0009] Optionally, the preset first compensation formula is:
[0010]
[0011] Among them, T BPRD is the base value of the pulse width modulation signal that triggers ADC sampling, a is the compensation coefficient generated by the pulse width modulation signal in the previous cycle, T BCLK is the clock cycle.
[0012] Optionally, the preset second compensation formula is:
[0013]
[0014] Among them, T BPRD is the base value of the pulse width modulation signal that triggers ADC sampling, a is the compensation coefficient generated by the pulse width modulation signal in the previous cycle, T BCLK is the clock cycle.
[0015] Optionally, collecting the charging current according to the current sampling time includes: if the duty cycle of the pulse width modulation is less than or equal to a preset threshold, the current sensor collects the middle value of the falling edge of the inductor current; or if the duty cycle of the pulse width modulation is greater than the preset threshold, the current sensor collects the middle value of the rising edge of the inductor current.
[0016] In a second aspect, an embodiment of the present invention further provides a supercapacitor charging method, comprising: applying the charging current sampling method as described in the first aspect to obtain a charging current; using a preset charging algorithm to calculate a corresponding output current based on the charging current, wherein the charging algorithm includes a dual-loop PID control of a voltage loop and a current loop; using the output current to charge the supercapacitor in any of the three modes of constant current, constant voltage, and floating charge.
[0017] In a third aspect, an embodiment of the present invention further provides a charging current sampling device, which is applied to supercapacitor charging, and includes: a current acquisition module, which is used to collect the current waveform generated when a pulse width modulated signal flows through an inductor, and collect the charging current according to a first current sampling time or a second current sampling time; a capacitor charging module, which is used to provide electrical energy to the supercapacitor.
[0018] In a fourth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the charging current sampling method described in the first aspect and / or the supercapacitor charging method described in the second aspect.
[0022] In a fifth aspect, an embodiment of the present invention further provides a non-volatile computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the charging current sampling method described in the first aspect and / or the supercapacitor charging method described in the second aspect can be executed.
[0023] The beneficial effects of the embodiments of the present invention are as follows: Different from the prior art, the embodiments of the present invention provide a charging current sampling method, which is applied to supercapacitor charging, including: collecting the current waveform generated when the pulse width modulation signal flows through the inductor; determining the current sampling time according to the preset first compensation formula or the preset second compensation formula; and collecting the charging current according to the current sampling time. The present invention dynamically adjusts and calculates the charging current sampling time based on the pulse width modulation signal duty cycle compensation, ensures that each sampling can accurately collect the intermediate value of the inductor current, and solves the fluctuation problem of the sampling current. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0025] Figure 1 is a flow chart of a charging current sampling method provided by an embodiment of the present invention;
[0026] Figure 2 is a current waveform generated by a pulse width modulation signal provided by an embodiment of the present invention flowing through an inductor;
[0027] Figure 3 is a principle diagram for calculating the duty cycle of a first pulse width modulation signal provided by an embodiment of the present invention;
[0028] Figure 4 is a sampling principle diagram of an ADC sampler provided by an embodiment of the present invention;
[0029] Figure 5 The embodiment of the present invention provides Figure 1 The method flow chart of step S102 in FIG.
[0030] Figure 6 is a flow chart of a supercapacitor charging method provided by an embodiment of the present invention;
[0031] Figure 7 This is a diagram showing the effect of sampling the intermediate value of the current on the rising edge of the triangular waveform of the inductor current in the constant voltage charging mode provided by an embodiment of the present invention;
[0032] Figure 8 is a diagram of a charging current sampling device provided by an embodiment of the present invention;
[0033] Fig. 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the protection scope of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device schematic diagram or the flow chart.
[0035] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in this specification and in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0036] See also Figure 1 , Figure 1 : is a flow chart of a charging current sampling method provided by an embodiment of the present invention, the method comprising the following steps:
[0037] S101, collecting a current waveform generated when a pulse width modulation signal flows through an inductor;
[0038] In some embodiments, the supercapacitor is charged using an IGBT (Insulated Gate Bipolar Transistor) switch. The DSP chip sends a pulse width modulation signal to act on the IGBT switch. When the pulse width modulation signal flows through the inductor, the waveform of the inductor current presents a triangular waveform. For details, please refer to Figure 2 , Figure 2 It is the current waveform generated by the pulse width modulation signal provided by the embodiment of the present invention flowing through the inductor. The pulse width modulation signal is a rectangular waveform. During the high effective time t1 of the pulse width modulation signal, the waveform of the inductor current is in a linear rising state, and during the low effective time t2 of the pulse width modulation signal, the waveform of the inductor current is in a linear falling state. Within one cycle Tcyc of the pulse width modulation signal, the waveform of the inductor current presents a triangular wave type, and the triangular wave shape of the inductor current is affected by the high effective time t1 and the low effective time t2 of the pulse width modulation signal. In addition, Ic is the middle value of the triangular wave current.
[0039] S102, determining a current sampling time according to a preset first compensation formula or a preset second compensation formula;
[0040] The expression of the preset first compensation formula is:
[0041]
[0042] Among them, T adc is the current sampling time, T BPRD is the base value of the pulse width modulation signal that triggers ADC sampling, a is the compensation coefficient generated by the pulse width modulation signal of the previous cycle, T BCLK is the clock cycle.
[0043] The expression of the preset second compensation formula is:
[0044]
[0045] Among them, T adc is the current sampling time, T BPRD is the base value of the pulse width modulation signal that triggers ADC sampling, a is the compensation coefficient generated by the pulse width modulation signal of the previous cycle, T BCLK is the clock cycle.
[0046] To facilitate understanding of step S102, the inventor further details as follows:
[0047] In some embodiments, during a charging cycle of the supercapacitor, a DSP (digital signal processing technology) chip generates two pulse width modulation signals with the same frequency: a first pulse width modulation signal and a second pulse width modulation signal, wherein the first pulse width modulation signal is used to calculate the duty cycle, and the second pulse width modulation signal is used to calculate the current sampling time T. adc .
[0048] Specifically, the DSP chip obtains the duty cycle of the first pulse width modulation signal by changing the comparator Cmp value. Figure 3 , Figure 3 1 is a schematic diagram of calculating the duty cycle of the first pulse width modulation signal provided by an embodiment of the present invention. In some embodiments, the DSP adopts the Up_Dowm mode to set the base value T of the pulse width modulation signal that triggers the ADC sampling. BPRD is 4, and the Cmp value of the comparator is 3. Based on this setting condition, the DSP generates a first pulse width modulation signal according to the duty cycle calculation formula: (T BPRD -Cmp) / T BPRD *100%, it is calculated that the duty cycle of the first pulse width modulation signal is 25%, that is, t1 / Tcyc is 25%, wherein t1 is the high effective time of the first pulse width modulation signal, and Tcyc is the period of the first pulse width modulation.
[0049] By changing the comparator Cmp value, the ADC sampler is triggered at different times, and the ADC triggers the sampler to sample the second pulse width modulation signal. For details, please refer to Figure 4 , Figure 4 : is a sampling principle diagram of an ADC sampler provided in an embodiment of the present invention. In some embodiments, the DSP adopts the Up mode to set the base value T of the pulse width modulation signal that triggers ADC sampling. BPRD is 7, the Cmp value of the comparator is 4, based on this setting condition, the current sampling time point is T adc .
[0050] In a charging cycle of charging the supercapacitor, if the power of the supercapacitor is very low, the voltage difference with the bus voltage is very large. If the constant current charging mode is used to charge the supercapacitor, the duty cycle of the first pulse width modulation signal generated by the DSP is low. When the first pulse width modulation signal flows through the inductor current, the current triangular waveform generated will have a large rising edge slope and a relatively small falling edge slope. In some embodiments, the first compensation formula is used to determine the current sampling time point. Specifically, the DSP sets the comparator Cmp value. Formula 1 is:
[0051] Cmp=T BPRD / 2+a*T BPRD / 2
[0052] Among them, T BPRD is the base value of the pulse width modulation signal that triggers ADC sampling, a is the compensation coefficient generated by the pulse width modulation signal of the previous cycle, a=0.8*(1-du), du is the duty cycle of the first pulse width modulation signal of the previous cycle.
[0053] Next, the ADC triggers the sampler to sample the second pulse width modulation signal and calculates the sampling time point T adc , Formula 2 is:
[0054] T adc =Cmp / (T BPRD +1)*T BCLK
[0055] Where Cmp is calculated by formula 1, T BCLK is the clock period. In some embodiments, T BCLK The size of is 0.5ns. Combining Formula 1 and Formula 2, we can get the first compensation formula. The sampling time point T is calculated. adc The rear current sensor collects the current middle value of the falling edge of the current triangle wave generated when the first pulse width modulation signal flows through the inductor current. The current middle value is collected by the current sensor as the charging current.
[0056] In some embodiments, when the supercapacitor voltage rises after charging for a period of time, and the duty cycle of the first pulse width modulation signal reaches a preset threshold, the rising slope of the triangular waveform of the current generated when the first pulse width modulation signal flows through the inductor is relatively small, and the falling slope is relatively large. The second compensation formula is used to determine the current sampling time point. Specifically, the DSP sets the comparator Cmp value, and Formula 3 is:
[0057] Cmp=a*T BPRD / 2
[0058] Among them, T BPRD is the base value of the pulse width modulation signal that triggers ADC sampling, a is the compensation coefficient generated by the pulse width modulation signal of the previous cycle, a=0.8*(1-du), du is the duty cycle of the first pulse width modulation signal of the previous cycle.
[0059] Next, the ADC triggers the sampler to sample the second pulse width modulation signal, and the sampling time point T is calculated using formula 2. adc , combine formula 2 and formula 3 to simplify and get the second compensation formula. The sampling time point T is calculated. adc The rear current sensor collects the current middle value of the rising edge of the current triangle wave generated when the first pulse width modulation signal flows through the inductor current. The current middle value is collected by the current sensor as the charging current.
[0060] S103: Collect charging current according to the current sampling time.
[0061] In some embodiments, if the current sampling time point T of the middle value of the current on the rising edge of the triangular wave is to be obtained, adc , you need to set Cmp=T BPRD / 2, if you want to obtain the current sampling time point T of the middle value of the falling edge current of the triangular wave adc , you need to set Cmp = T BPRD .
[0062] See also Figure 5 , Figure 5 The embodiment of the present invention provides Figure 1 The method flow chart of step S102 in the embodiment of the present invention comprises:
[0063] S1021, determine whether the duty cycle of the pulse width modulation signal is less than or equal to a preset threshold. If yes, execute step S1023, if not, execute step S1022.
[0064] In some embodiments, the preset threshold is set to 50%.
[0065] S1023: If yes, determine the current sampling time according to a preset first compensation formula.
[0066] S1022: Otherwise, determine the current sampling time according to a preset second compensation formula.
[0067] S103: Collect charging current according to the current sampling time.
[0068] In some embodiments, collecting the charging current according to the current sampling time further includes: if the duty cycle of the pulse width modulation is less than or equal to a preset threshold, the current sensor collects the middle value of the rising edge of the inductor current; or, if the duty cycle of the pulse width modulation is greater than the preset threshold, the current sensor collects the middle value of the falling edge of the inductor current.
[0069] See also Figure 6 , Figure 6 : is a flow chart of a supercapacitor charging method provided by an embodiment of the present invention, applying the charging current sampling method provided by the above embodiment, including:
[0070] S301, obtaining charging current.
[0071] The current sensor collects the current intermediate value of the rising edge and / or falling edge of the current triangular wave generated when the first pulse width modulation signal flows through the inductor current as the charging current.
[0072] S302: Using a preset charging algorithm, based on the charging current, calculate and obtain a corresponding output current.
[0073] In some embodiments, the charging algorithm includes dual-loop PID control of a voltage loop and a current loop. For the PID control of the current loop, the output current of the previous cycle is used to adjust the charging current of the current cycle. The adjustment process includes the sum of three links: proportional, integral, and differential to obtain the output current of the current cycle.
[0074] Specifically, a PID controller is a linear controller that forms a deviation between a given value r(t) and an actual output value y(t): e(t) = r(t) - y(t). The proportional (P), integral (I) and differential (D) of the deviation are linearly combined to form a control quantity to control the controlled object. The functions of each correction link of the PID controller are as follows: (1) Proportional link: It immediately and proportionally responds to the deviation signal e(t) of the control system. Once the deviation occurs, the controller immediately produces a control action to reduce the error. When the deviation e = 0, the control action is also 0. Therefore, proportional control is based on the deviation for adjustment, that is, differential adjustment. (2) Integral link: It can memorize the error and is mainly used to eliminate static error and improve the system's zero-error degree. The strength of the integral action depends on the integral time constant Ti. The larger the Ti, the weaker the integral action, and vice versa. (3) Differential link: It can reflect the change trend (rate of change) of the deviation signal and can introduce an effective early correction signal into the system before the deviation signal value becomes too large, thereby speeding up the system's action speed and reducing the adjustment time. From the perspective of time, the proportional action controls the current error of the system, the integral action controls the history of the system error, and the differential action reflects the changing trend of the system error. The combination of these three is a perfect combination of "past, present and future".
[0075] PID output function u(t):
[0076]
[0077] The transfer function formula of PID control is:
[0078]
[0079] In the formula, Kp is the proportional coefficient, Ti is the integral time constant, and Td is the differential time constant; Ki=Kp / Ti, which is the integral coefficient; Kd=Kp*Td, which is the differential coefficient.
[0080] Regarding the selection of PID parameters: (1) Proportional action makes the input and output of the controller proportional. In order to minimize the deviation, speed up the response speed and shorten the adjustment time, it is necessary to increase Kp. However, excessive proportional action will deteriorate the dynamic performance of the system and even make the closed-loop system unstable. (2) The introduction of integral action is conducive to eliminating steady-state errors, but it reduces the stability of the system. In particular, the integral in the large deviation stage often causes the system to produce excessive overshoot and prolong the adjustment time. (3) The introduction of differential action enables the system to respond according to the trend of deviation changes. Appropriate differential action can speed up the system response, effectively reduce overshoot, improve the dynamic characteristics of the system, and increase the stability of the system. The disadvantage is that the differential action is sensitive to interference, which reduces the system's ability to suppress interference. Therefore, the parameter selection of the PID controller must take into account the requirements of dynamic and static performance indicators. Only by reasonably setting the three parameters of Kp, Ki, and Kd can a relatively satisfactory control performance be obtained. In some embodiments, not only does the PID controller automatically set and adjust the parameters of the PID controller, but the user can also manually set and adjust the parameters of the PID controller according to actual needs. PID controller parameter tuning is to set and adjust the parameters of the controller. There are three methods for PID controller parameter tuning: (1) Tuning method based on parameter identification of the controlled process object. This method first identifies the parameter model of the object and then uses theoretical calculation tuning methods such as pole configuration tuning method and cancellation principle method to tune. (2) Parameter tuning method based on extracting the output response characteristics of the object, such as ZN parameter tuning method (also known as critical proportionality method). (3) Parameter optimization method. (4) Expert system method based on pattern recognition and controller parameter online tuning method based on the controller's own control behavior.
[0081] S303, using the output current to charge the supercapacitor in any one of the three modes of constant current, constant voltage, and floating charge.
[0082] See also Figure 7 , Figure 7 : is a sampling effect diagram of the current intermediate value of the rising edge of the current triangle wave of the inductor current in the constant voltage charging mode provided by an embodiment of the present invention, wherein: Figure 7 The current triangle waveforms of two adjacent inductor currents are schematically drawn, where Ic is the middle value of the rising edge of the current triangle wave, and T adc 1 is the sampling time point of the previous cycle, T adc 2 is the sampling time point of the next cycle.
[0083] Accordingly, an embodiment of the present invention further provides a charging current sampling device, which is applied to supercapacitor charging, such as Figure 8 As shown, in some embodiments, a charging current sampling device 80 includes:
[0084] A current acquisition module 801 is a current acquisition module used to acquire a current waveform generated when a pulse width modulation signal flows through an inductor, and to acquire a charging current according to a first current sampling time or a second current sampling time;
[0085] The capacitor charging module 802 is used to provide electrical energy to the supercapacitor.
[0086] As another aspect of an embodiment of the present invention, an embodiment of the present invention provides an electronic device, such as Figure 8 FIG. 1 is a schematic diagram of the hardware structure of the electronic device 90. Fig. 9 The electronic device includes: one or more processors 901 and a memory 902, Fig. 9 A processor 901 is taken as an example.
[0087] The processor 901 and the memory 902 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0088] The memory 902 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to a charging current sampling device in an embodiment of the present application (for example, the attached Figure 7 The processor 801 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and modules stored in the memory 902, that is, the charging current sampling method and / or the supercapacitor charging method of the above method embodiment are implemented.
[0089] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the controller, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 802 may optionally include a memory remotely arranged relative to the processor 901, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0090] The one or more modules are stored in the memory 902, and when executed by the one or more processors 901, the charging current sampling method and / or the supercapacitor charging method in any of the above method embodiments are executed.
[0091] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0092] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by an electronic device to perform the charging current sampling method and / or the supercapacitor charging method in any of the above method embodiments.
[0093] An embodiment of the present invention provides a computer program product, including a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the charging current sampling method and / or the supercapacitor charging method in any of the above method embodiments.
[0094] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions to use at least one computer (which can be a personal computer, a server, or a network, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A charging current sampling method, applied to supercapacitor charging, characterized in that: include: Collect the current waveform generated when the pulse width modulation signal flows through the inductor; Determining whether the duty cycle of the pulse width modulation signal is less than or equal to a preset threshold; If yes, the current sampling time is determined according to the preset first compensation formula, and the current sensor collects the middle value of the falling edge of the inductor current; Otherwise, the current sampling time is determined according to a preset second compensation formula, and the current sensor collects the middle value of the rising edge of the inductor current; Collecting charging current according to the current sampling time; The preset first compensation formula is: The preset second compensation formula is: in, is the base value of the pulse width modulation signal that triggers ADC sampling, is the compensation coefficient generated by the pulse width modulation signal of the previous cycle, is the clock cycle.
2. A supercapacitor charging method, characterized in that: include: Applying the charging current sampling method as claimed in claim 1 to obtain the charging current; Using a preset charging algorithm, based on the charging current, a corresponding output current is calculated, wherein the charging algorithm includes a dual-loop PID control of a voltage loop and a current loop; The output current is used to charge the supercapacitor in any of three modes: constant current, constant voltage, and floating charge.
3. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, the instructions The command is executed by the at least one processor so that the at least one processor can execute the charging current sampling method as claimed in claim 1 and / or the supercapacitor charging method as claimed in claim 2.
4. A non-volatile computer-readable storage medium, characterized in that: The calculation The machine-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the charging current sampling method as claimed in claim 1 and / or the supercapacitor charging method as claimed in claim 2 can be executed.
