Stepping motor speed control method, computer device, medium and program product

By calculating the accumulation of pulse signals, the acceleration and deceleration of stepper motors is solved, and the problems of unstable stepper motor control and large memory usage in the prior art are reduced, thereby reducing CPU computing time and improving control efficiency.

CN120034050APending Publication Date: 2025-05-23ZHUHAI QUIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510028223.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing stepper motor control methods are prone to cause bad working conditions such as vibration, stalling, and step loss during acceleration and deceleration, and the table checking method occupies a large amount of memory and is inconvenient for dynamic adjustment.

Method used

By calculating the accumulation of pulse signals, determine whether the stepper motor completes acceleration and deceleration control, and use an accumulator to track the number of pulse outputs to avoid complex division calculations and achieve a reduction in CPU calculation time.

Benefits of technology

It greatly reduces the computing time of the CPU, improves the algorithm speed and efficiency, facilitates changing acceleration or deceleration control at any time, saves computing resources, and simplifies memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034050A_ABST
    Figure CN120034050A_ABST
Patent Text Reader

Abstract

The invention provides a stepping motor speed control method, a computer device, a medium and a program product, and the method comprises the steps: obtaining motion instruction data of a stepping motor, controlling the motion of the stepping motor according to the motion instruction data of the stepping motor, and updating the numerical value of a residual pulse every time the pulse is output in the control process of the stepping motor; starting the motor according to the minimum speed pulse frequency, performing acceleration control according to the positive acceleration after the motor accelerates to the minimum speed corresponding to the minimum speed pulse frequency, and calculating the number of deceleration pulses at the current speed when the condition of entering a constant speed state is met; controlling the motor to move at a constant speed until the numerical value of the residual pulse is less than or equal to the current speed deceleration pulse number, and then entering a deceleration state; and performing deceleration control on the motor according to the negative acceleration, and when the speed is reduced to be less than or equal to the minimum speed, maintaining the pulse frequency corresponding to the current operation speed to output the pulse until the numerical value of the residual pulse is 0. The speed control efficiency of the stepping motor can be improved, and acceleration and deceleration can be conveniently controlled.
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 stepper motor speed control method, a computer device, a medium and a program product. Background Art

[0002] A stepper motor is an electric motor that converts electrical pulse signals into corresponding angular displacement or linear displacement.

[0003] For a control system with a stepper motor, it is necessary to start, accelerate, maintain a constant speed, decelerate, and stop the stepper motor when controlling it. If the acceleration and deceleration speeds are not set properly during the acceleration and deceleration process, the stepper motor may experience vibration, stall, step loss, and other adverse working conditions.

[0004] An existing method for controlling the acceleration and deceleration of a stepper motor is implemented through a table lookup method, that is, the comparison matching values ​​of the timers required for each stage of the motor acceleration or deceleration process are calculated in advance and stored in a table, and the motor acceleration or deceleration is controlled according to the table when the motor is running. However, this method table will occupy a large amount of memory, and the table is not convenient to change during movement. Summary of the invention

[0005] A first object of the present invention is to provide a stepper motor speed control method that can reduce the calculation time of a CPU.

[0006] The second object of the present invention is to provide a computer device for implementing the above-mentioned stepping motor speed control method.

[0007] A third object of the present invention is to provide a computer-readable storage medium for implementing the above-mentioned stepper motor speed control method.

[0008] A fourth object of the present invention is to provide a computer program product for implementing the above-mentioned stepper motor speed control method.

[0009] In order to achieve the above-mentioned first purpose, the present invention provides a stepper motor speed control method, which includes the following steps: obtaining stepper motor motion instruction data, the stepper motor motion instruction data including the minimum speed pulse frequency, positive acceleration, negative acceleration, maximum speed pulse frequency and the value of the remaining pulse; controlling the stepper motor to start moving according to the stepper motor motion instruction data, and in the process of the stepper motor starting to move to a standstill, each time a pulse is output, the value of the remaining pulse is updated; starting the stepper motor according to the minimum speed pulse frequency, after the stepper motor accelerates to the minimum speed corresponding to the minimum speed pulse frequency, accelerating control is performed according to the positive acceleration to determine whether the conditions for entering the uniform speed state are met, and if so, calculating the current speed deceleration pulse number to enter the uniform speed state; controlling the stepper motor to move at a uniform speed until the value of the remaining pulse is less than or equal to the current speed deceleration pulse number, and then entering the deceleration state; decelerating the stepper motor according to the negative acceleration, and when decelerating to less than or equal to the minimum speed, maintaining the pulse frequency corresponding to the current running speed to output pulses until the value of the remaining pulse is 0.

[0010] As can be seen from the above scheme, the present invention determines whether the stepper motor completes acceleration and deceleration control within a preset time period by calculating the accumulation of pulse signals. It does not need to be calculated by complex methods such as division, which greatly reduces the calculation time of the CPU and has a significant effect on improving the efficiency of the algorithm speed. In the acceleration control and deceleration control of the present invention, the pulse output is completed in the same timer, which can save computing resources and facilitate transplantation. The present invention does not need to perform acceleration or deceleration according to the table lookup method. Compared with the table lookup method, the present invention can easily change the acceleration or deceleration control at any time.

[0011] A further solution is that before starting the stepper motor according to the minimum speed pulse frequency, it includes: setting the running speed to the minimum speed; calculating the number of pulses per unit time corresponding to the running speed; setting the timer interrupt time corresponding to the running speed; when starting the stepper motor according to the minimum speed pulse frequency, it includes: entering the timer interrupt, outputting a pulse, and adding 1 to the value of the speed pulse accumulator; until the value of the speed pulse accumulator is greater than the number of pulses per unit time corresponding to the running speed, start accelerating according to the positive acceleration.

[0012] It can be seen from this that the speed pulse accumulator can be used to accumulate pulses to determine whether the stepper motor has completed speed regulation to the minimum speed.

[0013] A further solution is that the number of pulses per unit time corresponding to the running speed = running speed / preset time parameter; the number of current speed deceleration pulses = running speed*running speed / negative acceleration / 2; the timer interrupt time corresponding to the running speed = timer clock frequency / running speed.

[0014] A further solution is that the preset time parameter is 1000, and the number of pulses per millisecond corresponding to the running speed = running speed / 1000.

[0015] It can be seen that the preset time parameters can be adjusted according to actual needs.

[0016] A further solution is that the condition for entering the uniform speed state is one of the following: accelerating to a running speed greater than or equal to the maximum speed corresponding to the maximum speed pulse frequency, and the value of the remaining pulses is less than the number of deceleration pulses corresponding to the running speed.

[0017] It can be seen that deceleration can be started when the stepper motor accelerates to the maximum speed corresponding to the maximum speed pulse frequency. When the stepper motor speed does not reach the maximum speed, if the value of the remaining pulses recorded in real time is less than the number of deceleration pulses corresponding to the running speed, it can be determined in time to start deceleration to avoid poor working conditions of the stepper motor.

[0018] A further solution is to add a positive acceleration each time for acceleration control, including: increasing the running speed by a positive acceleration, clearing the value of the speed pulse accumulator, updating the number of pulses per unit time corresponding to the running speed, and updating the timer interrupt time corresponding to the running speed; entering the timer interrupt, outputting a pulse, and adding 1 to the value of the speed pulse accumulator; until the value of the speed pulse accumulator is greater than the number of pulses per unit time corresponding to the running speed.

[0019] It can be seen that the accumulated result of the speed pulse accumulator can be used to determine whether one acceleration is completed and the next acceleration is started.

[0020] A further solution is to reduce the deceleration control by reducing a negative acceleration each time, including: reducing the running speed by a negative acceleration, clearing the value of the speed pulse accumulator, updating the number of pulses per unit time corresponding to the running speed, and updating the timer interrupt time corresponding to the running speed; entering the timer interrupt, outputting a pulse, and adding 1 to the value of the speed pulse accumulator; until the value of the speed pulse accumulator is greater than the number of pulses per unit time corresponding to the running speed.

[0021] It can be seen that the accumulated result of the speed pulse accumulator can be used to determine whether one deceleration is completed and the next deceleration is started.

[0022] In order to achieve the above-mentioned second purpose, the present invention provides a computer device, including a processor and a memory, wherein: a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned stepper motor speed control method is implemented.

[0023] In order to achieve the third objective mentioned above, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, the stepper motor speed control method mentioned above is implemented.

[0024] In order to achieve the fourth objective mentioned above, the present invention provides a computer program product, including computer instructions, wherein: when the computer instructions are executed by a processor, the above-mentioned stepper motor speed control method is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of the initialization state in the first embodiment of the stepping motor speed control method of the present invention.

[0026] Figure 2 It is a flow chart of the standby state in the first embodiment of the stepping motor speed control method of the present invention.

[0027] Figure 3 It is a flow chart of the acceleration state in the first embodiment of the stepping motor speed control method of the present invention.

[0028] Figure 4 It is a flow chart of the uniform speed state in the first embodiment of the stepping motor speed control method of the present invention.

[0029] Figure 5 It is a flow chart of the deceleration state in the first embodiment of the stepping motor speed control method of the present invention.

[0030] Figure 6 It is a flow chart of the stop state in the first embodiment of the stepping motor speed control method of the present invention.

[0031] Figure 7 It is a schematic diagram of a stepper motor speed control simulation curve in the first embodiment of the stepper motor speed control method of the present invention.

[0032] Figure 8 It is a flow chart of the acceleration state in the second embodiment of the stepping motor speed control method of the present invention.

[0033] The present invention is further described below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION

[0034] The stepper motor speed control method of the present invention performs stepper motor movement based on the preset minimum speed pulse frequency, positive acceleration, negative acceleration, maximum speed pulse frequency and residual pulse values. The present invention also provides a computer device, a computer readable storage medium and a computer program product for implementing the stepper motor speed control method.

[0035] The first embodiment of the stepping motor speed control method:

[0036] The stepper motor speed control method of this embodiment is implemented by a computer program, and the computer program runs on a microcontroller unit (MCU).

[0037] The microcontroller unit is electrically connected to the stepper motor. After obtaining the currently set running speed, the microcontroller unit sets the timer interrupt time corresponding to the currently set running speed, and controls the movement of the stepper motor by outputting pulses through the timer interrupt.

[0038] See also Figure 1 , Figure 1 The process of the initialization state in this embodiment is shown, including:

[0039] S11: Receive stepper motor motion command data.

[0040] The stepper motor motion instruction data is obtained from a host computer to which the microcontroller unit is connected. The connection between the microcontroller unit and the host computer may be wired or wireless.

[0041] S12: Set the minimum pulse speed frequency, positive acceleration, negative acceleration, maximum speed pulse frequency and the number of remaining pulses according to the stepper motor motion command data.

[0042] Among them, the minimum pulse speed frequency MinSpd represents the pulse frequency corresponding to the stepper motor running at the set minimum speed; the maximum speed pulse frequency MaxSpd represents the pulse frequency corresponding to the stepper motor running at the set maximum speed; the positive acceleration AccSpd and the negative acceleration DecSpd both represent the change in speed, the positive acceleration represents the increase in the motor speed when accelerating, and the negative acceleration represents the decrease in the motor speed when decelerating; the number of remaining pulses represents the number of pulse signals that need to be completed after the set stepper motor is started, and each time the microcontroller outputs a pulse, the number of remaining second pulses is subtracted by 1.

[0043] S13: Start the timer and enable the timer interrupt.

[0044] See also Figure 2 , Figure 2 The flowchart of the standby state in this embodiment is shown, including:

[0045] S21: Enter the timer interrupt and set the running speed to the minimum speed.

[0046] Among them, the minimum speed is the speed value corresponding to the minimum speed pulse frequency, and the running speed RunSpd is set to the minimum speed.

[0047] S22: Calculate the number of pulses per millisecond corresponding to the running speed.

[0048] The number of pulses per unit time corresponding to the running speed AccPlsPerMsCurSpd = running speed RunSpd / preset time parameter. In this embodiment, the dimension of the running speed is pulses / second, and the preset time parameter is 1000. Since the speed of the stepper motor in this embodiment is accelerated or decelerated in a time period of 1 millisecond, the number of pulses per millisecond corresponding to the running speed can be obtained. It can be understood that in other embodiments, the preset time parameter can be adjusted according to actual needs.

[0049] S23: Set the timer interrupt time according to the running speed.

[0050] Among them, timer interrupt time = timer clock frequency / running speed.

[0051] S24: Set the running state to the acceleration state.

[0052] Among them, after setting to the acceleration state, the acceleration state is executed when the timer generates the next interrupt.

[0053] See also Figure 3 , Figure 3 The flowchart of the acceleration state in this embodiment is shown, including:

[0054] S31: Enter the timer interrupt, output pulse, the value of the remaining pulse is reduced by 1, and the value of the speed pulse accumulator is increased by 1.

[0055] Among them, the value of the speed pulse accumulator is initially 0.

[0056] S32: Determine whether the value of the speed pulse accumulator is greater than the number of pulses per millisecond corresponding to the running speed.

[0057] According to the judgment result, it can be determined whether the speed of the stepper motor reaches the set running speed RunSpd. If the judgment result of step S32 is yes, continue to step S33; if the judgment result of step S32 is no, execute step S31.

[0058] Among them, when step S32 is executed for the first time, the running speed RunSpd at this time is the minimum speed set in step S21. By judging whether the value of the speed pulse accumulator is greater than the number of pulses per millisecond corresponding to the running speed RunSpd in step S22, it can be determined whether the speed of the stepper motor has reached the minimum speed at this time. When the value of the speed pulse accumulator is greater than the number of pulses per millisecond corresponding to the running speed RunSpd in step S22, continue to execute step S33 and start acceleration; when the value of the speed pulse accumulator is not greater than the number of pulses per millisecond corresponding to the running speed RunSpd in step S22, it means that the speed of the stepper motor has still reached the minimum speed at this time, then return to step 31.

[0059] Among them, after executing step S32 for the first time, when executing step S32 again, the running speed RunSpd at this time is the running speed set in step S33 after adding a positive acceleration, and the number of pulses per millisecond corresponding to the running speed is the number of pulses per millisecond re-determined in step S33 according to the updated running speed.

[0060] S33: The running speed increases by a positive acceleration, the value of the speed pulse accumulator is cleared, the number of pulses per millisecond corresponding to the running speed is updated, and the timer interrupt time corresponding to the running speed is updated.

[0061] The running speed RunSpd is updated by adding a positive acceleration value to the running speed RunSpd, and the number of pulses per millisecond corresponding to the running speed at this time is calculated.

[0062] S34: Determine whether the running speed is greater than or equal to the maximum speed.

[0063] If the judgment result of step S34 is yes, then continue to execute step S35; if the judgment result of step S34 is no, return to step S31.

[0064] S35: Calculate the number of current speed deceleration pulses and set the running state to a uniform speed state.

[0065] Among them, after setting to the uniform speed state, the uniform speed state is executed when the timer generates the next interrupt.

[0066] See also Figure 4 , Figure 4 The flowchart of the uniform speed state in this embodiment is shown, including:

[0067] S41: Enter the timer interrupt, output pulse, and the value of the remaining pulse is reduced by 1.

[0068] S42: Determine whether the value of the remaining pulses is less than the current speed deceleration pulse number.

[0069] Among them, whether to start deceleration can be determined based on the judgment result. If the judgment result of step S42 is yes, it means that deceleration needs to be started, and step S43 is continued; if the judgment result of step S42 is no, it means that deceleration is still not needed, and return to step S41.

[0070] S43: Set the running state to the deceleration state.

[0071] Among them, after setting to the deceleration state, when the timer generates the next interrupt, the uniform speed state is executed.

[0072] See also Figure 5 , Figure 5 The flowchart of the deceleration state in this embodiment is shown, including:

[0073] S51: Enter the timer interrupt, output pulse, the value of the remaining pulse is reduced by 1, and the value of the speed pulse accumulator is increased by 1.

[0074] S52: Determine whether the value of the remaining pulse is greater than 1.

[0075] Among them, according to the judgment result, it can be determined whether the pulse signal used for this motor control has been completed output. If the judgment result of step S52 is no, it means that the pulse signal of this motor control has been completed output, and step S56 is executed to set the operating state to the stop state. Among them, after the operating state is set to the stop state, the stop state is executed when the timer generates the next interrupt; if the judgment result of step S52 is no, it means that the pulse signal of this motor control has not been completed output, and step S53 is continued.

[0076] S53: Determine whether the running speed is less than or equal to the minimum speed.

[0077] Among them, according to the judgment result of step S53, it can be determined whether it is necessary to control the stepper motor to decelerate according to the negative acceleration. If the judgment result is no, it means that it is necessary to continue to control the stepper motor to decelerate according to the negative acceleration, and then continue to execute step S54; if the judgment result is yes, there is no need to control the stepper motor to decelerate according to the negative acceleration, but the stepper motor is controlled by outputting pulses according to the pulse frequency corresponding to the current operating speed, and then return to step S51.

[0078] S54: Determine whether the value of the speed pulse accumulator is greater than the number of pulses per millisecond of the running speed.

[0079] Among them, since the time cycle of the stepper motor acceleration and deceleration is 1 millisecond, the judgment result of step S54 can be used to determine whether the deceleration and speed change are completed. If the judgment result is yes, continue to step S55; if the judgment result is no, return to step S51.

[0080] S55: The running speed is reduced by a negative acceleration, the value of the speed pulse accumulator is cleared, the number of pulses per millisecond at the running speed is updated, and the timer interrupt time is updated.

[0081] The running speed RunSpd is updated by subtracting a negative acceleration value from the running speed RunSpd, and the number of pulses per millisecond corresponding to the running speed at this time is calculated.

[0082] See also Figure 6 , Figure 6 The flowchart of the stop state in this embodiment is shown, including:

[0083] S61: Enter timer interrupt, output pulse, the value of the remaining pulse is 0.

[0084] S62: Set the running speed to 0, set the running state to standby state, and stop the timer.

[0085] Thus, the current stepper motor speed control ends until it is set to the acceleration state again.

[0086] During the acceleration control and deceleration control of the stepper motor, the positive acceleration and / or negative acceleration can be modified according to an external input instruction, and subsequent speed control can be performed in real time according to the modified positive acceleration and / or negative acceleration.

[0087] See also Figure 7 , Figure 7 The stepper motor speed control simulation curve of this embodiment is shown, wherein the stepper motor speed control simulation curve is a T-shaped curve, wherein the horizontal axis represents time and the vertical axis represents speed.

[0088] In summary, the present invention determines whether the stepper motor completes acceleration and deceleration control by calculating the accumulation of pulse signals, and does not need to calculate the deceleration pulse by division for each pulse signal output, which greatly reduces the calculation time of the CPU and has a significant efficiency improvement effect on the algorithm speed. The present invention can conveniently change the acceleration or deceleration control at any time. The pulse output of the present invention is completed within the same timer, which can save computing resources and facilitate transplantation. The present invention can improve the speed control efficiency of the stepper motor and facilitate the control of acceleration and deceleration.

[0089] Second embodiment of the stepping motor speed control method:

[0090] See also Figure 8The difference between this embodiment and the first embodiment is the flowchart of the acceleration state. The flowchart of the acceleration state of this embodiment, relative to the first embodiment, further includes step S32', i.e., judging whether the value of the remaining pulse is less than the number of deceleration pulses corresponding to the running speed. If the judgment result of step S32' is no, then continue to execute step S33'. If the judgment result of step S32' is yes, then directly jump to step S36'.

[0091] Computer device embodiment:

[0092] The computer device of this embodiment includes a processor and a memory. The memory stores a computer program. When the processor executes the computer program, the above-mentioned stepper motor speed control method embodiment is implemented.

[0093] The computer device may include but is not limited to a processor and a memory. Those skilled in the art will appreciate that the computer device may include more or fewer components, or a combination of certain components, or different components, for example, the computer device may also include input and output devices, network access devices, buses, etc.

[0094] For example, the processor may be a central processing unit (CPU), 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 microcontroller or any conventional processor, etc. The processor is the control center of a computer device, and uses various interfaces and lines to connect various parts of the entire computer device.

[0095] The memory can be used to store computer programs and / or modules. The controller realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. For example, the memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound receiving function, a sound conversion to text function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0096] Computer readable storage medium embodiment:

[0097] If the module integrated in the computer device of the above embodiment 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 implementation of all or part of the process of the stepper motor speed control method embodiment 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 controller, the steps of the above stepper motor speed control method embodiment 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 storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0098] Computer program product embodiment:

[0099] The computer program product of this embodiment includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes each step of the above-mentioned stepper motor speed control method embodiment.

Claims

1. A stepper motor speed control method, characterized in that: The following steps are involved: Acquire stepper motor motion instruction data, wherein the stepper motor motion instruction data includes a minimum speed pulse frequency, a positive acceleration, a negative acceleration, a maximum speed pulse frequency, and a value of a remaining pulse; Controlling the stepper motor to start moving according to the stepper motor motion instruction data, and updating the value of the remaining pulses each time a pulse is output during the process from the stepper motor starting to move to a standstill; The stepper motor is started according to the minimum speed pulse frequency, and after the stepper motor is accelerated to the minimum speed corresponding to the minimum speed pulse frequency, acceleration control is performed according to the positive acceleration to determine whether a condition for entering a uniform speed state is met, and if so, the number of current speed deceleration pulses is calculated to enter a uniform speed state; Controlling the stepper motor to move at a constant speed until the value of the remaining pulses is less than or equal to the number of the current speed deceleration pulses, and then entering a deceleration state; The stepper motor is decelerated according to the negative acceleration, and when it is decelerated to a speed less than or equal to the minimum speed, the pulse frequency corresponding to the current operating speed is maintained to output pulses until the value of the remaining pulses is 0.

2. The stepper motor speed control method according to claim 1, characterized in that: Before starting the stepper motor according to the minimum speed pulse frequency, the method includes: Setting the running speed to the minimum speed; Calculating the number of pulses per unit time corresponding to the running speed; Set the timer interrupt time corresponding to the running speed; When the stepper motor is started according to the minimum speed pulse frequency, it includes: Enter the timer interrupt, output a pulse, and the value of the speed pulse accumulator increases by 1; After the value of the speed pulse accumulator is greater than the number of pulses per unit time corresponding to the running speed, acceleration begins according to the positive acceleration.

3. The stepper motor speed control method according to claim 2, characterized in that: The number of pulses per unit time corresponding to the running speed = the running speed / preset time parameter; The current speed deceleration pulse number = running speed * running speed / negative acceleration / 2; The timer interruption time corresponding to the running speed=timer clock frequency / the running speed.

4. The stepper motor speed control method according to claim 3, characterized in that: The preset time parameter is 1000, and the number of pulses per millisecond corresponding to the running speed = the running speed / 1000.

5. The stepper motor speed control method according to claim 2, characterized in that: The condition for entering the uniform speed state is one of the following: accelerating to a running speed greater than or equal to the maximum speed corresponding to the maximum speed pulse frequency, and the value of the remaining pulses is less than the number of deceleration pulses corresponding to the running speed.

6. The stepper motor speed control method according to any one of claims 2 to 5, characterized in that: Each time the positive acceleration is increased, acceleration control is performed, including: The running speed is increased by the positive acceleration, the value of the speed pulse accumulator is cleared, the number of pulses per unit time corresponding to the running speed is updated, and the timer interrupt time corresponding to the running speed is updated; Enter the timer interrupt, output pulse, and the value of the speed pulse accumulator is increased by 1; Until the value of the speed pulse accumulator is greater than the number of pulses per unit time corresponding to the running speed.

7. The stepper motor speed control method according to claim 5, characterized in that: The deceleration control is performed by reducing the negative acceleration one at a time, including: The running speed is reduced by the negative acceleration, the value of the speed pulse accumulator is cleared, the number of pulses per unit time corresponding to the running speed is updated, and the timer interrupt time corresponding to the running speed is updated; Enter the timer interrupt, output pulse, and the value of the speed pulse accumulator is increased by 1; Until the value of the speed pulse accumulator is greater than the number of pulses per unit time corresponding to the running speed.

8. A computer device comprising a processor and a memory, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the stepper motor speed control method according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the stepper motor speed control method described in any one of claims 1 to 7 is implemented.

10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by the processor, the stepper motor speed control method described in any one of claims 1 to 7 is implemented.