Stepping motor control method and electronic equipment

The stepper motor is controlled by the fractional function curve acceleration and deceleration relationship, which solves the problems of both motion stability and acceleration and deceleration efficiency in the prior art, and achieves a stable and efficient acceleration and deceleration process.

CN119134978APending Publication Date: 2024-12-13SHIJIAZHUANG YULIAN VIDEO CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411305566.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing stepper motor control methods cannot take into account both motion stability and acceleration and deceleration efficiency. The trapezoidal curve acceleration and deceleration algorithm leads to a large impact, while the S-shaped curve acceleration and deceleration algorithm is computationally large and has low efficiency.

Method used

The fractional function curve acceleration and deceleration relationship is adopted to determine the total number of acceleration and deceleration steps through preset operating parameters, solve the curve parameters to be solved, and determine the pulse time series to control the operation of the stepper motor. The curve slope is first gradually increasing and then gradually decreasing. , simplify calculations, improve response speed and efficiency.

Benefits of technology

The stepper motor is able to operate smoothly during the acceleration and deceleration process, improve the response speed and acceleration and deceleration efficiency, avoid shock vibration, and simplify the calculation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119134978A_ABST
    Figure CN119134978A_ABST
Patent Text Reader

Abstract

The invention provides a stepping motor control method and electronic equipment. The method comprises the following steps: acquiring a control parameter and a preset operation parameter of the stepping motor; based on the preset operation parameters, determining the total acceleration and deceleration step number of the stepping motor in the acceleration and deceleration process; acquiring a preset fractional function curve acceleration and deceleration relational expression; the relational expression comprises to-be-solved curve parameters, and the relational expression is used for representing a mapping relation between acceleration and deceleration steps and a pulse time interval; determining values of to-be-solved curve parameters according to the control parameters and the total acceleration and deceleration step number; and according to the total acceleration and deceleration step number, the relational expression and the value of the to-be-solved curve parameter, determining a pulse time sequence corresponding to the stepping motor in the acceleration and deceleration process, and controlling the stepping motor to operate based on the pulse time sequence. In the process of controlling the stepping motor, the motion stability and acceleration and deceleration efficiency of the stepping motor can be considered at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motor control, and in particular to a control method of a stepping motor and electronic equipment. Background Art

[0002] The stepper motor can convert the received pulse signal into mechanical angular displacement or linear displacement, thereby controlling the movement of the operating mechanism. Stepper motors are successfully used in the printer, telescopic mechanism, card sorting mechanism and other motion mechanisms of highway toll robots.

[0003] The acceleration and deceleration algorithm is a key technology for controlling stepper motors. Common acceleration and deceleration algorithms are usually trapezoidal curve acceleration and deceleration algorithms or S-curve acceleration and deceleration algorithms. Among them, the trapezoidal curve acceleration and deceleration algorithm has the advantages of simple algorithm, fast response and high efficiency. However, it cannot smoothly transition at the turning points of speed change and uniform speed, resulting in greater impact during movement. The S-curve acceleration and deceleration algorithm can make the movement of the motion mechanism more stable and the impact vibration is smaller, but the implementation process is more complicated and the amount of calculation is large, resulting in low acceleration and deceleration efficiency. In summary, the existing acceleration and deceleration algorithms cannot take into account both motion stability and acceleration and deceleration efficiency at the same time. Summary of the invention

[0004] The embodiments of the present invention provide a control method of a stepper motor and an electronic device to solve the problem that the existing control method of a stepper motor cannot take into account both motion stability and acceleration and deceleration efficiency.

[0005] In a first aspect, an embodiment of the present invention provides a method for controlling a stepping motor, comprising:

[0006] Obtain control parameters and preset operating parameters of the stepper motor;

[0007] Based on the preset operating parameters, determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process;

[0008] Obtaining a preset fractional function curve acceleration and deceleration relationship; the relationship includes the curve parameters to be solved, and the relationship is used to express the mapping relationship between the acceleration and deceleration steps and the pulse time interval;

[0009] Determining the value of the curve parameter to be solved according to the control parameter and the total number of acceleration and deceleration steps;

[0010] According to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, the pulse time sequence corresponding to the stepper motor during the acceleration and deceleration process is determined, and the operation of the stepper motor is controlled based on the pulse time sequence.

[0011] In a possible implementation, the control parameters include: rated speed and motor subdivision setting value; the curve parameters to be solved include: first curve parameters, second curve parameters and third curve parameters;

[0012] Determining the value of the curve parameter to be solved according to the control parameter and the total number of acceleration and deceleration steps includes:

[0013] Determine respectively a first product of the rated speed and the motor subdivision setting value, and a second product of the total number of acceleration and deceleration steps and a preset first tuning coefficient, and determine the value of the first curve parameter according to the ratio of the second product to the first product;

[0014] The values ​​of the second curve parameter and the third curve parameter are correspondingly determined according to the product of the value of the first curve parameter and the preset second tuning coefficient, and the product of the value of the first curve parameter and the preset third tuning coefficient.

[0015] In a possible implementation, the preset second tuning coefficient is the second tuning coefficient after the tuning is completed;

[0016] Before respectively determining the values ​​of the second curve parameter and the third curve parameter according to the product of the value of the first curve parameter and the preset second tuning coefficient, and the product of the value of the first curve parameter and the preset third tuning coefficient, the method further includes:

[0017] Obtaining an initial second tuning coefficient and a third tuning coefficient, and determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, and the value of the first curve parameter, and jumping to the step of determining the pulse time sequence corresponding to the stepper motor in the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence;

[0018] Acquiring an actual operating state of the stepper motor, and detecting whether the stepper motor is out of step according to the actual operating state;

[0019] If the stepper motor loses step, the second tuning coefficient is adjusted, and based on the adjusted second tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient and the value of the first curve parameter, until the stepper motor does not lose step and the second tuning coefficient after tuning is obtained.

[0020] In a possible implementation manner, after detecting whether the stepping motor is out of step, the method further includes:

[0021] If the stepping motor does not lose steps, the number of adjustments is initialized;

[0022] According to the actual operating state, detecting whether the actual acceleration and deceleration time of the stepping motor has exceeded;

[0023] If the actual acceleration and deceleration time of the stepper motor exceeds the time limit, detecting whether the adjustment times reaches a preset value;

[0024] If the number of adjustments does not reach the preset value, the second tuning coefficient is adjusted and the number of adjustments is updated. Based on the adjusted second tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches the preset value, and the second tuning coefficient after the tuning is completed is obtained.

[0025] In a possible implementation, the preset third tuning coefficient is the third tuning coefficient after the tuning is completed;

[0026] After detecting whether the adjustment times reaches a preset value, the method further includes:

[0027] If the number of adjustments reaches a preset value, the third tuning coefficient is adjusted, and based on the adjusted third tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, and the third tuning coefficient after the tuning is completed is obtained.

[0028] In a possible implementation, if the stepping motor loses step, adjusting the second tuning coefficient includes:

[0029] If the stepping motor loses step, respectively obtaining a current value and a lower limit value corresponding to the second tuning coefficient;

[0030] An average value of the current value and the lower limit value is determined as a new current value corresponding to the second tuning coefficient.

[0031] In a possible implementation, if the number of adjustments does not reach a preset value, adjusting the second tuning coefficient includes:

[0032] If the number of adjustments does not reach the preset value, respectively obtaining the current value and the upper limit value corresponding to the second tuning coefficient;

[0033] An average value of the current value and the upper limit value is determined as a new current value corresponding to the second tuning coefficient.

[0034] In a possible implementation, the acceleration / deceleration relationship of the fractional function curve is:

[0035]

[0036] Wherein, f(n) represents the pulse time interval between the pulse emission time corresponding to the nth acceleration / deceleration step and the pulse emission time corresponding to the n-1th acceleration / deceleration step, a represents the first curve parameter, b represents the second curve parameter, c represents the third curve parameter, n represents the acceleration / deceleration step, n=1, 2, 3...N, and N represents the total number of acceleration / deceleration steps;

[0037] Determining the value of the first curve parameter according to the ratio of the second product to the first product includes:

[0038] according to determining a value of the first curve parameter;

[0039] Among them, a represents the first curve parameter, k1 represents the preset first tuning coefficient, r represents the rated speed, and s represents the motor subdivision setting value.

[0040] In a possible implementation, the preset operation parameters include: a preset total number of operation steps, a preset total operation time, and a preset acceleration and deceleration time;

[0041] The step of determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process based on the preset operating parameters includes:

[0042] according to Determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process;

[0043] Wherein, N represents the total number of acceleration and deceleration steps, N G Indicates the total number of preset running steps, T G Indicates the total preset running time, T A Indicates the preset acceleration and deceleration time, and ΔT indicates the average pulse interval time.

[0044] In a second aspect, an embodiment of the present invention provides a control device for a stepping motor, comprising:

[0045] An acquisition module is used to acquire control parameters and preset operating parameters of the stepper motor;

[0046] Compute module for:

[0047] Based on the preset operating parameters, determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process;

[0048] Obtaining a preset fractional function curve acceleration and deceleration relationship; the relationship includes the curve parameters to be solved, and the relationship is used to express the mapping relationship between the acceleration and deceleration steps and the pulse time interval;

[0049] Determining the value of the curve parameter to be solved according to the control parameter and the total number of acceleration and deceleration steps;

[0050] A control module is used to determine the pulse time sequence corresponding to the stepper motor during the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and control the operation of the stepper motor based on the pulse time sequence.

[0051] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements the steps of the method described in the first aspect or any possible implementation manner of the first aspect.

[0052] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.

[0053] The embodiment of the present invention provides a control method and electronic device for a stepper motor. The total number of acceleration and deceleration steps can be determined by the preset operating parameters of the stepper motor. Subsequently, the preset fractional function curve acceleration and deceleration relationship is obtained, and the control parameters of the stepper motor and the total number of acceleration and deceleration steps are used to solve the value of the curve parameter to be solved in the fractional function curve acceleration and deceleration relationship. Then, according to the total number of acceleration and deceleration steps, the relationship and the curve parameter to be solved, the pulse time sequence of the stepper motor in the acceleration and deceleration process is determined to control the operation of the stepper motor. Among them, the curve slope of the fractional function curve conforms to the ideal speed change trend of the stepper motor gradually increasing and then gradually decreasing during the acceleration and deceleration process, and compared with the S-shaped curve, the fractional function curve relationship is simpler and has a smaller amount of calculation. The embodiment of the present invention uses the fractional function curve acceleration and deceleration relationship to express the mapping relationship between the acceleration and deceleration steps and the pulse time interval, thereby determining the pulse time sequence to control the operation of the stepper motor, which can not only ensure the smooth operation of the stepper motor during the acceleration and deceleration process, but also improve the response speed and acceleration and deceleration efficiency of the stepper motor. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 labor.

[0055] Figure 1 is a flow chart of an implementation method of a stepping motor control method provided by an embodiment of the present invention;

[0056] Figure 2 is a schematic diagram of a curve shape corresponding to a fractional function curve provided by an embodiment of the present invention;

[0057] Figure 3 is a schematic diagram of another curve shape corresponding to the fractional function curve provided by an embodiment of the present invention;

[0058] Figure 4 is a flowchart of implementing tuning of the second tuning coefficient provided by an embodiment of the present invention;

[0059] Figure 5 is a flowchart of implementing tuning of the second tuning coefficient and the third tuning coefficient provided by another embodiment of the present invention;

[0060] Figure 6 is a schematic structural diagram of a control device for a stepping motor provided in an embodiment of the present invention;

[0061] Figure 7 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0063] Acceleration and deceleration algorithms are key technologies for controlling stepper motors. For acceleration and deceleration algorithms, on the one hand, the acceleration and deceleration process must be smooth and stable, with small flexible impact; on the other hand, the response time must be fast, the reaction must be rapid, and the acceleration and deceleration efficiency must be high. Therefore, how to improve the acceleration and deceleration efficiency while ensuring the smoothness and stability of the acceleration and deceleration process to achieve smooth and efficient movement is a key issue in controlling stepper motors.

[0064] Common acceleration and deceleration algorithms are usually trapezoidal curve acceleration and deceleration algorithms or S-curve acceleration and deceleration algorithms. Among them, the trapezoidal curve acceleration and deceleration algorithm refers to acceleration and deceleration in a certain proportion in a straight line manner (acceleration and deceleration from the starting speed to the target speed). The trapezoidal curve has the advantages of simple algorithm, fast response and high efficiency. However, the trapezoidal curve adopts a uniform acceleration and deceleration method in the acceleration and deceleration stage, which does not conform to the speed change law of the stepper motor. It cannot smoothly transition at the turning point of speed change and uniform speed, resulting in a large flexible impact during the acceleration and deceleration process.

[0065] The S-curve acceleration and deceleration algorithm mainly includes sin curve, quadratic curve, cyclic curve and cubic curve. The S-curve acceleration and deceleration algorithm is relatively slow in the initial acceleration and deceleration stage, and then gradually speeds up. At the end of the acceleration and deceleration process, the speed slows down again, so that the acceleration and deceleration process can be more stable and the impact vibration is smaller. However, the implementation process of the S-curve acceleration and deceleration algorithm is relatively complicated, and the amount of calculation is large, resulting in low acceleration and deceleration efficiency. In summary, the existing acceleration and deceleration algorithms cannot take into account both motion stability and acceleration and deceleration efficiency at the same time.

[0066] In order to take into account both the stability and acceleration / deceleration efficiency of the stepper motor during the acceleration / deceleration process, in the embodiment of the present invention, a preset fractional function curve acceleration / deceleration relationship is used to determine the pulse time sequence during the acceleration / deceleration process, thereby controlling the acceleration / deceleration of the stepper motor. Among them, the slope of the fractional function curve satisfies the trend of gradually increasing first and then gradually decreasing, which conforms to the speed change law of the stepper motor, and can make the stepper motor accelerate / decelerate smoothly. Moreover, compared with S-shaped curves such as sin curves, quadratic curves, and cyclic curves, the fractional function curve has a small amount of calculation, a faster response, and a higher acceleration / deceleration efficiency.

[0067] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.

[0068] Figure 1 The implementation flow chart of the control method of the stepping motor provided by the embodiment of the present invention is described in detail as follows:

[0069] Step 101, obtaining control parameters and preset operating parameters of the stepper motor.

[0070] In the embodiment of the present invention, the control parameters include but are not limited to the rated speed of the stepper motor and the motor subdivision setting value of the stepper motor, etc. The preset operation parameters include but are not limited to the preset total number of operation steps, the preset total operation time and the preset acceleration and deceleration time.

[0071] The above preset operating parameters can be determined according to the motion mechanism connected to the stepper motor and the actual motion scene. Different motion mechanisms and different motion scenes correspond to different preset operating parameters.

[0072] Step 102: determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process based on preset operating parameters.

[0073] According to the motion mechanism and motion scene corresponding to the stepper motor, the preset total number of running steps, the preset total running time and the preset acceleration and deceleration time of the stepper motor in the entire motion process under the motion scene can be determined accordingly, and then the total number of acceleration and deceleration steps of the stepper motor in the acceleration and deceleration process can be determined.

[0074] In some embodiments, the Determine the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process.

[0075] Where N represents the total number of acceleration and deceleration steps, N G Indicates the total number of preset running steps, T G Indicates the total preset running time, T A Indicates the preset acceleration and deceleration time, and ΔT indicates the average pulse interval time.

[0076] Here, the values ​​of the preset total number of running steps and the preset total running time can be directly determined according to the motion mechanism and motion scene corresponding to the stepper motor. The value of the preset acceleration and deceleration time is usually between 10ms and 300ms. The specific value can be determined according to the stepper motor. The value of the average pulse interval time is usually between 0.8ms and 1.2ms.

[0077] Step 103: Obtain a preset fractional function curve acceleration / deceleration relationship equation, which is used to express the mapping relationship between acceleration / deceleration steps and pulse time intervals.

[0078] The acceleration and deceleration relationship of the fractional function curve can be expressed as:

[0079] Among them, f(n) represents the pulse time interval between the pulse emission time corresponding to the nth acceleration / deceleration step and the pulse emission time corresponding to the n-1th acceleration / deceleration step, a represents the first curve parameter, b represents the second curve parameter, c represents the third curve parameter, n represents the acceleration / deceleration step, n=1, 2, 3…N, and N represents the total number of acceleration / deceleration steps.

[0080] The curve shape corresponding to the acceleration and deceleration relationship of the above fractional function curve is as follows Figure 2 or Figure 3 As shown in the figure, the slope of the acceleration and deceleration curve of the above fractional function curve first gradually increases and then gradually decreases. Accordingly, the speed of the stepper motor can be relatively slow in the initial acceleration and deceleration stage, and then gradually speed up. The speed slows down again near the end of the acceleration and deceleration process, which conforms to the speed change law of the stepper motor and can achieve smooth acceleration and deceleration.

[0081] Moreover, compared with S-shaped curves such as sin curves, quadratic curves, cyclic curves and cubic curves, the above-mentioned fractional function curve relationship is simpler and requires less calculation. Accordingly, its response speed is faster and the acceleration and deceleration efficiency is higher, thereby achieving improved response speed and acceleration and deceleration efficiency while ensuring smooth and stable acceleration and deceleration processes.

[0082] Step 104, determining the value of the curve parameter to be solved according to the control parameter and the total number of acceleration and deceleration steps.

[0083] The first curve parameter, the second curve parameter and the third curve parameter in the above relationship are all curve parameters to be solved.

[0084] According to the above rated speed, motor subdivision setting value and total number of acceleration and deceleration steps, the values ​​of the first curve parameter, the second curve parameter and the third curve parameter can be solved accordingly.

[0085] In some embodiments, when solving the values ​​of the above-mentioned first curve parameter, second curve parameter and third curve parameter, the first product of the rated speed and the motor subdivision setting value, and the second product of the total number of acceleration and deceleration steps and the preset first tuning coefficient can be determined respectively, and the value of the first curve parameter can be determined according to the ratio of the second product to the first product; then, the values ​​of the second curve parameter and the third curve parameter are determined accordingly according to the product of the value of the first curve parameter and the preset second tuning coefficient, and the product of the value of the first curve parameter and the preset third tuning coefficient.

[0086] Specifically, according to determining a value of a first curve parameter;

[0087] Wherein, a represents the first curve parameter, k1 represents the preset first tuning coefficient, r represents the rated speed, s represents the motor subdivision setting value, and N represents the total number of acceleration and deceleration steps.

[0088] The value of the second curve parameter is determined according to b=k2×a, wherein k2 represents a preset second tuning coefficient.

[0089] The value of the third curve parameter is determined according to c=k3×a, wherein k3 represents a preset third tuning coefficient.

[0090] Here, the first tuning coefficient is in direct proportion to the preset acceleration / deceleration time. When the preset acceleration / deceleration time is known, the value of the preset first tuning coefficient can be directly determined.

[0091] The second tuning coefficient and the third tuning coefficient are used to adjust the speed mutation and impact vibration problems of the stepper motor during the acceleration and deceleration process. In the embodiment of the present invention, the second tuning coefficient and the third tuning coefficient can be adjusted and optimized in advance to overcome the speed mutation and impact vibration problems of the stepper motor during the acceleration and deceleration process, thereby obtaining the second tuning coefficient and the third tuning coefficient after the tuning is completed, that is, the preset second tuning coefficient and the third tuning coefficient.

[0092] Step 105, determining the pulse time sequence corresponding to the stepper motor during the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relational expression and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence.

[0093] It can be understood that each time the stepper motor receives a pulse, it executes an acceleration / deceleration step, and the acceleration / deceleration steps correspond to the pulses one by one.

[0094] Based on the above relationship and the value of the curve parameter to be solved, the mathematical relationship between the acceleration and deceleration steps and the pulse time interval can be determined. By inputting each acceleration and deceleration step into the above mathematical relationship in turn, the pulse emission time corresponding to each acceleration and deceleration step and the pulse time interval between the pulse emission time corresponding to the previous acceleration and deceleration step can be determined, so that the pulse emission time corresponding to each acceleration and deceleration step in the entire acceleration and deceleration process can be obtained to form a pulse time sequence. Then the operation of the stepper motor can be controlled.

[0095] The pulse time sequence includes multiple pulses and the pulse emission time corresponding to each pulse.

[0096] The embodiment of the present invention can determine the total number of acceleration and deceleration steps through the preset operating parameters of the stepper motor, and then obtain the preset fractional function curve acceleration and deceleration relationship, and use the control parameters of the stepper motor and the total number of acceleration and deceleration steps to solve the value of the curve parameter to be solved in the fractional function curve acceleration and deceleration relationship, and then determine the pulse time sequence of the stepper motor in the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the curve parameter to be solved to control the operation of the stepper motor. Among them, the curve slope of the fractional function curve conforms to the ideal speed change trend of the stepper motor gradually increasing and then gradually decreasing during the acceleration and deceleration process, and compared with the S-shaped curve, the fractional function curve relationship is simpler and has a smaller amount of calculation. The embodiment of the present invention uses the fractional function curve acceleration and deceleration relationship to express the mapping relationship between the acceleration and deceleration steps and the pulse time interval, so as to determine the pulse time sequence to control the operation of the stepper motor, which can not only ensure the smooth operation of the stepper motor during the acceleration and deceleration process, but also improve the response speed and acceleration and deceleration efficiency of the stepper motor.

[0097] The following is an introduction to the adjustment and optimization process of the second tuning coefficient and the third tuning coefficient.

[0098] According to the above, the second tuning coefficient and the third tuning coefficient are used to adjust the speed mutation and impact vibration problems of the stepper motor during the acceleration and deceleration process. During the operation of the stepper motor, the speed mutation and impact vibration problems are mainly manifested in two aspects: the stepper motor loses step and the actual over-deceleration time exceeds the time limit. Among them, the second tuning coefficient is a key factor affecting the stepper motor loses step. In some embodiments, the stepper motor can be detected to optimize the second tuning coefficient. For specific optimization and adjustment methods, see Figure 4 :

[0099] Step 401, obtain the initial second tuning coefficient and the third tuning coefficient, and determine the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, and jump to the step of determining the pulse time sequence corresponding to the stepper motor in the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence.

[0100] Here, the values ​​of the second curve parameter and the third curve parameter can be determined according to b=k2×a and c=k3×a. And jump to the step of determining the pulse time sequence corresponding to the stepper motor in the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence, so as to control the operation of the stepper motor and monitor the actual operation status of the stepper motor.

[0101] Step 402, obtaining the actual operating state of the stepper motor, and detecting whether the stepper motor is out of step according to the actual operating state.

[0102] Step 403, if the stepper motor loses step, adjust the second tuning coefficient, and based on the adjusted second tuning coefficient, jump to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the stepper motor does not lose step and the second tuning coefficient after tuning is obtained.

[0103] Specifically, if the stepping motor loses step, the current value and the lower limit value corresponding to the second tuning coefficient are respectively obtained; and the average value of the current value and the lower limit value is determined as the new current value corresponding to the second tuning coefficient.

[0104] Here, the second tuning coefficient has a corresponding upper limit value and a lower limit value, which can be determined according to the actual motion scene of the stepper motor.

[0105] In the embodiment of the present invention, the value of the initial second tuning coefficient can be determined as the upper limit value, and the second tuning coefficient can be optimized and adjusted by detecting the stepping motor's stepping out of step. If the stepping motor is out of step, the second tuning coefficient is continuously reduced according to the current value and the lower limit value corresponding to the second tuning coefficient until the stepping motor does not lose step, and the second tuning coefficient is obtained after the tuning is completed.

[0106] Exemplarily, the lower limit value of the second tuning coefficient can be 0, and the upper limit value can be A. The initial value of the second tuning coefficient is A. If it is detected that the stepper motor is out of step, the current value corresponding to the second tuning coefficient is adjusted to A / 2. And according to the adjusted second tuning coefficient, the pulse time sequence is re-determined, and the operation of the stepper motor is controlled. According to the actual operating state of the stepper motor, whether the stepper motor is out of step is detected. If the stepper motor is still out of step, the current value corresponding to the second tuning coefficient is adjusted to A / 4, and the cycle is iterated until the stepper motor does not lose step, and the second tuning coefficient that has been tuned is obtained.

[0107] The embodiment of the present invention adjusts the second tuning coefficient accordingly according to the step-out condition of the stepping motor, so as to prevent the stepping motor from stepping out during actual operation.

[0108] Considering that the speed mutation and impact vibration problems are also reflected in the actual acceleration and deceleration time overtime. Among them, the second tuning coefficient and the third tuning coefficient will affect the actual acceleration and deceleration time of the stepper motor. In other embodiments, it is also possible to further detect the actual acceleration and deceleration time on the basis of detecting the stepping motor out of step, so as to continue to optimize and adjust the second tuning coefficient, and optimize and adjust the third tuning coefficient. For specific optimization and adjustment methods, see Figure 5 :

[0109] Step 501, obtain the initial second tuning coefficient and the third tuning coefficient, and determine the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, and jump to the step of determining the pulse time sequence corresponding to the stepper motor during the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence.

[0110] Step 502, obtaining the actual operating state of the stepper motor, and detecting whether the stepper motor is out of step according to the actual operating state.

[0111] Step 503, if the stepper motor loses step, adjust the second tuning coefficient, and based on the adjusted second tuning coefficient, jump to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the stepper motor does not lose step and the second tuning coefficient after tuning is obtained.

[0112] Here, the implementation of steps 501-503 is shown in Figure 4 The relevant description in the embodiments will not be repeated here.

[0113] Step 504: If the stepper motor does not lose steps, the adjustment times are initialized.

[0114] Here, when the stepper motor does not lose steps and the actual acceleration and deceleration time of the stepper motor exceeds the time limit, the number of adjustments is used to represent the number of optimized adjustments of the second tuning coefficient.

[0115] Step 505: Detect whether the actual acceleration and deceleration time of the stepper motor has exceeded according to the actual operating status.

[0116] Here, the actual acceleration / deceleration time timeout means that the actual acceleration / deceleration time is greater than the preset acceleration / deceleration time.

[0117] The embodiment of the present invention further detects whether the actual acceleration and deceleration time has timed out when it is determined that the stepper motor has not lost steps, so as to continue to optimize and adjust the second tuning coefficient, or, on the basis of continuing to adjust the second tuning coefficient, optimize and adjust the third tuning coefficient until the actual acceleration and deceleration time does not time out.

[0118] Step 506: If the actual acceleration and deceleration time of the stepper motor exceeds the time limit, it is detected whether the number of adjustment times reaches a preset value.

[0119] The preset value here can be determined according to actual conditions, and is used to limit the number of times the second tuning coefficient is adjusted when the stepper motor does not lose steps and the actual acceleration and deceleration time of the stepper motor exceeds the time limit.

[0120] Step 507, if the number of adjustments does not reach the preset value, adjust the second tuning coefficient and update the number of adjustments. Based on the adjusted second tuning coefficient, jump to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches the preset value, and the second tuning coefficient after the tuning is completed is obtained.

[0121] The second tuning coefficient and the third tuning coefficient both affect the actual acceleration and deceleration time of the stepper motor. The embodiment of the present invention preferentially adjusts the second tuning coefficient and updates the number of adjustments accordingly. When the number of adjustments does not reach the preset value, the second tuning coefficient is adjusted until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches the preset value, and the second tuning coefficient after the tuning is completed is obtained, that is, the preset second tuning coefficient.

[0122] In one case, the stepper motor corresponding to the initial second tuning coefficient does not lose step. If the acceleration and deceleration time times out at this time, the initial second tuning coefficient is adjusted until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches a preset value, and the second tuning coefficient after the tuning is completed is obtained, that is, the above-mentioned preset second tuning coefficient.

[0123] In another case, the stepper motor corresponding to the initial second tuning coefficient is out of step. At this time, the second tuning coefficient is first tuned according to step 503 until the stepper motor does not lose step, and the tuned second tuning coefficient is obtained, and further detection is made as to whether the actual acceleration and deceleration time has timed out. If so, the tuned second tuning coefficient is continuously adjusted until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches a preset value, and the second tuning coefficient after tuning is obtained, that is, the preset second tuning coefficient.

[0124] Specifically, if the actual acceleration and deceleration time of the stepper motor times out and the number of adjustments does not reach the preset value, the current value and upper limit value corresponding to the second tuning coefficient are obtained respectively; and the average value of the current value and the upper limit value is determined as the new current value corresponding to the second tuning coefficient.

[0125] Exemplarily, the upper limit value of the second tuning coefficient may be A. When the stepper motor does not lose steps, the current value corresponding to the second tuning coefficient may be B. If the actual acceleration and deceleration time of the stepper motor exceeds the time limit, the second tuning coefficient may be adjusted to (A+B) / 2.

[0126] After the above step 506, the method further includes:

[0127] Step 508, if the number of adjustments reaches the preset value, the third tuning coefficient is adjusted, and based on the adjusted third tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, and the third tuning coefficient after the tuning is completed is obtained.

[0128] If the actual acceleration and deceleration time exceeds the time limit, and the number of adjustments reaches the preset value, it means that the second tuning coefficient has been adjusted too many times, and the effect of preventing the actual acceleration and deceleration time from exceeding the time limit has not been achieved. At this time, the third tuning coefficient is adjusted iteratively until the actual acceleration and deceleration time of the stepper motor does not exceed the time limit, and the third tuning coefficient after the tuning is completed is obtained, that is, the preset third tuning coefficient.

[0129] Specifically, if the actual acceleration / deceleration time times out and the number of adjustments reaches a preset value, the current value and lower limit value corresponding to the third tuning coefficient are respectively obtained; and the average value of the current value and the lower limit value is determined as the new current value corresponding to the third tuning coefficient.

[0130] Here, the third tuning coefficient has a corresponding upper limit value and a lower limit value, which can be determined according to the actual motion scene of the stepper motor.

[0131] In the embodiment of the present invention, the value of the initial third tuning coefficient can be determined as the upper limit value, and the third tuning coefficient can be optimized and adjusted by detecting the actual acceleration and deceleration time and the number of adjustments of the stepper motor. If the actual acceleration and deceleration time exceeds the time limit, and the number of adjustments reaches the preset value, the third tuning coefficient is continuously reduced according to the current value and the lower limit value corresponding to the third tuning coefficient until the actual acceleration and deceleration time of the stepper motor does not exceed the time limit, and the third tuning coefficient is obtained after the tuning is completed.

[0132] The embodiment of the present invention optimizes and adjusts the second tuning coefficient and the third tuning coefficient according to the stepping motor's stepping out and timeout conditions, so that the second tuning coefficient and the third tuning coefficient after tuning can avoid the stepping motor from stepping out or timeout. At this time, the second tuning coefficient and the third tuning coefficient are the preset second tuning coefficient and the third tuning coefficient.

[0133] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0134] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.

[0135] Figure 6 The schematic diagram of the structure of the control device of the stepping motor provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0136] like Figure 6 As shown, the control device 6 of the stepper motor includes: an acquisition module 61 , a calculation module 62 and a control module 63 .

[0137] An acquisition module 61 is used to acquire control parameters and preset operating parameters of the stepper motor;

[0138] The calculation module 62 is used for:

[0139] Based on the preset operating parameters, determine the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process;

[0140] Obtaining a preset fractional function curve acceleration and deceleration relationship; the relationship includes the curve parameters to be solved, and the relationship is used to express the mapping relationship between the acceleration and deceleration steps and the pulse time interval;

[0141] According to the control parameters and the total number of acceleration and deceleration steps, the values ​​of the curve parameters to be solved are determined;

[0142] The control module 63 is used to determine the pulse time sequence corresponding to the stepper motor during the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and control the operation of the stepper motor based on the pulse time sequence.

[0143] In a possible implementation, the control parameters include: rated speed and motor subdivision setting value; the curve parameters to be solved include: first curve parameters, second curve parameters and third curve parameters;

[0144] The calculation module 62 is specifically used for:

[0145] Determine respectively a first product of the rated speed and the motor subdivision setting value, and a second product of the total number of acceleration and deceleration steps and a preset first tuning coefficient, and determine the value of the first curve parameter according to the ratio of the second product to the first product;

[0146] The values ​​of the second curve parameter and the third curve parameter are correspondingly determined according to the product of the value of the first curve parameter and the preset second tuning coefficient, and the product of the value of the first curve parameter and the preset third tuning coefficient.

[0147] In a possible implementation, the preset second tuning coefficient is the second tuning coefficient after the tuning is completed;

[0148] The calculation module 62 is further used for:

[0149] Obtaining the initial second tuning coefficient and the third tuning coefficient, and determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient and the value of the first curve parameter, and jumping to the step of determining the pulse time sequence corresponding to the stepper motor in the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence;

[0150] Obtain the actual operating status of the stepper motor, and detect whether the stepper motor is out of step based on the actual operating status;

[0151] If the stepper motor loses step, the second tuning coefficient is adjusted, and based on the adjusted second tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient and the value of the first curve parameter, until the stepper motor does not lose step, and the second tuning coefficient after tuning is obtained.

[0152] In a possible implementation, the calculation module 62 is further configured to:

[0153] If the stepper motor does not lose steps, the number of adjustments will be initialized;

[0154] According to the actual running status, check whether the actual acceleration and deceleration time of the stepper motor has exceeded;

[0155] If the actual acceleration and deceleration time of the stepper motor exceeds the time limit, the adjustment times are checked to see if they reach the preset value.

[0156] If the number of adjustments does not reach the preset value, the second tuning coefficient is adjusted and the number of adjustments is updated. Based on the adjusted second tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient and the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches the preset value, and the second tuning coefficient after the tuning is completed is obtained.

[0157] In a possible implementation, the preset third tuning coefficient is the third tuning coefficient after the tuning is completed;

[0158] The calculation module 62 is further used for:

[0159] If the number of adjustments reaches the preset value, the third tuning coefficient is adjusted, and based on the adjusted third tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, and the third tuning coefficient after the tuning is completed is obtained.

[0160] In a possible implementation, the calculation module 62 is specifically configured to:

[0161] If the stepper motor loses step, the current value and the lower limit value corresponding to the second tuning coefficient are obtained respectively;

[0162] The average value of the current value and the lower limit value is determined as the new current value corresponding to the second tuning coefficient.

[0163] In a possible implementation, the calculation module 62 is specifically configured to:

[0164] If the number of adjustments does not reach the preset value, the current value and the upper limit value corresponding to the second tuning coefficient are obtained respectively;

[0165] The average of the current value and the upper limit value is determined as the new current value corresponding to the second tuning coefficient.

[0166] In a possible implementation, the acceleration / deceleration relationship of the fractional function curve is:

[0167] Wherein, f(n) represents the pulse emission time corresponding to the nth acceleration / deceleration step and the pulse time interval between the pulse emission time corresponding to the n-1th acceleration / deceleration step, a represents the first curve parameter, b represents the second curve parameter, c represents the third curve parameter, n represents the acceleration / deceleration step, n=1, 2, 3…N, and N represents the total number of acceleration / deceleration steps;

[0168] The calculation module 62 is specifically used for:

[0169] according to determining a value of a first curve parameter;

[0170] Wherein, a represents the first curve parameter, k1 represents the preset first tuning coefficient, r represents the rated speed, and s represents the motor subdivision setting value.

[0171] In a possible implementation, the preset operation parameters include: a preset total number of operation steps, a preset total operation time, and a preset acceleration and deceleration time;

[0172] The calculation module 62 is specifically used for:

[0173] according to Determine the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process;

[0174] Where N represents the total number of acceleration and deceleration steps, N G Indicates the total number of preset running steps, T G Indicates the total preset running time, T A Indicates the preset acceleration and deceleration time, and ΔT indicates the average pulse interval time.

[0175] The stepper motor control device provided in the embodiment of the present invention can be used to execute the above-mentioned stepper motor control method. Its technical principle and implementation effect are the same as those of the above-mentioned method embodiment, and will not be repeated here.

[0176] Figure 7 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 7 As shown, the electronic device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, the steps in the above-mentioned control method embodiments of the stepper motor are implemented, for example Figure 1 Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 6 The functions of modules 61 to 63 are shown.

[0177] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 72 in the electronic device 7. For example, the computer program 72 may be divided into Figure 6 Modules 61 to 63 are shown.

[0178] The electronic device 7 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 7 and does not constitute a limitation of the electronic device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0179] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0180] The memory 71 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7. The memory 71 may also be an external storage device of the electronic device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the electronic device 7. The memory 71 is used to store the computer program and other programs and data required by the electronic device. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0181] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0182] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0183] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0184] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0185] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0186] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0187] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned control method embodiments of each stepper motor can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A control method for a stepping motor, characterized in that: include: Obtain the control parameters and preset operating parameters of the stepper motor; Based on the preset operating parameters, determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process; Obtaining a preset fractional function curve acceleration and deceleration relationship; the relationship includes the curve parameters to be solved, and the relationship is used to express the mapping relationship between the acceleration and deceleration steps and the pulse time interval; Determining the value of the curve parameter to be solved according to the control parameter and the total number of acceleration and deceleration steps; According to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, the pulse time sequence corresponding to the stepper motor during the acceleration and deceleration process is determined, and the operation of the stepper motor is controlled based on the pulse time sequence.

2. The control method of the stepping motor according to claim 1, characterized in that: The control parameters include: rated speed and motor subdivision setting value; the curve parameters to be solved include: first curve parameters, second curve parameters and third curve parameters; Determining the value of the curve parameter to be solved according to the control parameter and the total number of acceleration and deceleration steps includes: Determine respectively a first product of the rated speed and the motor subdivision setting value, and a second product of the total number of acceleration and deceleration steps and a preset first tuning coefficient, and determine the value of the first curve parameter according to the ratio of the second product to the first product; The values ​​of the second curve parameter and the third curve parameter are correspondingly determined according to the product of the value of the first curve parameter and the preset second tuning coefficient, and the product of the value of the first curve parameter and the preset third tuning coefficient.

3. The control method of the stepping motor according to claim 2, characterized in that: The preset second tuning coefficient is the second tuning coefficient after the tuning is completed; Before respectively determining the values ​​of the second curve parameter and the third curve parameter according to the product of the value of the first curve parameter and the preset second tuning coefficient, and the product of the value of the first curve parameter and the preset third tuning coefficient, the method further includes: Obtaining an initial second tuning coefficient and a third tuning coefficient, and determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, and the value of the first curve parameter, and jumping to the step of determining the pulse time sequence corresponding to the stepper motor in the acceleration and deceleration process according to the total number of acceleration and deceleration steps, the relationship and the value of the curve parameter to be solved, and controlling the operation of the stepper motor based on the pulse time sequence; Acquiring an actual operating state of the stepper motor, and detecting whether the stepper motor is out of step according to the actual operating state; If the stepper motor loses step, the second tuning coefficient is adjusted, and based on the adjusted second tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient and the value of the first curve parameter, until the stepper motor does not lose step and the second tuning coefficient after tuning is obtained.

4. The control method of the stepping motor according to claim 3, characterized in that: After detecting whether the stepping motor is out of step, the method further includes: If the stepping motor does not lose steps, the number of adjustments is initialized; According to the actual operating state, detecting whether the actual acceleration and deceleration time of the stepping motor has exceeded; If the actual acceleration and deceleration time of the stepper motor exceeds the time limit, detecting whether the adjustment times reaches a preset value; If the number of adjustments does not reach the preset value, the second tuning coefficient is adjusted and the number of adjustments is updated. Based on the adjusted second tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, or until the number of adjustments reaches the preset value, and the second tuning coefficient after the tuning is completed is obtained.

5. The control method of the stepping motor according to claim 4, characterized in that: The preset third tuning coefficient is the third tuning coefficient after the tuning is completed; After detecting whether the adjustment times reaches a preset value, the method further includes: If the number of adjustments reaches a preset value, the third tuning coefficient is adjusted, and based on the adjusted third tuning coefficient, the process jumps to the step of determining the values ​​of the second curve parameter and the third curve parameter according to the second tuning coefficient and the third tuning coefficient, as well as the value of the first curve parameter, until the actual acceleration and deceleration time of the stepper motor does not time out, and the third tuning coefficient after the tuning is completed is obtained.

6. The control method of a stepper motor according to any one of claims 3 to 5, characterized in that: If the stepping motor loses step, adjusting the second tuning coefficient includes: If the stepping motor loses step, respectively obtaining a current value and a lower limit value corresponding to the second tuning coefficient; An average value of the current value and the lower limit value is determined as a new current value corresponding to the second tuning coefficient.

7. The control method of a stepping motor according to claim 4 or 5, characterized in that: If the adjustment times do not reach the preset value, adjusting the second tuning coefficient includes: If the number of adjustments does not reach the preset value, respectively obtaining the current value and the upper limit value corresponding to the second tuning coefficient; An average value of the current value and the upper limit value is determined as a new current value corresponding to the second tuning coefficient.

8. The control method of a stepping motor according to any one of claims 2 to 5, characterized in that: The acceleration / deceleration relationship of the fractional function curve is: Wherein, f(n) represents the pulse time interval between the pulse emission time corresponding to the nth acceleration / deceleration step and the pulse emission time corresponding to the n-1th acceleration / deceleration step, a represents the first curve parameter, b represents the second curve parameter, c represents the third curve parameter, n represents the acceleration / deceleration step, n=1, 2, 3...N, and N represents the total number of acceleration / deceleration steps; Determining the value of the first curve parameter according to the ratio of the second product to the first product includes: according to determining a value of the first curve parameter; Among them, a represents the first curve parameter, k1 represents the preset first tuning coefficient, r represents the rated speed, and s represents the motor subdivision setting value.

9. The control method of a stepping motor according to any one of claims 1 to 5, characterized in that: The preset operation parameters include: a preset total number of operation steps, a preset total operation time, and a preset acceleration and deceleration time; The step of determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process based on the preset operating parameters includes: according to Determining the total number of acceleration and deceleration steps of the stepper motor during the acceleration and deceleration process; Wherein, N represents the total number of acceleration and deceleration steps, N G Indicates the total number of preset running steps, T G Indicates the total preset running time, T A Indicates the preset acceleration and deceleration time, and ΔT indicates the average pulse interval time.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the stepper motor control method as described in any one of claims 1 to 9 are implemented.