Stepping motor acceleration and deceleration curve parameter table generation method based on step number prediction and multi-motor motion control method
By generating the number of step -by -step motor to increase the deceleration curve parameter table based on the number of step -based predictions, the traditional method has not considered the problem of inaccurate vibration and positioning caused by the periodic changes of the timer period, and the smooth speed changes and system stability in the acceleration process are realized. Essence
Patent Information
- Application Number
- CN202411315645.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The traditional table lookup method does not consider the timer cycle changes when generating stepper motor acceleration and deceleration meters, resulting in the problem of vibration or inaccurate positioning of stepper motors during acceleration and deceleration.
Use the method of step -based prediction to generate a step -by -step motor to speed up the curve parameter table. By obtaining parameters such as running steps, time units, and differential mode, the SIGMOID function model is used for compensation and calculation. Time distance model function, finally generates a micro -step running time node table and speed table to form a varituted curve parameter table.
Ensure the smoothness of the speed changes during the speed -up process of the stepper motor, reduce mechanical wear, improve the stability of the system, and avoid problems that are not synchronized with a given signal due to the non -synchronization of the given signal due to the speed surface deformation.
Smart Images

Figure CN119382561A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control technology, and in particular to a method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction and a multi-motor motion control method. Background Art
[0002] In automation and precision machinery applications, stepper motors need to transition quickly and smoothly from one speed to another. In the control process of stepper motors, the table lookup method is often used to control their acceleration and deceleration. The acceleration and deceleration table represented by the "S" curve (also known as the Sigmoid curve) enables the stepper motor to achieve smooth movement, effectively reduces heat and vibration, reduces the stepper motor drive power, and improves the control accuracy of the motor. The main purpose of the S-curve acceleration and deceleration is to smoothly control the speed change of the motor in the acceleration and deceleration stages to avoid the impact on the system when starting or stopping directly. However, when generating the acceleration and deceleration curve table of the S-curve based on the table lookup method, a timer interrupt is usually used to obtain the speed value in the table. This method does not take into account that the step length (i.e., step angle or step distance) of the stepper motor is fixed, so after the timer updates the speed value, the timer period will also change, resulting in vibration or inaccurate positioning due to nonlinear problems in the acceleration and deceleration process. Summary of the invention
[0003] The present invention provides a method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction and a multi-motor motion control method. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction is used to solve the technical problem that the timer cycle change is not considered in the process of generating a stepper motor acceleration and deceleration table by the classic table lookup method, and a method for generating a stepper motor acceleration and deceleration table with a specific running step number adjusted from one speed to another is set.
[0004] In a first aspect, the present invention provides a method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction, comprising:
[0005] S1: Get the number of running steps of the stepper motor during acceleration or deceleration, the running time unit of the stepper motor during acceleration or deceleration, 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 stepper motor during acceleration or deceleration;
[0006] S2: Based on the initial speed and the target speed, the typical S-shaped acceleration and deceleration curve model of the stepper motor (i.e., the Sigmoid function model for predicting the number of steps of the stepper motor) is compensated and calculated to obtain the S-shaped speed curve of the stepper motor running speed; wherein, the horizontal axis (independent variable) of the S-shaped speed curve is time, and the vertical axis (dependent variable) is the instantaneous speed (unit: step / second).
[0007] S3: Perform definite integral calculation on the S-shaped speed curve of the stepper motor step speed to obtain the distance-time model function of the stepper motor during acceleration or deceleration, and then calculate the total distance of the stepper motor during acceleration or deceleration; wherein the horizontal coordinate (independent variable) of the distance-time model function is time, and the vertical coordinate (dependent variable) is distance;
[0008] S4: inverting the distance-time model function to obtain a time-distance model function for the acceleration or deceleration process of the stepping motor, that is, an inverse function of the distance-time model function; wherein the abscissa (independent variable) in the time-distance model function is distance; and the ordinate (dependent variable) is time;
[0009] S5: Calculate the number of micro-steps in the acceleration and deceleration process of the stepper motor according to the number of running steps in the acceleration and deceleration process of the stepper motor and the differential mode of the stepper motor;
[0010] S6: Based on the number of micro-steps in the acceleration and deceleration process of the stepper motor and the total distance of the stepper motor in the acceleration or deceleration process (i.e., the micro-step distance of the stepper motor moving from the initial speed to the target speed), a micro-step running distance table of the stepper motor after equal-distance division is calculated;
[0011] S7: combining the micro-step running distance table and the time distance model function of the stepping motor acceleration or deceleration process, calculating and obtaining the micro-step running time node table of the stepping motor;
[0012] S8: Substitute the micro-step operation time node table of the stepper motor into the S-shaped speed curve (Sigmoid function model) of the stepper motor operation speed for calculation to obtain the speed table at each micro-step moment;
[0013] S9: Generate corresponding acceleration and deceleration curve parameters (single-chip microcomputer automatic reload value) using each speed value in the microstep speed table. The entire set of 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).
[0014] The stepper motor acceleration and deceleration curve parameter table generation method based on step number prediction takes the step number as the prediction basis, uses the Sigmoid function model, and focuses on ensuring that the motor can accurately generate the stepper motor acceleration and deceleration curve parameter table according to the preset parameters after the fixed number of steps, and smoothly reaches the target speed by applying the stepper motor acceleration and deceleration curve parameter table. The method focuses on the speed control of the motor action, optimizes the motor's motion torque by finely controlling the running speed of each step, and is suitable for precision equipment that needs to accurately control the number of motion steps and positions. It can not only accurately control the acceleration and deceleration process, but also ensure the smoothness of the speed change in the whole process, reduce mechanical wear and improve system stability. By writing the above stepper motor acceleration and deceleration curve parameter table (referred to as stepper motor acceleration and deceleration table) into a storage medium, the controller uses a table lookup method to fill in the timer automatic reload register in sequence, which is used to control the cycle of the timer, thereby generating a pulse signal according to the cycle; the stepper motor driver drives the stepper motor to rotate a micro-step distance according to the pulse signal. By continuously filling the timer automatic reload register in sequence using the table lookup method, the stepper motor can be accurately adjusted from the access speed to the target speed (including acceleration and deceleration) within the specified time. This method takes into account the changes in the motion cycle of the stepper motor during motion, corrects the errors at the endpoints of the Sigmiod function definition domain, and solves the technical problems of the traditional table lookup S-curve method not considering the changes in the micro-step operation cycle, resulting in deformation of the acceleration table (causing torque waste) and the traditional table lookup S-curve method not considering the errors caused by the model definition domain. It achieves smooth motion, effectively reduces heat and vibration, reduces the stepper motor drive power, and improves the control accuracy of the motor.
[0015] Furthermore, the S-shaped speed curve of the stepper motor running speed in S2 is as follows:
[0016]
[0017] Among them, Sigmoid(x) is the S-shaped speed curve of the stepper motor running speed, that is, the Sigmoid function of the stepper motor step number prediction; PPS in is the initial speed of the stepper motor; PPS aim is the target speed of the stepper motor acceleration or deceleration process; nT is represented by the preset time unit, where n is the coefficient, T is the total time used for the actual operation from the initial speed of the stepper motor to the target speed of the acceleration or deceleration process, and a suitable n is set so that nT=1, which is convenient for subsequent calculations; x is the time variable in the time unit representation.
[0018] Furthermore, the total distance that the stepper motor runs during acceleration or deceleration is specifically:
[0019]
[0020] In the formula, Integral sigmoid (t) is the total distance traveled during the acceleration or deceleration process of the stepper motor, that is, the distance-time model function; Sigmoid(x) is the Sigmoid function for predicting the number of steps of the stepper motor; nT represents the time unit of the acceleration or deceleration operation of the stepper motor; x is the time variable in the time unit representation; and t is time.
[0021] Furthermore, the inverse function of the stepper motor microstep distance time model function, that is, the stepper motor acceleration or deceleration process time distance model function arcInegral (distence), is specifically:
[0022] arcInegral(distence)=arc(Integral sigmoid (t))
[0023] Where, distance is the distance the stepper motor runs; Integral sigmoid (t) is the micro-step distance that the stepper motor rotates from time 0 to time t.
[0024] Furthermore, the calculation formula for the number of microsteps in the acceleration and deceleration process of the stepper motor is:
[0025] microsteps=steps×microstepmode
[0026] In the formula, microsteps represents the total number of microsteps in the acceleration or deceleration process of the stepper motor; steps is the number of running steps in the acceleration or deceleration process of the stepper motor; microstepmode represents the differential mode of the stepper motor.
[0027] Furthermore, the micro-step running distance table of the stepper motor is obtained as follows:
[0028]
[0029] Where, distances is the distance of multiple 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 the stepper motor runs during acceleration and deceleration; To Integral the total distance sigmoid (nT) is divided into microsteps; microsteps is the total number of microsteps in the acceleration and deceleration process of the stepper motor; nT is the unit of time for the acceleration or deceleration of the stepper motor.
[0030] Furthermore, the micro-step operation time node table of the stepper motor is obtained as follows:
[0031] [timeslices]=[arcInegral(distences)]
[0032] In the formula, timeslice is the running time node of a 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 for each microstep running total distance, that is, the time node table [timeslices].
[0033] Furthermore, the speed table for each microstep moment is
[0034] [SigmoidPPSList]=[Sigmoid(timeslices)]
[0035] Wherein, [SigmoidPPSList] is the speed of each microstep moment corresponding to the microstep operation time node of the stepper motor; Sigmoid (timeslices) is the instantaneous operation speed of each microstep when the stepper motor accelerates or decelerates (unit: step / second, i.e., PPS), specifically, the instantaneous operation speed of the stepper motor microstep obtained by substituting the microstep operation time node table of the stepper motor into the S-shaped speed curve model (Sigmoid function) of the stepper motor operation speed.
[0036] Furthermore, the calculation formula of the stepper motor acceleration and deceleration curve parameter table is:
[0037]
[0038] Where [Speedstables] is the stepper motor acceleration and deceleration curve parameter table, that is, the MCU automatic reload value; F freq Indicates the main frequency of the microcontroller timer; microstepmode indicates the differential mode of the stepper motor.
[0039] In a second aspect, the present invention provides a method for controlling linear motion of multiple stepper motors based on the method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction as described above, comprising:
[0040] Step 1: Taking the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, where the calculation formula of the single-step transmission ratio is:
[0041]
[0042] Among them, p a is the single-step transmission ratio of stepper motor a; x 1 is the step angle of the reference stepper motor; xa is the step angle of stepper motor a; y 1 is the mechanical transmission ratio of the reference stepper motor; a is the mechanical transmission ratio of stepper motor a; The running direction of the reference stepper motor is f 1 The angle between the composite direction f of the velocity vectors of all stepper motors and the projection f′ of the reference stepper motor and the running plane of stepper motor a; is the running direction of the stepper motor a 2 The angle between the composite direction f of the velocity vectors of all stepper motors and the projection f′ of the reference stepper motor and the running plane of stepper motor a;
[0043] Step 2: Set the number of steps for the acceleration or deceleration of stepper motor a a Equal to the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps 1 ×p a ; Stepper motor a access speed PPS ina Equal to the entry speed of the reference stepper motor multiplied by the single-step transmission ratio PPS in1 ×p a ; Target speed PPS of stepper motor a aima Equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p a ;
[0044] Step 3: Generate acceleration / deceleration curve parameter tables for the reference motor and each stepper motor other than the reference motor using the step number prediction-based stepper motor acceleration / deceleration curve parameter table generation method as described above.
[0045] In a third aspect, the present invention provides a method for controlling the coaxial rotation motion of multiple stepper motors based on the method for generating a stepper motor acceleration and deceleration curve parameter table based on the step number prediction as described above, comprising:
[0046] Step 1: Taking the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, where the calculation formula of the single-step transmission ratio is:
[0047]
[0048] Among them, p b is the single-step transmission ratio of stepper motor b; x 1 is the step angle of the reference stepper motor; x b is the step angle of stepper motor b; y 1 is the mechanical transmission ratio of the reference stepper motor; b is the mechanical transmission ratio of stepper motor b;
[0049] Step 2: Set the number of steps for the acceleration or deceleration of stepper motor b b Equal to the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps 1 ×p b ; Stepper motor b's access speed PPS inb Equal to 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 Equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p b ;
[0050] Step 3: Generate acceleration / deceleration curve parameter tables for the reference motor and each stepper motor other than the reference motor using the step number prediction-based stepper motor acceleration / deceleration curve parameter table generation method as described above.
[0051] Beneficial Effects
[0052] The present invention proposes a method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction and a multi-motor motion control method; wherein the method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction has the following advantages:
[0053] (1) The stepper motor acceleration and deceleration curve parameter table generated by the method proposed in the present invention can ensure that the speed follows the S-curve model when used for stepper motor speed control, thereby preventing the adverse consequences of speed table deformation. This avoids the problem that the motor may not be able to respond to each pulse signal in time due to speed table deformation, resulting in the rotor position being out of sync with the given signal, and causing stalling or loss of step.
[0054] (2) The stepper motor acceleration and deceleration curve parameter table generated by the method proposed in the present invention can accurately calculate the torque required for acceleration when used for stepper motor speed control, avoid energy waste, and ensure the load capacity of the motor during acceleration and deceleration. By reasonably designing the acceleration and deceleration curve, the motor speed can be changed smoothly, mechanical shock and vibration can be reduced, the stability of the system can be improved, and it can be ensured that the motor can maintain sufficient torque output in the entire speed range to avoid jumping and unstable operation.
[0055] In addition, since the stepper motor acceleration and deceleration curve parameter table generated by the method proposed in the present invention well maintains the S-curve model waveform, it can be used for multi-motor speed vector control under working conditions such as multiple stepper motor linear motion systems and multiple stepper motor coaxial rotation motion systems, ensuring that the multiple motors always maintain the correct vector direction when running. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a working principle diagram of a stepper motor provided by an embodiment of the present invention;
[0058] Figure 2 This is a schematic diagram of the number of running steps of an "S" type function based on a table lookup method provided in an embodiment of the present invention, taking 1040 steps from 200 pps to 2000 pps as an example;
[0059] Figure 3 It is a speed diagram and a motor acceleration diagram provided by an embodiment of the present invention when an S-type accelerometer is used for operation without considering the change of the timer cycle; wherein (a) is a speed diagram when the S-type accelerometer is used, and (b) is a motor acceleration diagram using the accelerometer shown in (a);
[0060] Figure 4 The present invention provides a stepper motor acceleration and deceleration curve parameter table based on step number prediction to generate a speed diagram and a motor acceleration diagram when the acceleration and deceleration table is running; wherein (a) is a speed diagram when the acceleration table is running using the method of the present invention, and (b) is a motor acceleration diagram using the acceleration table shown in (a);
[0061] Figure 5 It is a flow chart of a method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction provided by an embodiment of the present invention;
[0062] Figure 6 It is a schematic diagram of the X and Y axis running directions of the classic gantry system provided by an embodiment of the present invention;
[0063] Figure 7 It is a schematic diagram of the X, Y and Z axis running directions of the speed vector synthesis control system of three motors provided in an embodiment of the present invention;
[0064] Figure 8 It is a schematic diagram of a card flipping mechanism provided in an embodiment of the present invention; wherein (a) is a stereoscopic diagram of a card flipping mechanism; wherein (b) is a projection diagram of one side of the first motor m1 of the card flipping mechanism; wherein (c) is a projection diagram of one side of the second motor m2 of the card flipping mechanism. DETAILED DESCRIPTION
[0065] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0066] The stepper motor is an open-loop control element that converts electrical pulse signals into angular displacement or linear displacement. Its working principle is as follows: Figure 1 As shown (taking a two-phase stepper motor as an example), each time a pulse signal is input, the rotor rotates an angle or moves forward one step, and the angular displacement or linear displacement output is proportional to the number of input pulses. The drive module converts the input signal into the drive signal of the stepper motor and inputs it into the driver circuit of the stepper motor. Typical input signals of the drive module include PUL (input step control pulse signal), DIR (stepper motor movement direction control), and ENV (enable). The stepper motor driver circuit can use DRV8825, TMC2225 and its peripheral circuits, M332C stepper motor driver, etc.; the drive signal lines for driving the stepper motor include A+, A-, B+, B- (or ABCD). When the differential step number set by the stepper motor driver circuit and the difference in circuit performance, the drive signal response presents different waveforms. For example, when the full-step drive mode is used, the sampling waveform of the drive signal of the stepper motor is a square wave, and when the micro-step drive mode is used, the sampling waveform of the drive signal of the stepper motor is approximately a sine wave.
[0067] In the control process of stepper motors, a table lookup method is often used to control the acceleration and deceleration of stepper motors. Among them, the acceleration and deceleration table represented by the "Sigmoid curve" (also known as the S-curve) enables the stepper motor to achieve smooth movement, effectively reduces heat and vibration, reduces the driving power of the stepper motor, and improves the control accuracy of the stepper motor. The main purpose of the S-curve acceleration and deceleration is to smoothly control the speed change of the motor during the acceleration and deceleration stages to avoid the impact on the system when starting or stopping directly. When generating the acceleration and deceleration curve parameter table of the S-curve based on the table lookup method, a timer interrupt is usually used to obtain the parameter values in the acceleration and deceleration curve parameter table stored in the storage medium and set them to the automatic reload register of the timer to control the time period. The traditional method of generating the acceleration and deceleration curve parameter table of the S-curve is to divide the operation process into equal parts according to the number of microsteps, use the result of the equal division as the time variable to obtain the corresponding speed value in the Sigmoid function model, and directly convert it into the stepper motor acceleration and deceleration curve parameter table. This method does not take into account that the step length (i.e., step angle or step distance) of the stepper motor is fixed. When the timer updates the speed value, the timer cycle will also change accordingly, causing the actual speed curve of the stepper motor to deform. The deformed curve will prolong the acceleration or deceleration time, and increase the torque required for the stepper motor to operate, that is, more energy is required to change the speed of the stepper motor. Figure 2 As shown in the figure, taking the commonly used "S" type (Sigmoid function) acceleration and deceleration algorithm as an example, the horizontal axis in the figure is the number of running steps, and the vertical axis is the running speed (unit: step / second or PPS). Take the acceleration curve from 200PPS (step / second) to 2000PPS (step / second), execute 1040 steps, and the running mode is full step as an example: when the stepper motor speed is 200PPS (step / second), the time required to run one step is 1 / 200 second; when the stepper motor speed is 2000PPS (step / second), the time required to run one step is 1 / 2000 second. The difference in time period is 10 times, which will greatly affect the performance of the stepper motor. Figure 3 As shown, when the timer cycle change is not considered, the speed diagram and motor acceleration diagram when the S-type acceleration table is used for operation. To this end, in order to solve the technical problem that the timer cycle change is not considered in the process of generating the stepper motor acceleration and deceleration table by the classic table lookup method, a method for generating a stepper motor acceleration and deceleration table by setting a specific number of running steps to adjust from one speed to another is proposed, as follows:
[0068] Example 1
[0069] like Figure 5 As shown, this embodiment provides a method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction, comprising:
[0070] S1: Get the number of running steps of the stepper motor acceleration or deceleration process steps (using the differential step number as an input parameter is not universal, and the final parameter table of the differential step number is obtained, so it is full step in this embodiment), the unit of time for the stepper motor acceleration or deceleration nT (nT defaults to 1 in this embodiment, and will eventually be converted into the time of microstep operation), the differential mode microstepmode of the stepper motor (the specific implementation is that the value can be selected according to the actual situation, and the value can be 1, 2, 4, 8, 16, 32, etc.), the main frequency F of the single-chip timer freq , Stepper motor access speed PPS in (i.e. the initial speed of the stepper motor at the initial moment, unit: step / second (PPS), the target speed PPS of the stepper motor during acceleration or deceleration aim (Unit: steps per second, or PPS). The unit of the stepper motor acceleration or deceleration operation time is nT, where n is the coefficient and T is the total time taken by the stepper motor to run from the initial speed to the target speed of the acceleration or deceleration process. Set a suitable n so that nT=1 for easy subsequent calculations.
[0071] S2: Based on the initial speed and target speed, the typical S-shaped acceleration and deceleration curve model (Sigmoid function model) of the stepper motor is compensated and calculated to obtain the S-shaped speed curve of the stepper motor running speed, that is, the Sigmoid function of the stepper motor step number prediction. In the S-shaped speed curve, the horizontal axis (independent variable) is time, and the vertical axis (dependent variable) is the instantaneous speed (unit: step / second). The S-shaped speed curve can be calculated according to the input time point to obtain the speed of the stepper motor corresponding to the current time point.
[0072] The graph of the "S" type function (Sigmoid function) is the sum of a constant function and a standard Sigmoid function. Among them, the equation of the typical S-type curve (Sigmoid curve) of the stepper motor is as follows:
[0073]
[0074] Where nT represents the time unit for the acceleration or deceleration of the stepper motor, where n is the coefficient, T is the total time used for the actual operation from the initial speed of the stepper motor to the target speed of the acceleration or deceleration process, and a suitable n is set so that nT=1, which is convenient for subsequent calculations; x is the time variable represented by the time unit [0, nT]; Sigmoid(x) represents the S-shaped speed curve of the stepper motor's running speed, specifically refers to the speed of the stepper motor at time x (unit: steps / second, i.e., PPS); PPS in Indicates the initial speed of the stepper motor; PPS aim represents the target speed of the stepper motor (unit: steps per second, i.e., PPS); x∈[0, nT], then The empirical value is taken here, Δ is the Sigmoid function Take the infinite time function value and the Sigmoid function The difference of the function value when the value is -6 is used to compensate for the calculation of the initial speed PPS of the stepper motor in The difference (PPS) between the stepper motor and Sigmoid (0) at time 0 in -Sigmoid (0) | Δ=0 ), taking into account the change of the stepper motor's motion cycle during motion, correcting the error at the endpoint of the Sigmiod function domain, the stepper motor's target speed PPS aim The difference (PPS) between the speed Sigmoid (nT) of the stepper motor at nT aim -Sigmoid (nT) | Δ=0 ), after compensation calculation, the Sigmoid function of the stepper motor step prediction is obtained (nT takes the value of 1):
[0075]
[0076] Among them, Sigmoid (x) is the S-shaped speed curve of the stepper motor running speed (Sigmoid function model); PPS in is the initial speed of the stepper motor; PPS aim It is the target speed of the stepper motor acceleration or deceleration process; Explanation on nT value 1: When PPS in Sigmoid in and PPS aim When determining, the time period T is scaled and the corresponding time node (in proportion to the change in the graph, and is also proportional to the definite integral (area, total running distance) of the Sigmoid function, that is, the points with the same proportion of the definite integral (area) of the function waveform have the same function value; therefore, assuming an nT, the speed value of the stepper motor corresponds to the actual speed value of the stepper motor after the running definite integral is equally divided and then scaled back to the time nodes of the nT time period.
[0077] S3: Perform definite integral calculation on the S-shaped speed curve (Sigmoid function) of the stepper motor step speed to obtain the distance-time model function of the stepper motor during acceleration or deceleration; 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 that the stepper motor runs during acceleration or deceleration is:
[0079]
[0080] In the formula, Integralsigmoid (t) is the definite integral function of the stepper motor speed, that is, the total distance the stepper motor runs during acceleration or deceleration; Sigmoid(x) is the Sigmoid function of the stepper motor step number prediction; nT represents the time unit of the stepper motor acceleration or deceleration; x is the time variable in the time unit representation; t is time. The S-shaped speed curve obtained based on the initial speed and target speed of the stepper motor can be solved by solving the definite integral to obtain the total distance the stepper motor needs to run from the initial speed to the target speed.
[0081] S4: Invert the distance-time model function during the acceleration or deceleration process of the stepper motor to obtain the time-distance model function of the acceleration or deceleration process of the stepper motor, that is, the inverse function of the distance-time model function. In the time-distance model function, the horizontal axis (independent variable) is the distance; the vertical axis (dependent variable) is the time; the formula is as follows:
[0082] arcInegral(distence)=arc(Integral sigmoid (t))
[0083] Where, distance is the distance the stepper motor runs; Integral sigmoid (t) is the micro-step distance of the stepper motor from 0 to t. arc(Integral sigmoid (t)) means Integral sigmoid The inverse function expression of (t) (i.e., exchanging the independent variable and the dependent variable, or the symmetric function image with the straight line "t = distance" as the symmetry axis); arcInegral(distence) represents the inverse function of the stepper motor microstep distance time model function, i.e., the time distance model function of the stepper motor acceleration or deceleration process. According to the time distance function obtained by inversion, the time point corresponding to the distance can be obtained according to the input stepper motor running distance.
[0084] S5: Calculate the number of microsteps in the acceleration and deceleration process of the stepper motor according to the number of running steps in the acceleration and deceleration process of the stepper motor 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 represents the number of running steps in the acceleration and deceleration process of the stepper motor; microstepmode represents the differential mode of the stepper motor.
[0087] In particular, the "one step" in this embodiment refers to a step that the stepper motor moves forward each time driven by a pulse signal in the full stepping mode. The distance of each step of the stepper motor is fixed, which is related to the structural parameters of the motor.
[0088] Microstep mode: The stepper motor driver or stepper motor driver chip supports the effect of subdivision control by finely controlling the voltage and current; microstepping drive is a technology that subdivides the step distance of the stepper motor, allowing the motor to rotate in smaller increments than full steps. This technology uses 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 fine control of the winding current. In traditional stepper motor operation, the winding is usually fully opened or fully closed, corresponding to a specific polarity direction, so as to generate enough torque to make the motor turn to the next step angle. However, in microstepping drive mode, the controller divides the current into multiple levels (or "microsteps") instead of fully opening or fully closing.
[0090] Microstepping: 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-differential mode as an example, the original step (1.8°) requires 16 microsteps to complete, that is, 16 pulses.
[0091] S6: Based on the number of micro-steps in the acceleration and deceleration process of the stepper motor and the total distance of the stepper motor in the acceleration or deceleration process, that is, the micro-step distance of the stepper motor from the initial speed to the target speed, a micro-step running distance table of the stepper motor after equidistant division is calculated.
[0092] The running distance of the stepper motor is divided into equal intervals, and then the size of the equally divided area in the specific Sigmoid (x) function is obtained (fixed distance - the total micro-step running distance of the stepper motor). The calculation formula is as follows:
[0093] [distences] = slice (Integral sigmoid (nT), microsteps)
[0094] Where distances is the distance of multiple microsteps of the stepper motor; [distences] represents the collection of all microstep distances, i.e., the microstep distance table; microsteps represents the total number of microsteps during the acceleration and deceleration process; Integral sigmoid(nT) represents the total distance the stepper motor runs during the acceleration and deceleration process; slice(...,...) represents a slicing function, which receives two parameters: the total number of microsteps during the acceleration and deceleration process and the total distance during the acceleration and deceleration process. sigmoid (nT) is divided equally according to the number of microsteps and expanded according to the definition to obtain:
[0095]
[0096] in, It represents the ratio of the running distance from the first to microsteps microsteps (i.e., it is proportional to the total distance after each microstep), that is, the total distance Integral sigmoid (nT) is divided equally according to the number of microsteps; “…×[…]” means that the constant term is multiplied by the elements in the table to form a new array [distences].
[0097] S7: According to the micro-step operation distance table and the time distance model function of the stepper motor acceleration or deceleration process, the micro-step operation time node table of the stepper motor is calculated.
[0098] Based on the micro-stepping distance table of the stepper motor, the equation "arcInegral(distence)=arc(Integral sigmoid (t))” to calculate the micro-step operation time node table [timeslices] of the stepper motor, the formula is as follows:
[0099] [timeslices]=[arcInegral(distences)]
[0100] In the formula, timeslice is the running time node of a 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 each microstep runs a total distance, that is, 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 micro-step operation time node table of the stepper motor into the typical S-shaped acceleration and deceleration curve model (Sigmoid function model) of the stepper motor to obtain the speed table at each micro-step moment.
[0102] [SigmoidPPSList]=[Sigmoid(timeslices)]
[0103] Among them, timeslices is mapped to the time axis, and the value range is [0, nT=1]; [SigmoidPPSList] is the speed of each microstep moment corresponding to the microstep operation time node of the stepper motor; Sigmoid (timeslices) is the instantaneous running speed of each microstep of the stepper motor when it moves, which is obtained by substituting the time node table of the stepper motor into the typical S-shaped acceleration and deceleration curve model of the motor - the Sigmoid function (unit: steps / second, i.e. PPS).
[0104] S9: Use each speed value in the microstep speed table to generate the corresponding acceleration and deceleration curve parameters, that is, the automatic reload value of the single-chip microcomputer (in this embodiment, the pulse half-cycle time is selected, and the pulse duty cycle is 50%). The entire set of acceleration and deceleration curve parameters is the final output result, that is, the stepper motor acceleration and deceleration curve parameter table (referred to as the stepper motor acceleration and deceleration table).
[0105]
[0106] Where [Speedstables] is the stepper motor acceleration and deceleration curve parameter table, i.e., the MCU automatic reload value; F freq Indicates the main frequency of the microcontroller timer; microstepmode indicates the differential mode of the stepper motor (the value is 1, 2, 4, 8, 16, 32, etc.). Indicates the calculation method of each value, and then forms a new acceleration and deceleration table [Speedstables] based on all the MCU automatic reload values obtained. By applying the stepper motor acceleration and deceleration curve parameter table, the target speed can be smoothly reached, the torque lost by the stepper motor during acceleration and deceleration can be reduced, and the load capacity of the stepper motor during acceleration and deceleration can be increased.
[0107] The speed diagram and motor acceleration diagram generated by the acceleration and deceleration table according to the method of this embodiment are as follows: Figure 4 As shown. Figure 3 Comparison shows that the torque required for using the undeformed "S-shaped acceleration curve" is much smaller than the torque of the deformed "S-shaped acceleration curve". Therefore, under the same conditions, the stepper motor using the acceleration and deceleration curve parameter table generated by this embodiment will lose less torque during the acceleration and deceleration process, that is, the load capacity during acceleration and deceleration is increased, or the acceleration and deceleration is completed with fewer steps, or the maximum acceleration speed is increased, etc.
[0108] By writing the above stepper motor acceleration and deceleration curve parameter table (referred to as the stepper motor acceleration and deceleration table) into the storage medium, the controller uses the table lookup method to fill in the timer automatic reload register in sequence, so that the stepper motor can accurately adjust from the access speed to the target speed (including acceleration and deceleration) within the specified time, thereby achieving smooth movement, effectively reducing heat 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 linear motion of multiple stepper motors using the method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction as described above, including:
[0111] Step 1: Taking the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, where the calculation formula of the single-step transmission ratio is:
[0112]
[0113] Among them, p a is the single-step transmission ratio of stepper motor a; x 1 is the step angle of the reference stepper motor; x a is the step angle of stepper motor a; y 1 is the mechanical transmission ratio of the reference stepper motor; a is the mechanical transmission ratio of stepper motor a; The running direction of the reference stepper motor is f 1 The angle between the composite direction f of the velocity vectors of all stepper motors and the projection f′ of the reference stepper motor and the running plane of stepper motor a; is the running direction of the stepper motor a 2 The angle between the composite direction f of the velocity vectors of all stepper motors and the projection f′ of the reference stepper motor and the running plane of stepper motor a;
[0114] Step 2: Set the number of steps for the acceleration or deceleration of stepper motor a a Equal to the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps 1 ×p a ; Stepper motor a access speed PPS ina Equal to the entry speed of the reference stepper motor multiplied by the single-step transmission ratio PPS in1 ×p a ; Target speed PPS of stepper motor a aima Equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p a ;
[0115] Step 3: Generate acceleration / deceleration curve parameter tables for the reference motor and each stepper motor other than the reference motor using the stepper motor acceleration / deceleration curve parameter table generation method based on the step number prediction as described above.
[0116] In order to further illustrate the method, two stepper motors (a first motor m1 (same as the reference motor), a second motor m2 (same as the stepper motor a)) and a trolley mechanism c1 are used as examples to illustrate in detail:
[0117] like Figure 6 The figure shows a simplified diagram of the X and Y axis running directions of the classic gantry system: wherein f1 represents the running direction of the first motor m1, f2 represents the running direction of the second motor m2, and f represents the running direction of the gantry trolley mechanism c1.
[0118] The angle between the X and Y axis running directions is determined according to the actual implementation method, and the classic value is 90°. In order to realize the gantry trolley mechanism c1 running along the running direction f, the speed vector is decomposed from the f direction to the f1 and f2 directions to obtain the running speed of the first motor m1 and the second motor m2 in a proportional relationship, and the proportional coefficient is the single-step transmission ratio of the two (considering the step angle difference).
[0119] During operation, the access speed, target speed, and number of running steps of the first motor m1 and the second motor m2 are the same as the single-step transmission ratio; the running time of the first motor m1 and the second motor m2 is the same. Based on the step number prediction-based stepper motor acceleration and deceleration curve parameter table generation method proposed above, the stepper motor acceleration and deceleration curve parameter table of the first motor m1 and the second motor m2 is generated. Specifically:
[0120] Take the first motor m1 as the reference stepper motor and obtain the number of acceleration or deceleration steps of the first motor m1 m1 , stepper motor acceleration or deceleration operation time unit nT, stepper motor differential mode microstepmode m1 , MCU timer main frequency F freq_m1 , Stepper motor access speed PPS in_m1 (i.e. the initial speed at the initial moment, unit: step / second), the target speed PPS of the stepper motor during acceleration or deceleration aim_m1 (Unit: step / second). And calculate the acceleration or deceleration parameter table of the first motor m1 [Speedstables m1 ];
[0121] Get the number of steps of acceleration or deceleration of the second motor m2 m2 , stepper motor acceleration or deceleration operation time unit nT, stepper motor differential mode microstepmode m2 , MCU timer main frequency Ffreq_m2 , the access speed PPS of the stepper motor in_m2 (i.e. the initial speed at the initial moment, unit: step / second), the target speed PPS of the stepper motor during acceleration or deceleration aim_m2 Calculate the acceleration or deceleration parameter table of the second motor m2 [Speedstables m2 ];
[0122] The number of steps for the acceleration or deceleration of the second motor m2 is steps m2 Equal to the number of acceleration or deceleration steps of the first motor m1 multiplied by the single-step transmission ratio steps m1 ×p; the access speed PPS of the second motor m2 in_m2 Equal to the access speed of the first motor m1 multiplied by the single-step transmission ratio PPS in_m1 ×p, the target speed PPS of the second motor m2 aim_m2 Equal to the target speed of the first motor m1 multiplied by the single-step transmission ratio PPS aim_m1 ×p. By converting the above stepper motor acceleration and deceleration curve parameter table ([Speedstables m1 ]、[Speedstables m2 ]) is written into the storage medium, and the controller uses the table lookup method to fill in the timer automatic reload register in sequence, controlling the first motor m1 and the second motor m2 to move simultaneously, solving the speed vector synthesis of two or more motors.
[0123] This embodiment can be extended to the speed vector synthesis of multiple motors, such as Figure 7 As shown, taking the speed vector synthesis of three motors as an example, according to the method of this embodiment, a reference motor is selected as the first motor m1 to obtain different single-step transmission ratios p 1 , p 2 , the method of this embodiment is used to obtain and obtain the corresponding stepper motor acceleration and deceleration curve parameter table ([Speedstables m1 ]、[Speedstables m2 ]). It is worth noting that Figure 7 As shown, the single-step transmission ratio p of the stepper motor m2 is calculated using the first motor m1. 1 When the angle is the angle between the projection f′ of the trolley direction f on the running plane of the first motor m1 and the second motor m2; the single-step transmission ratio p of the stepper motor m3 is calculated by using the reference motor m1. 2 When , the angle is the angle of the projection f″ of the trolley direction f on 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 rotation motion of multiple stepper motors using the method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction as described above, including:
[0126] Step 1: Taking the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, where the calculation formula of the single-step transmission ratio is:
[0127]
[0128] Among them, p b is the single-step transmission ratio of stepper motor b; x 1 is the step angle of the reference stepper motor; x b is the step angle of stepper motor b; y 1 is the mechanical transmission ratio of the reference stepper motor; b is the mechanical transmission ratio of stepper motor b;
[0129] Step 2: Set the number of steps for the acceleration or deceleration of stepper motor b b Equal to the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps 1 ×p b ; Stepper motor b's access speed PPS inb Equal to 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 Equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p b ;
[0130] Step 3: Generate acceleration / deceleration curve parameter tables for the reference motor and each stepper motor other than the reference motor using the stepper motor acceleration / deceleration curve parameter table generation method based on the step number prediction as described above.
[0131] In order to further illustrate the method, a card flipping mechanism is taken as an example to be described in detail. Figure 8 As shown, it includes a first motor m1 (same as the reference motor described above), a second motor m2 (same as the stepping motor b described above), a flip mechanism 1, a card shifting gear 2 and a target card 3, m1-1 is the transmission shaft of the first motor m1, m2-1 is the transmission shaft of the second motor m2, 1-1 is a side projection of the first motor m1, and 1-2 is a side projection of the second motor m2:
[0132] In order to ensure that the card can be moved and functions such as card flipping can be realized, 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 operating speeds of the first motor m1 and the second motor m2 are proportional, the proportional coefficient is the transmission ratio of the two (taking into account the step angle difference).
[0133] During operation, the access speed, target speed, and number of running steps of the first motor m1 and the second motor m2 are the same as the transmission ratio; the running time of the first motor m1 and the second motor m2 is the same. Based on the method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction proposed by the present invention, the stepper motor acceleration and deceleration curve parameter table of the first motor m1 and the second motor m2 is generated. Specifically:
[0134] If the step angle of the first motor m1 is x1, the step angle of the second motor m2 is x2, 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] Taking the first motor m1 as the reference, get the number of acceleration or deceleration steps of the first motor m1 m1 , stepper motor acceleration or deceleration operation time unit nT, stepper motor differential mode microstepmode m1 , MCU timer main frequency F freq_m1 , Stepper motor access speed PPS in_m1 (i.e. the initial speed at the initial moment, unit: step / second), the target speed PPS of the stepper motor during acceleration or deceleration aim_m1 (Unit: step / second). And calculate the acceleration or deceleration parameter table of the first motor m1 [Speedstables m1 ];
[0136] Get the number of steps of acceleration or deceleration of the second motor m2 m2 , stepper motor acceleration or deceleration operation time unit nT, stepper motor differential mode microstepmode m2 , MCU timer main frequency F freq_m2 , Stepper motor access speed PPS in_m2 (i.e. the initial speed at the initial moment, unit: step / second), the target speed PPS of the stepper motor during acceleration or deceleration aim_m2 Calculate the acceleration or deceleration parameter table of the second motor m2 [Speedstables m2 ];
[0137] The number of steps for the acceleration or deceleration of the second motor m2 is steps m2Equal to the number of acceleration or deceleration steps of the first motor m1 multiplied by the single-step transmission ratio steps m1 ×p; the access speed PPS of the second motor m2 in_m2 Equal to the access speed of the first motor m1 multiplied by the single-step transmission ratio PPS in_m1 ×p, the target speed PPS of the second motor m2 aim_m2 Equal to the target speed of the first motor m1 multiplied by the single-step transmission ratio PPS aim_m1 ×p.
[0138] By converting the above stepper motor acceleration and deceleration curve parameter table ([Speedstables m1 ]、[Speedstables m2 ]) is written into the storage medium, and the controller uses the table lookup method to fill in the timer automatic reload register in sequence, controlling the first motor m1 and the second motor m2 to move simultaneously, solving the problem of vector synthesis of the rotation speed of the two coaxial motors.
[0139] This embodiment can be extended to the speed vector synthesis of multiple motors, but the main working condition is a dual-motor type, and the calculation method is the calculation method of the dual motor 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), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the type of device.
[0141] The readable storage medium is a computer-readable storage medium, which may be an internal storage unit of the controller described in any of the foregoing embodiments, such as a hard disk or memory of the controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the controller. Furthermore, the readable storage medium may also include both an internal storage unit of the controller and an external storage device. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0142] Based on this understanding, the technical solution of the present invention, in essence or in other words, the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.
[0143] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0144] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction, characterized in that: include: S1: Get the number of running steps of the stepper motor during acceleration or deceleration, the running time unit of the stepper motor during acceleration or deceleration, 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 stepper motor during acceleration or deceleration; S2: Based on the initial speed and target speed, the typical S-shaped acceleration and deceleration curve model of the stepper motor is compensated and calculated to obtain the S-shaped speed curve of the stepper motor running speed; S3: Perform definite integral calculation on the S-shaped speed curve of the stepper motor step speed to obtain the distance-time model function of the stepper motor during acceleration or deceleration, and then calculate the total distance of the stepper motor during acceleration or deceleration; S4: inverting the distance-time model function to obtain a time-distance model function of the stepper motor acceleration or deceleration process, that is, an inverse function of the distance-time model function; S5: Calculate the number of micro-steps in the acceleration and deceleration process of the stepper motor according to the number of running steps in the acceleration and deceleration process of the stepper motor and the differential mode of the stepper motor; S6: Based on the number of micro-steps in the acceleration and deceleration process of the stepper motor and the total distance of the stepper motor in the acceleration or deceleration process, a micro-step running distance table of the stepper motor after equal-distance division is calculated; S7: combining the micro-step running distance table and the time distance model function of the stepping motor acceleration or deceleration process, calculating and obtaining the micro-step running time node table of the stepping motor; S8: Substitute the micro-step operation time node table of the stepper motor into the S-shaped speed curve of the stepper motor operation speed for calculation to obtain the speed table at each micro-step moment; S9: Generate corresponding acceleration and deceleration curve parameters using each speed value in the micro-step speed table. The entire set of acceleration and deceleration curve parameters is the final output result, i.e., the stepper motor acceleration and deceleration curve parameter table.
2. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The S-shaped speed curve of the stepper motor running speed in S2 is as follows: Among them, Sigmoid(x) is the S-shaped speed curve of the stepper motor running speed, that is, the Sigmoid function of the stepper motor step number prediction; PPS in is the initial speed of the stepper motor; PPS aim is the target speed of the stepper motor acceleration or deceleration process; nT is represented by the preset time unit, where n is the coefficient, T is the total time actually used to run from the initial speed of the stepper motor to the target speed of the acceleration or deceleration process, nT=1; x is the time variable in the time unit representation.
3. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The total distance that the stepper motor runs during acceleration or deceleration in S3 is: In the formula, Integral sigmoid (t) is the total distance traveled during the acceleration or deceleration process of the stepper motor, and is the definite integral function of the stepper motor speed; Sigmoid(x) is the Sigmoid function for predicting the number of steps of the stepper motor; nT represents the time unit of the acceleration or deceleration operation of the stepper motor; x is the time variable in the time unit representation; and t is time.
4. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The time distance model function arcInegral(distence) of the stepper motor acceleration or deceleration process in S4 is: arcInegral(distence)=arc(Integral sigmoid (t)) Where, distance is the distance the stepper motor runs; Integral sigmoid (t) is the micro-step distance that the stepper motor rotates from time 0 to time t.
5. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The calculation formula for the number of microsteps in the acceleration and deceleration process of the stepper motor in S5 is: microsteps=steps×microstepmode In the formula, microsteps represents the total number of microsteps in the acceleration or deceleration process of the stepper motor; steps is the number of running steps in the acceleration or deceleration process of the stepper motor; microstepmode represents the differential mode of the stepper motor.
6. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The method for obtaining the micro-step running distance table of the stepper motor in S6 is: Where, distances is the distance of multiple 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 the stepper motor runs during acceleration and deceleration; To Integral the total distance sigmoid (nT) is divided into microsteps; microsteps is the total number of microsteps in the acceleration and deceleration process of the stepper motor; nT is the unit of time for the acceleration or deceleration of the stepper motor.
7. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The method for obtaining the micro-step operation time node table of the stepper motor in S7 is: [timeslices]=[arcInegral(distences)] In the formula, timeslice is the running time node of a 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 for each microstep running total distance, that is, the time node table [timeslices].
8. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The speed table for each microstep in S8 is: [SigmoidPPSList]=[Sigmoid(timeslices)] Wherein, [SigmoidPPSList] is the speed of each microstep moment corresponding to the microstep operation time node of the stepper motor; Sigmoid(timeslices) is the instantaneous operating speed of each microstep of the stepper motor when it moves, which is obtained by substituting the microstep operation time node table of the stepper motor into the S-shaped speed curve model of the stepper motor operating speed.
9. The method for generating a stepper motor acceleration and deceleration curve parameter table based on step number prediction according to claim 1, characterized in that: The calculation formula of the stepper motor acceleration and deceleration curve parameter table in S9 is: Where [Speedstables] is the stepper motor acceleration and deceleration curve parameter table, that is, the MCU automatic reload value; F freq Indicates the main frequency of the microcontroller timer; microstepmode indicates the differential mode of the stepper motor.
10. A method for controlling linear motion of multiple stepper motors based on the method according to any one of claims 1 to 9, characterized in that: include: Step 1: Taking the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, where the calculation formula of the single-step transmission ratio is: Among them, p a is the single-step transmission ratio of stepper motor a; x1 is the step angle of the reference stepper motor; x a is the step angle of stepper motor a; y1 is the mechanical transmission ratio of the reference stepper motor; y a is the mechanical transmission ratio of stepper motor a; is the angle between the running direction f1 of the reference stepper motor and the projection f′ of the speed vector synthesis direction f of all stepper motors on the running plane of the reference stepper motor and stepper motor a; It is the angle between the running direction f2 of stepper motor a and the projection f′ of the speed vector synthesis direction f of all stepper motors on the running plane of the reference stepper motor and stepper motor a; Step 2: Set the number of steps for the acceleration or deceleration of stepper motor a a Equal to the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps1×p a ; Stepper motor a access speed PPS ina Equal to the entry speed of the reference stepper motor multiplied by the single-step transmission ratio PPS in1 ×p a ; Target speed PPS of stepper motor a aima Equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p a ; Step 3: Generate an acceleration / deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor using the method described in any one of claims 1 to 9.
11. A method for controlling the coaxial rotational motion of multiple stepper motors based on the method according to any one of claims 1 to 9, characterized in that: include: Step 1: Taking the reference stepper motor as a reference, calculate the single-step transmission ratio of each stepper motor other than the reference stepper motor, where the calculation formula of the single-step transmission ratio is: Among them, p b is the single-step transmission ratio of stepper motor b; x1 is the step angle of the reference stepper motor; x b is the step angle of stepper motor b; y1 is the mechanical transmission ratio of the reference stepper motor; y b is the mechanical transmission ratio of stepper motor b; Step 2: Set the number of steps for the acceleration or deceleration of stepper motor b b Equal to the number of acceleration or deceleration steps of the reference stepper motor multiplied by the single-step transmission ratio steps1×p b ; Stepper motor b's access speed PPS inb Equal to 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 Equal to the target speed of the reference stepper motor multiplied by the single-step transmission ratio PPS aim1 ×p b ; Step 3: Generate an acceleration / deceleration curve parameter table of the reference motor and each stepper motor other than the reference motor using the method described in any one of claims 1 to 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
Motor control apparatus, motor control method, and program
US20180302009A1