Model Reference Adaptive Control and Fuzzy Neural Network Synchronous Motion Compensator for Gantry Robots

: A model reference adaptive control and fuzzy neural network (FNN) synchronous motion compensator for a gantry robot is presented in this paper. This paper proposes the development and application of gantry robots with MRAC and FNN online compensators. First, we propose a model reference adaptive controller (MRAC) under the cascade control method to make the reference model close to the real model and reduce tracking errors for the single axis. Then, a fuzzy neural network compensator for the gantry robot is proposed to compensate for the synchronous errors between the dual servo motors to improve precise movement. In addition, an online parameter training method is proposed to adjust the parameters of the FNN. Finally, the experimental results show that the proposed method improves the synchronous errors of the gantry robot and demonstrates the methodology in this paper. This study also successfully integrates the hardware and successfully veriﬁes the proposed methods.


Introduction
Gantry robots have been widely used in manufacturing industries such as highprecision motion control, precision manufacturing, circuit assembly, microelectronics, and inspection [1][2][3]. The gantry robot is composed of a manipulator on an overhead system, and two motors are installed on two parallel linear guides to drive the moving platform. However, due to various factors, such as unbalanced forces on both sides, various disturbances in the driving process will cause synchronous errors between the two motors. The consequence of these synchronous errors will not only cause system jitter and affect the quality of the workpiece but also cause the work process to stop due to overcurrent protection. These undesirable effects are very much in need of control and improvement for high-speed and high-precision manufacturing. Therefore, how to effectively control the synchronous errors of a gantry position platform has become a key issue.
Typical methods (see Figure 1) to synchronize the motion in gantry robot control systems include (1) the cascade control method, and (2) the parallel control method [4,5]. Both methods use two control loops to control the motors separately. The first control method divides the two control loops into a master loop and a slave loop, and the reference command is only provided to the master loop. The master loop has a master motor, and the slave loop has a slave motor. If the master loop encounters a disturbance, the slave loop also reflects the disturbance. The second control method has the two control loops follow the same reference position command. Since the inevitable differences between the two subsystems (including motors, motor drives, etc.) are not taken into account, this method usually exhibits poor performance. Recently, compensators [6][7][8][9] and cross-coupling technology have often been used in machine tools and multiaxis motion applications [10,11] to solve synchronization control problems and improve control performance [12][13][14][15]. In cross-coupling control, each loop also considers the position and speed errors of another motor to evaluate its own control performance. However, these methods cannot provide sufficient robustness because the control parameters are selected through trial and error.
Fuzzy neural networks (FNNs) [16][17][18][19][20][21][22][23][24][25][26] is an intelligent technology that combines the advantages of fuzzy logic and neural network systems. The FNN system is a straightforward implementation of a fuzzy inference system with a four-layered network structure. Generally, the advantage of FNN systems lies in that: (1) the FNN system can automatically identify fuzzy logic rules, (2) the parameters of the FNN system have clear physical meanings, (3) the FNN system can incorporate linguistic information (in the form of fuzzy IF-THEN rules), and (4) the desired performance can be obtained under fewer adjustable parameters than in neural networks. Generally, FNNs can be divided into the Mamdani type and Takagi-Sugeno-Kang (TSK) type. Since the TSK model can incorporate mathematical knowledge about the controlled plant and can use control theory to analyse its behaviour, the TSK model is the most commonly used FNN method.
Recent research on gantry robots, such as literature [27], discusses the synchronous control based on fuzzy single neuron PID cross-coupling controller, literature [28] discusses the suppression of the rotational motion of cross-coupled gantry stage and literature [29] proposes a new algorithm to identify the parameters of the synchronous dualdrive ball screw gantry system. This paper proposes the development and application of gantry robots with MRAC and FNN online compensators. For the controller design, a cascade control method with an MRAC controller is proposed to ensure the tracking requirements of single axis control. Then, the purpose of the FNN compensator is to eliminate the synchronous errors between the dual servo motors. To improve the learning ability of FNN, an online parameter training method is proposed to adjust the parameters of the FNN. This paper has developed and successfully completed the theoretical and technical feasibility of the proposed method through various experimental comparisons.
The rest of the paper is organized as follows. The gantry robot servo system description is given in Section 2. Section 3 presents the proposed synchronous control methods of gantry robots. The FNN online compensator with two inputs and one output is developed to compensate for the synchronous errors. The experimental results are illustrated in Section 4 to demonstrate the methodology proposed in this paper. Figure 2 shows the gantry robot system used in this paper. It consists of two rotating servo motors, guideways, and ball screws. Recently, compensators [6][7][8][9] and cross-coupling technology have often been used in machine tools and multiaxis motion applications [10,11] to solve synchronization control problems and improve control performance [12][13][14][15]. In cross-coupling control, each loop also considers the position and speed errors of another motor to evaluate its own control performance. However, these methods cannot provide sufficient robustness because the control parameters are selected through trial and error.

The Structure and Mathematical Model of the Gantry Robot System
Fuzzy neural networks (FNNs) [16][17][18][19][20][21][22][23][24][25][26] is an intelligent technology that combines the advantages of fuzzy logic and neural network systems. The FNN system is a straightforward implementation of a fuzzy inference system with a four-layered network structure. Generally, the advantage of FNN systems lies in that: (1) the FNN system can automatically identify fuzzy logic rules, (2) the parameters of the FNN system have clear physical meanings, (3) the FNN system can incorporate linguistic information (in the form of fuzzy IF-THEN rules), and (4) the desired performance can be obtained under fewer adjustable parameters than in neural networks. Generally, FNNs can be divided into the Mamdani type and Takagi-Sugeno-Kang (TSK) type. Since the TSK model can incorporate mathematical knowledge about the controlled plant and can use control theory to analyse its behaviour, the TSK model is the most commonly used FNN method.
Recent research on gantry robots, such as literature [27], discusses the synchronous control based on fuzzy single neuron PID cross-coupling controller, literature [28] discusses the suppression of the rotational motion of cross-coupled gantry stage and literature [29] proposes a new algorithm to identify the parameters of the synchronous dual-drive ball screw gantry system. This paper proposes the development and application of gantry robots with MRAC and FNN online compensators. For the controller design, a cascade control method with an MRAC controller is proposed to ensure the tracking requirements of single axis control. Then, the purpose of the FNN compensator is to eliminate the synchronous errors between the dual servo motors. To improve the learning ability of FNN, an online parameter training method is proposed to adjust the parameters of the FNN. This paper has developed and successfully completed the theoretical and technical feasibility of the proposed method through various experimental comparisons.
The rest of the paper is organized as follows. The gantry robot servo system description is given in Section 2. Section 3 presents the proposed synchronous control methods of gantry robots. The FNN online compensator with two inputs and one output is developed to compensate for the synchronous errors. The experimental results are illustrated in Section 4 to demonstrate the methodology proposed in this paper. Figure 2 shows the gantry robot system used in this paper. It consists of two rotating servo motors, guideways, and ball screws. In traditional cascade control, the inner current control loop usually has a high gain to minimize the current error over the system operating range. The bandwidth of the current loop is usually well over 2 kHz, and the effect of back EMF is eliminated. The electronic dynamics are so fast that the transfer function of the AC servo drive can be treated as a constant current gain. For simplicity, the system equations of each axis of the gantry robot can be shown as

The Structure and Mathematical Model of the Gantry Robot System
where i M is the equivalent mass of the mechanism; i D is the equivalent viscous friction; ti K is the torque constant; Li F is the external disturbance term; and ui is the control effort. Then, the undermined plant is ( ) The velocity PI controller (shown in Figure 3) is used to eliminate external disturbances. Then, the identified plant from the control effort to the velocity response can be simplified to ( ) Then, the input command, shown in Figure 4a, is simultaneously fed into each axis as vcmd1 and vcmd2, and the responses of Axes 1 and 2 are shown in Figure 4b. The data of Figure 4a,b are utilized to identify the parameters in Equation (3); then, the identified results of each axis are indicated in Table 1.  In traditional cascade control, the inner current control loop usually has a high gain to minimize the current error over the system operating range. The bandwidth of the current loop is usually well over 2 kHz, and the effect of back EMF is eliminated. The electronic dynamics are so fast that the transfer function of the AC servo drive can be treated as a constant current gain. For simplicity, the system equations of each axis of the gantry robot can be shown as where M i is the equivalent mass of the mechanism; D i is the equivalent viscous friction; K ti is the torque constant; F Li is the external disturbance term; and u i is the control effort. Then, the undermined plant is The velocity PI controller (shown in Figure 3) is used to eliminate external disturbances. Then, the identified plant from the control effort to the velocity response can be simplified to In traditional cascade control, the inner current control loop usually has a high gain to minimize the current error over the system operating range. The bandwidth of the current loop is usually well over 2 kHz, and the effect of back EMF is eliminated. The electronic dynamics are so fast that the transfer function of the AC servo drive can be treated as a constant current gain. For simplicity, the system equations of each axis of the gantry robot can be shown as where i M is the equivalent mass of the mechanism; i D is the equivalent viscous friction; ti K is the torque constant; Li F is the external disturbance term; and ui is the control effort. Then, the undermined plant is ( ) The velocity PI controller (shown in Figure 3) is used to eliminate external disturbances. Then, the identified plant from the control effort to the velocity response can be simplified to ( ) Then, the input command, shown in Figure 4a, is simultaneously fed into each axis as vcmd1 and vcmd2, and the responses of Axes 1 and 2 are shown in Figure 4b. The data of Figure 4a,b are utilized to identify the parameters in Equation (3); then, the identified results of each axis are indicated in Table 1.  Then, the input command, shown in Figure 4a, is simultaneously fed into each axis as v cmd1 and v cmd2 , and the responses of Axes 1 and 2 are shown in Figure 4b. The data of Figure 4a,b are utilized to identify the parameters in Equation (3); then, the identified results of each axis are indicated in Table 1.

Controller Design for The Single Sxis
To reduce the tracking error of the single axis position, we adopt the cascade control method to design the single axis control, as shown in Figure 5. In this method, the discrete model of a single axis plant, which can be represented as ( ) and s T is the sampling time.

Controller Design for The Single Sxis
To reduce the tracking error of the single axis position, we adopt the cascade control method to design the single axis control, as shown in Figure 5. In this method, G pi z −1 is the discrete model of a single axis plant, which can be represented as and T s is the sampling time.
Energies 2022, 15, x FOR PEER REVIEW 5 of 18 To make the reference model close to the real model, we adopted the adaptive control to let the reference model approach to real model. At present, there are two main design architectures in the adaptive control. One is the self-tuning controller (STC), and the other is the model reference adaptive controller (MRAC). Here, The inner velocity loop and outer position loop use the integral K vii , proportional K vpi , and proportional K ppi controllers. To make the reference model close to the real model, we adopted the adaptive control to let the reference model approach to real model. At present, there are two main design architectures in the adaptive control. One is the selftuning controller (STC), and the other is the model reference adaptive controller (MRAC). Here, we adopted the MRAC [30], as shown in Figure 6. The basic concept of MRAC is to plan the performance of the control system in a reference model, and the design of the entire feedback control system is to match the planned reference model to achieve the expected system response. The inner velocity loop and outer position loop use the integral Kvii, proportional Kvpi, and proportional Kppi controllers. To make the reference model close to the real model, we adopted the adaptive control to let the reference model approach to real model. At present, there are two main design architectures in the adaptive control. One is the self-tuning controller (STC), and the other is the model reference adaptive controller (MRAC). Here, we adopted the MRAC [30], as shown in Figure 6. The basic concept of MRAC is to plan the performance of the control system in a reference model, and the design of the entire feedback control system is to match the planned reference model to achieve the expected system response. From Figure 6, the adaptive force ucomp can be obtained by the error Verr, and the reference output Vm is composed of the nominal parameters an and bn. The adaptive parameters K1, K2, and K3 are derived from the Lyapunov stability criterion. The detailed derivation process, please see Appendix A. From Figure 6, the adaptive force u comp can be obtained by the error V err, and the reference output V m is composed of the nominal parameters a n and b n . The adaptive parameters K 1 , K 2 , and K 3 are derived from the Lyapunov stability criterion. The detailed derivation process, please see Appendix A.
where the positive constants are B j and C j , and j = 1, 2, 3, could be well tuned under the model reference adaptive control method. Therefore, the transfer function of the velocity inner loop can be represented as We can use the pole-placement method to design the controller for this second-order system. Let the two parameters ξ and ω n be similar to the damping ratio and natu-Energies 2022, 15, 123 6 of 17 ral frequency of the standard second-order system; then, the parameters of the velocity controller are The transfer function of the outer position loop can be simplified as Here, the bandwidth of the position loop can be well designed according to the rule of cascade control, and then the parameter K ppi can be easily obtained. For more details, please refer to [30]. Here, we adopt the important design results of [30].

FNN Synchronous Motion Compensator
Although the abovementioned single axis controller can reduce the single axis position tracking error, the synchronous error between the dual motors is caused by various factors, such as unbalanced forces on both sides, various disturbances in the driving process and environmental uncertainty. This is an unavoidable situation. Therefore, we developed an FNN online compensator combined with MRAC, as shown in Figure 7. This FNN online compensator can compensate for the synchronous error online. Here, two methods are proposed: (1) parallel control and (2) parallel master-slave control. When the linear guides are not parallel with respect to each other axis in installation, the second method will be applied to avoid the mechanical coupling force being yielded by achieving the synchronous motion in position.
Energies 2022, 15, x FOR PEER REVIEW 7 of 18 Adopting the concept of fuzzy neural network technology, the proposed FNN compensator for MRAC can be constructed, as shown in Figure 8. Adopting the concept of fuzzy neural network technology, the proposed FNN compensator for MRAC can be constructed, as shown in Figure 8. Adopting the concept of fuzzy neural network technology, the proposed FNN compensator for MRAC can be constructed, as shown in Figure 8. Next, we introduce the important concepts of an FNN. An FNN is a network with fuzzy inference characteristics implemented by a four-layer neural network. The following will describe the structure, corresponding operation and learning process of an FNN.
Layer 1: Input layer Next, we introduce the important concepts of an FNN. An FNN is a network with fuzzy inference characteristics implemented by a four-layer neural network. The following will describe the structure, corresponding operation and learning process of an FNN.

Layer 1: Input layer
Each node in this layer represents the input node of each input linguistic variable and corresponds to an input variable. This means that the nodes in this layer are only responsible for passing the input signal to the next linguistic layer. There are two input variables of the FNN compensator in our proposed synchronous control method. One is the position synchronous error x 1 1 = e s = P 1 − P 2 , and the other is the velocity synchronous error x 1 2 = . e s = V 1 − V 2 . P 1 , P 2 are the position responses, and V 1 and V 2 are the velocity responses corresponding to Axes 1 and 2, respectively. Therefore, the node output of this layer is as follows: Layer 2: Linguistic layer (Membership layer) The nodes in layer 2 are called membership nodes, and the role of this layer is to perform the membership function of each node. The Gaussian function is used here as a membership function. Then, where m ij and σ ij denote the mean and the standard deviation, respectively, of the Gaussian functions of the jth term of the ith input linguistic variable; M is the number of rules.

Layer 3: Rule layer
The rule nodes are located in layer 3, which includes the rule layer and fuzzy inference mechanism. For each layer 3 node, there is at most one previous link from the layer 2 node of the language variable. The nodes in this layer are denoted by ∏, which are multiplied by the input signal from layer 2. Then, for the jth rule node, where y 3 k and w 3 k represent the output and weight of the rule layer, respectively. Here, w 3 k is designed to be 1.

Layer 4: Output layer
The layer 4 contains output variable nodes. This layer performs defuzzification to obtain the numerical output y 4 o . The operation of layer 4 is where y 4 o (N) is the output of the proposed FNN compensator for MRAC and the link weight w 4 ko is the output strength. In this paper, M is set to 3, which means that the linguistic layer has 6 nodes, and the rule layer has 9 nodes.

On-Line Learning Algorithm
The parameter learning algorithm is based on a supervised learning law to train the system. This method is the same as the derivation of the back propagation algorithm, adjusting the link weight in the output layer to minimize the given energy function.
Next, we describe the update laws of the parameters in the FNN. First, the error term to be propagated is given by

Stability Analysis
Refer to [31][32][33], based on the discrete Lyapunov function analysis, we consider the energy function (14) as the discrete Lyapunov function. The change in the Lyapunov function can be written as then, according to [31][32][33], Equation (20) will be derived as follows.
By the design of the learning rate parameters [31], the convergence of Equation (21) can be guaranteed. Here, we have omitted some mathematical processes, and listed the important result as follows: From Equation (22), it means that the synchronous error of the gantry robot will gradually converge to zero. Figure 9 shows the experimental system of the gantry robot control system in this study. In the experimental system, the single axis controller and the proposed FNN online compensator for MRAC are implemented in the PC.

Experimental Results
From Equation (22), it means that the synchronous error of the gantry robot will gradually converge to zero. Figure 9 shows the experimental system of the gantry robot control system in this study. In the experimental system, the single axis controller and the proposed FNN online compensator for MRAC are implemented in the PC. In this study, a 1 msec sampling rate is adopted for the encoder interface and the execution of the control algorithm. For comparison, the results of experiments for lowfrequency (1/5 Hz) and high-frequency (2/3 Hz) sinusoid position commands with the same strokes ( ± 36.6 mm) are used to verify the synchronous control performance of cascade synchronous control, parallel synchronous control without a synchronous compensator and the proposed control methods in Figure 7. Here, we set the parameters of the In this study, a 1 msec sampling rate is adopted for the encoder interface and the execution of the control algorithm. For comparison, the results of experiments for low-frequency (1/5 Hz) and high-frequency (2/3 Hz) sinusoid position commands with the same strokes (±36.6 mm) are used to verify the synchronous control performance of cascade synchronous control, parallel synchronous control without a synchronous compensator and the proposed control methods in Figure 7. Here, we set the parameters of the proposed FNN compensator as w 3 k = 1 and M = 3, which means that the linguistic layer has 6 nodes, and the rule layer has 9 nodes. Furthermore, the learning rate η w is designed to 0.001 to let the convergence of Equation (21) can be guaranteed. To provide an overall evaluation, two performance indices, the sum of absolute synchronous error and root mean square synchronous error, are defined as

Experimental Results
(23) Figure 10 shows the synchronous error of the cascade synchronous control method, shown in Figure 1a, by feeding the low-frequency command (1/5 Hz). The maximum synchronous error is approximately ±0.92 mm even when the federate is low. In this method, the control efforts, depicted in Figure 11, indicate that they are not consistent in the phase and magnitude due to the servo lag between the master and slave axes and that the effect will yield a large synchronous error. Hence, this method is not suitable for gantry robot synchronous control. In the following discussion, the performance of the two proposed methods will be compared under different conditions: (1) without compensation; (2) with FNN compensation; and (3) with FNN and MRAC compensation.  Figure 10 shows the synchronous error of the cascade synchronous control method, shown in Figure 1a, by feeding the low-frequency command (1/5 Hz). The maximum synchronous error is approximately ± 0.92 mm even when the federate is low. In this method, the control efforts, depicted in Figure 11, indicate that they are not consistent in the phase and magnitude due to the servo lag between the master and slave axes and that the effect will yield a large synchronous error. Hence, this method is not suitable for gantry robot synchronous control. In the following discussion, the performance of the two proposed methods will be compared under different conditions: (1) without compensation; (2) with FNN compensation; and (3) with FNN and MRAC compensation.

Parallel Synchronous Control
There are two kinds of position commands mentioned above fed to the parallel synchronous control method to test the synchronous performance. For low-frequency commands, the synchronous error and cost function shown in Equation (14) are depicted in Figure 12a,b. Figure 13a,b shows the case of a high-frequency command. When a constant disturbance 0.02375 N-m is applied to Axis 2 during the period of 2 to 3 s and 1.2 to 1.6 s

Parallel Synchronous Control
There are two kinds of position commands mentioned above fed to the parallel synchronous control method to test the synchronous performance. For low-frequency commands, the synchronous error and cost function shown in Equation (14) are depicted in Figure 12a,b. Figure 13a,b shows the case of a high-frequency command. When a constant disturbance 0.02375 N-m is applied to Axis 2 during the period of 2 to 3 s and 1.2 to 1.6 s corresponding to low-and high-frequency commands, respectively, and the synchronous errors will be magnified without a compensator. Figure 14a,b shows the synchronous errors with respect to low-and high-frequency commands. In contrast, these figures also show that the synchronous errors will be suppressed to be similar to the condition without disturbances by synchronous compensators. The detailed results of the two performance indices in Equation (20) are shown in Tables 2 and 3. The sampling points between the dotted lines shown in Figure 14a,b, where disturbances are applied, are calculated in the case of "with disturbances". corresponding to low-and high-frequency commands, respectively, and the synchronous errors will be magnified without a compensator. Figure 14a,b shows the synchronous errors with respect to low-and high-frequency commands. In contrast, these figures also show that the synchronous errors will be suppressed to be similar to the condition without disturbances by synchronous compensators. The detailed results of the two performance indices in Equation (20) are shown in Tables 2 and 3. The sampling points between the dotted lines shown in Figure 14a,b, where disturbances are applied, are calculated in the case of "with disturbances".

Parallel Master-Slave Synchronous Control
There are also two kinds of position commands mentioned above fed to the parallel master-slave synchronous control method to test the synchronous performance. For lowfrequency commands, the synchronous error and cost function shown in Equation (14) are depicted in Figure 15a,b. Figure 16a,b shows the case of a high-frequency command. When a constant disturbance 0.02375 N-m is applied to Axis 2 during 2 to 3 s and 1.2 to 1.6 s corresponding to low-and high-frequency commands, respectively, and the synchronous errors will be magnified without a compensator. Figure 17a,b shows the synchronous errors with respect to low-and high-frequency commands. In contrast, these figures also show that the synchronous errors will be suppressed to be similar to the condition without disturbances by synchronous compensators. The detailed results of the two performance indices in Equation (23) are shown in Tables 4 and 5. The sampling points between the dotted lines shown in Figure 17a,b, where the disturbances are applied, are calculated in the case of "with disturbances".        In addition, we use the parameter settings of [34] to realize the performance of the PID compensator, as shown in Figure 18. The synchronous errors under different control schemes are shown in Table 6. In addition, we use the parameter settings of [34] to realize the performance of the PID compensator, as shown in Figure 18. The synchronous errors under different control schemes are shown in Table 6.

Conclusions
This paper has proposed MRAC controllers and FNN online compensators for a gantry robot. We successfully completed the theoretical and technical feasibility of the proposed method through various experimental comparisons. From Tables 2-5, we demonstrate the advantages of our proposed method (FNN + MRAC) for the synchronous errors and the design can enhance robustness to uncertainty. In addition, this study also successfully integrates the hardware and successfully verifies the proposed methods. For the future research direction, because this paper does not analyze and deal with the influence of friction, the analysis and compensation of friction will be the future development direction. Data Availability Statement: Not applicable.

Conflicts of Interest:
The author declares no conflict of interest.

Appendix A
According to the development in [30], the continuous Lyapunov function is selected as where the α i , β i are arbitrary positive constants and . e = −(B n /J n )e + 3 ∑ i=1 x i g i . For more parameter description, please see [35]. Reference [30] has shown that the purpose of the terms β i eg i (i = 1, 2, 3) in Equation (A1) will make the adaptive process converge faster. Therefore, the time derivative of Equation (A1) can be calculated and finally obtained as follows then, .
x i is designed as , so that Equation (A2) is negative definite and the response of the plant is consistent with the reference model. Therefore, Equation (A3) can be obtained as follows which is negative definite for all e. We divide both sides of the adaptive law .