Design of an Adaptive Boost Energy-Saving Fuzzy Control System Driven by the Finite State Machine

Aiming at the challenging problem of the traditional warp knitting machine electronic jacquard control system with complex structure of multiple circuit boards layered cascade, such as large physical space occupation, high power consumption, and independent high-voltage power supply voltage, we proposed an embedded circuit and control strategy design for the piezoelectric jacquard needle (PJN) with adaptive boost and energy recovery functions. Firstly, the electromechanical dynamics model of PJN was established. Secondly, the fuzzy PI double closed-loop control algorithm driven by a finite state machine is proposed. )irdly, with the help of a Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET), the PJN is integrated with the drive circuit. )e drive circuit of PJN uses an energy storage inductor to replace the current limiting resistor of the traditional drive circuit, which can not only limit the forward charging current of the PJN and reduce energy loss but also can use the energy absorbed from the low-voltage power supply to adaptively boost the power supply of the PJN to the high voltage required for working conditions. )e simulation results show that the new PJN drive circuit has an adaptive self-boost function. )e PWM signal modulated by the fuzzy PI double closed-loop control algorithm can efficiently and accurately control the adaptive boost power supply and the voltage across the PJN.)e mode of the circuit can be correctly switched through the sequential logic of the finite state machine and realize the energy recovery function.


Preface
At present, traditional motors and electromagnetic drives can no longer meet the drive requirements of special equipment for precision motion [1]. A new generation of intelligent actuators represented by piezoelectric ceramic actuators, giant magnetostrictive actuator, and shape memory alloy actuators [2][3][4] are not only widely used in nanolevel intelligent precision manufacturing equipment in the fields of aerospace, bioengineering, etc. but also gradually used in traditional industrial automation control fields, such as textile equipment [5]. At present, these intelligent actuators generally contain embedded circuit systems inside, which can run intelligent control algorithms such as fuzzy control [6][7][8][9] and neural network control [10]. e research results on the application of piezoelectric ceramics in highprecision motion and positioning control mainly include the establishment of nonlinear models and their compensation mechanisms based on the inherent nonlinear hysteresis and creep characteristics of piezoelectric ceramics, as well as the design of micromovement flexible mechanisms, etc. [11][12][13]. e research on the application of piezoelectric ceramics in the field of electronic information mainly includes piezoelectric vibration control and energy harvesting, as well as the design of new piezoelectric sensors and driving power supplies [14][15][16]. When driving the microdisplacement mechanism, the piezoelectric ceramic driver can be regarded as a capacitor [17]; it consumes less energy, but when driving the load, it will generate a larger current in the drive circuit, and there is large power consumption and the problem of low efficiency. In addition, the traditional piezoelectric control system needs to be additionally equipped with special power supplies of different specifications according to the characteristics of the controlled object, resulting in a large system, low integration, and high complexity and cost.

Piezoelectric Ceramic Dynamic Model
e PJN generally consists of two Pb-based Lanthanumdoped Zirconate Titanate (PZT) piezoelectric ceramic wafers and a glass fiber ceramic substrate, as shown in Figure 1.
l is the length of the PJN, c � 2a + b is the thickness of the PJN, a is the thickness of PZT piezoelectric ceramic wafers, b is the thickness of the glass fiber ceramic substrate, c � a + 0.5b is half the thickness of the PJN, r is the radius of curvature, and θ is the chord center angle. According to the inverse piezoelectric effect, the PJN uses the applied voltage U PJN to produce a vertical deflection deformation (upper PZT contraction, lower PZT extension) in the vertical direction proportional to the electric field strength and produces a positive and negative offset to achieve the jacquard effect. e bending and stretching amount Δl of the PJN is where d 31 is the piezoelectric strain constant. Next, we consider the mathematical relationship between the bending and expansion of the PJN and its applied voltage U PJN . It can be seen from Figure 1 that From equation (2), we can get r � (l + Δl)c/Δl and θ � Δl/c. Considering l + Δl ≈ l, it can be concluded that the displacement of the positive and negative offset of the PJN is From equation (3), it can be seen that the displacement of the PJN positive and negative offset is proportional to the applied voltage U PJN , proportional to the square of its length l, and inversely proportional to the square of the thickness c.

PJN Drive Circuit Model
e drive circuit model includes six MOSFETs such as V 1 ,V 2 , and V 31 ∼ V i1 (i � 3, 4, 5, 6). ere are 9 diodes, which are D 1 ∼ D 5 ,D 31 ∼ D i1 , and D 31 ′ ∼ D i1 ′ , i � 3, 4, 5, 6. ere is an energy storage inductor L and a PJN. In the driving circuit, V 31 ∼ V i1 and PJN constitute a double-arm bridge circuit, as shown in Figure 2. e low-voltage power supply voltage is U d (usually 24 V power supply), and the high-voltage power supply voltage is U p (usually DC 100 V ∼ 200 V). e turn-on and turn-off of the MOSFETs are driven by a high-frequency PWM signal. e PWM signal is obtained by modulating the triangular carrier by the control signal output by the voltage and current double closed-loop controller. e logic switching of the initial boosting, high-frequency boosting, and high-voltage driving modes of the drive circuit is completed by the finite-state machine.

PJN Driving Circuit Working Mode Analysis
e complete working process of the drive circuit of the PJN includes 6 working modes, that is, S 0 ∼ S 5 , as shown in Figure 3.
e key waveform of the drive circuit is shown in Figure 4. e switching condition c ij between modes is determined by the combination of the production process of the warp knitting machine and the characteristics of the driving circuit. e equivalent circuit in different modes is shown in Figure 5.

e Initial Boost Mode S 0 of the High-Voltage Power
Supply. All MOSETs are turned off through the input control terminal, and the low-voltage power supply U d charges the high-voltage power supply U p through the diode D 3 until U p ≥ U d − U DD . U DD is the forward voltage drop of the diode D 3 . e mode S 0 is shown in Figure 5(a). When

High-Frequency Boost Mode S 1 of High-Voltage Power
Supply. U p is charged through U d and L until U p reaches the rated voltage U * p . Real-time detection of U p is carried out during the boost process; if U p > � U * p is satisfied, the charging boost process ends. is process is realized by highfrequency cyclic switching of the two submodes S a 1 and S b 1 , as shown in Figures 3(b) and 3(c). In mode S a 1 , U d charges and stores energy for L. During the charging process of L, the two arms of the double-arm bridge composed of V 31 V 41 V 51 , and V 61 work alternately at high frequencies, so as to ensure that the charging and discharging energy of the PJN are complementary and remain in a balanced position. In the mode S a 1 , i L rises according to the following formula: When i L > i * L (i * L is the reference set current), the circuit is switched from S a 1 to S b 1 , the inductor L is discharged to ensure i L ≤ i * L , and the energy in the L is recovered to U p . In mode S b 1 , i L drops according to the following formula: According to the conservation of energy, we can get where I L is the average value of i L , T a is the total time occupied by submode S a 1 intermittently in a mode S 1 , and T b is the total time occupied by submode S b 1 intermittently in a mode S 1 .
According to formula (6), we can get When U p > � U * p , the condition c 12 � 1 or c 13 � 1 satisfied, and the drive circuit enters S 2 (positive offset) or S 3 (negative offset) from S 1 .

Positive Offset
where C PJN is the equivalent capacitance of the PJN and C p is the equivalent capacitance of U p . It can be seen from equation (8) that, in order to obtain U * PJN that satisfies the warp knitting process, U * p > U * PJN must be made in the mode S 1 .
In mode S a 2 , i L rises according to the following formula: In order to ensure i L ≤ i * , L discharges in mode S b 2 , and i L decreases according to the following formula: Mode S 3 : assuming that the rated driving voltage of the PJN that meets the process requirements is −U * PJN , U p will reversely charge the PJN until U PJN ≤ − U * PJN , and the two submodes

Equilibrium
Mode S 4 and S 5 . According to the warp knitting process, the PJN will return to the equilibrium modes S 2 or S 3 after meeting the conversion conditions c 42 � 1 or c 42 � 1 after working for a time interval in S 4 or S 5 . e next action of the PJN in the equilibrium mode will depend on the warp knitting process and the state of U p . For example, if the PJN is currently in the balanced mode S 4 and U p > � U * p , the next step of the warp knitting process will continue to shift positively, and the transition condition c 42 � 1 of the finite state machine is triggered, causing the drive circuit to transfer to the mode S 2 . Note that if U p < U * p , you need to trigger c 41 � 1 to return to mode S 1 to charge U p to compensate for the energy lost during driving the PJN. After U p > � U * p , the charging and boosting process ends, and U p continues to drive the PJN according to the warp knitting process.

Fuzzy PI Control Algorithm Driven by the Finite State Machine
Generally, the circuit for multimode switching operation needs to adopt an independent controller in each working mode. In this paper, a finite-state machine is used to drive a fuzzy PI controller so that it can adapt to different circuit modes, as shown in Figure 6. e fuzzy PI controller adopts double closed-loop control, where U * S � U * p , U * PJN , −U * PJN . e inner loop of the fuzzy PI controller is the antisaturation current PI control loop, which outputs the signal U r ′ ∈ [−U r ′ , U r ′ ] through the conversion factor α, and generates the PWM signal K to drive the MOSFETs by modulating the triangular wave. e outer loop is an antisaturation voltage fuzzy PI control loop, and the output is U r ∈ [−U r , U r ]. When the deviation e u is large, the outer loop output U r is always saturated, the voltage loop is equivalent to an open loop, and the system becomes a current regulation system based on the conversion voltage U * i of i * L , basically keeping the I L constant. When the deviation e u is close to zero, it indicates that the target voltage is basically reached, U r gradually exits the saturation state, and U * i and i L drop rapidly. e proportional and integral adjustment parameters of the outer-loop fuzzy PI controller are k p � k p0 + Δk p and k i � k i0 + Δk i , respectively, where k p0 and k i0 are the initial values, and Δk p and Δk i are the fuzzy control variables. e establishment of fuzzy control rules requires full consideration of the characteristics of the PJN drive circuit. For example: when the mode of the circuit is S 1 (U * S � U * p , e u � U * p − U p ) and the voltage difference e u and Δe u is large, it shows that the deviation of U p and U * p is large, so Δk p and Δk i should be increased to achieve the purpose of quickly reducing the e u . e fuzzy rule table is shown in Table 1, which contains 18 fuzzy rules in the form of "if A i and B i , then C i ″ . In order to reduce the computational complexity of the proposed fuzzy PI controller, we only use 18 fuzzy control rules. In future work, we will use the offline generated fuzzy control table to avoid online real-time fuzzy inference which will further improve the operating efficiency of the control system.
In this paper, the fuzzy domain of input and output is divided into three fuzzy subsets N, Z, P { }. When the deviation is small, the triangular membership function is used to improve the control sensitivity. e analytical formula is shown in equation (11), where a is the midpoint of the fuzzy subset and c is the distance from the midpoint to the two ends of the fuzzy subset. When the deviation is large, the s-shaped membership function is used, and the analytical formula is as in equation (12).
e relationship between the clarification variables e u and Δe u and the fuzzy variables E u and ΔE u is where k e and k Δe are the quantization factors of E u and ΔE u , respectively. e input and output membership functions of the fuzzy inference are shown in Figures 7(a), 8(b), and 8(c) . e fuzzy adaptive adjustment of k p and k i is shown in Figure 8(d).
e relationship between PI parameter correction variables Δk p and Δk i and e u and Δe u , respectively, is shown in Figure 9.
e Mamdani reasoning rule is used to perform fuzzy reasoning as follows: We use the center of gravity method with smoother output, simpler calculation, and higher accuracy to perform the following defuzzification:  Figure 6: e fuzzy PI controller driven by the finite state machine.

Simulation
In order to verify the effectiveness of the design strategy of the adaptive boost energy-saving fuzzy control system driven by the finite-state machine, a PJN drive circuit was built in MATLAB/Simulink, as shown in Figure 8.
In order to ensure that U p and U PJN can follow the given values U * p and U * PJN smoothly and quickly, a double closedloop control system is established, as shown in Figure 10. Each module is encapsulated in a subsystem. It can be seen from Figure 10 that the drive circuit of the PJN is driven by a finite-state machine, and the PWM signal in the finite-state machine needs to be adjusted automatically by the fuzzy PI controller.      Figure 11. It can be seen from Figure 11 that the output voltage of the fuzzy PI controller generates the PWM signal of the MOSFETs in the driving circuit by modulating the triangular wave, which determines the frequency of the current i L in the circuit. e finite-state machine realizes the logic switching between the various modes of the circuit. e adaptive self-boost performance, jacquard needle drive function, and energy-saving effect of the PJN drive circuit are shown in Figures 12(a) and 12(b), and the PWM waveform generation process is shown in Figure 12(c). It can be seen from Figure 12(a) that it only took 100 ms for U P to boost from 0 V to 100 V. During U P ≪ 100 V, the voltage outer loop is in a saturated state, and only the current inner loop control circuit, by setting U r ′ ∈ [0 r , 20], guarantees i L ≤ 20 ms. U r ∈ [−2, 2] is set in the simulation process, and during U P ≥ 98 V, the voltage outer loop starts to work and smoothly and quickly adjust U P to boost to 100 V. Figure 12(a) also shows that the decay speed of i L in the substate S b 1 of the boost mode S 1 continues to increase. e average voltage U PJN of the U PJN is zero, which ensures that the PJN is stationary at the equilibrium position. Figure 12(b) shows the positive and negative offset of Set PJN for one cycle under the conditions of U * p � 205 V and U * PJN � 150 V. From Figure 12(b), it can be seen that the positive offset time of PJN is T + � 1.5 ms, the negative offset time is T − � 1 ms, the time to stay in the equilibrium position is T O � 1.5 ms, and the total time of an offset cycle is T T � T L + T R + T O � 4 ms, which satisfies the process requirements 3 ∼ 20 ms, which shows that the proposed driving strategy is feasible. It can be seen from Figure 12(b) that, in the T − phase (S b 1 mode), the circuit recovers the energy stored in L through the piezoelectric effect of the PJN, which has energy-saving performance. Although energy is recovered in phase T − , the high-voltage power supply U P still has a small loss (U P < 205 V), so in phase S 1 (mode S 4 ), it returns to the boost mode S 1 , trying to boost up to U P .

Conclusions
is paper integrates the self-boosting circuit of PJN highvoltage power supply with the PJN high-frequency working circuit to improve the circuit integration. e logic switching sequence of each functional mode of the circuit is dispatched by a finite-state machine. e adopted PI fuzzy double closed-loop control algorithm can realize the controlled voltage value of the circuit in each mode smoothly and quickly reaching the target value. e new PJN drive circuit designed in this paper uses energy storage inductors instead of the current limiting resistors of the traditional drive circuit, making the circuit have a self-boosting function, without external high-voltage power supply, only lowvoltage power supply, effectively reducing the complexity of the circuit. e energy storage capacity of the inductor can be used for energy recovery, achieving energy saving and low power consumption. e design strategy proposed in this paper provides a theoretical basis for the design of the embedded jacquard miniaturized control system of the warp knitting machine. It would be interesting to consider Takagi-Sugeno fuzzy neural networks to analyze the stability and provide self-learning capabilities in the control problem of the driving circuit of the PJN for future work.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.