Motor control method and device

By using the motor control method of random triangular carrier and space vector pulse width modulation algorithm in permanent magnet synchronous motor, the motor vibration and noise problems caused by high-frequency harmonics in the inverter output current are solved, and the effect of reducing noise and improving system performance is achieved.

CN119519502AActive Publication Date: 2025-02-25SHENZHEN SYSLAB ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411589708.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-25
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

The current output by the inverter in a permanent magnet synchronous motor contains high-frequency harmonics, which causes motor vibration and narrowband noise, affecting the user experience.

Method used

A motor control method is adopted, using a timer, ADC trigger source and pseudo-random number generation module to generate a random triangle carrier, adjust the motor current sampling value, and update the duty cycle according to the space vector pulse width modulation algorithm to adjust the output pulse width.

Benefits of technology

By reducing the number of inverter switching times, reducing switching losses, dispersing harmonic energy, significantly reducing high-frequency noise, and improving the robustness and dynamic performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119519502A_ABST
    Figure CN119519502A_ABST
Patent Text Reader

Abstract

The invention provides a motor control method and device. The method comprises the following steps: acquiring a random number generated by a pseudo random number generation module; setting the working frequency and the period value of the timer, and generating a triangular carrier wave; adjusting the working frequency of the timer based on the random number to obtain a random triangular carrier; acquiring motor current sampling values of the top point and the bottom point of the random triangular carrier wave; and based on the motor current sampling value, duty ratio updating is carried out, and the output pulse width is adjusted. A double-updating double-sampling control strategy is adopted, the switching frequency can be reduced to half of the original switching frequency, meanwhile, a random number is obtained through a Meisson rotation algorithm to change the frequency of each half period of triangular carrier waves, and minimum pulse width modulation is used for output pulse square waves, so that the switching frequency of the inverter is reduced, and the purposes of reducing high-frequency noise and improving the stability of the inverter are achieved. And the robustness and the dynamic performance of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motor control, and in particular to a motor control method and device. Background Art

[0002] Permanent magnet synchronous motors have the advantages of high power factor and high torque density, and have been widely used in wind power generation, electric vehicles, ship propulsion and other fields. However, the core of the induction motor drive system is the inverter using pulse width modulation technology. The current output by the inverter contains harmonics of the switching frequency and its sidebands. These harmonics have the characteristics of high frequency and narrow bandwidth, which will cause motor vibration and generate narrowband noise, making people feel uncomfortable.

[0003] In order to suppress the motor current harmonics, the existing research literature suppresses the current harmonics by optimizing the motor structure and using control strategies. The method of suppressing the current harmonics by optimizing the motor structure has the disadvantages of complex motor structure and increased processing difficulty. The traditional current harmonic suppression method technology is relatively mature, with high reliability and stability, but the suppression effect on wide-band high-frequency noise is poor.

[0004] If random variables are introduced into the control unit of the inverter using random modulation technology, the energy distribution concentrated in the switching frequency harmonic spectrum will be improved, the harmonic energy will be dispersed to have a wider bandwidth, and the final output square wave will be subjected to minimum pulse width modulation, thereby achieving the purpose of reducing high-frequency noise. Summary of the invention

[0005] The main purpose of the present invention is to provide a motor control method and device, aiming to solve the problem that harmonics in the current output by the inverter cause motor vibration, generate narrow-band noise, and make people feel uncomfortable.

[0006] To achieve the above object, the present invention proposes a motor control method, based on a control device, the control device includes a timer, an ADC trigger source and a pseudo-random number generation module, the method includes: Get the random number generated by the pseudo-random number generation module; Setting the working frequency and period value of the timer so that the timer generates a triangular carrier based on the working frequency and period value; Starting a timer to generate an update event and trigger an update interrupt, and in the update interrupt, adjusting the working frequency of the timer based on the random number to adjust the period of the triangular carrier to obtain a random triangular carrier; The ADC trigger source is set to the update event generated by the timer at the top and bottom of the random triangle carrier, and the motor current sampling values ​​at the top and bottom of the random triangle carrier are obtained; Based on the motor current sampling value, the duty cycle is updated according to the space vector pulse width modulation algorithm to adjust the output pulse width.

[0007] Optionally, the pseudo-random number generation module is a Mersenne twister algorithm module.

[0008] Optionally, the specific steps of setting the working frequency and period value of the timer so that the timer generates a triangular carrier based on the working frequency and period value include: Setting the clock source and pre-divider of the timer to obtain the operating frequency of the timer; Set the timer to continuous calculation mode and set the timer period value; Based on the operating frequency and the period value, the timer generates a triangular carrier; Get the period of the triangular carrier.

[0009] Optionally, the start timer generates an update event and triggers an update interrupt, and in the update interrupt, based on the random number, the working frequency of the timer is adjusted to adjust the period of the triangular carrier, and the specific steps of obtaining the random triangular carrier include: Limiting the output value of a pseudo-random number generation module to [a, -a], wherein the pseudo-random number generation module generates a random number between [a, -a]; After an update event is generated based on the start timer, the timer triggers an update interrupt when a preset condition is met; In an update interrupt, based on the random number, a pre-scaling coefficient of a pre-scalar in the timer is changed to adjust the operating frequency of the timer; The period of the triangular carrier between two update interruptions is adjusted along with the adjustment of the operating frequency to obtain a random triangular carrier.

[0010] Optionally, the specific steps of setting the ADC trigger source to the update event generated by the timer at the top and bottom of the random triangular carrier and obtaining the motor current sampling values ​​at the top and bottom of the random triangular carrier include: Select the update event generated by the timer as the ADC trigger source; When the update event of the timer occurs at the top and bottom points of the triangular carrier, the motor current sampling value is obtained.

[0011] Optionally, the control system further includes an ADC conversion module, and the specific steps of updating the duty cycle based on the motor current sampling value and adjusting the output pulse width according to the space vector pulse width modulation algorithm include: The obtained motor current sampling value is processed by the ADC conversion module and converted into a digital signal; After the motor current sampling value is converted into a digital signal, the ADC conversion module sends an interrupt signal; Based on the interrupt signal received from the ADC conversion module, the currently executed task is suspended, and the task of updating the duty cycle according to the space vector pulse width modulation algorithm is jumped to; Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated by the space vector pulse width modulation algorithm to achieve the update of the duty cycle and adjust the output pulse width of the duty cycle.

[0012] Optionally, the step of calculating the duty cycle based on the digital signal converted by the ADC conversion module by using the space vector pulse width modulation algorithm to update the duty cycle and adjust the output pulse width of the duty cycle also includes: When the duty cycle output pulse width is greater than the preset pulse width, the current output pulse width is replaced with the preset pulse width.

[0013] Optionally, the preset pulse width is less than or equal to the output pulse width of the current duty cycle.

[0014] The present invention also proposes a motor control device, including a timer, an ADC trigger source, a pseudo-random number generation module, a memory and a processor. The memory is provided with a control program, and the control program is used by the processor to implement the motor control method steps as described above when executed.

[0015] Optionally, the control device is a microcontroller of model STM32.

[0016] The present invention adopts a double-update double-sampling control strategy, performs current sampling and duty cycle update once every half cycle of the triangular carrier, so that the number of switching times can be reduced to half of the original. At the same time, a random number is obtained through a Mersenne rotation algorithm to change the frequency of each half cycle of the triangular carrier, and the output pulse square wave is modulated with a minimum pulse width, thereby reducing the number of inverter switches, reducing switching losses, and dispersing harmonic energy, thereby achieving the purpose of reducing high-frequency noise and improving the robustness and dynamic performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 A flow chart of the steps of a motor control method of the present invention; Figure 2This is a flow chart of step S200 of an embodiment of a motor control method of the present invention; Figure 3 This is a flow chart of step S300 of an embodiment of a motor control method of the present invention; Figure 4 This is a flow chart of step S400 of an embodiment of a motor control method of the present invention; Figure 5 This is a flow chart of step S500 of an embodiment of a motor control method of the present invention; Figure 6 This is a flow chart of step S540 of an embodiment of a motor control method of the present invention; Figure 7 A triangular carrier diagram of a single sampling and single updating control strategy in the prior art; Figure 8 A triangular carrier diagram of a sampling double-update double-sampling control strategy in a motor control method of the present invention; Fig. 9 The present invention discloses a triangular carrier diagram that is integrated with a random PWM and a double-update double-sampling algorithm in a motor control method.

[0019] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

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

[0021] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0022] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0023] In addition, in the present invention, descriptions such as "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0024] The present invention provides a motor control method based on a control device, the control device includes a timer, an ADC trigger source and a pseudo-random number generation module, such as Figure 1 and Fig. 9 As shown, the method includes: Step S100: Obtaining a random number generated by a pseudo-random number generation module; The pseudo-random number generation module can be used to generate random numbers, operate random sequences, and simulate random events. Although these numbers are pseudo-random, they are random enough in most applications. In this step, the control method obtains the random number required for the next step through the pseudo-random number generation module.

[0025] Step S200: Setting the working frequency and period value of the timer so that the timer is based on the working frequency and period value, such as Figure 7 As shown, a triangular carrier is generated; Setting up a timer to generate a triangular carrier usually involves configuring the timer's period and the interrupt service routine. The operating frequency of a timer usually refers to the frequency of the timer clock, which is the number of pulses that the timer counter increases per second. This frequency determines the speed at which the timer counts.

[0026] The period value is the maximum value reached by the timer counter. When the counter reaches this value, the timer generates an update event or triggers an interrupt, and the counter usually restarts counting from 0. The period value determines the interval at which the timer triggers an event or interrupt.

[0027] After determining the working frequency and period value of the timer, the actual period of the timer trigger event or interrupt can be calculated. In the continuous counting mode of the timer, the timer counter starts counting from 0, increases to a certain maximum value, and then gradually decreases to 0, forming a complete triangle wave cycle.

[0028] Step S300: Start the timer to generate an update event and trigger an update interrupt. In the update interrupt, based on the random number, adjust the working frequency of the timer to adjust the period of the triangular carrier, such as Fig. 9 As shown, a random triangular carrier is obtained; An update event is an event generated when a timer counter overflows. When the timer counter reaches its preset period value, the counter overflows (i.e. wraps around to 0 or a certain starting value) and triggers an update event. This event is usually used to perform periodic tasks, such as time measurement, timing control, etc.

[0029] The update interrupt is an interrupt triggered by the timer when an update event occurs. When the interrupt is triggered, the CPU will suspend the currently executing task and execute the interrupt service routine (ISR) associated with the timer. In the ISR, the present invention uses the random number generated in step S100 to adjust the working frequency of the timer, thereby adjusting the period of the triangular carrier. Figure 7 and Fig. 9 , Fig. 9 The period length of the other half of the triangular carrier in is changed to obtain a random triangular carrier.

[0030] Step S400: Figure 8 As shown, the ADC trigger source is set to the update event generated by the timer at the top and bottom points of the random triangle carrier, and the motor current sampling values ​​at the top and bottom points of the random triangle carrier are obtained; The ADC trigger source can be generally divided into two categories: software trigger and hardware trigger. In the present invention, the ADC trigger source is set as the update event generated by the timer at the top and bottom of the random triangle carrier. At the top and bottom of the random triangle carrier, the ADC is triggered to sample and convert the motor current. Among them, the sampling rate should be high enough to accurately capture the current value at the top and bottom of the triangle carrier; the resolution should be high enough to provide sufficient accuracy. At this time, the timer triggers the update interrupt, processes the ADC conversion result in the ISR, reads the sampled value of the motor current, and enters the next step at the same time.

[0031] Step S500: Based on the motor current sampling value, the duty cycle is updated according to the space vector pulse width modulation algorithm to adjust the output pulse width.

[0032] Space vector pulse width modulation (SVPWM) is an efficient modulation technology widely used in motor drives and power electronic devices. It generates a voltage or current that is approximately sinusoidal by precisely controlling the switching devices of the inverter, thereby driving the AC motor. In the SVPWM algorithm, the update and adjustment of the duty cycle is the key link in the output pulse width control. Based on the motor current sampling value, the width of the output pulse can be adjusted accordingly by adjusting the duty cycle. The larger the duty cycle, the wider the width of the output pulse; the smaller the duty cycle, the narrower the width of the output pulse.

[0033] like Figures 7-9 As shown, Figure 7It is a single-sampling single-update control strategy, in which ADC current sampling and duty cycle update are performed once in each PWM cycle. Figure 8 In order to reduce switching losses and the number of switches, the PWM cycle is increased to twice that of the single sampling and single updating control strategy. Two ADC current sampling and two duty cycle updates are performed in each PWM cycle. ADC current sampling is performed at the bottom and top of the triangular carrier. Compared with the single updating and single sampling control strategy, the number of switches is reduced to half while maintaining the original control effect.

[0034] Fig. 9 As shown, in order to reduce switching noise, improve the energy distribution concentrated in the switching frequency harmonic spectrum, disperse the harmonic energy, the random PWM is integrated with the double-update double-sampling algorithm, and update events are generated at the bottom and top of the triangular carrier to enter the update interrupt to perform the SVPWM algorithm and modify the pre-division coefficient of the timer. At the same time, the duty cycle is updated and the final output square wave is subjected to minimum pulse width modulation, thereby achieving the purpose of reducing high-frequency noise and reducing the number of switching times.

[0035] The present invention adopts a double-update double-sampling control strategy, performs current sampling and duty cycle update once every half cycle of the triangular carrier, so that the number of switching times can be reduced to half of the original. At the same time, a random number is obtained through a Mersenne rotation algorithm to change the frequency of each half cycle of the triangular carrier, and the output pulse square wave is modulated with a minimum pulse width, thereby reducing the number of inverter switches, reducing switching losses, and dispersing harmonic energy, thereby achieving the purpose of reducing high-frequency noise and improving the robustness and dynamic performance of the system.

[0036] In one embodiment, the pseudo-random number generation module is a Mersenne twister algorithm module. The Mersenne twister algorithm is a pseudo-random number generation algorithm that is based on matrix linear recursion on a finite binary field, can quickly generate high-quality pseudo-random numbers, and corrects many defects of the classical random number generation algorithm.

[0037] One of the main advantages of the Mersenne Twister algorithm is its very long period, which ensures that the algorithm is able to produce a non-repeating sequence of random numbers even after running for a long time. The algorithm is considered to be statistically uniformly distributed and performs well in many applications. This is due to the use of Mersenne primes in the algorithm, which ensures that the generated sequence has good statistical properties.

[0038] The implementation of this algorithm usually involves three stages: obtaining the basic Mersenne rotation chain, performing the rotation algorithm on the rotation chain, and processing the results obtained by the rotation algorithm.

[0039] In one embodiment, if Figure 2 As shown, the specific steps of setting the working frequency and period value of the timer so that the timer generates a triangular carrier based on the working frequency and period value include: Step S210: setting the clock source and pre-divider of the timer to obtain the working frequency of the timer; There are usually multiple options for the timer's clock source, including external clock source, internal clock source or system clock. When selecting the clock source, you need to consider the accuracy, stability and application requirements of the timer. When there is an external clock signal input, you can choose an external clock source, which is usually used in application scenarios that require high precision or synchronization; microcontrollers usually have one or more clock sources inside, such as internal RC oscillators, which are usually used in application scenarios that do not require high precision or external clock signals; the system clock is the core clock of the microcontroller, usually used for high-speed computing and communication. In some cases, the system clock can also be used as the clock source of the timer.

[0040] The prescaler is used to divide the clock source of the timer to reduce the counting frequency of the timer. This helps to achieve a longer timing cycle or more accurate timing control. In this embodiment, the required prescaler coefficient is determined, and the larger the prescaler coefficient, the lower the counting frequency of the timer.

[0041] In this step, set the timer's clock source and prescaler, select the timer's clock source, and determine the prescaler's prescaler coefficient value. The relationship between the timer's operating frequency and the timer's clock source (timer's clock frequency) and prescaler coefficient is as follows: Operating frequency = clock frequency / (pre-scaling factor + 1); By adjusting the pre-scaling factor, the operating frequency of the timer can be changed, thereby affecting the frequency of the generated triangular carrier.

[0042] Step S220: setting the timer to a continuous calculation mode and setting a period value of the timer; Set the timer to continuous calculation mode (also called continuous counting mode or loop counting mode). In addition to the pre-scaling factor, the period value of the timer also determines the period of the PWM signal. The period value determines the number of times the timer counter needs to count before reaching an overflow. The timer starts counting from 0. When the count reaches the period value, the timer will start counting from 0 again to form a cycle. This period value is the maximum value of the timer counter plus 1 (because the count usually starts from 0).

[0043] Step S230: Based on the operating frequency and the period value, the timer generates a triangular carrier; The time of each count can be calculated by the working frequency of the timer: Time per count = 1 / operating frequency; In the continuous counting mode of the timer, the timer counter starts counting from 0, increases to a certain maximum value, and then gradually decreases to 0, forming a complete triangle wave cycle.

[0044] The overflow time T of the timer (one cycle of the triangular carrier) is: T = (period value + 1) × time per count; Step S240: Obtain the period of the triangular carrier.

[0045] T = (period value + 1) × (prescale factor + 1) / clock frequency.

[0046] In one embodiment, if Figure 3 As shown, the timer is started to generate an update event and trigger an update interrupt. In the update interrupt, the working frequency of the timer is adjusted based on a random number to adjust the period of the triangular carrier. The specific steps of obtaining the random triangular carrier include: Step S310: limiting the output value of the pseudo-random number generation module to [a, -a], and the pseudo-random number generation module generates a random number between [a, -a]; Furthermore, the Mersenne Twister algorithm is used and the output value of the Mersenne Twister algorithm is limited to [-1, 1]. According to the switching frequency formula: ; in A random number between [-1, 1] generated by the Mersenne Twister algorithm; is the random range of switching frequency; is the instantaneous value of the switching frequency; is the average value of the random switching frequency.

[0047] Step S320: After an update event is generated based on the start timer, the timer triggers an update interrupt when a preset condition is met; in the update interrupt, the next step is executed.

[0048] Step S330: In the update interrupt, based on the random number, change the pre-scaling coefficient of the pre-scaling device in the timer to adjust the working frequency of the timer. According to the calculation formula of the working frequency and the pre-scaling coefficient, the pre-scaling coefficient is changed by the random number to adjust the working frequency of the timer.

[0049] Step S340: The triangular carrier period between two update interruptions is adjusted along with the adjustment of the operating frequency to obtain a random triangular carrier. The pre-scaling coefficient is changed by the generated random number in the update interruption, thereby changing the time of the other half period of the triangular carrier.

[0050] In one embodiment, if Figure 4 As shown, the ADC trigger source is set to the update event generated by the timer at the top and bottom of the random triangle carrier, and the specific steps of obtaining the motor current sampling values ​​at the top and bottom of the random triangle carrier include: Step S410: select the update event generated by the timer as the ADC trigger source; thus, when the timer generates an update event, the ADC will start converting.

[0051] Step S420: When the timer update event occurs at the vertex and bottom of the triangular carrier, the motor current sampling value is obtained. The vertex and bottom of the triangular carrier correspond to the maximum and minimum values ​​of the PWM signal. When the triangular carrier is at its vertex or bottom, the ADC will be triggered and start conversion. After the conversion is completed, the motor current sampling value is read from the result register of the ADC.

[0052] In one embodiment, if Figure 5 As shown, the control system also includes an ADC conversion module, which updates the duty cycle based on the motor current sampling value according to the space vector pulse width modulation algorithm. The specific steps of adjusting the output pulse width include: Step S510: Processing the obtained motor current sampling value through the ADC conversion module and converting it into a digital signal; Step S520: After the motor current sampling value is converted into a digital signal, the ADC conversion module sends an interrupt signal; once the ADC conversion is completed, the ADC conversion module generates an interrupt signal, and this interrupt signal triggers the interrupt processor of the controller.

[0053] Step S530: based on receiving the interrupt signal of the ADC conversion module, suspend the currently executed task and jump to the task of updating the duty cycle according to the space vector pulse width modulation algorithm; Step S540: Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated by the space vector pulse width modulation algorithm to update the duty cycle and adjust the output pulse width of the duty cycle. In the interrupt processing program, the motor current sampling value in the ADC result register is read, and the SVPWM algorithm is used to calculate the duty cycle of the PWM signal required to generate the target voltage vector. At the end of the interrupt processing program, the interrupt flag of the ADC is cleared to allow the next interrupt signal to be received.

[0054] In one embodiment, the step of calculating the duty cycle by a space vector pulse width modulation algorithm based on the digital signal converted by the ADC conversion module, and updating the duty cycle and adjusting the output pulse width of the duty cycle further includes: When the duty cycle output pulse width is greater than the preset pulse width, the current output pulse width is replaced with the preset pulse width. Optionally, the preset pulse width is less than or equal to the current duty cycle output pulse width.

[0055] In this embodiment, if Figure 6 As shown, step S540 includes: Step S541: Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated by a space vector pulse width modulation algorithm to update the duty cycle; Step S542: When the duty cycle output pulse width is greater than the preset pulse width, the current output pulse width is replaced with the preset pulse width. The final output square wave is further modulated by minimum pulse width, and when the duty cycle output pulse width is less than the minimum pulse width, it is output as the minimum pulse width.

[0056] The present invention also provides a motor control device, including a timer, an ADC trigger source, a pseudo-random number generation module, a memory and a processor. The memory is provided with a control program, and the control program is used by the processor to implement the motor control method steps as claimed in any one of claims 1 to 8 when executed.

[0057] In one embodiment, the control device is a microcontroller of model STM32. The STM32 microcontroller is a high-performance, low-power 32-bit microcontroller. It has a rich peripheral interface, high-speed data processing capability and powerful control capability, and is widely used in industrial automation, automotive electronics, smart home and other fields. The random double sampling double update control strategy based on STM32 in this embodiment has a small amount of calculation and is easy to implement.

[0058] The above descriptions are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.

Claims

1. A motor control method, based on a control device, characterized in that: The control device comprises A timer, an ADC trigger source and a pseudo-random number generation module, the method includes: Get the random number generated by the pseudo-random number generation module; Setting the working frequency and period value of the timer so that the timer generates a triangular carrier based on the working frequency and period value; Starting a timer to generate an update event and trigger an update interrupt, and in the update interrupt, adjusting the working frequency of the timer based on the random number to adjust the period of the triangular carrier to obtain a random triangular carrier; The ADC trigger source is set to the update event generated by the timer at the top and bottom of the random triangle carrier, and the motor current sampling values ​​at the top and bottom of the random triangle carrier are obtained; Based on the motor current sampling value, the duty cycle is updated according to the space vector pulse width modulation algorithm to adjust the output pulse width.

2. The motor control method according to claim 1, characterized in that: The pseudo-random number generation module is a Mersenne twister algorithm module.

3. The motor control method according to claim 1, characterized in that: The specific steps of setting the working frequency and period value of the timer so that the timer generates a triangular carrier based on the working frequency and period value include: Setting the clock source and pre-divider of the timer to obtain the operating frequency of the timer; Set the timer to continuous calculation mode and set the timer period value; Based on the operating frequency and the period value, the timer generates a triangular carrier; Get the period of the triangular carrier.

4. The motor control method according to claim 1, characterized in that: The start timer generates an update event and triggers an update interrupt. In the update interrupt, the working frequency of the timer is adjusted based on the random number to adjust the period of the triangular carrier. The specific steps of obtaining the random triangular carrier include: Limiting the output value of a pseudo-random number generation module to [a, -a], wherein the pseudo-random number generation module generates a random number between [a, -a]; After an update event is generated based on the start timer, the timer triggers an update interrupt when a preset condition is met; In an update interrupt, based on the random number, a pre-scaling coefficient of a pre-scalar in the timer is changed to adjust the operating frequency of the timer; The period of the triangular carrier between two update interruptions is adjusted along with the adjustment of the operating frequency to obtain a random triangular carrier.

5. The motor control method according to claim 1, characterized in that: The specific steps of setting the ADC trigger source to the update event generated by the timer at the top and bottom of the random triangular carrier and obtaining the motor current sampling values ​​at the top and bottom of the random triangular carrier include: Select the update event generated by the timer as the ADC trigger source; When the update event of the timer occurs at the top and bottom points of the triangular carrier, the motor current sampling value is obtained.

6. The motor control method according to claim 1, characterized in that: The control system further includes an ADC conversion module. The specific steps of updating the duty cycle based on the motor current sampling value and adjusting the output pulse width according to the space vector pulse width modulation algorithm include: The obtained motor current sampling value is processed by the ADC conversion module and converted into a digital signal; After the motor current sampling value is converted into a digital signal, the ADC conversion module sends an interrupt signal; Based on the interrupt signal received from the ADC conversion module, the currently executed task is suspended, and the task of updating the duty cycle according to the space vector pulse width modulation algorithm is jumped to; Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated by the space vector pulse width modulation algorithm to achieve the update of the duty cycle and adjust the output pulse width of the duty cycle.

7. The motor control method according to claim 6, characterized in that: The step of calculating the duty cycle based on the digital signal converted by the ADC conversion module by the space vector pulse width modulation algorithm, updating the duty cycle and adjusting the output pulse width of the duty cycle also includes: When the duty cycle output pulse width is greater than the preset pulse width, the current output pulse width is replaced with the preset pulse width.

8. The motor control method according to claim 7, characterized in that: The preset pulse width is less than or equal to the output pulse width of the current duty cycle.

9. A motor control device, characterized in that: The method comprises a timer, an ADC trigger source, a pseudo-random number generation module, a memory and a processor. The memory is provided with a control program. When the control program is executed by the processor, the steps of the motor control method according to any one of claims 1 to 8 are implemented.

10. The motor control device according to claim 9, characterized in that: The control device is a microcontroller of the STM32 model.

Citation Information

Patent Citations

  • Triangular carrier slope random distribution pulse width modulation circuit

    CN106533404A

  • Motor control method for irregular carrier slope random modulation

    CN109981025A

  • Double-random SVPWM harmonic suppression method based on Mersenne twister algorithm

    CN112910347A

  • Double-sampling single-refreshing method based on three-phase two-level topological structure

    CN114257102A

  • Current control method and drive control device using the method

    JP2008086071A