A time prediction-based parameter table generation method for acceleration and deceleration curves of a stepper motor and a multi-motor motion control method

By generating a stepper motor acceleration and deceleration curve parameter table based on time prediction, the nonlinearity problem caused by timer period variation is solved, achieving smooth motor motion and high-precision control, while reducing heat generation and vibration.

CN119382560BActive Publication Date: 2025-12-05HUNAN GREATWALL INFORMATION FINANCIAL EQUIP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411315641.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-12-05
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

Existing technologies do not consider the timer period variation when generating stepper motor acceleration and deceleration curve tables, leading to nonlinearity issues and causing vibration and inaccurate positioning.

Method used

A stepper motor acceleration and deceleration curve parameter table is generated by a time prediction method. A specific running time is set, and the Sigmoid function is used for compensation calculation to generate a micro-step running time node value table. This table is then written into the timer auto-reload register to ensure that the stepper motor accurately adjusts its speed within the specified time.

Benefits of technology

It achieves smooth motor movement, reduces heat generation and vibration, reduces drive power, improves control accuracy, and avoids untimely motor response and stalling caused by speedometer deformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119382560B_ABST
    Figure CN119382560B_ABST
Patent Text Reader

Abstract

The application discloses a time prediction-based generation method of a step motor acceleration-deceleration curve parameter table and a multi-motor motion control method, and the generation method of the step motor acceleration-deceleration curve parameter table comprises the following steps: obtaining basic operation parameters of a step motor; performing compensation calculation on a Sigmoid function definition domain, an access speed and a target speed to obtain a S-shaped acceleration curve model function; calculating and obtaining micro-step operation time of a micro-step step number k according to the current micro-step step number k and a differential mode; adding the micro-step operation time of the first k-1 micro-step steps to the micro-step operation time of the micro-step step number k to obtain a time value of a time node of the current micro-step step number k, and then obtaining a micro-step operation time node value table, and then sequentially solving the micro-step operation time node value table in the S-shaped acceleration curve model function to obtain a step motor micro-step operation speed table; and then generating a corresponding acceleration-deceleration curve parameter table in combination with the differential mode and a single-chip microcomputer timer main frequency. The method adjusts the step motor from one speed to another speed by setting a specific operation time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of control, in particular to a time prediction-based stepping motor acceleration and deceleration curve parameter table generation method and a multi-motor motion control method. BACKGROUND

[0002] In automation and precision machinery applications, stepping motors need to quickly and smoothly transition from one speed to another. In the control process of stepping motors, a lookup table method is often used for acceleration and deceleration control. The acceleration and deceleration table represented by the "S" curve (also known as the Sigmoid curve) enables smooth motion of the stepping motor, effectively reduces heat and vibration, reduces the driving power of the stepping motor, and improves the control accuracy of the motor. The main purpose of the S-type curve acceleration and deceleration is to smoothly control the speed change of the motor during the acceleration and deceleration stages, avoiding the impact on the system when starting or stopping directly. However, when generating the S-type curve acceleration and deceleration curve table based on the lookup table method, a timer interrupt is usually used to obtain the speed value in the table. This method does not take into account the fixed step length (i.e. step angle or step distance) of the stepping motor, so after the timer updates the speed value, the timer period will also change, resulting in vibration or inaccurate positioning due to the non-linear problem in the acceleration and deceleration process. SUMMARY

[0003] The present application provides a time prediction-based stepping motor acceleration and deceleration curve parameter table generation method and a multi-motor control method, which is used to solve the technical problem of not considering the change of timer period in the process of generating the stepping motor acceleration and deceleration table by the classical lookup table method, and sets the stepping motor acceleration and deceleration parameter table generation method for adjusting from one speed to another speed within a specific running time.

[0004] In a first aspect, the present application provides a time prediction-based stepping motor acceleration and deceleration curve parameter table generation method, comprising:

[0005] S1: obtaining the stepping motor acceleration or deceleration running time T, the stepping motor microstep mode microstepmode, and the single-chip microcomputer timer main frequency F freq , the stepping motor access speed pps in (i.e. initial speed), and the target speed pps aim of the stepping motor acceleration or deceleration process;

[0006] S2: obtaining the Sigmoid function domain, performing compensation calculation on the Sigmoid function with the Sigmoid function domain, the stepping motor access speed, and the target speed of the stepping motor acceleration or deceleration process to obtain the stepping motor S-type acceleration curve model function;

[0007] S3: obtaining the micro-step running time of the micro-step number k according to the current micro-step number k and the step motor differential mode calculation in S1; wherein, k∈(1, K), K is the total micro-step number that the step motor needs to run from the access speed to the target speed;

[0008] S4: adding the micro-step running time of the previous k-1 micro-steps and the micro-step running time of the micro-step number k to obtain the time value of the time node of the current micro-step number k, and judging whether the current micro-step number k is K: if not, k=k+1, and returning to S3; if yes, obtaining the micro-step running time node value table based on all the micro-step running time node values, and entering S5;

[0009] S5: substituting the micro-step running time node value table into the step motor S-type acceleration curve model function in S2 to sequentially solve and obtain the step motor micro-step running speed table; wherein the step motor micro-step speed table includes an acceleration data table and a deceleration data table;

[0010] S6: combining the micro-step speed table, the differential mode of the step motor, and the main frequency of the single-chip microcomputer timer to generate the corresponding acceleration and deceleration curve parameter table (single-chip microcomputer automatic reload value), and the entire acceleration and deceleration curve parameter table set is the final output result, i.e., the step motor acceleration and deceleration curve parameter table (referred to as step motor acceleration and deceleration table).

[0011] By writing the above step motor acceleration and deceleration curve parameter table (referred to as step motor acceleration and deceleration table) into a storage medium, the controller uses the look-up table method to sequentially fill in the timer automatic reload register, which is used to control the period of the timer, so as to generate a pulse signal according to the period. The step motor driver drives the step motor to rotate a micro-step distance according to the pulse signal. By continuously filling the timer automatic reload register with the look-up table method, the step motor can accurately adjust from the access speed to the target speed (including acceleration and deceleration) within a specified time. This method considers the change of the movement period of the step motor in motion, corrects the error at the end of the domain of the Sigmiod function, solves the technical problems such as deformation of the acceleration table caused by the traditional look-up table method S-type curve method not considering the change of the micro-step running period (causing torque waste) and the error caused by the traditional look-up table method S-type curve method not considering the model domain, realizes smooth motion, effectively reduces heating and vibration, reduces the driving power of the step motor, and at the same time improves the control accuracy of the motor.

[0012] Further, the step motor S-type acceleration curve model function obtained by compensation calculation in S2 is:

[0013]

[0014] wherein, PPS in is the access speed of the step motor; PPSaim Target speed of the stepper motor for acceleration or deceleration process; t is time variable; T is set time of stepper motor acceleration or deceleration operation; Sigmoid (t) Speed of the stepper motor at t time.

[0015] Further, the microstep operation time of the microstep number k in S3 is:

[0016]

[0017] Wherein, t count (k) is the microstep operation time of the stepper motor at k microsteps; k represents the kth microstep time point; microstepmode is the microstep mode of the stepper motor; Sigmoid (t)k-1 Speed of the stepper motor at the k-1th microstep.

[0018] Further, the time value of each microstep time node in S4 is:

[0019]

[0020] Wherein, t sum (k) is the time value of the kth microstep time node.

[0021] Further, the microstep operation time node value table in S4 includes an acceleration data table and a deceleration data table, wherein the microstep operation time node value table is:

[0022]

[0023] Wherein, [TimesList] is the microstep speed table of the stepper motor; [] represents the data structure of computer storage speed table array, linked list or other sequential structure; [...] represents the expansion item of the above data structure;

[0024] The specific acquisition method of the acceleration data table is: in the acceleration process, PPS aim >PPS in When When the first time is met, or the total operation time t sum (K) >= T, the acceleration data table is generated and saved

[0025]

[0026] Wherein, [SigmoidPPSList] is the microstep speed table of the stepper motor; [] represents the data structure of computer storage speed table array, linked list or other sequential structure; [...] represents the expansion item of the above data structure;

[0027] The specific acquisition method of the deceleration data table is: during the deceleration process, the PPS aim <PPS in When When the first time is met, or the total running time t sum (K)>=T, stop recursively generating and saving the data table [SigmoidPPSList] of the deceleration process:

[0028]

[0029] Wherein, [SigmoidPPSList] is the microstep speed table of the stepper motor; [] represents the data structure of the array, linked list or other sequential structure of the computer storage speed table; [...] represents the expansion item of the above data structure; ε=Sigmoid (0) -PPS in

[0030] Further, the calculation formula of the single-chip microcomputer automatic reloading value is:

[0031]

[0032] Wherein, [Speedstables] is the acceleration and deceleration curve parameter table of the stepper motor (single-chip microcomputer automatic reloading value table); F freq Represents the main frequency of the single-chip microcomputer timer; microstepmodem represents the microstep mode of the stepper motor.

[0033] In a second aspect, the application provides a plurality of stepper motor linear motion control methods based on the time prediction-based stepper motor acceleration and deceleration curve parameter table generation method as described above, comprising:

[0034] Step 1: Take the reference stepper motor as the reference, and calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, wherein the calculation formula of the single-step transmission ratio is:

[0035]

[0036] Wherein, p a Is the single-step transmission ratio of the stepper motor a; x1 is the step angle of the reference stepper motor; x a Is the step angle of the stepper motor a; y1 is the mechanical transmission ratio of the reference stepper motor; y a Is the mechanical transmission ratio of the stepper motor a; Is the included angle between the running direction f1 of the reference stepper motor and the synthetic direction f of the speed vector of all stepper motors in the projection f' of the reference stepper motor and the stepper motor a running plane; The angle between the running direction f2 of the stepper motor a and the speed vector synthetic direction f of all the stepper motors in the reference stepper motor and the stepper motor a running plane projection f';

[0037] Step 2: Set the acceleration or deceleration running time T of the stepper motor a a equal to the acceleration or deceleration running time T1 of the reference stepper motor; the access speed PPS of the stepper motor a ina equal to the access speed of the reference stepper motor multiplied by the single-step transmission ratio PPS in1 ×p a ; the target speed PPS of the stepper motor a aima equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p a ;

[0038] Step 3: Generate the acceleration and deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor by using the time prediction-based stepper motor acceleration and deceleration curve parameter table generation method described above.

[0039] In a third aspect, the application provides a coaxial rotation motion control method for multiple stepper motors based on the time prediction-based stepper motor acceleration and deceleration curve parameter table generation method described above, comprising:

[0040] Step 1: Take the reference stepper motor as the reference, and calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, wherein the calculation formula of the single-step transmission ratio is:

[0041]

[0042] wherein p b is the single-step transmission ratio of the stepper motor b; x1 is the step pitch angle of the reference stepper motor; x b is the step pitch angle of the stepper motor b; y1 is the mechanical transmission ratio of the reference stepper motor; y b is the mechanical transmission ratio of the stepper motor b;

[0043] Step 2: Set the acceleration or deceleration running time T of the stepper motor b b equal to the acceleration or deceleration running time T1 of the reference stepper motor; the access speed PPS of the stepper motor b inb equal to the access speed of the reference stepper motor multiplied by the single-step transmission ratio PPS in1 ×p b ; the target speed PPS of the stepper motor b aimb equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p b ;

[0044] Step 3: Generate the acceleration and deceleration curve parameter table of each stepping motor except the reference motor by using the time prediction based stepping motor acceleration and deceleration curve parameter table generation method as described above.

[0045] Advantages

[0046] The present application provides a time prediction based stepping motor acceleration and deceleration curve parameter table generation method and a multi-motor motion control method. The time prediction based stepping motor acceleration and deceleration curve parameter table generation method has the following advantages:

[0047] (1) The stepping motor acceleration and deceleration curve parameter table generated by the method can ensure that the speed follows the S-shaped curve model when used in stepping motor speed control, preventing the adverse consequences of speed table distortion. The problem of rotor position out of synchronization with the given signal, resulting in locked rotor or out-of-step phenomenon, is avoided due to the motor's inability to respond to each pulse signal in time due to speed table distortion.

[0048] (2) The stepping motor acceleration and deceleration curve parameter table generated by the method can accurately calculate the required torque for acceleration when used in stepping motor speed control, avoiding energy waste and ensuring the motor's load carrying capacity during acceleration and deceleration. By reasonably designing the acceleration and deceleration curve, the motor speed can be smoothly changed, reducing mechanical impact and vibration, improving system stability, and ensuring that the motor can maintain sufficient torque output throughout the speed range to avoid jumping and unstable operation.

[0049] In addition, since the stepping motor acceleration and deceleration curve parameter table generated by the method well maintains the S-shaped curve model waveform, it can be used for multi-motor speed vector control in multi-motor linear motion systems, multi-motor coaxial rotation motion systems and other working conditions. Ensure that the multi-motor always runs in the correct vector direction. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0051] Figure 1 is the stepping motor working principle diagram provided by the present application;

[0052] Figure 2is a running step number-running speed schematic diagram of a commonly used S-shaped function based on a table lookup method provided by the embodiment of the present application, taking 1040 steps running at 200 pps to 2000 pps as an example;

[0053] Figure 3 is a speed diagram and a motor acceleration diagram when an S-shaped acceleration table is run without considering the change of a timer period, wherein (a) is a speed diagram when the S-shaped acceleration table is run, and (b) is a motor acceleration diagram using the acceleration table shown in (a);

[0054] Figure 4 is a speed diagram and a motor acceleration diagram when a step motor acceleration-deceleration curve parameter table is generated based on time prediction; wherein (a) is a speed diagram when the acceleration-deceleration table of the present application is run, and (b) is a motor acceleration diagram using the acceleration-deceleration table shown in (a);

[0055] Figure 5 is a flow chart of a step motor acceleration-deceleration curve parameter table generation method based on time prediction provided by the embodiment of the present application;

[0056] Figure 6 is a running direction diagram of a classical gantry system X, Y axis provided by the embodiment of the present application;

[0057] Figure 7 is a running direction diagram of a three-motor speed vector synthesis control system X, Y, Z axis provided by the embodiment of the present application;

[0058] Figure 8 is a card flipping mechanism diagram provided by the embodiment of the present application; wherein (a) is a card flipping mechanism perspective view; wherein (b) is a projection view of a first motor m1 side of the card flipping mechanism; and wherein (c) is a projection view of a second motor m2 side of the card flipping mechanism. DETAILED DESCRIPTION

[0059] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described in detail below. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0060] A step motor is an open-loop control element that converts an electric pulse signal into angular displacement or linear displacement, and its working principle is as follows Figure 1As shown (for example, a two-phase stepper motor), for each input pulse signal, the rotor rotates an angle or moves forward by a step, and the output angular displacement or linear displacement is proportional to the number of input pulses. The drive module converts the input signal into the drive signal of the stepper motor through the driver circuit of the stepper motor. The typical input signals of the drive module include PUL (input step control pulse signal), DIR (step motor movement direction control), and ENV (enable). The stepper motor driver circuit can use DRV8825, TMC2225 and its peripheral circuit, M332C stepper motor driver, etc.; the drive signal lines for driving the stepper motor include A+, A-, B+, B- (or ABCD). The driving mode of the stepper motor includes full-step driving and micro-step driving (subdivision), in the full-step driving mode, for each input pulse signal, the rotor rotates a fixed angle (called "step angle") or moves forward by a certain distance in the linear stepper motor, and the distance per step is fixed, which is related to the structural parameters of the motor. The micro-step driving mode is a technology for subdividing the step angle of the stepper motor, which allows the motor to rotate in smaller increments than full-step driving. In the micro-step driving mode, the stepper motor driver or stepper motor driving chip achieves fine control by precisely controlling the voltage and current; this technology uses current control to generate an intermediate magnetic field state between two full-step positions, allowing the motor to move more smoothly and enabling more accurate positioning. When the number of micro-steps set by the stepper motor driver circuit and the performance of the circuit differ, the response of the drive signal presents different waveforms, such as a square wave when the full-step driving mode is used, and a micro-sine wave when the micro-step driving mode is used.

[0061] In the control process of the stepper motor, the look-up table method is often used to control the acceleration and deceleration of the stepper motor. Among them, the acceleration and deceleration table represented by the "Sigmoid curve" (also known as S-shaped curve) enables the stepper motor to achieve smooth motion, effectively reduces heat and vibration, reduces the driving power of the stepper motor, and at the same time improves the control accuracy of the stepper motor. The main purpose of the S-shaped curve acceleration and deceleration is to smoothly control the speed change of the motor during the acceleration and deceleration stage, avoiding the impact on the system when starting or stopping directly. When generating the S-shaped curve acceleration and deceleration curve table based on the look-up table method, a timer interrupt is usually used to obtain the speed value in the table. This method does not consider that the step length (i.e. step angle or step distance) of the stepper motor is fixed, and when the timer updates the speed value, the period of the timer will also change, causing the actual speed time waveform of the stepper motor to change during acceleration or deceleration, increasing the torque required for the stepper motor to run, i.e. more energy is needed to change the speed of the stepper motor. For example Figure 2As shown in the figure, taking the commonly used "S" type (Sigmoid function) acceleration-deceleration algorithm as an example, the horizontal coordinate of the figure is the micro-step stepping number of the stepper motor, and the vertical coordinate is the speed (unit: steps / second-PPS) of the stepper motor; for the acceleration curve of 200 to 2000 PPS, taking the complete execution of 1040 steps as an example, when the speed is 200 PPS, the time for running one step is (1 step / 200 steps / second) 5ms, and when the speed is 2000 PPS, the time for running one step is (1 step / 2000 steps / second) 0.5ms. The speed diagram and motor acceleration diagram when running the S-type acceleration table without considering the change of timer period are as shown in the figure. Figure 3 Therefore, in order to solve the technical problem that the change of timer period is not considered in the process of generating the stepper motor acceleration-deceleration table by the classical lookup table method, the application provides a stepper motor acceleration-deceleration table generation method for adjusting from one speed to another speed by setting a specific running time, and the method is as follows:

[0062] Embodiment 1

[0063] As shown in the figure, the embodiment provides a stepper motor acceleration-deceleration curve parameter table generation method based on time prediction, which comprises: Figure 5

[0064] S1: obtaining the running time T of the stepper motor acceleration or deceleration, the microstep mode microstepmode (taking values of 1, 2, 4, 8, 16, 32, etc.) of the stepper motor, the main frequency F of the single-chip microcomputer timer freq , the access speed PPS of the stepper motor (i.e. the initial speed at the initial moment, unit: steps / second) in , and the target speed PPS (unit: steps / second) of the stepper motor acceleration or deceleration process. aim

[0065] S2: taking the definition domain of the Sigmoid function as the empirical value [-6, 6], compensating the Sigmoid function (typical acceleration curve equation of the stepper motor, i.e. Sigmoid curve) by taking the definition domain of the Sigmoid function, the access speed of the stepper motor, and the target speed of the stepper motor acceleration or deceleration process to obtain the stepper motor S-type acceleration curve model function.

[0066] The equation of the stepper motor typical acceleration curve (Sigmoid curve) is:

[0067]

[0068] Wherein, Sigmoid (t) represents the speed function (unit: steps / second) of the stepper motor, t∈[0,T]; then Here, the empirical value is taken; T is the running time of the stepper motor acceleration or deceleration; Δ is the Sigmoid function in the definition domain [-6, 6]; and the equation of the stepper motor typical acceleration curve (Sigmoid curve) is​​ Taking the function value of an infinitesimal and the Sigmoid function in The difference in function value when the value is -6, used to compensate for the initial speed PPS of the stepper motor in The difference of Sigmoid(0) at time 0 of the stepper motor (PPS in -Sigmoid (0) | Δ=0 ), the target speed PPS of the stepper motor aim The difference of Sigmoid(T) at time T of the stepper motor (PPS aim -Sigmoid (T) | Δ=0 ), the calculation of Δ takes into account the change of the motion period of the stepper motor in motion, and corrects the error at the end of the domain of the Sigmoid function. After compensation calculation, the Sigmoid function for time prediction of the stepper motor, i.e. the stepper motor S-type acceleration curve model function, is obtained:

[0069]

[0070] Where PPS in is the access speed of the stepper motor (unit: steps / sec); PPS aim is the target speed of the stepper motor during acceleration or deceleration (unit: steps / sec); t is the time variable; T is the set running time of the stepper motor during acceleration or deceleration; Sigmoid (t) is the speed of the stepper motor at time t (unit: steps / sec).

[0071] S3: Calculate the microstep running time of the microstep step number k according to the current microstep step number k and the stepper motor differential mode described in S1; wherein k∈(1,K), K is the total microstep step number of the stepper motor from the access speed to the target speed.

[0072] Specifically, the microstep running time of the microstep step number k is:

[0073]

[0074] Where t count (k) is the microstep running time of the stepper motor at the kth microstep; k represents the kth microstep time point; microstepmode is the differential mode of the stepper motor; Sigmoid (t)k-1 is the speed of the stepper motor at the (k-1)th microstep.

[0075] S4: add the microstep running time of the previous k-1 microsteps to the microstep running time of the microstep step number k to obtain the time value of the time node of the current microstep step number k, and determine whether the current microstep step number k is K: if not, k=k+1, and return to S3; if yes, obtain the microstep running time node value table based on all the microstep running time node values, and enter S5.

[0076] Specifically, the time value of each microstep time node is:

[0077]

[0078] wherein, t sum (k) is the time value of the time node of the kth microstep.

[0079] Since the microstep period of the stepper motor is discrete, the formula of the time value of each microstep time node can be approximately simplified as follows:

[0080]

[0081] wherein, t sum (k) is the time value of each microstep time node; is the speed of the stepper motor at the kth microstep time point; n is the step number of the microstep, used for microstep time accumulation and counting (in the formula, the counting is from n=0 to n=k-1); microstepmode is the microstep mode of the stepper motor.

[0082] S5: substitute the microstep running time node value table into the stepper motor S-shaped acceleration curve model function in S2 to sequentially solve to obtain a stepper motor microstep running speed table; wherein the stepper motor microstep speed table includes an acceleration data table and a deceleration data table.

[0083] Specifically, the microstep running time node value table is:

[0084]

[0085] wherein, [TimesList] is the stepper motor microstep speed table; [] represents the data structure of an array, a linked list or other sequential structure of a computer storage speed table; [...] represents the expansion item of the above data structure;

[0086] The specific acquisition method of the acceleration data table is as follows: during the acceleration process, PPS aim >PPS in , when When the first time is met, or the total running time t sum (K)>=T, the acceleration data table is generated and saved

[0087]

[0088] wherein [SigmoidPPSList] is a micro-step speed table of the stepper motor; [] represents a data structure of an array, a linked list or other sequential structure in which the computer stores the speed table; [...] represents an expansion item of the above data structure; ε = Sigmoid (0) -PPS in .

[0089] The specific acquisition method of the deceleration data table is: during the deceleration process, the PPS aim <PPS in , when When the first time is met, or the total running time t sum (K)> = t, stop recursively generating and saving the data table [SigmoidPPSList] of the deceleration process:

[0090]

[0091] wherein [SigmoidPPSList] is a micro-step speed table of the stepper motor; [] represents a data structure of an array, a linked list or other sequential structure in which the computer stores the speed table; [...] represents an expansion item of the above data structure; ε = Sigmoid (0) -PPS in .

[0092] S6: Generate corresponding acceleration and deceleration curve parameter table (single-chip microcomputer automatic reloading value) in combination with the micro-step speed table, the differential mode of the stepper motor and the main frequency of the single-chip microcomputer timer. The entire set of acceleration and deceleration curve parameter table is the final output result, that is, the stepper motor acceleration and deceleration curve parameter table (referred to as stepper motor acceleration and deceleration table).

[0093] wherein the calculation formula of the single-chip microcomputer automatic reloading value is:

[0094]

[0095] wherein [Speedstables] is a stepper motor acceleration and deceleration curve parameter table (single-chip microcomputer automatic reloading value table, pulse half-cycle time, pulse duty cycle is 50%, used for table lookup method to fill into the single-chip microcomputer automatic reloading register in turn); F freqThis indicates the main frequency of the microcontroller's timer; microstepmode indicates the differential mode of the stepper motor. By writing the above stepper motor acceleration and deceleration curve parameter table (referred to as the stepper motor acceleration and deceleration table) into the storage medium, the controller uses a lookup method to sequentially fill the timer's automatic reload register, enabling the stepper motor to accurately adjust from the entry speed to the target speed (including acceleration and deceleration) within a specified time. This achieves smooth motion, effectively reduces heat generation and vibration, reduces the stepper motor drive power, and improves the motor's control accuracy.

[0096] The speed diagram and motor acceleration diagram generated based on the method described in this embodiment are as follows: Figure 4 As shown. By using with Figure 3 The comparison revealed that the torque required by using the undeformed "S-shaped acceleration curve" is much smaller than that of the deformed "S-shaped acceleration curve". Therefore, under the same conditions, the stepper motor using the acceleration and deceleration curve parameter table generated in this embodiment loses less torque during acceleration and deceleration. This has the beneficial effects of increased load-carrying capacity during acceleration and deceleration, fewer steps to complete acceleration and deceleration, or increased maximum acceleration speed.

[0097] Example 2

[0098] This embodiment provides a method for controlling the linear motion of multiple stepper motors using the stepper motor acceleration / deceleration curve parameter table generation method based on time prediction as described above, including:

[0099] Step 1: Using the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor. The formula for calculating the single-step transmission ratio is:

[0100]

[0101] Where, p a x is the single-step transmission ratio of stepper motor a; x1 is the step angle of the reference stepper motor; x a y1 is the step angle of stepper motor a; y2 is the mechanical transmission ratio of the reference stepper motor; y3 is the step angle of stepper motor a. a Let be the mechanical transmission ratio of stepper motor a; The angle between the running direction f1 of the reference stepper motor and the composite velocity vector f of all stepper motors, projected onto the running plane of the reference stepper motor and stepper motor a, is f'. Let f' be the angle between the running direction f2 of stepper motor a and the composite velocity vector f of all stepper motors, projected onto the running plane of the reference stepper motor and stepper motor a.

[0102] Step 2: Set the acceleration or deceleration time T of stepper motor a aEqual to the acceleration or deceleration running time T1 of the reference stepper motor; the access speed PPS of the stepper motor a ina Equal to the access speed PPS of the reference stepper motor multiplied by the single-step transmission ratio in1 ×p a ; the target speed PPS of the stepper motor a aima Equal to the target speed PPS of the reference stepper motor multiplied by the single-step transmission ratio aim1 ×p a ;

[0103] Step 3: Generate the acceleration and deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor by using the time prediction-based stepper motor acceleration and deceleration curve parameter table generation method as described above.

[0104] In order to further illustrate the method, taking two stepper motors (the first motor m1 (the same as the above reference motor), the second motor m2 (the same as the stepper motor a)) and a trolley mechanism c1 as an example, the method is described in detail:

[0105] As shown in Figure 6 is a schematic diagram of the running direction of the X and Y axes of a classic gantry system: wherein f1 represents the running direction of the first motor m1, f2 represents the running direction of the second motor m2, and f represents the running direction of the gantry trolley mechanism c1.

[0106] The included angle of the running direction of the X and Y axes is determined according to the actual implementation mode, and the classic value is 90°. In order to realize the running of the gantry trolley mechanism c1 along the running direction f, the speed vector is decomposed from the f direction to the f1 and f2 directions to obtain the running speeds of the first motor m1 and the second motor m2 in a proportional relationship, and the proportional coefficient is the single-step transmission ratio of the two (considering the step pitch angle difference).

[0107] In the running process, the access speed, target speed, and running step number of the first motor m1 and the second motor m2 are the same as the single-step transmission ratio; the running time of the first motor m1 and the second motor m2 is the same. The stepper motor acceleration and deceleration curve parameter table of the first motor m1 and the second motor m2 is generated based on the time prediction-based stepper motor acceleration and deceleration curve parameter table generation method as described above. If the step pitch angle of the first motor m1 is x1, the step pitch angle of the second motor m2 is x2, the mechanical transmission ratio of the first motor m1 is y1, the mechanical transmission ratio of the second motor m2 is y2, the included angle between the running direction f1 of the first motor m1 and the running direction f is the included angle between the running direction f2 of the second motor m2 and the running direction f is then the single-step transmission ratio Specifically,

[0108] Taking the first motor m1 as the reference stepper motor, the acceleration or deceleration running step number stepsm1 Stepper motor acceleration or deceleration time unit nT; Stepper motor differential mode (microstepmode) m1 The main frequency of the microcontroller's timer is F. freq_m1 Stepper motor entry speed (PPS) in_m1 (Initial velocity at the initial moment, unit: steps / second), target velocity (PPS) during the acceleration or deceleration process of the stepper motor. aim_m1 (Unit: steps / second). And calculate the acceleration or deceleration parameters for the first motor m1 [Speedstables]. m1 ];

[0109] Get the acceleration or deceleration steps of the second motor m2. m2 Stepper motor acceleration or deceleration time unit nT; Stepper motor differential mode (microstepmode) m2 The main frequency of the microcontroller's timer is F. freq_m2 Stepper motor entry speed (PPS) in_m2 (Initial velocity at the initial moment, unit: steps / second), target velocity (PPS) during the acceleration or deceleration process of the stepper motor. aim_m2 Calculate the acceleration or deceleration parameters of the second motor m2 [Speedstables] m2 ];

[0110] The acceleration or deceleration steps of the second motor m2 are ste[s] m2 Equals the number of acceleration or deceleration steps of the first motor m1 multiplied by the single-step transmission ratio steps m1 ×p; the entry speed (PPS) of the second motor m2 in_m2 Equals the entry speed of the first motor m1 multiplied by the single-step transmission ratio PPS in_m1 ×p, the target speed PPS of the second motor m2 aim_m2 Equals the target speed of the first motor m1 multiplied by the single-step transmission ratio PPS aim_m1 ×p. By referring to the above stepper motor acceleration / deceleration curve parameter table ([Speedstables...) m1 [Speedstables] m2 The data is written into the storage medium and then sequentially filled into the timer automatic reload register by the controller using a lookup table method. This controls the first motor m1 and the second motor m2 to move simultaneously, thus solving the problem of speed vector synthesis for two or more motors.

[0111] This embodiment can be extended to the velocity vector synthesis of multiple motors, such as Figure 7As shown, taking the speed vector synthesis of three motors as an example, a reference motor is selected as the first motor m1 according to the method of this embodiment, which is used to obtain different single-step transmission ratios p1 and p2. The corresponding stepper motor acceleration and deceleration curve parameter table ([Speedstables]) is obtained and calculated using the method of this embodiment. m1 [Speedstables] m2 It is worth noting that... Figure 7 As shown, when calculating the single-step transmission ratio p1 of stepper motor m2 using the first motor m1, the included angle is the angle between the projection f' of the trolley direction f onto the running plane of the first motor m1 and the second motor m2; when calculating the single-step transmission ratio p2 of stepper motor m3 using the reference motor m1, the included angle is the angle between the projection f” of the trolley direction f onto the running plane of the first motor m1 and the third motor m3.

[0112] Example 3

[0113] This embodiment provides a method for controlling the coaxial rotational motion of multiple stepper motors using the stepper motor acceleration / deceleration curve parameter table generation method described above, including:

[0114] Step 1: Using the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor. The formula for calculating the single-step transmission ratio is:

[0115]

[0116] Where, p b x is the single-step transmission ratio of stepper motor b; x1 is the step angle of the reference stepper motor; x b y1 is the step angle of stepper motor b; y2 is the mechanical transmission ratio of the reference stepper motor; y3 is the step angle of stepper motor b. b Let be the mechanical transmission ratio of stepper motor b;

[0117] Step 2: Set the acceleration or deceleration time T of stepper motor b b Equal to the acceleration or deceleration time T1 of the reference stepper motor; the entry speed PPS of stepper motor b. inb Equals the entry speed of the reference stepper motor multiplied by the single-step transmission ratio (PPS) in1 ×p b Target speed PPS of stepper motor b aimb Equals the target speed of the reference stepper motor multiplied by the single-step transmission ratio (PPS) aim1 ×p b ;

[0118] Step 3: Use the time prediction-based stepper motor acceleration / deceleration curve parameter table generation method described above to generate the acceleration / deceleration curve parameter table for the reference motor and each stepper motor other than the reference motor.

[0119] To further illustrate the method, a card flipping mechanism is used as an example for detailed explanation, such as... Figure 7 As shown, it includes a first motor m1 (same as the reference motor as described above), a second motor m2 (same as the stepper motor b as described above), a flipping mechanism 1, a card shifting gear 2, and a target card 3. m1-1 is the drive shaft of the first motor m1, m2-1 is the drive shaft of the second motor m2, 1-1 is a side projection view of the first motor m1, and 1-2 is a side projection view of the second motor m2.

[0120] To ensure the ability to move the card and perform functions such as card flipping, the transmission shafts of the first motor m1 and the second motor m2 are coaxial. When the first motor m1 drives the flipping mechanism to rotate, the second motor m2 remains stationary. If the running speeds of the first motor m1 and the second motor m2 are proportional, the proportionality coefficient is the transmission ratio between the two (considering the difference in step angle).

[0121] During operation, the entry speed, target speed, and number of steps for both the first motor m1 and the second motor m2 are the same as the transmission ratio; the running time for both motors m1 and m2 is the same. Based on the time-prediction-based stepper motor acceleration / deceleration curve parameter table generation method proposed in this invention, the stepper motor acceleration / deceleration curve parameter tables for the first motor m1 and the second motor m2 are generated. Specifically:

[0122] If the step angle of the first motor m1 is x1 and the step angle of the second motor m2 is x2, and the mechanical transmission ratio of the first motor m1 is y1 and the mechanical transmission ratio of the second motor m2 is y2, then the single-step transmission ratio...

[0123] Using the first motor m1 as a reference, obtain the acceleration or deceleration steps of the first motor m1. m1 Stepper motor acceleration or deceleration time unit nT; Stepper motor differential mode (microstepmode) m1 The main frequency of the microcontroller's timer is F. freq_m1 Stepper motor entry speed (PPS) in_m1 (Initial velocity at the initial moment, unit: steps / second), target velocity (PPS) during the acceleration or deceleration process of the stepper motor. aim_m1 (Unit: steps / second). And calculate the acceleration or deceleration parameters for the first motor m1 [Speedstables]. m1 ];

[0124] Get the acceleration or deceleration steps of the second motor m2. m2 Stepper motor acceleration or deceleration time unit nT; Stepper motor differential mode (microstepmode) m2, single-chip microcomputer timer main frequency F freq_m2 , stepper motor access speed PPS in_m2 (ie, the initial moment of the initial speed, units: steps / second), the target speed PPS of the stepper motor acceleration or deceleration process aim_m2 Calculate the second motor m2 acceleration or deceleration parameter table [Speedstables m2 ];

[0125] Where the number of steps of the second motor m2 acceleration or deceleration operation steps m2 Equal to the number of steps of the first motor m1 acceleration or deceleration operation steps m1 ×p; the access speed PPS of the second motor m2 in_m2 Equal to the access speed of the first motor m1 multiplied by the single-step transmission ratio PPS in_m1 ×p, the target speed PPS of the second motor m2 aim_m2 Equal to the target speed of the first motor m1 multiplied by the single-step transmission ratio PPS aim_m1 ×p.

[0126] By writing the above stepper motor acceleration and deceleration curve parameter table ([Speedstables m1 ], [Speedstables m2 ]) into the storage medium, the controller uses the look-up table method to fill in the timer automatic reload register in turn, controls the first motor m1 and the second motor m2 to move simultaneously, and solves the problem of vector synthesis of the rotation speed of two coaxial motors.

[0127] This embodiment can be extended to the speed vector synthesis of multiple motors, but the main working condition is the double motor type, and the calculation method of this embodiment double motor is not detailed.

[0128] It should be understood that in the embodiments of the present application, the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The memory can include a read-only memory and a random access memory, and provide instructions and data for the processor. A portion of the memory can also include a non-volatile random access memory. For example, the memory can also store device type information.

[0129] The readable storage medium is a computer readable storage medium, which can be an internal storage unit of the controller, such as a hard disk or a memory of the controller. The readable storage medium can also be an external storage device of the controller, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Further, the readable storage medium can include both the internal storage unit and the external storage device of the controller. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium can also be used to temporarily store data that has been output or will be output.

[0130] Based on such understanding, the technical solutions of the present application, essentially or in the contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned readable storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0131] It can be understood that the same or similar parts in the above-mentioned embodiments can be mutually referenced, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0132] Although the embodiments of the present application have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and the ordinary skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.

Claims

1. A method for generating a parameter table of a time-predicted acceleration / deceleration curve of a stepper motor, characterized by, Comprising: S1: obtaining the acceleration or deceleration running time of the stepper motor, the differential mode of the stepper motor, the main frequency of the single-chip microcomputer timer, the target speed of the stepper motor acceleration or deceleration process, and the access speed of the stepper motor, i.e. the initial speed; S2: obtaining the definition domain of the Sigmoid function, and performing compensation calculation on the Sigmoid function with the definition domain of the Sigmoid function, the access speed of the stepper motor, and the target speed of the stepper motor acceleration or deceleration process to obtain a stepper motor S-type acceleration curve model function; S3: calculating the micro-step running time of the micro-step step number k according to the differential mode of the stepper motor in S1; wherein k∈(1,K), K is the total micro-step step number required for the stepper motor to run from the access speed to the target speed; S4: adding the micro-step running time of the first k-1 micro-steps to the micro-step running time of the micro-step step number k to obtain the time value of the time node of the current micro-step step number k, and determining whether the current micro-step step number k is K: if not, k=k+1, and returning to S3; if yes, obtaining a micro-step running time node value table based on all the micro-step running time node values, and entering S5; S5: substituting the micro-step running time node value table into the stepper motor S-type acceleration curve model function in S2 to sequentially solve to obtain a stepper motor micro-step speed table; wherein the stepper motor micro-step speed table includes an acceleration data table and a deceleration data table; S6: combining the micro-step speed table, the differential mode of the stepper motor, and the main frequency of the single-chip microcomputer timer to generate a corresponding acceleration and deceleration curve parameter table, and the set of the entire acceleration and deceleration curve parameter table is the final output result, i.e. the stepper motor acceleration and deceleration curve parameter table.

2. The method of claim 1, wherein, The stepper motor S-type acceleration curve model function obtained by compensation calculation in S2 is: where PPS in is the step motor's admission speed; PPS aim is the target speed of the step motor acceleration or deceleration process; t is the time variable; T is the set step motor acceleration or deceleration run time; Sigmoid (t) is the step motor's speed at time t.

3. The method of claim 1, wherein the method further comprises: The micro-step running time of the micro-step step number k in S3 is: wherein t count (k) is the microstep run time of the stepper motor in k microsteps; k represents the kth microstep time point; microstepmode is the microstep mode of the stepper motor; Sigmoid (t)k-1 is the speed of the stepper motor at the k-1th microstep.

4. The method of claim 1, wherein, The time value of each micro-step time node in S4 is: wherein t sum (k) is the time value of the time node of the kth microstep; microstep mode is the microstep mode of the stepper motor.

5. The method of claim 1, wherein, The micro-step running time node value table is: Wherein, [TimesList] is the stepper motor micro-step speed table; [] represents the data structure of the computer storage speed table array, linked list or other sequential structure; [...] represents the expansion item of the above data structure; The specific acquisition method of the acceleration data table is: during the acceleration process, the PPS aim >PPS in When The acceleration data table [SigmoidPPSList] is generated and saved when the first time meets or the total running time t sum (K)>=T: Wherein, [SigmoidPPSList] is a step motor micro-step speed table; [] represents a data structure of an array, a linked list or other sequential structure in which a computer stores a speed table; and [...] represents an expansion item of the above data structure. The specific acquisition method of the deceleration data table is: during the deceleration process, the PPS aim <PPS in When When the first time, or the total running time t sum (K) = T, stop recursively generating and saving the data table [SigmoidPPSList] of the deceleration process: Wherein, [SigmoidPPSList] is a micro-step speed table of a stepper motor; [] represents a data structure of an array, a linked list or other sequential structure in which a computer stores a speed table; [...] represents an expansion item of the above data structure; ε = Sigmoid (0) -PPS in .

6. The method of claim 1, wherein, The calculation formula of the single-chip automatic reloading value is: Wherein, [Speedstables] is the parameter table of the stepping motor acceleration and deceleration curve (single-chip automatic reloading value table); F freq Indicates the main frequency of the single-chip timer; microstepmode indicates the stepping motor microstep mode.

7. A method for linear motion control of a plurality of stepper motors based on the method of any one of claims 1-6, characterized by, Comprising: Step 1: taking the reference stepper motor as a reference, calculating the single-step transmission ratio of each stepper motor other than the reference stepper motor, wherein the calculation formula of the single-step transmission ratio is: Wherein, p a is the single-step transmission ratio of the stepper motor a; x1 is the step angle of the reference stepper motor; x a is the step angle of the stepper motor a; y1 is the mechanical transmission ratio of the reference stepper motor; y a is the mechanical transmission ratio of the stepper motor a; is the included angle between the running direction f1 of the reference stepper motor and the resultant direction f of the speed vectors of all the stepper motors in the projection f' of the running plane of the reference stepper motor and the stepper motor a; is the included angle between the running direction f2 of the stepper motor a and the resultant direction f of the speed vectors of all the stepper motors in the projection f' of the running plane of the reference stepper motor and the stepper motor a; Step 2: Set the acceleration or deceleration run time T of the stepper motor a a equal to the acceleration or deceleration run time Tl of the reference stepper motor; the access speed PPS of the stepper motor a ina equal to the access speed of the reference stepper motor multiplied by the single step drive ratio PPS in1 x p a ; the target speed PPS of the stepper motor a aima equal to the target speed of the reference stepper motor multiplied by the single step drive ratio PPS aim1 x p a ; Step 3: generating the acceleration and deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor by using the method of any one of claims 1-6.

8. A method for controlling the rotational movement of a plurality of stepper motors coaxially based on the method of any one of claims 1-6, characterized by, Comprising: Step 1: taking the reference stepper motor as a reference, calculating the single-step transmission ratio of each stepper motor other than the reference stepper motor, wherein the calculation formula of the single-step transmission ratio is: wherein p b is the single step transmission ratio of the stepper motor b; x1 is the step angle of the reference stepper motor; x b is the step angle of the stepper motor b; y1 is the mechanical transmission ratio of the reference stepper motor; y b is the mechanical transmission ratio of the stepper motor b; Step 2: Set the acceleration or deceleration run time T of the stepper motor b b equal to the acceleration or deceleration run time T1 of the reference stepper motor; the access speed PPS of the stepper motor b inb equal to the access speed of the reference stepper motor multiplied by the single step transmission ratio PPS in1 × p b ; the target speed PPS of the stepper motor b aimb equal to the target speed of the reference stepper motor multiplied by the single step transmission ratio PPS aim1 × p b ; Step 3: generating the acceleration and deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor by using the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Stepping motor acceleration and deceleration control method

    CN106341063A

  • Control method and system of multiple stepping motors based on embedded processor

    CN108923706A