Current sampling method, device, equipment and medium

By using the interrupt control signal with frequency doubling relationship and the MOS tube driving signal in current sampling, the sampling point is ensured to be at the midpoint of the inductor current, which solves the problem of difficulty in controlling DC components and current harmonics in the prior art, and improves the current sampling Stability and control stability.

CN119224416APending Publication Date: 2024-12-31ALTENERGY POWER SYST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411425727.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing current sampling method results in large DC components and current harmonics in the output, which affects the quality of the power grid, and has poor control stability, making it difficult to effectively control DC components and current harmonics.

Method used

By outputting the interrupt control signal and the MOS tube driving signal, the inductor current is sampled when the counter reaches the preset value, ensuring that the sampling point is at the midpoint of the rising or falling edge of the inductor current, and avoiding the influence of the opening and closing noise of the MOS tube.

Benefits of technology

It effectively avoids the impact of excessive DC components and current harmonics on the power grid under grid connection, improves the stability of current sampling, and achieves more stable control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119224416A_ABST
    Figure CN119224416A_ABST
Patent Text Reader

Abstract

The invention discloses a current sampling method and device, equipment and a medium, and the method comprises the steps: outputting an interruption control signal and an MOS tube driving signal, and enabling the interruption control signal and the MOS tube driving signal to have a frequency multiplication relation; when a first counter corresponding to the interrupt control signal reaches a first pre-designed value, inductive current is sampled, the inductive current is formed when the MOS tube driving signal drives the opening and closing state of the MOS tube, and when the first counter reaches the first pre-designed value, the sampling of the inductive current is carried out, and when the first counter reaches the second pre-designed value, the sampling of the inductive current is carried out; the inductive current is located at the middle point of the rising edge or the falling edge. Therefore, the stability of current sampling can be improved, and more stable control can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of current sampling, and in particular to a current sampling method, device, equipment and medium. Background Art

[0002] At present, the common energy storage system is through direct fixed-point current sampling, and then the current sampling is applied to the control. This method will cause a large DC component and corresponding current harmonics in the output, which will affect the quality of the power grid. This situation will also cause additional losses and heat, resulting in a shortened equipment life. At the same time, different certification standards now have corresponding requirements for DC components and current harmonics, that is, the DC component and current harmonics need to be controlled within a smaller range. However, it is difficult to achieve effective control of this part according to the traditional sampling method. The current sampling lacks stability, resulting in a lack of control stability. Summary of the invention

[0003] In view of this, the purpose of this application is to provide a current sampling method, device, equipment and medium, which can improve the stability of current sampling to achieve more stable control. The specific scheme is as follows:

[0004] In a first aspect, the present application provides a current sampling method, comprising:

[0005] Outputting an interrupt control signal and a MOS tube driving signal, wherein the interrupt control signal and the MOS tube driving signal have a frequency multiplication relationship;

[0006] When the first counter corresponding to the interrupt control signal reaches a first preset value, the inductor current is sampled, wherein the inductor current is the inductor current formed by the MOS tube drive signal driving the MOS tube to be turned on and off, and when the first counter reaches the first preset value, the inductor current is at the midpoint of the rising edge or the falling edge.

[0007] Optionally, the output interrupt control signal and the MOS tube drive signal include:

[0008] Outputting an interrupt control signal based on a first enhanced pulse width modulation module, wherein the first enhanced pulse width modulation module adopts a rising and falling edge mode;

[0009] The MOS tube driving signal is output based on the second enhanced pulse width modulation module, wherein the second enhanced pulse width modulation module adopts a rising and falling edge mode.

[0010] Optionally, also include:

[0011] When the second count value of the second counter corresponding to the MOS tube driving signal reaches the comparison value set in the second enhanced pulse width modulation module, the MOS tube is driven to perform corresponding switching operations to achieve the reversal of the inductor current.

[0012] Optionally, when the second count value of the second counter corresponding to the MOS tube driving signal reaches the comparison value set in the second enhanced pulse width modulation module, the MOS tube is driven to perform a corresponding opening and closing operation, including:

[0013] When the second count value of the second counter corresponding to the MOS tube driving signal is in an ascending state and the second count value reaches the comparison value, the upper tube of the MOS tube is driven to close and the lower tube of the MOS tube is driven to disconnect;

[0014] When the second count value of the second counter corresponding to the MOS tube driving signal is in a decreasing state and the second count value reaches the comparison value, the upper tube of the MOS tube is driven to be disconnected and the lower tube of the MOS tube is driven to be closed.

[0015] Optionally, before outputting the interrupt control signal and the MOS tube driving signal, the method further includes:

[0016] The count values ​​of the first counter and the second counter are aligned.

[0017] Optionally, sampling the inductor current includes:

[0018] When a sampling signal is detected, the inductor current is sampled, wherein the sampling signal is a signal triggered when a first counter corresponding to the interrupt control signal reaches a first pre-designed value.

[0019] Optionally, after sampling the inductor current, the method further includes:

[0020] When the end point of the cycle corresponding to the interrupt control signal is reached, grid-connected output control is performed based on the sampled inductor current.

[0021] In a second aspect, the present application discloses a current sampling device, comprising:

[0022] A signal output module, including an output interrupt control signal and a MOS tube drive signal, wherein the interrupt control signal and the MOS tube drive signal have a frequency multiplication relationship;

[0023] The inductor current sampling module is used to sample the inductor current when the first counter corresponding to the interrupt control signal reaches a first preset value, wherein the inductor current is the inductor current formed by the MOS tube driving signal driving the MOS tube to be turned on and off, and when the first counter reaches the first preset value, the inductor current is at the midpoint of the rising edge or the falling edge.

[0024] In a third aspect, the present application discloses an electronic device, including a memory and a processor, wherein:

[0025] The memory is used to store the computer program;

[0026] The processor is used to execute the computer program to implement the above-mentioned current sampling method.

[0027] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned current sampling method when executed by a processor.

[0028] It can be seen from the above scheme that the present invention provides a current sampling method, including: outputting an interrupt control signal and a MOS tube drive signal, wherein the interrupt control signal and the MOS tube drive signal have a frequency multiplication relationship; when a first counter corresponding to the interrupt control signal reaches a first pre-designed value, sampling the inductor current, wherein the inductor current is the inductor current formed by the MOS tube drive signal driving the MOS tube in an on-off state, and when the first counter reaches the first pre-designed value, the inductor current is at the midpoint of a rising edge or a falling edge.

[0029] It can be seen that the beneficial effects of the present application are: outputting an interrupt control signal and a MOS tube drive signal with a frequency multiplication relationship, which facilitates the determination of periodic sampling points, ensures that the sampling point of the inductor current is always located at the midpoint of the inductor current, avoids the influence of noise caused by the opening and closing of the MOS tube, and effectively avoids the influence of excessive DC components and current harmonics on the power grid in the case of grid connection, and can improve the stability of current sampling to achieve more stable control.

[0030] Correspondingly, a current sampling device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0032] Figure 1 A flow chart of a current sampling method provided in an embodiment of the present application;

[0033] Figure 2 A schematic diagram of a signal waveform provided in an embodiment of the present application;

[0034] Figure 3 A schematic diagram of a hardware circuit for applying a current sampling method provided in an embodiment of the present application;

[0035] Figure 4 It is a schematic diagram of a test waveform based on a conventional current sampling method;

[0036] Figure 5 It is a schematic diagram of a test waveform based on a conventional current sampling method;

[0037] Figure 6 It is a schematic diagram of a test waveform based on a conventional current sampling method;

[0038] Figure 7 It is a schematic diagram of a test waveform based on a conventional current sampling method;

[0039] Figure 8 A schematic diagram of a test waveform corresponding to a current sampling method provided in an embodiment of the present application;

[0040] Fig. 9 A schematic diagram of a test waveform corresponding to a current sampling method provided in an embodiment of the present application;

[0041] Fig.10 A schematic diagram of a test waveform corresponding to a current sampling method provided in an embodiment of the present application;

[0042] Fig.11 A schematic diagram of a test waveform corresponding to a current sampling method provided in an embodiment of the present application;

[0043] Fig.12 A schematic diagram of the structure of a current sampling device provided in an embodiment of the present application;

[0044] Fig.13 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] See also Figure 1 As shown, the embodiment of the present application discloses a current sampling method, including:

[0047] Step S11: outputting an interrupt control signal and a MOS tube (Metal-Oxide-Semiconductor Field-Effect Transistor) driving signal, wherein the interrupt control signal and the MOS tube driving signal have a frequency multiplication relationship.

[0048] Among them, the interrupt control signal is used to perform grid-connected output control when the preset interrupt condition is met. The MOS tube drive signal is used to drive the on and off state of the MOS tube. The frequency multiplication relationship refers to the existence of an integer multiple relationship between signal frequencies. In this embodiment, the frequency of the MOS tube drive signal is higher than the frequency of the interrupt control signal, for example, a 3-fold frequency multiplication relationship, that is, the frequency of the MOS tube drive signal is 3 times the frequency of the interrupt control signal. Both the interrupt control signal and the MOS tube drive signal can be triangular waves, and both can be in the form of a rising edge first and a falling edge later.

[0049] In an optional implementation, an interrupt control signal can be output based on a first enhanced pulse width modulation module, wherein the first enhanced pulse width modulation module adopts a rising and falling edge mode; a MOS tube drive signal can be output based on a second enhanced pulse width modulation module, wherein the second enhanced pulse width modulation module adopts a rising and falling edge mode. The first enhanced pulse width modulation module and the second enhanced pulse width modulation module can be enhanced pulse width modulation modules in an MCU (i.e., Microcontroller Unit). The rising and falling edge mode can be understood as the configuration of the enhanced pulse width modulation module as a rising and falling edge, so that the pulse width modulation waveform undergoes specific actions or changes at both the rising and falling edges of the counter. An increase and decrease counting mode is adopted, that is, the counter increases first and then decreases.

[0050] In this embodiment, when the second count value of the second counter corresponding to the MOS tube drive signal reaches the comparison value set in the second enhanced pulse width modulation module, the MOS tube is driven to perform corresponding opening and closing operations to achieve the reversal of the inductor current. The MOS tube drive signal is a rising and falling edge, and when the second count value reaches the comparison value set in the second enhanced pulse width modulation module at the rising and falling edges, the MOS tube will be driven to perform corresponding opening and closing operations to achieve the reversal of the inductor current. For example, when the peak value of the counter is 1000, 500 is reversed in the rising state, and 500 is also reversed in the falling state. In this way, the inductor current corresponding to the peak value 1000 is the midpoint of the inductor.

[0051] In an optional implementation, when the second count value of the second counter corresponding to the MOS tube drive signal is in an ascending state and the second count value reaches the comparison value, the upper tube of the MOS tube is driven to close and the lower tube of the MOS tube is disconnected; when the second count value of the second counter corresponding to the MOS tube drive signal is in a descending state and the second count value reaches the comparison value, the upper tube of the MOS tube is driven to disconnect and the lower tube of the MOS tube is closed. By driving the opening and closing states of the upper tube of the MOS tube and the lower tube of the MOS tube, the inductor can be controlled to charge and discharge, and the direction of the inductor current can be reversed. The upper tube can be understood as a MOS tube connected between the positive pole (or high potential end) of the power supply and the load, which is responsible for controlling the on-off of the power supply to the load. The lower tube can be understood as a MOS tube connected between the load and the ground (or low potential end), which is responsible for controlling the on-off of the load and the ground.

[0052] Among them, an initial comparison value can be set, and the comparison value is subsequently determined based on the target current of the grid-connected output control. The target current is an ideal current.

[0053] Step S12: When the first counter corresponding to the interrupt control signal reaches a first preset value, the inductor current is sampled, wherein the inductor current is the inductor current formed by the MOS tube drive signal driving the MOS tube to open or close, and when the first counter reaches the first preset value, the inductor current is at the midpoint of the rising edge or the falling edge.

[0054] In this embodiment, before outputting the interrupt control signal and the MOS tube driving signal, the count values ​​of the first counter and the second counter may be aligned, for example, both starting to count from 0.

[0055] It is understandable that in this embodiment, the sampling point can be set to the midpoint of the inductor current by setting the first pre-designed value.

[0056] In an optional implementation, the inductor current may be sampled when a sampling signal is detected, wherein the sampling signal is a signal triggered when the first counter corresponding to the interrupt control signal reaches a first pre-designed value. That is, when the first counter corresponding to the interrupt control signal reaches a first pre-designed value, the sampling signal is triggered, such as an ADC (Analog-to-Digital Converter) signal, and when the ADC signal is detected, the inductor current is sampled.

[0057] Furthermore, when the end point of the cycle corresponding to the interrupt control signal is reached, the grid-connected output control is performed based on the sampled inductor current. Grid-connected output control refers to the process of converting the electric energy generated by distributed energy (such as solar energy, wind energy, etc.) into alternating current with the same grid voltage and frequency through an inverter, and safely and stably connecting it to the grid. The purpose of grid connection can be achieved by using the output inductor current as the control quantity and the inverter outputting a current signal with the same frequency and phase as the grid voltage.

[0058] In this embodiment, the inductor current may be collected once within a period corresponding to the interrupt control signal, and the grid-connected output control may be performed at the end of the period, so that periodic control may be achieved.

[0059] In a specific implementation, when the first counter reaches the first pre-designed value, the inductor current may be at the midpoint of the rising edge or the midpoint of the falling edge. The first pre-designed value may be the count value in the rising state of the interrupt control signal or the count value in the falling state.

[0060] In this embodiment, the PWM (i.e., Pulse Width Modulation) (i.e., the interrupt control signal) for controlling sampling has a frequency multiple relationship with the MOS tube driving PWM (i.e., the MOS tube driving signal), and based on this, the midpoint of the inductor current is sampled. The midpoint of the inductor current is the midpoint of the MOS tube being turned on and off. Since signal noise is usually generated when the MOS tube is turned on and off, the influence of the MOS switch noise on the sampling can be effectively avoided by avoiding the time point corresponding to the MOS switch.

[0061] It can be seen that the embodiment of the present application outputs an interrupt control signal and a MOS tube drive signal having a frequency multiplication relationship, which facilitates the determination of periodic sampling points, ensures that the sampling point of the inductor current is always located at the midpoint of the inductor current, avoids the influence of noise caused by the opening and closing of the MOS tube, and effectively avoids the influence of excessive DC components and current harmonics on the power grid in the case of grid connection, and can improve the stability of current sampling to achieve more stable control.

[0062] Below, taking the current sampling process controlled by a 32-bit floating-point microcontroller unit (MCU) as an example, the current sampling solution provided by the present application is further described. The relationship between the sampling PWM and the MOS tube driving PWM frequency multiplication is controlled by software, which can be referred to in the attached Figure 1 , EPWM (Enhanced Pulse Width Modulation) 1 is used as the sampling PWM, EPWM2 is used as the DC-AC (DC-AC inverter) MOS control signal, the software configuration is aligned, and EPWM2 is 3 times the frequency of EPWM1.

[0063] Use the MCU's EPWM1 ​​to generate an interrupt control signal with a period of 60us, and use the MCU's EPWM2 to generate a DC-AC drive signal (i.e., MOS tube drive signal), with a control period of 20us and a frequency of 50K. At the same time, align the counts of EPWM1 ​​and EPWM2 through software configuration. At this time, the DC-AC drive signal is 3 times the frequency of the timing control signal (i.e., interrupt control signal). See Figure 2 As shown, Figure 2 A signal waveform diagram provided for an embodiment of the present application. The interrupt control EPWM (i.e., EPWM1) outputs an interrupt control signal. The CLA interrupt (i.e., the interrupt control signal) has a period of 60us. The EPWM mode is used for rising and falling edges, and the period is 2*3000*10ns. The ADC signal is triggered at 1000 counts on the falling edge to sample the inductor current. The MOS tube control EPWM (i.e., EPWM2) outputs a MOS tube drive signal. The DC-AC MOS tube drive (i.e., the MOS tube drive signal) has a period of 20us. The EPWM mode is used for rising and falling edges, and the period is 2*1000*10ns. For EPWM2, CMPA is the comparison value of EPWM2: when the counter rises, when this value is reached, the upper tube is closed and the lower tube is disconnected. When the counter rises, when this value is reached, the upper tube is disconnected and the lower tube is closed. CMPA is an internal register of the MCU. Through this register value, the opening time of the upper and lower tubes can be changed. For example, if CMPA is configured to be 500, the upper tube is closed when the count value reaches 500 on the rising edge and the lower tube is disconnected. When the count value reaches 500 on the falling edge, the upper tube is disconnected and the lower tube is closed. Figure 2 For further information, see Figure 3 As shown, Figure 3 A hardware circuit diagram of a current sampling method provided in this embodiment, MOS tubes Q1 and Q4 are controlled by the same signal, Q2 and Q3 are controlled by the same signal, and the control signals of Q1 and Q2 are complementary. Q1 and Q4 are MOS tube upper tubes, that is, Q1 and Q4 are controlled by the MOS tube upper tube drive signal, and Q2 and Q3 are MOS tube lower tubes. Q2 and Q3 are controlled by the MOS tube lower tube drive signal, and L1 and L2 are inductors. i a is the inductor current, u a is the inductor voltage, S1 is the switch, AC is the AC power supply, and Ve is the bus voltage.

[0064] In this way, the sampling point is configured at the position of 1000 counts of the falling edge of the EPWM1 ​​interrupt. At this time, it can be seen that the current sampling point is completely aligned with the midpoint of the inductor current. In addition, due to the use of fixed-frequency control, the changes in the comparison value of CMPA are complementary to the upper and lower tubes, and the falling edge of the timer is always aligned with the midpoint of the falling edge of the inductor current. If sampling is performed at other positions, the sampled current value will fluctuate at different positions of the inductor current, and the stability of the current sampling will be very poor.

[0065] Among them, the 32-bit floating-point microcontroller unit can be an F28004x device, such as F280049C, and the related resources are suitable for micro inverter and energy storage application scenarios. The F280049C can be used to implement the DC-AC control process. That is, the EPWM1 ​​of the F280049C is used to output the interrupt control signal, and the EPWM2 is used to output the DC-AC drive signal.

[0066] This embodiment uses a 32-bit floating-point microcontroller unit to implement the DC-AC control process. Based on the midpoint current sampling under PWM fixed-frequency control, the noise generated when the MOS tube is turned on can be effectively avoided. At the same time, the current can be stably sampled for control, making the control more stable. Based on the PWM fixed-frequency control, the stable control of the grid-connected output is better achieved. This solution can be applied to the field of distributed energy grid-connected power generation technology, such as the field of photovoltaic grid-connected power generation technology. This method optimizes the inverter control system, and performs corresponding grid-connected output control by sampling the midpoint of the inductor current, better controlling the DC component and current harmonics, and effectively avoiding the interference of the grid-connected energy storage inverter to the power grid. At the same time, it reduces its own additional losses and heat.

[0067] See also Figures 4 to 7 As shown, Figures 4 to 7 This is a test waveform diagram based on the conventional current sampling method. Purple is the grid-side voltage, and yellow is the inductor current. It can be seen that the symmetry of the inductor current waveform is very poor, which will also lead to poor Idc (Direct Current) and Ithd (Total Harmonic Distortion of Current) of the device. Figures 4 to 7 Corresponding waveforms at different powers. Figures 8 to 11 , Figures 8 to 11 This is a test waveform diagram corresponding to the current sampling method provided in the embodiment of the present application. The current sampling scheme provided in the present application is adopted. The purple is the grid side voltage, and the yellow is the inductor current. It can be seen that the inductor current waveform has good symmetry, reducing the existence of Idc. Such a waveform has better Idc and Ithd, and has less impact on the grid environment. See Figures 8 to 11 Corresponding waveforms at different powers.

[0068] See also Fig.12 As shown, the embodiment of the present application discloses a current sampling device, comprising:

[0069] The signal output module 11 includes an output interrupt control signal and a MOS tube drive signal, wherein the interrupt control signal and the MOS tube drive signal have a frequency multiplication relationship;

[0070] The inductor current sampling module 12 is used to sample the inductor current when the first counter corresponding to the interrupt control signal reaches a first preset value, wherein the inductor current is the inductor current formed by the MOS tube driving signal driving the MOS tube to be turned on and off, and when the first counter reaches the first preset value, the inductor current is at the midpoint of the rising edge or the falling edge.

[0071] Among them, the signal output module 11 is specifically used to: output an interrupt control signal based on the first enhanced pulse width modulation module, wherein the first enhanced pulse width modulation module adopts a rising and falling edge mode; output a MOS tube drive signal based on the second enhanced pulse width modulation module, wherein the second enhanced pulse width modulation module adopts a rising and falling edge mode.

[0072] Furthermore, the device also includes a MOS tube driving module, which is used to drive the MOS tube to perform corresponding opening and closing operations when the second count value of the second counter corresponding to the MOS tube driving signal reaches the comparison value set in the second enhanced pulse width modulation module to achieve the reversal of the inductor current.

[0073] Among them, the MOS tube driving module is specifically used to: when the second count value of the second counter corresponding to the MOS tube driving signal is in an ascending state and the second count value reaches the comparison value, drive the upper tube of the MOS tube to close and the lower tube of the MOS tube to disconnect; when the second count value of the second counter corresponding to the MOS tube driving signal is in a descending state and the second count value reaches the comparison value, drive the upper tube of the MOS tube to disconnect and the lower tube of the MOS tube to close.

[0074] Furthermore, the device also includes a count value alignment module, which is used to align the count values ​​of the first counter and the second counter before outputting the interrupt control signal and the MOS tube driving signal.

[0075] In this embodiment, the inductor current sampling module 12 is specifically used to sample the inductor current when a sampling signal is detected, wherein the sampling signal is a signal triggered when a first counter corresponding to the interrupt control signal reaches a first pre-designed value.

[0076] Furthermore, the device also includes a control module, which is used to perform grid-connected output control based on the sampled inductor current when the end point of the cycle corresponding to the interrupt control signal is reached after the inductor current is sampled.

[0077] It can be seen that the embodiment of the present application outputs an interrupt control signal and a MOS tube drive signal having a frequency multiplication relationship, which facilitates the determination of periodic sampling points, ensures that the sampling point of the inductor current is always located at the midpoint of the inductor current, avoids the influence of noise caused by the opening and closing of the MOS tube, and effectively avoids the influence of excessive DC components and current harmonics on the power grid in the case of grid connection, and can improve the stability of current sampling to achieve more stable control.

[0078] See also Fig.13 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to execute the computer program, the current sampling method disclosed in the above embodiment.

[0079] For the specific process of the above current sampling method, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0080] Furthermore, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0081] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26; wherein the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0082] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the current sampling method disclosed in the aforementioned embodiment.

[0083] For the specific process of the above current sampling method, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0084] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0085] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0086] The above is a detailed introduction to a current sampling method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A current sampling method, characterized in that: include: Outputting an interrupt control signal and a MOS tube driving signal, wherein the interrupt control signal and the MOS tube driving signal have a frequency multiplication relationship; When the first counter corresponding to the interrupt control signal reaches a first preset value, the inductor current is sampled, wherein the inductor current is the inductor current formed by the MOS tube drive signal driving the MOS tube to be turned on and off, and when the first counter reaches the first preset value, the inductor current is at the midpoint of the rising edge or the falling edge.

2. The current sampling method according to claim 1, characterized in that: The output interrupt control signal and the MOS tube drive signal include: Outputting an interrupt control signal based on a first enhanced pulse width modulation module, wherein the first enhanced pulse width modulation module adopts a rising and falling edge mode; The MOS tube driving signal is output based on the second enhanced pulse width modulation module, wherein the second enhanced pulse width modulation module adopts a rising and falling edge mode.

3. The current sampling method according to claim 2, characterized in that: Also includes: When the second count value of the second counter corresponding to the MOS tube driving signal reaches the comparison value set in the second enhanced pulse width modulation module, the MOS tube is driven to perform corresponding switching operations to achieve the reversal of the inductor current.

4. The current sampling method according to claim 3, characterized in that: When the second count value of the second counter corresponding to the MOS tube driving signal reaches the comparison value set in the second enhanced pulse width modulation module, the MOS tube is driven to perform a corresponding opening and closing operation, including: When the second count value of the second counter corresponding to the MOS tube driving signal is in an ascending state and the second count value reaches the comparison value, the upper tube of the MOS tube is driven to close and the lower tube of the MOS tube is driven to disconnect; When the second count value of the second counter corresponding to the MOS tube driving signal is in a decreasing state and the second count value reaches the comparison value, the upper tube of the MOS tube is driven to be disconnected and the lower tube of the MOS tube is driven to be closed.

5. The current sampling method according to claim 3, characterized in that: Before outputting the interrupt control signal and the MOS tube driving signal, it also includes: The count values ​​of the first counter and the second counter are aligned.

6. The current sampling method according to claim 1, characterized in that: The sampling of the inductor current comprises: When a sampling signal is detected, the inductor current is sampled, wherein the sampling signal is a signal triggered when a first counter corresponding to the interrupt control signal reaches a first pre-designed value.

7. The current sampling method according to any one of claims 1 to 6, characterized in that: After sampling the inductor current, the method further includes: When the end point of the cycle corresponding to the interrupt control signal is reached, grid-connected output control is performed based on the sampled inductor current.

8. A current sampling device, characterized in that: include: A signal output module, including an output interrupt control signal and a MOS tube drive signal, wherein the interrupt control signal and the MOS tube drive signal have a frequency multiplication relationship; The inductor current sampling module is used to sample the inductor current when the first counter corresponding to the interrupt control signal reaches a first preset value, wherein the inductor current is the inductor current formed by the MOS tube driving signal driving the MOS tube to be turned on and off, and when the first counter reaches the first preset value, the inductor current is at the midpoint of the rising edge or the falling edge.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the current sampling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the current sampling method according to any one of claims 1 to 7 is implemented.