A method for optimizing the control timing of a dual-shaft low-voltage motor driver and related equipment.

By alternately performing the feedback correction of the motor and the allocation of the speed ring and position ring calculation to different interrupt periods in the dual-axis low-voltage motor driver, the problem of excessive MCU load is solved and the real-time and reliability of the system is improved.

CN115840402BActive Publication Date: 2025-02-28SHANGHAI XINRUI DRIVE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211626445.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-17
Publication Date
2025-02-28
Estimated Expiration
2042-12-17

AI Technical Summary

Technical Problem

The dual-axis low-voltage motor drivers have too much load on the microcontrol unit (MCU) in real-time control tasks, resulting in a low reliability margin of the MCU, making it difficult to ensure the real-time and reliability of the system at the same time.

Method used

通过在不同的中断周期交替执行第一电机与第二电机的反馈修正,并将速度环与位置环的计算分配到不同的中断周期中进行交替处理,减少MCU的中断处理时间和处理负荷。

Benefits of technology

It reduces the processing load of the MCU, improves the real-time and reliability of the system, and ensures the real-time and reliability of the motor control of the dual-axis low-voltage motor driver.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application provides a control timing optimization method and related equipment for a dual-axis low-voltage motor driver, in the field of dual-axis motor control, wherein the method comprises: when the dual-axis low-voltage motor driver controls the motor, feedback correction of the first motor and the second motor are alternately performed in different interrupt cycles, and calculation of the speed loop and the position loop are allocated to different interrupt cycles for alternating processing, the calculation of the speed loop and the position loop of the same motor is performed at intervals of one interrupt cycle, and the loop calculation of the first motor and the second motor is performed in two adjacent interrupt cycles, which can reduce the processing load of the MCU of the dual-axis low-voltage motor driver and effectively improve the real-time and reliability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of dual-axis motor control, and in particular to a control timing optimization method and related equipment for a dual-axis low-voltage motor driver. Background Art

[0002] In existing servo control systems, digital control is usually adopted. The motor driver usually uses a microcontroller unit as a processor. The tasks handled by the microcontroller unit (MCU) include core control tasks such as current loop, speed loop and position loop, as well as peripheral tasks such as display processing, external communication and external input. The former needs to be executed according to strict time requirements and is a real-time control task, which is executed in the MCU's timer interrupt; the latter has no strict time requirements and is a non-real-time control task, which is executed in the MCU's main loop.

[0003] A dual-axis motor driver is a device that implements two sets of motor control algorithms through an MCU and performs closed-loop control on two motors at the same time. Compared with a single-axis driver, a dual-axis motor driver has higher requirements for the MCU. Dual-axis low-voltage motor drivers are often used for more sophisticated motor control in production and life, such as stepper motors commonly used in 3D printing and servo motors with high position accuracy control in production. The focus of this type of low-voltage motor is on precise control of the motor. The current dual-axis motor driver processes the real-time control tasks of the two motors in parallel in the timing interrupt to ensure real-time control of the two motors at the same time. However, this method places a large load on the MCU, causing the MCU to be in a high-load state of processing the real-time control tasks of the two motors most of the time, resulting in a low reliability margin for the MCU. If the processing load of the MCU is reduced, the real-time performance of the system for motor control cannot be met. Therefore, it is urgent to find a timing control method for the MCU to simultaneously ensure the real-time and reliability of the system. Summary of the invention

[0004] The present application provides a control timing optimization method and related equipment for a dual-axis low-voltage motor driver, which can reduce the processing load of the MCU and effectively improve the real-time and reliability of the system by alternately executing feedback corrections of the first motor and the second motor in different interrupt cycles and allocating the calculations of the speed loop and the position loop to different interrupt cycles for alternating processing.

[0005] In a first aspect of the present application, a control timing optimization method for a dual-axis low-voltage motor driver is provided, which is applied to a dual-axis low-voltage motor driver. The method comprises:

[0006] In a first interruption cycle, real-time sampling information of a first motor is acquired, speed loop calculation is performed on the real-time sampling information of the first motor, and a first PWM signal is output based on the calculation result to control the speed of the first motor;

[0007] In the second interruption period, real-time sampling information of the second motor is obtained, speed loop calculation is performed on the real-time sampling information of the second motor, a second PWM signal is output based on the calculation result, and the speed of the second motor is controlled;

[0008] In a third interruption cycle, real-time sampling information of the first motor is acquired, position loop calculation is performed on the real-time sampling information of the first motor, and a third PWM signal is output based on the calculation result to control the position of the first motor;

[0009] In a fourth interruption cycle, real-time sampling information of the second motor is acquired, position loop calculation is performed on the real-time sampling information of the second motor, and a fourth PWM signal is output based on the calculation result to control the position of the second motor;

[0010] The first interruption period and the third interruption period are separated by the second interruption period or the fourth interruption period.

[0011] Through the above technical scheme, the real-time tasks of the first motor and the second motor are executed alternately in different interrupt cycles, and the speed loop and position loop calculations originally completed in the same interrupt cycle are assigned to the alternating interrupts of the same motor channel for processing. Each interruption only executes the speed loop or position loop calculation of one of the motors, which can reduce the interrupt processing time of the MCU, reduce the processing load of the MCU, and improve the real-time performance and reliability of the system in the dual-axis low-voltage motor driver without reducing the motor load.

[0012] Optionally, in the first interruption period, obtaining real-time sampling information of the first motor includes:

[0013] At the start time of the first interruption period, simultaneously acquiring current sampling information and position sampling information of the first motor;

[0014] The step of obtaining real-time sampling information of the first motor in the third interruption cycle includes:

[0015] At the start time of the third interruption period, current sampling information and position sampling information of the first motor are simultaneously acquired.

[0016] By adopting the above technical solution, in the process of processing the feedback signal of the first motor, the current sampling information and the position sampling information of the first motor are collected simultaneously at the starting moment of the interrupt cycle, so that the time when the two types of sampling information enter the MCU interrupt is consistent, and the sampling interval is also consistent, so that the signal sampling is not affected by the execution of the conditional code, and the accuracy of the subsequent current torque calculation and speed calculation can be guaranteed.

[0017] Optionally, in the second interruption period, obtaining real-time sampling information of the second motor includes:

[0018] At the start time of the second interruption period, simultaneously acquiring the current sampling information and the position sampling information of the second motor;

[0019] The step of obtaining the real-time sampling information of the second motor in the fourth interruption cycle includes:

[0020] At the start time of the fourth interruption period, the current sampling information and the position sampling information of the second motor are simultaneously acquired.

[0021] By adopting the above technical solution, in the process of processing the feedback signal of the second motor, only the signal of one motor is processed each time sampling is performed. While ensuring the real-time performance of information processing, some peripheral resources common to the two motors can be time-shared, and oversampling of the feedback information of a single motor can be achieved, thereby improving the anti-interference ability of the system.

[0022] Optionally, the dual-axis low-voltage motor driver further includes a first current sampling circuit and a first position feedback sensor, and the current sampling information and position sampling information of the first motor are simultaneously acquired at the start time of the first interruption cycle, including:

[0023] Sending a current sampling signal to the first current sampling circuit at the start time of the first interruption cycle, and receiving current sampling information fed back by the first current sampling circuit based on the current sampling signal, wherein the current sampling information is the phase current of the first motor;

[0024] At the start time of the first interruption period, a position acquisition signal is sent to the first position feedback sensor, and position sampling information fed back by the first position feedback sensor based on the position acquisition signal is received.

[0025] By adopting the above technical solution, current sampling information and position sampling information are collected at the start of the interruption, so that temporary collection is performed when a certain parameter is needed during the calculation process, which can speed up the calculation efficiency and reduce the interruption time.

[0026] Optionally, the dual-axis low-voltage motor driver further includes a second current sampling circuit and a second position feedback sensor, and the current sampling information and position sampling information of the second motor are simultaneously acquired at the start time of the second interruption period, including:

[0027] Sending a current sampling signal to the current sampling circuit at the start time of the second interruption cycle, and receiving current sampling information fed back by the second current sampling circuit, wherein the current sampling information is the phase current of the second motor;

[0028] At the start time of the second interruption period, a position acquisition signal is sent to the position feedback sensor, and position sampling information fed back by the second position feedback sensor is received.

[0029] By adopting the above technical solution, the motor phase current and motor position are collected to obtain the motor speed and motor rotation, calculate the motor control deviation, correct the control signal according to the real-time actual operation of the motor, and sample the two feedback signals simultaneously, which can ensure the real-time processing of the system.

[0030] Optionally, the dual-axis low-voltage motor driver further includes an analog-to-digital converter shared by the first motor and the second motor, and after simultaneously acquiring the current sampling information and the position sampling information of the first motor at the start time of the first interrupt cycle, further includes:

[0031] In the first interruption cycle or the third interruption cycle, controlling the analog-to-digital converter to perform analog-to-digital conversion processing on the current sampling information and the position sampling information of the first motor;

[0032] The current sampling information and the position sampling information after analog-to-digital conversion are synchronously processed.

[0033] By adopting the above technical solution, before the current sampling information and the position sampling information enter the MCU, the collected information is converted into analog-to-digital, and then the timing synchronization processing is performed to ensure that the timing of the sampling information entering the MCU is kept consistent.

[0034] Optionally, the dual-axis low-voltage motor driver further includes an analog-to-digital converter shared by the first motor and the second motor, and after simultaneously acquiring the current sampling information and the position sampling information of the second motor at the start time of the second interruption period, further includes:

[0035] In the second interruption cycle or the fourth interruption cycle, controlling the analog-to-digital converter to perform analog-to-digital conversion processing on the current sampling information and the position sampling information of the second motor;

[0036] The current sampling information and the position sampling information after analog-to-digital conversion are synchronously processed.

[0037] By adopting the above technical scheme, the sampling information of the first motor is subjected to analog-to-digital conversion in the first interrupt cycle or the third interrupt cycle, and the sampling information of the second motor is subjected to analog-to-digital conversion in the second interrupt cycle or the fourth interrupt cycle. The same analog-to-digital converter is used in different interrupt cycles, and the shared peripheral resources are fully utilized through time-sharing multiplexing, which can reduce the system load.

[0038] In a second aspect, the present application provides a control timing optimization device for a dual-axis low-voltage motor driver, which is applied to a dual-axis low-voltage motor driver, and the device includes:

[0039] A first motor speed control module, used for obtaining real-time sampling information of the first motor in a first interruption period, performing speed loop calculation on the real-time sampling information of the first motor, and outputting a first PWM signal based on the calculation result to control the speed of the first motor;

[0040] A second motor speed control module, used for obtaining real-time sampling information of the second motor in a second interrupt period, performing speed loop calculation on the real-time sampling information of the second motor, outputting a second PWM signal based on the calculation result, and controlling the speed of the second motor;

[0041] A first motor position control module, configured to obtain real-time sampling information of the first motor in a third interruption period, perform position loop calculation on the real-time sampling information of the first motor, and output a third PWM signal based on the calculation result to control the position of the first motor;

[0042] a second motor position control module, configured to obtain real-time sampling information of the second motor in a fourth interruption period, perform position loop calculation on the real-time sampling information of the second motor, and output a fourth PWM signal based on the calculation result to control the position of the second motor;

[0043] The first interruption period and the third interruption period are separated by the second interruption period or the fourth interruption period.

[0044] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing any one of the above methods.

[0045] In a fourth aspect, the present application provides an electronic device, comprising a processor, a memory and a transceiver, wherein the memory is used to store instructions, the transceiver is used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device performs any one of the above methods.

[0046] In summary, the beneficial technical effects brought about by the embodiments of the present application include:

[0047] The MCU of the dual-axis low-voltage motor driver can reduce the processing load of the MCU by alternately executing the feedback correction of the first motor and the second motor in different interrupt cycles; and the calculation of the speed loop and the position loop are allocated to different interrupt cycles for alternating processing to ensure the reasonable allocation of computing resources, which can effectively improve the system's real-time reliability for the dual-axis low-voltage motor control. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a structural schematic diagram of a single-axis motor drive system according to an embodiment of the present application;

[0049] Figure 2 is a task timing diagram of a motor control system implemented by a microcontroller in an embodiment of the present application;

[0050] Figure 3 It is a flow chart of a control timing optimization method of a dual-axis low-voltage motor driver according to an embodiment of the present application;

[0051] Figure 4 It is a control block diagram of a speed loop calculation in an embodiment of the present application;

[0052] Figure 5 It is a structural schematic diagram of a control timing optimization device for a dual-axis low-voltage motor driver according to an embodiment of the present application;

[0053] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0054] Explanation of the accompanying drawings: 10, first motor speed control module; 20, second motor speed control module; 30, first motor position control module; 40, second motor position control module; 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0056] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a specific way.

[0057] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0058] First, the application scenario of this application is briefly introduced. The principle of the motor driver is to control the operation of the motor through a pulse signal (such as PWM). The dual-axis motor driver is relative to the single-axis motor driver. The single-axis motor driver drives and controls a single motor, while the dual-axis electrical driver drives and controls two motors.

[0059] See also Figure 1 , is a structural schematic diagram of a single-axis motor drive system provided in an embodiment of the present application. In the figure, the control loop is divided into a current loop, a speed loop and a position loop from the inside to the outside. The current loop samples the current output to the motor by the drive module in the drive system. The current entering the motor will affect the motor's speed. Therefore, the feedback of the current loop can correct the control motor's current in the most timely manner. The speed loop and the position loop correct the motor based on the data fed back from the actual operation of the motor. The position is the integral of the motor speed. The deviation between the actual rotation speed and position of the motor and the expected rotation speed and position is calculated to correct the motor in real time.

[0060] See also Figure 2 , which is a task timing diagram of a motor control system implemented by a microcontroller provided in an embodiment of the present application, performs current sampling and position sampling when an interrupt is triggered, calculates the position loop or the speed loop after the sampling is completed, and completes the motor control under a non-real-time task.

[0061] See also Figure 3, which is a flow chart of a control timing optimization method for a dual-axis low-voltage motor driver provided in an embodiment of the present application. The method can be implemented by a computer program, can be implemented by a single-chip microcomputer, or can be run on a control timing optimization device for a dual-axis low-voltage motor driver based on a von Neumann system. The computer program can be integrated into an application or run as an independent tool application. Taking a computer device as an example, the embodiment of the present application describes in detail the specific steps of the control timing optimization method for a dual-axis low-voltage motor driver.

[0062] S101, in a first interruption cycle, obtaining real-time sampling information of the first motor, performing speed loop calculation on the real-time sampling information of the first motor, and outputting a first PWM signal based on the calculation result to control the rotation speed of the first motor.

[0063] The first motor refers to one of the two motors controlled by the dual-axis low-voltage motor driver in the embodiment of the present application. The two motors do not affect each other and operate independently through the corresponding drive modules. The first motor does not cover the actual parameter meanings such as the size and power consumption of the motor. It only represents one of the two motors driven and controlled by the dual-axis low-voltage motor driver in the embodiment of the present application, and is used to distinguish the two motor movements.

[0064] The first interrupt cycle refers to the cycle of MCU processing interrupts. The MCU processing of the dual-axis low-voltage motor driver is divided into real-time code processing and non-real-time code processing. Real-time code (such as current and position sampling, speed calculation, position loop, speed conversion and current loop calculation, real-time command processing, etc.) is executed in the timer interrupt, and non-real-time code (such as motor drive) is executed in the main loop. The first interrupt cycle refers to the time to pause the main loop to execute real-time tasks.

[0065] The first PWM signal refers to a signal that adjusts the initial PWM pulse waveform after the speed loop is calculated, thereby controlling the speed of the first motor. The speed deviation is calculated by the MCU, and the duty cycle of the initial PWM signal is adjusted to adjust the actual speed to the expected speed.

[0066] In one of the embodiments, current sampling information and position sampling information of the first motor are simultaneously acquired at the start time of the first interruption period.

[0067] See also Figure 4 , is a control block diagram of a speed loop calculation provided in an embodiment of the present application, in which is the speed given value, ω m is the actual speed value, T i is the equivalent time constant of the current loop, J is the total inertia of the motor and load, is the permanent magnet flux, p n is the pole pair number, K ωis the speed controller proportional coefficient, T ω is the speed controller integral coefficient, T L is the load torque. Since the bandwidth of the current loop is much higher than that of the speed loop, the current loop in the figure is equivalent to the first-order inertia link. Therefore, the open-loop transfer function of the speed loop is:

[0068]

[0069] The current loop is a proportional (P) and integral (I) regulation, where P regulation is used to quickly offset the influence of interference, and I regulation is used to eliminate residual errors.

[0070] At the start of the first interrupt cycle, the current sampling information and the position sampling information of the first motor are obtained simultaneously, so that the current sampling information and the position sampling information enter the MCU at the same time. When performing speed loop calculation, since the motor is usually connected to a load, the load torque needs to be obtained to achieve precise control of the actual speed. The load torque can be calculated through the actual position of the motor.

[0071] When performing speed loop calculation in the first interrupt cycle, both speed sampling information and position sampling information are needed. The timings of using the two types of information in the calculation are different. If sampling information is obtained when a certain sampling information is needed, the calculation time will be increased, thereby lengthening the interrupt cycle, increasing the system interrupt occupancy rate, and affecting the reliability of the system.

[0072] In one of the embodiments, a current acquisition signal is sent to the first current sampling circuit at the start time of the first interrupt cycle, and current sampling information fed back by the first current sampling circuit based on the current acquisition signal is received, and the current sampling information is the phase current of the first motor; a position acquisition signal is sent to the first position feedback sensor at the start time of the first interrupt cycle, and position sampling information fed back by the first position feedback sensor based on the position acquisition signal is received.

[0073] At the start of the interruption, the current sampling information and the position sampling information are collected. Since the interruption cycle is consistent in time, the intervals between the current and position sampling can be guaranteed to be consistent and not affected by the conditional code.

[0074] The first current sampling circuit is arranged at the first motor to collect the U, V, and W three-phase currents of the first motor to obtain current sampling information. The current sampling information can be obtained by directly collecting the current of the first motor, or by designing a circuit based on a current transformer, based on the real-time collection of the three-phase current of the first motor.

[0075] The object of the first position feedback sensor is the first motor, which is used to collect the real-time position information of the first motor. The position feedback sensor can use a Hall element sensor or a single-channel rotary transformer (resolver). When the accuracy requirement is high, the resolver is often used to collect the actual position of the motor rotor. The motor and the resolver are mechanically installed in a shaft connection. The resolver is a commonly used position sensor in motor control to reflect the rotor position of the motor. By obtaining the absolute position of the motor rotor, the relative position between the motor rotor and the stator is calculated, thereby accurately collecting the position information of the motor.

[0076] In one of the embodiments, in the first interruption cycle or the third interruption cycle, the analog-to-digital converter is controlled to perform analog-to-digital conversion on the current sampling information and the position sampling information of the first motor; and the current sampling information and the position sampling information after the analog-to-digital conversion are timed and synchronized.

[0077] Since the collected current sampling information and position sampling information of the first motor are usually analog signals, it may be necessary to perform analog-to-digital conversion on the collected signals. Since the current sampling information and the position sampling information need to be synchronously entered into the MCU, the two sampling information need to be synchronously processed at a regular interval. A more conventional method is to use a register to store the sampling information that is first sampled, and after all the sampling information is completed, it enters the MCU after synchronization with the timer to achieve synchronization of the sampling information when the interrupt starts.

[0078] S102, in a second interruption period, acquiring real-time sampling information of the second motor, performing speed loop calculation on the real-time sampling information of the second motor, outputting a second PWM signal based on the calculation result, and controlling the rotation speed of the second motor.

[0079] After the speed loop calculation of the first motor is performed in the first interrupt cycle, the speed loop calculation of the second motor is performed in the second interrupt cycle. In the actual dual-axis low-voltage motor driver processing, the speed loop calculation of the second motor can be performed in the second interrupt cycle, and the position loop calculation of the second motor can also be performed. It is only necessary to perform different loop calculations on the same motor in adjacent interrupt cycles to achieve different loop calculations in the second interrupt cycle and the fourth interrupt cycle.

[0080] In one of the embodiments, the current sampling information and the position sampling information of the second motor are simultaneously acquired at the start time of the second interruption period.

[0081] The current sampling information and position sampling information of the second motor are obtained at the starting time of the second interrupt cycle, so that the time interval between each current sampling and position sampling is consistent. Therefore, the sampling timing of the sampling part is not affected by the execution of the conditional code during the loop calculation process. The stability of the sampling interval can ensure the accuracy of subsequent current torque calculation and speed calculation.

[0082] In one of the embodiments, a current acquisition signal is sent to the current sampling circuit at the start time of the second interrupt cycle, and current sampling information fed back by the second current sampling circuit is received, where the current sampling information is the phase current of the second motor; and a position acquisition signal is sent to the position feedback sensor at the start time of the second interrupt cycle, and position sampling information fed back by the second position feedback sensor is received.

[0083] In each interruption cycle, different current sampling circuits and position feedback sensors are used to obtain the current sampling information required for the speed loop calculation and the position sampling information required for the position loop calculation of the corresponding motor. After the calculation results of the position loop or the speed loop are obtained in the interruption cycle, the corrected PWM signal can be output during the remaining time of the interruption to control the corresponding single motor, and the output current can be controlled in real time according to the current loop. After obtaining the calculation result of the position loop, the calculation result of the speed loop can be obtained in the next interruption cycle of the same motor, and the calculation results of the two interruption cycles can be comprehensively processed to obtain a combined correction result, and the corrected PWM signal can be output to realize the control of the single motor. After each position loop calculation result is obtained, it can also be comprehensively processed with the speed loop calculation result of the previous interruption cycle of the same motor to obtain a more accurate PWM correction signal.

[0084] In one of the embodiments, in the second interrupt cycle or the fourth interrupt cycle, the analog-to-digital converter is controlled to perform analog-to-digital conversion on the current sampling information and the position sampling information of the second motor; and the current sampling information and the position sampling information after the analog-to-digital conversion are timed and synchronized.

[0085] The sampling information of the first motor and the sampling information of the second motor are processed alternately. Compared with the previous simultaneous or sequential analog-to-digital conversion processing of the sampling information of the two motors, the sampling information of a single motor can be processed at a fixed time.

[0086] S103, in a third interruption period, acquiring real-time sampling information of the first motor, performing position loop calculation on the real-time sampling information of the first motor, and outputting a third PWM signal based on the calculation result to control the position of the first motor.

[0087] In one of the embodiments, the current sampling information and the position sampling information of the first motor are simultaneously acquired at the start time of the third interruption period.

[0088] Each time a single motor's position loop or speed loop calculation is performed, the motor's speed information and position information need to be collected. The speed information is obtained by collecting the motor's phase current, and the position information is obtained by rotating synchronously with the motor's rotor to ensure the rate of the loop calculation.

[0089] S104, in the fourth interruption period, obtaining the real-time sampling information of the second motor, performing position loop calculation on the real-time sampling information of the second motor, and outputting a fourth PWM signal based on the calculation result to control the position of the second motor. The first interruption period and the third interruption period are separated by the second interruption period or the fourth interruption period; the first interruption period and the third interruption period are separated by the second interruption period or the fourth interruption period.

[0090] In one embodiment, the current sampling information and the position sampling information of the second motor are simultaneously acquired at the start time of the fourth interruption period.

[0091] The current sampling information and position sampling information of the corresponding first motor or second motor are obtained in each interruption cycle. The position loop and the speed loop cooperate with each other in the interruption cycle executed at intervals to reduce the calculation time of each interruption to ensure the real-time performance of the system.

[0092] Through the above technical scheme, the loop calculations of the two motors are distributed to two interrupt cycles, and the loop calculations of the two motors are executed alternately. In the loop calculations of the same motor, the calculations of the speed loop and the position loop are executed alternately with an interrupt cycle interval, so that the system interrupt occupancy rate is reduced, the system reliability margin is increased, and the timing configuration of the real-time tasks with alternating intervals can ensure the reliability and real-time performance of the system for motor control.

[0093] See also Figure 5 , which shows a schematic diagram of the structure of a control timing optimization device for a dual-axis low-voltage motor driver provided by an exemplary embodiment of the present application. The device can be implemented as all or part of the device through software, hardware or a combination of both. The device includes a first motor speed control module 10, a second motor speed control module 20, a first motor position control module 30 and a second motor position control module 40.

[0094] The first motor speed control module 10 is used to obtain the real-time sampling information of the first motor in the first interruption period, perform speed loop calculation on the real-time sampling information of the first motor, and output a first PWM signal based on the calculation result to control the speed of the first motor;

[0095] The second motor speed control module 20 is used to obtain the real-time sampling information of the second motor in the second interrupt period, perform speed loop calculation on the real-time sampling information of the second motor, output a second PWM signal based on the calculation result, and control the speed of the second motor;

[0096] The first motor position control module 30 is used to obtain the real-time sampling information of the first motor in the third interruption period, perform position loop calculation on the real-time sampling information of the first motor, and output a third PWM signal based on the calculation result to control the position of the first motor;

[0097] The second motor position control module 40 is used to obtain the real-time sampling information of the second motor in the fourth interrupt period, perform position loop calculation on the real-time sampling information of the second motor, and output a fourth PWM signal based on the calculation result to control the position of the second motor; the first interrupt period and the third interrupt period are separated by the second interrupt period or the fourth interrupt period.

[0098] The present application also provides a computer storage medium that can store multiple instructions, which are suitable for being loaded and executed by a processor as described above. Figure 1 to Figure 5 A control timing optimization method for a dual-axis low-voltage motor driver according to the embodiment shown in the figure can be found in Figure 1 to Figure 5 The specific description of the illustrated embodiment will not be repeated here.

[0099] See also Figure 6 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .

[0100] The communication bus 1002 is used to realize the connection and communication between these components.

[0101] The user interface 1003 may include a display screen (Display) and a camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.

[0102] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0103] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.

[0104] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Figure 6 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program of a control timing optimization method for a dual-axis low-voltage motor driver.

[0105] exist Figure 6In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call an application program stored in the memory 1005 for a control timing optimization method for a dual-axis low-voltage motor drive. When executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments.

[0106] An electronic device readable storage medium stores instructions, which, when executed by one or more processors, enable the electronic device to execute one or more of the methods described in the above embodiments.

[0107] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0108] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0109] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0110] 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, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0111] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0113] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, it will be easy for those skilled in the art to think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A control timing optimization method for a dual-axis low-voltage motor driver, characterized in that: Applied to a dual-axis low-voltage motor driver, the method comprises: In a first interruption cycle, real-time sampling information of a first motor is acquired, speed loop calculation is performed on the real-time sampling information of the first motor, and a first PWM signal is output based on the calculation result to control the speed of the first motor; In the second interruption period, real-time sampling information of the second motor is obtained, speed loop calculation is performed on the real-time sampling information of the second motor, a second PWM signal is output based on the calculation result, and the speed of the second motor is controlled; In a third interruption cycle, real-time sampling information of the first motor is acquired, position loop calculation is performed on the real-time sampling information of the first motor, and a third PWM signal is output based on the calculation result to control the position of the first motor; In a fourth interruption cycle, real-time sampling information of the second motor is acquired, position loop calculation is performed on the real-time sampling information of the second motor, and a fourth PWM signal is output based on the calculation result to control the position of the second motor; The first interruption period and the third interruption period are separated by the second interruption period or the fourth interruption period; Wherein, in the first interruption period, obtaining the real-time sampling information of the first motor includes: simultaneously obtaining the current sampling information and the position sampling information of the first motor at the start time of the first interruption period; Acquiring the real-time sampling information of the first motor in the third interruption period includes: acquiring the current sampling information and the position sampling information of the first motor at the start time of the third interruption period.

2. The method according to claim 1, characterized in that: The step of obtaining the real-time sampling information of the second motor in the second interruption period includes: At the start time of the second interruption period, simultaneously acquiring the current sampling information and the position sampling information of the second motor; The step of obtaining the real-time sampling information of the second motor in the fourth interruption cycle includes: At the start time of the fourth interruption period, the current sampling information and the position sampling information of the second motor are simultaneously acquired.

3. The method according to claim 1, characterized in that The dual-axis low-voltage motor driver further includes a first current sampling circuit and a first position feedback sensor, and the current sampling information and position sampling information of the first motor are simultaneously acquired at the start time of the first interruption cycle, including: Sending a current sampling signal to the first current sampling circuit at the start time of the first interruption cycle, and receiving current sampling information fed back by the first current sampling circuit based on the current sampling signal, wherein the current sampling information is the phase current of the first motor; At the start time of the first interruption period, a position acquisition signal is sent to the first position feedback sensor, and position sampling information fed back by the first position feedback sensor based on the position acquisition signal is received.

4. The method according to claim 2, characterized in that: The dual-axis low-voltage motor driver further includes a second current sampling circuit and a second position feedback sensor, and the current sampling information and position sampling information of the second motor are simultaneously acquired at the start time of the second interruption period, including: Sending a current sampling signal to the current sampling circuit at the start time of the second interruption cycle, and receiving current sampling information fed back by the second current sampling circuit, wherein the current sampling information is the phase current of the second motor; At the start time of the second interruption period, a position acquisition signal is sent to the position feedback sensor, and position sampling information fed back by the second position feedback sensor is received.

5. The method according to claim 1, characterized in that The dual-axis low-voltage motor driver further includes an analog-to-digital converter shared by the first motor and the second motor, and after simultaneously acquiring the current sampling information and the position sampling information of the first motor at the start time of the first interruption cycle, further includes: In the first interruption cycle or the third interruption cycle, controlling the analog-to-digital converter to perform analog-to-digital conversion processing on the current sampling information and the position sampling information of the first motor; The current sampling information and the position sampling information after analog-to-digital conversion are synchronously processed.

6. The method according to claim 2, characterized in that The dual-axis low-voltage motor driver further includes an analog-to-digital converter shared by the first motor and the second motor, and after simultaneously acquiring the current sampling information and the position sampling information of the second motor at the start time of the second interruption period, further includes: In the second interruption cycle or the fourth interruption cycle, controlling the analog-to-digital converter to perform analog-to-digital conversion processing on the current sampling information and the position sampling information of the second motor; The current sampling information and the position sampling information after analog-to-digital conversion are synchronously processed.

7. A control timing optimization device for a dual-axis low-voltage motor driver, characterized in that: Applicable to a dual-axis low-voltage motor driver, the device comprises: A first motor speed control module, used for obtaining real-time sampling information of the first motor in a first interruption period, performing speed loop calculation on the real-time sampling information of the first motor, and outputting a first PWM signal based on the calculation result to control the speed of the first motor; A second motor speed control module, used for obtaining real-time sampling information of the second motor in a second interrupt period, performing speed loop calculation on the real-time sampling information of the second motor, outputting a second PWM signal based on the calculation result, and controlling the speed of the second motor; A first motor position control module, configured to obtain real-time sampling information of the first motor in a third interruption period, perform position loop calculation on the real-time sampling information of the first motor, and output a third PWM signal based on the calculation result to control the position of the first motor; a second motor position control module, configured to obtain real-time sampling information of the second motor in a fourth interruption period, perform position loop calculation on the real-time sampling information of the second motor, and output a fourth PWM signal based on the calculation result to control the position of the second motor; The first interruption period and the third interruption period are separated by the second interruption period or the fourth interruption period; The first motor speed control module is used to obtain the real-time sampling information of the first motor in the following manner: simultaneously obtaining the current sampling information and the position sampling information of the first motor at the start time of the first interruption period; The first motor position control module is used to obtain the real-time sampling information of the first motor in the following manner: simultaneously obtaining the current sampling information and the position sampling information of the first motor at the start time of the third interruption period.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 6.

9. An electronic device, characterized in that: It includes a processor, a memory and a transceiver, the memory is used to store instructions, the transceiver is used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multi-axis servo drive synchronous control method, device and system

    CN115085595A

  • Multiaxis AC servo motor controlling means

    CN206283441U