Optimization method, control method and system for acceleration and deceleration curve of stepper motor

By dividing the stepper motor motion process into four non-zero speed start-stop modes and optimizing pulse control, the problem of insufficient control performance of stepper motors in zero-speed start-stop states is solved, achieving more efficient dynamic torque utilization and lower computational power consumption, thus improving control accuracy and flexibility.

CN115411983BActive Publication Date: 2026-05-08SOUTHWEST JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTHWEST JIAOTONG UNIV
Filing Date
2022-04-02
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

The linear acceleration and deceleration curves of existing stepper motors cannot fully utilize their control performance in zero-speed start-stop states, and they also exhibit large dynamic torque and oscillation phenomena, especially performing poorly in fast dynamic response situations.

Method used

By adopting a non-zero speed start-stop acceleration and deceleration curve optimization method, the stepper motor motion process is divided into four modes: uniform speed, uniform acceleration, uniform deceleration before zero crossing, and uniform deceleration before zero crossing. Through pipeline technology and stepper motor controller IP core designed with FPGA chip, the pulse generation time and interval are optimized to achieve arbitrary linear speed profile control.

Benefits of technology

It improves the control performance of the stepper motor, reduces the dynamic torque during acceleration, reduces computational power consumption, enhances control accuracy and flexibility, and reduces the thermal power consumption of the FPGA chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115411983B_ABST
    Figure CN115411983B_ABST
Patent Text Reader

Abstract

The application relates to a kind of acceleration and deceleration curve optimization method, control method and system of step motor, and to step motor control technical field, by dividing the movement process of step motor into four non-zero speed start-stop rotation modes, including uniform speed mode, uniform acceleration mode, uniform deceleration non-zero point mode and uniform deceleration zero point mode, respectively for each mode Calculation pulse generation time and adjacent pulse generation time interval, and based on the pulse generation time and generation time interval under the four modes, the acceleration and deceleration curve is optimized. The optimized acceleration and deceleration curve is used to drive the step motor to start from a certain speed, compared with the linear acceleration and deceleration curve started from static, the dynamic torque required by the step motor in the acceleration process is smaller, and the control performance is better when accelerating to medium-high speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of stepper motor control technology, and in particular to a method, control method and system for optimizing the linear acceleration and deceleration curve of a stepper motor. Background Technology

[0002] A stepper motor is an actuator that converts a digital pulse sequence into angular displacement increments. It is characterized by low cost, rapid start / stop, and high positioning accuracy, and is widely used in robotics, CNC machine tools, and automation equipment. There are two main control methods for stepper motors: open-loop and closed-loop. Closed-loop control offers high control accuracy and efficiency, but it also has higher system cost and implementation complexity. With the development of microstepping technology, the synchronization capability of angular displacement output with pulse input has continuously improved. Furthermore, through optimization of appropriate acceleration / deceleration curve algorithms, phenomena such as missed steps and impact oscillations can be effectively avoided. Because open-loop control is simple to implement and its control accuracy meets the needs of most applications, it is the primary control method for stepper motors. Current research mainly focuses on acceleration / deceleration curve optimization and its specific implementation.

[0003] Domestic and international researchers have proposed many optimization schemes for stepper motor acceleration and deceleration curve algorithms, mainly including linear, S-shaped, and sine curves. S-shaped and sine curves can effectively suppress shocks and residual oscillations during motion, but they are not suitable for applications requiring rapid dynamic response. Furthermore, these two acceleration and deceleration curve algorithms are complex to implement, and accurate real-time calculation is also difficult. Linear acceleration and deceleration curve algorithms are simple to implement, have a fast response, and possess time-optimal characteristics. Currently, most linear acceleration and deceleration curves involve zero-speed start-stop, failing to fully utilize the stepper motor's self-starting and stopping frequency and torque-frequency characteristics, thus hindering the full realization of its control performance.

[0004] Therefore, there is an urgent need for an optimization method based on the linear acceleration and deceleration curve of a stepper motor under non-zero speed start-stop conditions, and to implement the control of the stepper motor rotation based on this optimization method, so as to improve the control performance of the stepper motor. Summary of the Invention

[0005] The purpose of this invention is to provide a method, control method and system for optimizing the acceleration and deceleration curves of a stepper motor, enabling non-zero speed start and stop of the stepper motor, and improving the control performance of the stepper motor.

[0006] To achieve the above objectives, the present invention provides the following solution:

[0007] A method for optimizing the acceleration and deceleration curves of a stepper motor, comprising:

[0008] Input at least one control cycle and the initial angular velocity and angular displacement of the stepper motor corresponding to each control cycle, wherein the control cycle is an arbitrarily set time for controlling the rotation of the stepper motor;

[0009] With the stepper motor in operation, the angular acceleration is calculated based on each control cycle, the initial angular velocity, and the angular displacement.

[0010] The rotation mode of the stepper motor is determined based on the initial angular velocity and the angular acceleration, wherein the rotation mode includes uniform speed mode, uniform acceleration mode, uniform deceleration mode before zero point crossing mode and uniform deceleration mode before zero point crossing mode.

[0011] Based on the rotation mode, the occurrence time of each pulse and the interval between the occurrence times of adjacent pulses are calculated in each control cycle;

[0012] The optimized acceleration / deceleration curves are obtained based on all occurrence times and occurrence time intervals under all said control cycles.

[0013] A stepper motor control system, wherein the control system is a stepper motor controller IP core designed on an FPGA chip, the IP core comprising:

[0014] An interface module, connected to a soft-core processor, is used to send control commands from the soft-core processor to the curve algorithm module;

[0015] The curve algorithm module, connected to the interface module, is used to execute the acceleration / deceleration curve optimization method using pipeline technology after receiving the control command, so as to obtain the optimized acceleration / deceleration curve.

[0016] A pulse generation module, connected to the curve algorithm module, is used to output pulses based on the optimized acceleration / deceleration curve and control the stepper motor to rotate based on the pulses.

[0017] A stepper motor control method utilizing a stepper motor control system includes:

[0018] Receive control commands from the soft-core processor;

[0019] According to the control command, the acceleration and deceleration curve optimization method is executed using pipeline technology to obtain the optimized acceleration and deceleration curve;

[0020] Output pulses based on the optimized acceleration / deceleration curve;

[0021] The stepper motor is controlled to rotate according to the pulse.

[0022] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0023] This invention provides a method, control method, and system for optimizing the acceleration and deceleration curves of a stepper motor. By dividing the stepper motor's motion process into four non-zero-speed start-stop rotation modes—uniform speed mode, uniform acceleration mode, uniform deceleration mode (before zero-crossing), and uniform deceleration mode (zero-crossing)—the invention calculates the pulse occurrence time and the interval between adjacent pulse occurrences for each mode. Based on all occurrence times and intervals under these four modes, an optimized acceleration and deceleration curve is obtained. This optimized curve drives the stepper motor to start from a certain speed. Compared to a linear acceleration and deceleration curve starting from a standstill, the stepper motor requires less dynamic torque during acceleration and exhibits better control performance at medium to high speeds. Furthermore, by dividing the arbitrary linear acceleration and deceleration process of the stepper motor into four non-zero-speed start-stop rotation modes, arbitrary linear velocity profiles, such as triangular or trapezoidal velocity profiles, can be achieved, providing greater flexibility in application. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of the acceleration / deceleration curve optimization method provided in Embodiment 1 of the present invention;

[0026] Figure 2 This is a schematic diagram of the four rotation modes in Embodiment 1 of the present invention: uniform speed, uniform acceleration, uniform deceleration before zero point, and uniform deceleration before zero point.

[0027] Figure 3 This is a schematic diagram of the discretized uniform acceleration mode in Example 1 of this embodiment;

[0028] Figure 4 This is a schematic diagram of the optimized acceleration / deceleration curve in Example 1 of this embodiment;

[0029] Figure 5 This is a schematic diagram of the stepper motor controller IP core provided in Embodiment 2;

[0030] Figure 6 This is a flowchart of the core algorithm in the control method provided in Embodiment 3;

[0031] Figure 7 This is a timing flowchart of the control method provided in Embodiment 3;

[0032] Figure 8This is a schematic diagram illustrating the calculation of the time interval between adjacent pulses and the error in the time interval between adjacent pulses using the control method provided in Embodiment 3.

[0033] Figure 9 This is a schematic diagram of the experimental platform for the stepper motor controller IP core provided in Embodiment 3.

[0034] Figure 10 This is a schematic diagram comparing the actual speed and angular displacement curves of the stepper motor with the theoretical values ​​under the non-zero speed start-stop control of the four rotation modes in this embodiment 3.

[0035] Figure 11 This is a schematic diagram of the velocity and angular displacement curves of a certain linear velocity profile in Example 3 of this embodiment;

[0036] Figure 12 This is a schematic diagram of the speed, angular displacement, and error curves of the zero-speed start-stop rotation in Embodiment 3.

[0037] Figure 13 This is a schematic diagram of the speed, angular displacement, and error curves of the non-zero speed start-stop rotation in Embodiment 3.

[0038] Figure 14 This is a temperature comparison diagram of the stepper motor controller IP core with zero-speed start / stop and the low-power stepper motor controller IP core with non-zero-speed start / stop in Embodiment 3. Detailed Implementation

[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] The purpose of this invention is to provide a method, control method and system for optimizing the acceleration and deceleration curves of a stepper motor, enabling non-zero speed start and stop of the stepper motor, and improving the control performance of the stepper motor.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] Example 1:

[0043] Regarding the issue of insufficient control performance in zero-speed start-stop, please refer to... Figure 1 This embodiment provides a method for optimizing the acceleration and deceleration curves of a stepper motor, including:

[0044] S1: Input at least one control cycle and the initial angular velocity and angular displacement of the stepper motor corresponding to each control cycle, wherein the control cycle is an arbitrarily set time for controlling the rotation of the stepper motor;

[0045] S2: Under the condition that the stepper motor is in operation, calculate the angular acceleration based on each control cycle, the initial angular velocity, and the angular displacement;

[0046] S3: Determine the rotation mode of the stepper motor based on the initial angular velocity and the angular acceleration, wherein the rotation mode includes uniform speed mode, uniform acceleration mode, uniform deceleration mode before zero crossing mode, and uniform deceleration mode before zero crossing mode. Figure 2 Figures (a)-(d) in the diagram provide schematic diagrams of these four rotation modes, where S3 specifically includes:

[0047] Determine whether the value of the angular acceleration is 0 to obtain the first determination result;

[0048] If the first determination result is yes, then the rotation mode is determined to be a uniform speed mode;

[0049] If the first judgment result is negative, then it is determined whether the sign values ​​of the initial angular velocity and the angular acceleration are the same, and a second judgment result is obtained;

[0050] If the second determination result is yes, then the rotation mode is determined to be a uniform acceleration mode;

[0051] If the second judgment result is negative, then determine whether half of the absolute value of the product of the initial angular velocity and the control period is less than or equal to the absolute value of the angular displacement, and obtain the third judgment result;

[0052] If the third judgment result is yes, then the rotation mode is determined to be a uniform deceleration mode that has not crossed the zero point.

[0053] Otherwise, the rotation mode is determined to be a uniform deceleration zero-crossing mode.

[0054] S4: Based on the rotation mode, calculate the occurrence time of each pulse sent to the stepper motor in each control cycle and the occurrence time interval of adjacent pulses sent to the stepper motor. Since the stepper motor will rotate one step every time it receives a pulse signal, the number of pulses sent to the stepper motor in each control cycle is set to be equal to the stepping threshold of the stepper motor in that control cycle.

[0055] A stepper motor converts electrical pulse signals into corresponding angular displacements. For each input electrical pulse, the motor rotates one step. Therefore, the speed change characteristics can be determined by a discrete pulse sequence, and the pulse period determines the stepper motor's rotational speed. The following analysis examines the pulse occurrence times and the intervals between adjacent pulse occurrences for four rotation modes.

[0056] During the linear rotation, with the starting point of the control period T as the time origin, the angular displacement θ is...

[0057]

[0058] In equation (1), ω0 is the initial angular velocity, β is the angular acceleration, n is the number of steps, and η is the motor step angle.

[0059] The angular acceleration β can be obtained as follows:

[0060]

[0061] 1) During the uniform speed rotation, the angular acceleration β is zero, i.e., θ1 = ω0T. The stepper motor rotates at a constant step rate. The time interval c between the occurrence of the i-th and (i-1)-th pulses sent to the stepper motor is... i for

[0062]

[0063] In the formula, f is the processor clock frequency, and θ1 is the angular displacement in the uniform speed mode.

[0064] 2) In the uniform acceleration mode, the initial angular velocity ω0 and angular acceleration β have the same sign, and |θ2|>|ω0T|, where θ2 is the angular displacement in the uniform acceleration mode. The discretized rotation process in the uniform acceleration mode is as follows: Figure 3 As shown.

[0065] Starting from the time t=0, t i Angular displacement θ at time t i for

[0066]

[0067] Therefore, the time t of the i-th pulse sent to the stepper motor i for

[0068]

[0069] Further derivation using angular acceleration β yields...

[0070]

[0071] The time interval c between the occurrence of the i-th and (i-1)-th pulses sent to the stepper motor i for

[0072]

[0073]

[0074] 3) In the uniform deceleration mode without crossing zero, the initial angular velocity ω0 and angular acceleration β have opposite signs, and 0.5*|ω0T|≤|θ3|<|ω0T|, where θ3 is the angular displacement in the uniform deceleration mode without crossing zero. Similar to the derivation process in the uniform acceleration mode, the signs are opposite; therefore, the time interval c between the occurrence of the i-th and (i-1)-th pulses sent to the stepper motor is... i for

[0075]

[0076] 4) In the uniform deceleration zero-crossing mode, the initial angular velocity ω0 and angular acceleration β have opposite signs, and |θ4| < 0.5*|ω0T|, where θ4 is the angular displacement in the uniform deceleration zero-crossing mode. The deceleration zero-crossing mode can be divided into two parts: a deceleration mode and an acceleration mode. The control period T of the deceleration mode is... A for

[0077]

[0078] Angular displacement θ in deceleration mode 41 for

[0079]

[0080] The initial angular velocity in acceleration mode is zero, and the control period is T. B for

[0081] T B =TT A (12)

[0082] Angular displacement θ in acceleration mode 42 for

[0083] θ 42 =θ4-θ 41 (13)

[0084] The calculation method for the time interval of the i-th and (i-1)-th pulses sent to the stepper motor in deceleration mode and acceleration mode is the same as that in uniform deceleration mode before zero crossing mode and uniform acceleration mode.

[0085] S5: An optimized acceleration / deceleration curve is obtained based on all occurrence times and occurrence time intervals under all control cycles, such as... Figure 4 As shown.

[0086] The linear acceleration and deceleration process with arbitrary non-zero speed start and stop is divided into four rotation modes: uniform speed, uniform acceleration, uniform deceleration before zero crossing, and uniform deceleration before zero crossing. Based on the pulse occurrence time and the interval between adjacent pulse occurrences under these four modes, the acceleration and deceleration curves are optimized. Using the optimized acceleration and deceleration curves, the stepper motor is started at a certain speed. Compared to zero-speed start, non-zero speed start fully utilizes the stepper motor's self-starting frequency, requires less dynamic torque during acceleration, exhibits less chattering at medium to high speeds, and provides better control. Arbitrary linear velocity profiles, such as triangular or trapezoidal velocity profiles, can be constructed by combining these four rotation modes, offering strong application flexibility.

[0087] To further reduce computational power consumption during the optimization of acceleration / deceleration curves, this embodiment employs pipelined execution for steps S1-S5. Simultaneously, the specific calculation formulas in steps S2-S4 are broken down according to multiplication, division, and square root operations. It's important to note that these broken formulas are also processed using pipelined techniques during computation. Therefore, this embodiment can obtain acceleration / deceleration curves for non-zero-speed start-stop states while reducing computational power consumption.

[0088] Example 2:

[0089] FPGAs, with their high speed, parallel processing, and modularity, enable synchronous parallel control of multi-axis motors, improving the integration of multi-axis systems and enhancing their servo control performance. Key research issues in FPGA-based multi-axis motor control systems include control algorithms, hardware logic models of these algorithms, embedded microprocessors, and system-level integration technologies. However, FPGA-based multi-axis motor control systems suffer from severe heat dissipation problems, consuming more power and often leading to FPGA chip damage or reduced device lifespan.

[0090] To address the aforementioned issues, a stepper motor acceleration / deceleration curve optimization method based on Embodiment 1 is proposed. A stepper motor controller IP core is designed using pipeline technology and low-power IC design techniques such as gated clock. This core can drive the stepper motor to start and stop at non-zero speeds, improving control performance while reducing FPGA chip power consumption.

[0091] See Figure 5 This embodiment provides a stepper motor control system, which is a stepper motor controller IP core designed on an FPGA chip. The IP core is designed and implemented using pure hardware logic, including:

[0092] An interface module, connected to the soft-core processor via an Avalon bus, is used to send control commands from the soft-core processor to the curve algorithm module. In this embodiment, a Nios II soft-core processor is preferred.

[0093] The curve algorithm module, connected to the interface module, is used to execute the acceleration / deceleration curve optimization method described in Example 1 using pipelined technology to obtain an optimized acceleration / deceleration curve after receiving the control command. The curve algorithm module is the core module of the stepper motor controller IP core, divided into two sub-modules: a state machine and a calculation module. It uses a finite state machine to complete the internal timing scheduling and state transitions, reducing intermediate calculation variables and constraining variable bit width. The state machine encoding uniformly adopts Gray Code, and only one bit changes between adjacent states. The calculation module is used for multiplication, division, and square root operations. It employs two recursive structure algorithms—non-recovery remainder division and non-redundant square root—for division and square root calculations, saving logic resources by increasing the calculation cycle.

[0094] A pulse generation module, connected to the curve algorithm module, is used to output pulses based on the optimized acceleration / deceleration curve, and control the stepper motor rotation based on the pulses. A counter is also designed to ensure the output pulse duty cycle is 50%. When the counter value is less than c... i When / 2, the PWM output level is low; otherwise, it is high, where c i The time interval between the occurrence of adjacent pulses;

[0095] The position detection module is connected to the stepper motor and the interface module. It is used to detect the rotor position information of the stepper motor in real time, parse the rotor position information, and send the parsed rotor position information to the soft core processor through the interface module.

[0096] As an optional implementation, both the interface module and the curve algorithm module are equipped with clock gating; wherein the curve algorithm module is clock-gated according to the time control of the acceleration / deceleration curve optimization method described in Embodiment 1.

[0097] This embodiment provides a low-power controller for non-zero speed start-stop of a stepper motor, which controls the stepper motor to start or stop at a certain speed, improving the control performance of the stepper motor and reducing the thermal power consumption of the controller.

[0098] Example 3:

[0099] This embodiment utilizes the IP core provided in Embodiment 2 to provide a stepper motor control method for a control system, including:

[0100] Receive control instructions from the soft-core processor;

[0101] According to the control command, the acceleration / deceleration curve optimization method described in Example 1 is executed using pipeline technology to obtain an optimized acceleration / deceleration curve;

[0102] Output pulses based on the optimized acceleration / deceleration curve;

[0103] The stepper motor is controlled to rotate according to the pulse.

[0104] To ensure the stepper motor rotates in the desired direction, it is also necessary to determine the current rotation direction of the stepper motor, which specifically includes:

[0105] Determine whether the initial angular velocity is 0;

[0106] If so, then the direction of rotation is determined to be the same as the direction of the initial angular velocity;

[0107] If not, then the direction of rotation is determined to be the same as the direction of angular displacement.

[0108] To enable those skilled in the art to better understand the above control process, please refer to Figure 6 By incorporating pipeline design principles, the complex algorithm process is divided into multi-stage pipeline processing, including:

[0109] Initialize the stepper motor controller IP core;

[0110] Initial value calculation: Initialize the step counting parameter i and the number of steps n; determine the rotation direction of the motor based on the initial angular velocity and angular displacement; calculate the angular acceleration and store the calculated value in the corresponding register; this part of the parameter is used as the initial value.

[0111] The motor rotation mode is quickly determined by the initial angular velocity and angular acceleration. Mode 1 corresponds to the uniform speed mode; Mode 2 and Mode 3 correspond to the uniform acceleration mode and the uniform deceleration mode before zero crossing, respectively; Mode 4 corresponds to the uniform deceleration mode before zero crossing.

[0112] Calculate the occurrence time of the current pulse sent to the stepper motor and the interval between the occurrence time of the current pulse and its adjacent pulses under the current step counting parameters according to different modes.

[0113] Determine if the current step counting parameter is less than the number of steps;

[0114] If so, increment the current step parameter by 1, send the next pulse to the stepper motor, and return to the step "calculate the occurrence time of the current pulse sent to the stepper motor and the interval between the occurrence time of the current pulse and its adjacent pulses under the current step parameters according to different modes" until the step parameter equals the number of steps.

[0115] Before each step pulse is completed, the timing interval of the next adjacent pulse is calculated iteratively to ensure the real-time performance of the control and to leverage the parallel processing capabilities of the FPGA.

[0116] like Figure 7 The control timing flowchart shown, after the addition of a gating clock, includes the following specific control method flow:

[0117] 1) Turn on the clock of the interface module, read the parameter instructions, turn off the clock gating after completion, and assign values ​​to the corresponding register parameters;

[0118] 2) Enter the first judgment. If the initial angular velocity ω0 and angular displacement θ are both 0, the motor remains stationary and returns to the idle state; otherwise, proceed to the next step.

[0119] 3) Initialize the step counting parameter i and the number of steps n;

[0120] 4) Determine the direction of motor rotation. If the initial angular velocity ω0 is not 0, the direction of rotation is the same as the direction of ω0; otherwise, the direction of rotation is the same as the direction of angular displacement θ.

[0121] 5) Turn on the clock of the multiplication module to complete the calculation of ω0*T, and turn off the clock of the module after the calculation is completed;

[0122] 6) Calculate the sign value (θ-ω0T) of the angular acceleration β as the basis for judging the rotation mode. If the acceleration is 0, enter mode 1. The time interval between the occurrence of adjacent pulses during the rotation process is calculated as shown in equation (8). Otherwise, proceed to the next step.

[0123] 7) Turn on the clock of the multiplication module to complete the calculation of ω0T*T, and turn off the clock of the module after the calculation is completed;

[0124] 8) Turn on the division module clock to complete ω0T 2 The calculation of / [2(θ-ω0T)] is performed, and the clock of this module is turned off after the corresponding time calculation is completed;

[0125] 9) Turn on the clock of the multiplication module to complete the square calculation. After the calculation is completed, obtain the initial value and turn off the clock of the module.

[0126] 10) Turn on the clock of the multiplication module to complete the calculation of T*T, and turn off the clock of the module after the calculation is completed;

[0127] 11) Turn on the multiplication module clock to complete η*T 2 The calculation is completed, and the module's clock is then turned off.

[0128] 12) Turn on the division module clock to complete ηT 2 The calculation of / (θ-ω0T) is performed, and the clock of the module is turned off after the corresponding time calculation is completed.

[0129] 13) Determine the motor rotation mode. If the initial angular velocity ω0 and the angular acceleration β have the same sign, proceed to mode 2; otherwise, proceed to the next step.

[0130] 14) If the initial angular velocity ω0 and the angular acceleration β have opposite signs, and 0.5*|ω0T|≤|θ|, then enter mode 3; otherwise, enter mode 4.

[0131] 15) Turn on the clock of the square root module and wait for the calculation to complete to obtain the pulse occurrence time value, as shown in equation (6);

[0132] 16) The time interval between the occurrence of adjacent pulses during the rotation of mode 3 is calculated as shown in equation (8);

[0133] 17) The time interval between the occurrence of adjacent pulses during the rotation of mode 4 is calculated as shown in equation (9);

[0134] 18) During the uniform deceleration and zero-point rotation process, calculate the control period and angular displacement of the uniform deceleration mode as shown in equations (10) and (11) and the control period and angular displacement of the uniform acceleration mode as shown in equations (12) and (13) respectively, and return to the corresponding rotation mode.

[0135] To verify the feasibility and effectiveness of the above scheme, a stepper motor controller was designed and implemented using the Verilog hardware description language in the EDA development tool (Quartus II). The various modules were synthesized and encapsulated into a custom IP soft core. The logic resource usage of the synthesized IP core is shown in Table 1. Hereinafter, the non-zero-speed start-stop stepper motor controller IP core will be referred to as the non-zero-speed IP core, while the stepper motor controller IP core that starts and stops from a standstill, as proposed in the prior art, will be referred to as the zero-speed IP core.

[0136] Table 1 Logical Resource Usage

[0137] Table 1 Logical resource usage

[0138]

[0139] According to the resource usage in Table 1, compared with the zero-speed IP core, the total logic resource usage decreased by 1005, a reduction of 29.71%. Among them, combinational logic decreased by 936, a reduction of 30.17%; sequential logic decreased by 437, a reduction of 24.72%; and multipliers decreased by 4, a reduction of 25%.

[0140] The power consumption of the controller IP core was pre-evaluated using the power analysis tool PowerPlay PowerAnalyzer provided by Quartus II. The power consumption was estimated by using the output of the gate-level simulation as input. The evaluation results under the same conditions are shown in Table 2.

[0141] Table 2 Power Consumption Evaluation Results

[0142] Table 2Power dissipation evaluation result

[0143]

[0144] According to the power consumption assessment results in Table 2, compared with the zero-speed IP core, the total thermal power consumption is reduced by 145.47mW, a decrease of 36.15%, of which the dynamic thermal power consumption is reduced by 144.92mW, a decrease of 61.73%, while the static thermal power consumption and I / O thermal power consumption are basically the same.

[0145] After completing the optimized design of the hardware module, the accuracy of the calculation of the time interval between adjacent pulses was verified by simulation in Modelsim. Figure 8 As shown, the error between the real-time calculated time interval between adjacent pulses and the theoretical value does not exceed ±0.1%, ensuring the accuracy of acceleration and deceleration control.

[0146] (1) Verify the four rotation modes of a certain control example.

[0147] The aforementioned stepper motor controller IP core has been implemented on Altera's DE0 FPGA development board. The driven object is a two-phase hybrid stepper motor with a rated torque of 0.032 N·m, a rated current of 0.5 A, a step angle of 1.8°, a rotor inertia of 1.5 × 10⁻⁷ kg·m², an encoder line count of 1024, and a side length of 20 mm. The load rotational inertia is approximately 6.5 × 10⁻⁷ kg·m², the drive circuit voltage is 24 V, and the microstepping is 16. The experimental platform is as follows... Figure 9 As shown.

[0148] To verify the operational effectiveness of the four rotation modes, the control performance was tested under the following four modes: uniform speed, uniform acceleration, uniform deceleration before zero crossing, and uniform deceleration before zero crossing. The velocity and angular displacement curves are shown below. Figure 10 As shown, the designed stepper motor controller IP core can realize non-zero speed start-stop control in four rotation modes. Its actual speed and angular displacement curves match the theoretical values ​​well, achieving high real-time and high-precision drive control.

[0149] These four rotation modes can be used to construct arbitrary linear velocity profiles. A constructed linear velocity profile includes four processes: a uniform acceleration process starting from non-zero speed, a uniform speed process, a uniform deceleration process crossing zero, and a uniform deceleration process stopping at zero speed. The velocity and angular displacement curves during these rotational processes are shown below. Figure 11 As shown, the stepper motor operates precisely according to a planned linear speed profile, but there is a certain mechanical oscillation phenomenon due to the sudden change in speed during non-zero speed start-up and stop.

[0150] (2) Verify the control performance of the stepper motor in a certain control example.

[0151] To verify the performance optimization effect of the acceleration / deceleration curves for non-zero speed start-stop, the control performance of zero-speed start-stop and non-zero-speed start-stop acceleration / deceleration curves was tested under the same conditions. The given control period was 100ms, with acceleration, constant speed, and deceleration times of 40ms, 20ms, and 40ms, respectively; the angular velocity for non-zero speed start was 7.5π (rad / s). The given speed curves for zero-speed start-stop and non-zero-speed start-stop are shown below. Figure 12 , 13 The speed is shown in (a). During this process, the maximum angular displacement and its error during zero-speed start-stop and non-zero-speed start-stop acceleration / deceleration are respectively shown in (a). Figure 12 , 13 The angular displacement (b) and error (c) are shown in the figure.

[0152] Depend on Figure 12 and Figure 13 It can be seen that the maximum stepless angular displacement of zero-speed start-stop is 540°, and the maximum stepless angular displacement of non-zero-speed start-stop is 648°, which is 108° higher than that of zero-speed start-stop, improving the control performance by 20%. After the operation is stable, the position error is within ±0.5°.

[0153] (3) Verify the power consumption of the controller IP core in a certain control instance.

[0154] To verify the power optimization effect of the designed low-power stepper motor controller IP core, six zero-speed start-stop controller IP cores and non-zero-speed start-stop controller IP cores were instantiated in the FPGA. The surface temperature changes of each FPGA chip in a free and open environment are as follows: Figure 14 As shown, after about 30 minutes, all FPGA chips reached thermal equilibrium. The temperature rise of the zero-speed IP core was about 8.1℃, and the temperature rise of the non-zero-speed IP core was about 3.8℃, which is 4.3℃ less than the temperature rise of the zero-speed IP core, and the thermal power consumption was reduced by about 53.09%.

[0155] Experiments show that the low-power stepper motor controller IP core with non-zero speed start-stop can achieve non-zero speed start-stop control in four rotation modes. Compared with the stepper motor IP core with zero speed start-stop, the control performance is improved by 20%, the circuit area is optimized by 30%, and the power consumption is reduced by 53%.

[0156] This embodiment uses a non-zero speed start-stop linear acceleration and deceleration curve to control the stepper motor, driving the stepper motor to start from a certain speed. Compared with the linear acceleration and deceleration curve that starts from a standstill, the dynamic torque required during acceleration is smaller, and the control performance is better when accelerating to medium and high speeds.

[0157] The arbitrary linear acceleration and deceleration process of the stepper motor is divided into four non-zero speed start-stop rotation modes, which can realize any linear velocity profile, such as triangular velocity profile, trapezoidal velocity profile, etc., and has strong flexibility in use.

[0158] By combining pipelined design principles with optimized hardware logic models for acceleration / deceleration curve algorithms, a stepper motor controller IP core was designed within an FPGA. Low-power IC design techniques, such as gated clocking, were employed to achieve low power consumption for the IP core. Pipeline design segmented the logical computation paths of the complex algorithm, while gated clocking controlled the validity of clock signals to each module to achieve state transitions, reducing unnecessary power consumption.

[0159] This embodiment can achieve high real-time and high-precision driving of stepper motors.

[0160] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0161] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for optimizing the acceleration and deceleration curves of a stepper motor, characterized in that, include: Input at least one control cycle and the initial angular velocity and angular displacement of the stepper motor corresponding to each control cycle, wherein the control cycle is an arbitrarily set time for controlling the rotation of the stepper motor; With the stepper motor in operation, the angular acceleration is calculated based on each control cycle, the initial angular velocity, and the angular displacement. The rotation mode of the stepper motor is determined based on the initial angular velocity and the angular acceleration, wherein the rotation mode includes uniform speed mode, uniform acceleration mode, uniform deceleration mode before zero point crossing mode and uniform deceleration mode before zero point crossing mode. Based on the rotation mode, calculate the occurrence time of each pulse sent to the stepper motor in each control cycle and the interval between the occurrence times of adjacent pulses; The optimized acceleration / deceleration curve is obtained based on all occurrence times and occurrence time intervals under all control cycles; When the rotation mode is the uniform speed mode, the expression for the time interval between adjacent pulse occurrences is: in, c i The first signal sent to the stepper motor in constant speed mode i The and the first i-1 The time interval between the occurrence of each pulse; f This refers to the processor's operating clock frequency; T To control the cycle; n The step number; η The step angle of the stepper motor; θ 1 This refers to the angular displacement in the uniform velocity mode. θ 1 =ω 0 T ; ω 0 The initial angular velocity of the stepper motor; When the current rotation mode is the uniform acceleration mode, the expression for the time interval between adjacent pulse occurrences is: in, c i The first signal sent to the stepper motor in uniform acceleration mode i The and the first i-1 The time interval between the occurrence of each pulse; f This refers to the processor's operating clock frequency; ω 0 The initial angular velocity; T To control the cycle; η The step angle of the stepper motor; θ 2 The angular displacement under the uniform acceleration mode is given. |θ 2 |>|ω 0 T| ; When the current rotation mode is the uniform deceleration mode that has not crossed zero, the expression for the time interval between adjacent pulse occurrences is: in, c i The first signal sent to the stepper motor in the uniform deceleration non-zero-crossing mode i The and the first i-1 The time interval between the occurrence of each pulse; f This refers to the processor's operating clock frequency; ω 0 The initial angular velocity; T To control the cycle; η The step angle of the stepper motor; θ 3 The angular displacement is the one in the uniform deceleration mode that does not cross zero. 0.5 |ω 0 T|≤|θ 3 |<|ω 0 T| ; When the current rotation mode is the deceleration mode in the uniform deceleration zero-crossing mode, the expression for the time interval between adjacent pulses sent to the stepper motor is: in, c i The first signal sent to the stepper motor in the deceleration mode of the uniform deceleration zero-crossing mode. i The and the first i- 1 The time interval between the occurrence of each pulse; f This refers to the processor's operating clock frequency; ω 0 The initial angular velocity; T To control the cycle; η The step angle of the stepper motor; θ 4 This refers to the angular displacement during the zero-crossing mode of uniform deceleration. |θ 4 |<0.5 |ω 0 T| ; T A This refers to the control cycle under the deceleration mode; θ 41 This refers to the angular displacement under the uniform deceleration mode; When the current rotation mode is the acceleration mode in the uniform deceleration zero-crossing mode, the expression for the time interval between adjacent pulses sent to the stepper motor is: in, T B The control cycle under the acceleration mode; θ 42 denoted as angular displacement in the acceleration mode.

2. The acceleration / deceleration curve optimization method according to claim 1, characterized in that, The acceleration / deceleration curve optimization method is implemented using pipeline technology.

3. The acceleration / deceleration curve optimization method according to claim 1, characterized in that, The stepper motor rotation mode determination based on the initial angular velocity and the angular acceleration specifically includes: Determine whether the value of the angular acceleration is 0 to obtain the first determination result; If the first determination result is yes, then the rotation mode is determined to be a uniform speed mode; If the first judgment result is negative, then it is determined whether the sign values ​​of the initial angular velocity and the angular acceleration are the same, and a second judgment result is obtained; If the second determination result is yes, then the rotation mode is determined to be a uniform acceleration mode; If the second judgment result is negative, then determine whether half of the absolute value of the product of the initial angular velocity and the control period is less than or equal to the absolute value of the angular displacement, and obtain the third judgment result; If the third judgment result is yes, then the rotation mode is determined to be a uniform deceleration mode that has not crossed the zero point. Otherwise, the rotation mode is determined to be a uniform deceleration zero-crossing mode.

4. A stepper motor control system, characterized in that, The control system is a stepper motor controller IP core designed on an FPGA chip, and the IP core includes: The interface module, connected to the soft-core processor via the Avalon bus, is used to send control commands from the soft-core processor to the curve algorithm module; The curve algorithm module, connected to the interface module, is used to execute the acceleration / deceleration curve optimization method as described in claim 1 using pipeline technology after receiving the control command to obtain the optimized acceleration / deceleration curve; A pulse generation module, connected to the curve algorithm module, is used to output pulses based on the optimized acceleration / deceleration curve and control the stepper motor to rotate based on the pulses.

5. The stepper motor control system according to claim 4, characterized in that, The curve algorithm module is equipped with a clock gating; the curve algorithm module controls the clock gating according to the time of executing the acceleration / deceleration curve optimization method as described in claim 1.

6. A stepper motor control method using the control system according to any one of claims 4-5, characterized in that, include: Receive control instructions from the soft-core processor; According to the control command, the acceleration / deceleration curve optimization method as described in claim 1 is executed using pipeline technology to obtain an optimized acceleration / deceleration curve; Output pulses based on the optimized acceleration / deceleration curve; The stepper motor is controlled to rotate according to the pulse.