Synchronous operation dual-motor control method based on operation step number

By running dual -motor control methods based on the number of running steps, the problem of multiple step motor coordinated motion and spacing adjustment has been solved, and accurate control and system stability are realized, and mechanical wear is reduced.

CN119382551APending Publication Date: 2025-01-28HUNAN GREATWALL INFORMATION FINANCIAL EQUIP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411316839.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art is difficult to achieve the coordinated movement of multiple stepper motors and adjust the working distance, especially in applications requiring precise control, such as fabrics, banner printing and dyeing and stamping machines.

Method used

Use a synchronous running dual motor control method based on the number of running steps. By controlling the speed of the first step in the motor and the transmission of the second -step motor, the dual -step motor collaborative spacing adjustment is achieved. Specific steps include the number of steps, time cycle, and target speed, determine the increase and subtraction curve equation, generate the speed table and control the motor movement.

Benefits of technology

Achieve the coordinated spacing adjustment of the dual -step motor to ensure the precise control of the number of motion steps and positions, reduce mechanical wear, and improve the stability of the system and move the smoothness of the motion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119382551A_ABST
    Figure CN119382551A_ABST
Patent Text Reader

Abstract

The invention discloses a synchronous operation dual-motor control method based on an operation step number, and the method comprises the steps: controlling a first stepping motor to move at a constant speed and controlling a second stepping motor to move at a variable speed after one time of work, enabling the second stepping motor to drive a working region of a second roller to reach a working position again after a first object passes through a set working distance, and enabling the second object to move at a variable speed; the running speed of the second stepping motor is PPSin at the moment; wherein the step of controlling the variable-speed motion of the second stepping motor comprises the following steps: determining a variable-speed operation mode of the second stepping motor based on the difference between the operation step numbers of the second stepping motor and the first stepping motor in a specific time period, and determining an acceleration and deceleration curve equation of the second stepping motor based on the specific step number, the specific time period, the initial speed and the target speed, further solving a speed table corresponding to each micro-step operation time node of the second stepping motor; and based on the obtained speed table, controlling the second stepping motor to perform variable-speed motion. According to the invention, cooperative spacing adjustment of the double stepping motors can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of control technology, and specifically relates to a synchronous operation dual-motor control method based on the number of operation steps. Background Art

[0002] The stepper motor is an open-loop control element that converts electrical pulse signals into angular displacement or linear displacement. Its working principle is as follows: Figure 1 As shown (taking a two-phase stepper motor as an example). The angular displacement or linear displacement output by the stepper motor is proportional to the number of input pulses. Among them, PUL (input stepper control pulse signal), DIR (stepper motor movement direction control), and ENV (enable) are typical input signals of the drive module. The drive module is a stepper motor driver circuit, such as DRV8825, TMC2225 and its peripheral circuits, M332C stepper motor driver, etc.; A+, A-, B+, B- (or ACBD) are the drive signal lines for driving the stepper motor.

[0003] There are three drive modes for stepper motors, namely full-step drive, half-step drive and micro-step drive (subdivision). In full-step drive mode, each time a pulse signal is input, the rotor rotates a fixed angle (called "step angle") or advances a certain distance in a linear stepper motor. The distance of each step is fixed, and this distance is related to the structural parameters of the motor. Micro-step drive mode is a technology that subdivides the step of the stepper motor, allowing the motor to rotate in smaller increments than full steps. In micro-step drive mode, the stepper motor driver or stepper motor driver chip achieves the effect of subdivision control by finely controlling the voltage and current; this technology uses current control to produce an intermediate magnetic field state between two full-step positions, so that the motor can move more smoothly and achieve more precise positioning. The core of the micro-step drive principle lies in the fine control of the winding current. In traditional stepper motor operation, the winding is usually fully opened or fully closed, corresponding to a specific polarity direction, so as to generate enough torque to make the motor turn to the next step angle. However, in microstepping mode, the controller divides the current into multiple levels (or "microsteps") instead of fully on or fully off. Microstepping, in layman's terms, means that one step is divided into multiple microsteps for control. For example, in full-step mode, one step (such as 1.8°) only requires one pulse, while in 16-microstep mode, one step (such as 1.8°) requires 16 microsteps and 16 pulses.

[0004] Due to the difference in driving mode and circuit performance set by the stepper motor driver circuit, the waveform of the driving signal is different (square wave in full-step driving mode and sampling waveform close to a sine waveform in micro-step driving mode).

[0005] In equipment such as cloth and banner printing, conveyor belts, and rolling stamp machines, multiple stepper motors are required to move in coordination and adjust the working spacing (such as the spacing between printing, processing, and stamping).

[0006] like Figure 2 As shown in the figure, taking the stamping machine as an example, its working principle is that the paper feed motor drives the paper to move. When the paper moves to the working position, i.e. the stamping position, the stamp driven by the stamping motor contacts the paper and begins to stamp on the paper. When stamping, the paper feed speed of the roller controlled by the paper feed motor must be the same as the linear speed of the stamp. When multiple stamps need to be printed on a paper, the spacing between stamps on the paper needs to be adjusted by adjusting the speed of the stamping motor and the paper feed motor. Summary of the invention

[0007] The purpose of this application is to provide a synchronous dual-motor control method based on the number of operating steps, which can realize the coordinated spacing adjustment of the dual stepping motors.

[0008] In a first aspect, the present application provides a synchronous dual-motor control method based on the number of running steps, wherein the dual-motor comprises a first stepper motor and a second stepper motor; the first stepper motor and the second stepper motor work together in the following manner:

[0009] The first stepper motor drives the first object, and the second stepper motor drives the second roller;

[0010] The second roller is divided into a first safety area, a working area, a second safety area and an adjustment area in the circumferential direction;

[0011] Each time it works, the second stepper motor drives the working area of ​​the second roller to pass through the working position, so that the first object contacts the working area on the second roller. At this time, the linear speed of the first object and the second roller is the same, and the corresponding running speed of the second stepper motor is PPS. in ;

[0012] After one operation, the first stepper motor is controlled to move at a constant speed of PPS0, and the second stepper motor is controlled to move at a variable speed, so that after the first object passes the set working distance, the second stepper motor drives the working area of ​​the second roller to reach the working position again, and at this time the running speed of the second stepper motor is PPS in ; Wherein, controlling the second stepper motor to change speed includes:

[0013] S1, input parameters steps, T, T half , Δsteps and PPS aim ;

[0014] Wherein, steps is the number of steps that the second stepper motor drives the adjustment area of ​​the second roller to pass through the working position, T is the target time period that the second stepper motor drives the adjustment area of ​​the second roller to pass through the working position, and T half It represents the running time of the first stage of the second stepper motor. Δsteps is the difference between the number of steps of the second stepper motor and the first stepper motor in the target time period T. PPS aim is the target speed of the first stage of the second stepper motor (unit: steps / second);

[0015] S2. Based on the size of Δsteps, determine the speed control mode of the second stepper motor:

[0016] If Δsteps<0, the first stage of the second stepper motor is the acceleration operation process, and the second stage is the deceleration operation process. The acceleration operation process is symmetrical to the deceleration operation process.

[0017] If Δsteps>0, the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process. The acceleration operation process is symmetrical to the deceleration operation process.

[0018] S3, determine the speed table corresponding to each micro-step operation time node of the first stage of the second stepper motor according to the following steps:

[0019] S3.1. Based on parameter PPS in 、PPS aim and T half , determine the acceleration and deceleration curve equation of the second stepper motor;

[0020] S3.2, based on the acceleration and deceleration curve equation of the second stepper motor, determine the operation time nodes and the actual number of operation microsteps of each microstep of the second stepper motor in the first stage;

[0021] S3.3, based on the acceleration and deceleration curve equation of the second stepper motor, generate a speed table [SigmoidPPSList1] corresponding to each micro-step operation time node of the first stage of the second stepper motor;

[0022] S4, based on the symmetric relationship between the acceleration and deceleration processes of the second stepper motor, the speed table [SigmoidPPSList2] corresponding to each microstep operation time node of the second stepper motor in the second stage is obtained from the speed table [SigmoidPPSList1] corresponding to each microstep operation time node of the second stepper motor in the first stage;

[0023] S5. Based on the speed table obtained in steps S3 and S4, control the second stepper motor to change speed.

[0024] In some possible implementations, the acceleration / deceleration curve equation of the second stepper motor adopts a Sigmoid curve equation:

[0025]

[0026] Among them, Sigmoid (x) Indicates the speed value at time x.

[0027] In some possible implementations, the S3.2 includes:

[0028] Determine the running time t of the nth microstep of the second stepper motor count (t):

[0029]

[0030] Among them, t n is the running time node of the kth microstep; microstepmode is the microstep driving mode of the stepper motor;

[0031] Assume t1 = 0, for k>1, through t count (t) Get the start time t of the kth microstep k :

[0032]

[0033] Among them, t sum (n) represents the sum of the running time from the first microstep to the nth microstep;

[0034] Starting from n=1, iteratively calculate the target speed PPS aim With actual speed The difference is calculated until the difference is less than or equal to the allowable speed error. The value of n at this time is taken as the actual number of microsteps in the first stage, recorded as max(n).

[0035] In some possible implementations, the method further includes:

[0036] Set the allowed microstep error β and the first stage target time period threshold T th ;

[0037] Calculate the actual running time of the first stage. The actual running time of the first stage is equal to the sum of the running time from the first microstep to the max(n)th microstep, recorded as max(t n ):

[0038]

[0039] If the first stage of the second stepper motor is an acceleration operation process, and the second stage is a deceleration operation process; then after step S3.2, execute:

[0040] a1) Calculate the microstep error α of the operation:

[0041] α=|max(n)-microsteps|

[0042] Among them, microsteps is the number of microsteps of the first stage target operation of the second stepper motor; microstrps is initialized as

[0043] b1) Determine whether α is less than the allowable microstep error β. If so, go to step S3.3;

[0044] Otherwise, go to step c1);

[0045] c1) Determine PPS aim <PPS max Is it true? If so, use the fuzzy control PD algorithm to adjust the PPS aim , and go to step S3.1;

[0046] If PPS acc <PPS max If not, go to step d1);

[0047] d1) Determine T half >T th Is it true? If T half >T th Established, the fuzzy control PD algorithm is used to adjust T half , and according to T half Adjust microsteps synchronously, then go to step S3.1;

[0048] If T half >T th If it is not established, the adjustment cannot be completed according to the set adjustment parameters, the adjustment fails and the program exits.

[0049] If the first stage of the second stepper motor is a deceleration process and the second stage is an acceleration process, then after step S3.2, execute:

[0050] a2) Calculate the micro-step error α of the operation:

[0051] α=|max(n)-microsteps|

[0052] b2) Determine whether α is less than the allowable microstep error β. If so, go to step S3.3;

[0053] Otherwise, go to step c2);

[0054] c2) Determine PPS aim ≥PPS min Is it true? If so, use the fuzzy control PD algorithm to adjust the PPS aim , and go to step S3.1;

[0055] If PPS aim ≥PPS min If not, go to step d2);

[0056] d2) Determine T half >T th Is it true? If T half >T th Established, the fuzzy control PD algorithm is used to adjust T half , and according to T half Adjust microsteps synchronously, then go to step S3.1;

[0057] If T half >T th If it is not established, the adjustment cannot be completed according to the set adjustment parameters, the adjustment fails and the program exits.

[0058] In some possible implementations, the S5 includes:

[0059] Based on the speed table obtained in steps S3 and S4, generate the acceleration and deceleration table [Speedstables]:

[0060]

[0061] Among them, F freq is the main frequency of the controller, [SigmoidList] is the speed table obtained by steps S3 and S4;

[0062] The speed value in the acceleration / deceleration table [Speedstables] is filled into the timer auto-reload register of the controller (microcontroller or other controller) to control the cycle of the timer, thereby generating a pulse signal according to the cycle; the stepper motor driver drives the second stepper motor to rotate a step angle according to the pulse signal.

[0063] The speed table includes a series of speed values ​​and can be stored in a computer medium (such as the FLASH of a single-chip microcomputer).

[0064] In a second aspect, the present application provides an electronic device, including: a memory and a processor;

[0065] The memory is used to store computer programs;

[0066] The processor is used to call the computer program to execute the method as described above.

[0067] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed on an electronic device, the electronic device implements the method as described above.

[0068] In a fourth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed on an electronic device, the electronic device implements the method as described above.

[0069] The specific implementation methods of the second to fifth aspects of the present application can refer to the implementation methods of the first aspect, which will not be repeated here.

[0070] Beneficial effects:

[0071] The present application adopts a method of fixing the speed of the first stepper motor in the dual motors and adjusting the speed of the second stepper motor. Specifically, it is a speed adjustment method that controls the second stepper motor to go through an acceleration and a deceleration process (which may also include a constant speed and a stop process), so that the second stepper motor can smoothly reach the set speed after a specific number of steps and a specific time according to the preset acceleration and deceleration mode, thereby realizing coordinated spacing adjustment of the dual stepper motors.

[0072] By setting a certain size of safety area before and after the working area, the speed of the second stepper motor in the corresponding working area can be guaranteed to be constant and not affected by the acceleration and deceleration of the motor. The present application can accurately control the number of movement steps and positions by carefully controlling each microstep of the second motor and optimizing the motion trajectory of the second motor. It can not only accurately control the acceleration and deceleration process, but also ensure the smoothness of the speed change in the whole process, ensure that the stepper motor does not lose steps, reduce mechanical wear and improve system stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 This is the working principle diagram of the stepper motor;

[0074] Figure 2 This is a working principle diagram of the paper feeding motor and the stamping motor in the stamping machine in the embodiment of the present application;

[0075] Figure 3 This is a schematic diagram of the speed control principle diagram of the stamping motor in the embodiment of this application;

[0076] Figure 4 This is a flow chart of an embodiment of the present application;

[0077] Figure 5 To adjust the PPS in the embodiment of this application aim The effect diagram;

[0078] Figure 6 In the embodiment of this application, T is adjusted half The effect diagram;

[0079] Figure 7 This is a system block diagram of the fuzzy control PD algorithm in the embodiment of the present application;

[0080] Figure 8 In the embodiment of this application, α and PPS aim The triangle membership function image of ;

[0081] Fig. 9 In the embodiment of this application, K p and K d The graph of the triangle membership function. DETAILED DESCRIPTION

[0082] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0083] like Figure 2 and Figure 3 As shown, taking a stamping machine as an example, the principle of adjusting the stamping distance by adjusting the speed of the stamping motor and the paper feeding motor in the embodiment of the present application is explained. In the embodiment of the present application, the speed of the paper feeding motor is kept constant to avoid the problem of paper jam or double sheeting caused by arbitrarily adjusting the speed of the paper feeding motor. The distance between stamps on the paper is adjusted by adjusting the speed of the stamping motor. Figure 3 As shown, in order to ensure that the speed of the stamping motor is constant when it is in the working area (stamping), and is not affected by the acceleration, deceleration and loss of step of the motor, a certain size of safety area is set before and after the working area. The first safety area is the sensor detection area. By installing a detection sensor at a certain position after the end of the working area, the area from the working area to the sensor detection position is the sensor detection area. According to the equipment parameters, the appropriate size of the adjustment area is set to control the speed of the stamping motor to achieve the adjustment effect. The second safety area is a reserved safety area to ensure that the speed of the stamping motor returns to the initial speed before reaching the working area.

[0084] Note that the circles of the first stepper motor and stamp motor here represent the size of the roller in contact with the paper medium. The upper and lower rollers need to keep the same speed (referring to the linear speed). Generally speaking, equal-sized rollers are used in design, and their linear speed and angular speed are consistent. In addition, there is a transmission mechanism between the roller and the stepper motor, and the angle of the adjustment area should be multiplied by the transmission ratio between the two. For example, if the roller adjustment area is about 130 degrees and the transmission ratio is 1:1, the stepper motor needs to be Within the step, adjust the speed and return to the initial speed; where N is the number of steps the stepper motor runs in one circle. There are many types of stepper motors on the market, such as 0.9°, 1.8°, 7.5°, etc. Among them, the most widely used is the 1.8° stepper motor. Taking the 1.8° stepper motor as an example, the number of steps it runs in one circle is 200.

[0085] The following is a detailed description of the embodiments of the present application in conjunction with the accompanying drawings. In the following embodiments, for a stamp stamping machine, the first stepper motor is a paper feeding motor, the second stepper motor is a stamp stamping motor, and the working spacing is a stamp stamping spacing.

[0086] The embodiment of the present application provides a synchronous operation dual-motor control method based on the number of running steps, the dual-motor includes a first stepper motor and a second stepper motor; the first stepper motor and the second stepper motor work together in the following manner:

[0087] The first stepper motor drives the first object, and the second stepper motor drives the second roller;

[0088] Wherein, the first stepper motor can transmit the first object through the first roller.

[0089] The second roller is divided into a first safety area, a working area, a second safety area and an adjustment area in the circumferential direction;

[0090] Each time it works, the second stepper motor drives the working area of ​​the second roller to pass through the working position, so that the first object contacts the working area on the second roller. At this time, the linear speed of the first object and the second roller is the same, and the corresponding running speed of the second stepper motor is PPS. in , unit: step / second;

[0091] PPS in is the initial speed. When the second stepper motor drives the working area of ​​the second roller through the working position, the speed is maintained at PPS in constant.

[0092] After one operation, the first stepper motor is controlled to move at a constant speed of PPS0, and the second stepper motor is controlled to move at a variable speed, so that after the first object passes the set working distance, the second stepper motor drives the working area of ​​the second roller to reach the working position again, and at this time the running speed of the second stepper motor is PPS in;like Figure 4 As shown, wherein controlling the second stepper motor to change speed includes:

[0093] S1, input parameters steps, Δsteps, t, T half and PPS aim ;

[0094] Wherein, steps is the number of steps that the second stepper motor drives the adjustment area of ​​the second roller to pass through the working position, T is the target time period that the second stepper motor drives the adjustment area of ​​the second roller to pass through the working position, and PPS aim is the target speed of the second stepper motor in the first stage (unit: steps / second); Δsteps is the difference between the number of steps run by the second stepper motor and the first stepper motor in the target time period T, steps0 is the number of steps run by the first stepper motor in the target time period T; T half Indicates the running time of the first stage of the second stepper motor;

[0095] In this step, according to the required working distance (for the stamping machine, that is, the stamping distance), the target time period and number of steps for the second stepper motor to drive the adjustment area of ​​the second roller to pass through the working position can be set.

[0096] The following relationship is obtained through the running time, and the maximum allowable range of Δsteps can be obtained.

[0097]

[0098] Wherein, PPS0 is the running speed of the first stepper motor, max(Δsteps) is the maximum value of Δsteps allowed within the target time period T, and min(Δsteps) is the minimum value of Δsteps allowed within the target time period T.

[0099] By transforming the above formula, we can get the value range of Δsteps:

[0100] Therefore, after inputting the parameter Δsteps, first determine whether its value is within the above range. If so, it is reasonable. Otherwise, the value of Δsteps needs to be adjusted.

[0101] In this step, according to the required working distance (for the stamping machine, that is, the stamping distance), the target time period and number of steps for the second stepper motor to drive the adjustment area of ​​the second roller to pass through the working position can be set.

[0102] In some embodiments, you can initialize:

[0103] S2. Based on the size of Δsteps, determine the speed control mode of the second stepper motor:

[0104] If Δsteps<0, the first stage of the second stepper motor is the acceleration operation process, and the second stage is the deceleration operation process. The acceleration operation process is symmetrical to the deceleration operation process.

[0105] If Δsteps>0, the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process. The acceleration operation process is symmetrical to the deceleration operation process.

[0106] In the above steps, if Δsteps>0, it means steps>steps in , the average speed of the second stepper motor is less than PPS in , so it is necessary to decelerate first and then accelerate to achieve a final speed of PPS in ;

[0107] On the contrary, if Δsteps<0, it means steps <steps in , the average speed of the second stepper motor is greater than PPS in , so it is necessary to accelerate first and then decelerate to achieve a final speed of PPS in .

[0108] S3, determine the speed table corresponding to each micro-step operation time node of the first stage of the second stepper motor according to the following steps:

[0109] S3.1. Based on parameter PPS in 、PPS aim and T half , determine the acceleration and deceleration curve equation of the second stepper motor;

[0110] In some embodiments, the acceleration and deceleration curve equation of the second stepper motor adopts a Sigmoid curve equation:

[0111]

[0112] Among them, Sigmoid (x) Indicates the speed value at time x (unit: steps / second);

[0113] S3.2, based on the acceleration and deceleration curve equation of the second stepper motor, determine the operation time nodes and the actual number of operation microsteps of each microstep in the first stage of the second stepper motor;

[0114] In some embodiments, the running time t of the nth microstep of the second stepper motor is determined count (t):

[0115]

[0116] Among them, t n is the running time node of the kth microstep, that is, the start time of the running; microstepmode is the microstep driving mode of the stepper motor (that is, the subdivision number of the stepper motor driver, the values ​​include 1, 2, 4, 8, 16, 32, etc., indicating that one step angle of the stepper motor is divided into microstepmode parts for control);

[0117] Assume t1 = 0, for k>1, through t count (t) Get the start time t of the kth microstep k :

[0118]

[0119] Among them, t sum (n) represents the sum of the running time from the first microstep to the nth microstep;

[0120] Starting from n=1, iteratively calculate the target speed PPS aim With actual speed until the difference is less than or equal to the allowed speed error, that is, , the value of n at this time is taken as the actual number of microsteps in the first stage, recorded as max(n), that is;

[0121] In some embodiments, the method further comprises:

[0122] Set the allowed microstep error β and the first stage target time period threshold T th (get experience value);

[0123] Calculate the actual running time of the first stage. The actual running time of the first stage is equal to the sum of the running time from the first microstep to the max(n)th microstep, recorded as max(t n ):

[0124]

[0125] If the first stage of the second stepper motor is an acceleration operation process, and the second stage is a deceleration operation process; then after step S3.2, execute:

[0126] a1) Calculate the microstep error α of the operation:

[0127] α=|max(n)-microsteps|

[0128] Among them, microsteps is the number of microsteps of the target operation of the second stepper motor in the first stage; microsteps is initialized to

[0129] b1) Determine whether α is less than the allowable microstep error β. If so, go to step S3.3;

[0130] Otherwise, go to step c1);

[0131] c1) Determine PPS aim <PPS max Is it true? If so, use the fuzzy control PD algorithm to adjust the PPS aim , and go to step S3.1;

[0132] If PPS acc <PPS max If not, go to step d1);

[0133] d1) Determine T half >T th Is it true? If T half >T th Established, the fuzzy control PD algorithm is used to adjust T half , and according to T half Adjust microsteps synchronously, then go to step S3.1;

[0134] If T half >T th If it is not established, the adjustment cannot be completed according to the set adjustment parameters, the adjustment fails and the program exits.

[0135] If the first stage of the second stepper motor is a deceleration process and the second stage is an acceleration process, then after step S3.2, execute:

[0136] a2) Calculate the micro-step error α of the operation:

[0137] α=|max(n)-microsteps|

[0138] b2) Determine whether α is less than the allowable microstep error β. If so, go to step S3.3;

[0139] Otherwise, go to step c2);

[0140] c2) Determine PPS aim ≥PPS min Is it true? If so, use the fuzzy control PD algorithm to adjust the PPS aim , and go to step S3.1;

[0141] If PPS aim ≥PPS min If not, go to step d2);

[0142] d2) Determine T half >T th Is it true? If T half >T th Established, the fuzzy control PD algorithm is used to adjust T half , and according to T half Adjust microsteps synchronously, then go to step S3.1;

[0143] If T half >T th If it is not established, the adjustment cannot be completed according to the set adjustment parameters, the adjustment fails and the program exits.

[0144] Among them, T th is a set empirical value, and the value may be different in different systems. In some embodiments,

[0145] The above embodiment adjusts the PPS through logical judgment aim , adjust T half The microsteps parameter is iteratively calculated until it reaches the allowed microstep error amount or the adjustment fails.

[0146] Using fuzzy control PD algorithm PPS aim The effect is as Figure 5 shown.

[0147] Using fuzzy control PD algorithm to adjust T half The effect is as Figure 6 As shown, the blue line is Sigmoid (x) , the red line is T half , the green line is

[0148] Among them, in the operation mode of accelerating first and then decelerating, according to T half The formula for synchronously adjusting microsteps is as follows:

[0149]

[0150] In the operation mode of deceleration first and acceleration later, according to T half The formula for synchronously adjusting microsteps is as follows:

[0151]

[0152] In some embodiments, a fuzzy control PD algorithm is used to adjust the PPS aim The specific implementation is as follows:

[0153] In this application, the system needs to respond quickly, and the cumulative error can be ignored. The PD algorithm formula to eliminate the integral term is as follows (to adjust the PPS aim For example):

[0154] ΔPPS aim =K p ×α+K d ×Δα

[0155] Among them, ΔPSS aim Indicates PPS aim The increment of α, Δα represents the rate of change of α, K p , K d They represent the coefficients of the proportional differential term of the PD algorithm, which is controlled by fuzzy reasoning. The system block diagram of the fuzzy control PD algorithm is shown in Figure 7 shown.

[0156] This application uses the microstep error α and the current target speed PPS aim As input variables, both of them change in real time in the control system. To determine the control parameters based on real-time variables, we first need to determine the value of the input variables and perform fuzzification. aim It is divided into 7 levels. In order to correspond the specific values ​​of the input variables to the fuzzy sets one by one, α and PPS are determined based on experience. aim The typical fuzzy set domain is {-350, -50, -7, 0, 7, 50, 350}, {PPS in -600,PPS in -400,PPS in -200,0,PPS in +200,PPS in +400,PPS in +600}. Therefore, this application adopts the triangular membership function to solve the membership. Its equation is as follows:

[0157]

[0158] In the above formula, f(X,a,b,c) is the triangle membership function, X is the domain variable, and a, b, and c are the horizontal coordinates of the three vertices of the triangle membership function. α and PPS acc The triangle membership function graph is as follows Figure 8 As shown. NB (blue image), NM (orange image), NS (green image), Z (red image), PS (purple image), PM (brown image), PB (rose red image) are α and PPS acc Seven function graphs of the triangular membership function, corresponding to variables α and PPS accFor example, in the triangle membership function of α, the blue image represents the image of the triangle membership function f(X,∞,-350,-50), and the orange image represents the image of the triangle membership function f(X,-350,-50,-7). The same is true for other color images.

[0159] K p and K d The triangular membership function graph of Fig. 9 As shown. Among them, P1 (blue image), P2 (orange image), P3 (green image), P4 (red image), P5 (purple image), P6 (brown image), and P7 (rose red image) are K p and K d Seven function graphs of the triangular membership function.

[0160] Build K p and K d Fuzzy control rule table (expert experience table), K p and K d The fuzzy subset of is {P1, P2, P3, P4, P5, P6, P7}, which is in the following form:

[0161] <![CDATA[α / PPS aim ]]> NB NM NS Z PS PM PB NB P7 P7 P6 P6 P6 P5 P3 NM P7 P6 P5 P4 P4 P3 P2 NS P5 P3 P3 P3 P2 P2 P1 Z P2 P2 P1 P1 P1 P1 P1 PS P5 P3 P3 P3 P2 P2 P1 PM P7 P6 P5 P4 P4 P3 P2 PB P7 P7 P6 P6 P6 P5 P3

[0162] In the above table, the P1-P7 rule is K p and K d Fuzzy rules corresponding to K p and K d Taking the P1 rule as an example, when α is small and PPS aim When K is small, p and K d The smaller the value, the gentler the control, and it is not easy to cause overshoot. Taking the P7 rule as an example, when α is large and the reference speed is large, K p and K d The value is large, and the control algorithm can respond quickly.

[0163] The P1-P7 rules are determined by the physical properties of the system. For example, the P1-P7 quantization values ​​are as follows:

[0164] —— P1 P2 P3 P4 P5 P6 P7 <![CDATA[K p ]]> 3 13 29 51 71 100 150 <![CDATA[K d ]]> 1 3 7 13 19 28 35

[0165] S3.3. Based on the acceleration and deceleration curve equation of the second stepper motor, generate the speed table [SigmoidPPSList1] corresponding to each micro-step operation time node of the first stage of the second stepper motor:

[0166]

[0167] S4, based on the symmetric relationship between the acceleration and deceleration processes of the second stepper motor, the speed table [SigmoidPPSList2] corresponding to each microstep operation time node of the second stepper motor in the second stage is obtained from the speed table [SigmoidPPSList] corresponding to each microstep operation time node of the second stepper motor in the first stage;

[0168] S5. Based on the speed table obtained in steps S3 and S4, control the second stepper motor to change speed.

[0169] Based on the speed table obtained in steps S3 and S4, generate the acceleration and deceleration table [Speedstables]:

[0170]

[0171] Among them, F freq is the main frequency of the controller; [SigmoidList] is the speed table obtained through steps S3 and S4, that is, [SigmoidPPSList] = [SigmoidPPSList1] ∪ [SigmoidPSList2].

[0172] The speed value in the acceleration / deceleration table [Speedstables] is filled into the timer auto-reload register of the controller (microcontroller or other controller) to control the cycle of the timer, thereby generating a pulse signal according to the cycle; the stepper motor driver drives the second stepper motor to rotate a step angle according to the pulse signal.

[0173] The speed table includes a series of speed values ​​and can be stored in a computer medium (such as the FLASH of a single-chip microcomputer).

[0174] The embodiment of the present application also provides an electronic device, including: a memory and a processor;

[0175] The memory is used to store computer programs;

[0176] The processor is used to call the computer program to execute the method as described above.

[0177] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed on an electronic device, the electronic device implements the method as described above.

[0178] An embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed on an electronic device, the electronic device implements the method as described above.

[0179] The embodiments of the present application also provide a system, an electronic device, a computer-readable storage medium, and a computer program product. The specific implementation methods can refer to the specific embodiments of the above methods and will not be repeated here.

[0180] Obviously, those skilled in the art should understand that the above-mentioned units or steps of the present application can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0181] The above description of the embodiments of the present application is only a partial embodiment of the present application, which is used to enable professionals in the field to implement or use the content of the present application, and is not used to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A synchronous dual-motor control method based on running steps, characterized in that: The dual motor includes a first stepper motor and a second stepper motor; the first stepper motor and the second stepper motor work together in the following manner: The first stepper motor drives the first object, and the second stepper motor drives the second roller; The second roller is divided into a first safety area, a working area, a second safety area and an adjustment area in the circumferential direction; Each time it works, the second stepper motor drives the working area of ​​the second roller to pass through the working position, so that the first object contacts the working area on the second roller. At this time, the linear speed of the first object and the second roller is the same, and the corresponding running speed of the second stepper motor is PPS. in ; After one operation, the first stepper motor is controlled to move at a constant speed of PPS0, and the second stepper motor is controlled to move at a variable speed, so that after the first object passes the set working distance, the second stepper motor drives the working area of ​​the second roller to reach the working position again, and at this time the running speed of the second stepper motor is PPS in ; Wherein, controlling the second stepper motor to change speed includes: S1, input parameters steps, T, T half , Δsteps and PPS aim ; Wherein, steps is the number of steps that the second stepper motor drives the adjustment area of ​​the second roller to pass through the working position, T is the target time period that the second stepper motor drives the adjustment area of ​​the second roller to pass through the working position, and T half It represents the running time of the first stage of the second stepper motor. Δsteps is the difference between the number of steps of the second stepper motor and the first stepper motor in the target time period T. PPS aim is the target speed of the second stepper motor in the first stage; S2. Based on the size of Δsteps, determine the speed control mode of the second stepper motor: If Δsteps<0, the first stage of the second stepper motor is the acceleration operation process, and the second stage is the deceleration operation process. The acceleration operation process is symmetrical to the deceleration operation process. If Δsteps>0, the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process. The acceleration operation process is symmetrical to the deceleration operation process. S3, determine the speed table corresponding to each micro-step operation time node of the first stage of the second stepper motor according to the following steps: S3.

1. Based on parameter PPS in 、PPS aim and T half ,, determine the acceleration and deceleration curve equation of the second stepper motor; S3.2, based on the acceleration and deceleration curve equation of the second stepper motor, determine the operation time nodes and the actual number of operation microsteps of each microstep of the second stepper motor in the first stage; S3.3, based on the acceleration and deceleration curve equation of the second stepper motor, generate a speed table [SigmoidPPSList1] corresponding to each micro-step operation time node of the first stage of the second stepper motor; S4, based on the symmetric relationship between the acceleration and deceleration processes of the second stepper motor, the speed table [SigmoidPPSList2] corresponding to each microstep operation time node of the second stepper motor in the second stage is obtained from the speed table [SigmoidPPSList1] corresponding to each microstep operation time node of the second stepper motor in the first stage; S5. Based on the speed table obtained in steps S3 and S4, control the second stepper motor to change speed.

2. The method according to claim 1, characterized in that The second stepper motor acceleration and deceleration curve equation adopts the Sigmoid curve equation: Among them, Sigmoid (x) Indicates the speed value at time x.

3. The method according to claim 1, characterized in that The S3.2 includes: Determine the running time t of the nth microstep of the second stepper motor count (t): Among them, t n is the running time node of the kth microstep; microstepmode is the microstep driving mode of the stepper motor; Assume t1 = 0, for k > 1, through t count (t) Get the start time t of the kth microstep k : Among them, t sum (n) represents the sum of the running time from the first microstep to the nth microstep; Starting from n=1, iteratively calculate the target speed PPS aim With actual speed The difference is calculated until the difference is less than or equal to the allowable speed error. The value of n at this time is taken as the actual number of microsteps in the first stage, recorded as max(n).

4. The method according to claim 1, characterized in that: The method further comprises: Set the allowed microstep error β and the first stage target time period threshold T th ; Calculate the actual running time of the first stage. The actual running time of the first stage is equal to the sum of the running time from the first microstep to the max(n)th microstep, recorded as max(t n ): If the first stage of the second stepper motor is an acceleration operation process, and the second stage is a deceleration operation process; then after step S3.2, execute: a1) Calculate the microstep error α of the operation: α=|max(n)-microsteps| Among them, microsteps is the number of microsteps of the target operation of the second stepper motor in the first stage; microsteps is initialized to b1) Determine whether α is less than the allowable microstep error β. If so, go to step S3.3; Otherwise, go to step c1); c1) Determine PPS aim <PPS max Is it true? If so, use the fuzzy control PD algorithm to adjust the PPS aim , and go to step S3.1; If PPS acc <PPS max If not, go to step d1); d1) Determine T half >T th Is it true? If T half >T th Established, the fuzzy control PD algorithm is used to adjust T half , and according to T half Adjust microsteps synchronously, then go to step S3.1; If T half >T th If it is not established, the adjustment cannot be completed according to the set adjustment parameters, the adjustment fails and the program exits.

5. The method according to claim 1, characterized in that The method further includes: setting an allowable microstep error amount β and a first-stage target time period threshold T th ; Calculate the actual running time of the first stage. The actual running time of the first stage is equal to the sum of the running time from the first microstep to the max(n)th microstep, recorded as max(t n ): If the first stage of the second stepper motor is a deceleration process and the second stage is an acceleration process, then after step S3.2, execute: a2) Calculate the micro-step error α of the operation: α=|max(n)-microsteps | b2) Determine whether α is less than the allowable microstep error β. If so, go to step S3.3; Otherwise, go to step c2); c2) Determine PPS aim ≥PPS min Is it true? If so, use the fuzzy control PD algorithm to adjust the PPS aim , and go to step S3.1; If PPS aim ≥PPS min If not, go to step d2); d2) Determine T half >T th Is it true? If T half >T th Established, the fuzzy control PD algorithm is used to adjust T half , and according to T half Adjust microsteps synchronously, then go to step S3.1; If T half >T th If it is not established, the adjustment cannot be completed according to the set adjustment parameters, the adjustment fails and the program exits.

6. The method according to claim 4 or 5, characterized in that: The S5 includes: Based on the speed table obtained in steps S3 and S4, generate the acceleration and deceleration table [Speedstables]: Among them, F freq is the main frequency of the controller, [SigmoidList] is the speed table obtained by steps S3 and S4; The speed value in the acceleration / deceleration table [Speedstables] is filled into the controller's timer auto-reload register to control the timer cycle, thereby generating a pulse signal according to the cycle; the stepper motor driver drives the second stepper motor to rotate a step angle according to the pulse signal.

7. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer programs; The processor is configured to call the computer program to execute the method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device implements the method according to any one of claims 1 to 6.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed on an electronic device, the electronic device implements the method according to any one of claims 1 to 6.