A single-resistor current sampling method, system, device, and medium

By calculating the pulse width difference of the three-phase PWM wave within the sector and processing the waveform, and configuring sampling points for current reconstruction, the accuracy problem of single-resistor current sampling beyond the linear modulation region is solved, achieving efficient and low-cost current sampling.

CN114355018BActive Publication Date: 2026-01-13GUANGZHOU SANJING ELETRIC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111649435.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2026-01-13
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

Existing single-resistor current sampling methods cannot perform sampling outside the linear modulation region, resulting in poor sampling accuracy.

Method used

By calculating the difference in pulse width of the three-phase PWM waves within the sector, waveform processing is performed to determine the target three-phase PWM waves. Sampling points are then configured for current reconstruction, and the three-phase current values ​​are calculated in conjunction with the current direction.

Benefits of technology

It reduces sampling data errors, adapts to different operating conditions, and lowers costs, requiring only a resistor and an operational amplifier to achieve current sampling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114355018B_ABST
    Figure CN114355018B_ABST
Patent Text Reader

Abstract

The application discloses a single-resistance current sampling method, system, device and medium, and the method comprises the following steps: calculating a pulse width difference value through a three-phase PWM wave pulse width in a sector, performing waveform processing according to the pulse width difference value result, and determining a target three-phase PWM wave; configuring a sampling point for the target three-phase PWM wave, sampling through a converter, and performing current reconstruction according to the sampling result to determine a sampling current value; determining a current direction according to a sector, and calculating a three-phase current value in combination with the sampling current value; the embodiment of the application can reduce the error of sampling data by performing waveform processing on the PWM wave, and can be widely applied to the technical field of motor control.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of motor control, and in particular to a single-resistance current sampling method, system, device and medium. BACKGROUND

[0002] At present, there are three schemes for current sampling, namely single-resistance sampling, double-resistance sampling and triple-resistance sampling. The double-resistance sampling uses two resistors to sample current, but since the two-phase current sampled must be used directly, the sampling window needs to be considered, and the pulse width modulation (PWM) waveform needs to be deformed, which increases the complexity of the algorithm. The triple-resistance sampling uses three resistors to collect three-phase current of the motor, but it needs to use three resistors and three operational amplifiers, resulting in high use cost. The single-resistance sampling uses a single resistor for sampling, which can reduce the cost to the greatest extent. However, the existing single-resistance sampling method cannot sample beyond the linear modulation region, and the accuracy of the sampling result is poor. SUMMARY

[0003] Therefore, the embodiments of the present application provide a single-resistance current sampling method, system, device and medium to reduce the error of the sampling data.

[0004] In one aspect, the present application provides a single-resistance current sampling method, comprising:

[0005] calculating a pulse width difference value according to the pulse width of the three-phase PWM wave in the sector, performing waveform processing according to the pulse width difference value result, and determining a target three-phase PWM wave;

[0006] configuring a sampling point for the target three-phase PWM wave, sampling through a converter, reconstructing current according to the sampling result, and determining a sampling current value;

[0007] determining a three-phase current value according to the sampling current value and the current direction determined according to the sector.

[0008] Optionally, the calculating a pulse width difference value according to the pulse width of the three-phase PWM wave in the sector, performing waveform processing according to the pulse width difference value result, and determining a target three-phase PWM wave comprises:

[0009] sorting the pulse width of the three-phase PWM wave in the sector to determine a first phase, a second phase and a third phase;

[0010] calculating a first pulse width difference value for the first phase and the second phase;

[0011] calculating a second pulse width difference value for the second phase and the third phase;

[0012] The first pulse width difference value and the second pulse width difference value are compared with a first threshold value respectively, and waveform processing is performed according to a comparison result to determine a target three-phase PWM wave.

[0013] Optionally, the comparing the first pulse width difference value and the second pulse width difference value with the first threshold value respectively and performing waveform processing according to a comparison result to determine the target three-phase PWM wave comprises:

[0014] When the first pulse width difference value or the second pulse width difference value is less than the first threshold value, phase shift processing is performed on the initial three-phase PWM wave to determine the target three-phase PWM wave.

[0015] Optionally, the comparing the first pulse width difference value and the second pulse width difference value with the first threshold value respectively and performing waveform processing according to a comparison result to determine the target three-phase PWM wave further comprises:

[0016] When the first pulse width difference value is equal to the second pulse width difference value, an overflow update or an underflow update is performed by a timer to configure a PWM wave to determine the target three-phase PWM wave.

[0017] Optionally, the configuring a sampling point for the target three-phase PWM wave, sampling by a converter, and performing current reconstruction according to a sampling result to determine a sampling current value comprises:

[0018] A first sampling point and a second sampling point are set in a period of the target three-phase PWM wave, and sampling is performed by the converter when the first sampling point and the second sampling point are reached to obtain sampling data;

[0019] The sampling data is transmitted by DMA, the sampling data is saved when a DMA interrupt occurs, and current reconstruction is performed when a timer underflow interrupt occurs to determine the sampling current value.

[0020] Optionally, the configuring a sampling point for the target three-phase PWM wave, sampling by a converter, and performing current reconstruction according to a sampling result to determine a sampling current value further comprises:

[0021] When a timer overflow interrupt occurs, a first value is updated to a register, wherein the first value is used to represent a sampling value when underflow calculation is performed in a previous period;

[0022] Sampling is performed by the converter, a second value is saved by a DMA interrupt, and the first value is updated to a buffer, wherein the second value is used to represent a sampling value in a current period;

[0023] When a timer underflow interrupt occurs, current reconstruction is performed according to the second value, the first value is updated to the register, and a sampling current value is calculated by a space vector pulse width modulation algorithm, and the sampling current value is updated to the buffer.

[0024] Optionally, the three-phase current value is calculated according to the current direction and the sampling current value.

[0025] The current direction is determined according to the high and low of the PWM wave level in the sector, and the positive and negative values of the sampling current value are determined according to the current direction;

[0026] The three-phase current value is calculated according to the Kirchhoff's current law.

[0027] In another aspect, the embodiment of the present application further discloses a single-resistance current sampling system, comprising:

[0028] The first module is configured to calculate a pulse width difference value according to the pulse width of the three-phase PWM wave in the sector, perform waveform processing according to the pulse width difference value, and determine a target three-phase PWM wave.

[0029] The second module is configured to configure a sampling point for the target three-phase PWM wave, perform sampling through a converter, perform current reconstruction according to the sampling result, and determine a sampling current value.

[0030] The third module is configured to determine a current direction according to the sector, and calculate a three-phase current value in combination with the sampling current value.

[0031] In another aspect, the embodiment of the present application further discloses an electronic device, comprising a processor and a memory.

[0032] The memory is configured to store a program.

[0033] The processor executes the program to realize the method as described above.

[0034] In another aspect, the embodiment of the present application further discloses a computer readable storage medium, which stores a program. The program is executed by a processor to realize the method as described above.

[0035] In another aspect, the embodiment of the present application further discloses a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the method as described above.

[0036] Compared with the prior art, the application has the following technical effects: the embodiment of the application calculates the pulse width difference value by the pulse width of the three-phase PWM wave in the sector, processes the waveform according to the pulse width difference value, and determines the target three-phase PWM wave; the sampling points are configured for the target three-phase PWM wave, sampling is performed through the converter, the current is reconstructed according to the sampling result, and the sampling current value is determined; the current direction is determined according to the sector, and the three-phase current value is calculated in combination with the sampling current value; the embodiment of the application can reduce the error of the sampling data by processing the waveform of the PWM wave. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0038] Figure 1 A flow chart of a sampling method of the embodiment of the application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0040] The embodiment of the application provides a single-resistance current sampling method, which comprises:

[0041] S101, calculating the pulse width difference value according to the pulse width of the three-phase PWM wave in the sector, processing the waveform according to the pulse width difference value, and determining the target three-phase PWM wave;

[0042] S102, configuring the sampling points for the target three-phase PWM wave, sampling through the converter, reconstructing the current according to the sampling result, and determining the sampling current value;

[0043] S103, determining the current direction according to the sector, and calculating the three-phase current value in combination with the sampling current value.

[0044] Further as a preferred embodiment, in the step S101, the pulse width difference value is calculated by the pulse width of the three-phase PWM wave in the sector, the waveform is processed according to the pulse width difference value, and the target three-phase PWM wave is determined, which comprises:

[0045] The pulse width of the three-phase PWM wave in the sector is sorted to determine the first phase, the second phase and the third phase;

[0046] The first phase and the second phase are subjected to pulse width difference value calculation to determine a first pulse width difference value;

[0047] The second phase and the third phase are subjected to pulse width difference value calculation to determine a second pulse width difference value;

[0048] The first pulse width difference value and the second pulse width difference value are compared with a first threshold value respectively, waveform processing is performed according to the comparison result, and a target three-phase PWM wave is determined.

[0049] In the embodiment, the three-phase full bridge used in the driving control is composed of three half bridges of six switching devices. Since the upper and lower bridge arms cannot be opened at the same time, there are a total of 8 switching states. The embodiment is provided with two zero vectors and six effective vectors, and the voltage space of 360 degrees is divided into 60-degree sectors, a total of six sectors. Each sector is allocated with an IGBT (Insulated Gate Bipolar Transistor) base drive signal. According to the PWM (Pulse Width Modulation) wave pulse width size of the drive signal, the three-phase PWM wave can be sorted, and the first phase, the second phase and the third phase are obtained in turn according to the sorting result. The first pulse width difference value is obtained by performing pulse width difference value calculation on the first phase and the second phase, and the second pulse width difference value is obtained by performing pulse width difference value calculation on the second phase and the third phase. The first pulse width difference value and the second pulse width difference value are compared with a first threshold value respectively. The first threshold value is the minimum sampling window, which is the sum of the dead time, the ADC (Analog / Digital Converter) conversion time, the IGBT rise time and the current stabilization time. The first pulse width difference value and the second pulse width difference value are the first sampling window and the second sampling window respectively. The first sampling window and the second sampling window are compared with the minimum sampling window respectively, different waveform processing is performed according to the comparison result, and the processed target three-phase PWM wave is obtained, so as to improve the accuracy of the sampling data.

[0050] Further as a preferred embodiment, the comparison of the first pulse width difference value and the second pulse width difference value with the first threshold value and the waveform processing according to the comparison result to determine the target three-phase PWM wave comprises:

[0051] When the first pulse width difference value or the second pulse width difference value is less than the first threshold value, the initial three-phase PWM wave is subjected to phase shift processing, and the target three-phase PWM wave is determined.

[0052] The first pulse width difference value and the second pulse width difference value are compared with the first threshold value respectively, and when the sampling window is greater than or equal to the minimum window, the two phases with the same or close pulse width are subjected to phase shift processing. When the first pulse width difference value and the second pulse width difference value are both greater than or equal to the first threshold value, it is the most ideal case and no waveform processing is needed; when the first pulse width difference value is less than the first threshold value, there is no window between the first phase and the second phase and the first zero vector time is greater than the first threshold value, the first phase is subjected to right shift processing; when the second pulse width difference value is less than the first threshold value, there is no window between the second phase and the third phase and the second zero vector time is greater than the first threshold value, the third phase is subjected to left shift processing; when the first pulse width difference value is less than the first threshold value and the first zero vector time is less than the first threshold value, the first phase is subjected to right shift processing and the third phase is subjected to left shift processing; when the second pulse width difference value is less than the first threshold value and the second zero vector time is less than the first threshold value, the first phase is subjected to right shift processing and the third phase is subjected to left shift processing.

[0053] Further as a preferred implementation, the comparison of the first pulse width difference value and the second pulse width difference value with the first threshold value and the waveform processing according to the comparison result to determine the target three-phase PWM wave further comprises:

[0054] When the first pulse width difference value is equal to the second pulse width difference value, the PWM wave is configured by overflow update or underflow update of a timer to determine the target three-phase PWM wave.

[0055] When the first pulse width difference value is equal to the second pulse width difference value, it indicates that the three phases are equal or close in size, and phase shift processing cannot be performed. A pair of complementary asymmetric PWM waves are configured by overflow update or underflow update of a timer. The timer can generate an update time once each time overflow occurs. When the timer is set to center alignment mode, overflow and underflow update events occur twice. The center alignment mode is that the timer is configured to count up, starting from zero to the period value and then decreasing from the period value to zero, and the count value is symmetric around the period value. In the operation process of the embodiment of the application, a shadow register is used. When configured as buffer update, the duty cycle is written into the register only when the next update time occurs, and otherwise, when configured as immediate update, the duty cycle is immediately written into the register.

[0056] Further as a preferred implementation, in the step S102, the sampling points of the target three-phase PWM wave are configured, sampling is performed by a converter, and the sampling current value is determined according to the sampling result, which comprises:

[0057] The first sampling point and the second sampling point are set in one cycle of the target three-phase PWM wave, and sampling is performed through the converter when the first sampling point and the second sampling point are reached, so as to obtain sampling data.

[0058] The sampling data is transmitted through DMA, the sampling data is saved when a DMA interrupt occurs, and current reconstruction is performed when a timer underflow interrupt occurs, so as to determine a sampling current value.

[0059] In the embodiment of the present application, the bus current is sampled twice in one PWM cycle, the first sampling point is set between the first phase and the second phase, and the second sampling point is set between the second phase and the third phase. When the first sampling point is reached, the ADC (analog-to-digital converter) is triggered to complete the first sampling in the current cycle, and when the second sampling point is reached, the ADC is triggered to complete the second sampling. The two sampling data are transmitted through DMA (direct memory access), the sampling data is saved when a DMA interrupt occurs, and current reconstruction is performed when a timer underflow interrupt occurs, so as to obtain a sampling current value.

[0060] Further, in the step S102, the target three-phase PWM wave is configured with a sampling point, sampling is performed through a converter, and current reconstruction is performed according to the sampling result to determine a sampling current value, and the step S102 further includes:

[0061] When a timer overflow interrupt occurs, the first value is updated to a register, wherein the first value is used to represent a sampling value when the underflow calculation of the last cycle is performed;

[0062] Sampling is performed through a converter, a second value is saved through a DMA interrupt, and the first value is updated to a buffer, wherein the second value is used to represent a sampling value in the current cycle;

[0063] When a timer underflow interrupt occurs, current reconstruction is performed according to the second value, the first value is updated to a register, a sampling current value is calculated through a space vector pulse width modulation algorithm, and the sampling current value is updated to a buffer.

[0064] In the application, when the timer overflow interrupt is generated, the PWM (pulse width modulation) is configured to buffer update, and the last calculated sampling time point is updated to the register; in the overflow interrupt, the PWM is configured to update immediately, and the first value, i.e. the sampling value in the last period underflow calculation, is updated to the register; after the ADC (analog / digital converter) sampling is completed, the second value, i.e. the current period sampling value, is saved through the DMA (direct memory access) interrupt; in the DMA interrupt, the PWM is reconfigured to buffer update, and the first value is updated to the buffer; when the timer underflow interrupt is generated, the first value is updated to the register in the overflow interrupt, and the second value saved in the DMA interrupt in the last period is used to reconstruct the current in the last period, and the SVPWM (space vector pulse width modulation) algorithm is used to calculate the PWM duty cycle, the sampling point is calculated, and the sampling current value sampled at the sampling point is updated to the buffer.

[0065] Further, as a preferred embodiment, in the step S103, the three-phase current value is calculated according to the sampling current value and the current direction determined according to the sector, and the step of calculating the three-phase current value according to the sampling current value includes:

[0066] The current direction is determined according to the high and low levels of the PWM wave in the sector, and the positive and negative values of the sampling current value are determined according to the current direction.

[0067] The three-phase current value is calculated according to the sampling current value based on the Kirchhoff's current law.

[0068] The three-phase current direction can be determined according to the sector, and it is assumed that the PWM high level is in and the low level is out. Taking the base drive signal in the sector as an example, if the first sampling current direction is W in and VU out, the W-phase current is sampled; the second sampling current direction is WV in and U out, and the U-phase current is sampled. It is assumed that the in current direction is positive and the out current direction is negative, and the sampling current value can be obtained in the same way. Finally, the three-phase current value is calculated based on the Kirchhoff's current law.

[0069] The application further discloses a single-resistor current sampling system, which comprises:

[0070] The first module is configured to calculate the pulse width difference value according to the pulse width of the three-phase PWM wave in the sector, perform waveform processing according to the pulse width difference value, and determine the target three-phase PWM wave.

[0071] The second module is configured to configure the sampling point for the target three-phase PWM wave, sample through the converter, reconstruct the current according to the sampling result, and determine the sampling current value.

[0072] The third module is configured to determine the current direction according to the sector, and calculate the three-phase current value in combination with the sampling current value.

[0073] According to the method of the application, the application further provides an electronic device, which comprises a processor and a memory. Figure 1 The memory is configured to store a program, and the processor is configured to execute the program to implement the method as described above.

[0074] According to the method of the application, the application further provides an electronic device, which comprises a processor and a memory. Figure 1 The memory is configured to store a program, and the processor is configured to execute the program to implement the method as described above.

[0075] The application further discloses a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. Figure 1 The processor of the computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to execute the method as shown in the figure.

[0076] In conclusion, the application has the following advantages:

[0077] (1) The application can process the waveform of the reference voltage vector exceeding the range of the linear modulation zone in the sampling process, thereby reducing the error of the sampling data.

[0078] (2) The application processes different sampling conditions correspondingly, and can adapt to different operating states.

[0079] (3) The application uses the timer double updating method, and only one resistor and an operational amplifier are needed in the current sampling, so that the application can be implemented without a high-end single-chip microcomputer, thereby reducing the cost.

[0080] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation diagram. For example, two blocks shown in succession can actually be executed substantially simultaneously or the blocks can be executed in reverse order depending on the functions / operations involved. In addition, the embodiments presented and described in the flowcharts of the application are provided by way of example, and the purpose is to provide a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently executed.

[0081] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the described functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It will also be appreciated that detailed discussion of the actual implementation of each module is not necessary to an understanding of the application. Rather, the actual implementation of the modules, in combination with their attributes, functions, and internal relationships, are to be understood within the context of the devices disclosed herein. Thus, those skilled in the art with access to patents, scientific journals, and other public sources known by those skilled in the art will be able, using ordinary skill, to practice the application as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and that the scope of the present application is to be determined by the entire scope of the claims, along with all equivalents of the claims and their equivalents.

[0082] If the functions are implemented in software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions of the present application can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0083] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing logic functions, and can be specifically embodied in any computer readable medium for use by an instruction execution system, device or apparatus, such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from the instruction execution system, device or apparatus, or in conjunction with these instructions. For the purpose of this specification, "computer readable medium" can be any device that can contain, store, communicate, propagate or transport programs for use by an instruction execution system, device or apparatus, or in conjunction with these instructions.

[0084] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0085] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following techniques can be used to implement the hardware used in the described embodiments: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.

[0086] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or more embodiments or examples.

[0087] Although embodiments of the present application have been shown and described, it would be recognized by those of ordinary skill in the art that various changes, modifications, alternatives, and variations can be made to the embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.

[0088] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the described embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A single-resistor current sampling method, characterized by, The method comprises the steps of: calculating the pulse width difference value of the three-phase PWM wave in the sector, processing the waveform according to the pulse width difference value, and determining the target three-phase PWM wave; configuring sampling points for the target three-phase PWM wave, sampling through the converter, reconstructing the current according to the sampling result, and determining the sampling current value; determining the current direction according to the sector, and calculating the three-phase current value in combination with the sampling current value; the method of calculating the pulse width difference value of the three-phase PWM wave in the sector, processing the waveform according to the pulse width difference value, and determining the target three-phase PWM wave comprises the steps of: sorting the pulse width of the three-phase PWM wave in the sector to determine the first phase, the second phase and the third phase; calculating the pulse width difference value of the first phase and the second phase to determine the first pulse width difference value; calculating the pulse width difference value of the second phase and the third phase to determine the second pulse width difference value; comparing the first pulse width difference value and the second pulse width difference value with the first threshold value respectively, processing the waveform according to the comparison result, and determining the target three-phase PWM wave; the method of comparing the first pulse width difference value and the second pulse width difference value with the first threshold value respectively, processing the waveform according to the comparison result, and determining the target three-phase PWM wave comprises the steps of: when the first pulse width difference value is less than the first threshold value, there is no window between the first phase and the second phase, and the first zero vector time is greater than the first threshold value, the first phase is right-shifted; when the second pulse width difference value is less than the first threshold value, there is no window between the second phase and the third phase, and the second zero vector time is greater than the first threshold value, the third phase is left-shifted; when the first pulse width difference value is less than the first threshold value, and the first zero vector time is less than the first threshold value, the first phase is right-shifted, and the third phase is left-shifted; when the second pulse width difference value is less than the first threshold value, and the second zero vector time is less than the first threshold value, the first phase is right-shifted, and the third phase is left-shifted; the method of configuring sampling points for the target three-phase PWM wave, sampling through the converter, and reconstructing the current according to the sampling result to determine the sampling current value further comprises the steps of: when the timer overflow interrupt occurs, the first value is updated to the register, wherein the first value represents the sampling value in the last period underflow calculation; sampling through the converter, saving the second value through the DMA interrupt, and updating the first value to the buffer, wherein the second value represents the current period sampling value; when the timer underflow interrupt occurs, the current is reconstructed according to the second value, the first value is updated to the register, and the sampling current value is calculated through the space vector pulse width modulation algorithm and updated to the buffer.

2. The single-resistor current sampling method of claim 1, wherein, the method of comparing the first pulse width difference value and the second pulse width difference value with the first threshold value respectively, processing the waveform according to the comparison result, and determining the target three-phase PWM wave further comprises the steps of: when the first pulse width difference value is equal to the second pulse width difference value, the PWM wave is configured through the timer overflow update or underflow update to determine the target three-phase PWM wave.

3. The single-resistor current sampling method of claim 1, wherein, the method of configuring sampling points for the target three-phase PWM wave, sampling through the converter, and reconstructing the current according to the sampling result to determine the sampling current value comprises the steps of: The first sampling point and the second sampling point are set in a cycle of the target three-phase PWM wave, and sampling is performed through the converter when the first sampling point and the second sampling point are reached to obtain sampling data; The sampling data is transmitted through the DMA, the sampling data is saved when the DMA interrupt occurs, and the current is reconstructed when the timer underflow interrupt occurs to determine the sampling current value.

4. The single-resistor current sampling method of claim 1, wherein, The current direction is determined according to the sector, and the three-phase current value is calculated in combination with the sampling current value, including: The current direction is determined according to the high and low of the PWM wave level in the sector, and the positive and negative values of the sampling current value are determined according to the current direction; The three-phase current value is calculated according to the Kirchhoff's current law.

5. A single-resistor current sampling system, comprising: It includes: The first module is configured to calculate the pulse width difference value according to the pulse width of the three-phase PWM wave in the sector, perform waveform processing according to the pulse width difference value, and determine the target three-phase PWM wave; The second module is configured to configure sampling points for the target three-phase PWM wave, sample through the converter, and reconstruct the current according to the sampling result to determine the sampling current value; The third module is configured to determine the current direction according to the sector, and calculate the three-phase current value in combination with the sampling current value; The pulse width difference value is calculated according to the pulse width of the three-phase PWM wave in the sector, the waveform is processed according to the pulse width difference value, and the target three-phase PWM wave is determined, including: The pulse width of the three-phase PWM wave in the sector is sorted to determine the first phase, the second phase and the third phase; The pulse width difference value of the first phase and the second phase is calculated to determine the first pulse width difference value; The pulse width difference value of the second phase and the third phase is calculated to determine the second pulse width difference value; The first pulse width difference value and the second pulse width difference value are compared with the first threshold value respectively, and the waveform is processed according to the comparison result to determine the target three-phase PWM wave; The first pulse width difference value and the second pulse width difference value are compared with the first threshold value respectively, and the waveform is processed according to the comparison result to determine the target three-phase PWM wave, including: When the first pulse width difference value is less than the first threshold value, there is no window between the first phase and the second phase, and the first zero vector time is greater than the first threshold value, the first phase is right shifted; When the second pulse width difference value is less than the first threshold value, there is no window between the second phase and the third phase, and the second zero vector time is greater than the first threshold value, the third phase is left shifted; When the first pulse width difference value is less than the first threshold value, and the first zero vector time is less than the first threshold value, the first phase is right shifted, and the third phase is left shifted; When the second pulse width difference value is less than the first threshold value, and the second zero vector time is less than the first threshold value, the first phase is right shifted, and the third phase is left shifted; The target three-phase PWM wave is configured with sampling points, sampling is performed through the converter, and the current is reconstructed according to the sampling result to determine the sampling current value, further including: When the timer overflow interrupt occurs, the first value is updated to the register, wherein the first value represents the sampling value when the last cycle underflow calculation is performed; The converter is sampled, the second value is saved through the DMA interrupt, and the first value is updated to the buffer, wherein the second value represents the current cycle sampling value; When the timer underflow interrupt occurs, current reconstruction is performed according to the second value, the first value is updated to the register, a sampling current value is calculated through a space vector pulse width modulation algorithm, and the sampling current value is updated to the buffer.

6. An electronic device, comprising: The processor and the memory are included. The memory is configured to store a program. The processor executes the program to implement the method in any one of claims 1-4.

7. A computer readable storage medium characterized in that, The storage medium stores a program, and the program is executed by the processor to implement the method in any one of claims 1-4.

Citation Information

Patent Citations

  • PWM phase shifting method of permanent magnet motor and PWM phase shifting device

    CN110855215A

  • Single-resistor sampling method

    CN112422017A

  • Phase current reconstruction method and apparatus

    WO2014026331A1