Synchronous operation dual-motor control method based on time period

By running dual motor control methods based on the time cycle, control the first -step motor motion of the motor at a constant speed and the transmission of the motor in the second step, realize multiple step -by -step motor synergy movement and work circuit adjustment, solve the steps of the existing technology steps The problem of coordinated motion and spacing adjustment of the motor improves the stability and accuracy of the system.

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

Patent Information

Application Number
CN202411316840.9
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

It is difficult for the prior art 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

The dual motor control method based on the time cycle is adopted, and the dual -step motor collaborative spacing adjustment is achieved by controlling the first -step motor motion of the motor at a uniform speed and the transmission of the motor. Specific steps include the number of steps, time cycles, microbutics, and target speeds to determine the increase and speed of speed curve equation, and control the motor movement through the micro -step running time node table.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119382552A_ABST
    Figure CN119382552A_ABST
Patent Text Reader

Abstract

The invention discloses a synchronous operation dual-motor control method based on a time period, and the method comprises the steps: controlling a first stepping motor to move at a constant speed, controlling a second stepping motor to move at a variable speed, 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 steps of determining a variable-speed operation mode of the second stepping motor based on a size relationship between a target time period and reference time, and determining an acceleration and deceleration curve equation of the second stepping motor based on a specific step number, a time period, an initial speed and a 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 a time cycle. 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 time-cycle-based synchronous dual-motor control method that can achieve coordinated spacing adjustment of dual stepper motors.

[0008] In a first aspect, the present application provides a time-cycle-based synchronous dual-motor control method, wherein the dual-motor comprises a first stepper motor and a second stepper motor; the first stepper motor and the second stepper motor work in coordination 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 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 the running speed of the second stepper motor is PPS at this time. in ; Wherein, controlling the second stepper motor to change speed includes:

[0013] S1. Input parameters steps, T, microsteps and PPS aim ;

[0014] Among them, 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, microsteps is the number of microsteps of the first stage of the second stepper motor, PPS aim is the target speed of the first stage of the second stepper motor (unit: steps / second);

[0015] S2, based on T and T 0 The size relationship determines the speed control mode of the second stepper motor:

[0016] If T <T 0 , then the first stage of the second stepper motor is the acceleration operation process, and the second stage is the deceleration operation process, and the acceleration operation process is symmetrical to the deceleration operation process;

[0017] If T>T 0 , then the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process, and the acceleration operation process is symmetrical to the deceleration operation process;

[0018] Among them, T 0 For the second stepper motor at speed PPS in The adjustment area of ​​the second roller is driven at a uniform speed to pass through the time period corresponding to the working position; T 0 = steps ÷ PPS in ;

[0019] In the above steps, if the target time period T is greater than T 0 , it means that 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 ;

[0020] On the contrary, if the target time period T is less than T 0 , it means that 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 .

[0021] 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:

[0022] S3.1. Based on parameters steps, T, PPS in and PPS aim , determine the acceleration and deceleration curve equation of the second stepper motor;

[0023] S3.2, find the definite integral of the acceleration and deceleration curve equation of the second stepper motor to obtain the definite integral function Integral, that is, the time distance function t_s;

[0024] S3.3, find the inverse function arcInegral of the definite integral function Integral, that is, the distance-time function s_t;

[0025] S3.4, using the definite integral function Integral, the total distance of the first stage of operation is obtained; based on the total distance, the total distance table [distences] of the operation after each microstep is obtained;

[0026] S3.5, obtain the micro-step running time node table [timeslices] through the total running distance table [distences] and the distance time function s_t after each micro-step;

[0027] S3.6, Substitute the micro-step operation time node table [timeslices] into the acceleration / deceleration curve equation of the second stepper motor to obtain the speed table [SigmoidPPSList] corresponding to each micro-step operation time node in the first stage of the second stepper motor;

[0028] S4, based on the symmetric relationship between the acceleration and deceleration processes of the second stepper motor, the speed table corresponding to each micro-step operation time node of the second stepper motor in the first stage [SigmoidPPSList] is used to obtain the speed table corresponding to each micro-step operation time node of the second stepper motor in the second stage;

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

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

[0031]

[0032] Among them, Sigmoid (x) represents the speed function value (unit: step / second), x represents time, nT represents the preset time unit, where n is the coefficient; Δ is the difference between the expected value and the theoretical value, which is used to compensate for the calculation of PPS in With Sigmoid (0) The difference and PPS aim With Sigmoid (nT) The difference between Δ and Δ is the empirical value.

[0033] In some possible implementations, let nT=1, and the second stepper motor acceleration and deceleration curve equation adopts the compensated Sigmoid curve equation:

[0034]

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

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

[0037] If the first stage of the second stepper motor is an acceleration operation process, the second stage is a deceleration operation process;

[0038] After step S3.6, execute:

[0039] S3.7. Based on [SigmoidPPSList], calculate the running time corresponding to each microstep; sum the running time corresponding to each microstep to obtain the actual time tsum of the first stage of the second stepper motor; calculate the actual time tsum of the first stage of the second stepper motor sum The target time period t of the first stage is set aim The difference Δt = t sum -t aim ;

[0040] S3.8, determine whether Δt<θ is satisfied, if so, retain [SigmoidPPSList]; otherwise, go to step S3.9;

[0041] S3.9 Determine whether PPS is met aim <PPS max If so, increase PPS through fuzzy control aim , and go to step S3.1; otherwise, go to step S3.10;

[0042] S3.10, determine whether t is satisfied aim ≥T th If so, reduce t through fuzzy control aim and microsteps, and go to step S3.7; otherwise, it prompts that the adjustment failed and exits.

[0043] In some possible implementations, the method further includes: setting an allowable time error θ and a first-stage target time period threshold T th ;

[0044] If the first stage of the second stepper motor is a deceleration operation process, the second stage is an acceleration operation process;

[0045] After step S3.6, execute:

[0046] S3.11. Based on [SigmoidPPSList], calculate the running time corresponding to each microstep; sum the running time corresponding to each microstep to obtain the actual time t of the first stage of the second stepper motor sum ; Calculate the actual time t of the first stage of the second stepper motor sum The target time period t of the first stage is set aim The difference Δt = t sum -t aim ;

[0047] S3.12, determine whether Δt<θ is satisfied. If so, the adjustment is successful, and the speed table [SigmoidPPSList] corresponding to each microstep running time node is retained; otherwise, go to step S3.13;

[0048] S3.13 Determine whether PPS is satisfied aim >PPS min If so, reduce PPS through fuzzy control aim , and go to step S3.1; otherwise, go to step S3.14;

[0049] S3.14, determine whether t is satisfied aim ≥T th If so, reduce t through fuzzy control aim and microsteps, and go to step S3.11; otherwise, it prompts that the adjustment failed and exits.

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

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

[0052]

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

[0054] 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.

[0055] 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).

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

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

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

[0059] 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.

[0060] 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.

[0061] 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.

[0062] Beneficial effects:

[0063] 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.

[0064] 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

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

[0066] 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;

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

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

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

[0070] Figure 6 In the embodiment of the present application, t is adjusted aim The effect diagram;

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

[0072] Figure 8 In the present application, Δt and PPS aim The triangle membership function image of ;

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

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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.

[0078] The embodiment of the present application provides a synchronous operation dual-motor control method based on a time period, wherein 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:

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

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

[0081] 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;

[0082] 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;

[0083] 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.

[0084] After one operation, the first stepper motor is controlled to move at a constant speed 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 the running speed of the second stepper motor is PPS at this time.in ;like Figure 4 As shown, wherein controlling the second stepper motor to change speed includes:

[0085] S1. Input parameters steps, T, microsteps and PPS aim ;

[0086] Among them, 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, microsteps is the number of microsteps of the first stage of the second stepper motor, PPS aim is the target speed of the first stage of the second stepper motor (unit: steps / second);

[0087] 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.

[0088] In some embodiments, you can initialize: Among them, 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);

[0089] S2, based on T and T 0 The size relationship determines the speed control mode of the second stepper motor:

[0090] If T <T 0 , then the first stage of the second stepper motor is the acceleration operation process, and the second stage is the deceleration operation process, and the acceleration operation process is symmetrical to the deceleration operation process;

[0091] If T>T 0 , then the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process, and the acceleration operation process is symmetrical to the deceleration operation process;

[0092] Among them, T 0 For the second stepper motor at speed PPS in The adjustment area of ​​the second roller is driven at a uniform speed to pass through the time period corresponding to the working position; T 0 = steps ÷ PPS in ;

[0093] In the above steps, if the target time period T is greater than T 0, it means that 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 ;

[0094] On the contrary, if the set target time period T is less than T 0 , it means that 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 .

[0095] 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:

[0096] S3.1. Based on parameters steps, T, PPS in and PPS aim , determine the acceleration and deceleration curve equation of the second stepper motor;

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

[0098]

[0099] Among them, Sigmoid (x) represents the speed function value (unit: step / second), x represents time, nT represents the preset time unit, where n is the coefficient; Δ is the difference between the expected value and the theoretical value, which is used to compensate for the calculation of PPS in With Sigmoid (0) The difference and PPS aim With Sigmoid (nT) The difference between Δ and Δ is the empirical value.

[0100] In some embodiments, a suitable n is set so that nT=1 to facilitate subsequent calculations.

[0101] At this time, the above equation is calculated after compensation as follows:

[0102]

[0103] The acceleration and deceleration curve equation of the second stepper motor adopts a compensated Sigmoid curve equation.

[0104] S3.2, find the definite integral of the acceleration and deceleration curve equation of the second stepper motor to obtain the definite integral function Integral, that is, the time distance function t_s;

[0105] The definite integral function Integral can be expressed as Integral sigmoid (t):

[0106]

[0107] Among them, Integral sigmoid (t) represents the definite integral function of velocity (i.e., time-distance function t_s); t represents the time upper limit of the definite integral, and its value range is [0,nT];

[0108] S3.3, find the inverse function arcInegral of the definite integral function Integral, that is, the distance-time function s_t;

[0109] The inverse function arcInegral can be expressed as arcInegral(distence) as follows:

[0110] arcInegral(distence)=arc(Integral sigmoid (t))

[0111] Among them, arc (Integral sigmoid (t)) means Integral sigmoid The inverse function expression of (t) (i.e., exchanging the independent variable and the dependent variable, or making a symmetric function graph with the equation "t = distance" straight line); arcInegral(distence) represents the inverse function of the definite integral function of velocity (i.e., the distance-time function s_t); distance represents the total running distance;

[0112] S3.4, using the definite integral function Integral, the total distance of the first stage of operation is obtained; based on the total distance, the total distance table [distences] of the operation after each microstep is obtained;

[0113] By finding equal spacing for the independent variable distance of the arcInegral(distence) function, we can obtain a fixed Sigmoid (x) The fixed area in the function (corresponding to the fixed distance - the microstep distance of the stepper motor, that is, the total distance each microstep of the stepper motor runs) is given by the following formula:

[0114] [distences] = slice (Integral sigmoid (nT), microsteps)

[0115] Where [distences] represents the total distance the second stepper motor runs after each microstep; microsteps represents the total number of microsteps in the first stage; Integralsigmoid (nT) represents the total distance of the first stage; slice(...,...) represents the slicing function, which receives two parameters and Integralizes the total distance. sigmoid (nT) is divided equally according to the number of microsteps; the above formula is expanded according to the definition to obtain:

[0116]

[0117] in, It indicates the ratio of the running distance after the first to microsteps microsteps to the total acceleration distance (i.e., it is proportional to the total running distance after each microstep); "...×[...]" indicates that the constant term is multiplied by the elements in the table to form a new array [distences];

[0118] S3.5, obtain the micro-step running time node table [timeslices] through the total running distance table [distences] and the distance time function s_t after each micro-step;

[0119] After obtaining the total running distance table [distences] after each microstep, the equation "arcInegral(distence)=arc(Integral sigmoid (t))” to calculate the micro-step operation time node table [timeslices] of the stepper motor, the formula is as follows:

[0120] [timeslices]=[arcInegral(distences)]

[0121] Among them, [arcInegral(distences)] means that each item of [distences] is calculated according to the distance-time function (the inverse function expression of the time-distance function t_s), and finally the micro-step operation time node table [timeslices] of the stepper motor is obtained.

[0122] S3.6, Substitute the micro-step operation time node table [timeslices] into the acceleration / deceleration curve equation of the second stepper motor to obtain the speed table [SigmoidPPSList] corresponding to each micro-step operation time node in the first stage of the second stepper motor;

[0123] [SigmoidPPSList] = [Sigmoid (timeslices) ]

[0124] Among them, timeslices is mapped to the time axis, and the value range is [0,nT].

[0125] S4, based on the symmetric relationship between the acceleration and deceleration processes of the second stepper motor, the speed table corresponding to each micro-step operation time node of the second stepper motor in the first stage [SigmoidPPSList] is used to obtain the speed table corresponding to each micro-step operation time node of the second stepper motor in the second stage;

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

[0127] In some embodiments, the S5 includes:

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

[0129]

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

[0131] 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.

[0132] 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).

[0133] In some embodiments, the method further includes: setting the allowed time error θ and the first stage target time period threshold T th 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.6, execute:

[0134] S3.7. Based on [SigmoidPPSList], calculate the running time corresponding to each microstep; sum the running time corresponding to each microstep to obtain the actual time t of the first stage of the second stepper motor sum ; Calculate the actual time t of the first stage of the second stepper motor sum The target time period t of the first stage is set aim The difference Δt = t sum -t aim ;

[0135] in,

[0136] Where, SigmoidPPSList∈[SigmoidPPSList], the unit is step / second;

[0137] In some embodiments, it is possible to set

[0138] S3.8, determine whether Δt<θ is satisfied, if so, retain [SigmoidPPSList]; otherwise, go to step S3.9;

[0139] In some embodiments, θ can be set to 10 -5 .

[0140] S3.9 Determine whether PPS is met aim <PPS max If so, increase PPS through fuzzy control aim , and go to step S3.1; otherwise, go to step S3.10;

[0141] In step S3.8, Δt=t sum -t aim , Δt≥θ, indicating that t sum Too large, so increase PPS in this step aim , so that the average speed increases, so the actual time of the first stage is t sum becomes smaller to reduce its difference from the first stage target time period t aim The difference.

[0142] S3.10, determine whether t is satisfied aim ≥T th If so, reduce t through fuzzy control aim and mucrosteps, and go to step S3.7; otherwise, it prompts that the adjustment failed and exits.

[0143] In this case, the speed has increased to PPS max , can no longer be increased, reduce the number of microsteps in the acceleration process, for example, the original acceleration process contains 35 microsteps, at this time reduce the number of microsteps in the acceleration process to 30 microsteps, let the remaining 5 steps at the maximum speed PPS max In this way, the average speed can be further improved, and the actual time of the first stage can be shortened to reduce the difference between it and the target time period t of the first stage. aim The difference.

[0144] In some embodiments, the method further includes: setting the allowed time error θ and the first stage target time period threshold T th ; If the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process; then after step S3.6, execute:

[0145] S3.11. Based on [SigmoidPPSList], calculate the running time corresponding to each microstep; sum the running time corresponding to each microstep to obtain the actual time t of the first stage of the second stepper motor sum ; Calculate the actual time t of the first stage of the second stepper motor sum The target time period t of the first stage is set aim The difference Δt = t sum -t aim ;

[0146] S3.12, determine whether Δt<θ is satisfied. If so, the adjustment is successful, and the speed table [SigmoidPPSList] corresponding to each microstep running time node is retained; otherwise, go to step S3.13;

[0147] S3.13 Determine whether PPS is satisfied aim >PPS min If so, reduce PPS through fuzzy control aim , and go to step S3.1; otherwise, go to step S3.14;

[0148] S3.14, determine whether t is satisfied aim ≥T th If so, reduce t through fuzzy control aim and mucrosteps, and go to step S3.11; otherwise, it prompts that the adjustment failed and exits.

[0149] The above embodiment adjusts the PPS through logical judgment aim ,t aim The parameters such as microsteps are iteratively calculated until the error is below the target time period or the adjustment fails and the system exits.

[0150] Adjust PPS as described in the above parameter adjustment logic formula aim The effect is as Figure 5 shown.

[0151] The above parameter adjustment logic formula adjusts t aim The effect is as Figure 6 As shown, the blue line is Sigmoid (x) , the red line is t aim , the green line is

[0152] The microsteps synchronization adjustment formula for the acceleration-then-deceleration operation mode is as follows:

[0153]

[0154] The microsteps synchronization adjustment formula for the deceleration-then-acceleration operation mode is as follows:

[0155]

[0156] The fuzzy control strategy described in the above parameter adjustment logic formula adopts the fuzzy control PID algorithm. In this application, the system needs to respond quickly, the cumulative error can be ignored, and the PD algorithm formula for eliminating the integral term is as follows (to adjust the PPS aim For example):

[0157] ΔPPS aim =K p ×Δt+K d ×Δt / dt

[0158] Where ΔPPS aim Indicates PPS aim The increment of Δt / dt represents the rate of change of Δt, 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.

[0159] This application uses the time error Δt 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, the variables Δt and PPS are determined based on experience. aim The typical fuzzy set domain is {-1×10 -1 , -2×10 -3 , -5×10 -4 , 0,5×10 -4 , 2×10 -3 , 1×10 -1}, {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:

[0160]

[0161] 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. Δt 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 Δt and PPS acc Seven function graphs of the triangular membership function, corresponding to variables Δt and PPS acc For example, in the triangle membership function of Δt, the blue image represents the triangle membership function f(X,∞,-1×10 -1 ,-2×10 -3 ) image, the orange image represents the triangle membership function f(X,-1×10 -1 ,-2×10 -3 -5×10 -4 ) images, and the same goes for other color images.

[0162] 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.

[0163] 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:

[0164] <![CDATA[Δt / 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

[0165] 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 the difference Δt 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 the difference Δt is large and the reference speed is large, Kp and K d The value is large, and the control algorithm can respond quickly.

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

[0167] —— P1 P2 P3 P4 P5 P6 P7 <![CDATA[K p ]]> 4000 6500 8500 12000 16000 24000 30000 <![CDATA[K d ]]> 5000 7000 9500 12000 18000 28000 35000

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

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

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

[0171] 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.

[0172] 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.

[0173] 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.

[0174] 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.

[0175] 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 time-cycle-based synchronous dual-motor control method, 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 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 the running speed of the second stepper motor is PPS at this time. in ; Wherein, controlling the second stepper motor to change speed includes: S1. Input parameters steps, T, microsteps and PPS aim ; Among them, 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, microsteps is the number of microsteps of the first stage of the second stepper motor, PPS aim is the target speed of the second stepper motor in the first stage; S2. Based on the magnitude relationship between T and T0, determine the speed control mode of the second stepper motor: If T<T0, 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 T>T0, the first stage of the second stepper motor is a deceleration operation process, and the second stage is an acceleration operation process, and the acceleration operation process is symmetrical to the deceleration operation process; Among them, T0 is the speed of the second stepper motor at PPS in The adjustment area of ​​the second roller is driven at a constant speed to pass the time period corresponding to the working position; T0 = steps ÷ PPS in ; 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 parameters steps, T, PPS in and PPS aim , determine the acceleration and deceleration curve equation of the second stepper motor; S3.2, find the definite integral of the acceleration and deceleration curve equation of the second stepper motor to obtain the definite integral function Integral, that is, the time distance function t_s; S3.3, find the inverse function arcInegral of the definite integral function Integral, that is, the distance-time function s_t; S3.4, using the definite integral function Integral, the total distance of the first stage of operation is obtained; based on the total distance, the total distance table [distences] of the operation after each microstep is obtained; S3.5, obtain the micro-step running time node table [timeslices] through the total running distance table [distences] and the distance time function s_t after each micro-step; S3.6, Substitute the micro-step operation time node table [timeslices] into the acceleration / deceleration curve equation of the second stepper motor to obtain the speed table [SigmoidPPSList] corresponding to each micro-step operation time node in 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 corresponding to each micro-step operation time node of the second stepper motor in the first stage [SigmoidPPSList] is used to obtain the speed table corresponding to each micro-step operation time node of the second stepper motor in the second 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 ) represents the speed function value, x represents time, nT represents the preset time unit, where n is the coefficient; △ is the difference between the expected value and the theoretical value, which is used to compensate for the calculation of PPS in With Sigmoid (0) The difference and PPS aim With Sigmoid (nT) The difference between △ and △ is taken as the empirical value 0.002473.

3. The method according to claim 2, characterized in that Let nT = 1, and the acceleration / deceleration curve equation of the second stepper motor adopts the compensated Sigmoid curve equation:

4. The method according to claim 1, characterized in that: The method further comprises: Set the allowed time error θ and the first stage target time period threshold T th ; If the first stage of the second stepper motor is an acceleration operation process, the second stage is a deceleration operation process; After step S3.6, execute: s3.

7. Based on [SigmoidPPSList], calculate the running time corresponding to each microstep; sum the running time corresponding to each microstep to obtain the actual time t of the first stage of the second stepper motor sum ; Calculate the actual time t of the first stage of the second stepper motor sum The target time period t of the first stage is set aim The difference Δt = t sum -t aim ; S3.8, determine whether Δt<θ is satisfied, if so, retain [SigmoidPPSList]; otherwise, go to step S3.9; S3.9 Determine whether PPS is met aim <PPS max If so, increase PPS through fuzzy control aim , and go to step S3.1; otherwise, go to step S3.10; S3.10, determine whether t is satisfied aim ≥T th If so, reduce t through fuzzy control aim and microsteps, and go to step S3.7; otherwise, it prompts that the adjustment failed and exits.

5. The method according to claim 1, characterized in that The method further includes: setting an allowable time error θ and a first stage target time period threshold T th ; If the first stage of the second stepper motor is a deceleration operation process, the second stage is an acceleration operation process; After step S3.6, execute: S3.

11. Based on [SigmoidPPSList], calculate the running time corresponding to each microstep; sum the running time corresponding to each microstep to obtain the actual time t of the first stage of the second stepper motor sum ; Calculate the actual time t of the first stage of the second stepper motor sum The target time period t of the first stage is set aim The difference Δt = t sum -t aim ; S3.12, determine whether Δt<θ is satisfied. If so, the adjustment is successful, and the speed table [SigmoidPPSList] corresponding to each microstep operation time node is retained; otherwise, go to step S3.13; S3.13 Determine whether PPS is satisfied aim >PPS min If so, reduce PPS through fuzzy control aim , and go to step S3.1; otherwise, go to step S3.14; S3.14, determine whether t is satisfied aim ≥T th If so, reduce t through fuzzy control aim and microsteps, and go to step S3.11; otherwise, it prompts that the adjustment failed and 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.