Stepping motor S-shaped speed curve control method

By sliding average processing of the trapezoidal velocity curve, the S-shaped speed curve is generated, which solves the problem of jitter caused by multiple acceleration mutation points during the acceleration and deceleration of the traditional trapezoidal velocity curve, and achieves the stability and biosafety of the motion.

CN119853511APending Publication Date: 2025-04-18科来思生物科技(重庆)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510128769.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The traditional trapezoidal velocity curve has multiple acceleration abrupt points during acceleration and deceleration, which can cause motor jitter and risk of splashing in containers that transport liquid.

Method used

The trapezoidal speed curve is processed through the sliding average window to generate an S-shaped speed curve, and the speed is smoothed at four points where the accelerations may suddenly change, such as starting, uniform acceleration to uniform speed, uniform deceleration, and stopping.

Benefits of technology

It effectively reduces jitter during movement, ensures that the dragged object does not jitter violently during movement, and thus ensures the stability and biological safety of the movement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853511A_ABST
    Figure CN119853511A_ABST
Patent Text Reader

Abstract

A control method for an S-shaped speed curve of a stepping motor is characterized by comprising the following steps: step 1, performing speed planning on a moving track of the stepping motor based on a starting point position, a middle point position and an end point position of the stepping motor to obtain a trapezoidal speed curve of the stepping motor; 2, fixed-length moving average processing is carried out on the trapezoidal speed curve through a moving average window, and an S-shaped speed curve of the stepping motor is obtained; and step 3, controlling the operation of the stepping motor based on the S-shaped speed curve. The device has the effects that the S-shaped speed curve is subjected to speed smoothing processing at four acceleration sudden change points, namely starting, uniform acceleration to uniform speed, uniform speed to uniform deceleration and stopping, and the speed curve of the type can reduce shaking in the movement process and ensure that liquid in a dragged object such as a test tube and a reaction cup can not be easily changed. And the filling needle and the like do not violently shake in the movement process, so that the movement stability and the biological safety are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of speed control, and in particular to a control method for an S-shaped speed curve of a stepping motor. Background Art

[0002] The trapezoidal speed curve control algorithm is one of the most widely used acceleration and deceleration control strategies in the field of industrial control. The so-called trapezoidal speed curve divides the entire motion process into three stages: uniform acceleration, uniform speed, and uniform deceleration, and the acceleration remains unchanged during the speed change process.

[0003] When the whole system starts and brakes at high speed, the performance of the whole system can be improved. When the system completes each action, it includes three processes: uniform acceleration, uniform speed, and uniform deceleration. Trapezoidal speed curve control applies different acceleration or deceleration to the actuators such as motors or electric cylinders through the control system, so that the robot or other actuators can transition smoothly when starting and stopping, avoiding damage and errors caused by excessive acceleration or deceleration.

[0004] Disadvantages of existing technology: However, in speed control, the traditional trapezoidal speed curve consists of three parts: uniform acceleration, uniform speed and uniform deceleration. There are four mutation points in acceleration: starting, uniform acceleration to uniform speed, uniform speed to uniform deceleration, and stopping, which may cause motor jitter. If the moving part is a container for transporting liquid, there is a risk of splashing. Summary of the invention

[0005] The invention provides a control method for an S-shaped speed curve of a stepping motor, which performs speed smoothing at four points where acceleration may suddenly change, namely, starting, uniform acceleration to uniform speed, uniform speed to uniform deceleration, and stopping, thereby reducing jitter during movement.

[0006] To achieve the above object, the present invention provides a method for controlling an S-shaped speed curve of a stepping motor, the key of which is to include the following steps:

[0007] Step 1: Based on the starting point position, the middle point position and the end point position of the stepper motor, the speed of the running trajectory of the stepper motor is planned to obtain the trapezoidal speed curve v of the stepper motor. T [n];

[0008] Step 2: The trapezoidal velocity curve v is averaged by sliding the window T [n] Perform a fixed-length sliding average process to obtain the S-shaped speed curve v of the stepper motor S [n], the expression is as follows:

[0009]

[0010] Among them, v S[n] represents the nth point of the S-shaped velocity curve, v T [n] represents the nth point of the trapezoidal speed curve, v T [k] represents the kth point of the trapezoidal velocity curve, and L represents the length of the sliding average window, which is L points;

[0011] The S-shaped velocity curve v S [n] with the trapezoidal speed curve v T [n] have similar movement characteristics.

[0012] Step 3: Based on the S-shaped velocity curve v S [n] Control the operation of the stepper motor.

[0013] Through the above design, an S-shaped speed curve can be generated in a resource-constrained embedded system. The S-shaped speed curve can effectively reduce the jitter during movement by smoothing the speed at the four points where the acceleration may suddenly change, namely, starting, uniform acceleration to uniform speed, uniform speed to uniform deceleration, and stopping. This ensures that the dragged object does not shake violently during movement, thereby ensuring the stability of the movement and biological safety.

[0014] The wider the sliding average window, the smaller the jerkiness of the S-shaped speed curve, and the better the anti-shake effect, but it will increase the total motion time and reduce the average speed. The increased time is the length of the filter window. For example, choosing a 200ms filter window can balance the anti-shake effect and the increase in time.

[0015] As a preference: in step 1, the trapezoidal speed curve v T [n] is the initial velocity v0 or the final velocity v t Trapezoidal speed profile with non-zero velocity.

[0016] This method is also applicable to trapezoidal velocity curves whose initial or final velocity is not zero. However, if the initial and final velocities are not equal, the trapezoidal velocity curve must be compensated for the uniform speed segment to ensure that the stroke corresponding to the filtered S curve is equal to the stroke of the original trapezoidal velocity curve.

[0017] As a preference: in step 2, when the trapezoidal speed curve v T [n] is the initial velocity v0 or the final velocity v t When the trapezoidal speed curve is not zero, firstly T [n] Make corrections and then make an S-shaped speed curve v S Generation of [n].

[0018] The initial speed is v0 or the final speed is v tWhen it is not equal to 0, if the S-shaped speed curve is directly derived, the actual stroke will be too much. The original trapezoidal speed curve must be corrected to obtain an S-shaped curve with the same stroke.

[0019] As a preferred embodiment: the trapezoidal speed curve v T [n] The process of making corrections is as follows:

[0020] First, by comparing the integral areas of the corresponding S-shaped speed curve and the trapezoidal speed curve, the correction area ΔS is obtained, and then the correction time Δt of the uniform speed section is obtained. The calculation expression of the correction time Δt is:

[0021]

[0022] Among them, v m Indicates uniform speed;

[0023] Then the trapezoidal speed curve v T The uniform speed period of [n] is reduced by Δt, and the corrected trapezoidal speed curve v is obtained. T ′[n], and then based on the corrected trapezoidal speed curve v T ′[n] generates an S-shaped speed curve.

[0024] As a preference: in step 1, the trapezoidal speed curve v T [n] is a trapezoidal speed curve that degenerates into a triangular curve, that is, a trapezoidal speed curve without a uniform speed segment.

[0025] This method is also applicable to a trapezoidal speed curve that degenerates into a triangular curve (i.e., there is no uniform speed segment), but the maximum speed will be reduced.

[0026] As a preference: if the trapezoidal speed curve v T If the uniform speed period of [n] is less than the correction time Δt, then the trapezoidal speed curve v T [n] degenerates into a triangular velocity curve, the process is as follows:

[0027] First, while maintaining the trapezoidal speed curve v T [n], the maximum speed is recalculated under the condition that the acceleration of the uniform acceleration and uniform deceleration stages remains unchanged, and a triangular speed curve is constructed. The area of ​​the triangular speed curve is larger than that of the trapezoidal speed curve v T The area of ​​[n] is reduced by the correction area ΔS, and then an S-shaped speed curve v is made based on the triangular speed curve S Generation of [n].

[0028] The maximum speed of the triangular speed curve is calculated based on the correction area ΔS.

[0029] Preferably, in step 3, the operation of the stepper motor is controlled by pulses, each pulse can make the stepper motor move forward one step in a specified direction. To control the speed of the stepper motor, the generation time of each pulse must be controlled; the faster the pulse is generated, the faster the motor speed, and vice versa.

[0030] Use a fixed-frequency time slice to control the stepper motor. The controller determines whether the time slice generates a pulse. According to the characteristics of the stepper motor not exceeding 1000 revolutions per second, the time slice frequency is 100kHz, and the corresponding period is 10us. The higher the time slice frequency, the higher the control accuracy and operation speed of the stepper motor, but it will consume more computing resources.

[0031] As a preferred embodiment: when the selected time slice period is T s , the speed of the nth point is v[n], the speed unit is pulse / second, then t=nT s The judgment conditions for generating pulses at a certain moment are:

[0032]

[0033] That is, if the integral of the stroke has a carry to the integer part, a pulse is generated.

[0034] As a preference: In the application, pay attention to the time slice frequency f s =100000, i.e. 100kHz, use counter J and initialize it to 0, and accumulate J in each time slice, i.e. J←J+v[n];

[0035] If J ≥ f s , then use J←Jf s Update counter J and generate a pulse at the same time. This can greatly reduce the computational overhead, making it possible to use this algorithm in resource-constrained microcontrollers.

[0036] Beneficial effects of the present invention: The S-shaped speed curve proposed in the present invention is a speed curve with continuously changing acceleration. The speed is smoothed at the four points where the acceleration may change suddenly, namely, starting, uniform acceleration to uniform speed, uniform speed to uniform deceleration, and stopping. This type of speed curve can reduce the jitter during the movement and ensure that the dragged object (such as a test tube, liquid in a reaction cup, a filling needle, etc.) does not shake violently during the movement, thereby ensuring the stability of the movement and biological safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0038] The present invention is further described in detail below in conjunction with the accompanying drawings and specific examples. The following examples or drawings are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0039] like Figure 1 As shown: A control method for an S-shaped speed curve of a stepping motor comprises the following steps:

[0040] Step 1: Based on the starting point position, the middle point position and the end point position of the stepper motor, the speed of the running trajectory of the stepper motor is planned to obtain the trapezoidal speed curve v of the stepper motor. T [n];

[0041] Step 2: The trapezoidal velocity curve v is averaged by sliding the window T [n] Perform a fixed-length sliding average process to obtain the S-shaped speed curve v of the stepper motor S [n], the expression is as follows:

[0042]

[0043] Among them, v S [n] represents the nth point of the S-shaped velocity curve, v T [n] represents the nth point of the trapezoidal speed curve, v T [k] represents the kth point of the trapezoidal velocity curve, and L represents the length of the sliding average window, which is L points;

[0044] The S-shaped velocity curve v S [n] with the trapezoidal speed curve v T [n] have similar movement characteristics.

[0045] Step 3: Based on the S-shaped velocity curve v S [n] Control the operation of the stepper motor.

[0046] The sliding average window is a filtering window of 200ms. The length of the sliding average window is related to the speed sampling frequency. In this embodiment, the speed sampling frequency is 5kHz, corresponding to one point of 0.2ms, and 200ms corresponds to 1000 points, so L=1000.

[0047] The wider the window, the smaller the jerkiness of the S-shaped speed curve, and the better the anti-shake effect, but it will increase the total motion time and reduce the average speed. The increased time is the length of the filter window. Selecting a 200ms filter window can balance the anti-shake effect and the increase in time.

[0048] In step 1, the trapezoidal speed curve v T [n] is the initial velocity v0 or the final velocity v t Trapezoidal speed profile with non-zero velocity.

[0049] This method is also applicable to trapezoidal velocity curves whose initial or final velocity is not zero. However, if the initial and final velocities are not equal, the trapezoidal velocity curve must be compensated for the uniform speed segment to ensure that the stroke corresponding to the filtered S curve is equal to the stroke of the original trapezoidal velocity curve.

[0050] In step 2, when the trapezoidal speed curve v T [n] is the initial velocity v0 or the final velocity v t When the trapezoidal speed curve is not zero, firstly T [n] Make corrections and then make an S-shaped speed curve v S Generation of [n].

[0051] The initial speed is v0 or the final speed is v t When it is not equal to 0, if the S-shaped speed curve is directly derived, the actual stroke will be too much. The original trapezoidal speed curve must be corrected to obtain an S-shaped curve with the same stroke.

[0052] For the trapezoidal velocity curve v T [n] The process of making corrections is as follows:

[0053] First, by comparing the integral areas of the corresponding S-shaped speed curve and the trapezoidal speed curve, the correction area ΔS is obtained, and then the correction time Δt of the uniform speed section is obtained. The calculation expression of the correction time Δt is:

[0054]

[0055] Among them, v m Indicates uniform speed;

[0056] Then the trapezoidal speed curve v T The uniform speed period of [n] is reduced by Δt, and the corrected trapezoidal speed curve v is obtained. T ′[n], and then based on the corrected trapezoidal speed curve v T ′[n] generates an S-shaped speed curve.

[0057] In step 1, the trapezoidal speed curve v T [n] is a trapezoidal speed curve that degenerates into a triangular curve, that is, a trapezoidal speed curve without a uniform speed segment.

[0058] This method is also applicable to a trapezoidal speed curve that degenerates into a triangular curve (i.e., there is no uniform speed segment), but the maximum speed will be reduced.

[0059] If the trapezoidal speed curve v T If the uniform speed period of [n] is less than the correction time Δt, then the trapezoidal speed curve vT [n] degenerates into a triangular velocity curve, the process is as follows:

[0060] First, while maintaining the trapezoidal speed curve v T [n], the maximum speed is recalculated under the condition that the acceleration of the uniform acceleration and uniform deceleration stages remains unchanged, and a triangular speed curve is constructed. The area of ​​the triangular speed curve is larger than that of the trapezoidal speed curve v T The area of ​​[m] is reduced by the correction area ΔS, and then an S-shaped speed curve v is made based on the triangular speed curve S Generation of [m].

[0061] In step 3, the operation of the stepper motor is controlled by pulses, and each pulse can make the stepper motor move forward one step in a specified direction. To control the speed of the stepper motor, the generation time of each pulse must be controlled; the faster the pulse is generated, the faster the motor speed, and vice versa.

[0062] Use a fixed-frequency time slice to control the stepper motor. The controller determines whether the time slice generates a pulse. According to the characteristics of the stepper motor not exceeding 1000 revolutions per second, the time slice frequency is 100kHz, and the corresponding period is 10us. The higher the time slice frequency, the higher the control accuracy and operation speed of the stepper motor, but it will consume more computing resources.

[0063] When the selected time slice period is T s , the speed of the nth point is v[n], the speed unit is pulse / second, then t=nT s The judgment conditions for generating pulses at a certain moment are:

[0064]

[0065] That is, if the integral of the stroke has a carry to the integer part, a pulse is generated.

[0066] In the application, we focus on the time slice frequency f s =100000, i.e. 100kHz, use counter J and initialize it to 0, and accumulate J in each time slice, i.e. J←J+v[n];

[0067] If J ≥ f s , then use J←Jf s Update counter J and generate a pulse at the same time. This can greatly reduce the computational overhead, making it possible to use this algorithm in resource-constrained microcontrollers.

[0068] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for controlling an S-shaped speed curve of a stepping motor, characterized in that: The following steps are involved: Step 1: Based on the starting point position, the middle point position and the end point position of the stepper motor, the speed of the running trajectory of the stepper motor is planned to obtain the trapezoidal speed curve v of the stepper motor. T [n]; Step 2: The trapezoidal velocity curve v is averaged by sliding the window T [n] Perform a fixed-length sliding average process to obtain the S-shaped speed curve v of the stepper motor S [n], the expression is as follows: Among them, v S [n] represents the nth point of the S-shaped velocity curve, v T [n] represents the nth point of the trapezoidal speed curve, v T [k] represents the kth point of the trapezoidal velocity curve, and L represents the length of the sliding average window, which is L points; Step 3: Based on the S-shaped velocity curve v S [n] Control the operation of the stepper motor.

2. The method for controlling an S-shaped speed curve of a stepping motor according to claim 1, characterized in that: In step 1, the trapezoidal speed curve v T [n] is the initial velocity v0 or the final velocity v t Trapezoidal speed profile with non-zero velocity.

3. The control method of a stepping motor S-shaped speed curve according to claim 2, characterized in that: In step 2, when the trapezoidal speed curve v T [n] is the initial velocity v0 or the final velocity v t When the trapezoidal speed curve is not zero, firstly T [n] Make corrections and then make an S-shaped speed curve v S Generation of [n].

4. The method for controlling an S-shaped speed curve of a stepping motor according to claim 3, characterized in that: For the trapezoidal velocity curve v T [n] The process of making corrections is as follows: First, by comparing the integral areas of the corresponding S-shaped speed curve and the trapezoidal speed curve, the correction area ΔS is obtained, and then the correction time Δt of the uniform speed section is obtained. The calculation expression of the correction time Δt is: Among them, v m Indicates uniform speed; Then the trapezoidal speed curve v T The uniform speed period of [n] is reduced by Δt, and the corrected trapezoidal speed curve v is obtained. T ′[n], and then based on the corrected trapezoidal speed curve v T ′[n] S-shaped speed curve v S Generation of [n].

5. A method for controlling an S-shaped speed curve of a stepping motor according to claim 4, characterized in that: In step 1, the trapezoidal speed curve v T [n] is a trapezoidal speed curve that degenerates into a triangular curve, that is, a trapezoidal speed curve without a uniform speed segment.

6. A method for controlling an S-shaped speed curve of a stepping motor according to claim 5, characterized in that: If the trapezoidal speed curve v T If the uniform speed period of [n] is less than the correction time Δt, then the trapezoidal speed curve v T [n] degenerates into a triangular velocity curve, the process is as follows: First, while maintaining the trapezoidal speed curve v T [n], the maximum speed is recalculated under the condition that the acceleration of the uniform acceleration and uniform deceleration stages remains unchanged, and a triangular speed curve is constructed. The area of ​​the triangular speed curve is larger than that of the trapezoidal speed curve v T The area of ​​[n] is reduced by the correction area ΔS, and then an S-shaped speed curve v is made based on the triangular speed curve S Generation of [n].

7. The method for controlling an S-shaped speed curve of a stepping motor according to claim 1, characterized in that: In step 3, the operation of the stepper motor is controlled by pulses, and each pulse causes the stepper motor to move forward one step in a specified direction; A fixed-frequency time slice is used to control the stepper motor. The controller determines whether the time slice generates a pulse. The time slice frequency is 100kHz, corresponding to a period of 10us.

8. The method for controlling an S-shaped speed curve of a stepping motor according to claim 7, characterized in that: When the selected time slice period is T s , the speed of the nth point is v[n], the speed unit is pulse / second, then the time t=nT s The judgment conditions for generating pulses are: That is, if the integral of the stroke has a carry to the integer part, a pulse is generated.

9. A method for controlling an S-shaped speed curve of a stepping motor according to claim 8, characterized in that: Time slice frequency f s =100000, i.e. 100kHz, use counter J and initialize it to 0, and accumulate J in each time slice, i.e. J←J+v[n]; If J ≥ f s , then use J←Jf s Updates counter J and generates a pulse.