## 4 Simulations and Experiments Results and Discussion
### Experiments Results and Discussion  
The symbolic function in the variable structure control expressed by Equation (38) is replaced by the saturation function to design quasi-sliding mode controller for reducing the chattering which is  
Figure 8: Real-Time Workshop (RT W) xPC target real-time control platform principle diagram.  
Figure 9: The display of the RTW real-time experiment platform.  
brought naturally by the sliding mode variable structure control in the experimental system. The new control law is expressed as:  
\[\mathbf{u}=\mathbf{C}\dot{\mathbf{e}}+\mathbf{\bar{q}_{d}}+\epsilon sat(\mathbf{ S})+\mathbf{K}\mathbf{S} \tag{43}\]  
with  
\[sat(s)=\left\{\begin{array}{ll}1&s>\Delta\\ ks&|s|\leq\Delta\\ -1&s<-\Delta\end{array}\right.\quad k=\frac{1}{\Delta} \tag{44}\]  
where \(\Delta\) is the boundary layer, and \(\Delta=0.05\).  
Experiments are carried out with the PID and the SMC controller respectively by applying a five-degree step input and a sinusoid input \(r=5\sin(0.5\pi t)\) to both of the Joints 1 and 2 in the same time. Figures 10 and 11 show the step responses of the Joints 1 and 2, respectively. Figures 12 and 13 show the sinusoid responses of the Joints 1 and 2, respectively.  
For step input, as shown in Figures 10a and 11a, the adjusting times of both joints with the proposed SMC and the PID controller are almost the same. However, the position steady state error of each joint with the SMC is far less than that with the PID controller, which is similar to the simulation results. As shown in Figure 10c,d, and Figure 11c,d, the tracking errors produced by the PID controller has higher oscillation amplitude than that by the SMC. This means that the SMC is more robust and accurate than the PID. As show in Figures 10b and 11b, both of the phase trajectories of the SMC converge to stable limit cycles, this implicates that the system yields bounded stability based on sliding mode variable structure control. In order to accelerate the trajectory reaching to the sliding mode surface and improve the system dynamic quality during the experiment, the values of the parameter **C** of the switch function and the proportional gain **K** are set bigger. This causes in initial response that the phase trajectory generates obvious chatter along the sliding mode surface.  
Figure 12: Experiment of sinusoidal response of Joint 1: (**a**) Position tracking; (**b**) Phases trajectory diagram of SMC; (**c**) Tracking error of PID; and (**d**) Tracking error of SMC.  
Figure 13: Experiment of sinusoidal response of Joint 2: (**a**) Position tracking; (**b**) Phases trajectory diagram of SMC; (**c**) Tracking error of PID; and (**d**) Tracking error of SMC.  
For sinusoid input, as show in Figures 12 and 13, the position tracking experiment results of both of the Joints 1 and 2 with PID controller have obvious lag in contrast to that with the SMC, which suggests that the system with the SMC has higher tracking accuracy than that with the PID controller.  
As shown in Figures 12b and 13b, both of the phase trajectories converge to limit cycles around the equilibrium point, this implicates that the system based on the SMC gains bounded stability and has certain steady state errors. For the reason, the \(x\)-axis and \(y\)-axis have different coordinate ranges, both of the limit cycles look tabular. Actually, if the \(x\)-axis and \(y\)-axis have the same ranges, both of the limit cycles will appear more slim, which implicates that the speed errors are larger than the position errors.