Permanent magnet synchronous motor control method and control circuit
By calculating the motor nameplate parameters to generate a driving voltage table, using sinusoidal pulse width modulation and current phase commutation to control the motor rotation direction, the problems of hardware dependence and calculation complexity in the prior art are solved, and low-cost and low-complexity motor control is achieved.
Patent Information
- Application Number
- CN202510519681.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-11
AI Technical Summary
The existing claw pole permanent magnet synchronous motor control technology has strong hardware dependence, high computing resource requirements, and high technical threshold for developers, which increases cost and complexity.
By calculating modulation parameters based on the motor nameplate parameters, generating a driving voltage table, and controlling the motor rotation direction using sinusoidal pulse width modulation and current commutation, no Hall sensors and complex operations are required.
Reduces computing and hardware requirements, applies to various types of motor control, and simplifies the development process.
Smart Images

Figure CN120301290A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of motor control, and particularly to a control method and a control circuit for a permanent magnet synchronous motor. Background Art
[0002] The claw-pole type permanent magnet synchronous motor is a permanent magnet synchronous motor with a special structure. Its stator consists of two axially distributed claw-shaped iron cores and is manufactured by a steel plate stamping process. Such a motor works based on the principle of electromagnetic induction and magnetic field synchronization: after the stator coil is energized, a rotating magnetic field is generated, which interacts with the magnetic field of the rotor permanent magnet to drive the rotor to rotate. Its claw-pole structure optimizes the magnetic field distribution and improves the motor efficiency and operation stability.
[0003] Currently, the control technologies for claw-pole type permanent magnet synchronous motors mainly include the following methods:
[0004] (1) Vector control: It depends on Hall sensors to detect the rotor position and current, and adjusts the commutation timing in real time through feedback signals to achieve precise control of speed and torque. Its core features include: it is necessary to record the Boolean output signals of Hall elements and the corresponding moments, estimate the motor position and then adjust the input square wave; the Hall signals can be directly read and are independent of the state of the input square wave. However, this type of method requires an additional configuration of Hall sensors, increasing the hardware cost and system complexity.
[0005] (2) Direct torque control and model predictive control: The rotor position is inferred by measuring the back electromotive force of the negative power resistor of the motor, without the need for physical sensors (sensorless control). Its characteristics are: it is necessary to input a tentative square wave to the motor, and the rotor position is inferred by the output voltage, involving complex mathematical transformations; the output voltage is zero before the input square wave, resulting in no effective signal being available in the initial stage, and it is necessary to dynamically calculate the sine function and rely on floating-point operations. However, this type of method has high requirements for the floating-point operation ability of the processor, restricting the range of hardware selection. At the same time, the algorithm complexity poses challenges to the electromechanical knowledge reserve of developers.
[0006] In view of this, the existing control technologies mainly have the following disadvantages: strong hardware dependence: vector control requires Hall sensors, increasing costs and failure risks; high requirements for computing resources: sensorless control requires floating-point operations and dynamic sine function calculations, restricting the applicability of low-end processors; complex algorithms: developers need to deeply understand electromechanical systems and mathematical modeling, raising the technical threshold. Summary of the Invention
[0007] The present application provides a permanent magnet synchronous motor control method and a control circuit to solve the problems of high computing resource requirements, the need to rely on detecting the motor position without a Hall sensor, and high technical thresholds for developers in the prior art. The present application does not require complex operations and does not require a Hall sensor to detect the motor position, which is beneficial to reducing the requirements for computing and hardware and is beneficial to being applicable to controlling various types of motors.
[0008] In a first aspect, the present application provides a permanent magnet synchronous motor control method, including:
[0009] Calculating a modulation parameter according to preset nameplate parameters, where the modulation parameter includes a commutation period;
[0010] Implementing sinusoidal pulse width modulation according to the modulation parameter to generate a driving voltage table;
[0011] According to the commutation period, alternately inputting n-phase and n + 1-phase currents to the motor, and controlling the rotation direction of the motor through current commutation;
[0012] Based on the control circuit, continuously controlling the operation of the motor according to the driving voltage table and the commutation current.
[0013] Optionally, the nameplate parameters include motor nameplate parameters and CPU nameplate parameters corresponding to the CPU used by the motor. The CPU nameplate parameters include the CPU frequency, and the motor nameplate parameters include the alternating current frequency. Before calculating the modulation parameter according to the preset nameplate parameters, the method further includes:
[0014] Calculating a motor phase period according to the CPU frequency;
[0015] Calculating a PWM full period according to the PWM frequency and a preset driving load frequency, where the value of the PWM frequency is equal to the CPU frequency;
[0016] Calculating a sine wave full wave period according to the alternating current frequency.
[0017] Optionally, obtaining a CPU interruption period and an interruption delay time according to the CPU nameplate parameters. The modulation parameter further includes the number of sampling points and an SPWM amplitude M coefficient. Calculating the modulation parameter according to the preset nameplate parameters includes:
[0018] Calculating the number of sampling points according to the motor phase period, the CPU interruption period, and the interruption delay time;
[0019] Calculating the SPWM amplitude M coefficient according to a preset PWM high level and the PWM full period;
[0020] Calculate the commutation period based on the full-wave period of the sine wave and the preset number of motor pole pairs.
[0021] Optionally, the implementation of sinusoidal pulse width modulation according to the modulation parameters to generate a driving voltage table includes:
[0022] Generate a driving voltage table according to the modulation parameters by the symmetric rule sampling method. The driving voltage table includes multiple motor driving durations. Each motor driving duration is the duration of the high-level output within a commutation period, and the CPU interruption moments are between each motor driving duration;
[0023] Intermittently output the high level according to the driving voltage table, and output a driving voltage to drive the motor.
[0024] Optionally, the alternating input of n-phase and n + 1-phase currents to the motor according to the commutation period and controlling the rotation direction of the motor through current commutation includes:
[0025] Input n-phase current to the motor within a commutation period, disconnect the n-phase current in the next commutation period and input n + 1-phase current to the motor to control the motor to rotate clockwise;
[0026] Input n + 1-phase current to the motor within a commutation period, disconnect the n + 1-phase current in the next commutation period and input n-phase current to the motor to control the motor to rotate counterclockwise.
[0027] In a second aspect, the present application provides a permanent magnet synchronous motor control circuit. The permanent magnet synchronous motor control circuit is used to execute the method described in the claims. The control circuit includes:
[0028] A micro control module, including a micro control chip. The output end of the micro control module is connected to the input end of the integration module, and the output end of the micro control module is connected to the power supply module;
[0029] The integration module includes a first pin, a second pin, a third pin, and a fourth pin. The first pin and the second pin are connected to the output end of the micro control module, and the third pin and the fourth pin are connected to the input end of the drive module;
[0030] The drive module is used to drive the motor according to the driving voltage;
[0031] The power supply module is used to supply power to the permanent magnet synchronous motor to provide commutation current;
[0032] The micro control module implements sinusoidal pulse width modulation according to the modulation parameters, outputs a driving voltage, and outputs the driving voltage to the integration module;
[0033] The first pin and the second pin of the integrated module respond to the driving voltage and transmit the driving voltage to the third pin and the fourth pin. The third pin and the fourth pin respond to the driving voltage and transmit the driving voltage to the driving module;
[0034] The driving module responds to the driving voltage and drives the motor.
[0035] Optionally, the motor drive includes a forward rotation mode and a reverse rotation mode. When the first pin responds to a high level and the second pin responds to a low level, the first pin transmits the high level to the third pin, and the second pin transmits the low level to the fourth pin. The third pin responds to the high level, and the fourth pin responds to the low level, and transmits the high level and the low level to the driving module to drive the forward rotation mode of the motor;
[0036] When the first pin responds to a low level and the second pin responds to a high level, the first pin transmits the low level to the third pin, and the second pin transmits the high level to the fourth pin, causing the third pin to respond to the low level and the fourth pin to respond to the high level, and transmitting the low level and the high level to the driving module to drive the reverse rotation mode of the motor.
[0037] Optionally, the first pin is connected to the power supply module, and the second pin is connected to the power supply module. The first pin accesses the n-phase current, and the second pin accesses the n + 1-phase current; the power supply module inputs the n-phase current to the first pin within one commutation period, stops inputting the n-phase current to the first pin in the next commutation period, and inputs the n + 1-phase current to the second pin to control the clockwise rotation of the motor;
[0038] The power supply module inputs the n + 1-phase current to the second pin within one commutation period, stops inputting the n + 1-phase current to the second pin in the next commutation period, and inputs the n-phase current to the first pin to control the counterclockwise rotation of the motor.
[0039] In a third aspect, an embodiment of the present application provides a permanent magnet synchronous motor control system, and the system includes:
[0040] A parameter calculation module, configured to calculate modulation parameters according to preset nameplate parameters, where the modulation parameters include a commutation period;
[0041] A driving voltage table module, configured to implement sinusoidal pulse width modulation according to the modulation parameters and generate a driving voltage table;
[0042] A current commutation module, configured to alternately input n-phase and n+1-phase currents to the motor according to the commutation period, and control the rotation direction of the motor through current commutation;
[0043] A motor control module, configured to continuously control the operation of the motor based on a control circuit according to the drive voltage table and the commutation current.
[0044] In a fourth aspect, an embodiment of the present application provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the above-described method is implemented.
[0045] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art: The present application realizes sinusoidal pulse width modulation through modulation parameters, generates a drive voltage table, drives the motor through the drive voltage table, and controls the rotation direction of the motor through the commutation current to control the operation of the motor, without complex calculations and without using a Hall sensor to detect the position of the motor, which is beneficial to reducing the requirements for computing and hardware and is beneficial to being applicable to controlling various types of motors. Description of the Drawings
[0046] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0048] One or more embodiments are exemplarily illustrated by the pictures in the corresponding drawings. These exemplary illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a proportional limitation.
[0049] Figure 1 It is a schematic flowchart of a permanent magnet synchronous motor control method provided by an embodiment of the present application;
[0050] Figure 2 It is a schematic diagram of a PWM output generated waveform provided by an embodiment of the present application;
[0051] Figure 3 It is a circuit diagram of a permanent magnet synchronous motor control circuit provided by an embodiment of the present application;
[0052] Figure 4Schematic diagrams of four rotation modes provided by the embodiments of the present application;
[0053] Figure 5 Schematic diagram of the structure of a permanent magnet synchronous motor control system provided by the embodiments of the present application. Detailed implementation manners
[0054] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.
[0055] The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numerals and / or letters in different examples. This repetition is for the purpose of simplification and clarity and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0056] In a first aspect, Figure 1 A permanent magnet synchronous motor control method provided by the embodiments of the present application, the method comprising:
[0057] S100, calculating modulation parameters according to preset nameplate parameters, the modulation parameters including a commutation period.
[0058] The motor nameplate is a metal or plastic label installed on the motor housing for identifying the key parameters of the motor. It is the most basic and important information source when using, installing and maintaining the motor. Common motor nameplate parameters are as follows: rated power, rated voltage, rated current, rated frequency, rated speed, connection method, number of phases, insulation class, protection class, power factor, factory number / model, efficiency class, etc. The present application calculates modulation parameters through the motor nameplate parameters, obtains the commutation period in the modulation parameters, and uses it to generate subsequent data.
[0059] S200, implementing sinusoidal pulse width modulation according to the modulation parameters to generate a driving voltage table.
[0060] Sinusoidal Pulse Width Modulation (SPWM) is a modulation technique widely used in fields such as frequency converters, motor control, inverters, and UPS. It controls the duty cycle of the PWM (Pulse Width Modulation) signal by simulating the waveform of a sine wave to achieve the waveform control and speed and frequency modulation functions of the output alternating current. By comparing the sine wave reference signal with the high-frequency triangular wave carrier, a string of PWM pulses is generated. The width (duty cycle) of these pulses changes with the sine wave, thus achieving the "quasi-sine" output control. In the embodiments of this application, the sinusoidal pulse width modulation is implemented according to the modulation parameters calculated in S100 to generate a drive table, and the pulses are adjusted according to the drive table to control the motor.
[0061] S300, according to the commutation period, alternately input n-phase and n + 1-phase currents to the motor, and control the rotation direction of the motor through current commutation.
[0062] Commutation means that during the process of driving the motor by the motor controller, according to the rotor position, the combination mode of the energized windings is changed orderly, so that the magnetic field rotates to drive the rotor to rotate continuously. The commutation period refers to the time interval during which the current switches from one phase to another when driving a brushless DC motor or a permanent magnet synchronous motor. It is a key parameter in the commutation process of the controller, which is directly related to the speed, smoothness, and efficiency of the motor. The commutation period = the time interval between two adjacent commutations.
[0063] S400, based on the control circuit, continuously control the operation of the motor according to the drive voltage table and the commutation current.
[0064] In this application, a control circuit is provided to execute the above method, which will be specifically introduced in the second aspect below. In the embodiments of this application, the sinusoidal pulse width modulation is implemented according to the drive voltage table of S200 above, and the rotation direction of the motor is controlled through current commutation in S300, and the movement of the motor is continuously controlled.
[0065] Specifically, the nameplate parameters include the motor nameplate parameters and the CPU nameplate parameters corresponding to the CPU used by the motor. The CPU nameplate parameters include the CPU frequency, and the motor nameplate parameters include the alternating current frequency. Before calculating the modulation parameters according to the preset nameplate parameters, the method further includes:
[0066] It should be noted that the following steps are calculated and illustrated by taking the nameplate parameters of a permanent magnet synchronous motor as an example. In actual applications, the nameplate parameters of actual synchronous motors are used, and the nameplate parameters of different synchronous motors are different.
[0067] S1, calculate the motor phase period according to the CPU frequency.
[0068] In the embodiment of the present application, the CPU frequency used to control the motor is 12Mhz, and the motor phase period = 1 / frequency = 1 / 12Mhz = 0.0833us.
[0069] S2. Calculate the PWM full cycle according to the PWM frequency and the preset driving load frequency, where the value of the PWM frequency is equal to the CPU frequency.
[0070] In the embodiment of the present application, the maximum PWM frequency is the same as the CPU frequency. According to common sense, the optimal frequency for PWM to drive a motor is generally above 15KHz, and 15Khz can be taken according to historical experience.
[0071] The PWM full cycle refers to the time required for a complete PWM signal to go from high level to low level and then back to high level, which is jointly determined by the upper limit of the PWM hardware port frequency and the frequency of the driven motor.
[0072] PWM full cycle = PWM frequency (CPU frequency) / driven load frequency = 12000000Hz / 15000Hz = 800us
[0073] S3. Calculate the sine wave full wave cycle according to the alternating current frequency.
[0074] In the embodiment of the present application, the commutation cycle time is obtained according to the driving frequency of the motor nameplate parameters, and the output alternating current is 50HZ. According to the period = 1 / frequency = 1 / 50HZ, the sine wave full wave cycle is 20ms.
[0075] Obtain the CPU interruption cycle and interruption delay time according to the CPU nameplate parameters. The modulation parameters further include the number of sampling points and the SPWM amplitude M coefficient. Calculate the modulation parameters according to the preset nameplate parameters, including:
[0076] S101. Calculate the number of sampling points according to the motor phase period, the CPU interruption cycle, and the interruption delay time.
[0077] In the embodiment of the present application, the CPU frequency used to control the motor is 12Mhz. Each interruption shortest cycle is at least 100us without affecting other tasks, such as touch keys, etc. Among them, the CPU running interruption own code delays 25us, and the total cycle of one interruption is 125us. According to the following formula, the optimal number of sampling points within 10ms is 80.
[0078] Number of sampling points = motor phase period / (CPU interruption cycle + interruption delay time)
[0079] The above formula means that the pulse width can be divided into 800 parts within one PWM cycle. The more parts it is divided into, the more accurate the time of each independent pulse is. The duration of the high level within the PWM cycle represents the driving voltage. If the high level lasts for the entire 800 μs, the average value of the output sine wave is equal to the voltage of the input square wave, which is 12 V. If the high level lasts for 400 μs, the average value of the output sine wave voltage is 6 V. In order to reduce heat generation in the embodiments of the present application while requiring sufficient torque, a high level of 700 μs and a low level of 100 μs are taken, that is, driving with a voltage magnification of 87.5% of the rated power is sufficient.
[0080] S102. Calculate the SPWM amplitude M coefficient according to the preset PWM high level and the PWM full cycle.
[0081] SPWM amplitude M coefficient = PWM high level / PWM full cycle = 700 / 800 = 0.875
[0082] S103. Calculate the commutation period according to the full wave period of the sine wave and the preset number of pole pairs of the motor.
[0083] The SPWM period Tc refers to the commutation period of the motor: here, the motor supports driving with alternating current of 50 Hz, and the number of pole pairs of the two-phase motor is 1.
[0084] Commutation period = sine wave full wave period / (number of pole pairs * 2) = 10 ms.
[0085] The embodiments of the present application have a wide range of applicable objects and have no special requirements for the parameters of the controlled synchronous motor. It can match synchronous motors with any number of pole pairs (number of phases) and can match synchronous motors with any operating voltage.
[0086] Implementing sinusoidal pulse width modulation according to the modulation parameters to generate a driving voltage table includes:
[0087] S201. Generate a driving voltage table according to the modulation parameters by the symmetric rule sampling method. The driving voltage table includes multiple motor driving durations, and each motor driving duration is the duration of the high level output within one commutation period. The CPU interruption moments are between the motor driving durations.
[0088] According to the parameters obtained in S100, obtain appropriate calibration values: the number of sampling points N is 80, the SPWM amplitude M coefficient is 0.875, and the commutation period Tc is 10 ms. Input the coefficients into the SPWM square wave conversion sine wave formula:
[0089]
[0090] The parameter k starts from 1, and Ton is calculated by expanding. When k = 1, the first value of Ton is obtained; when k = 2, the second value of Ton is obtained... Repeat the above steps until k = 80, and the 80th value of Ton is obtained. In practical applications, with the help of the VC++ compiler, 80 fixed Tons are generated and put into a table at one time, as shown below:
[0091] static code u16 pwm_duty_table[] =
[0092] {
[0093] 0, 27, 54, 82, 109, 136, 163, 190, 216, 242, 267, 293, 317, 342, 365,
[0094] 388, 411, 433, 454, 475, 494, 514, 532, 549, 566, 582, 596, 610, 623,
[0095] 635, 646, 656, 665, 673, 680, 686, 691, 695, 697, 699, 700, 699, 697,
[0096] 695, 691, 686, 680, 673, 665, 656, 646, 635, 623, 610, 596, 582, 566,
[0097] 549, 532, 514, 494, 475, 454, 433, 411, 388, 365, 342, 317, 293, 267,
[0098] 242, 216, 190, 163, 136, 109, 82, 54, 27
[0099] }
[0100] S202, according to the driving voltage table, output the high level intermittently, and output the driving voltage to drive the motor.
[0101] In the embodiment of the present application, each number in the table represents the time of high level output within a commutation period, that is, 10 ms is divided into 80 parts. Starting from the first data, the driving high level time is 0 us. After a CPU interruption moment, the driving high level is 27 us. Continuing after the CPU interruption moment, the driving high level is 54 us, and so on until all data is traversed and the current commutation of the motor enters the driving within the next period.
[0102] According to the above, the duration Ton of the PWM output is obtained at each interrupt moment of the CPU. After executing the following code, SPWM (Sinusoidal Pulse Width Modulation) is achieved:
[0103]
[0104]
[0105]
[0106] The running interrupt Timer1_ISR() starts 100 us after the CPU starts, and at the same time accumulates the variable pwm_step_index. The interval between each interrupt is 125 us, and the total time consumed by 80 interrupt calls is 10 ms, which is the driving time for a single phase of the two-phase brushless motor. Taking the time 0 us as the motor startup time axis, according to the table pwm_duty_table:
[0107] Within the first 125 us of Ton1, the PWM high-level output lasts for 27 us;
[0108] Within the second 125 us of Ton2, the PWM high level lasts for 54 us;
[0109] Within the third 125 us of Ton2, the PWM high level lasts for 82;
[0110] And so on, until the 80th 125 is executed. The schematic diagram of the PWM output waveform is as shown in Figure 2 ; This continuous square wave has a total period length of 10 ms.
[0111] According to the commutation period, alternately inputting n-phase and n + 1-phase currents to the motor and controlling the rotation direction of the motor through current commutation includes:
[0112] S301, inputting n-phase current to the motor within one commutation period, disconnecting the n-phase current in the next commutation period and inputting n + 1-phase current to the motor to control the motor to rotate clockwise;
[0113] S302, inputting n + 1-phase current to the motor within one commutation period, disconnecting the n + 1-phase current in the next commutation period and inputting n-phase current to the motor to control the motor to rotate counterclockwise.
[0114] Since after the n-phase drive of the motor in this example takes 10 ms, it is still necessary to drive the n + 1 phase of the motor in the next 10 ms to keep the motor rotating continuously. In the embodiments of the present application, based on the hardware circuit diagram (such as Figure 3As shown in the figure, the two-phase currents are exchanged and applied to the n-phase and the n + 1-phase currents in turn. By controlling the n-phase and the n + 1-phase currents, the permanent magnet synchronous motor can be controlled to rotate clockwise or counterclockwise. For example, to make the claw-pole type permanent magnet synchronous motor rotate clockwise, the n-phase current can be disconnected while the n + 1-phase current is connected.
[0115] Specifically, in the first step, the first half-cycle alternating current of the sine wave is used to drive the motor phase n for 10 ms of one phase cycle, and then it stops and waits for a certain delay, where the delay is the motor phase gap. In the second step, the n-phase current is cut off, and the second half-cycle alternating current of the sine wave is used to drive the motor phase n + 1 for 10 ms of one phase cycle, and then it stops and waits for a certain delay. By alternately driving the n-phase and the n + 1-phase of the motor with the first half-wave and the second half-wave of the sine wave, the claw-pole type permanent magnet synchronous motor can continuously generate torque for all phases, pushing the fan head to rotate horizontally.
[0116] By implementing sinusoidal pulse width modulation according to the modulation parameters, generating a driving voltage table, and then continuously controlling the operation of the motor according to the driving voltage table and the commutation current, complex operations are not required, floating-point operations are not required, the sine function sin is not required, and the motor position does not need to be detected by a Hall sensor, which is beneficial to reducing the requirements for calculation and hardware and is beneficial to being applicable to controlling various types of motors.
[0117] In the second aspect, Figure 3 The following is a circuit diagram of a permanent magnet synchronous motor control circuit provided by an embodiment of the present application. As shown in the figure, the present application provides a permanent magnet synchronous motor control circuit, and the permanent magnet synchronous motor control circuit is used to execute a permanent magnet synchronous motor control method. The control circuit includes:
[0118] The micro-control module includes a micro-control chip. The output end of the micro-control module is connected to the input end of the integrated module, and the output end of the micro-control module is connected to the power supply module;
[0119] The integrated module includes a first pin, a second pin, a third pin, and a fourth pin. The first pin and the second pin are connected to the output end of the micro-control module, and the third pin and the fourth pin are connected to the input end of the driving module;
[0120] The driving module is used to drive the motor according to the driving voltage;
[0121] The power supply module is used to supply power to the permanent magnet synchronous motor to provide commutation current;
[0122] The micro-control module implements sinusoidal pulse width modulation according to the modulation parameters, outputs a driving voltage, and outputs the driving voltage to the integrated module;
[0123] The first pin and the second pin of the integrated module respond to the driving voltage and transmit the driving voltage to the third pin and the fourth pin. The third pin and the fourth pin respond to the driving voltage and transmit the driving voltage to the driving module;
[0124] The driving module responds to the driving voltage and drives the motor.
[0125] In the embodiment of the present application, the position end of resistor R59 at the first pin INA and the position end of resistor R61 at the second pin INB are the input terminals of the motor control H-bridge signal. The input signal is output from the IO pin PWM of the single-chip microcomputer and is loaded on the motor (Motor, symbol M) after being transformed by the H-bridge.
[0126] Further, the motor drive includes a forward rotation mode and a reverse rotation mode. When the first pin responds to a high level and the second pin responds to a low level, the first pin transmits the high level to the third pin, and the second pin transmits the low level to the fourth pin. The third pin responds to the high level, and the fourth pin responds to the low level, and transmits the high level and the low level to the driving module to drive the forward rotation mode of the motor;
[0127] When the first pin responds to a low level and the second pin responds to a high level, the first pin transmits the low level to the third pin, and the second pin transmits the high level to the fourth pin, causing the third pin to respond to the low level and the fourth pin to respond to the high level, and transmitting the low level and the high level to the driving module to drive the reverse rotation mode of the motor.
[0128] As Figure 4 shown, Figure 4 It includes four rotation modes of the motor. In the embodiment of the present application, the forward rotation mode and the reverse rotation mode are mainly described. The principle of the H-bridge MOSFET power switch tube inside the integrated chip is as follows: Among them, the first pin INA, the second pin INB, the third pin OUTA, the fourth pin OUTB, VM is the motor voltage, and M is the Motor motor.
[0129] The definition of the forward rotation mode is that when INA = H (the terminal marked by INA inputs a high level) and INB = L (the terminal marked by INB inputs a low level), at this time, the motor drive terminal OUTA outputs a high level, the motor drive terminal OUTB outputs a low level, the motor drive current flows into the motor from OUTA, and flows to the ground terminal from OUTB. At this time, the rotation of the motor is defined as the forward rotation mode.
[0130] The reverse mode is defined as: INA = L (the terminal marked by INA inputs low level), INB = H (the terminal marked by INB inputs high level). At this time, the motor drive terminal OUTB outputs high level, and the motor drive terminal OUTA outputs low level. The motor drive current flows into the motor from OUTB and flows to the ground terminal from OUTA. At this time, the rotation of the motor is defined as the reverse mode.
[0131] Further, the first pin is connected to the power supply module, the second pin is connected to the power supply module, the first pin accesses the n-phase current, and the second pin accesses the n + 1-phase current;
[0132] The power supply module inputs the n-phase current to the first pin within one commutation period, stops inputting the n-phase current to the first pin in the next commutation period, and inputs the n + 1-phase current to the second pin to control the motor to rotate clockwise;
[0133] The power supply module inputs the n + 1-phase current to the second pin within one commutation period, stops inputting the n + 1-phase current to the second pin in the next commutation period, and inputs the n-phase current to the first pin to control the motor to rotate counterclockwise.
[0134] In the embodiment of the present application, the first pin INA and the second pin INB are respectively connected to the power supply module. The power supply module inputs the n-phase current to INA and the n + 1-phase current to INB. In a possible implementation manner, within one commutation period, first open INA to input the n-phase current, then in the next commutation period, close INA to disconnect the n-phase current, and at the same time open INB to connect the n + 1-phase current to control the motor to rotate clockwise.
[0135] In another possible implementation manner, within one commutation period, first open INB to input the n + 1-phase current, then in the next commutation period, close INB to disconnect the n + 1-phase current, and at the same time open INA to connect the n-phase current to control the motor to rotate counterclockwise.
[0136] As Figure 5 shown, Figure 5 is a schematic structural diagram of a permanent magnet synchronous motor control system provided by the embodiment of the present application.
[0137] The parameter calculation module 510 is used to calculate the modulation parameters according to the preset nameplate parameters, and the modulation parameters include the commutation period;
[0138] The drive voltage table module 520 is used to implement sinusoidal pulse width modulation according to the modulation parameters and generate a drive voltage table;
[0139] A current commutation module 530 is configured to alternately input n-phase and n+1-phase currents to the motor according to the commutation period, and control the rotation direction of the motor by current commutation.
[0140] A motor control module 540 is configured to continuously control the operation of the motor based on a control circuit according to the drive voltage table and the commutation current.
[0141] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0142] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0144] In the embodiments provided in the present application, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are only illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0145] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0146] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present application, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0147] All or part of the processes in the above-mentioned embodiment methods of the present application can also be completed by a computer program product. When the computer program product runs on a terminal device, the terminal device can execute the steps in the above-mentioned various method embodiments.
[0148] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A permanent magnet synchronous motor control method, characterized in that The method includes: Calculating modulation parameters according to preset nameplate parameters, where the modulation parameters include commutation periods; Implementing sinusoidal pulse width modulation according to the modulation parameters to generate a drive voltage table; According to the commutation period, alternately inputting n-phase and n + 1-phase currents to the motor, and controlling the rotation direction of the motor through current commutation; Based on a control circuit, continuously controlling the operation of the motor according to the drive voltage table and the commutation current.
2. The method according to claim 1, wherein The nameplate parameters include motor nameplate parameters and CPU nameplate parameters corresponding to the CPU adopted by the motor. The CPU nameplate parameters include CPU frequency, and the motor nameplate parameters include AC frequency. Before calculating the modulation parameters according to the preset nameplate parameters, the method further includes: Calculating the motor phase period according to the CPU frequency; Calculating the PWM full period according to the PWM frequency and a preset drive load frequency, where the value of the PWM frequency is equal to the CPU frequency; Calculating the sine wave full wave period according to the AC frequency.
3. The method according to claim 2, wherein Obtaining the CPU interruption period and interruption delay time according to the CPU nameplate parameters. The modulation parameters further include the number of sampling points and the SPWM amplitude M coefficient. Calculating the modulation parameters according to the preset nameplate parameters includes: Calculating the number of sampling points according to the motor phase period, the CPU interruption period, and the interruption delay time; Calculating the SPWM amplitude M coefficient according to a preset PWM high level and the PWM full period; Calculating the commutation period according to the sine wave full wave period and a preset number of motor pole pairs.
4. The method according to claim 3, wherein Implementing sinusoidal pulse width modulation according to the modulation parameters to generate a drive voltage table includes: Generating a drive voltage table according to the modulation parameters by the symmetric rule sampling method. The drive voltage table includes multiple motor drive durations, and each motor drive duration is the duration of high level output within a commutation period. CPU interruption moments are between the motor drive durations; Intermittently outputting the high level according to the drive voltage table to output a drive voltage to drive the motor.
5. The method according to claim 1, wherein According to the commutation period, alternately inputting n-phase and n + 1-phase currents to the motor, and controlling the rotation direction of the motor through current commutation includes: Inputting n-phase current to the motor within a commutation period, disconnecting the n-phase current in the next commutation period, and inputting n + 1-phase current to the motor to control the motor to rotate clockwise; Inputting n + 1-phase current to the motor within a commutation period, disconnecting the n + 1-phase current in the next commutation period, and inputting n-phase current to the motor to control the motor to rotate counterclockwise.
6. A permanent magnet synchronous motor control circuit, characterized in that, The permanent magnet synchronous motor control circuit is used to execute the method according to claims 1 to 5. The control circuit includes: A micro control module, including a micro control chip. The output end of the micro control module is connected to the input end of an integration module, and the output end of the micro control module is connected to a power supply module; The integrated module includes a first pin, a second pin, a third pin, and a fourth pin. The first pin and the second pin are connected to the output end of the micro - control module, and the third pin and the fourth pin are connected to the input end of the drive module; The drive module is configured to drive the motor according to the drive voltage; The power - supply module is configured to supply power to the permanent - magnet synchronous motor to provide commutation current; The micro - control module implements sinusoidal pulse - width modulation according to the modulation parameters, outputs a drive voltage, and outputs the drive voltage to the integrated module; The first pin and the second pin of the integrated module respond to the drive voltage and transmit the drive voltage to the third pin and the fourth pin. The third pin and the fourth pin respond to the drive voltage and transmit the drive voltage to the drive module; The drive module responds to the drive voltage and drives the motor.
7. The control circuit according to claim 6, wherein The motor drive includes a forward - rotation mode and a reverse - rotation mode. When the first pin responds to a high level and the second pin responds to a low level, the first pin transmits the high level to the third pin, and the second pin transmits the low level to the fourth pin. The third pin responds to the high level, and the fourth pin responds to the low level, and transmits the high level and the low level to the drive module to drive the forward - rotation mode of the motor; When the first pin responds to a low level and the second pin responds to a high level, the first pin transmits the low level to the third pin, and the second pin transmits the high level to the fourth pin, causing the third pin to respond to the low level and the fourth pin to respond to the high level, and transmitting the low level and the high level to the drive module to drive the reverse - rotation mode of the motor.
8. The control circuit according to claim 6, wherein The first pin is connected to the power - supply module, and the second pin is connected to the power - supply module. The first pin receives the n - phase current, and the second pin receives the (n + 1)-phase current; the power - supply module inputs the n - phase current to the first pin within one commutation period, stops inputting the n - phase current to the first pin in the next commutation period, and inputs the (n + 1)-phase current to the second pin to control the clockwise rotation of the motor; The power - supply module inputs the (n + 1)-phase current to the second pin within one commutation period, stops inputting the (n + 1)-phase current to the second pin in the next commutation period, and inputs the n - phase current to the first pin to control the counter - clockwise rotation of the motor.
9. A permanent magnet synchronous motor control system, characterized in that The system includes: A parameter - calculation module, configured to calculate modulation parameters according to preset nameplate parameters, where the modulation parameters include a commutation period; A drive - voltage table module, configured to implement sinusoidal pulse - width modulation according to the modulation parameters and generate a drive - voltage table; A current - commutation module, configured to alternately input the n - phase and (n + 1)-phase currents to the motor according to the commutation period and control the rotation direction of the motor through current commutation; A motor - control module, configured to continuously control the operation of the motor based on a control circuit according to the drive - voltage table and the commutation current.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the permanent magnet synchronous motor control method according to any one of claims 1 to 5 are implemented.