Motor rotation control method and apparatus

By adding the interrupt function trigger signal to decouple from the PWM signal in the motor control system and disassemblying the control algorithm into 4 parts, the problems of high CPU load and consistent control cycle in the prior art are solved, efficient motor control is achieved, and the update frequency of SVPWM is maintained.

WO2025065904A1PCT designated stage expired Publication Date: 2025-04-03SHANGHAI LEEKR TECHNOLOGY CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/138204
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-25
Filing Date
2023-12-12
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

In the existing motor control method, the interrupt trigger signal and the PWM signal reference channel are the same signal, resulting in the motor control period and the PWM signal period being consistent. When the CPU load is high, the load can only be reduced to the PWM period, affecting NVH. At the same time, the three closed-loop control has problems with execution priority and function nesting, which affects the control effect.

Method used

Decoupling from the PWM signal reference channel is achieved by adding the interrupt function trigger signal. The motor control algorithm is disassembled into 4 parts, and only part of the function is performed in each control cycle to reduce the CPU load. The fourth control cycle generates a predictively controlled SVPWM signal to maintain the update frequency of the SVPWM when the motor is controlled.

Benefits of technology

It realizes that the update frequency of SVPWM during motor control without affecting the motor while reducing the CPU load, improves the control effect and avoids the influence of NVH.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023138204_03042025_PF_FP_ABST
    Figure CN2023138204_03042025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present invention relate to the technical field of motor control and disclose a motor rotation control method and apparatus. The method comprises: performing inverse Park transform and inverse Clark transform on a control output result obtained from a position loop, a velocity loop and a current loop, so as to obtain an SVPWM signal of the current cycle, an interrupt control cycle being decoupled from a PWM signal reference channel; acquiring present position sampling information of a motor, and predicting the position sampling information, so as to obtain position result information of a motor rotor within prediction cycles; performing inverse Park transform and inverse Clark transform on the position result information, so as to obtain an SVPWM signal of the prediction cycles; according to the SVPWM signal of the current cycle and the SVPWM signal of the prediction cycles, generating an SVPWM control signal group and, according to the SVPWM control signal group, controlling the motor. In the embodiments of the present invention, the motor rotation control method additionally provides an interrupt function trigger signal to implement decoupling from the PWM signal reference channel, so that when an interrupt function scheduling cycle is increased to reduce a CPU load, the frequency of updating SVPWM will not be affected during motor control.
Need to check novelty before this filing date? Find Prior Art

Description

Motor rotation control method and device Technical Field

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

[0002] Permanent magnet synchronous motor control is widely used in applications such as vehicle drive motors, electric power steering motors, and brake motors. The controllers for these motors generally require high functional safety levels and product reliability, often employing a mature and reliable software architecture. AUTOSAR, as a mature, reliable, and widely adopted architecture, has become a trend. By purchasing commercial off-the-shelf (COTS) software that complies with the functional safety AUTOSAR architecture, these software can be configured to generate the desired functional safety-compliant code. Furthermore, the motor controllers themselves must incorporate numerous safety mechanisms to meet functional safety requirements. This undoubtedly increases code complexity and software execution time. Technical issues

[0003] Current motor control methods traditionally use the same reference channel for the interrupt trigger signal and the PWM signal. This ensures that the motor control cycle and the PWM signal cycle are consistent. For example, if the motor control PWM signal cycle is 50µs, then the interrupt function execution cycle is also 50µs. If the motor controller's CPU load is high, reducing this load requires increasing the cycle of both the motor control PWM signal and the interrupt trigger PWM signal. This increased PWM cycle can negatively impact NVH.

[0004] One type of three-loop control of traditional motor FOC control is to establish three tasks or interrupts for the three closed-loop systems, namely the position loop control function, the speed loop control function and the current loop function. Since these three functions belong to different tasks or interrupts, there will inevitably be problems with the execution priority and function nesting of the three. In addition, during this process, the ECU usually has other interrupts and tasks that intersperse or block the timing and phase of the three-loop control system functions. For a real-time control system for a motor, during the process of task interruption or nested execution, the value of the three-loop control operation result may not be the current latest value or the control sequence may not be executed in the expected order, thereby affecting the control effect. In addition, its CPU load is generally very large. Therefore, designing a method for motor rotation control has become a technical problem that needs to be solved urgently by those skilled in the art. Technical Solutions

[0005] To address the above-mentioned drawbacks, an embodiment of the present invention discloses a motor rotation control method, which can reduce the CPU load without affecting the update frequency of SVPWM during motor control.

[0006] A first aspect of an embodiment of the present invention discloses a motor rotation control method, comprising:

[0007] In a first interruption cycle, first position sampling information of the motor is acquired, and a position loop calculation is performed on the first position sampling information of the motor to obtain a first control output result;

[0008] 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;

[0009] In a third interruption period, receiving a second control output result calculated in the second interruption period, and performing a current loop calculation on the second control output result to obtain a third control output result;

[0010] In a fourth interrupt cycle, receiving a third control output result calculated in the third interrupt cycle, performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of the current cycle; wherein the first interrupt cycle, the second interrupt cycle, the third interrupt cycle, and the fourth interrupt cycle constitute an interrupt control cycle, and the interrupt control cycle is decoupled from the PWM signal reference channel;

[0011] In a fourth interrupt cycle, 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 preset number of prediction cycles; performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal of a preset number of prediction cycles;

[0012] An SVPWM control signal group is generated according to the SVPWM signal of the current cycle and the SVPWM signals of a preset number of predicted cycles, and the motor is controlled according to the SVPWM control signal group.

[0013] As an optional implementation manner, in the first aspect of the embodiment of the present invention, 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:

[0014] Obtaining motor position sampling information of the motor in the first interrupt cycle;

[0015] Processing the motor position sampling information of the first interruption period to obtain the actual position of the motor rotor and the actual speed of the electronic rotor;

[0016] According to the target position of the motor control input and the actual position of the motor rotor, the position of the motor is closed-loop controlled to obtain a first control output result;

[0017] The receiving a first control output result obtained by calculation during the first interruption period, and performing a speed loop calculation on the first control output result to obtain a second control output result, includes:

[0018] receiving a first control output result calculated during the first interruption period and an actual speed of the motor rotor;

[0019] Performing closed-loop control calculation on the target speed of the motor to obtain a second control output result;

[0020] The receiving the second control output result obtained by calculation during the second interruption period, and performing current loop calculation on the second control output result to obtain a third control output result, includes:

[0021] Sampling the motor phase current to obtain phase currents Ia and Ic;

[0022] Clark and Park transformations are performed on the phase currents Ia and Ic to obtain the direct-axis current Id and the quadrature-axis current Iq; wherein the quadrature-axis leads the direct-axis by an electrical angle of 90 degrees;

[0023] receiving a second control output result calculated in the second interruption period, performing closed-loop control on the direct-axis current Id and the quadrature-axis current Iq of the motor, and obtaining a third control output result;

[0024] The receiving of the third control output result calculated in the third interruption period, and performing an inverse Park transformation and an inverse Clark transformation on the third control output result to obtain an SVPWM signal of the current period, includes:

[0025] Obtaining motor position sampling information of the motor in the fourth interruption cycle;

[0026] Processing the motor position sampling information in the fourth interruption period to obtain the actual position and speed of the motor rotor;

[0027] receiving a third control output result calculated in a third interruption 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;

[0028] The method of acquiring 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 preset 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 of a preset number of prediction periods includes:

[0029] Obtain the motor speed and position of the fourth interrupt cycle;

[0030] Predicting the motor rotor position of the first interruption period, the motor rotor position of the second interruption period, and the motor rotor position of the third interruption period in the next stage according to the motor speed and position of the fourth interruption period;

[0031] The output results of the first interruption period, the second interruption period and the third interruption period of the next stage are respectively subjected to inverse Park transformation and inverse Clark transformation to obtain the SVPWM signals corresponding to the position loop, speed loop and current loop of the next stage.

[0032] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the priority of the interrupt control cycle is configured as the highest level of application class interrupts.

[0033] In specific implementation, the priority of the interrupt control cycle is configured to be very high so that it will not be disturbed by other interrupts or application tasks; general interrupts are divided into Class I and Class II interrupts, and the application interrupt here is a Class II interrupt. Class I interrupts are generally system-level settings; here, it only needs to be configured as the highest level of application-class interrupts to achieve the corresponding three-loop control disassembly.

[0034] As an optional implementation manner, in the first aspect of the embodiment of the present invention, after generating the SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signals of the preset number of predicted cycles, the further comprising:

[0035] Execute the above steps cyclically, and generate a corresponding sequence index number for the obtained SVPWM control signal group; and associate the corresponding SVPWM control signal group with the sequence index number and store it;

[0036] Each time a new interrupt control cycle is entered, the SVPWM control signal group associated with the new interrupt control cycle is obtained according to the corresponding sequence index number to perform subsequent motor control.

[0037] The entire control sequence is generated and executed in a loop. Each time an interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated according to the interrupt function sequence number, and then applied to the motor drive bridge circuit. This does not affect the SVPWM update frequency during motor control due to the reduced CPU load.

[0038] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the motor rotation control method further includes:

[0039] Get the current load operation information of the CPU;

[0040] The load operation information is compared with a preset load. If the load information is greater than the preset load, the size of the interrupt control period is increased until the load operation information of the central processing unit is less than the preset load.

[0041] Here, the CPU load operating status is detected in real time and compared with the pre-set 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 cycle is increased to reduce the operating load.

[0042] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the motor rotation control method further includes:

[0043] The time acquisition module is used to obtain the AD signal sampling trigger time T1 and the interrupt trigger time T2;

[0044] Get the current speed ω of the motor;

[0045] The predicted motor rotor position information is calculated based on the AD signal sampling trigger time T1, the interrupt trigger time T2, the current speed ω and the position compensation formula, and the motor rotation is controlled according to the predicted motor rotor position information, and SVPWM is generated. The position compensation formula is: θ2=θ1+ω*(T2-T1+n*T), where n is the number of cycles between the control cycle for generating the predicted PWM signal and the current control cycle, T is the cycle time of the motor control, ω is the current 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 cycle, and θ2 is the motor rotor position predicted in the corresponding control cycle.

[0046] Since the interrupt control period is decoupled from the PWM signal reference channel period, that is, the time difference between the moment the interrupt control function enters and the moment the AD sampling of the motor-driven SVPWM is triggered is random, in order to achieve better signal synchronization, angle compensation is required during the specific implementation to achieve more precise motor control.

[0047] As an optional implementation, in the first aspect of the embodiment of the present invention, the preset number is 3.

[0048] A second aspect of an embodiment of the present invention discloses a motor rotation control device, comprising:

[0049] Position loop calculation module: used for obtaining first position sampling information of the motor in a first interrupt cycle, and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result;

[0050] A speed loop calculation module is configured to receive, during a second interruption period, a first control output result calculated during a first interruption period, and perform a speed loop calculation on the first control output result to obtain a second control output result;

[0051] A current loop calculation module is configured to receive, during a third interruption period, a second control output result calculated during a second interruption period, and perform a current loop calculation on the second control output result to obtain a third control output result;

[0052] a PWM calculation module configured to receive, during a fourth interrupt cycle, a third control output result calculated during a third interrupt cycle, and perform an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal for the current cycle; wherein the first, second, third, and fourth interrupt cycles constitute an interrupt control cycle, and the interrupt control cycle is decoupled from a PWM signal reference channel;

[0053] A signal prediction module is configured to obtain the current second position sampling information of the motor during the fourth interruption period, predict the second position sampling information to obtain the position result information of the motor rotor within a preset number of prediction periods, and perform an inverse Park transform and an inverse Clark transform on the position result information to obtain the SVPWM signal of the preset number of prediction periods;

[0054] The motor control module is configured to generate an SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signals of a preset number of predicted cycles, and control the motor according to the SVPWM control signal group.

[0055] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the priority of the interrupt control cycle is configured as the highest level of application class interrupts.

[0056] The third aspect of an embodiment of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; 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 embodiment of the present invention.

[0057] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the motor rotation control method disclosed in the first aspect of the embodiment of the present invention. Beneficial effects

[0058] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0059] The motor rotation control method in the embodiment of the present invention achieves decoupling from the PWM signal reference channel by adding an interrupt function trigger signal, so that when the interrupt function scheduling period is increased to reduce the CPU load, the update frequency of SVPWM during motor control will not be affected. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0061] FIG1 is a flow chart of a motor rotation control method disclosed in an embodiment of the present invention;

[0062] FIG2 is a schematic diagram of a flow chart of automatic adjustment of an interrupt control period according to an embodiment of the present invention;

[0063] FIG3 is a schematic diagram of a flow chart of angle compensation calculation disclosed in an embodiment of the present invention;

[0064] FIG4 is a block diagram of the principle of FOC control of a motor disclosed in an embodiment of the present invention;

[0065] FIG5 is a schematic diagram of the relationship between the PWM drive of the motor disclosed in an embodiment of the present invention;

[0066] FIG6 is a schematic structural diagram of a motor rotation control device provided by an embodiment of the present invention;

[0067] FIG7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Best Mode for Carrying Out the Invention

[0068] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0069] It should be noted that the terms "first," "second," "third," "fourth," etc. in the description and claims of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having," as well as any variations thereof, in the embodiments of the present invention, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.

[0070] One type of three-loop control of traditional motor FOC control is to establish three tasks or interrupts for the three closed-loop system, namely the position loop control function, the speed loop control function and the current loop function. Since these three functions belong to different tasks or interrupts, there will inevitably be problems with the execution priority and function nesting of the three. In addition, during this process, the ECU usually has other interrupts and tasks that intersperse or block the timing and phase of the three-loop control system functions. For a real-time control system of a motor, during the process of task interruption or nested execution, the value of the three-loop control operation result may not be the current latest value or the control sequence may not be executed in the expected order, thereby affecting the control effect. In addition, its CPU load is generally very large. Based on this, the embodiment of the present invention discloses a motor rotation control method, device, electronic device and storage medium, which achieves decoupling from the PWM signal reference channel by adding an interrupt function trigger signal, so that when the scheduling period of the interrupt function is increased to reduce the CPU load, the update frequency of SVPWM during motor control will not be affected. Example 1

[0071] Please refer to Figure 1, which is a flow chart of the motor rotation control method disclosed in an embodiment of the present invention. Among them, the execution subject of the method described in the embodiment of the present invention is an execution subject composed of software and / or hardware, and the execution subject can receive relevant information by wired or / and wireless means, and can send certain instructions. Of course, it can also have certain processing functions and storage functions. The execution subject can control multiple devices, such as a remote physical server or cloud server and related software, or it can be a local host or server and related software that performs related operations on a device placed somewhere. In some scenarios, multiple storage devices can also be controlled, and the storage devices can be placed in the same place or different places as the devices. As shown in Figure 1, the motor rotation control method includes the following steps:

[0072] S101: In a first interrupt cycle, obtaining first position sampling information of a motor, and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result;

[0073] 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;

[0074] S103: In a third interruption period, receiving a second control output result calculated in the second interruption period, and performing a current loop calculation on the second control output result to obtain a third control output result;

[0075] S104: In a fourth interrupt cycle, receiving a third control output result calculated in the third interrupt cycle, performing an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal of the current cycle; wherein the first, second, third, and fourth interrupt cycles constitute an interrupt control cycle, and the interrupt control cycle is decoupled from the PWM signal reference channel; and wherein the interrupt control cycle is a complete motor FOC control cycle;

[0076] S105: In a fourth interruption 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 preset number of prediction periods; performing an inverse Park transform and an inverse Clark transform on the position result information to obtain an SVPWM signal for a preset number of prediction periods;

[0077] S106: Generate an SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signals of a preset number of predicted cycles, and control the motor according to the SVPWM control signal group.

[0078] More preferably, the acquiring 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:

[0079] Obtaining motor position sampling information of the motor in the first interrupt cycle;

[0080] Processing the motor position sampling information of the first interruption period to obtain the actual position of the motor rotor and the actual speed of the electronic rotor;

[0081] According to the target position of the motor control input and the actual position of the motor rotor, the position of the motor is closed-loop controlled to obtain a first control output result;

[0082] The receiving a first control output result obtained by calculation during the first interruption period, and performing a speed loop calculation on the first control output result to obtain a second control output result, includes:

[0083] receiving a first control output result calculated during the first interruption period and an actual speed of the motor rotor;

[0084] Performing closed-loop control calculation on the target speed of the motor to obtain a second control output result;

[0085] The receiving the second control output result obtained by calculation during the second interruption period, and performing current loop calculation on the second control output result to obtain a third control output result, includes:

[0086] Sampling the motor phase current to obtain phase currents Ia and Ic;

[0087] Clark and Park transformations are performed on the phase currents Ia and Ic to obtain the direct-axis current Id and the quadrature-axis current Iq; wherein the quadrature-axis leads the direct-axis by an electrical angle of 90 degrees;

[0088] receiving a second control output result calculated in the second interruption period, performing closed-loop control on the direct-axis current Id and the quadrature-axis current Iq of the motor, and obtaining a third control output result;

[0089] The receiving of the third control output result calculated in the third interruption period, and performing an inverse Park transformation and an inverse Clark transformation on the third control output result to obtain an SVPWM signal of the current period, includes:

[0090] Obtaining motor position sampling information of the motor in the fourth interruption cycle;

[0091] Processing the motor position sampling information in the fourth interruption period to obtain the actual position and speed of the motor rotor;

[0092] receiving a third control output result calculated in a third interruption 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;

[0093] The method of acquiring 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 preset 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 of a preset number of prediction periods includes:

[0094] Obtain the motor speed and position of the fourth interrupt cycle;

[0095] Predicting the motor rotor position of the first interruption period, the motor rotor position of the second interruption period, and the motor rotor position of the third interruption period in the next stage according to the motor speed and position of the fourth interruption period;

[0096] The output results of the first interruption period, the second interruption period and the third interruption period of the next stage are respectively subjected to inverse Park transformation and inverse Clark transformation to obtain the SVPWM signals corresponding to the position loop, speed loop and current loop of the next stage.

[0097] Figure 4 is a block diagram of the principle of motor FOC control according to an embodiment of the present invention. The motor rotor position sensor is located near the motor. During rotor rotation, it outputs four analog voltage signals: Sin+, Cos+, Sin-, and Cos-. These analog voltage signals are sampled and normalized by analog-to-digital converters (ADCs). After processing in a phase-locked loop (PLL), the motor's rotor position and speed signals are obtained. The motor's three-phase inverter bridge has sampling resistors. When current flows through these resistors, analog voltage signals are generated. These signals are sampled and converted to phase currents Ia and Ic. Clark coordinates are used to transform the phase currents to produce Iα and Iβ current signals. These current signals, combined with the motor rotor position signal, undergo Park coordinates to produce the actual D-axis current signal Id and Q-axis current signal Iq. When the controller requests a target rotor position, the software performs closed-loop position control based on the actual position signals calculated by the PLL. The output of the position closed-loop control is the requested target rotor speed. The software then performs closed-loop speed control based on the actual speed calculated by the PLL. The speed closed-loop control outputs the D-axis target current Id_ref and the Q-axis target current Iq_ref. Combined with the actual values ​​Id and Iq obtained through Park coordinate transformation, these values ​​are used to control the D-axis and Q-axis current targets, respectively. The D-axis target current control generates Vd, while the Q-axis target current control generates Vq. Vd and Vq are combined with the motor rotor position signal through inverse Park coordinate transformation to generate Vα and Vβ. Vα and Vβ are then transformed through inverse Clark transformation to generate the space vector pulse width modulation signal (SVPWM). This signal acts on the motor inverter bridge to drive the motor.

[0098] The six PWM signals for motor control in the embodiment of the present invention, as well as the PWM signals for triggering sampling of motor current and rotor position, are generated by the PWM module of the motor controller's main chip. These seven PWM signals are typically located in the same module, all center-aligned based on the PWM signal reference channel and based on the same clock source. In addition, there is an interrupt trigger signal, which is used to implement the interrupt function. Within the interrupt function, three closed-loop control loops are implemented for the motor's position loop, speed loop, and current loop. In a typical FOC algorithm module, the output of the position loop control serves as the control input for the speed loop. The speed loop control output corresponds to the current loop control input, and the output of the current loop corresponds to the reference voltage signals for the D and Q axes. The reference voltage signals undergo inverse Park and inverse Clarke transforms to generate space vector PWM signals. In some practical applications, speed loop control may be directly converted to current loop control, or position loop control may be directly converted to current loop control, or a combination of the two, but this does not affect the disassembly.

[0099] Traditionally, the interrupt trigger signal and the PWM signal reference channel are the same signal, ensuring that the motor control cycle and the PWM signal cycle are consistent. For example, if the motor control PWM signal cycle is 50us, then the interrupt function execution cycle should also be 50us. If the motor controller's CPU load is high, reducing this load requires increasing the cycle of both the motor control PWM signal and the interrupt-triggered PWM signal. This increased PWM cycle can affect noise, vibration, and harshness (NVH). However, by adding a trigger signal to generate a new interrupt function, the trigger signal of this new interrupt function is decoupled from the PWM signal reference channel. This means that the frequency of the new interrupt trigger signal can be lowered, such as 10kHz or 16kHz, or it can be the same as the PWM reference channel, while the frequency of the six motor control PWM signals remains at 20kHz.

[0100] Due to system inertia, the outputs of the position, velocity, and current loops are generally considered to play little or no role within the extremely short four-cycle control period of a motor closed-loop system. This means that the control outputs of the three loops (the reference voltages for the D and Q axes) are assumed to vary little. However, the rotor position of the motor constantly changes during control, and this change is crucial for generating SVPWM. Therefore, the rotor position for the current cycle can be calculated based on the current rotor Sin and Cos signals. Furthermore, the rotor position for the next three cycles can be predicted based on the rotor speed (generally obtained by taking the inverse tangent of the sin / cos ratio or performing phase-locked loop processing of the sin and cos signals, which will not be discussed here). The SVPWM corresponding to the current cycle and the three following cycles is then calculated using inverse Park and inverse Clark transforms. Each time an interrupt function is entered, the corresponding SVPWM is updated and applied to the motor drive axle. This approach ensures stable motor control.

[0101] More preferably, the priority of the interrupt control cycle is configured as the highest level of application class interrupts.

[0102] In specific implementation, the priority of the interrupt control cycle is configured to be very high so that it will not be disturbed by other interrupts or application tasks; general interrupts are divided into Class I and Class II interrupts, and the application interrupt here is a Class II interrupt. Class I interrupts are generally system-level settings; here, it only needs to be configured as the highest level of application-class interrupts to achieve the corresponding three-loop control disassembly.

[0103] In this embodiment of the present invention, the priority of this interrupt function is generally set very high to prevent interference from other interrupts and tasks. The three closed-loop control loops are then broken down into four control cycles, with each cycle representing one entry into the interrupt function. The first entry into the interrupt function implements position loop control, the second entry into the interrupt function implements velocity loop control, the third entry into the interrupt function implements current loop control, and the fourth entry into the interrupt function generates a sequence of four predicted SVPWM control signals for the voltage space vector. One set of signals is the SVPWM control signal for the current control cycle, and the remaining three sets are for the next three control cycles. The entire control sequence is executed in a loop, and so on. Each time an interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated based on the interrupt function's sequence number, and applied to the motor drive bridge circuit. This reduces CPU load and prevents the SVPWM update frequency from being affected during motor control.

[0104] More preferably, after generating the SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signals of the preset number of predicted cycles, the method further includes:

[0105] Execute the above steps cyclically, and generate a corresponding sequence index number for the obtained SVPWM control signal group; and associate the corresponding SVPWM control signal group with the sequence index number and store it;

[0106] Each time a new interrupt control cycle is entered, the SVPWM control signal group associated with the new interrupt control cycle is obtained according to the corresponding sequence index number to perform subsequent motor control.

[0107] The entire control sequence is generated and executed in a loop. Each time an interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated according to the interrupt function sequence number, and then applied to the motor drive bridge circuit. This does not affect the SVPWM update frequency during motor control due to the reduced CPU load.

[0108] More preferably, FIG2 is a flow chart of automatic adjustment of the interrupt control period disclosed in an embodiment of the present invention. As shown in FIG2 , the motor rotation control method further includes:

[0109] S107: Obtaining the current load operation information of the central processing unit;

[0110] S108: Compare the load operation information with a preset load. If the load information is greater than the preset load, increase the size of the interrupt control period until the load operation information of the central processing unit is less than the preset load.

[0111] During specific implementation, the control period here can be set in advance and can be dynamically adjusted; here, the CPU load operating status is detected in real time and compared with the pre-set 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.

[0112] More preferably, FIG3 is a flow chart of angle compensation calculation disclosed in an embodiment of the present invention. As shown in FIG3 , the motor rotation control method further includes:

[0113] S100a: Obtain the AD signal sampling trigger time T1 and the interrupt trigger time T2 through the time acquisition module;

[0114] S100b: Get the current speed w of the motor;

[0115] S100c: The predicted motor rotor position information is calculated based on the AD signal sampling trigger time T1, the interrupt trigger time T2, the current speed ω and the position compensation formula, and the motor rotation is controlled according to the predicted motor rotor position information, and SVPWM is generated. The position compensation formula is: θ2=θ1+ω*(T2-T1+n*T), where n is the number of cycles between the control cycle for generating the predicted PWM signal and the current control cycle, T is the cycle time of the motor control, ω is the current 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 cycle, and θ2 is the motor rotor position predicted in the corresponding control cycle.

[0116] Since the interrupt control period is decoupled from the PWM signal reference channel period, that is, the time difference between the moment the interrupt control function enters and the moment the AD sampling of the motor-driven SVPWM is triggered is random, in order to achieve better signal synchronization, angle compensation is required during the specific implementation to achieve more precise motor control.

[0117] At this point, the motor control frequency is executed according to the frequency of the newly added motor interrupt function. Since the interrupt function for the PWM signal reference channel is decoupled from the newly added motor control interrupt function, the signal sampling and processing procedures are largely unchanged from before the decoupling. The main differences are as follows: When AD sampling is triggered, the DMA transfers the sampling result to the corresponding RAM variable. The software then transfers the value of the STM or TBU module's time counter register to the RAM variable corresponding to T1, obtaining the current time T1. Within the newly added motor control interrupt function, the software again reads the value of the STM or TBU module's time counter register to obtain the current time T2. When calculating the predicted motor rotor position, the software converts the sampled value to the angle θ1 at the sampling moment. When executing motor FOC control within the newly added interrupt control function, the current angle θ2 is required. Given the motor speed ω, θ2 = θ1 + ω * (T2 - T1 + n * T). The time difference between T2 and T1 in the predicted cycle may not be equal to the time difference between T2 and T1 in the current cycle. However, even if this difference is present, it is assumed to be minimal and will have little impact on predictive control. In addition, time protection needs to be set when updating the six-channel PWM waves output by the motor in the newly added interrupt control function, that is, the six-channel PWM signals must be updated at the same time. Usually, the shadow register must be set to prohibit updating before the update. After the six-channel PWM is set, the shadow register update of the six channels is enabled to avoid the high and low-side MOS being passed through due to the high and low-side shadow registers not being updated at the same time. The update will take effect in the next PWM cycle.

[0118] This embodiment of the present invention decouples the motor control algorithm from the PWM signal by adding an interrupt function trigger signal and reduces CPU load by increasing the interrupt function's scheduling period. The motor control algorithm is also broken down into four parts, with only one part executed during each control cycle, further reducing CPU load. To minimize CPU load, the fourth control cycle generates a predictive SVPWM signal to minimize motor control.

[0119] In the motor rotation control method of the embodiment of the present invention, an interrupt function trigger signal is added to achieve decoupling from the PWM signal reference channel, so that when the interrupt function scheduling period is increased to reduce the CPU load, the update frequency yi of SVPWM during motor control is not affected. Modes for Carrying Out the Invention

[0120] Example 2

[0121] Please refer to Figure 6, which is a schematic diagram of the structure of the motor rotation control device disclosed in an embodiment of the present invention. As shown in Figure 6, the motor rotation control device may include:

[0122] The position loop calculation module 21 is configured to obtain first position sampling information of the motor in a first interruption period, and perform position loop calculation on the first position sampling information of the motor to obtain a first control output result;

[0123] The speed loop calculation module 22 is configured to receive, during the second interruption period, the first control output result calculated during the first interruption period, and perform speed loop calculation on the first control output result to obtain a second control output result;

[0124] The current loop calculation module 23 is configured to receive, during the third interruption period, the second control output result calculated during the second interruption period, and perform current loop calculation on the second control output result to obtain a third control output result;

[0125] PWM calculation module 24: configured to receive, during a fourth interrupt cycle, a third control output result calculated during a third interrupt cycle, and perform an inverse Park transform and an inverse Clark transform on the third control output result to obtain an SVPWM signal for the current cycle; wherein the first, second, third, and fourth interrupt cycles constitute an interrupt control cycle, and the interrupt control cycle is decoupled from the PWM signal reference channel; and wherein the interrupt control cycle is a complete motor FOC control cycle;

[0126] The signal prediction module 25 is configured to obtain the current second position sampling information of the motor during the fourth interruption period, predict the second position sampling information to obtain the position result information of the motor rotor within a preset number of prediction periods, and perform an inverse Park transform and an inverse Clark transform on the position result information to obtain the SVPWM signal of the preset number of prediction periods.

[0127] The motor control module 26 is configured to generate an SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signals of a preset number of predicted cycles, and control the motor according to the SVPWM control signal group.

[0128] More preferably, the priority of the interrupt control cycle is configured as the highest level of application class interrupts.

[0129] In specific implementation, the priority of the interrupt control cycle is configured to be very high so that it will not be disturbed by other interrupts or application tasks; general interrupts are divided into Class I and Class II interrupts, and the application interrupt here is a Class II interrupt. Class I interrupts are generally system-level settings; here, it only needs to be configured as the highest level of application-class interrupts to achieve the corresponding three-loop control disassembly.

[0130] In this embodiment of the present invention, the priority of this interrupt function is generally set very high to prevent interference from other interrupts and tasks. The three closed-loop control loops are then broken down into four control cycles, with each cycle representing one entry into the interrupt function. The first entry into the interrupt function implements position loop control, the second entry into the interrupt function implements velocity loop control, the third entry into the interrupt function implements current loop control, and the fourth entry into the interrupt function generates a sequence of four predicted SVPWM control signals for the voltage space vector. One set of signals is the SVPWM control signal for the current control cycle, and the remaining three sets are for the next three control cycles. The entire control sequence is executed in a loop, and so on. Each time an interrupt function is entered, the corresponding set of SVPWM control signals is indexed and updated based on the interrupt function's sequence number, and applied to the motor drive bridge circuit. This reduces CPU load and prevents the SVPWM update frequency from being affected during motor control.

[0131] The motor rotation control method in the embodiment of the present invention achieves decoupling from the PWM signal reference channel by adding an interrupt function trigger signal, so that when the interrupt function scheduling period is increased to reduce the CPU load, the update frequency of SVPWM during motor control will not be affected. Example 3

[0132] Please refer to Figure 7, which is a schematic diagram of the structure 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 circumstances, it can also be a smart device such as a mobile phone, a tablet computer, and a monitoring terminal, as well as an image acquisition device with processing capabilities. As shown in Figure 7, the electronic device may include:

[0133] A memory 510 storing executable program code;

[0134] a processor 520 coupled to the memory 510;

[0135] The processor 520 calls the executable program code stored in the memory 510 to execute part or all of the steps in the motor rotation control method in the first embodiment.

[0136] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute part or all of the steps in the motor rotation control method in the first embodiment.

[0137] An embodiment of the present invention further discloses a computer program product, wherein when the computer program product is run on a computer, the computer is caused to execute part or all of the steps in the motor rotation control method in the first embodiment.

[0138] An embodiment of the present invention further discloses an application publishing platform, wherein the application publishing platform is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes some or all of the steps in the motor rotation control method in embodiment one.

[0139] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the processes does not necessarily mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0140] The units described as separate components may or may not be physically separate, 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. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.

[0141] In addition, the functional units in the embodiments of the present invention may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of hardware or software functional units.

[0142] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several requests for causing a computer device (which can be a personal computer, server, or network device, specifically a processor in the computer device) to execute some or all of the steps of the method described in various embodiments of the present invention.

[0143] In the embodiments provided herein, it should be understood that "B corresponding to A" means that B is associated with A and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information.

[0144] Those skilled in the art will appreciate that some or all of the steps in the various methods of the embodiments may be performed by instructing related hardware through a program. The program may be stored in a computer-readable storage medium, including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0145] The motor rotation control method, device, electronic device and storage medium disclosed in the embodiments of the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A motor rotation control method, characterized in that: include: In a first interruption cycle, first position sampling information of the motor is acquired, and a position loop calculation is performed on the first position sampling information of the motor to obtain a first control output result; 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; In a third interruption period, receiving a second control output result calculated in the second interruption period, and performing a current loop calculation on the second control output result to obtain a third control output result; In a fourth interruption cycle, receiving a third control output result calculated in the third interruption cycle, and performing an inverse Park transformation and an inverse Clark transformation on the third control output result to obtain an SVPWM signal of the current cycle; wherein the first interruption cycle, the second interruption cycle, the third interruption cycle and the fourth interruption cycle constitute an interruption control cycle, and the interruption control cycle is decoupled from the PWM signal reference channel; In the fourth interruption cycle, the second position sampling information of the motor is obtained, and the second position sampling information is predicted to obtain the position result information of the motor rotor within a preset number of prediction cycles; the position result information is subjected to an inverse Park transformation and an inverse Clark transformation to obtain an SVPWM signal of a preset number of prediction cycles; An SVPWM control signal group is generated according to the SVPWM signal of the current cycle and the SVPWM signal of a preset number of predicted cycles, and the motor is controlled according to the SVPWM control signal group.

2. The motor rotation control method according to claim 1, characterized in that: The acquiring 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: Acquire motor position sampling information of the motor in the first interruption cycle; Processing the motor position sampling information of the first interruption period to obtain the actual position of the motor rotor and the actual speed of the electronic rotor; According to the target position of the motor control input and the actual position of the motor rotor, the position of the motor is closed-loop controlled to obtain a first control output result; The receiving a first control output result obtained by calculating the first interruption period, and performing a speed loop calculation on the first control output result to obtain a second control output result, comprises: Receiving a first control output result calculated in a first interruption period and an actual rotation speed of a motor rotor; Performing closed-loop control calculation on the target speed of the motor to obtain a second control output result; The receiving the second control output result obtained by calculating the second interruption period, and performing current loop calculation on the second control output result to obtain a third control output result, comprises: Sampling the motor phase current to obtain phase currents Ia and Ic; After performing Clark and Park transformation on the phase currents Ia and Ic, a direct axis current Id and a quadrature axis current Iq are obtained; wherein the quadrature axis leads the direct axis by an electrical angle of 90 degrees; Receiving the second control output result calculated in the second interruption period, and performing closed-loop control on the direct-axis current Id and the quadrature-axis current Iq of the motor, and obtaining a third control output result; The receiving of the third control output result calculated in the third interruption period, and performing an inverse Park transformation and an inverse Clark transformation on the third control output result to obtain an SVPWM signal of the current period, comprises: Acquire the motor position sampling information of the motor in the fourth interruption cycle; Processing the motor position sampling information in the fourth interruption period to obtain the actual position of the motor rotor and the speed of the motor rotor; receiving a third control output result calculated in a third interruption period, and performing an inverse Park transformation and an inverse Clark transformation on the third control output result to obtain an SVPWM signal of a current period; The method of acquiring the current second position sampling information of the motor, predicting the second position sampling information to obtain the position result information of the motor rotor within a preset number of prediction cycles; and performing an inverse Park transformation and an inverse Clark transformation on the position result information to obtain the SVPWM signal of the preset number of prediction cycles includes: Obtaining the motor speed and position of the fourth interruption cycle; Predicting the motor rotor position of the first interruption cycle, the motor rotor position of the second interruption cycle, and the motor rotor position of the third interruption cycle in the next stage according to the motor speed and position of the fourth interruption cycle; The output results of the first interruption cycle, the second interruption cycle and the third interruption cycle of the next stage are respectively subjected to inverse Park transformation and inverse Clark transformation to obtain the SVPWM signals corresponding to the position loop, the speed loop and the current loop of the next stage.

3. The motor rotation control method according to claim 1, characterized in that: After generating the SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signal of the preset number of predicted cycles, the method further includes: Execute the above steps in a loop, and generate a corresponding sequence index number for the obtained SVPWM control signal group; and store the corresponding SVPWM control signal group and the sequence index number in association with each other; Each time a new interrupt control cycle is entered, the SVPWM control signal group associated with the new interrupt control cycle is acquired according to the corresponding sequence index number to perform subsequent motor control.

4. The motor rotation control method according to claim 1, characterized in that: The motor rotation control method further includes: Get the current load operation information of the CPU; The load operation information is compared with a preset load. If the load information is greater than the preset load, the size of the interrupt control cycle is increased until the load operation information of the central processing unit is less than the preset load.

5. The motor rotation control method according to claim 1, characterized in that: The motor rotation control method further includes: The time acquisition module is used to obtain the AD signal sampling trigger time T1 and the interrupt trigger time T2; Get the current speed ω of the motor; The predicted motor rotor position information is calculated according to the AD signal sampling trigger time T1, the interrupt trigger time T2, the current speed ω and the position compensation formula, and the motor rotation is controlled according to the predicted motor rotor position information, and SVPWM is generated. The position compensation formula is: θ2=θ1+ω*(T2-T1+ n*T), wherein n is the number of cycles between the control cycle for generating the predicted PWM signal and the current control cycle, T is the cycle time of the motor control, ω is the current speed of the motor, T2 is the interrupt trigger time, T1 is the AD signal trigger time, θ1 is the angle calculated after the AD sampling processing of the motor rotor position in the current cycle, and θ2 is the motor rotor position predicted in the corresponding control cycle.

6. The motor rotation control method according to claim 1, characterized in that: The priority of the interrupt control cycle is configured as the highest level of application class interrupts; And / or, the preset number is 3.

7. A motor rotation control device, characterized in that: include: Position loop calculation module: used for acquiring first position sampling information of the motor in a first interruption cycle, and performing position loop calculation on the first position sampling information of the motor to obtain a first control output result; Speed ​​loop calculation module: used for receiving the first control output result calculated in the first interruption period in the second interruption period, and performing speed loop calculation on the first control output result to obtain the second control output result; A current loop calculation module: used for receiving, in a third interruption period, a second control output result calculated in a second interruption period, and performing a current loop calculation on the second control output result to obtain a third control output result; PWM calculation module: used for receiving the third control output result calculated in the third interruption period in the fourth interruption period, and performing inverse Park transformation and inverse Clark transformation on the third control output result to obtain the SVPWM signal of the current period; wherein the first interruption period, the second interruption period, the third interruption period and the fourth interruption period constitute an interruption control period, and the interruption control period is decoupled from the PWM signal reference channel; Signal prediction module: used for obtaining the current second position sampling information of the motor in the fourth interruption cycle, predicting the second position sampling information to obtain the position result information of the motor rotor within a preset number of prediction cycles; performing inverse Park transformation and inverse Clark transformation on the position result information to obtain the SVPWM signal of the preset number of prediction cycles; The motor control module is used to generate an SVPWM control signal group according to the SVPWM signal of the current cycle and the SVPWM signal of the preset number of predicted cycles, and control the motor according to the SVPWM control signal group.

8. The motor rotation control device according to claim 7, characterized in that: The priority of the interrupt control cycle is configured as the highest level of application class interrupts.

9. An electronic device, characterized in that: include: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the motor rotation control method described in any one of claims 1 to 71 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the motor rotation control method according to any one of claims 1 to 6.

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 rotation control method and device

    CN116979850A

  • Motor control device

    JP2014007894A