Trigonometric function acceleration and deceleration control method of stepping motor

Through the trigonometric function acceleration and deceleration control method, the acceleration curve of the stepper motor is dynamically adjusted, which solves the problems of inaccurate positioning and unstable motion in traditional control algorithms, achieves higher positioning accuracy and response speed, and reduces jitter and improves the overall performance of the system.

CN120034049AActive Publication Date: 2025-05-23GUANGZHOU YAJIANG PHOTOELECTRIC EQUIP CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510062942.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-23
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The traditional stepper motor control algorithm uses fixed acceleration and deceleration in motion planning, resulting in overshoot or inaccurate positioning when moving at small distances, insufficient response speed when moving at large distances, and neglect the continuity of the rapid motion, resulting in unstable motor movement.

Method used

The trigonometric function acceleration and deceleration control method is adopted, and the acceleration and deceleration control parameters are initialized by obtaining the distance to be moved and the expected reaction rate, and the acceleration and deceleration control parameters are initialized, and the rush degree is simulated as the sinusoidal curve. The numerical integral is used to obtain the velocity equation, and the difference is taken as the actual velocity equation, and the stepper motor is controlled according to the velocity planning curve.

Benefits of technology

It realizes dynamic adjustment of the acceleration curve according to the motion distance, ensures continuous urgency, improves the positioning accuracy and response speed of the motor, reduces jitter during the motion, and improves the operating efficiency and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034049A_ABST
    Figure CN120034049A_ABST
Patent Text Reader

Abstract

The invention relates to the field of stepping motor control, in particular to a stepping motor trigonometric function acceleration and deceleration control method, which mainly comprises the following steps: acquiring a to-be-moved distance and an expected reaction rate of a stepping motor, and initializing acceleration and deceleration control parameters of the stepping motor; based on the acceleration and deceleration control parameters, a sine function is adopted to simulate the jerk of the stepping motor into a sine curve, and a jerk equation describing the change relation of the change rate of the acceleration of the stepping motor along with time is obtained; numerical integration is conducted on the jerk equation to obtain a speed equation, the first-order difference of the speed equation is taken as an actual speed equation, and the actual speed equation describes the change relation of the motor speed along with time; and controlling the stepping motor according to the speed planning curve. The method is high in real-time performance, simple in calculation and continuous in jerk, has different reaction speeds for different distances, and can enable the stepping motor to accurately reach a target point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of stepper motor control, and in particular to a trigonometric function acceleration and deceleration control method for a stepper motor. Background Art

[0002] Traditional stepper motor control algorithms, such as trapezoidal acceleration and deceleration algorithms and S-shaped acceleration and deceleration algorithms, mostly use fixed acceleration and deceleration for motion planning. However, this fixed acceleration and deceleration mode has obvious limitations: when moving a small distance, the motor may reach the target position too quickly due to excessive acceleration, resulting in overshoot or inaccurate positioning; when moving a large distance, the motor's response speed may not meet the needs of fast positioning. In addition, since the actual movement of the stepper motor is discrete, and traditional acceleration and deceleration algorithms are usually based on continuous mathematical models (such as integration) for speed planning, this will lead to a certain deviation between theoretical and actual movement, further affecting positioning accuracy.

[0003] More importantly, traditional acceleration and deceleration algorithms often ignore the continuity of jerk (i.e. the rate of change of acceleration). The discontinuity of jerk will cause the motor to vibrate during movement, affecting the smoothness of movement. This kind of jitter is unacceptable, especially in some application scenarios that require extremely high movement smoothness, such as precision machining, robot joint control, etc.

[0004] Therefore, there is an urgent need for a stepper motor acceleration and deceleration control algorithm that can dynamically adjust the acceleration curve according to the movement distance and ensure the continuity of jerk. This algorithm can not only improve the positioning accuracy and response speed of the motor, but also effectively reduce the jitter during the movement process, and improve the operating efficiency and stability of the entire system. Summary of the invention

[0005] The present application provides a trigonometric function acceleration and deceleration control method for a stepper motor, which can dynamically adjust the response speed according to the distance to be moved by the stepper motor and enable the motor to reach the target point accurately.

[0006] In order to achieve the above object, the present invention adopts the following technical scheme:

[0007] In a first aspect, the present invention provides a trigonometric function acceleration and deceleration control method for a stepping motor, comprising:

[0008] Get the distance to be moved and the expected reaction rate of the stepper motor, and initialize the acceleration and deceleration control parameters of the stepper motor;

[0009] Based on the acceleration and deceleration control parameters, a sine function is used to simulate the jerk of the stepper motor as a sine curve, and a jerk equation describing the relationship between the rate of change of the acceleration of the stepper motor and time is obtained;

[0010] Numerically integrating the jerk equation to obtain a speed equation, taking the first-order difference of the speed equation as an actual speed equation, wherein the actual speed equation describes the relationship between the motor speed and time;

[0011] Calculating the value of the constant of the acceleration / deceleration control parameter in the actual speed equation according to the distance to be moved;

[0012] According to the expected reaction rate, the slope of the actual speed equation is set to obtain a speed planning curve;

[0013] The stepper motor is controlled according to the speed planning curve.

[0014] In a preferred example of the present application, it can be further configured to include:

[0015] Obtaining a preset distance threshold, and when the distance to be moved is greater than the preset distance threshold, calculating the uniform speed movement time of the motor;

[0016] Combined with the actual speed equation, a speed planning curve including a uniform speed time period is obtained.

[0017] In a preferred example of the present application, it can be further set as follows: the expression of the jerk equation is for:

[0018]

[0019] Δt 1 =tt 1 ;

[0020] Among them, t is the movement time of the stepper motor, a 1 is the maximum acceleration during the actual acceleration process, a 2 is the maximum acceleration during the actual deceleration process, v max is the maximum speed reached during actual operation, t 0 =0,t 1 is the total acceleration time, t 2 is the total deceleration time, ω i To represent ω 1 and ω 2 The intermediate parameter, a i Indicates a 1 、a 2 .

[0021] In a preferred example of the present application, it can be further set that the expression v(t) of the actual speed equation is:

[0022]

[0023] In a preferred example of the present application, it can be further set that the acceleration and deceleration control parameters include constants and variables, wherein the constants include the maximum speed V of the motor. max , the maximum acceleration A during the process of the motor accelerating from rest to maximum speed 1 , the total time of acceleration T 1 , the motor is from V max The acceleration from deceleration to stop is A 2 , the total time of deceleration is T 2 , the motor running distance S during the whole acceleration and deceleration process max .

[0024] In a preferred example of the present application, it can be further set that the expression v(t) of the speed planning curve including the uniform speed time period is:

[0025]

[0026] Δt 1,c =tT 1 -T c ;

[0027] Among them, T i Indicates T 1 , T 2 , T c It indicates the time during which the motor moves at a constant speed.

[0028] In a second aspect, the present application provides a trigonometric function acceleration and deceleration control device for a stepping motor, the device comprising:

[0029] The data acquisition module is used to obtain the distance to be moved and the expected reaction rate of the stepper motor, and initialize the acceleration and deceleration control parameters of the stepper motor;

[0030] A jerk module, used to simulate the jerk of the stepper motor as a sine curve using a sine function based on the acceleration and deceleration control parameters, and obtain a jerk equation describing the relationship between the rate of change of the acceleration of the stepper motor and time;

[0031] A speed module, used for numerically integrating the jerk equation to obtain a speed equation, taking the first-order difference of the speed equation as an actual speed equation, wherein the actual speed equation describes the relationship between the motor speed and time;

[0032] The control module is used to calculate the value of the acceleration and deceleration control parameter in the actual speed equation according to the distance to be moved; set the slope of the actual speed equation according to the expected reaction rate to obtain a speed planning curve; and control the stepper motor according to the speed planning curve.

[0033] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the trigonometric function acceleration and deceleration control method for a stepper motor as described in any one of the above items are implemented.

[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the trigonometric function acceleration and deceleration control method of a stepper motor as described in any one of the above items is implemented.

[0035] In a fifth aspect, the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the trigonometric function acceleration and deceleration control method for a stepper motor as described in any one of the above items.

[0036] In summary, compared with the prior art, the technical solution provided in the embodiment of the present application has at least the following beneficial effects:

[0037] The method of the present application has strong real-time performance, simple calculation, continuous jerk, different reaction speeds for different distances, and can enable the stepper motor to accurately reach the target point. It can be applied to the acceleration and deceleration movement of equipment such as moving head lights, improving the motion control performance of the stepper motor. At the same time, the speed planning curve obtained by differential in the present method can not only meet the maximum acceleration and continuous jerk restrictions, but also can accurately reach the target point, ensuring the accuracy of the acceleration and deceleration planning. Moreover, the control method of the present application can realize the control of the reaction rate at different distances by selecting different slope functions, so that the method can adapt to the needs of different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a trigonometric function acceleration and deceleration control method for a stepper motor provided in one embodiment of the present application.

[0039] Figure 2 A structural diagram of a trigonometric function acceleration and deceleration control device for a stepper motor provided in one embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] In one embodiment of the present application, a trigonometric function acceleration and deceleration control method for a stepper motor is provided. Figure 1 As shown, the method includes:

[0042] S100: Obtain the distance to be moved and the expected reaction rate of the stepper motor, and initialize the acceleration and deceleration control parameters of the stepper motor.

[0043] Specifically, the distance to be moved is the distance that the user wants the stepper motor to perform acceleration and deceleration movement. The acceleration and deceleration control parameters include constant parameters and variables. The constants include at least: the maximum speed V of the motor max ; The motor accelerates from standstill to V max The maximum acceleration during the process is A 1 The total time spent is T 1 ; The motor starts at the highest speed V max The acceleration from deceleration to stop is A 2 The total time spent is T 2 ; The motor running distance during the entire acceleration and deceleration process is S max The variables include: the maximum speed v to which the motor actually accelerates when running max , the maximum acceleration a during the actual acceleration process 1 , the maximum acceleration a during the actual deceleration process 2 , actual total acceleration time t 1 , actual deceleration total time t 2 ; The actual motor running distance s during acceleration and deceleration.

[0044] The distance to be moved is taken as the motor running distance s during the actual acceleration and deceleration process.

[0045] S200: Based on the acceleration / deceleration control parameters, a sine function is used to simulate the jerk of the stepper motor as a sine curve, and a jerk equation describing the relationship between the rate of change of the acceleration of the stepper motor and time is obtained.

[0046] Specifically, the simulated jerk is a sine curve, then the jerk equation is for:

[0047]

[0048] Among them, Δt 1 =tt 1 , t 0 =0,t 1 is the total acceleration time, t 2 is the total deceleration time;

[0049] S300: numerically integrating the jerk equation to obtain a speed equation, taking the first-order difference of the speed equation as an actual speed equation, wherein the actual speed equation describes the relationship between the motor speed and time.

[0050] Specifically, by integrating them one by one, we get for:

[0051]

[0052] In t 1 At the moment the acceleration process ends, the motor speed will reach v max , the integral is for:

[0053]

[0054] In t 1 At the moment the motor has traveled a distance of s 1 , integrate again to get s(t):

[0055]

[0056] In formulas (3) and (4), we have s(t 1 )=s 1 ,s max =s(t 1 +t 2 ), combined we get:

[0057]

[0058] In addition, for the constant A 1 , A 2 、V max , T 1 , T 2 Also available:

[0059]

[0060] The above calculations are all integral results. The actual motor operation is a discrete process. Using integral instead of discrete process will cause errors. In order to ensure that the motor accurately travels the specified distance, the first-order difference of s(t) is taken as the actual speed equation, recorded as v(t):

[0061] (7)

[0063] v(t) is the velocity planning curve under acceleration smoothing. The velocity curve v(t) obtained by difference can not only meet the maximum acceleration and jerk continuous limits, but also reach the target point accurately.

[0064] S400: Calculating the value of the constant of the acceleration / deceleration control parameter in the actual speed equation according to the distance to be moved;

[0065] Specifically, in order to obtain the speed planning curve v(t), it is necessary to calculate v according to the given distance s. max and a 1 and a 2 .

[0066] For any distance s max When running at a small distance, it is required to be slow and steady. It is only necessary to stretch and transform the speed curve. For any trigonometric function As long as the product of amplitude A and frequency w is a constant, the curve shape is consistent, so Defining Slope Adjusting the slope k can adjust the shape of the curve. It is known that in S max Lower acceleration time T 1 , T 2 , A1, A2, V max ,definition Solve the following equations:

[0067]

[0068] We can get:

[0069]

[0070] S500: According to the expected reaction rate, the slope of the actual speed equation is set to obtain a speed planning curve;

[0071] Furthermore, a preset distance threshold is obtained, and when the distance to be moved is greater than the preset distance threshold, the uniform speed movement time of the motor is calculated; combined with the actual speed equation, a speed planning curve including a uniform speed time period is obtained.

[0072] Specifically, S max As the preset distance threshold, when the moving distance s max When i =f(s,S max ,K i ) can calculate the actual v max ,Pick For the calculation example, we get:

[0073]

[0074] From (6), we can see that when the motor has the highest speed V max , Acceleration and deceleration time T i Given, the maximum acceleration A in the acceleration and deceleration stage​​i , slope K i (i=1,2),S max It can be determined that is a constant term, record:

[0075]

[0076] Combining (5), (8) and (10), all unknown quantities of the velocity curve v(t) are obtained as follows:

[0077]

[0078] in

[0079] According to the actual application, the motor's speed requirements for different distances, that is, the expected reaction rate, defines the slope function f(s,S max ,K i ).

[0080] When the slope function When the distance s max Any distance will arrive in a fixed time. In fact, if

[0081]

[0082] Similar calculations can be obtained That is, by selecting different slope functions, the reaction rate at different distances can be controlled. max Discussion.

[0083] If s>S max , then there is a uniform speed segment, and it is obvious that uniform speed time Combining (7) we can get:

[0084]

[0085]

[0086] Where Δt 1,c =tT 1 -T c ,

[0087] S600: Controlling the stepper motor according to the speed planning curve.

[0088] ​​Specifically, the control program sets the speed of the stepper motor in each operation cycle according to the speed planning curve, and finally reaches the target. During control, the motor target position is issued by the control console, the motor real-time position is measured by the (Hall) position sensor, and the motor speed is specified by the above S100-S600 method. The method aims to control the motor to reach the target position smoothly, without losing step and overshoot, and has been used in the point-to-point movement of the moving head light.

[0089] In this embodiment, the real-time performance is strong, the calculation is simple, the jerk is continuous, there are different reaction speeds for different distances, and the stepper motor can accurately reach the target point. It can be applied to the acceleration and deceleration movement of equipment such as moving head lights, thereby improving the motion control performance of the stepper motor. At the same time, the speed planning curve obtained by differential in this method can not only meet the maximum acceleration and continuous jerk restrictions, but also can accurately reach the target point, ensuring the accuracy of the acceleration and deceleration planning. Moreover, the control method of the present application can realize the control of the reaction rate at different distances by selecting different slope functions, so that the method can adapt to the needs of different application scenarios.

[0090] This application also provides a trigonometric function acceleration and deceleration control device for a stepper motor. Figure 2 As shown, the device comprises:

[0091] The data acquisition module 100 is used to obtain the distance to be moved and the expected reaction rate of the stepper motor, and initialize the acceleration and deceleration control parameters of the stepper motor;

[0092] A jerk module 200 is used to simulate the jerk of the stepper motor as a sine curve using a sine function based on the acceleration and deceleration control parameters, and obtain a jerk equation describing the relationship between the rate of change of the acceleration of the stepper motor and time;

[0093] A speed module 300 is used to numerically integrate the jerk equation to obtain a speed equation, and take the first-order difference of the speed equation as an actual speed equation, wherein the actual speed equation describes the relationship between the motor speed and time;

[0094] The control module 400 is used to calculate the value of the acceleration and deceleration control parameter in the actual speed equation according to the distance to be moved; set the slope of the actual speed equation according to the expected reaction rate to obtain a speed planning curve; and control the stepper motor according to the speed planning curve.

[0095] The functional implementation of each module in the above-mentioned trigonometric function acceleration and deceleration control device for a stepper motor corresponds to the steps in the above-mentioned trigonometric function acceleration and deceleration control method embodiment for a stepper motor, and its functions and implementation processes will not be repeated here one by one.

[0096] The present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the trigonometric function acceleration and deceleration control method for a stepper motor as described in any of the above embodiments are implemented.

[0097] The present application also provides a computer-readable storage medium, on which a program is stored, wherein the computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive and / or a memory stick, etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The working process, working details and technical effects of the computer-readable storage medium provided in this embodiment can be found in the above embodiment of a trigonometric function acceleration and deceleration control method for a stepping motor, which will not be repeated here.

[0098] The application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the trigonometric function acceleration and deceleration control method for a stepper motor as described in any of the above embodiments.

[0099] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0100] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of this application shall be based on the attached claims.

Claims

1. A trigonometric function acceleration and deceleration control method for a stepping motor, characterized in that: include: Get the distance to be moved and the expected reaction rate of the stepper motor, and initialize the acceleration and deceleration control parameters of the stepper motor; Based on the acceleration and deceleration control parameters, a sine function is used to simulate the jerk of the stepper motor as a sine curve, and a jerk equation describing the relationship between the rate of change of the acceleration of the stepper motor and time is obtained; Numerically integrating the jerk equation to obtain a speed equation, taking the first-order difference of the speed equation as an actual speed equation, wherein the actual speed equation describes the relationship between the motor speed and time; Calculating the value of the constant of the acceleration / deceleration control parameter in the actual speed equation according to the distance to be moved; According to the expected reaction rate, the slope of the actual speed equation is set to obtain a speed planning curve; The stepper motor is controlled according to the speed planning curve.

2. The trigonometric function acceleration and deceleration control method of a stepping motor according to claim 1, characterized in that: Also includes: Obtaining a preset distance threshold, and when the distance to be moved is greater than the preset distance threshold, calculating the uniform speed movement time of the motor; Combined with the actual speed equation, a speed planning curve including a uniform speed time period is obtained.

3. The trigonometric function acceleration and deceleration control method of a stepping motor according to claim 2, characterized in that: The expression of the jerk equation is for: Δt1=t-t1; Among them, t is the movement time of the stepper motor, a1 is the maximum acceleration during the actual acceleration process, a2 is the maximum acceleration during the actual deceleration process, and v max is the highest speed during actual operation, t0=0, t1 is the total acceleration time, t2 is the total deceleration time, ω i is the intermediate parameter representing ω1 and ω2, a i Indicates a1, a2.

4. The trigonometric function acceleration and deceleration control method of a stepping motor according to claim 1, characterized in that: The expression v(t) of the actual velocity equation is:

5. The trigonometric function acceleration and deceleration control method of a stepping motor according to claim 4, characterized in that: The acceleration and deceleration control parameters include constants and variables, where the constants include the maximum speed V of the motor. max , the maximum acceleration A1 during the process of the motor accelerating from standstill to maximum speed, the total time of acceleration T1, the motor from V max The acceleration from deceleration to stop is A2, the total time of deceleration is T2, and the motor travels a distance S during the whole acceleration and deceleration process. max .

6. The trigonometric function acceleration and deceleration control method of a stepping motor according to claim 5, characterized in that: The expression v(t) of the speed planning curve including the uniform speed time period is: Δt 1,c =t-T1-T c ; Among them, T i Indicates T1, T2, T c It indicates the time during which the motor moves at a constant speed.

7. A trigonometric function acceleration and deceleration control device for a stepping motor, characterized in that: include: The data acquisition module is used to obtain the distance to be moved and the expected reaction rate of the stepper motor, and initialize the acceleration and deceleration control parameters of the stepper motor; A jerk module, used to simulate the jerk of the stepper motor as a sine curve using a sine function based on the acceleration and deceleration control parameters, and obtain a jerk equation describing the relationship between the rate of change of the acceleration of the stepper motor and time; A speed module, used for numerically integrating the jerk equation to obtain a speed equation, taking the first-order difference of the speed equation as an actual speed equation, wherein the actual speed equation describes the relationship between the motor speed and time; A control module, used for calculating the value of the acceleration / deceleration control parameter in the actual speed equation according to the distance to be moved; According to the expected reaction rate, the slope of the actual speed equation is set to obtain a speed planning curve; and the stepper motor is controlled according to the speed planning curve.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the trigonometric function acceleration and deceleration control method for a stepping motor as claimed in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, wherein when the program is executed by a processor, the trigonometric function acceleration and deceleration control method for a stepping motor according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising computer instructions, characterized in that The computer instructions, when executed by a processor, implement the steps of the trigonometric function acceleration and deceleration control method for a stepping motor as described in claims 1 to 6.

Citation Information

Patent Citations

  • Acceleration / deceleration control method in trajectory planning of numerical control system

    CN108319228A

  • Three-axis micro-line segment direct speed transition method based on trigonometric function acceleration and deceleration control

    CN111966047A

  • Trajectory planning acceleration and deceleration control method and system with motion efficiency and flexibility

    CN113534748A

  • Vehicle control device

    CN117222561A

  • Pulse motor controller

    JP2014176171A