Motor rotation control method and device

The motor rotation control method decouples interrupt and PWM signals, dividing control into four periods with prioritized interrupts to reduce CPU load and maintain SVPWM frequency, enhancing motor control stability and accuracy.

JP7770545B2Active Publication Date: 2025-11-14SHANGHAI LEEKR TECHNOLOGY CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2024514380
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2023-09-25
Filing Date
2023-12-12
Publication Date
2025-11-14
Estimated Expiration
2043-12-12

AI Technical Summary

Technical Problem

Conventional motor control methods face challenges with high CPU load and potential disruptions in the execution order of three-loop control functions due to shared interrupt and PWM signal periods, affecting the control effect and NVH performance.

Method used

A motor rotation control method that decouples the interrupt trigger signal from the PWM signal reference channel, divides the control process into four distinct interrupt periods, and sets the interrupt priority to the highest level, allowing for cyclic execution of position, velocity, and current loop calculations without affecting SVPWM update frequency.

Benefits of technology

This approach reduces CPU load while maintaining SVPWM update frequency, ensuring stable and accurate motor control by prioritizing interrupt periods and predicting motor rotor positions for improved synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007770545000001
    Figure 0007770545000001
  • Figure 0007770545000002
    Figure 0007770545000002
  • Figure 0007770545000003
    Figure 0007770545000003
Patent Text Reader

Abstract

An embodiment of the present invention relates to the technical field of motor control and discloses a motor rotation control method and apparatus, the method including the steps of: performing an inverse Park transform and an inverse Clark transform on control output results obtained from a position loop, a velocity loop, and a current loop to obtain an SVPWM signal for a current period, whereby an interrupt control period is decoupled from a PWM signal reference channel; obtaining current position sampling information of the motor, predicting the position sampling information, and obtaining motor rotor position result information within the prediction period; performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for a prediction period; generating an SVPWM control signal group based on the SVPWM signal for the current period and the SVPWM signal for the prediction period, and controlling the motor based on the SVPWM control signal group. In this embodiment of the motor rotation control method, an interrupt trigger signal is added to achieve decoupling from the PWM signal reference channel, and an interrupt function scheduling period is added to reduce CPU load without affecting the SVPWM update frequency during motor control.
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 more particularly to a motor rotation control method and device. [Background technology]

[0002] Permanent magnet synchronous motor control is widely used, for example in all-vehicle drive motors, electric power-assisted steering motors, and brake motors. These motor controllers generally require high levels of functional security and product reliability, and typically employ mature, reliable software architectures. AUTOSAR is already a trend, as it is a mature, reliable, and widely used architecture. By purchasing COTS software with an AUTOSAR architecture that meets functional safety, the desired code that meets functional safety can be generated through configuration. In addition, many safety mechanisms are added to the motor controller itself to meet functional safety requirements. This inevitably increases code complexity and software execution time.

[0003] In conventional motor control methods, the interrupt trigger signal and the PWM signal reference channel are the same signal, and thus the motor control period and the PWM signal period are the same. For example, if the motor control PWM signal period is 50us, the interrupt function execution period is also 50us. When the motor controller's CPU load is high, the only way to reduce the load is to lengthen the periods of both the motor control PWM signal and the interrupt trigger PWM signal, but longer PWM periods affect NVH.

[0004] One of the three-loop control methods for conventional motor FOC control is to establish three tasks or interrupts for the three-loop system: a position loop control function, a velocity loop control function, and a current loop control function. Because these three functions belong to different tasks or interrupts, problems inevitably arise: three execution priorities and function nesting. Furthermore, during this process, the timing and phase of the three-loop control system functions in the ECU are typically mixed or blocked by other interrupts and tasks. For real-time motor control systems, during the task interrupt or nesting process, the three-loop control calculation results may not be the most current values ​​or the control sequence may not be executed in the desired order, which may affect the control effect. Furthermore, the CPU load is typically very large. Therefore, designing a method capable of motor rotation control is a technical challenge that must be addressed by those skilled in the art. Summary of the Invention [Problem to be solved by the invention]

[0005] The embodiment of the present invention discloses a motor rotation control method that can reduce the CPU load without affecting the update frequency of SVPWM during motor control in response to the above defect. [Means for solving the problem]

[0006] According to a first aspect of an embodiment of the present invention, a motor rotation control method is disclosed, the motor rotation control method comprising: In a first interrupt period, acquiring first position sampling information of the motor, and performing a position loop calculation on the first position sampling information of the motor to obtain a first control output result; receiving, in a second interrupt period, a first control output result calculated in the first interrupt period, and performing a speed loop calculation on the first control output result to obtain a second control output result; receiving, in a third interrupt period, a second control output result calculated in the second interrupt period, and performing a current loop calculation on the second control output result to obtain a third control output result; receiving, in a fourth interrupt period, a third control output result calculated in the third interrupt period, and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of a current period, wherein the first interrupt period, the second interrupt period, the third interrupt period, and the fourth interrupt period constitute an interrupt control period, and the interrupt control period and a PWM signal reference channel are decoupled; In a fourth interrupt period, obtaining current second position sampling information of the motor, predicting the second position sampling information to obtain position result information of the motor rotor within a predetermined number of prediction periods, and performing inverse Park transform and inverse Clark transform on the position result information to obtain an SVPWM signal for a predetermined number of prediction periods; The method further includes generating a group of SVPWM control signals based on the SVPWM signal of the current cycle and SVPWM signals of a predetermined number of predicted cycles, and controlling a motor based on the group of SVPWM control signals.

[0007] As one alternative embodiment, in the first aspect of the embodiment of the present invention, the step of obtaining first position sampling information of the motor and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result may include: obtaining motor position sampling information in a first interrupt period of the motor; processing the motor position sampling information of the first interrupt period to obtain the actual position of the motor rotor and the actual rotation speed of the electronic rotor; and performing closed-loop control on the position of the motor based on the target position of the motor control input and the actual position of the motor rotor to obtain a first control output result; The step of receiving a first control output result calculated in a first interrupt period and performing a speed loop calculation on the first control output result to obtain a second control output result includes: receiving a first control output result calculated in a first interrupt period and an actual rotation speed of the motor rotor; performing a closed-loop control calculation for a target speed of the motor to obtain a second control output result; The step of receiving the second control output result calculated in the second interrupt period and performing a current loop calculation on the second control output result to obtain the third control output result includes: sampling the motor phase currents to obtain phase currents Ia and Ic; a step of performing Clark and Park transformation on the phase currents Ia and Ic to obtain a direct axis current Id and a quadrature axis current Iq, in which the quadrature axis leads the direct axis by an electrical angle of 90 degrees; receiving a second control output result calculated in a second interrupt period, and performing closed-loop control on the direct axis current Id and the quadrature axis current Iq of the motor to obtain a third control output result; The step of receiving the third control output result calculated in the third interrupt period and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of the current period includes: obtaining motor position sampling information in a fourth interrupt period of the motor; processing the motor position sampling information in the fourth interrupt period to obtain the actual position of the motor rotor and the rotation speed of the motor rotor; receiving a third control output result calculated in a third interrupt period, and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of a current period; The steps of obtaining the current second position sampling information of the motor, predicting the second position sampling information to obtain position result information of the motor rotor within a predetermined number of prediction periods, and performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for a predetermined number of prediction periods, as described above, include: acquiring the motor rotation speed and position in the fourth interrupt period; predicting the motor rotor position for the first interrupt period, the motor rotor position for the second interrupt period, and the motor rotor position for the third interrupt period in the next stage based on the motor rotation speed and position for the fourth interrupt period; The method includes a step of performing inverse Park transform and inverse Clark transform calculations on the output results of the first interrupt period, the second interrupt period, and the third interrupt period in the next stage, respectively, to obtain SVPWM signals corresponding to the position loop, the velocity loop, and the current loop in the next stage.

[0008] As an alternative embodiment, in a first aspect of the embodiment of the present invention, the priority of the interrupt control period is set to the highest level of an application program type interrupt.

[0009] In a specific implementation, the interrupt control period is set to a high priority, so that it is not interfered with by other interrupts or application program tasks.Normal interrupts are divided into level 1 and level 2 interrupts, where the application program interrupt is a level 2 interrupt, and level 1 interrupt is generally set at the system level.Here, if the application program type interrupt is set to the highest level, the corresponding three-closed-loop control decomposition can be realized.

[0010] As one alternative embodiment, in the first aspect of the embodiment of the present invention, after the step of generating the SVPWM control signal group based on the SVPWM signal of the current cycle and the SVPWM signals of the preset number of predicted cycles, a step of cyclically executing the above steps, generating a sequence index number corresponding to the obtained SVPWM control signal group, and storing the corresponding SVPWM control signal group and the sequence index number in association with each other; Each time a new interrupt control period is entered, the method further includes a step of obtaining an SVPWM control signal group associated with the new interrupt control period based on the corresponding sequence index number to perform subsequent motor control.

[0011] The entire control sequence is generated in order and executed cyclically. Each time an interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated based on the sequence number of the interrupt function being entered, and acted on the motor drive bridge circuit. In this way, the CPU load is reduced and the SVPWM update frequency during motor control is not affected.

[0012] As one alternative embodiment, in a first aspect of the embodiment of the present invention, the motor rotation control method includes: obtaining current load operating information of the central processor; The method further includes a step of comparing the load operation information with a preset load, and if the load information is greater than the preset load, increasing the size of the interrupt control period until the load operation information of the central processor becomes smaller than the preset load.

[0013] Here, the CPU load operating state is detected in real time and compared with a preset load to determine whether the CPU is operating within a reasonable interval, and if the current operating load of the CPU is too high, the size of the interrupt control period is increased to reduce the operating load.

[0014] As one alternative embodiment, in a first aspect of the embodiment of the present invention, the motor rotation control method includes: obtaining an AD signal sampling trigger time T1 and an interrupt trigger time T2 by a time acquisition module; Obtaining the current rotation speed ω of the motor; The method further includes the step of: performing calculation based on the AD signal sampling trigger time T1, the interrupt trigger time T2, the current rotation speed ω, and a position compensation equation to obtain predicted motor rotor position information; performing rotation control on the motor based on the predicted motor rotor position information to generate SVPWM, where the position compensation equation is θ2=θ1+ω*(T2-T1+n*T), where n is the number of periods that differ between the control period in which the predicted PWM signal is generated and the current control period, T is the motor control period, ω is the current rotation speed of the motor, T2 is the interrupt trigger time, T1 is the AD signal trigger time, θ1 is the angle calculated after AD sampling the motor rotor position in the current period, and θ2 is the predicted motor rotor position in the corresponding control period.

[0015] Because the interrupt control period and the PWM signal reference channel period are decoupled, that is, the time difference between the time when the interrupt control function is entered and the AD sampling trigger time of the SVPWM driven by the motor is random, in order to achieve better signal synchronization, in a specific implementation, angle compensation is required to achieve more accurate motor control.

[0016] As an alternative embodiment, in the first aspect of the embodiment of the present invention, the preset number is three.

[0017] A second aspect of the present invention discloses a motor rotation control device, the motor rotation control device comprising: a position loop calculation module for obtaining first position sampling information of the motor in a first interrupt period and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result; a speed loop calculation module for receiving a first control output result calculated in the first interrupt period and performing a speed loop calculation on the first control output result to obtain a second control output result in a second interrupt period; a current loop calculation module for receiving a second control output result calculated in the second interrupt period and performing a current loop calculation on the second control output result to obtain a third control output result in a third interrupt period; a PWM calculation module for receiving a third control output result calculated in a third interrupt period and performing an inverse Park transform and an inverse Clark transform on the third control output result in a fourth interrupt period to obtain an SVPWM signal of a current period, wherein the first interrupt period, the second interrupt period, the third interrupt period, and the fourth interrupt period constitute an interrupt control period, and the interrupt control period and a PWM signal reference channel are decoupled; a signal prediction module for obtaining current second position sampling information of the motor in a fourth interrupt period, predicting the second position sampling information to obtain position result information of the motor rotor within a predetermined number of prediction periods, and performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for the predetermined number of prediction periods; and a motor control module for generating a group of SVPWM control signals based on the SVPWM signal of the current period and the SVPWM signals of a predetermined number of predicted periods, and for controlling a motor based on the group of SVPWM control signals.

[0018] As an alternative embodiment, in a second aspect of the embodiment of the present invention, the priority of the interrupt control period is set to the highest level of an application program type interrupt.

[0019] A third aspect of the present invention discloses an electronic device including a memory in which executable program code is stored and a processor coupled to the memory, wherein the processor calls the executable program code stored in the memory to execute the motor rotation control method disclosed in the first aspect of the present invention.

[0020] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, the computer program causing a computer to execute the motor rotation control method disclosed in the first aspect of the present invention. [Effects of the Invention]

[0021] The embodiment of the present invention has the following advantageous effects compared to the prior art.

[0022] In the embodiment of the present invention, the motor rotation control method adds an interrupt trigger signal to decouple the PWM signal from the reference channel, and adds a scheduling period for the interrupt function to reduce the CPU load without affecting the SVPWM update frequency during motor control. [Brief explanation of the drawings]

[0023] In order to more clearly explain the technical solutions in the embodiments of the present invention, the following will briefly describe the drawings that need to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without paying creative labor. [Figure 1] 3 is a flowchart of a motor rotation control method disclosed in an embodiment of the present invention. [Figure 2] 1 is a flowchart of automatic adjustment of an interrupt control period disclosed in an embodiment of the present invention. [Figure 3] 4 is a flowchart of angle compensation calculation disclosed in an embodiment of the present invention. [Figure 4] FIG. 1 is a block diagram illustrating the principle of motor FOC control disclosed in an embodiment of the present invention. [Figure 5] 1 is a schematic diagram of an interrupt and motor PWM drive relationship disclosed in an embodiment of the present invention. [Figure 6] 1 is a structural schematic diagram of a motor rotation control device according to an embodiment of the present invention; [Figure 7]1 is a structural schematic diagram of an electronic device according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0024] The following clearly and completely describes the technical solutions in the embodiments of the present invention, in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without any creative effort also fall within the scope of protection of the present invention.

[0025] It should be explained that the terms "first," "second," "third," "fourth," etc. in the present specification and claims are used to distinguish between different objects, rather than to describe a particular order. The terms "comprise" and "have" and any variations thereof in the embodiments of the present invention are intended to cover a non-exclusive "inclusion," and illustratively, a process, method, system, product, or apparatus comprising a series of steps or units need not be limited to those steps or units expressly recited, but may include other steps or units not expressly recited or inherent to those processes, methods, products, or apparatus.

[0026] One of the three-loop control methods for conventional motor FOC control is to establish three tasks or interrupts for the three-loop system: a position loop control function, a velocity loop control function, and a current loop control function. Because these three functions belong to different tasks or interrupts, problems inevitably arise: execution priority and function nesting. Furthermore, during this process, the timing and phase of the three-loop control system functions in the ECU are typically mixed or blocked by other interrupts and tasks. For real-time motor control systems, during task interrupt or nested execution, the three-loop control calculation results may not be the latest values ​​or the control sequence may not be executed in the desired order, which may affect the control effect and generally result in a significant CPU load. Based on this, embodiments of the present invention disclose a motor rotation control method, device, electronic device, and storage medium. By adding an interrupt trigger signal, decoupling from the PWM signal reference channel is achieved. By adding a scheduling period for the interrupt function, CPU load can be reduced without affecting the SVPWM update frequency during motor control.

[0027] Example 1 Referring to FIG. 1, FIG. 1 is a flowchart of a motor rotation control method disclosed in an embodiment of the present invention. The execution entity of the method described in the embodiment of the present invention is an execution entity consisting of software and / or hardware, which can receive relevant information and send certain commands via wired and / or wireless methods. Of course, it can also have certain processing and storage functions. The execution entity can control multiple devices, such as a remote physical server or cloud server and associated software, or a local host computer or server and associated software that performs related operations on devices located in a certain location. In some scenarios, it can also control multiple storage devices, which can be located in the same location as the devices or in different locations. As shown in FIG. 1, the motor rotation control method includes: Step S101: in a first interrupt period, obtain first position sampling information of the motor, and perform a position loop calculation on the first position sampling information of the motor to obtain a first control output result; Step S102: in a second interruption period, receiving a first control output result calculated in the first interruption period, and performing a speed loop calculation on the first control output result to obtain a second control output result; Step S103: in a third interrupt period, receiving a second control output result calculated in the second interrupt period, and performing a current loop calculation on the second control output result to obtain a third control output result; Step S104: in a fourth interrupt period, receiving a third control output result calculated in the third interrupt period, and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of a current period, wherein the first interrupt period, the second interrupt period, the third interrupt period, and the fourth interrupt period constitute an interrupt control period, and the interrupt control period and the PWM signal reference channel are decoupled, and the interrupt control period is a complete motor FOC control period; Step S105: in a fourth interrupt period, obtain current second position sampling information of the motor, predict the second position sampling information to obtain position result information of the motor rotor within a predetermined number of prediction periods, and perform inverse Park transform and inverse Clark transform on the position result information to obtain SVPWM signals for a predetermined number of prediction periods; The method may include step S106 of generating a group of SVPWM control signals based on the SVPWM signal of the current cycle and the SVPWM signals of a predetermined number of predicted cycles, and controlling the motor based on the group of SVPWM control signals.

[0028] More preferably, the step of acquiring first position sampling information of the motor and performing a position loop calculation on the first position sampling information of the motor to obtain a first control output result comprises: obtaining motor position sampling information in a first interrupt period of the motor; processing the motor position sampling information of the first interrupt period to obtain the actual position of the motor rotor and the actual rotation speed of the electronic rotor; and performing closed-loop control on the position of the motor based on the target position of the motor control input and the actual position of the motor rotor to obtain a first control output result; The step of receiving a first control output result calculated in a first interrupt period and performing a speed loop calculation on the first control output result to obtain a second control output result includes: receiving a first control output result calculated in a first interrupt period and an actual rotation speed of the motor rotor; performing a closed-loop control calculation for a target speed of the motor to obtain a second control output result; The step of receiving the second control output result calculated in the second interrupt period and performing a current loop calculation on the second control output result to obtain the third control output result includes: sampling the motor phase currents to obtain phase currents Ia and Ic; a step of performing Clark and Park transformation on the phase currents Ia and Ic to obtain a direct axis current Id and a quadrature axis current Iq, in which the quadrature axis leads the direct axis by an electrical angle of 90 degrees; receiving a second control output result calculated in a second interrupt period, and performing closed-loop control on the direct axis current Id and the quadrature axis current Iq of the motor to obtain a third control output result; The step of receiving the third control output result calculated in the third interrupt period and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of the current period includes: obtaining motor position sampling information in a fourth interrupt period of the motor; processing the motor position sampling information in the fourth interrupt period to obtain the actual position of the motor rotor and the rotation speed of the motor rotor; receiving a third control output result calculated in a third interrupt period, and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of a current period; The steps of obtaining the current second position sampling information of the motor, predicting the second position sampling information to obtain position result information of the motor rotor within a predetermined number of prediction periods, and performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for a predetermined number of prediction periods, as described above, include: acquiring the motor rotation speed and position in the fourth interrupt period; predicting the motor rotor position for the first interrupt period, the motor rotor position for the second interrupt period, and the motor rotor position for the third interrupt period in the next stage based on the motor rotation speed and position for the fourth interrupt period; The method includes a step of performing inverse Park transform and inverse Clark transform calculations on the output results of the first interrupt period, the second interrupt period, and the third interrupt period in the next stage, respectively, to obtain SVPWM signals corresponding to the position loop, the velocity loop, and the current loop in the next stage.

[0029] Figure 4 is a block diagram of the motor FOC control principle disclosed in an embodiment of the present invention. The motor rotor position sensor is located near the motor. During motor rotor rotation, the motor rotor position sensor outputs four analog voltage signals: sin+, cos+, sin-, and cos-. The analog voltage signals are sampled and scaled by AD sampling, and then processed through a phase-locked loop (PLL) calculation to obtain the motor rotor position signal and motor rotor rotation speed signal. The motor three-phase inverter bridge has a sampling resistor. When current flows through the resistor, a voltage analog signal is generated. This signal is then sampled and scaled to obtain the phase currents Ia and Ic. The phase currents are then transformed into Clark coordinates to obtain Iα and Iβ current signals. These current signals are then combined with the motor rotor position signal and transformed into Park coordinates to obtain the actual D-axis current signal Id and Q-axis current signal Iq. When the controller requests the motor rotor target position, the software performs position closed-loop control based on the actual position signal obtained through PLL calculation. The output of the position closed-loop control is the desired motor rotor target speed, and the software performs speed closed-loop control based on the actual speed obtained by phase-locked loop calculation. The speed closed-loop control outputs the D-axis target current Id_ref and the Q-axis target current Iq_ref, which are combined with the actual Id and Iq obtained by Park coordinate transformation to perform D-axis and Q-axis current target control, respectively. Vd is obtained by controlling the D-axis target current, and Vq is obtained by controlling the Q-axis target current. Vd and Vq are combined with the motor rotor position signal through inverse Park coordinates to obtain Vα and Vβ, which are then inverse Clark transformed to obtain the space vector pulse-width modulation signal SVPWM, which acts on the motor inverter bridge to drive the motor.

[0030] In an embodiment of the present invention, the six PWM signals for motor control, including the PWM signals triggered by motor current and rotor position, are generated by a PWM module on the main chip of the motor controller. These seven PWM signals are generally in the same module, all of which operate according to the same clock source and are centered on the PWM signal reference channel, with an additional interrupt trigger signal for implementing an interrupt function. The interrupt function implements three closed-loop control loops: the motor's position loop, velocity loop, and current loop. In a typical FOC algorithm module, the output of the position loop control is the control input for the velocity loop, and the control output of the velocity loop corresponds to the control input for the current loop. The output of the current loop corresponds to the reference voltage signals for the D and Q axes. The reference voltage signals are then subjected to an inverse Park and Clarke transform to generate space vector PWM signals. In some practical applications, the speed loop control may be converted to current loop control, or the position loop control may be converted to current loop control, or a combination of the two, but this does not affect the resolution.

[0031] In conventional methods, the interrupt trigger signal and the PWM signal reference channel are the same signal, so the motor control period and the PWM signal period are the same. For example, if the motor control PWM signal period is 50 us, the interrupt function execution period is also 50 us. When the motor controller's CPU load is high, the only way to reduce the load is to lengthen the periods of both the motor control PWM signal and the interrupt trigger PWM signal. However, a longer PWM period affects NVH (Noise, Vibration, and Harshness). Here, a trigger signal path is added to create a new interrupt function, and the trigger signal of this new interrupt function is decoupled from the PWM signal reference channel. That is, the frequency of the new interrupt trigger signal can be slower, such as 10 kHz or 16 kHz, or it can be the same as the PWM reference channel. The frequency of the six motor control PWM signals can remain at 20 kHz.

[0032] Due to system inertia, it is generally believed that the outputs of the position loop, velocity loop, and current loop play little dominant role within the four control periods of a motor closed-loop system. This means that the three-loop control output results (D-axis and Q-axis reference voltages) are thought to barely change. However, the motor rotor position constantly changes during motor control, and this change is significantly important for the motor's SVPWM generation. Therefore, the motor rotor position for the current period is calculated based on the current motor rotor sine and cosine signals, and the motor rotor position for the next three periods is predicted based on the motor rotor rotation speed (which can usually be obtained by taking the arc tangent of the sine / cosine signal or by performing phase-locked loop processing on the sine and cosine signals; this is not further explained here). Then, the SVPWM corresponding to the current period and the three following periods are obtained through inverse Park and inverse Clark transforms. Each time the interrupt function is entered, the corresponding SVPWM is updated and applied to the motor drive bridge. This method achieves stable motor control.

[0033] More preferably, the priority of the interrupt control period is set to the highest level of an application program type interrupt.

[0034] In a specific implementation, the interrupt control period is set to a high priority, so that it is not interfered with by other interrupts or application program tasks.Normal interrupts are divided into level 1 and level 2 interrupts, where the application program interrupt is a level 2 interrupt, and level 1 interrupt is generally set at the system level.Here, if the application program type interrupt is set to the highest level, the corresponding three-closed-loop control decomposition can be realized.

[0035] In this embodiment of the present invention, the priority of this interrupt function is generally set high, so it is not interfered with by other interrupts or tasks. Three closed-loop control is decomposed, i.e., motor control is realized by dividing it into four control periods. Each control period involves one interrupt function entry. The first interrupt function entry implements position loop control; the second interrupt function entry implements velocity loop control; the third interrupt function entry implements current loop control; and the fourth interrupt function entry generates a sequence of SVPWM control signals with four predicted voltage space vectors. One of these is the SVPWM control signal for the current control period, and the other three are the SVPWM control signals for the following three control periods. This cyclical execution is repeated for the entire control sequence. Each time the interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated based on the sequence number of the interrupt function being entered, and then applied to the motor drive bridge circuit. This reduces the CPU load and does not affect the SVPWM update frequency during motor control.

[0036] More preferably, after the step of generating a group of SVPWM control signals based on the SVPWM signal of the current cycle and the SVPWM signals of a predetermined number of predicted cycles, a step of cyclically executing the above steps, generating a sequence index number corresponding to the obtained SVPWM control signal group, and storing the corresponding SVPWM control signal group and the sequence index number in association with each other; Each time a new interrupt control period is entered, the method further includes a step of obtaining an SVPWM control signal group associated with the new interrupt control period based on the corresponding sequence index number to perform subsequent motor control.

[0037] The entire control sequence is generated in order and executed cyclically. Each time an interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated based on the sequence number of the interrupt function being entered, and acted on the motor drive bridge circuit. In this way, the CPU load is reduced and the SVPWM update frequency during motor control is not affected.

[0038] More preferably, FIG. 2 is a flowchart of an automatic adjustment of an interrupt control period disclosed in an embodiment of the present invention, and as shown in FIG. 2, the motor rotation control method includes: Step S107: obtaining current load operation information of the central processor; The method further includes a step S108 of comparing the load operation information with a preset load, and if the load information is greater than the preset load, increasing the size of the interrupt control period until the load operation information of the central processor becomes smaller than the preset load.

[0039] In a specific implementation, the control period here may be preset or dynamically adjusted, and the CPU load operating state is detected in real time and compared with a preset load to determine whether the CPU is operating within a reasonable range. If the current operating load of the CPU is too high, the size of the interrupt control period is increased to reduce the operating load.

[0040] More preferably, FIG. 3 is a flowchart of the angle compensation calculation disclosed in the embodiment of the present invention. As shown in FIG. 3, the motor rotation control method includes: Step S100a: acquiring an AD signal sampling trigger time T1 and an interrupt trigger time T2 by a time acquisition module; Step S100b of acquiring the current rotation speed w of the motor; The method further includes step S100c of performing calculations based on the AD signal sampling trigger time T1, the interrupt trigger time T2, the current rotation speed ω, and a position compensation equation to obtain predicted motor rotor position information, and performing rotation control on the motor based on the predicted motor rotor position information to generate SVPWM, where the position compensation equation is θ2=θ1+ω*(T2-T1+n*T), where n is the number of periods that differ between the control period in which the predicted PWM signal is generated and the current control period, T is the motor control period, ω is the current rotation speed of the motor, T2 is the interrupt trigger time, T1 is the AD signal trigger time, θ1 is the angle calculated after AD sampling processing of the motor rotor position in the current period, and θ2 is the predicted motor rotor position in the corresponding control period.

[0041] Because the interrupt control period and the PWM signal reference channel period are decoupled, that is, the time difference between the time when the interrupt control function is entered and the AD sampling trigger time of the SVPWM driven by the motor is random, in order to achieve better signal synchronization, in a specific implementation, angle compensation is required to achieve more accurate motor control.

[0042] At this time, the motor control frequency is executed according to the frequency of the new motor interrupt function. Because the interrupt function for the PWM signal reference channel and the new motor control interrupt function are decoupled, the signal sampling process is not significantly different from before decoupling. The main differences are as follows: When AD sampling is triggered, the DMA transfers the sampling result to the corresponding RAM variable. At this time, software transfers the value of the STM or TBU module time count register to the RAM variable corresponding to T1 to obtain the time T1. The new motor control interrupt function then reads the value of the STM or TBU module time count register to obtain the time T2. When calculating the predicted motor rotor position, the angle obtained by software conversion based on the sampled value is the angle θ1 at the sampling time. The angle required for this time to perform motor FOC control in the new interrupt control function is θ2, and the motor rotation speed is ω, so θ2 = θ1 + ω * (T2 - T1 + n * T). The time difference between T2 and T1 in the predicted period may not be equal to the time difference between T2 and T1 in the current period; in this case, even if they are not equal, it is small and is considered to have a very small impact on predictive control.In addition, the new interrupt control function must set time protection when updating the PWM waves of the six routes output by the motor, that is, the PWM signals of the six routes must be updated at the same time.Generally, before updating, the shadow register must be set to prohibit updating.After the PWM setting of the six routes is completed, the shadow registers of the six channels are enabled to be updated, which avoids the connection between the high-side MOS and the low-side MOS due to the high-side shadow register and low-side shadow register being updated at different times.After the update, they are enabled in the next PWM period.

[0043] In an embodiment of the present invention, an interrupt trigger signal is added to decouple the PWM signal, an interrupt function scheduling period is added to reduce the CPU load, the motor control algorithm is divided into four parts, and only a portion of the functions is executed in each control period to reduce the CPU load. When reducing the CPU load, an SVPWM signal for predictive control is generated in the fourth control period to avoid affecting the motor control effect.

[0044] In the embodiment of the present invention, the motor rotation control method adds an interrupt trigger signal to decouple the PWM signal from the reference channel, and adds a scheduling period for the interrupt function to reduce the CPU load without affecting the SVPWM update frequency during motor control.

[0045] Example 2 Referring to Figure 6, it is a structural schematic diagram of a motor rotation control device disclosed in an embodiment of the present invention. As shown in Figure 6, the motor rotation control device includes: a position loop calculation module 21 for obtaining first position sampling information of the motor in a first interrupt period, and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result; a speed loop calculation module 22 for receiving a first control output result calculated in a first interrupt period and performing a speed loop calculation on the first control output result to obtain a second control output result in a second interrupt period; a current loop calculation module 23 for receiving a second control output result calculated in the second interrupt period and performing a current loop calculation on the second control output result to obtain a third control output result in a third interrupt period; a PWM calculation module 24 for receiving a third control output result calculated in a third interrupt period and performing an inverse Park transform and an inverse Clark transform on the third control output result in a fourth interrupt period to obtain an SVPWM signal of a current period, wherein the first interrupt period, the second interrupt period, the third interrupt period, and the fourth interrupt period constitute an interrupt control period, and the interrupt control period and a PWM signal reference channel are decoupled, and the interrupt control period is a complete motor FOC control period; a signal prediction module 25 for obtaining current second position sampling information of the motor in a fourth interrupt period, predicting the second position sampling information to obtain position result information of the motor rotor within a predetermined number of prediction periods, and performing inverse Park transform and inverse Clark transform on the position result information to obtain an SVPWM signal for a predetermined number of prediction periods; The present invention may further include a motor control module 26 for generating a group of SVPWM control signals based on the SVPWM signal of the current cycle and the SVPWM signals of a preset number of predicted cycles, and for controlling a motor based on the group of SVPWM control signals.

[0046] More preferably, the priority of the interrupt control period is set to the highest level of an application program type interrupt.

[0047] In a specific implementation, the interrupt control period is set to a high priority, so that it is not interfered with by other interrupts or application program tasks.Normal interrupts are divided into level 1 and level 2 interrupts, where the application program interrupt is a level 2 interrupt, and level 1 interrupt is generally set at the system level.Here, if the application program type interrupt is set to the highest level, the corresponding three-closed-loop control decomposition can be realized.

[0048] In this embodiment of the present invention, the priority of this interrupt function is generally set high, so it is not interfered with by other interrupts or tasks. Three closed-loop control is decomposed, i.e., motor control is realized by dividing it into four control periods. Each control period involves one interrupt function entry. The first interrupt function entry implements position loop control; the second interrupt function entry implements velocity loop control; the third interrupt function entry implements current loop control; and the fourth interrupt function entry generates a sequence of SVPWM control signals with four predicted voltage space vectors. One of these is the SVPWM control signal for the current control period, and the other three are the SVPWM control signals for the following three control periods. This cyclical execution is repeated for the entire control sequence. Each time the interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated based on the sequence number of the interrupt function being entered, and then applied to the motor drive bridge circuit. This reduces the CPU load and does not affect the SVPWM update frequency during motor control.

[0049] In the embodiment of the present invention, the motor rotation control method adds an interrupt trigger signal to decouple the PWM signal from the reference channel, and adds a scheduling period for the interrupt function to reduce the CPU load without affecting the SVPWM update frequency during motor control.

[0050] Example 3 Referring to Figure 7, Figure 7 is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention. The electronic device can be a computer, a server, etc., and of course, in certain cases, it can also be a smart device such as a mobile phone, a tablet computer, a monitoring terminal, and an image collection device with processing function. As shown in Figure 7, the electronic device can: a memory 510 in which executable program code is stored; a processor 520 coupled to the memory 510; The processor 520 calls the executable program code stored in the memory 510 to execute some or all of the steps of the motor rotation control method according to the first embodiment.

[0051] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program, which causes a computer to execute some or all of the steps of the motor rotation control method in the first embodiment.

[0052] The embodiment of the present invention further discloses a computer program product, which, when executed on a computer, causes the computer to perform some or all of the steps of the motor rotation control method in the first embodiment.

[0053] An embodiment of the present invention further discloses an application release platform for a release computer program product, which, when executed on a computer, causes the computer to perform some or all of the steps in the motor rotation control method in embodiment 1.

[0054] In various embodiments of the present invention, it should be understood that the magnitude of the sequence number of each process does not imply a necessary order of execution, and the execution order of each process must be determined by its function and inherent logic, and does not constitute any limitation on the implementation process of the embodiments of the present invention.

[0055] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. To achieve the objectives of this embodiment, some or all of the units may be selected according to actual needs.

[0056] Furthermore, each functional unit in each embodiment of the present invention may be integrated into a single processing unit, each unit may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit may be realized in the form of hardware or in the form of a software functional unit.

[0057] The integrated unit can be realized in the form of a software functional unit and stored in a computer-accessible memory when sold or used as an independent product. Based on this understanding, the technical solution of the present invention can essentially, or a portion contributing to the prior art, or all or a part of the technical solution can be embodied in the form of a software product, and this software product is stored in one memory and includes several requests to cause one computer device (which may be a personal computer, a server, a network device, etc., and particularly may be a processor in the computer device) to execute some or all of the steps of the methods described in various embodiments of the present invention.

[0058] In the embodiment according to the present invention, it should be understood that "B corresponding to A" means that B is related to A and B can be determined based on A. However, it should be further understood that determining B based on A does not only mean determining B based on A, but also means that B can be determined based on A and / or other information.

[0059] Those skilled in the art will understand that some or all of the steps of the various methods in the above embodiments can be performed by instructing associated hardware by a program that can be stored in a computer-readable storage medium, and the storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memory, magnetic disk memory, magnetic tape memory, or any other computer-readable medium that can be used to carry or store data.

[0060] The motor rotation control method, device, electronic device, and storage medium disclosed in the embodiments of the present invention have been introduced in detail above, and the principles and embodiments of the present invention have been described in this specification using specific examples. However, the explanation of the above examples is only intended to aid in understanding the method of the present invention and its core idea. Furthermore, those skilled in the art will recognize that there may be changes in the specific embodiments and application scope based on the idea of ​​the present invention. As such, the contents of this specification should not be construed as limitations on the present invention.

Claims

1. A motor rotation control method, comprising: In a first interrupt period, acquiring first position sampling information of the motor, and performing a position loop calculation on the first position sampling information of the motor to obtain a first control output result; receiving, in a second interrupt period, a first control output result calculated in the first interrupt period, and performing a speed loop calculation on the first control output result to obtain a second control output result; receiving, in a third interrupt period, a second control output result calculated in the second interrupt period, and performing a current loop calculation on the second control output result to obtain a third control output result; receiving, in a fourth interrupt period, a third control output result calculated in the third interrupt period, and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of a current period, wherein the first interrupt period, the second interrupt period, the third interrupt period, and the fourth interrupt period constitute an interrupt control period, the interrupt control period is a complete motor FOC control period, and the interrupt control period and a PWM signal reference channel are decoupled; In a fourth interrupt period, obtaining current second position sampling information of the motor, predicting position result information of the motor rotor within a predetermined number of prediction periods based on the second position sampling information, and performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for the predetermined number of prediction periods; generating a group of SVPWM control signals based on the SVPWM signal of the current period and the SVPWM signals of a predetermined number of predicted periods, and controlling a motor based on the group of SVPWM control signals; Acquiring an AD signal sampling trigger time T 1 and an interrupt trigger time T 2 by a time acquisition module; obtaining a current rotation speed ω of the motor; A motor rotation control method comprising the steps of: calculating based on the AD signal sampling trigger time T1, interrupt trigger time T2, current rotation speed ω and a position compensation equation to obtain predicted motor rotor position information; performing rotation control on the motor based on the predicted motor rotor position information; and generating an SVPWM, wherein the position compensation equation is θ2 = θ1 + ω*(T2 - T1 + n*T), where n is the number of periods that differ between the control period in which the predicted PWM signal is generated and the current control period; T is the motor control period; ω is the current motor rotation speed; T2 is the interrupt trigger time; T1 is the AD signal trigger time; θ1 is the angle calculated after AD sampling processing of the motor rotor position in the current period; and θ2 is the predicted motor rotor position in the corresponding control period.

2. The step of obtaining first position sampling information of the motor and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result includes: obtaining motor position sampling information in a first interrupt period of the motor; processing the motor position sampling information of the first interrupt period to obtain the actual position of the motor rotor and the actual rotation speed of the electronic rotor; and performing closed-loop control on the position of the motor based on the target position of the motor control input and the actual position of the motor rotor to obtain a first control output result; The step of receiving a first control output result obtained by calculation in the first interrupt period and performing a speed loop calculation on the first control output result to obtain a second control output result includes: receiving a first control output result calculated in a first interrupt period and an actual rotation speed of the motor rotor; performing a closed-loop control calculation for a target speed of the motor to obtain a second control output result; receiving a second control output result calculated in the second interrupt period and performing a current loop calculation on the second control output result to obtain a third control output result, sampling the motor phase currents to obtain phase currents Ia and Ic; a step of performing Clark and Park transformation on the phase currents Ia and Ic to obtain a direct-axis current Id and a quadrature-axis current Iq, in which the quadrature axis leads the direct axis by an electrical angle of 90 degrees; receiving a second control output result calculated in a second interrupt period, and performing closed-loop control on the direct-axis current Id and the quadrature-axis current Iq of the motor to obtain a third control output result; receiving a third control output result calculated in the third interrupt period and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of the current period; obtaining motor position sampling information in a fourth interrupt period of the motor; processing the motor position sampling information in the fourth interrupt period to obtain the actual position of the motor rotor and the rotation speed of the motor rotor; receiving a third control output result calculated in a third interrupt period, and performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of a current period; obtaining current second position sampling information of the motor, predicting position result information of the motor rotor within a predetermined number of prediction periods based on the second position sampling information, and performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for the predetermined number of prediction periods; acquiring the motor rotation speed and position in a fourth interrupt period; predicting the motor rotor position for the first interrupt period, the motor rotor position for the second interrupt period, and the motor rotor position for the third interrupt period in the next stage based on the motor rotation speed and position for the fourth interrupt period; 2. The motor rotation control method according to claim 1, further comprising the step of performing an inverse Park transform and an inverse Clark transform on the output results of the first interrupt period, the second interrupt period, and the third interrupt period of the next stage, respectively, to obtain SVPWM signals corresponding to the position loop, the velocity loop, and the current loop of the next stage.

3. After generating a group of SVPWM control signals based on the SVPWM signal of the current period and the SVPWM signals of a predetermined number of predicted periods, a step of cyclically executing the steps, generating a sequence index number corresponding to the obtained SVPWM control signal group, and storing the corresponding SVPWM control signal group and the sequence index number in association with each other; 2. The motor rotation control method according to claim 1, further comprising the step of: acquiring an SVPWM control signal group associated with a new interrupt control period based on a corresponding sequence index number each time a new interrupt control period is entered, and performing subsequent motor control.

4. The motor rotation control method includes: obtaining current load operating information of the central processor; 2. The motor rotation control method according to claim 1, further comprising the step of comparing the load operation information with a preset load, and if the load information is greater than the preset load, increasing the size of the interrupt control period until the load operation information of the central processor becomes smaller than the preset load.

5. The priority of the interrupt control period is set to the highest level of an application program type interrupt; 2. The motor rotation control method according to claim 1, wherein the preset number is three.

6. A motor rotation control device, a position loop calculation module for obtaining first position sampling information of the motor in a first interrupt period and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result; a speed loop calculation module for receiving a first control output result calculated in the first interrupt period and performing a speed loop calculation on the first control output result to obtain a second control output result in a second interrupt period; a current loop calculation module for receiving a second control output result calculated in the second interrupt period and performing a current loop calculation on the second control output result to obtain a third control output result in a third interrupt period; a PWM calculation module for receiving a third control output result calculated in a third interrupt period and performing an inverse Park transform and an inverse Clark transform on the third control output result in a fourth interrupt period to obtain an SVPWM signal of a current period, wherein the first interrupt period, the second interrupt period, the third interrupt period, and the fourth interrupt period constitute an interrupt control period, and the interrupt control period and a PWM signal reference channel are decoupled; a signal prediction module for obtaining current second position sampling information of the motor in a fourth interrupt period, predicting position result information of the motor rotor within a predetermined number of prediction periods based on the second position sampling information, obtaining position result information of the motor rotor within the predetermined number of prediction periods, and performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for the predetermined number of prediction periods; a motor control module for generating a group of SVPWM control signals based on the SVPWM signal of the current period and the SVPWM signals of a predetermined number of predicted periods, and for controlling a motor based on the group of SVPWM control signals; A time acquisition module acquires an AD signal sampling trigger time T 1 and an interrupt trigger time T 2 ; Obtain the current rotation speed ω of the motor, A motor rotation control device comprising: a step of calculating based on the AD signal sampling trigger time T1, interrupt trigger time T2, current rotation speed ω and a position compensation equation to obtain predicted motor rotor position information, performing rotation control on the motor based on the predicted motor rotor position information, and generating an SVPWM, wherein the position compensation equation is θ2 = θ1 + ω*(T2 - T1 + n*T), where n is the number of periods that differ between the control period in which the predicted PWM signal is generated and the current control period, T is the motor control period, ω is the current motor rotation speed, T2 is the interrupt trigger time, T1 is the AD signal trigger time, θ1 is the angle calculated after AD sampling processing of the motor rotor position in the current period, and θ2 is the predicted motor rotor position in the corresponding control period.

7. 7. The motor rotation control device according to claim 6, wherein the priority of the interrupt control period is set to the highest level of an application program type interrupt.

8. 6. An electronic device comprising: a memory in which executable program code is stored; and a processor coupled to the memory, wherein the processor calls the executable program code stored in the memory in order to execute the motor rotation control method according to any one of claims 1 to 5.

9. 6. A computer-readable storage medium storing a computer program, the computer program causing a computer to execute the motor rotation control method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-axis AC servo motor control system based on FPGA chip

    CN112039370A

  • Control time sequence optimization method of double-shaft low-voltage motor driver and related equipment

    CN115840402A

  • Motor control device

    JP2014007894A

  • Control device, and control method

    JP2022183661A

  • Work machine

    WO2023074825A1