A single resistor current sampling method and storage medium
The method simplifies single-resistor current sampling for permanent magnet synchronous motors by determining current values of two phases, adjusting pulse widths, and optimizing waveform positions to achieve accurate sampling without phase shifting, reducing complexity and voltage distortion.
Patent Information
- Application Number
- CN202411125454.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-16
AI Technical Summary
Existing single-resistor current sampling methods for permanent magnet synchronous motors face inaccuracies due to uncertain phase shifting requirements, leading to increased complexity and voltage distortion, especially when sampling times are less than the minimum duration for current stabilization.
A method that samples current values of two motor phases initially, determines the third phase current based on these values, and adjusts pulse widths using fixed sampling waveforms without phase shifting, ensuring accurate current sampling by optimizing the positional relationship between sampling and pulse width waveforms.
This approach simplifies the control algorithm by eliminating phase shifting, reduces voltage distortion, and achieves accurate current sampling without altering the existing sampling circuit, thereby stabilizing motor operation.
Smart Images

Figure CN118646303B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of current sampling, and in particular to a single resistor current sampling method and a storage medium. Background Art
[0002] In the prior art, current sampling is often implemented through the control algorithm of the permanent magnet synchronous motor (PMSP). Current sampling is very important for the vector control of the motor. For example, the three-phase current of the permanent magnet synchronous motor can be obtained based on the sampling circuit and sampling algorithm, and then the motor can be controlled through the feedback link based on the three-phase current. Common current methods include dual-resistance sampling and single-resistance sampling. Among them, the single-resistance sampling circuit is simple and low-cost, and is widely used.
[0003] In general, the single resistor sampling method uses a non-zero basic vector to determine the motor phase current by measuring the current of the DC bus. Each basic vector is set to a specific time within the pulse width modulation cycle to generate a voltage vector. Based on this, the permanent magnet synchronous motor phase current can be reconstructed.
[0004] However, since it takes a certain amount of time for the current to change to a stable state, there is a minimum value for the duration of the non-zero vector during single resistor sampling. When the actual sampling time is less than the above minimum value, the true and relatively accurate current value cannot be obtained. Based on this, in order to improve the accuracy of the current value, technicians will use the phase shift method when performing single resistor sampling to adjust the problem of inaccurate current sampling. However, different control cycles may require phase shifting, or may not require phase shifting, or the phase shifting may require moving any phase pulse width, any two phase pulse widths, or the pulse widths corresponding to all phases. The above phase shifting operation is uncertain, so it is necessary to judge each control cycle, which greatly increases the complexity of the control algorithm. At the same time, frequent phase shifting increases the output voltage distortion corresponding to the three phases, causing the motor to be unstable or generate large electromagnetic noise.
[0005] Based on this, there is an urgent need for a single-resistance current sampling solution that can obtain accurate current without phase shifting. Summary of the invention
[0006] The object of the present invention is to provide a single resistor current sampling method and a storage medium, which can obtain accurate current without changing the existing sampling circuit and without phase shifting.
[0007] The present invention provides a single resistor current sampling method, comprising the following steps:
[0008] When entering this control cycle, the current of any two phases of the motor is initially sampled to respectively determine the current values corresponding to any two phases of the motor in the previous control cycle;
[0009] Determine the current value corresponding to the third phase according to the current values corresponding to any two phases;
[0010] Determine the pulse width corresponding to each pulse width waveform in this control cycle according to the current value corresponding to each phase and the sampling waveform corresponding to each phase, obtain the pulse width waveform under this control cycle, and determine the control signal corresponding to this control cycle;
[0011] Wherein, the control signal includes three control waveforms, each control waveform corresponds to the three phases of the motor respectively, and the control waveform includes a sampling waveform and a pulse width waveform; the pulse width waveform is arranged after the sampling waveform; the sampling period of the sampling waveform is greater than the sampling window;
[0012] The motor is driven and controlled according to the control signal corresponding to the control cycle.
[0013] Preferably, the step of determining the pulse width corresponding to each pulse width waveform in the present control cycle according to the current value corresponding to each phase and the sampling waveform corresponding to each phase to obtain the pulse width waveform in the present control cycle includes:
[0014] Determine the pulse width corresponding to each control waveform in this control cycle according to the current value corresponding to each phase;
[0015] The pulse width corresponding to each pulse width waveform is determined according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase, the pulse width waveform under the current control cycle is obtained, and the control signal corresponding to the current control cycle is determined.
[0016] Preferably, the steps of determining the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase are:
[0017] For any phase, determine the non-zero vector conduction time corresponding to the sampling waveform of the current phase;
[0018] The pulse width corresponding to each pulse width waveform is determined according to the pulse width corresponding to the control waveform in the current phase and the non-zero vector conduction time.
[0019] Preferably, when the sampling waveform includes at least two consecutive sampling periods, each sampling period corresponds to a different non-zero vector, the step of determining the conduction time of the non-zero vector corresponding to the sampling waveform in the current phase for any phase is:
[0020] Determine the duration of each non-zero vector under the sampling waveform according to the vector state of each non-zero vector in the corresponding sampling period;
[0021] The conduction time of the non-zero vector corresponding to the sampling waveform of the current phase is determined according to the sum of the durations corresponding to all the non-zero vectors.
[0022] Preferably, the step of determining the duration of each non-zero vector under the sampling waveform according to the vector state of each non-zero vector in the corresponding sampling period is:
[0023] If the vector state is low, the duration of the non-zero vector in the current sampling period is zero;
[0024] If the vector state is at a high level, the duration of the non-zero vector in the current sampling period is the time corresponding to the sampling period.
[0025] Preferably, when entering the current control cycle, the step of performing initial current sampling on any two phases of the motor includes:
[0026] For any two phases of the motor, the current modulated by the corresponding pulse width waveform in the previous control cycle is sampled using each sampling waveform in the current control cycle to obtain the current values corresponding to any two phases of the motor in the previous control cycle.
[0027] Preferably, when the pulse width waveform further includes the distribution position of the pulse width, the step of obtaining the pulse width waveform under the control cycle and determining the control signal corresponding to the control cycle includes:
[0028] For any phase, according to the vector state corresponding to the sampling waveform and the pulse width corresponding to the pulse width waveform in the current control period, an initial pulse width waveform in the current control period is obtained;
[0029] Determining the distribution position of the pulse width according to the vector state corresponding to the sampling waveform and the initial pulse width waveform to obtain a final pulse width waveform;
[0030] The control signal corresponding to the present control cycle is determined according to the sampling waveform and the final pulse width waveform, wherein the final pulse width waveform is arranged after the sampling waveform is arranged.
[0031] Preferably, the step of determining the distribution position of the pulse width according to the vector state corresponding to the sampling waveform and the initial pulse width waveform to obtain the final pulse width waveform comprises:
[0032] Determine whether the vector states corresponding to the sampling waveforms are all the same. If they are all the same, then
[0033] The pulse width corresponding to the pulse width waveform in the present control period is continuous with the end time of the sampling waveform in the present control period;
[0034] Or the pulse width corresponding to the pulse width waveform in the present control cycle is continuous with the start time of the sampling waveform in the next control cycle.
[0035] Preferably, after the step of determining whether the vector states corresponding to the sampling waveforms are all the same, the method further comprises:
[0036] Determine whether the vector state corresponding to the sampling waveform changes from high to low;
[0037] If so, the pulse width corresponding to the pulse width waveform in the current control cycle is continuous with the start time of the sampling waveform in the next control cycle;
[0038] If not, the pulse width corresponding to the pulse width waveform in this control period is continuous with the end time of the sampling waveform in this control period.
[0039] In a second aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the single-resistance current sampling method as described in any one of the first aspects are implemented.
[0040] The beneficial effects of the embodiments of the present invention include, for example:
[0041] When entering this control cycle, the current of any two phases of the motor is initially sampled to determine the current values corresponding to any two phases of the motor in the previous control cycle. Then, the current value corresponding to the third phase is determined based on the current values corresponding to any two phases, and the pulse width corresponding to each pulse width waveform in this control cycle is determined based on the current values corresponding to each phase and the sampling waveform corresponding to each phase, so as to obtain the pulse width waveform under this control cycle, and determine the control signal corresponding to this control cycle. Among them, the control signal includes three control waveforms, each of which corresponds to the three phases of the motor, and the control waveform includes a sampling waveform and a pulse width waveform; the pulse width waveform is arranged after the sampling waveform. Finally, the motor is driven and controlled according to the control signal corresponding to this control cycle. The present invention determines the corresponding pulse width waveform based on the sampling waveform to obtain the control signal corresponding to this control cycle to drive and control the motor. On the basis of not changing the existing sampling circuit, the sampling waveform and the pulse width waveform are adjusted to avoid the phase shift operation of the sampling process and simplify the sampling process; and based on the positional relationship between the sampling waveform and the pulse width waveform, the current sampling method is adjusted to obtain a more accurate sampling value. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 It is a waveform diagram corresponding to the control signal in any control cycle in the prior art;
[0044] Figure 2 It is a waveform diagram corresponding to the control signal in this control cycle after the phase shift operation in the prior art;
[0045] Figure 3 A flow chart of the steps of a single resistor current sampling method provided by the present invention;
[0046] Figure 4 is one of the waveform diagrams corresponding to the control signal in any control period of the present invention;
[0047] Figure 5 is a step-by-step flow chart of step 103 of the present invention;
[0048] Figure 6 is a step-by-step flow chart of step 201 in the present invention;
[0049] Figure 7 is a step-by-step flow chart of step 301 in the present invention;
[0050] Figure 8 The second waveform diagram corresponding to the control signal in any control cycle of the present invention;
[0051] Fig. 9 The third waveform diagram corresponding to the control signal in any control cycle of the present invention;
[0052] Fig.10 The waveform corresponding to the control signal in any control cycle of the present invention is Figure 4 ;
[0053] Fig.11 is a step-by-step flow chart of step 202 of the present invention;
[0054] Fig.12 One of the sub-step flow charts of step 502 in the present invention;
[0055] Fig.13 It is one of the control signals corresponding to the low level of the sampling waveform in the present invention;
[0056] Fig.14The second control signal corresponding to the low level of the sampling waveform in the present invention;
[0057] Fig.15 It is one of the control signals corresponding to the high level of the sampling waveform in the present invention;
[0058] Fig.16 The second control signal corresponding to the high level of the sampling waveform in the present invention;
[0059] Fig.17 This is the second step-by-step flow chart of step 502 in the present invention;
[0060] Fig.18 It is the control signal corresponding to the level of the sampling waveform in the present invention when it changes from high to low;
[0061] Fig.19 It is the control signal corresponding to the level of the sampling waveform in the present invention when it changes from low to high. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0063] In the prior art, when single resistor sampling is performed, sampling is usually performed twice in one control cycle, and each time a different combination of non-zero vectors must be used to obtain the current of any two phases of the three phases, and then the current corresponding to the third phase is obtained according to the current relationship between the phases of the motor. Figure 1 For example, Figure 1 The control signal under a control cycle of the prior art is shown, wherein T is the duration corresponding to a control cycle, and T1, T2 and T3 correspond to the pulse widths corresponding to the pulse width waveforms in the motor phase A, phase B and phase C respectively. Figure 1 , assuming that sampling is performed in the durations t2 and t3 corresponding to 001 and 011, respectively, where t2 and t3 represent the durations corresponding to the non-zero vector 001 and the non-zero vector 011, the voltages corresponding to the motor phases A, B and C can be expressed as: U dc *(T1 / T),U dc *(T2 / T), U dc *(T3 / T); where U dc is the voltage corresponding to the DC bus.
[0064] Since the current change and stabilization require a certain amount of time, the duration of the above non-zero vector, such as sampling period t2 and sampling period t3, needs to be greater than the minimum value of the non-zero timing duration during single resistor current sampling, that is, the sampling window T min , if sampling period t3 < sampling window T min , when sampling current with a single resistor, it is impossible to sample a relatively accurate current within the sampling period t3. Based on this, the conventional way to adjust the accuracy of the sampled current is to move the pulse width of each phase, for example, move the pulse width corresponding to any phase or multiple phases to the left to make the sampling period larger than the sampling window. Please refer to Figure 2 , Figure 2 Shown in Figure 1 The control signal corresponding to each phase of the motor is moved based on the sampling period t2 and the sampling period t3 satisfy: t2 <T min , t3 <T min In order to ensure the accuracy of the sampled current, the above judgment needs to be performed before each control cycle, which will greatly increase the complexity of the single-resistance sampling control algorithm. At the same time, due to the frequent movement of single phase or multi-phase, the three-phase voltage distortion will increase, resulting in unstable motor operation.
[0065] Based on the above considerations, an embodiment of the present invention provides a single resistor current sampling solution, so that accurate current can be obtained without phase shifting without changing the existing sampling circuit, which greatly reduces the complexity of the control algorithm.
[0066] First, please refer to Figure 3 This embodiment provides a single resistor current sampling method, including the following steps 101 to 104.
[0067] Step 101 , when entering the current control cycle, initial current sampling is performed on any two phases of the motor to respectively determine the current values corresponding to any two phases of the motor in the previous control cycle.
[0068] Step 102: Determine the current value corresponding to the third phase according to the current values corresponding to any two phases.
[0069] Step 103, determine the pulse width corresponding to each pulse width waveform in the current control cycle according to the current value corresponding to each phase and the sampling waveform corresponding to each phase, obtain the pulse width waveform in the current control cycle, and determine the control signal corresponding to the current control cycle.
[0070] The control signal includes three control waveforms, each of which corresponds to the three phases of the motor, and the control waveform includes a sampling waveform and a pulse width waveform; the pulse width waveform is arranged after the sampling waveform. The sampling period of the sampling waveform is greater than the sampling window.
[0071] Step 104 : driving and controlling the motor according to the control signal corresponding to the current control cycle.
[0072] In this embodiment, a control signal is provided, which includes three control waveforms, each of which corresponds to the three phases of the motor. Each control waveform includes a sampling waveform and a pulse width waveform, wherein the pulse width waveform is arranged after the sampling waveform.
[0073] Based on this, when entering the current control cycle, since the sampling waveform is in front, the current adjusted in the previous control cycle can be sampled using the sampling waveform first to determine the pulse width corresponding to the control waveform of each phase in the current control cycle. That is, when entering the current control cycle, the step 101 of initial current sampling of any two phases of the motor is specifically: for any two phases of the motor, the current modulated by the corresponding pulse width waveform in the previous control cycle is sampled using each sampling waveform under the current control cycle, and the current value corresponding to any two phases of the motor in the previous control cycle is obtained.
[0074] Specifically, when the sampling waveform includes at least two consecutive sampling cycles, and each sampling cycle corresponds to a different non-zero vector, when entering the current control cycle, the step 101 of performing initial current sampling on any two phases of the motor is specifically as follows: when entering the current control cycle, two consecutive sampling cycles are used to obtain the current values corresponding to any two phases of the motor in the previous control cycle based on different non-zero vectors.
[0075] It should be noted that, in this embodiment, the sampling period corresponding to each sampling waveform is greater than the sampling window to avoid phase shifting operation. Figure 4 , Figure 4 A schematic diagram of a control signal is shown, wherein the sampling signal is fixed on the left side of the pulse width signal, wherein each sampling waveform corresponds to two sampling periods, which are described as the first sampling period t1 and the second sampling period t2 for the convenience of description. In this embodiment, the first sampling period t1 and the second sampling period t2 are both greater than the sampling window, and the sampling points corresponding to each sampling period are all located within the sampling window.
[0076] Furthermore, the present embodiment can determine the corresponding pulse width waveform according to the sampling waveform, that is, the pulse width corresponding to each pulse width waveform in the present control cycle is determined by the current value of each phase corresponding to the previous control cycle and the sampling waveform corresponding to the present control cycle, so as to obtain the pulse width waveform under the present control cycle, and then determine the control signal corresponding to the present control cycle. Based on this, the present embodiment can optimize the sampling current on the basis of optimizing the sampling process to obtain a more accurate control signal.
[0077] Based on this, please refer to Figure 5In this embodiment, the pulse width corresponding to each pulse width waveform in this control cycle is determined based on the current value corresponding to each phase and the sampling waveform corresponding to each phase, and step 103 of obtaining the pulse width waveform under this control cycle includes steps 201 to 202.
[0078] Step 201: Determine the pulse width corresponding to each control waveform in the current control cycle according to the current value corresponding to each phase.
[0079] Step 202: Determine the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase, obtain the pulse width waveform under the current control cycle, and determine the control signal corresponding to the current control cycle.
[0080] In this embodiment, the three-phase voltage corresponding to the current control cycle can be directly determined based on the information such as the current of each phase and the corresponding speed of the motor in the previous control cycle, and then the pulse width of the control waveform under the corresponding phase can be determined based on the voltage of each phase. For example, assuming that the phase voltage corresponding to phase A is U A , then in this control cycle, the pulse width T1 corresponding to the A phase control waveform satisfies the calculation formula: T1=T*(U A / U dc ).
[0081] Please refer to Figure 6 In a possible implementation, step 201 of determining the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase includes steps 301 to 302.
[0082] Step 301: For any phase, determine the non-zero vector conduction time corresponding to the sampled waveform of the current phase.
[0083] Step 302: Determine the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to the control waveform in the current phase and the non-zero vector conduction time.
[0084] In this embodiment, please refer to Figure 7 When the sampling waveform includes at least two consecutive sampling periods, each sampling period corresponds to a different non-zero vector. For any phase, step 301 of determining the conduction time of the non-zero vector corresponding to the sampling waveform in the current phase includes steps 401 to 402.
[0085] Step 401 : Determine the duration of each non-zero vector under the sampling waveform according to the vector state of each non-zero vector in the corresponding sampling period.
[0086] Step 402: Determine the non-zero vector conduction time corresponding to the current phase down-sampled waveform according to the sum of the durations corresponding to all non-zero vectors.
[0087] In a possible implementation, step 401 may be implemented as follows: first, the vector state corresponding to the current sampling period is determined. If the vector state of the current sampling period is a low level, the duration of the non-zero vector in the current sampling period is zero. If the vector state is a high level, the duration of the non-zero vector in the current sampling period is the time corresponding to the sampling period.
[0088] Please continue to refer to Figure 4 , taking the sampling waveform under this control cycle as an example, the non-zero vector combinations corresponding to the sampling waveform are: 001, 011; taking phase A as an example, under this control cycle, the first sampling cycle t1 corresponds to a low level, and the second sampling cycle t2 corresponds to a low level, then the non-zero vector conduction time of the sampling waveform corresponding to phase A satisfies: T A =0.
[0089] Similarly, taking phase B as an example, in this control cycle, the first sampling period t1 corresponds to a low level, and the second sampling period t2 corresponds to a high level, then the non-zero vector conduction time of the sampling waveform corresponding to phase A satisfies: T B = t2.
[0090] Similarly, taking phase C as an example, in this control cycle, the first sampling period t1 corresponds to a high level, and the second sampling period t2 corresponds to a high level, then the non-zero vector conduction time of the sampling waveform corresponding to phase C satisfies: T C = t1+ t2.
[0091] In a possible implementation, step 202 of determining the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to the control waveform in the current phase and the non-zero vector conduction time in this embodiment is specifically:
[0092] The difference between the pulse width corresponding to the control waveform in the current phase and the non-zero vector conduction time is used as the pulse width corresponding to each pulse width waveform.
[0093] In this embodiment, after the pulse width corresponding to each pulse width waveform is determined, the control waveform of the corresponding phase can be determined based on the sampling waveform in front and the pulse width waveform in the back to obtain the control signal under the current control cycle.
[0094] In this embodiment, when the sampling waveform includes at least two consecutive sampling periods, and each sampling period corresponds to a different non-zero vector, each non-zero vector is composed of a pseudo-random code or a high / low level, and corresponds to the three phases of the motor respectively. It can be understood that the non-zero vector at this time includes 6 types, for example: 001, 010, 011, 100, 101 and 110, then the corresponding sampling waveform includes at least 30 sampling combinations of non-zero vectors, for example, 001 and 010; 001 and 011, etc.
[0095] Please continue to refer to Figure 4 , Figure 4 The sampling waveform corresponding to the sampling combination of 001 and 011 in this control cycle is shown. Among them, the number of pulse width waveform level flips corresponding to each phase is different. Taking phase A as an example, the number of level flips in this control cycle is: 2 times. Similarly, the number of level flips corresponding to phase B in this control cycle is: 2 times. Similarly, taking phase C as an example, the number of level flips in this control cycle is: 2 times.
[0096] Please refer to Figure 8 , Figure 8 The sampling waveform corresponding to the sampling combination of 001 and 010 in this control cycle is shown. Taking phase A as an example, the number of level flips in this control cycle is 2 times. Similarly, the number of level flips corresponding to phase B in this control cycle is 2 times. Similarly, taking phase C as an example, the number of level flips in this control cycle is 3 times.
[0097] Please refer to Figures 9 and 10 ,exist Figure 8 Based on the embodiment shown, the distribution position of the corresponding pulse width is adjusted; wherein, Figure 8 The pulse width of the pulse width waveform shown is set to the far left; Fig. 9 The pulse width of the pulse width waveform shown is set to the far right; Fig.10 The pulse width of the pulse width waveform shown is set in the middle part, and the leftmost, rightmost and middle described in this embodiment are all commented on based on the setting position of the pulse width waveform.
[0098] by Fig. 9 As shown in FIG. 1 , at this time, the number of level flips corresponding to phase A in this control cycle is 1; the number of level flips corresponding to phase B in this control cycle is 3. The number of level flips corresponding to phase C in this control cycle is 2. Similarly, Fig.10 As shown, at this time, the number of level flips corresponding to phase A in this control cycle is: 2 times; the number of level flips corresponding to phase B in this control cycle is: 4 times; the number of level flips corresponding to phase C in this control cycle is: 3 times.
[0099] It can be seen that different non-zero vector combinations will form different pulse width waveforms, which will affect the number of level flips of the corresponding control signal. Similarly, the same non-zero vector combination will also affect the number of level flips of the corresponding control signal due to the different distribution positions of the pulse width waveform. However, frequent level flips will also affect the performance of the motor.
[0100] Based on this, please refer to Fig.11 When the pulse width waveform also includes the distribution position of the pulse width, the pulse width waveform under the current control cycle is obtained, and step 202 of determining the control signal corresponding to the current control cycle also includes steps 501 to 503.
[0101] Step 501: For any phase, according to the vector state corresponding to the sampling waveform and the pulse width corresponding to the pulse width waveform in the current control period, obtain the initial pulse width waveform in the current control period.
[0102] Step 502: Determine the distribution position of the pulse width according to the vector state corresponding to the sampling waveform and the initial pulse width waveform to obtain a final pulse width waveform.
[0103] Step 503: Determine the control signal corresponding to the current control cycle according to the sampling waveform and the final pulse width waveform, wherein the final pulse width waveform is set after the sampling waveform is set.
[0104] In this embodiment, the difference between the pulse width corresponding to the control waveform in the current phase and the non-zero vector conduction time can be used as the pulse width corresponding to each pulse width waveform to obtain the initial pulse width waveform in this control cycle. At this time, only the time corresponding to the pulse width corresponding to the pulse width waveform is determined based on the current step 501.
[0105] On this basis, please refer to Fig.12 The step 502 of determining the distribution position of the pulse width according to the vector state corresponding to the sampling waveform and the initial pulse width waveform to obtain the final pulse width waveform includes at least the following steps 601:
[0106] It is determined whether the vector states corresponding to the sampling waveforms are all the same. If they are the same, the pulse width corresponding to the pulse width waveform in this control period is continuous with the sampling waveform.
[0107] In one achievable manner, the step of the pulse width corresponding to the pulse width waveform in the control period being continuous with the sampling waveform includes: the pulse width corresponding to the pulse width waveform in the control period is continuous with the end time of the sampling waveform in the control period.
[0108] In another achievable manner, the step of the pulse width corresponding to the pulse width waveform in the current control cycle being continuous with the sampling waveform includes: the pulse width corresponding to the pulse width waveform in the current control cycle is continuous with the start time of the sampling waveform in the next control cycle.
[0109] Please refer to Figure 13 to Figure 14 , Fig.13 , Fig.14 The pulse width waveform corresponding to the vector state corresponding to the sampling waveform is shown in FIG. Fig.13 As shown, when the vector states corresponding to the sampling waveforms are all low level, at this time, the pulse width corresponding to the pulse width waveform in this control cycle is continuous with the end time of the sampling waveform.
[0110] Similarly, if Fig.14As shown, when the vector states corresponding to the sampling waveforms are all low level, at this time, the pulse width corresponding to the pulse width waveform in the current control cycle is continuous with the start time of the sampling waveform in the next control cycle.
[0111] Different from the above embodiment, please refer to Figure 15 to Figure 16 , Fig.15 , Fig.16 Figure 2 shows the pulse width waveform corresponding to the sampling waveform when the vector states corresponding to the sampling waveform are all high. Fig.15 As shown, when the vector states corresponding to the sampling waveforms are all high level, at this time, the pulse width corresponding to the pulse width waveform in this control cycle is continuous with the end time of the sampling waveform.
[0112] Similarly, if Fig.16 As shown, when the vector states corresponding to the sampling waveforms are all low level, at this time, the pulse width corresponding to the pulse width waveform in the current control cycle is continuous with the start time of the sampling waveform in the next control cycle.
[0113] In this embodiment, please refer to Fig.17 , after the step of determining whether the vector states corresponding to the sampled waveforms are the same, the method further includes step 602:
[0114] Determine whether the vector state corresponding to the sampling waveform changes from high to low;
[0115] If so, the pulse width corresponding to the pulse width waveform in the current control cycle is continuous with the start time of the sampling waveform in the next control cycle.
[0116] If not, the pulse width corresponding to the pulse width waveform in this control period is continuous with the end time of the sampling waveform in this control period.
[0117] Please refer to Figure 18 to Figure 19 , Fig.18 The pulse width waveform corresponding to the vector state corresponding to the sampling waveform changes from high to low is shown; Fig.19 The pulse width waveform corresponding to the vector state of the sampling waveform changes from low to high is shown in FIG. Fig.18 As shown in , when the vector state corresponding to the sampling waveform changes from high to low, at this time, the pulse width corresponding to the pulse width waveform in this control cycle is continuous with the start time of the sampling cycle corresponding to the sampling waveform in the next control cycle. Similarly, Fig.19 As shown, when the vector state corresponding to the sampling waveform changes from low to high, at this time, the pulse width corresponding to the pulse width waveform in this control cycle is continuous with the start time of the sampling cycle corresponding to the sampling waveform in this control cycle.
[0118] Based on this, from Figure 13 to Fig.16 , Figure 18 to Figure 19It can be seen that in this embodiment, the number of flips corresponding to each control waveform in this control cycle is 2. It can be understood that the number of flips corresponding to the control signal in this control cycle is 6, which can greatly reduce the phase voltage distortion of the motor and improve the accuracy of the sampling current.
[0119] Based on the above single resistor current sampling scheme, when setting the corresponding sampling waveform, this embodiment only needs to ensure three level change moments, namely: the zero moment of the sampling waveform (the start time corresponding to this control period), the end moment corresponding to the first sampling period (numerically equal to the first sampling period t1) and the end moment corresponding to the second sampling period (numerically equal to the second sampling period t2). Compared with the conventional settings, please continue to refer to Figure 2 When setting the corresponding sampling waveform, 6 level change moments need to be updated. Based on this, this embodiment can greatly simplify the sampling steps.
[0120] In a possible implementation, the corresponding sampling waveform can be fixed under different control cycles, for example, the first sampling cycle and the second sampling cycle under the sampling waveform. Specifically, to ensure that the current does not change during sampling, the sampling time corresponding to the first sampling cycle can satisfy: t1-S min ; The sampling time corresponding to the second sampling period can satisfy: t1+t2-S min ; S min The minimum time to complete sampling.
[0121] Please continue to refer to Figure 4 In this embodiment, t1= t2= T min , correspondingly, the upper bridge of phase A is at T min * 2 moment from low level to high level, B phase upper bridge at T min The C phase upper bridge changes from low level to high level at time 0, and these three moments remain unchanged.
[0122] Correspondingly, the lower edge is determined according to the steps of determining the corresponding control signals of each phase in the above embodiment. For example, first calculate the three-phase voltage of the current control cycle according to the three-phase current value of the previous control cycle, as well as information such as the motor speed, and then determine the pulse width corresponding to each control waveform according to the three-phase voltage. Finally, the pulse width corresponding to each pulse width waveform is determined according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase. The pulse widths in the pulse width waveforms of phase A, phase B, and phase C can be expressed as: D1= T1; D2= T2- t2; D3= T3- t1- t2. Continue to refer to Figure 4At this time, the A phase upper bridge changes from high level to low level at t1+t2+T1; the B phase upper bridge changes from high level to low level at t1+T2; the C phase upper bridge changes from high level to low level at T3. Among them, T1, T2 and T3 are the pulse widths corresponding to each control waveform.
[0123] Based on this, the present embodiment does not need to perform phase shift judgment when entering each control cycle, and can directly perform current sampling. After fixing the sampling time and sampling waveform of each phase, the sampling waveform of any two phases can be fixed to achieve the phase corresponding to the sampled current without having to judge, thereby reducing the complexity of sampling and simplifying the complexity of the sampling algorithm.
[0124] In summary, this embodiment provides a single-resistance current sampling method, which can determine the corresponding pulse width waveform based on the sampling waveform to obtain the control signal corresponding to the current control cycle to drive and control the motor. On the basis of not changing the existing sampling circuit, the sampling waveform and the pulse width waveform are adjusted to avoid the phase shift operation of the sampling process and simplify the sampling process; and based on the positional relationship between the sampling waveform and the pulse width waveform, the current sampling method is adjusted to obtain a more accurate sampling value.
[0125] In the second aspect, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, the steps corresponding to the single-resistance current sampling method of the first aspect are implemented, that is, when entering the current control cycle, the current of any two phases of the motor is initially sampled to respectively determine the current values corresponding to any two phases in the motor in the previous control cycle. Then, the current value corresponding to the third phase is determined based on the current values corresponding to any two phases, and the pulse width corresponding to each pulse width waveform in the current control cycle is determined based on the current values corresponding to each phase and the sampling waveform corresponding to each phase, so as to obtain the pulse width waveform under the current control cycle, and determine the control signal corresponding to the current control cycle. Among them, the control signal includes three control waveforms, each of which corresponds to the three phases of the motor, and the control waveform includes a sampling waveform and a pulse width waveform; the pulse width waveform is arranged after the sampling waveform. Finally, the motor is driven and controlled according to the control signal corresponding to the current control cycle.
[0126] Among them, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions and programs, and when the computer instructions and programs are read and run, the method of the above embodiment is executed. The storage medium may include memory, flash memory, registers, or a combination thereof.
[0127] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A single resistor current sampling method, characterized in that: The single resistor current sampling method comprises the following steps: When entering this control cycle, the current of any two phases of the motor is initially sampled to respectively determine the current values corresponding to any two phases of the motor in the previous control cycle; Determine the current value corresponding to the third phase according to the current values corresponding to any two phases; Determine the pulse width corresponding to each pulse width waveform in this control period according to the current value corresponding to each phase and the sampling waveform corresponding to each phase, obtain the pulse width waveform under this control period, and determine the control signal corresponding to this control period; the sampling period of the sampling waveform is greater than the sampling window; Wherein, the control signal includes at least three control waveforms, each control waveform corresponds to the three phases of the motor respectively, and the control waveform includes a sampling waveform and a pulse width waveform; the pulse width waveform is arranged after the sampling waveform; The motor is driven and controlled according to the control signal corresponding to the control cycle; The step of determining the pulse width corresponding to each pulse width waveform in the present control cycle according to the current value corresponding to each phase and the sampling waveform corresponding to each phase to obtain the pulse width waveform in the present control cycle comprises: Determine the pulse width corresponding to each control waveform in this control cycle according to the current value corresponding to each phase; Determine the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase, obtain the pulse width waveform under the current control cycle, and determine the control signal corresponding to the current control cycle; The steps of determining the pulse width corresponding to each pulse width waveform according to the pulse width corresponding to each control waveform and the sampling waveform corresponding to each phase are: For any phase, determine the non-zero vector conduction time corresponding to the sampling waveform of the current phase; The pulse width corresponding to each pulse width waveform is determined according to the pulse width corresponding to the control waveform in the current phase and the non-zero vector conduction time.
2. The single resistor current sampling method according to claim 1, characterized in that: When the sampling waveform includes at least two consecutive sampling periods, each sampling period corresponds to a different non-zero vector, the step of determining the conduction time of the non-zero vector corresponding to the sampling waveform in the current phase for any phase is: Determine the duration of each non-zero vector under the sampling waveform according to the vector state of each non-zero vector in the corresponding sampling period; The conduction time of the non-zero vector corresponding to the sampling waveform of the current phase is determined according to the sum of the durations corresponding to all the non-zero vectors.
3. The single resistor current sampling method according to claim 2, characterized in that: The step of determining the duration of each non-zero vector under the sampling waveform according to the vector state of each non-zero vector in the corresponding sampling period is: If the vector state is low, the duration of the non-zero vector in the current sampling period is zero; If the vector state is at a high level, the duration of the non-zero vector in the current sampling period is the time corresponding to the sampling period.
4. The single resistor current sampling method according to claim 1, characterized in that: When entering the control cycle, the steps of performing initial current sampling on any two phases of the motor include: For any two phases of the motor, the current modulated by the corresponding pulse width waveform in the previous control cycle is sampled using each sampling waveform in the current control cycle to obtain the current values corresponding to any two phases of the motor in the previous control cycle.
5. The single resistor current sampling method according to claim 1, characterized in that: When the pulse width waveform also includes the distribution position of the pulse width, the step of obtaining the pulse width waveform under the current control cycle and determining the control signal corresponding to the current control cycle includes: For any phase, according to the vector state corresponding to the sampling waveform and the pulse width corresponding to the pulse width waveform in the current control period, an initial pulse width waveform in the current control period is obtained; Determining the distribution position of the pulse width according to the vector state corresponding to the sampling waveform and the initial pulse width waveform to obtain a final pulse width waveform; The control signal corresponding to the present control cycle is determined according to the sampling waveform and the final pulse width waveform, wherein the final pulse width waveform is arranged after the sampling waveform.
6. The single resistor current sampling method according to claim 5, characterized in that: The step of determining the distribution position of the pulse width according to the vector state corresponding to the sampling waveform and the initial pulse width waveform to obtain the final pulse width waveform includes: Determine whether the vector states corresponding to the sampling waveforms are all the same; if they are all the same, the pulse width corresponding to the pulse width waveform in the current control period is continuous with the end time of the sampling waveform in the current control period; Or the pulse width corresponding to the pulse width waveform in the present control cycle is continuous with the start time of the sampling waveform in the next control cycle.
7. The single resistor current sampling method according to claim 6, characterized in that: If the vector states corresponding to the sampling waveforms are all the same, the step further includes: Determine whether the vector state corresponding to the sampling waveform changes from high to low; If so, the pulse width corresponding to the pulse width waveform in the current control cycle is continuous with the start time of the sampling waveform in the next control cycle; If not, the pulse width corresponding to the pulse width waveform in this control period is continuous with the end time of the sampling waveform in this control period.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the single-resistance current sampling method according to any one of claims 1 to 7 are implemented.
