Motor control method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2026-08-11
Smart Images

Figure CN119519502B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, and in particular to a motor control method and apparatus. Background Technology
[0002] Permanent magnet synchronous motors (PMSMs) have advantages such as high power factor and high torque density, and are widely used in wind power generation, electric vehicles, and ship propulsion. However, the core of an induction motor drive system is the inverter, which uses pulse width modulation (PWM) technology. The current output by the inverter contains harmonics of the switching frequency and its sidebands. These harmonics are characterized by high frequency and narrow bandwidth, which can cause motor vibration and generate narrowband noise, making people feel uncomfortable.
[0003] To suppress motor current harmonics, existing research literature addresses this through both optimizing the motor's structure and implementing control strategies. However, methods that rely on optimizing the motor's structure suffer from drawbacks such as increased structural complexity and manufacturing difficulty. Traditional current harmonic suppression methods are relatively mature and offer high reliability and stability, but they are less effective at suppressing high-frequency noise over a wide frequency range.
[0004] If random modulation technology is used to introduce random variables into the inverter's control unit, the energy distribution concentrated in the switching harmonic spectrum will be improved, the harmonic energy will be dispersed, and it will have a wider bandwidth. The final output square wave will be modulated with minimum pulse width, thereby reducing high-frequency noise. Summary of the Invention
[0005] The main objective of this invention is to propose a motor control method and device, which aims to solve the problem that harmonics in the inverter output current cause motor vibration, generate narrowband noise, and cause discomfort to people.
[0006] To achieve the above objectives, this invention proposes a motor control method based on a control device, which includes a timer, an ADC trigger source, and a pseudo-random number generation module. The method includes:
[0007] Obtain random numbers generated by the pseudo-random number generation module;
[0008] Set the operating frequency and period value of the timer so that the timer generates a triangular carrier wave based on the operating frequency and period value;
[0009] Start a timer to generate an update event and trigger an update interrupt. In the update interrupt, adjust the operating frequency of the timer based on the random number to adjust the period of the triangular carrier wave and obtain a random triangular carrier wave.
[0010] Set the ADC trigger source to the update event generated by the timer at the vertex and basal point of the random triangular carrier wave, and obtain the motor current sampling value at the vertex and basal point of the random triangular carrier wave;
[0011] Based on the motor current sampling value, the duty cycle is updated according to the space vector pulse width modulation algorithm, and the output pulse width is adjusted.
[0012] Optionally, the pseudo-random number generation module is a Mason tween rotation algorithm module.
[0013] Optionally, the specific steps of setting the operating frequency and period value of the timer so that the timer generates a triangular carrier wave based on the operating frequency and period value include:
[0014] Set the clock source and prescaler of the timer to obtain the operating frequency of the timer;
[0015] Set the timer to continuous calculation mode and set the timer's period value;
[0016] Based on the operating frequency and period value, the timer generates a triangular carrier wave;
[0017] Obtain the period of the triangular carrier wave.
[0018] Optionally, the specific steps of starting the timer to generate an update event and trigger an update interrupt, and adjusting the operating frequency of the timer based on the random number in the update interrupt to adjust the period of the triangular carrier to obtain the random triangular carrier include:
[0019] The output value of the pseudo-random number generation module is limited to [a, -a], and the pseudo-random number generation module generates random numbers between [a, -a].
[0020] After an update event is generated based on the start of a timer, the timer triggers an update interrupt under preset conditions;
[0021] In the update interrupt, based on the random number, the prescaler coefficient of the prescaler in the timer is changed to adjust the operating frequency of the timer;
[0022] The triangular carrier period between two update interruptions is adjusted as the operating frequency is adjusted to obtain a random triangular carrier.
[0023] Optionally, the specific steps of setting the ADC trigger source to the update event generated by the timer at the vertices and basal points of the random triangular carrier wave, and obtaining the motor current sampling values at the vertices and basal points of the random triangular carrier wave, include:
[0024] Select the update event generated by the timer as the ADC trigger source;
[0025] When the timer update event occurs at the apex and basal point of the triangular carrier wave, the motor current sampling value is acquired.
[0026] Optionally, the control system further includes an ADC conversion module, wherein the specific steps of updating the duty cycle based on the motor current sampling value and according to the space vector pulse width modulation algorithm to adjust the output pulse width include:
[0027] The obtained motor current sampling values are processed by the ADC conversion module and converted into digital signals;
[0028] After the motor current sampling value is converted into a digital signal, the ADC conversion module sends an interrupt signal;
[0029] Based on the received interrupt signal from the ADC conversion module, the currently executing task is paused, and the task of updating the duty cycle according to the space vector pulse width modulation algorithm is executed.
[0030] Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated through the space vector pulse width modulation algorithm to realize the update of the duty cycle and the adjustment of the output pulse width of the duty cycle.
[0031] Optionally, the step of updating the duty cycle and adjusting the output pulse width based on the digital signal converted by the ADC conversion module by calculating the duty cycle using the space vector pulse width modulation algorithm further includes:
[0032] 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.
[0033] Optionally, the preset pulse width is less than or equal to the output pulse width of the current duty cycle.
[0034] 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 contains a control program, which is executed by the processor to implement the motor control method steps described above.
[0035] Optionally, the control device is an STM32 microcontroller.
[0036] This invention employs a dual-update, dual-sampling control strategy, performing current sampling and duty cycle updates every half cycle of the triangular carrier wave, thereby reducing the number of switching operations to half of the original. Simultaneously, a random number is obtained through the Mason rot algorithm to change the frequency of the triangular carrier wave every half cycle, and the output pulse square wave is modulated with minimum pulse width, thereby reducing the number of inverter switching operations, reducing switching losses, dispersing harmonic energy, and achieving the goal of reducing high-frequency noise and improving the robustness and dynamic performance of the system. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0038] Figure 1 This is a flowchart of the steps of a motor control method according to the present invention;
[0039] Figure 2 This is a flowchart of step S200 of an embodiment of a motor control method of the present invention;
[0040] Figure 3 This is a flowchart of step S300 of an embodiment of a motor control method of the present invention;
[0041] Figure 4 This is a flowchart of step S400 of an embodiment of a motor control method of the present invention;
[0042] Figure 5 This is a flowchart of step S500 of an embodiment of a motor control method of the present invention;
[0043] Figure 6 This is a flowchart of step S540 of an embodiment of a motor control method of the present invention;
[0044] Figure 7 This is a triangular carrier diagram for a single-sampling, single-update control strategy in existing technologies.
[0045] Figure 8 This is a triangular carrier diagram of the sampling double-update double-sampling control strategy in a motor control method of the present invention;
[0046] Figure 9 This is a triangular carrier diagram used in a motor control method of the present invention, which integrates random PWM and a double-update double-sampling algorithm.
[0047] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0049] 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 positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0050] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0051] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0052] This invention provides a motor control method based on a control device, which includes a timer, an ADC trigger source, and a pseudo-random number generation module, such as... Figure 1 and Figure 9 As shown, the method includes:
[0053] Step S100: Obtain the random number generated by the pseudo-random number generation module;
[0054] The pseudo-random number generation module can be used to generate random numbers, manipulate random sequences, and simulate random events. Although these numbers are pseudo-random, they are random enough for most applications. In this step, the control method obtains the random numbers needed for the next step through the pseudo-random number generation module.
[0055] Step S200: Set the timer's operating frequency and period value so that the timer operates based on the operating frequency and period value, such as... Figure 7 As shown, a triangular carrier wave is generated;
[0056] Setting up a timer to generate a triangular carrier wave typically involves configuring the timer's period and interrupt service routine. The timer's operating frequency usually refers to the frequency of the timer clock, which is the number of pulses the timer counter increments by per second; this frequency determines the timer's counting speed.
[0057] 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 events or interrupts.
[0058] Once the operating frequency and period value of the timer are determined, 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 back to 0, forming a complete triangular wave cycle.
[0059] Step S300: Start the timer to generate an update event and trigger an update interrupt. In the update interrupt, adjust the timer's operating frequency based on a random number to adjust the period of the triangular carrier wave, such as... Figure 9 As shown, a random triangular carrier wave is obtained;
[0060] An update event is an event generated when a timer counter overflows. When the timer counter reaches its preset period value, it overflows (i.e., wraps back to 0 or a certain initial value) and triggers an update event. This event is typically used to perform periodic tasks, such as time measurement and timing control.
[0061] An update interrupt is a timer-triggered interrupt that occurs when an update event happens. When an interrupt is triggered, the CPU suspends the currently executing task and executes the interrupt service routine (ISR) associated with the timer. In the ISR, this invention uses the random number generated in step S100 to adjust the timer's operating frequency, thereby adjusting the period of the triangular carrier wave. (Comparison) Figure 7 and Figure 9 , Figure 9 The period length of the other half of the triangular carrier wave changes, resulting in a random triangular carrier wave.
[0062] Step S400: As Figure 8 As shown, the ADC trigger source is set to the update event generated by the timer at the vertices and basal points of the random triangular carrier wave, and the motor current sampling values at the vertices and basal points of the random triangular carrier wave are obtained.
[0063] ADC trigger sources can be broadly categorized into two types: software triggering and hardware triggering. In this invention, the ADC trigger source is set to the update events generated by the timer at the vertices and basal points of a random triangular carrier wave. At the vertices and basal points of the random triangular carrier wave, the ADC is triggered to sample and convert the motor current. The sampling rate should be high enough to accurately capture the current values at the vertices and basal points of the triangular carrier wave; the resolution should also be high enough to provide sufficient accuracy. At this point, the timer triggers an update interrupt, the ADC conversion result is processed in the ISR, and the sampled value of the motor current is read, while proceeding to the next step.
[0064] Step S500: Based on the motor current sampling value, update the duty cycle according to the space vector pulse width modulation algorithm and adjust the output pulse width.
[0065] Space Vector Pulse Width Modulation (SVPWM) is a highly efficient modulation technique widely used in motor drives and power electronic equipment. It generates an approximately sinusoidal voltage or current by precisely controlling the switching devices of an inverter, thereby driving an AC motor. In the SVPWM algorithm, updating and adjusting the duty cycle is a crucial step in controlling the output pulse width. Based on the sampled motor current value, the width of the output pulse can be adjusted accordingly by changing the duty cycle. A larger duty cycle results in a wider output pulse; a smaller duty cycle results in a narrower output pulse.
[0066] like Figures 7-9 As shown, Figure 7 The single-sampling, single-update control strategy involves sampling the ADC current and updating the duty cycle once per PWM cycle. Figure 8 To reduce switching losses and the number of switching operations, the PWM period is doubled compared to the single-sampling, single-update control strategy. Each PWM period involves two ADC current samples and two duty cycle updates. ADC current sampling is performed at the bottom and top points of the triangular carrier wave. Compared to the single-update, single-sampling control strategy, this approach reduces the number of switching operations to half while maintaining the original control effect.
[0067] Figure 9 To reduce switching noise, improve the energy distribution of the switching harmonic spectrum, and disperse harmonic energy, random PWM is integrated with a double-update double-sampling algorithm. Update events are generated at both the bottom and top of the triangular carrier wave, triggering an update interrupt to perform the SVPWM algorithm and modify the prescaler coefficient of the timer. Simultaneously, the duty cycle is updated, and the final output square wave is subjected to minimum pulse width modulation, thereby reducing high-frequency noise and the number of switching operations.
[0068] This invention employs a dual-update, dual-sampling control strategy, performing current sampling and duty cycle updates every half cycle of the triangular carrier wave, thereby reducing the number of switching operations to half of the original. Simultaneously, a random number is obtained through the Mason rot algorithm to change the frequency of the triangular carrier wave every half cycle, and the output pulse square wave is modulated with minimum pulse width, thereby reducing the number of inverter switching operations, reducing switching losses, dispersing harmonic energy, and achieving the goal of reducing high-frequency noise and improving the robustness and dynamic performance of the system.
[0069] In one embodiment, the pseudo-random number generation module is a Mason tween rotation algorithm module. The Mason tween rotation algorithm is a pseudo-random number generation algorithm that is based on linear recursion of matrices over a finite binary field. It can quickly generate high-quality pseudo-random numbers and corrects many of the shortcomings of classical random number generation algorithms.
[0070] One of the main advantages of the Mersenne rotation algorithm is its very long period, which ensures that the algorithm can still generate non-repeating sequences of random numbers after running for a long time. The algorithm is statistically considered to be uniformly distributed and performs well in many applications. This is because the algorithm uses Mersenne primes, ensuring that the generated sequences have good statistical properties.
[0071] The implementation of this algorithm typically involves three stages: obtaining the basic Mason swirl chain, performing a swirl algorithm on the swirl chain, and processing the results obtained from the swirl algorithm.
[0072] In one embodiment, such as Figure 2 As shown, the specific steps for setting the timer's operating frequency and period value so that the timer generates a triangular carrier wave based on the operating frequency and period value include:
[0073] Step S210: Set the clock source and prescaler of the timer to obtain the operating frequency of the timer;
[0074] Timer clock sources typically offer several options, including external clock sources, internal clock sources, or system clocks. When selecting a clock source, the timer's accuracy, stability, and application requirements must be considered. External clock sources can be chosen when an external clock signal is available, typically used for applications requiring high precision or synchronization. Microcontrollers usually have one or more internal clock sources, such as internal RC oscillators; these are typically used for applications that do not require high precision or external clock signals. The system clock is the core clock of the microcontroller, typically used for high-speed computation and communication; in some cases, the system clock can also be used as the timer's clock source.
[0075] A prescaler is used to divide the clock source of a timer to reduce the timer's counting frequency. This helps to achieve longer timing periods or more precise timing control. In this embodiment, a desired prescaler factor is determined; the larger the prescaler factor, the lower the timer's counting frequency.
[0076] This step sets the timer's clock source and prescaler. Select the timer's clock source and determine the prescaler's prescaler value. The relationship between the timer's operating frequency, its clock source (timer's clock frequency), and the prescaler value is as follows:
[0077] Operating frequency = Clock frequency / (Prescaler + 1);
[0078] By adjusting the prescaler coefficient, the operating frequency of the timer can be changed, which in turn affects the frequency of the generated triangular carrier wave.
[0079] Step S220: Set the timer to continuous calculation mode and set the timer period value;
[0080] Set the timer to continuous counting mode (also known as continuous counting mode or cyclic counting mode). Besides the prescaler, the timer's period value also determines the period of the PWM signal. The period value determines how many times the timer counter needs to count before overflowing. The timer starts counting from 0, and when it reaches the period value, it restarts counting from 0, forming one cycle. This period value is the maximum value of the timer counter plus 1 (because counting usually starts from 0).
[0081] Step S230: Based on the operating frequency and period value, the timer generates a triangular carrier wave;
[0082] The time for each count can be calculated using the timer's operating frequency.
[0083] Time for each count = 1 / operating frequency;
[0084] 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 back to 0, forming a complete triangular wave cycle.
[0085] The timer overflow time T (one period of the triangular carrier wave) is:
[0086] T = (period value + 1) × time for each count;
[0087] Step S240: Obtain the period of the triangular carrier wave.
[0088] T = (period value + 1) × (prescaler + 1) / clock frequency.
[0089] In one embodiment, such as Figure 3As shown, the specific steps for generating an update event and triggering an update interrupt by starting a timer, adjusting the timer's operating frequency based on a random number within the update interrupt to adjust the period of the triangular carrier wave, and obtaining the random triangular carrier wave include:
[0090] Step S310: Limit the output value of the pseudo-random number generation module to [a, -a], and the pseudo-random number generation module generates random numbers between [a, -a].
[0091] Furthermore, using the Mason twirl algorithm and limiting its output to [-1, 1], according to the switching frequency formula:
[0092] ;
[0093] in The random number between [-1, 1] generated by the Mason rotation algorithm; For a random range of switching frequencies; This is the instantaneous value of the switching frequency; This represents the average value of the random switching frequency.
[0094] Step S320: After an update event is generated based on the start timer, the timer triggers an update interrupt under preset conditions; in the update interrupt, the next step is executed.
[0095] Step S330: In the update interrupt, based on a random number, change the prescaler coefficient in the timer to adjust the timer's operating frequency. According to the above formula for calculating the operating frequency and the prescaler coefficient, the prescaler coefficient is changed by a random number, thereby adjusting the timer's operating frequency.
[0096] Step S340: The triangular carrier period between the two update interrupts is adjusted according to the operating frequency to obtain a random triangular carrier. During the update interrupt, the prescaler coefficient is changed by generating random numbers, thereby altering the time of the other half of the triangular carrier period.
[0097] In one embodiment, such as Figure 4 As shown, the specific steps for obtaining the motor current sampling values at the vertices and troughs of the random triangular carrier wave, by setting the ADC trigger source to the update events generated by the timer at the vertices and troughs of the random triangular carrier wave, include:
[0098] Step S410: Select the update event generated by the timer as the ADC trigger source; in this way, when the timer generates an update event, the ADC will start the conversion.
[0099] Step S420: When the timer update event occurs at the apex and trough of the triangular carrier wave, acquire the motor current sample value. The apex and trough of the triangular carrier wave correspond to the maximum and minimum values of the PWM signal. When the triangular carrier wave is at its apex or trough, the ADC will be triggered and start conversion. After conversion, read the motor current sample value from the ADC result register.
[0100] In one embodiment, such as 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 and according to the space vector pulse width modulation algorithm. The specific steps for adjusting the output pulse width include:
[0101] Step S510: The obtained motor current sample value is processed by the ADC conversion module and converted into a digital signal;
[0102] 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 will generate an interrupt signal, which will trigger the controller's interrupt processor.
[0103] Step S530: Based on the received interrupt signal from the ADC conversion module, pause the currently executing task and jump to the task of updating the duty cycle according to the space vector pulse width modulation algorithm;
[0104] Step S540: Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated using the space vector pulse width modulation algorithm to update the duty cycle and adjust the output pulse width. In the interrupt handler, 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 handler, the interrupt flag of the ADC is cleared to allow the reception of the next interrupt signal.
[0105] In one embodiment, the steps of updating the duty cycle and adjusting the output pulse width based on the digital signal converted by the ADC conversion module and calculating the duty cycle using a space vector pulse width modulation algorithm further include:
[0106] When the output pulse width of the duty cycle 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 output pulse width of the current duty cycle.
[0107] In this embodiment, as Figure 6 As shown, step S540 includes:
[0108] Step S541: Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated through the space vector pulse width modulation algorithm to update the duty cycle;
[0109] Step S542: When the duty cycle output pulse width is greater than the preset pulse width, replace the current output pulse width with the preset pulse width. The final output square wave is further modulated using minimum pulse width modulation; when the duty cycle output pulse width is less than the minimum pulse width, output it as the minimum pulse width.
[0110] 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 contains a control program, which is executed by the processor to implement the motor control method steps as described in any one of claims 1 to 8.
[0111] In one embodiment, the control device is an STM32 microcontroller. The STM32 microcontroller is a high-performance, low-power 32-bit microcontroller. It features rich peripheral interfaces, high-speed data processing capabilities, and powerful control capabilities, and is widely used in industrial automation, automotive electronics, smart homes, and other fields. The random double-sampling double-update control strategy based on the STM32 in this embodiment has low computational complexity and is easy to implement.
[0112] The above description is merely an optional embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within 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 includes The method includes a timer, an ADC trigger source, and a pseudo-random number generation module. Obtain random numbers generated by the pseudo-random number generation module; Set the clock source and prescaler of the timer to obtain the operating frequency of the timer, set the timer to continuous calculation mode and set the period value of the timer, and generate a triangular carrier wave based on the operating frequency and period value; obtain the period of the triangular carrier wave. The output value of the pseudo-random number generation module is limited to [-1, 1], and the pseudo-random number generation module generates random numbers between [-1, 1]. After an update event is generated based on the start of the timer, the timer triggers an update interrupt under preset conditions. In the update interrupt, based on the random numbers, the prescaler coefficient of the prescaler in the timer is changed to adjust the operating frequency of the timer. The triangular carrier period between two update interrupts is adjusted with the adjustment of the operating frequency to obtain a random triangular carrier. Set the ADC trigger source to the update event generated by the timer at the vertex and basal point of the random triangular carrier wave, and obtain the motor current sampling value at the vertex and basal point of the random triangular carrier wave; Based on the motor current sampling value, the duty cycle is updated according to the space vector pulse width modulation algorithm, and the output pulse width is adjusted.
2. The motor control method according to claim 1, characterized in that, The pseudo-random number generation module is a Mason tween rotation algorithm module.
3. The motor control method according to claim 1, characterized in that, The specific steps for setting the ADC trigger source to the update event generated by the timer at the vertices and basal points of the random triangular carrier wave, and obtaining the motor current sampling values at the vertices and basal points of the random triangular carrier wave, include: Select the update event generated by the timer as the ADC trigger source; When the timer update event occurs at the apex and basal point of the triangular carrier wave, the motor current sampling value is acquired.
4. The motor control method according to claim 1, characterized in that, The control device also includes an ADC conversion module. The specific steps for updating the duty cycle and adjusting the output pulse width based on the motor current sampling value and according to the space vector pulse width modulation algorithm include: The obtained motor current sampling values are processed by the ADC conversion module and converted into digital signals; After the motor current sampling value is converted into a digital signal, the ADC conversion module sends an interrupt signal; Based on the received interrupt signal from the ADC conversion module, the currently executing task is paused, and the task of updating the duty cycle according to the space vector pulse width modulation algorithm is executed. Based on the digital signal converted by the ADC conversion module, the duty cycle is calculated through the space vector pulse width modulation algorithm to realize the update of the duty cycle and the adjustment of the output pulse width of the duty cycle.
5. The motor control method according to claim 4, characterized in that, The steps of updating the duty cycle and adjusting the output pulse width based on the digital signal converted by the ADC conversion module, through the space vector pulse width modulation algorithm to calculate the duty cycle, further include: 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.
6. The motor control method according to claim 5, characterized in that, The preset pulse width is less than or equal to the output pulse width of the current duty cycle.
7. A motor control device, characterized in that, It includes a timer, an ADC trigger source, a pseudo-random number generation module, a memory, and a processor. The memory contains a control program, which is executed by the processor to implement the steps of the motor control method as described in any one of claims 1 to 6.
8. The motor control device according to claim 7, characterized in that, The control device is an STM32 microcontroller.
Citation Information
Patent Citations
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