Design of a High-Speed Rapier Loom Control System Based on a Mixed Current Attenuation Algorithm

At present, the weft selection and selvedge control systems available on the loom do not support precise control of the weft selection and selvedge devices, which will reduce the dynamic performance and production efficiency of the loom. The low-frequency oscillation and back Electromotive force (EMF) of the stepping motor are the main factors that affect the stability of the control system. This paper proposes an optimized mixed current attenuation algorithm that is dedicated to improving the performance of the system. The contribution and innovation of this paper is that the mixed current attenuation algorithm is proposed to improve the low frequency oscillation and back-EMF of the stepping motor and applied to the actual loom production. In this paper, the current subdivision drive is used to improve the low-frequency oscillation of the stepper motor of the weft selection and twisting device, and the back-EMF is reduced by the mixed current attenuation algorithm. First, to verify the effectiveness of the mixed current attenuation algorithm, this paper conducts a motor winding current waveform test. Then, by comparing the acceleration and deceleration control effects in the current self-decay mode, it is verified that the mixed current attenuation algorithm can effectively reduce the low-frequency oscillation and back-EMF of the stepper motor, and improve the dynamic performance and production efficiency of the stepper motor. Finally, the algorithm was debugged and verified on the high-speed rapier loom test platform. By recording and comparing the number of stops of the loom in a certain period of time, it can be concluded that the number of stops caused by the process error of weft selection and selvedge is greatly reduced. Experiments show that the weft selection and selvedge control system using the mixed current attenuation algorithm can achieve precise control of the weft selection and selvedge device, which can effectively improve the productivity and dynamic performance of the loom while reducing the low-frequency oscillation and back-EMF of the stepping motor. Experiments show that the mixed current attenuation algorithm meets the technological requirements of weft selection and selvedge and has a good application prospect.


I. INTRODUCTION
As an important traditional industry in China, the textile industry plays an important role in the development of the national economy [1]. However, the performance indicators of domestic high-speed rapier looms still have a certain gap compared with foreign advanced equipment and cannot meet the needs of domestic and foreign markets [2][3][4]. At present, in the field of weft selection and selvage control, there are problems such as low control accuracy, low dynamic performance, and low actual production efficiency. In some current studies, Xu analyzed the electronic weft selector for rapier looms based on GTX. This type of actuator has a compact structure and accurate movement, but this type of weft selector does not have high dynamic performance [5].
Chen summarized the reasons for the weft break of the rapier loom and proposed corresponding solutions according to the position of the weft break of the loom [6]. However, it did not propose a precise control method for weft selection and selvedge of the loom and a control method to improve the dynamic performance of the system. Zhang in order to improve the motion characteristics of variable lead screw weft insertion mechanism, the displacement curve of weft insertion mechanism is designed based on the transformed trapezoidal acceleration curve. Compared with the traditional design, the final result makes the weft selection process of rapier loom more stable [7]. However, this design does not realize the accurate control of weft selection and edge twisting device. Zhou aiming at the problem that the traditional process principle is difficult to improve the weaving efficiency of projectile loom, the design of electromagnetic driven gripper weft insertion mechanism is proposed, which changes the existing mechanical weft picking principle, realizes frictionless high-speed weft insertion, and has the characteristics of good dynamic performance [8]. However, this design still can not realize the accurate control of weft selection and hemming device in the actual production of loom. Sami adopts fractional-order sliding mode control, and uses the basic mathematical formula of sliding mode control to establish a robust control model without chattering. This control strategy has effective and stable speed convergence and smaller errors, which is better than traditional PI and SMC control strategies [9]. Akdeniz analyzes the properties of rapier loom selvedge, and measures the change of weft yarn length through image analysis technology. But this method does not make the system have good dynamic performance and the investment cost is too high [10]. At present, the weft selection and selvedge control system of the loom cannot realize the precise control of the weft selection and selvedge devices, and the traditional control system does not have very good dynamic performance. The main reason for these problems is that the stepper motor of the weft selvage device adopts an open-loop control method without speed or displacement feedback [11]. The lowfrequency oscillation and back-EMF of the stepping motor caused by this control method will affect the precise control of the weft selection and selvedge device in the loom and the dynamic performance of the system. Although traditional open-loop control can guarantee the accuracy of the stepper motor's operation to a certain extent, as the speed of the stepper motor continues to increase, missed steps will occur. Loss of steps by the stepper motor will lead to the failure of weft selection and selvedge. The research goal of this paper is to solve the problems that the weft selection and selvedge can not be accurately controlled and the system dynamic performance is poor caused by the low-frequency oscillation and back-EMF of the stepping motor caused by the stepping motor control mode of the loom. Therefore, this article will begin with the optimization of the weft selection and the selvedge control system and will innovatively propose an optimized mixed current attenuation algorithm that more effectively controls the stepper motor. This method can reduce the step loss caused by the low-frequency oscillation of the stepping motor and the back-EMF, so as to realize the precise control of the weft selection and selvedge device and the improvement of the dynamic performance. Compared with other solutions, this paper proposes a mixed current attenuation algorithm by combining the characteristics of the loom control system to reduce the low-frequency oscillation and back-EMF generated by the stepper motor and improve the stability of the system. This method can better realize the precise control of the weft selection and selvedge devices. While meeting the technological requirements of weft selection and selvedge, it can also more effectively improve the dynamic performance of the system and the production efficiency of the loom.

II. ANALYSIS AND SOLUTION OF KEY PROBLEMS
The stepping motor of the weft selection and selvedge device will produce vibration when running at low speed, that is, the low-frequency oscillation of the motor, and there is a problem of insufficient action when running at high speed [12 -14]. In addition, the back-EMF generated by the stepping motor will affect the dynamic performance of the motor. Vibration is mainly caused by the low-frequency oscillation characteristics of the stepper motor. When the motor runs at high speed, the back-EMF generated by the motor itself will make the motor movement not in place, which shows that the motor movement is out of step and affects the dynamic performance of the system. This section will present a theoretical analysis based on the working principle and mathematical model of the stepper motor and seek ways to improve the two problems.

A. Analysis of key issues
(1) Causes of low-frequency oscillation When the stepping motor is running in the stepping state, due to the rotor inertia, the rotor will rush past the balance position and receive a reverse torque that reduces the forward speed until it stops [15][16]. At this time, the rotor begins to rotate in the reverse direction under the action of the reverse torque. Due to the working principle of the stepper motor, this type of oscillation phenomenon is inevitable. If the motor continues to run in this way, the kinetic energy of the rotor will accumulate increasingly. When the motor drive pulse frequency is approximately equal to the free oscillation frequency of the stepper motor, the motor will produce lowfrequency oscillation.
(2) Reasons for poor dynamic characteristics The mechanical motion equation for a two-phase hybrid stepping motor is T is the output torque of the stepper motor; J is the total moment of inertia of the stepper motor; B is the friction damping coefficient; r  is the angular velocity of the motor rotor; and L T is the load torque. The friction damping coefficient B has little effect on the speed of the motor and can be ignored the following equation is obtained: Equation (2) shows the torque that produces acceleration. The electromagnetic torque e T of the stepper motor is a variable that gradually decreases with increasing motor speed. Therefore, under conditions in which the total moment of inertia of the system and the load torque do not change, the electromagnetic torque is the main factor that affects the dynamic characteristics of the motor.
The equivalent circuit of a certain phase of the motor is analyzed. The equivalent circuit is shown in Fig. 3. The single-phase coil reactance is where r N is the number of motor rotor teeth. When the motor runs at high speed, the coil winding resistance is much smaller than the coil reactance. Therefore, the single-phase winding impedance at high speed can be approximately equal to the single-phase coil reactance. Therefore, the current during the single-phase winding of the motor can be expressed as: In Equation (3), U is the applied voltage, and ) sin(   r r m N K is the back-EMF E of the motor. Equation (3) shows that the back-EMF increases with increasing motor speed; this has a restraining effect on the winding current. When the voltage applied to the winding remains unchanged, the winding current will be increasingly less affected by the back-EMF, thereby reducing the electromagnetic torque of the motor and further affecting the dynamic performance of the motor [17]. Based on the above analysis, it can be concluded that to improve the dynamic characteristics of the stepper motor, it is necessary to effectively reduce the influence of the back-EMF.

B. Solution
There are two main ways to effectively reduce the lowfrequency oscillation of a stepper motor: (1) To reduce the step angle, the motor structure can be improved, such as by increasing the number of motor phases or the number of teeth of the rotor and stator; however, this means that higher requirements are placed on the manufacturing process of the motor, and the processing cost is increased. Additionally, the motor winding current can be subdivided to increase the number of balance states between the step angles to reduce the step angle.
(2) A damper or shock absorber can be installed to eliminate the kinetic energy stored in the motor rotor and reduce noise. This method increases the additional load on the motor, has a certain impact on the acceleration and deceleration of the motor, and reduces the dynamic performance of the stepper motor.
There are two main ways to improve the dynamic characteristics of a stepper motor: (1) The first involves choosing a reasonable acceleration and deceleration curve and making full use of the torque frequency characteristics of the stepper motor. The specific method is to control the stepping motor so that it uses higher acceleration to accelerate at low speed and accelerates with lower acceleration at high speed. This method can effectively prevent lost steps [18][19].
(2) The second way is to reduce the influence of the back-EMF. When the model of the stepper motor is determined, the back-EMF can be reduced by optimizing the hardware circuit and the control algorithm. The reduction of back-EMF is conducive to an increase in the winding current, and this increases the output torque of the motor and improves dynamic performance.
To reduce the low-frequency oscillation during the operation of the weft selection and twisting drive motor, this article performs subdivision control on the motor winding current to improve the stability of the control system. To improve the dynamic characteristics of the stepper motor, this article proposes a mixed current attenuation control algorithm that reduces the inhibitory effect of back-EMF on the winding current.

1) PRINCIPLE OF SUBDIVISION STEPPING DRIVE
The subdivision stepping drive is also called the micromotion drive [20 -21]. Its purpose is to gradually increase the current during each phase of the step angle in the full stepping drive in n steps so that the force attracting the rotor is slowly changed. The balance point remains constant. The full step angle is subdivided into n steps to make the rotor run smoothly. Therefore, this method can be considered an effective method of reduce vibration when the motor is running at low speed.
The realization process of the subdivision control consists of changing the original direct on-off of the winding current when the winding current of the two-phase winding of the stepper motor is switched; that is, all of the winding current is passed in or cut off, but only a part of the rated value of the corresponding winding is changed. Fig. 5 shows the change in the phase A current when the two-phase hybrid stepping motor has four subdivisions. Fig. 5 shows that the subdivided winding current is not a square wave but a step wave. The rated current is stepped in or cut off. The rotor will rotate the same number of times in one step angle regardless of the number of steps the current is subdivided into.

2) REALIZATION OF THE SUBDIVISION STEPPING DRIVE
This article uses the current tracking control method, which differs from other control methods in that it controls the output current. This method compares the given current value with the actual current value and, based on the result of the comparison, outputs a pulse width modulation (PWM) signal that controls the power switch. When the actual current value is greater than the given value, the power switch's conduction time is reduced by the current closedloop regulation. If the current value is less than the given value, the conduction time of the power switch is increased.
The current tracking control method can be implemented in a variety of ways. This article uses a hysteresis control method to achieve current subdivision. The hysteresis control waveform is shown in Fig. 6. The experimental setting current value is * i , the actual current value is i , and the hysteresis width is  2 . When the actual current value is lower than , the PWM output is high, and current is injected from the DC side, causing the actual current to increase rapidly. When the actual current is higher than , the PWM output is low, the power tube is turned off, and the current is attenuated by freewheeling. When the current decreases to less than ) -( *  i , the PWM signal is high, and this causes the current to increase again to achieve the current follow-up. Compared with other control methods, this control method used in this article can easily realize subdivision control and real-time control of the current and improve the current follow-up effect.

1) COMMON H-BRIDGE CURRENT ATTENUATION PRINCIPLES
The driving method used in this article is bipolar H-bridge driving. There are two main current attenuation methods based on dual H-bridges: the traditional self-attenuation method and the fast attenuation method [22].
(1) Self-decay method (a) Forward conduction phase (b) Current self-attenuation stage We take a one-phase H-bridge circuit as an example, as shown in Fig. 7, where Q1, Q2, Q3, and Q4 are MOSFETtype switching devices. As shown in Fig. 7 (a), when Q1 and Q4 are conducted and Q2 and Q3 are turned on, the current flows from Volt Current Condenser (VCC) through Q1, the winding, and Q4 in turn, and the current is forwardconducted. The voltage applied to the internal diode of Q3 is the power supply voltage minus the voltage applied to Q4. For the voltage value applied to Q4, the voltage of Q4 is the voltage in the saturation state, and the voltage applied to the internal diode of Q2 is the power supply voltage minus the saturation voltage drop applied to Q1.
When the winding of this phase is de-energized, it enters the current attenuation stage. The current flows as shown in Fig. 7(b). Q1 and Q4 are turned on. Due to the existence of the winding back-EMF, the voltage across the winding becomes negative. The VCC and the Q3 internal diodes, the winding, the internal diode of Q2, and GND form a conduction loop, and the back-EMF generated by the winding decays to zero in the conduction loop. When the power is off, the voltage applied to the drain source of Q1 is the power supply voltage plus the forward-conducting voltage of the internal diode of Q2. Similarly, the voltage acting on the Q4 drain source is the power supply voltage plus the voltage of the Q3 internal diode in the forward conduction state, and the voltage value of the Q2 internal diode and the Q3 internal diode in the forward conduction state is very small, approximately 0; thus, the voltage applied to Q1 and Q4 when the power is off is approximately equal to the power supply voltage. This current decay method can effectively prevent Q1 and Q4 from being broken down under power-off conditions. The winding current in this attenuation mode is free attenuation, so the attenuation speed of the system is slow. When the current needs to decrease quickly, it cannot effectively follow the given value; thus, the back-EMF cannot be effectively released, and this affects the dynamic performance of the stepper motor.
(2) Fast decay method: As shown in Fig. 8, the fast decay method is still introduced with the current forward conduction. When Q1 and Q4 are closed and Q2 and Q3 are open, the current through the winding increases positively. In the freewheeling phase, Q1 and Q4 are opened, and Q2 and Q3 are closed. VCC, Q3, the winding, Q2, and GND then form a loop. When Q1 and Q4 are opened, the voltage across the winding becomes negative; this happens to be opposite to the current flow of VCC, so the current generated by the winding will decrease rapidly until it reaches zero. Compared with the self-attenuation method, the attenuation speed of this attenuation method is faster. There are obvious shortcomings in the fast decay mode. The switching frequency and the current fluctuation of the power tube are increased, and the stability of the motor output torque is reduced.

C. Principle of mixed current decay algorithm
It can be seen from the attenuation principle of the Hbridge current that the self-attenuation method can realize feedback of the attenuation current to the power supply and can ensure a steady change in the current during the current rise stage so that the motor runs stably. However, this type of current self-decay method cannot quickly follow the change in the given current setting value during the winding current decline stage and cannot realize effective release of the back-EMF. Compared with the self-decay method, the rapid decay method can quickly reduce the winding current and effectively release the back-EMF during the current drop stage.
This paper proposes a mixed current attenuation algorithm that combines the advantages and disadvantages of the two attenuation methods, thereby effectively improving the current following effect and reducing the low-frequency oscillation generated by the motor, and effectively reducing the back-EMF. The principle on which the mixed current attenuation algorithm presented in this paper is based is introduced by taking the waveform of a phase current with one electrical angle period under four subdivisions as an example.
Author Name: Preparation of Papers for IEEE Access (February 2017) VOLUME XX, 2017 9

FIGURE 9. Eight subphases current waveform diagram
In the range 0 to 2 /  , the phase current increases in a positive direction. To ensure a stable change in the current and make the motor run smoothly, the self-decay method is adopted in this interval.
In the range 2 /  to  , the current is in the positive decreasing phase, and each subdivision step in this range is divided into two stages. In the first stage, the rate of change in the current is fast, so the fast attenuation method should be adopted to quickly follow the decreasing speed of the phase current. In the second stage, if fast attenuation is still used, the current attenuation will be accelerated, resulting in an increase in the current ripple and the stability of the motor, so the self-decay method should be used to reduce the pulsation of the current.
In the interval  to 2 / 3 , the phase current increases in the opposite direction, and the attenuation method is the same as that used in the interval 0 to 2 /  .
In the interval 2 / 3 to  2 , the phase current is in the reverse decreasing stage, and the freewheeling method is the same as that used in the interval At each subdivision step of the current drop, the fast attenuation mode is adopted first, and then the selfattenuation mode is adopted. The proportions of these two current attenuation modes must be adjusted. When the subdivision is determined, if there are 8 cycles of current closed-loop control on a subdivision step and the ratio of the fast attenuation mode to the self-attenuation mode is 3:5, then the current control effect of the first three cycles adopts the fast attenuation mode and that of the five remaining cycles adopts the self-attenuation mode. In the actual motor control process, the two attenuation modes should be reasonably distributed according to the actual demand. The larger the proportion of cycles operating in the fast mode is, the faster is the current reduction speed and the greater is the pulsation; under these conditions, the motor may produce lowfrequency oscillation. The smaller the proportion of cycles operating in the fast attenuation mode is, the slower is the decline in the phase current, but the pulsation will also be reduced.

IV. OVERALL SCHEME DESIGN OF CONTROL SYSTEM
This article is dedicated to improving the performance of the control system through the optimization of the weft selection and selvedge control system hardware platform and the application of control algorithms. The overall hardware and software designs of the control system are described below.

A. Overall hardware design
This text chooses the electric current closed loop stepping motor control system. In this paper, the current subdivision drive and the mixed current attenuation algorithm are used to improve the low frequency oscillation of the stepper motor in order to realize the precise control of the weft selection and selvedge device used in the loom. In this paper, the mixed current decay algorithm is used to reduce the back-EMF during operation of the stepper motor in order to improve the dynamic performance of the system.
To meet the needs of the subject, the weft selection and selvedge control system studied in this paper needs to realize the control of 10 stepper motors, 2 of which control the selvedge device and 8 of which control the weft selection device. To reduce the development cost, the main control chip is used to control two drive circuits; that is, a hardware circuit board is used to control two stepping motors. Since weft selection and twisting stepper motor drive circuits are based on the same principle, one of the motor drive circuits will be introduced when the hardware scheme is introduced. Fig. 10 shows a functional block diagram of the hardware system. The hardware structure includes the main controller, a power conversion circuit, a power drive circuit, a current sampling circuit, a high-speed input channel, and an RS485 communication module.
The main control circuit is responsible for setting the motor speed, controlling the current, subdividing the current, setting the rotation direction, and processing the current signal collected by the current sampling circuit to obtain the actual current collection value.
The power supply provides the basis for ensuring the normal operation of the entire control system. The power drive circuit, the current sampling circuit, and the high-speed pulse input circuit of the control system operate on different voltage levels, so it is necessary to design power conversion circuits for multiple voltage levels. The power conversion module of this system is connected to a 24-V switching power supply that converts the 24-V power supply voltage into 15-V, 5-V, and 3.3-V power supply voltages.
The power drive circuit is mainly composed of latches, power drive devices, and H-bridge circuits.
The current sampling circuit collects the phase current of the stepper motor and calculates the true phase current through the main control circuit.
In the weft selection control system, the control of the weft selection device is mainly realized through reception of the control signal from the main controller of the high-speed rapier loom. The control signal from the main controller of the loom is a voltage signal of 24-V, while the STM32F103 can only accept voltage signals of 0-3.3-V; thus, the highspeed input channel reduces the voltage of the control signal and isolates the external interference signal [23].
In the selvedge control system, the selvedge controller needs to detect and receive the control signals of the main controller, such as the flat heddle, the loom spindle angle, and the loom stop signal, in real time and feed the current status back to the loom master controller. This article realizes communication with the main controller of the loom through an RS485 communication module [24][25][26].

B. Overall software design
Whereas the hardware platform is the foundation of the control system, the software system is its soul. The software system guides the system to perform actions. Errors or defects in software design will directly cause equipment to fail to operate normally and may even cause equipment damage or personal safety issues. The high-speed rapier loom weft selection and selvedge embedded software system mainly controls the drive motor as it completes the process actions of the weft selection and selvedge device. This article adopts the current closed-loop control method based on subdivision to realize the control of the drive motor. Fig. 11 shows an overall block diagram of the software; it mainly includes the subdivision control module, the speed control module, the mixed current attenuation module, the current acquisition and processing module, the current adjustment module, and the PWM generation module. It should be pointed out that the speed of the stepper motor in the selvedge control system follows the speed of the loom's main shaft, which is controlled by an external signal.

1) SYSTEM MAIN PROGRAM DESIGN
The weft selection device of the high-speed rapier loom consists of multiple weft selection fingers, and each weft selection finger is controlled by an independent stepping motor. The main shaft of the loom has only one weft selection finger action per cycle, and the main controller decides which weft selection finger to extend or retract by sending a control signal. When the main shaft of the loom starts, the initial state of each weft selection finger is the retracted state. This article combines the weft selection process and takes a single control unit as an example to illustrate the software design. Fig. 12 illustrates the main program flow chart of the weft selection control system.

2) CURRENT CONTROL SOFTWARE DESIGN
In this paper, the closed-loop control of the current is realized by software. For current closed-loop control, PID adjustment is the most mature and widely used control method [27][28][29]. Since the stator current of the stepper motor cannot follow the rapid change of the given reference value, adding the derivative term will cause the controller output to change excessively and will reduce the control effect of the motor, so only PI adjustment is adopted.
To simplify the calculation of all currents in the PI adjustment, in the actual calculation process the calculation of the current is directly converted to the calculation of the output duty cycle value. The ADC conversion number of the main control chip STM32F103 is 12 bits, the current sampling circuit widens the voltage range of the sampling resistor to 0.27-V-3.03-V, and the main control chip outputs the PWM duty cycle. This can be expressed as 76 . Then, the actual deviation of the k time PWM output is (6) Equation (7) can be derived from the positional PI equation: where P K is the proportional coefficient, T is the sampling period, and I T is the integral constant.
From Equations (7) and (8), The incremental PI equation consists of Equations (9) and (10). Comparing the positional and the incremental PI, it can be seen that the positional PI needs to calculate the cumulative value of the deviation and that the output is related to the entire past state, while the incremental PI output is related only to the deviation between the current moment and the previous two beats. When the calculation fails, the control effect of the positional PI will completely disappear, and the incremental PI will remain in place [30]. The stepper motor has integral parts, and the incremental PI control effect is better.

3) DESIGN OF MIXED CURRENT ATTENUATION CONTROL SOFTWARE
In this section, the self-decay control method used in the rising phase of the motor winding current is introduced. In the forward or reverse decline phase of the current, the fast decay method is used first, and then the self-decay method is used. The proportions of these two control modes must be adjusted. In the case of subdivision determination, if there are 8 current closed-loop control functions and the ratio of the rapid decay control mode to the self-decay control mode is 3:5, the first three rounds of current control adopt the fast attenuation control mode, and the last five rounds of current control function adopt the self-attenuation control mode. Fig. 13 shows the flow chart of the mixed current decay program.

FIGURE 13. Flow chart of the mixed current decay program
First, the program determines whether the current control times are greater than the total control times in a step; if they are greater, it enters the next subdivision step. Otherwise, it is necessary to judge whether the current is increasing at this time; if the current is increasing, the self-decay control method is adopted. When the current is in the declining stage, the program first determines whether the current control times are greater than the product of the total control times of a step and the attenuation proportional coefficient. If they are greater, the self-decay control mode is adopted; otherwise, the rapid decay control mode is adopted.

V. EXPERIMENTAL TEST OF THE CONTROL SYSTEM
In order to reduce the low-frequency oscillation during the operation of the weft selection and twist drive motor, this paper uses the current subdivision drive to subdivide the control of the motor winding current to improve the stability of the control system. To reduce the suppression of the winding current by the back-EMF, this article proposes a mixed current attenuation control algorithm to improve the effect on the motor winding current. Finally, this paper verifies the effectiveness of the current subdivision control and mixed current attenuation algorithm by testing the current waveform of the drive motor winding.

1) CURRENT WAVEFORM TEST
Experimental process: The driving pulse frequency was set at 2 kHz, two subdivisions were used, and the current was 2.3 A. The winding resistance current waveform of the stepper motor under the control of the self-attenuation mode, the fast attenuation mode and both types of attenuation mode (setting the current attenuation ratio coefficient to 0.3) was tested by oscilloscopy. The measured current waveform is shown in Fig. 14. (a) Self-decay method (b) Fast decay method (c) Mixed attenuation method It can be seen from Fig. 14 that in the current self-decay mode, the current waveform is relatively stable in the rising phase; this can effectively follow the increase in the set current in the winding current, but irregularities appear in the falling phase due to the fact that the freewheeling of the diode in the self-decay mode cannot effectively accelerate the reduction of the winding current, and this prevents the winding current from quickly following the reduction of the set current. In the fast decay mode, the back-EMF can be effectively released during the current drop stage, and the current following effect is improved, but in the current rising phase, the current waveform will be unstable. The switching frequency of the power tube under this control will also increase, and the power consumption will increase, and this will affect the stability of the motor operation. Compared with the self-decay and fast decay control methods, in the mixed attenuation control mode, the current waveform is closer to the current waveform under the ideal two subdivisions, and the current following effect is more obvious.
In this paper, the mixed current attenuation algorithm and the current subdivision drive is used to realize different subdivision controls and to verify the effectiveness of subdivision control. Fig. 15 shows the motor winding current waveforms observed when the driving pulse frequencies are 2 kHz, 4 kHz, 8 kHz, and 16 kHz; the corresponding numbers of subdivisions are two, four, eight, and sixteen, respectively. When sixteen subdivisions are used, the waveform diagram of the winding current is very close to the standard sine wave shown in Fig. 15. In the embedded control system of the high-speed rapier loom weft selection and selvedge device, the number of subdivisions of the current is set to sixteen. Through on-site debugging, it is found that the low-frequency oscillation problem of the motor has been effectively reduced, and the drive motor runs more smoothly.

2) ACCELERATION AND DECELERATION PERFORMANCE TEST
This paper studies the principle of H-bridge current attenuation control and proposes a mixed current attenuation control algorithm. To prove that use of this algorithm improves the dynamic performance of the motor, self-attenuation and mixed attenuation methods are used to control the motor during acceleration and deceleration tests. A step 2CM880 driver (current adjustment range 1.7A5 .7A; the highest support subdivision number is 100) is used for experimental comparison.
Test process: In the experiment, the power supply voltage of the motor is set to 24-V, and the working current is set to the rated current of 2.3 A using 2 subdivisions. In this experiment, a simple segmented acceleration and deceleration curve is used. The stepping motor is driven from a static state at 100 r/min, 200 r/min, 300 r/min, 400 r/min, 500 r/min, 600 r/min, and 700 r/min and accelerated for each acceleration segment. The six acceleration sections between 100 r/min and 600 r/min use the same acceleration time 1 t .
The deceleration is performed in six deceleration sections of 700 r/min, 560 r/min, 420 r/min, 280 r/min, 140 r/min, and 0 r/min. The same deceleration time 2 t is set for the four deceleration stages between 560 r/min and 140 r/min. The acceleration section between 600 r/min and 700 r/min and the deceleration section between 700 r/min and 560 r/min use the time 3 t . Before each acceleration and deceleration test, the starting angle 1  of the stepping motor is recorded. The motor will first rotate forward and then reverse according to the above set acceleration and deceleration curve and will use this as a test cycle. After each test cycle is completed, the motor's stopping angle 2  is recorded. In an ideal state, 1  and 2  are equal. Therefore, the difference between the two angles can be used to determine whether the motor is out of step or overshoots. Finally, 1 t and 2 t are constantly adjusted to obtain the shortest total acceleration and deceleration times when the angle difference is the smallest. Test results: The experimental results obtained using the two attenuation methods and the 2CM880 driver are shown in Table I. In the traditional control algorithm, the weft selection and selvedge device will produce low-frequency oscillation when the stepping motor runs at low speed. This low-frequency oscillation will make the forward rotation and reverse rotation of the motor have a deviation angle in the same cycle. The larger the deviation angle, the more obvious the out of step or overshoot of the motor, and the worse the control accuracy of the weft selection and selvedge device for the loom. In the traditional control algorithm, the stepping motor will produce a back-EMF when running. This back-EMF is not conducive to the increase of motor coil winding current, which is not conducive to the normal output torque of the motor. In the actual production and operation, the acceleration time and deceleration time of the motor reaching the same speed are long, that is, the dynamic performance is poor.
Under the same conditions, the shortest acceleration time of stepping motor controlled by mixed attenuation algorithm is 19.6ms, which is the shortest compared with self attenuation algorithm and 2CM880 driver; Under the same conditions, the shortest deceleration time of stepping motor controlled by mixed attenuation algorithm is 13.4ms, which is the shortest compared with self attenuation algorithm and 2CM880 driver; Under the same conditions, the deviation angle of the stepping motor controlled by the mixed attenuation algorithm is 0.96°, which is the smallest compared with the self attenuation algorithm and 2CM880 driver; It can be seen from the test results that compared with the self-decay method and the 2CM880 driver, under the same loom production conditions, the mixed current decay control algorithm is more conducive to shortening the stepper motor's acceleration and deceleration time, and the deviation angle is smaller. It can be seen from the experimental results that the stepper motor under the mixed current attenuation algorithm is better than some algorithms and some stepper series drivers in terms of dynamic performance. The mixed current attenuation algorithm proposed in this paper not only effectively suppresses the low-frequency oscillation generated by the motor during operation, but also effectively reduces the back-EMF generated by the motor during operation, so as to increase the output torque of the motor and improve the dynamic performance of the system. This is the reason why the mixed current attenuation algorithm is used in the experiment to reduce the motor deviation angle, reduce the acceleration and deceleration time, and improve the dynamic performance of the system compared with other methods. This proves that the mixed current attenuation control algorithm proposed in this paper can effectively improve the dynamic response of the stepper motor to achieve precise control of the weft selection and selvedge device of the loom. In terms of system operation stability, the mixed current attenuation algorithm combines the advantages of the selfdecay method and the fast decay method. The mixed current attenuation algorithm realizes the feedback of the attenuated current to the power supply. During the rising phase of the current, it can ensure the stable change of the current and increase the smoothness of the motor operation. In the declining phase of the current, the mixed current attenuation algorithm can achieve a rapid reduction of the winding current, effectively release the back-EMF generated during the operation of the motor, and ensure the smoothness of the system operation.
These can improve the production efficiency in the actual production of the rapier loom, and has a good application prospect.

VI. CONCLUSION
As two important processes, weft selection and selvedge technology directly affect overall production efficiency. This paper analyzes the existing operating problems associated with currently available weft selection and selvedge technology in detail and optimizes its control system. The existing problems in the operation of the high-speed rapier loom weft selection and selvedge device are analyzed. The low-frequency oscillation and the back-EMF of the actuator (stepping motor) are the main factors that affect the stability of the control system. The contribution and innovation of this paper is that the mixed current mixed attenuation algorithm is proposed to improve the low frequency oscillation and back-EMF of the stepping motor and applied to the actual loom production. In this paper, an optimized mixed current attenuation algorithm is proposed to improve the performance of the system. The system uses STM32F103 as the core for modular design, completes the construction of the system hardware platform, and completes the software control system design framework based on the design of the hardware platform. The key parts of the designed system, including the system main program design, the current control software design, and the software design based on the mixed current attenuation algorithm, are described in detail. In this paper, the current closed-loop control method based on subdivision is used to control the drive motor and design the corresponding software system. The low-frequency oscillation of the stepping motor in the weft selection and edging device is improved by current subdivision drive, and the influence of the back-EMF of the stepping motor is reduced by the mixed current attenuation algorithm. Finally, the control system is debugged and verified, and an experimental platform is built. In order to ensure the normal operation of the designed hardware circuit, the current waveforms of the stepper motor windings were tested, which verified the effectiveness of the mixed current attenuation algorithm and current subdivision drive in reducing the low frequency oscillation of the weft selection and selvedge device used in the loom. By comparing the acceleration and deceleration test results obtained using the motor under the current self-attenuation mode control, it is verified that the use of the current mixed attenuation algorithm can improve the dynamic performance of the motor.
In the future, the improvement of the weft selection and selvedge control system for looms is mainly reflected in the following aspects: 1. In the process of building the hardware platform of the embedded control system, the electromagnetic compatibility of the system was not evaluated. In the follow-up research, the electromagnetic interference characteristics of the system will be further tested and improved to ensure that the control system can operate reliably in a complex industrial field environment.
2. With the progress of science and technology, in the future development, the research of remote control system is imperative. Therefore, in order to meet the needs of future development, the design of the future weft selection and selvedge control system for looms should add a wireless transmission module or an industrial Ethernet module to meet the needs of industrial interconnection while increasing the transmission rate.
3. In order to improve the degree of intelligence of the system, this subject should consider adding system fault diagnosis and intelligent prediction functions in the future algorithm design.

Data availability
The code and data used to support the findings of this study have been deposited in the Design of High-speed Rapier Loom Control System Based on Mixed Current Attenuation Algorithm repository and can be obtained from the corresponding author upon request.
YANJUN XIAO is a professor in the School of Mechanical Engineering, Hebei University of Technology. He holds a bachelor's degree in industrial automation chemistry and a master's degree in machine manufacturing and automation from Hebei University of Technology. His main research interests are waste heat recovery and industrial control.
LINHAN SHI is studying for a master's degree at Hebei University of Technology. He graduated from Hebei University of Technology in 2019. He is mainly engaged in intelligent industrial connectivity and embedded development.