#### Abstract

A novel Fuzzy PID-Variable Structure Adaptive Control is proposed for position tracking of Permanent Magnet Synchronous Motor which will be used in electric extremity exoskeleton robot. This novel control method introduces sliding mode variable structure control on the basis of traditional PID control. The variable structure term is designed according to the sliding mode surface which is designed by system state equation, so it could compensate for the disturbance and uncertainty. Considering the chattering of sliding mode system, the fuzzy inference method is adopted to adjust the parameters of PID adaptively in real time online, which can attenuate chattering and improve control precision and dynamic performance of system correspondingly. In addition, compared with the traditional sliding mode control, this method takes the fuzzy PID control item to replace the equivalent control item of sliding mode variable structure control, which could avoid the control performance reduction resulted from modeling error and parameter error of system. It is proved that this algorithm can converge to the sliding surface and guarantee the stability of system by Lyapunov function. Simulation results show that Fuzzy PID-Variable Structure Adaptive Control enjoys better control precision and dynamic performance compared with traditional control method, and it improves the robustness of system significantly. Finally, the effectiveness and practicability of the algorithm are verified by the method of Rapid Control Prototyping on the semiphysical simulation test bench.

#### 1. Introduction

Lower extremity exoskeleton system is a kind intelligent assist robot, which is wearable, combines the operator with machine, and could be used in medical and military fields wildly [1–3]. Accurate and fast trajectory tracking is one of the core issues of extremity exoskeleton robot [4, 5]. Therefore, the high precision control of the extremity exoskeleton robot driven by Permanent Magnet Synchronous Motor (PMSM) is one of the core problems of robot control. Conventional PID control which has weak robustness is incapable of dealing with nonlinear control, although it has the advantage of simple structure and easy implementation. PMSM is a multivariable and strongly coupled nonlinear system, thus having many factors in its control system, such as current coupling, system saturation, parameter perturbation, and external disturbance, which affect the performance of system directly [6]. Therefore, designing a control method with strong robustness, good dynamic performance, high control precision, and easy engineering implementation is the focus of research.

Sliding Mode Cotrol (SMC) is widely used as a nonlinear control method currently. By designing the sliding mode surface reasonably, the control performance of system will not be affected by internal parameter perturbation and external disturbance, and the system will have strong robustness and high control precision. However, the equivalent control term of sliding mode control depends on the accuracy of system model and parameters, while in practical application, only an approximate mathematical model of motor can be obtained. And there are still some uncertain factors, such as parameter error and external interference, which will reduce the performance of the sliding mode control and even cause the instability of system [7]. To solve the problem that SMC cannot obtain the accurate model and parameters of system, some intelligent methods are introduced to compensate the equivalent control item. Reference [8] introduced neural network into the variable structure control to compensate for the lack of accurate system models and parameters and proposed a neural network controller online training method which was applied to the speed loop of electric drive and improved the adaptability and robustness greatly based on variable structure control. An adaptive fuzzy sliding mode control strategy was designed to compensate for the influence of nonlinear, disturbances, and uncertain parameters in asymmetric hydraulic cylinder position servo control system in [9]. In this paper, the uncertain factors of the models and parameters were treated as interference. In [10], by using the linear feedback RBF, the sliding mode controller was compensated, and the control effect was further improved. Reference [11] proposed a method that achieved good results combining fast terminal sliding mode (FTSM) with radial basis function (RBF), which was applied to the vector control of PMSM. The method of combining neural network control and sliding mode variable structure control was proposed in [12, 13] with the main idea of meeting the sliding mode condition by adjusting the gain coefficient of control law online. Simply introducing the intelligent control method will make the controller structure complicated, increase the cost of controlling, and reduce the usability of control system. An ideal controller is designed to strive to reach an optimal tradeoff between performance and complexity.

As is known, PID control is a simple, easy to implement, and widely used control method. In the face of the traditional SMC the accurate models and parameters of system cannot be obtained. It is natural to think of the combination of sliding mode variable structure control and PID control. In the design of sliding surface, the integral term was introduced to form a sliding surface which was similar to PID structure in [14]. Two novel methods, integral approach law and PID-like approach law, were proposed in [15], to control Electro-Hydraulic Actuator (EHA). Among these control methods, PID control was only introduced to design sliding surface; however, the controller also consists of equivalent control item based on mode of system. In [16], PID control and sliding mode variable structure control were combined to be variable structure PID control (VSPID). PID control was introduced to replace the variable structure coefficient in SMC, so that the VSPID became a strict nonlinear controller. However, there was a risk that only nonlinear control cannot guarantee the optimal performance of the system. A similar approach was proposed in [17], and due to the use of PID control instead of the variable structure factor, it is still a switch value control.

Since the variable structure control is introduced in the design of controller in this paper, the chattering caused by variable structure control must be considered. References [18, 19] put forward an adaptive fuzzy sliding mode controller, which realized the self-adaption of variable structure parameters and attenuated the chattering caused by sliding mode control. Reference [20] proposed a method of fuzzy reaching law for robot control system, which greatly attenuated the chattering of traditional sliding mode system and made the system achieve better control performance. In order to give full play to the performance of the variable structure control item, the fuzzy inference method is introduced to attenuate the chattering of the system by adaptively modifying the parameters of PID. Since fuzzy PID control is a mature control method applied in engineering, it does not make the control structure too complex.

In this paper, the Fuzzy PID-Variable Structure Adaptive Control, which is mutual compensation of sliding mode variable structure control and fuzzy PID control, is proposed for trajectory tracking of PMSM used in extremity exoskeleton system. Firstly, this algorithm ensures stability of system by PID control instead of equivalent control. Then, a sliding mode surface based on state equation of system is designed for sliding mode variable structure control which compensates for insensitivity of PID control to parameter perturbations and external disturbances. Finally, the fuzzy reasoning method is added to adjust the parameters of PID adaptively online in real time, which improves robustness of system again and attenuates chattering of sliding mode system as well.

#### 2. Mathematical Model of PMSM

The mathematical model of PMSM in the rotating shaft (, ) is

where and are voltage component of d axis and q axis of the stator, respectively , and are current component of d axis and q axis of the stator, respectively , is the resistance of stator winding , is electronic flux linkage, is the inductance of motor, is friction coefficient proportional to rotational speed, is load torque , is moment of inertia , is mechanical angle position of motor rotor , and is mechanical angle velocity of motor rotor .

PMSM servo system is a three-closed-loop control system based on flux orientation, including position control loop, speed control loop, and current control loop. The three-closed-loop control of PMSM is shown in Figure 1 while . Besides PMSM, the system also includes a SVPWM inverter, a power rectifier, a position sensor, a current controller (ACR), a speed controller (ASR), and a position controller (APR). The position controller (APR) is our focus; meanwhile the speed controller (ASR) and the position controller (APR) are designed based on the traditional PID algorithm.

In order to design the position loop controller conveniently, it is assumed that the speed control loop, the current control loop, and the inverter are ideal. Therefore, the mathematical model of the PMSM can be simplified as a second-order differential link [21] as

It can be also expressed as

Let , , , and .

Then (3) can be simplified as

where represents the control input parameter.

The control target of the PMSM position loop is to enable the output to track the reference value quickly and accurately. Let , ; then the state equation of the PMSM can be expressed as

#### 3. Design of Fuzzy PID-Variable Structure Adaptive Controller

##### 3.1. Design of Fuzzy PID Controller

The fuzzy PID controller is designed as a system with two-dimensional input and three-dimensional output. The inputs are the error and the error change rate of system. The output (, , and ) is parameters compensation of PID controller. The PID parameters in practical applications can be expressed as

where , , and are the preset parameter values of PID controller.

The control principle of fuzzy PID control is shown in Figure 2.

The core of fuzzy PID is the design of fuzzy inference rules. Firstly, fuzzify the input variables and by membership function, and then the inference is carried out according to predefined fuzzy rules. Finally, the barycenter method is used to defuzzify the reasoning results to achieve dynamic real-time update of PID parameters.

The fuzzy subset of two-dimensional input variables and three-dimensional output variables is defined as

The same membership function is applied to the input variables and the output variables for real-time calculation and online adjustment. The membership functions and adopt Gaussian distribution function, while the rest adopt triangular distribution function [22], as is shown in Figure 3.

The fuzzy rules of , , and are shown in Table 1, where the first column is the fuzzy rules of , the second column is the fuzzy rules of , and the third column is the fuzzy rules of . 49 fuzzy control rules can be obtained from Table 1, which will be adopted for fuzzy controller designing.

The process of adaptively adjusting PID parameters should follow the following principles:(1): When is a positive and larger value, is positive, that is, to increase . However, when is negative and its absolute value is increasing, the system is in overshoot state, so should be reduced. When is near zero, if is negative, the system overshoot will become larger and larger, so should be reduced; if is positive, in order to reduce the deviation, should be positive.(2): Following the principle of integral separation, its regulation is similar to that of , but the situation of integral saturation should be prevented, for fear of system overshoot. If increases, should be reduced accordingly.(3): When is positive and increasing, increasing may cause differential spillover. Therefore, if the larger is taken, the smaller should be taken.

Finally, the fuzzy quantity of the output variable is defuzzified as the output of the controller by barycenter method as

where is the ith element of and is the membership function of A on .

Then, the output of Fuzzy PID controller can be expressed aswhere , , and .

##### 3.2. Design of Sliding Mode Variable Structure Controller

According to state equations (5), the sliding mode surface is defined aswhere* c* is a positive constant.

can be obtained according to the condition that the system maintains the motion on the sliding surface. That is, where is the desired trajectory.

From (4), (10), and (11), we have

From (12), it can be seen that the result of equivalent control quantity includes , , and . and are determined by the system parameters and . is determined by the system parameters and . It can be inferred that the equivalent control amount will be changed with system parameter perturbation and load disturbance, and then the input will make the moving point away from the sliding surface, which will even lead to negative effect on servo system.

The switch item should be designed as

where is the variable structure gain; is the sliding mode surface; and is the sign function.

##### 3.3. Design of Fuzzy PID-Variable Structure Adaptive Controller

Considering that the equivalent control item in SMC will affect the servo control performance due to modeling error and inaccurate parameters of system, the effect of the equivalent control item in SMC is compensated by PID control item, and then the effect of the nonlinear is compensated by the variable structure control item. Meanwhile, the fuzzy inference method is used to adjust the parameters of PID in real time online, which can attenuate chattering. The fuzzy PID controller can ensure the stability of system, limit the error to a narrow range, and attenuate the chattering of SMC as well. On the other hand, the variable structure control item is used to compensate the effect of nonlinear, which can suppress the effect of parameter perturbation and load disturbance. The schematic diagram of Fuzzy PID-Variable Structure Adaptive Control is shown in Figure 4.

The output of Fuzzy PID-Variable Structure Adaptive Controller iswhere is the sliding mode surface, is the approximate linear control item, and is the nonlinear control item.

#### 4. Proof of Stability

The controller designed by (14) is used to control PMSM position loop described in (4) and (5). If the control parameters are selected according to the constraints of (15), the system state can converge to the sliding surface and ensure global stability of the system.

where , , , and are the upper bounds of given position target , derivative of given position target , the second derivative of given position target , and load disturbance d, respectively, and is the parameter of positive definite matrix defined later. It can be also expressed aswhere is the Euclidean norm.

In the actual control system, the position target input of the system is bounded, and the perturbation of system parameters and the disturbance of external load will change within a certain range. Thus the assumption in (16) is reasonable in the actual control system.

For* n*-dimensional system the sliding surface can be expressed as

The control item in (13) can be expressed as

To construct a control matrix for an -dimensional system reasonably, set

Construct a positive definite Lyapunov function as

In order to guarantee the positive definiteness of the Lyapunov function (21), the definition of the symmetry matrix iswhere , , and satisfy the following relationship:

Differentiating , we obtain

From (4), (5), (11), and (14), (25) can be obtained:

In the process of stability analysis, as there is no integral term in the design of sliding mode surface, the integral term in fuzzy PID can be ignored. Then (26) can be obtained:

Substituting (26) into (24), the following equation can be obtained:

Because of (23), we can obtain

Combining (16), then (28) can be expressed as

It can be deduced that is a negative definite matrix when (15) is satisfied. According to Lyapunov's second method, it can be concluded that the system is globally stable based on Fuzzy PID-Variable Structure Adaptive Control.

#### 5. Simulation Verification

The model of the position-speed-current three-closed-loop control system for PMSM vector control is built based on Matlab/Simulink. The speed loop and the current loop adopt the conventional PID control while the position loop adopts the Fuzzy PID-Variable Structure Adaptive Control which is introduced in this paper. The simulation model is shown in Figure 5.

The parameters of the simulation model are shown in Table 2.

Figures 6–10 show the step response. The input reference position is a step signal of , and the load disturbance of is added at . The simulation results are compared with conventional PID control and fuzzy PID control.

From Figure 6, it can be seen that all the three control algorithms can obtain better results based on the condition that the parameters of the control system are appropriate. However, it can be seen from the details that compared with PID control and fuzzy PID control, the Fuzzy PID-Variable Structure Adaptive Control can accelerate system convergence, reduce system response time, and obtain better dynamic performance and robustness. Especially after adding load disturbances, the Fuzzy PID-Variable Structure Adaptive Control responds fastest and converges to the reference position in the shortest time. In addition, the simulation results show that the chattering of variable structure control is attenuated obviously due to the adaptive adjustment of PID control parameters online. Figure 11 is the speed curve (after a low-pass filter) of PMSM controlled by Fuzzy PID-Variable Structure Adaptive Controller. Figure 12 shows the current curve (after a low-pass filter) of the axis (the deceleration ratio of 50 is considered).

Figures 13–15 show the sinusoidal response. The input reference position of system is a sinusoidal signal (amplitude: , frequency: ), and the load disturbance of is added at . Compared with Fuzzy PID-Variable Structure Adaptive Control, the other two algorithms exhibit phase lag. Especially after adding load disturbance, PID control and fuzzy PID control exhibit a large static deviation. In addition, the simulation results show that the chattering of variable structure control is attenuated obviously due to the adaptive adjustment of PID control parameters online. Figure 16 is the speed curve (after a low-pass filter) of PMSM controlled by Fuzzy PID-Variable Structure Adaptive Controller. Figure 17 shows the current curve (after a low-pass filter) of the axis (the deceleration ratio of 50 is considered).

By analyzing the step response and sinusoidal response with load disturbance, the Fuzzy PID-Variable Structure Adaptive Control can improve the servo precision, the dynamic performance, and the robustness of system. At the same time, the chattering of variable structure control is also attenuated obviously because the PID parameters can be adjusted online adaptively by fuzzy inference.

#### 6. Experiment Verification

The Rapid Control Prototype (RCP) is a kind of semiphysical simulation. After the mathematical simulation of the system control model meets the desired effect, the control algorithm model of the servo system will be extracted individually. Then the Real-Time Driver (RTD) of actual controlled object, feedback original, and drive unit are added to the control algorithm, which will constitute a closed-loop system [23, 24]. Before the structure design and processing completion of extremity exoskeleton, the effectiveness of Fuzzy PID-Variable Structure Adaptive Control is verified on a semiphysical simulation test bench. The RCP model is shown in Figure 18.

The control system test bench is shown in Figure 19.

The control principle of test bench is shown in Figure 20.

##### 6.1. Static Testing

The step response performances of conventional PID control and Fuzzy PID-Variable Structure Adaptive Control are compared by a step signal. The step response testing is performed with a constant torque of 5Nm, and the step motion mode is a reciprocating motion with the range of 100° to 200°. The experimental results are shown in Figures 21–25; Figure 21 is the position tracking curve, Figure 22 is the position tracking error curve, and Figure 23 is the speed curve. Figure 24 is the original curve of torque sensor under Fuzzy PID-Variable Structure Adaptive Control (it is basically consistent with the curve of torque sensor under PID control), and Figure 25 is the curve of torque sensor after a low-pass filter.

It can be seen from Figures 21 and 22 that the positioning accuracy of conventional PID control and Fuzzy PID-Variable Structure Adaptive Control is almost the same. However, it is evident that the dynamic response of Fuzzy PID-Variable Structure Adaptive Control outperforms that of conventional PID control. Because of the unidirectional constant torque, the forward step response and reverse step response of the same control will be different. Through comparison, it is observed that the forward step response and reverse step response under Fuzzy PID-Variable Structure Adaptive Control are more consistent.

##### 6.2. Dynamic Testing

The dynamic response performances of conventional PID control and Fuzzy PID-Variable Structure Adaptive Control are compared by sinusoidal response by a sinusoidal signal (amplitude: 100°, frequency: 2Hz) with a constant torque of 5Nm. The experimental results are shown in Figures 26–30; Figure 26 is the position tracking curve, Figure 27 is the position tracking error curve, and Figure 28 is the speed curve. Figure 29 is the original curve of torque sensor under Fuzzy PID-Variable Structure Adaptive Control (it is basically consistent with the curve of torque sensor under PID control), and Figure 30 is the curve of torque sensor after a low-pass filter.

Both conventional PID control and Fuzzy PID-Variable Structure Adaptive Control achieve good performances under the proper parameter as shown Figure 26. Since the conventional PID control performances are good enough, the advantages of Fuzzy PID-Variable Structure Adaptive Control will be more persuasive when we illustrate the tracking errors in Figure 27. It is observed that the dynamic response of Fuzzy PID-Variable Structure Adaptive Control outperforms that of conventional PID control, especially at the near place of the position curve crossing time axis (at this time, the speed reaches the maximum.).

There is no obvious chattering in the response curve of static testing and dynamic testing under Fuzzy PID-Variable Structure Adaptive Control, which indicates that it is feasible to introduce fuzzy inference into PID control to attenuate chattering. Finally, we conclude the advantages of the proposed Fuzzy PID-Variable Structure Adaptive Control method as high precision, good robustness, and simplicity based on experiments.

#### 7. Conclusion

The Fuzzy PID-Variable Structure Adaptive Control algorithm for the position tracking control of PMSM which will be used in electric extremity exoskeleton robot is proposed. The controller consists of two parts which are mutual compensation: one is a nonlinear part (Variable structure control), and the other is an approximate linear part (fuzzy PID control). Variable structure control has high robustness. Fuzzy PID control is used to compensate the equivalent control item in SMC and attenuate chattering. The simulation results show that the algorithm can improve control accuracy, dynamic performance, and robustness. The chattering of sliding mode system is attenuated to some extent. At the same time, the Fuzzy PID-Variable Structure Adaptive Control algorithm has the advantages of simple structure and easy engineering realization as well. Finally, the effectiveness and practicability of the algorithm are verified based on a semiphysical simulation test bench with the method of RCP.

Undoubtedly, the control algorithm proposed in this paper as the lower level control method can be applied in our designed electric exoskeleton successfully. And it is also the foundation and origin of designing the higher level control method in our later works on this electric extremity exoskeleton.

#### Data Availability

The simulation and experimental data used to support the findings of this study are available from the corresponding author upon request.

#### Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

#### Acknowledgments

This work was supported by the Chinese National Science Foundation (no. 51075017).