A step motor acceleration and deceleration curve parameter table generation method based on step count prediction and a multi-motor motion control method
By generating a stepper motor acceleration and deceleration curve parameter table based on step count prediction, the nonlinearity problem caused by timer period variation is solved, achieving smooth movement and high-precision control of the stepper motor, and reducing heat generation and vibration.
Patent Information
- Application Number
- CN202411315645.4
- 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
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.
A stepper motor acceleration and deceleration curve parameter table is generated by a step-count prediction method. The Sigmoid function model is used for compensation calculation to ensure that the motor smoothly reaches the target speed according to the preset parameters after a fixed number of steps. The periodic changes of the stepper motor during motion are considered to correct the error at the endpoint of the Sigmoid function domain.
It achieves smooth movement of the stepper motor, reduces heat generation and vibration, improves control accuracy, avoids the problem of the motor failing to respond to pulse signals in time due to speedometer deformation, and ensures the stability and precise control of the motor during acceleration and deceleration.
Smart Images

Figure CN119382561B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of control technology, and in particular to a method for generating a parameter table of acceleration and deceleration curves of a stepper motor based on step count prediction and a multi-motor motion control method. Background Technology
[0002] In automation and precision machinery applications, stepper motors require rapid and smooth transitions from one speed to another. In the control of stepper motors, lookup tables are commonly used for acceleration and deceleration control. Acceleration / deceleration tables, represented by the "S"-shaped curve (also known as the sigmoid curve), enable smooth movement of the stepper motor, effectively reducing heat generation and vibration, decreasing the stepper motor's drive power, and improving control accuracy. The main purpose of S-curve acceleration / deceleration is to smoothly control the speed changes during acceleration and deceleration, avoiding shocks to the system during direct starts or stops. However, when generating the S-shaped acceleration / deceleration curve table based on the lookup table method, a timer interrupt is typically used to retrieve the speed values from the table. This method does not consider that the stepper motor's step size (i.e., step angle or step distance) is fixed. Therefore, after the timer updates the speed value, the timer period also changes, leading to vibration or inaccurate positioning due to nonlinearity during acceleration and deceleration. Summary of the Invention
[0003] This invention provides a method for generating a stepper motor acceleration / deceleration curve parameter table based on step count prediction and a multi-motor motion control method. The method for generating a stepper motor acceleration / deceleration curve parameter table based on step count prediction is used to solve the technical problem that the classic lookup table method does not consider the timer period change in the process of generating a stepper motor acceleration / deceleration table. It is a method for generating a stepper motor acceleration / deceleration table that sets a specific number of running steps to adjust from one speed to another.
[0004] In a first aspect, the present invention provides a method for generating a parameter table of acceleration and deceleration curves of a stepper motor based on step count prediction, comprising:
[0005] S1: Obtain the number of steps during the acceleration or deceleration process of the stepper motor, the unit of time for acceleration or deceleration of the stepper motor, the differential mode of the stepper motor, the main frequency of the microcontroller timer, the initial speed of the stepper motor, and the target speed of the acceleration or deceleration process of the stepper motor.
[0006] S2: Based on the initial speed and target speed, compensation calculations are performed on the typical S-shaped acceleration and deceleration curve model of the stepper motor (i.e., the Sigmoid function model for stepper motor step count prediction) to obtain the S-shaped speed curve of the stepper motor running speed; where the horizontal axis (independent variable) of the S-shaped speed curve is time and the vertical axis (dependent variable) is instantaneous speed (unit: steps / second).
[0007] S3: Perform definite integral calculation on the S-shaped speed curve of the stepper motor's step speed to obtain the distance-time model function of the stepper motor during acceleration or deceleration, and then calculate the total distance traveled by the stepper motor during acceleration or deceleration; where the horizontal axis (independent variable) of the distance-time model function is time, and the vertical axis (dependent variable) is distance.
[0008] S4: Inverse the distance-time model function to obtain the time-distance model function for the acceleration or deceleration process of the stepper motor, which is the inverse function of the distance-time model function; where the horizontal axis (independent variable) of the time-distance model function is distance and the vertical axis (dependent variable) is time;
[0009] S5: Calculate the number of microsteps in the acceleration and deceleration process of the stepper motor based on the number of running steps in the acceleration and deceleration process and the differential mode of the stepper motor;
[0010] S6: Based on the number of microsteps during the acceleration and deceleration process of the stepper motor and the total distance traveled by the stepper motor during acceleration or deceleration (i.e., the microstep distance of the stepper motor from the initial speed to the target speed), calculate and obtain the microstep travel distance table of the stepper motor after equal interval division.
[0011] S7: Combine the micro-stepping distance table and the stepper motor acceleration or deceleration process time distance model function to calculate the micro-stepping time node table of the stepper motor;
[0012] S8: Substitute the stepper motor's microstep running time node table into the S-shaped speed curve (Sigmoid function model) of the stepper motor's running speed to calculate and obtain the speed table for each microstep time.
[0013] S9: Generate corresponding acceleration and deceleration curve parameters (microcontroller automatic reload values) using the speed values in the microstep speed table. The entire set of acceleration and deceleration curve parameters is the final output result, namely the stepper motor acceleration and deceleration curve parameter table (abbreviated as stepper motor acceleration and deceleration table).
[0014] The stepper motor acceleration / deceleration curve parameter table generation method based on step count prediction uses the number of steps as the prediction basis and employs the Sigmoid function model. Its key focus is ensuring that after a fixed number of steps, the motor can accurately generate a stepper motor acceleration / deceleration curve parameter table according to preset parameters. This allows for a smooth achievement of the target speed by applying the parameter table. The method emphasizes speed control of the motor's movement. By precisely controlling the speed of each step, it optimizes the motor's torque and is suitable for precision equipment requiring precise control of the number of steps and position. It not only accurately controls the acceleration and deceleration process but also ensures the smoothness of speed changes throughout the process, reducing mechanical wear and improving system stability. The stepper motor acceleration / deceleration curve parameter table (hereinafter referred to as the stepper motor acceleration / deceleration table) is written into a storage medium. The controller then uses a lookup method to sequentially fill the timer's automatic reload register, controlling the timer's period and generating pulse signals according to that period. The stepper motor driver drives the stepper motor to rotate one microstep based on the pulse signals. By continuously filling the timer's automatic reload register with a lookup table, the stepper motor can accurately adjust from the entry speed to the target speed (including acceleration and deceleration) within a specified time. This method takes into account the change in the stepper motor's motion cycle during movement, corrects the error at the endpoint of the Sigmoid function's domain, and solves the technical problems of the traditional lookup table S-curve method, which does not consider the change in the microstep running cycle, resulting in accelerometer distortion (causing torque waste) and errors caused by the traditional lookup table S-curve method not considering the model's domain. This achieves smooth motion, effectively reduces heat generation and vibration, reduces the stepper motor's drive power, and improves the motor's control accuracy.
[0015] Furthermore, the S-shaped speed curve of the stepper motor in S2 is as follows:
[0016]
[0017] Wherein, Sigmoid(x) is the S-shaped speed curve of the stepper motor, i.e., the Sigmoid function for predicting the number of steps of the stepper motor; PPS in The initial speed of the stepper motor; PPS aim The target speed for the stepper motor during acceleration or deceleration; nT represents the preset time unit, where n is a coefficient and T is the total time taken for the stepper motor to travel from its initial speed to the target speed during acceleration or deceleration. Let a suitable n be set so that nT = 1 for easy subsequent calculations; x is the time variable in the time unit representation.
[0018] Furthermore, the total distance traveled by the stepper motor during acceleration or deceleration is specifically as follows:
[0019]
[0020] In the formula, Integral sigmoid (t) represents the total distance traveled by the stepper motor during acceleration or deceleration, i.e., the distance-time model function; Sigmoid(x) is the Sigmoid function for predicting the number of steps of the stepper motor; nT represents the unit of time for the stepper motor's acceleration or deceleration; x is the time variable in the time unit representation; t is time.
[0021] Furthermore, the inverse function of the stepper motor microstep distance-time model function, namely the stepper motor acceleration or deceleration time-distance model function arcInegral(distence), is specifically:
[0022] arcInegral(distence)=arc(Integral sigmoid (t))
[0023] In the formula, distance is the distance traveled by the stepper motor; Integral sigmoid (t) represents the microstep distance of the stepper motor from time 0 to time t.
[0024] Furthermore, the formula for calculating the number of microsteps in the acceleration and deceleration process of a stepper motor is as follows:
[0025] microsteps=steps×microstepmode
[0026] In the formula, microsteps represents the total number of microsteps during the acceleration or deceleration process of the stepper motor; steps represents the number of steps during the acceleration or deceleration process of the stepper motor; and microstepmode represents the differential mode of the stepper motor.
[0027] Furthermore, the method for obtaining the micro-step distance table of the stepper motor is as follows:
[0028]
[0029] In the formula, distences represents the distance traveled by the stepper motor in multiple microsteps; [distences] represents the set of all microstep travel distances, i.e., the microstep travel distance table; Integral sigmoid (nT) represents the total distance traveled by the stepper motor during acceleration and deceleration; To make the total distance Integral sigmoid (nT) is divided into equal parts according to the number of microsteps; microsteps is the total number of microsteps in the acceleration and deceleration process of the stepper motor; nT is the unit representing the acceleration and deceleration or deceleration running time of the stepper motor.
[0030] Furthermore, the method for obtaining the micro-stepping time node table of the stepper motor is as follows:
[0031] [timeslices]=[arcInegral(distences)]
[0032] In the formula, timeslice is the running time node of a certain microstep in the operation of the stepper motor; [timeslices] is the microstep running time node table of the stepper motor; [arcInegral(distences)] represents the set of time nodes when the total distance of each microstep is traveled, that is, the time node table [timeslices].
[0033] Furthermore, the speedometer for each microstep is as follows:
[0034] [SigmoidPPSList]=[Sigmoid(timeslices)]
[0035] In the formula, [SigmoidPPSList] represents the speed at each microstep corresponding to the microstep running time node of the stepper motor; Sigmoid(timeslices) represents the instantaneous running speed of each microstep when the stepper motor accelerates or decelerates (unit: steps / second, i.e., PPS), which is obtained by substituting the microstep running time node table of the stepper motor into the S-shaped speed curve model (Sigmoid function) of the stepper motor running speed to obtain the instantaneous running speed of the stepper motor microstep.
[0036] Furthermore, the calculation formula for the stepper motor acceleration / deceleration curve parameter table is as follows:
[0037]
[0038] In the formula, [Speedstables] is the parameter table of the stepper motor acceleration and deceleration curves, i.e., the automatic reload value of the microcontroller; F freq This indicates the main frequency of the microcontroller's timer; microstepmode indicates the differential mode of the stepper motor.
[0039] Secondly, the present invention provides a method for controlling the linear motion of multiple stepper motors based on the stepper motor acceleration / deceleration curve parameter table generation method described above, comprising:
[0040] 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:
[0041]
[0042] 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 ay1 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.
[0043] Step 2: Set the acceleration or deceleration steps for stepper motor a. a Equals the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps1×p a The entry speed (PPS) of stepper motor a ina Equals the entry speed of the reference stepper motor multiplied by the single-step transmission ratio (PPS) in1 ×p a The target speed of stepper motor a is PPS. aima Equals the target speed of the reference stepper motor multiplied by the single-step transmission ratio (PPS) aim1 ×p a ;
[0044] Step 3: Using the step-motor acceleration / deceleration curve parameter table generation method based on step number prediction as described above, generate the acceleration / deceleration curve parameter table for the reference motor and each step motor other than the reference motor.
[0045] Thirdly, the present invention provides a method for controlling the coaxial rotational motion of multiple stepper motors based on the stepper motor acceleration / deceleration curve parameter table generation method described above, comprising:
[0046] 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:
[0047]
[0048] 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;
[0049] Step 2: Set the acceleration or deceleration steps for stepper motor b. b Equals the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps1×p bThe 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 ;
[0050] Step 3: Using the step-motor acceleration / deceleration curve parameter table generation method based on step number prediction as described above, generate the acceleration / deceleration curve parameter table for the reference motor and each step motor other than the reference motor.
[0051] Beneficial effects
[0052] This invention proposes a method for generating a stepper motor acceleration / deceleration curve parameter table based on step count prediction and a multi-motor motion control method; wherein, the method for generating a stepper motor acceleration / deceleration curve parameter table based on step count prediction has the following advantages:
[0053] (1) The stepper motor acceleration and deceleration curve parameter table generated by the method proposed in this invention can ensure that the speed follows the S-curve model when applied to stepper motor speed control, preventing adverse consequences of speed gauge deformation. This avoids the problem that speed gauge deformation may cause the motor to fail to respond to each pulse signal in time, resulting in the rotor position being out of sync with the given signal, leading to stalling or step loss.
[0054] (2) The stepper motor acceleration and deceleration curve parameter table generated by the method proposed in this invention can accurately calculate the torque required for acceleration when applied to stepper motor speed control, avoiding energy waste and ensuring the load-carrying capacity of the motor during acceleration and deceleration. By rationally designing the acceleration and deceleration curves, the motor speed can be smoothly changed, reducing mechanical shock and vibration, improving system stability, and ensuring that the motor maintains sufficient torque output throughout the entire speed range to avoid jerking and unstable operation.
[0055] Furthermore, because the stepper motor acceleration / deceleration curve parameter table generated by the method proposed in this invention maintains the waveform of the S-curve model well, it can be used for multi-motor speed vector control in operating conditions such as multiple stepper motor linear motion systems and multiple stepper motor coaxial rotary motion systems. This ensures that multiple motors always maintain the correct vector direction during operation. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a schematic diagram of the working principle of a stepper motor provided in an embodiment of the present invention;
[0058] Figure 2 This is a schematic diagram of the number of running steps and running speed of a commonly used "S"-shaped function based on the lookup table method provided in the embodiments of the present invention, taking 1040 steps running from 200pps to 2000pps as an example;
[0059] Figure 3 These are speed diagrams and motor acceleration diagrams provided by embodiments of the present invention, which do not consider the timer period variation when using an S-type accelerometer; wherein (a) is the speed diagram when using an S-type accelerometer, and (b) is the motor acceleration diagram using the accelerometer shown in (a);
[0060] Figure 4 The embodiments of the present invention provide a speed diagram and a motor acceleration diagram when the acceleration and deceleration table is generated based on the step number prediction parameter table of the stepper motor acceleration and deceleration curve; wherein (a) is the speed diagram when the acceleration table is generated using the method of the present invention, and (b) is the motor acceleration diagram using the acceleration table shown in (a);
[0061] Figure 5 This is a flowchart of the method for generating a stepper motor acceleration / deceleration curve parameter table based on step count prediction provided in an embodiment of the present invention;
[0062] Figure 6 This is a simplified diagram of the X and Y axis running directions of a classic gantry system provided in an embodiment of the present invention;
[0063] Figure 7 This is a simplified diagram of the X, Y, and Z axis running directions of the speed vector synthesis control system for three motors provided in this embodiment of the invention;
[0064] Figure 8 This is a simplified diagram of a card flipping mechanism provided in an embodiment of the present invention; wherein (a) is a perspective view of a card flipping mechanism; wherein (b) is a projection view of one side of the first motor m1 of the card flipping mechanism; and wherein (c) is a projection view of one side of the second motor m2 of the card flipping mechanism. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0066] A stepper motor is an open-loop control component that converts electrical pulse signals into angular or linear displacement. Its working principle is as follows: Figure 1 As shown (taking a two-phase stepper motor as an example), for each input pulse signal, the rotor rotates by an angle or moves forward one step. The output angular or linear displacement is proportional to the number of input pulses. The drive module converts the input signal into a drive signal for the stepper motor and inputs it to the stepper motor driver circuit. Typical input signals for the drive module include PUL (input step control pulse signal), DIR (stepper motor direction control), and ENV (enable). Stepper motor driver circuits can use DRV8825, TMC2225 and its peripheral circuits, M332C stepper motor driver, etc. The drive signal lines for the stepper motor include A+, A-, B+, B- (or ABCD). Due to differences in the differential step number set in the stepper motor driver circuit and the circuit performance, the drive signal response exhibits different waveforms. For example, in full-step drive mode, the sampled waveform of the stepper motor drive signal is a square wave, while in micro-step drive mode, the sampled waveform of the stepper motor drive signal is approximately a sine wave.
[0067] In the control of stepper motors, a lookup table method is often used for acceleration and deceleration control. Among these, the acceleration / deceleration table, represented by the "Sigmoid curve" (also known as the S-curve), enables smooth movement of the stepper motor, effectively reducing heat generation and vibration, decreasing the stepper motor's drive power, and improving control accuracy. The main purpose of S-curve acceleration / deceleration is to smoothly control the speed changes of the motor during acceleration and deceleration, avoiding shocks to the system during direct start-up or stopping. When generating the S-curve acceleration / deceleration curve parameter table based on the lookup table method, a timer interrupt is typically used to retrieve the parameter values from the stored acceleration / deceleration curve parameter table and set them to the timer's auto-reload register to control the time period. The traditional method for generating S-curve acceleration / deceleration curve parameter tables involves dividing the running process into equal parts according to the number of microsteps. The result of this division is used as a time variable to obtain the corresponding speed value in the Sigmoid function model, which is then directly converted into a stepper motor acceleration / deceleration curve parameter table. This method does not consider that the step size (i.e., step angle or step distance) of the stepper motor is fixed. When the timer updates the speed value, the timer period also changes, causing the actual speed curve of the stepper motor to distort. The distorted curve will increase the acceleration or deceleration time and increase the torque required for the stepper motor to operate, meaning more energy is needed to change the stepper motor speed. Figure 2 As shown, taking the commonly used "S"-shaped (Sigmoid function) acceleration / deceleration algorithm as an example, the horizontal axis of the graph represents the number of steps, and the vertical axis represents the running speed (unit: steps / second, i.e., PPS). Taking the acceleration curve from 200 PPS (steps / second) to 2000 PPS (steps / second), executing 1040 steps, and running in full-step mode as an example: when the stepper motor speed is 200 PPS (steps / second), the time required to complete one step is 1 / 200 of a second; when the stepper motor speed is 2000 PPS (steps / second), the time required to complete one step is 1 / 2000 of a second. The difference in time period is 10 times, which will greatly affect the performance of the stepper motor. Figure 3 As shown, the speed diagram and motor acceleration diagram during operation using an S-shaped accelerometer are shown without considering the timer period variation. To address the technical problem of the classic lookup table method failing to consider timer period variations in generating stepper motor acceleration / deceleration tables, this application proposes a method for generating stepper motor acceleration / deceleration tables that adjusts from one speed to another by setting a specific number of running steps, as detailed below:
[0068] Example 1
[0069] like Figure 5 As shown, this embodiment provides a method for generating a stepper motor acceleration / deceleration curve parameter table based on step count prediction, including:
[0070] S1: Obtain the number of steps (steps) during the acceleration or deceleration process of the stepper motor (using the differential step count as an input parameter is not universal; the final result is a parameter table of differential steps, hence in this embodiment, it is a full step), the unit of the stepper motor acceleration or deceleration time (nT in this embodiment defaults to 1, which will eventually be converted into the microstep running time), the stepper motor differential mode (microstepmode, which can be set according to the actual situation, with values of 1, 2, 4, 8, 16, 32, etc.), and the microcontroller timer main frequency F. freq Stepper motor entry speed (PPS) in (i.e., the initial velocity of the stepper motor at the initial moment, in steps per second, or PPS), and the target velocity (PPS) of the stepper motor during acceleration or deceleration. aim (Unit: steps per second, or PPS). The unit for the acceleration or deceleration time of a stepper motor is nT, where n is a coefficient and T is the total time taken for the stepper motor to travel from its initial speed to the target speed during acceleration or deceleration. Let a suitable n be set so that nT = 1 for easier subsequent calculations.
[0071] S2: Based on the initial and target speeds, compensation calculations are performed on the typical S-shaped acceleration / deceleration curve model (Sigmoid function model) of a stepper motor to obtain the S-shaped speed curve of the stepper motor's running speed, i.e., the Sigmoid function for predicting the stepper motor's steps. In the S-shaped speed curve, the horizontal axis (independent variable) represents time, and the vertical axis (dependent variable) represents instantaneous speed (unit: steps / second). The S-shaped speed curve can be used to calculate the stepper motor speed corresponding to the current time point based on the input time point.
[0072] The graph of the "S"-shaped function (Sigmoid function) is the sum of a constant function and a standard sigmoid function. The equation for a typical S-shaped curve (Sigmoid curve) of a stepper motor is as follows:
[0073]
[0074] Where nT represents the time unit for the stepper motor's acceleration or deceleration, where n is a coefficient and T is the total time taken for the stepper motor to reach the target speed during acceleration or deceleration. A suitable n is set such that nT = 1 for easier subsequent calculations; x is the time variable represented in the time unit [0, nT]; Sigmoid(x) represents the S-shaped speed curve of the stepper motor, specifically the speed of the stepper motor at time x (unit: steps / second, i.e., PPS); PPS in This indicates the initial speed of the stepper motor; PPS aim Let x represent the target speed of the stepper motor (unit: steps / second, i.e., PPS); x∈[0, nT], then Here, we use empirical values, where Δ represents the Sigmoid function at... Take the function value at infinite time and the Sigmoid function in The difference in function values when the value is -6 is used to compensate for the initial speed PPS of the stepper motor. in The difference between the stepper motor's Sigmoid(0) at time 0 and the stepper motor's Sigmoid(0) (PPS) in -Sigmoid (0) | Δ=0 This paper considers the variation of the stepper motor's motion cycle during operation, corrects the error at the endpoints of the Sigmoid function's domain, and adjusts the stepper motor's target speed PPS. aim The difference between the speed of the stepper motor at time nT and the speed of the stepper motor, Sigmoid(nT) (PPS) aim -Sigmoid (nT) | Δ=0 After compensation calculation, the Sigmoid function for predicting the stepper motor steps is obtained (nT is 1):
[0075]
[0076] Wherein, Sigmoid(x) represents the S-shaped speed curve of the stepper motor (Sigmoid function model); PPS in The initial speed of the stepper motor; PPS aim This represents the target speed during the acceleration or deceleration of the stepper motor; Regarding the value of nT being 1: when PPS in the Sigmoid function... in and PPS aim When determined, the scaling of the time period T is proportional to the corresponding time node (the change in the graph is directly proportional to the definite integral (area, total running distance) of the Sigmoid function, that is, the function value is the same at points where the definite integral (area) of the function waveform is the same; therefore, assuming an nT, after dividing it equally by its running definite integral, we can reverse the scaling to each time node of the nT time period, and the speed value of the stepper motor corresponds one-to-one with the actual speed value of the stepper motor.
[0077] S3: The distance-time model function of the stepper motor during acceleration or deceleration is obtained by definite integral calculation of the S-shaped speed curve (Sigmoid function) of the stepper motor's step speed; in the distance-time model function, the horizontal axis (independent variable) is time and the vertical axis (dependent variable) is distance.
[0078] Specifically, the total distance traveled by the stepper motor during acceleration or deceleration is as follows:
[0079]
[0080] In the formula, Integralsigmoid (t) is the definite integral function of the stepper motor speed, i.e., the total distance traveled by the stepper motor during acceleration or deceleration; Sigmoid(x) is the Sigmoid function for predicting the number of steps; nT represents the unit of time for the stepper motor's acceleration or deceleration; x is the time variable in the time unit representation; t is time. Based on the S-shaped speed curve obtained from the initial and target speeds of the stepper motor, the total distance the stepper motor needs to travel from the initial speed to the target speed can be obtained by solving the definite integral.
[0081] S4: Inverse the distance-time model function during the acceleration or deceleration of the stepper motor to obtain the time-distance model function for the acceleration or deceleration process, which is the inverse function of the distance-time model function. In the time-distance model function, the horizontal axis (independent variable) is distance; the vertical axis (dependent variable) is time; the formula is as follows:
[0082] arcInegral(distence)=arc(Integral sigmoid (t))
[0083] In the formula, distance is the distance traveled by the stepper motor; Integral sigmoid (t) represents the microstep distance the stepper motor travels from 0 to t. arc(Integral) sigmoid (t) represents Integral sigmoid The inverse function expression of (t) (i.e., by changing the independent and dependent variables, or the graph of a symmetrical function with the line "t = distance" as the axis of symmetry); arcInegral(distence) represents the inverse function of the stepper motor's microstep distance-time model function, that is, the time-distance model function of the stepper motor's acceleration or deceleration process. Based on the inverse time-distance function, the time point corresponding to the input stepper motor's travel distance can be obtained.
[0084] S5: Calculate the number of microsteps in the acceleration / deceleration process of the stepper motor based on the number of running steps during the acceleration / deceleration process and the differential mode of the stepper motor. The calculation formula is as follows:
[0085] microsteps=steps×microstepmode
[0086] In the formula, microsteps represents the total number of microsteps in the acceleration and deceleration process of the stepper motor; steps is the number of running steps in the acceleration and deceleration process of the stepper motor; and microstepmode represents the differential mode of the stepper motor.
[0087] Specifically, in this embodiment, "one step" refers to the stepper motor moving forward one step in full-step mode, driven by each pulse signal. The distance of each step forward by the stepper motor is fixed and related to the structural parameters of the motor.
[0088] Microstepping mode: Stepper motor drivers or stepper motor driver chips support microstepping control by finely controlling voltage and current. Microstepping is a technology that subdivides the step size of a stepper motor, allowing the motor to rotate in smaller increments than a full step. This technology utilizes current control to generate an intermediate magnetic field state between two full step positions. This allows the motor to move more smoothly and achieve more precise positioning.
[0089] The core of the microstepping drive principle lies in the precise control of the winding current. In traditional stepper motor operation, the windings are usually fully open or fully closed, corresponding to a specific polarity direction, thereby generating sufficient torque to make the motor rotate to the next step angle. However, in microstepping drive mode, the controller divides the current into multiple levels (or "microsteps"), instead of fully open or fully closed.
[0090] Microstep: In layman's terms, it means dividing one step into multiple microsteps for control. Originally, one step (1.8°) only requires one pulse. Taking the 16-microstep mode as an example, the original one step (1.8°) would require 16 microsteps to complete, that is, 16 pulses.
[0091] S6: Based on the number of microsteps during the acceleration and deceleration process of the stepper motor and the total distance traveled by the stepper motor during acceleration or deceleration, i.e. the microstep distance of the stepper motor from the initial speed to the target speed, calculate and obtain the microstep travel distance table of the stepper motor after equal interval division.
[0092] The running distance of the stepper motor is divided into equal intervals, and then the area of each equal interval in a specific Sigmoid(x) function is calculated (fixed distance - the total distance of the stepper motor's microsteps). The calculation formula is as follows:
[0093] [distences] = slice(Integral) sigmoid (nT), microsteps)
[0094] Where, distences represents the distance traveled by the stepper motor in multiple microsteps; [distences] represents the set of all microstep travel distances, i.e., the microstep travel distance table; microsteps represents the total number of microsteps during the acceleration and deceleration process; Integral sigmoid(nT) represents the total distance traveled by the stepper motor during acceleration and deceleration; slice(...,...) represents the slice function, which takes two parameters: the total number of microsteps and the total distance traveled during acceleration and deceleration. The total distance is then integrated into the Integral function. sigmoid (nT) is divided equally according to the number of microsteps, and expanded according to the definition, we get:
[0095]
[0096] in, This indicates the proportion of the running distance from the first to the microsteps (i.e., proportional to the total distance run after each microstep), which is the total distance Integral. sigmoid (nT) is divided equally according to the number of microsteps; “…×[…]” indicates that the constant term is multiplied by the elements in the table to form a new array [distences].
[0097] S7: Based on the micro-stepping distance table and the stepper motor acceleration or deceleration process time distance model function, calculate the micro-stepping time node table of the stepper motor.
[0098] After determining the distances based on the microstepping distance of a stepper motor [distences], the equation "arcInegral(distence) = arc(Integral)" is used. sigmoid The stepper motor's microstepping time node table [timeslices] is calculated using the formula below:
[0099] [timeslices]=[arcInegral(distences)]
[0100] In the formula, timeslice represents the running time node of a certain microstep in the operation of the stepper motor; [timeslices] is the microstep running time node table of the stepper motor; [arcInegral(distences)] represents the set of time nodes when the total distance of each microstep is traveled, i.e., the time node table [timeslices]. [arcInegral(distences)] means that each item of [distences] is calculated according to the distance-time function (the inverse function expression of the time-distance (ts) function), and finally the microstep running time node table [timeslices] of the stepper motor is obtained.
[0101] S8: Substitute the stepper motor's microstep running time node table into the typical S-shaped acceleration / deceleration curve model (Sigmoid function model) of the stepper motor to obtain the speed table for each microstep.
[0102] [SigmoidPPSList]=[Sigmoid(timeslices)]
[0103] Here, timeslices is mapped to the time axis and takes values in the range of [0, nT = 1]; [SigmoidPPSList] is the speed at each microstep corresponding to the microstep running time node of the stepper motor; Sigmoid(timeslices) is the instantaneous running speed (unit: steps / second, i.e., PPS) of the stepper motor when it moves, obtained by substituting the stepper motor's time node table into the typical S-shaped acceleration and deceleration curve model of the motor - the Sigmoid function.
[0104] S9: Generate the corresponding acceleration and deceleration curve parameters, i.e., the microcontroller's automatic reload value, using the speed values in the microstep speed table (in this embodiment, the pulse half-cycle time is selected and the pulse duty cycle is 50%). The set of all acceleration and deceleration curve parameters is the final output result, i.e., the stepper motor acceleration and deceleration curve parameter table (referred to as the stepper motor acceleration and deceleration table).
[0105]
[0106] In the formula, [Speedstables] represents the stepper motor acceleration / deceleration curve parameter table, i.e., the microcontroller's automatic reload value; F freq This represents the main frequency of the microcontroller's timer; microstepmode represents the differential mode of the stepper motor (values include 1, 2, 4, 8, 16, 32, etc.). (Formula) This indicates the calculation method for each value, and then a new acceleration / deceleration table [Speedstables] is formed based on all the obtained microcontroller auto-reload values. By applying the stepper motor acceleration / deceleration curve parameter table, the target speed can be reached smoothly, the torque loss of the stepper motor during acceleration / deceleration can be reduced, and the load-carrying capacity of the stepper motor during acceleration / deceleration can be increased, among other beneficial effects.
[0107] 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 results in increased load-carrying capacity during acceleration and deceleration, fewer steps to complete acceleration and deceleration, or increased maximum acceleration speed, among other beneficial effects.
[0108] By writing the above stepper motor acceleration and deceleration curve parameter table (hereinafter referred to as the stepper motor acceleration and deceleration table) into the storage medium, the controller uses the lookup method to fill the timer automatic reload register in sequence, so that the stepper motor can accurately adjust from the entry speed to the target speed (including acceleration and deceleration) at a specified time, thus achieving smooth motion, effectively reducing heat generation and vibration, reducing the stepper motor drive power, and improving the control accuracy of the motor.
[0109] Example 2
[0110] 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 step number prediction as described above, including:
[0111] 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:
[0112]
[0113] 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.
[0114] Step 2: Set the acceleration or deceleration steps for stepper motor a. a Equals the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps1×p a The entry speed (PPS) of stepper motor a ina Equals the entry speed of the reference stepper motor multiplied by the single-step transmission ratio (PPS) in1 ×p a The target speed of stepper motor a is PPS. aima Equals the target speed of the reference stepper motor multiplied by the single-step transmission ratio (PPS) aim1 ×p a ;
[0115] Step 3: Generate the acceleration and deceleration curve parameter tables for the reference motor and each step motor other than the reference motor using the step motor acceleration and deceleration curve parameter table generation method based on the step number prediction as described above.
[0116] To further illustrate the method, we will use two stepper motors (first motor m1 (same as the reference motor mentioned above) and second motor m2 (same as stepper motor a mentioned above)) and the trolley mechanism c1 as an example for detailed explanation:
[0117] like Figure 6 The diagram shows a simplified representation of the X and Y axis running directions of a classic gantry system: where 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.
[0118] The angle between the X and Y axes is determined according to the actual implementation method, with a classic value of 90°. In order to make the gantry trolley mechanism c1 move along the running direction f, the velocity 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. The proportionality coefficient is the single-step transmission ratio of the two (considering the difference in step angle).
[0119] 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 those for single-step transmission; the running time for both motors m1 and m2 is the same. Based on the stepper motor acceleration / deceleration curve parameter table generation method proposed above, the acceleration / deceleration curve parameter tables for the first motor m1 and the second motor m2 are generated. Specifically:
[0120] Using the first motor m1 as the reference stepper motor, 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 microcontroller's timer main frequency 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 ];
[0121] 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 microcontroller's timer main frequency F freq_m2Stepper 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 ];
[0122] The acceleration or deceleration steps of the second motor m2 are... 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 of the second motor m2 (PPS) 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.
[0123] This embodiment can be extended to the velocity vector synthesis of multiple motors, such as Figure 7 As 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.
[0124] Example 3
[0125] 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:
[0126] 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:
[0127]
[0128] 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;
[0129] Step 2: Set the acceleration or deceleration steps for stepper motor b. b Equals the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps1×p b 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 ;
[0130] Step 3: Generate the acceleration and deceleration curve parameter tables for the reference motor and each step motor other than the reference motor using the step motor acceleration and deceleration curve parameter table generation method based on the step number prediction as described above.
[0131] To further illustrate the method, a card flipping mechanism is used as an example for detailed explanation, such as... Figure 8 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.
[0132] To ensure that the card can be moved and functions such as card flipping are achieved, 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, and 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 of the two (considering the difference in step angle).
[0133] 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 step-count prediction-based stepper motor acceleration / deceleration curve parameter table generation method proposed in this invention, the stepper motor acceleration / deceleration curve parameter table for the first motor m1 and the second motor m2 is generated. Specifically:
[0134] 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...
[0135] 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 microcontroller's timer main frequency 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 ];
[0136] 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 microcontroller's timer main frequency 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 ];
[0137] The acceleration or deceleration steps of the second motor m2 are... 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 of the second motor m2 (PPS) aim_m2 Equals the target speed of the first motor m1 multiplied by the single-step transmission ratio PPSaim_m1 ×p.
[0138] By referring to the above stepper motor acceleration and 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 vector synthesis of the rotation speeds of the two coaxial motors.
[0139] This embodiment can be extended to the velocity vector synthesis of multiple motors, but the main operating condition is a dual-motor type, and the calculation method is the same as the dual-motor calculation method in this embodiment, which will not be shown in detail.
[0140] It should be understood that, in the embodiments of the present invention, the processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information.
[0141] The readable storage medium is a computer-readable storage medium, which can be an internal storage unit of the controller described in any of the foregoing embodiments, such as the controller's hard drive or memory. The readable storage medium can also be an external storage device of the controller, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the controller. Further, the readable storage medium can include both the controller's internal storage unit and external storage devices. 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.
[0142] Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0144] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for generating a parameter table of a step motor acceleration-deceleration curve based on step count prediction, characterized in that, Comprise: S1: obtain the running steps of the stepper motor acceleration process or deceleration process, the stepper motor acceleration or deceleration running time unit, the stepper motor differential mode, the single-chip microcomputer timer main frequency, the initial speed of the stepper motor, the target speed of the stepper motor acceleration or deceleration process; S2: based on the initial speed, the target speed, the typical S-shaped acceleration and deceleration curve model of the stepper motor is compensated and calculated, and the S-shaped speed curve of the stepper motor running speed is obtained; S3: the S-shaped speed curve of the stepper motor step running speed is calculated, and the distance-time model function of the stepper motor acceleration or deceleration process is obtained, and then the total distance of the stepper motor acceleration or deceleration process is calculated; S4: the inverse of the distance-time model function is obtained, that is, the inverse function of the distance-time model function; S5: the microstep step number of the stepper motor acceleration or deceleration process is calculated according to the running steps of the stepper motor acceleration or deceleration process and the stepper motor differential mode; S6: based on the microstep step number of the stepper motor acceleration or deceleration process and the total distance of the stepper motor acceleration or deceleration process, the microstep running distance table of the stepper motor after equal division is calculated; S7: the microstep running time node table of the stepper motor is calculated by combining the microstep running distance table and the distance-time model function of the stepper motor acceleration or deceleration process; S8: the microstep running time node table of the stepper motor is substituted into the S-shaped speed curve of the stepper motor running speed to calculate the speed table at each microstep time; S9: the corresponding acceleration and deceleration curve parameters are generated by using the speed values in the microstep speed table, and the set of the whole acceleration and deceleration curve parameters is the final output result, that is, the stepper motor acceleration and deceleration curve parameter table.
2. The method of claim 1, wherein, The S-shaped speed curve of the stepper motor running speed in S2 is as follows: wherein Sigmoid(x) is a S-shaped speed curve of the stepper motor running speed, i.e. a Sigmoid function of the stepper motor step number prediction; PPS in is an initial speed of the stepper motor; PPS aim is a target speed of the stepper motor acceleration or deceleration process; nT represents a preset time unit, wherein n is a coefficient, T is a total time actually used for running from the initial speed of the stepper motor to the target speed of the acceleration or deceleration process, nT = 1; x is a time variable in the time unit representation.
3. The method of claim 1, wherein, The total distance of the stepper motor acceleration or deceleration process in S3 is as follows: wherein Integral sigmoid (t) is the total distance run by the stepper motor during the acceleration or deceleration process, the integral function of the stepper motor speed; Sigmoid(x) is the Sigmoid function of the stepper motor step number prediction; nT represents the unit of time for the stepper motor acceleration or deceleration; x is the time variable in the unit of time; t is the time.
4. The method of claim 1, wherein, The distance-time model function arcIntegral(distence) of the stepper motor acceleration or deceleration process in S4 is as follows: arcInegral(distence) = arc(Integral sigmoid (t)) where distence is the distance traveled by the stepper motor; Integral sigmoid (t) is the microstep distance traveled by the stepper motor from time 0 to time t.
5. The method of claim 1, wherein, The calculation formula of the microstep step number of the stepper motor acceleration or deceleration process in S5 is as follows: microsteps=steps×microstepmode In the formula, microsteps represents the total microstep step number of the stepper motor acceleration or deceleration process;steps is the running step number of the stepper motor acceleration or deceleration process;microstepmode represents the stepper motor differential mode.
6. The method of claim 1, wherein, The acquisition method of the microstep running distance table of the stepper motor in S6 is as follows: where distences is the distance of the plurality of microsteps of the stepper motor; [distences] represents the set of all microstep distances, i.e. the microstep distance table; Integral sigmoid (nT) is the total distance run by the stepper motor during the acceleration and deceleration process; Integral sigmoid (nT) is equally divided by the number of microsteps; microsteps is the total number of microsteps of the stepper motor during the acceleration and deceleration process; nT is a unit of time representing the acceleration or deceleration run time of the stepper motor.
7. The method of claim 1, wherein, The acquisition method of the microstep running time node table of the stepper motor in S7 is as follows: [timeslices]=[arcInegral(distences)] In the formula, timeslice is the running time node of a microstep of the stepper motor;[timeslices] is the microstep running time node table of the stepper motor;[arcInegral(distences)] represents the set of time nodes at each microstep running total distance, that is, the time node table [timeslices].
8. The method of claim 1, wherein, The speed table at each microstep time in S8 is [SigmoidPPSList] = [Sigmoid(timeslices)] In the formula, [SigmoidPPSList] is the speed of each micro-step moment corresponding to the micro-step running time node of the stepper motor; Sigmoid(timeslices) is the instantaneous running speed of each micro-step of the stepper motor obtained by substituting the micro-step running time node table of the stepper motor into the S-shaped speed curve model of the running speed of the stepper motor.
9. The method of claim 1, wherein, The calculation formula of the acceleration-deceleration curve parameter table of the stepper motor in S9 is: In the formula, [Speedstables] is a parameter table of the acceleration and deceleration curve of the stepper motor, i.e. the automatic reloading value of the single-chip microcomputer; F freq represents the main frequency of the single-chip microcomputer timer; and microstepmode represents the microstep mode of the stepper motor.
10. A method for linear motion control of a plurality of stepper motors based on the method of any one of claims 1-9, characterized by, It comprises: Step 1: Taking the reference stepper motor as the reference, the single-step transmission ratio of each stepper motor other than the reference stepper motor is calculated, 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 number of steps to accelerate or decelerate the stepper motor a steps a Equal to the number of steps to accelerate or decelerate the reference stepper motor multiplied by the single step drive ratio steps1 x p a ; Access speed of stepper motor a PPS ina Equal to the access speed of the reference stepper motor multiplied by the single step drive ratio PPS in1 x p a ; Target speed of stepper motor a PPS 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: The acceleration-deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor is generated by using the method of any one of claims 1-9.
11. A method for controlling the rotational movement of a plurality of stepper motors in a coaxial arrangement based on the method of any one of claims 1-9, wherein, It comprises: Step 1: Taking the reference stepper motor as the reference, the single-step transmission ratio of each stepper motor other than the reference stepper motor is calculated, 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 number of steps of acceleration or deceleration run of stepper motor b steps b Equal to the number of steps of acceleration or deceleration run of reference stepper motor multiplied by single step transmission ratio steps1 x p b ; Access speed of stepper motor b PPS inb Equal to the access speed of reference stepper motor multiplied by single step transmission ratio PPS in1 x p b ; Target speed of stepper motor b PPS aimb Equal to the target speed of reference stepper motor multiplied by single step transmission ratio PPS aim1 x p b ; Step 3: The acceleration-deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor is generated by using the method of any one of claims 1-9.
Citation Information
Patent Citations
Adaptive speed control method for stepping motor driving head
CN110109490A
Electric automobile permanent magnet synchronous motor control system with road condition reproduction function
CN112865639A