## 3 Sliding Mode Controller Design
### Nonlinear Integration Chain Tracking-Differentiator  
In order to realize the control law expressed by Equation (38), the position error change ratio of the joints, the speed error, and the acceleration of the joints must be known. In general, the photoelectrical encoders installed in the joints are displacement sensor. Theoretically, the speed signal can be obtained only by taking the first-order derivative of the displacement signal, and the acceleration signal by the second-order derivative. But only the signal expressed by analytic formula can be used for mathematically calculating its first or higher orders derivatives. The signal measured by sensor cannot be mathematically taking the derivatives because it has no analytic formula. In engineering, difference method is often used to approximate the derivatives of signal. Because the signal measured by sensor usually contains disturbances which will be further amplified after difference, the approximated first derivative signal usually intermingles with strong disturbances, and the approximated second derivative signal even can be submerged by disturbances. Much of the disturbances can be eliminated with digital filter such as Butterworth, Chebyshev, and Bessel et al. after difference, but this method unfortunately has obvious drawbacks such as time delay and nonlinear phase shift which will impact the control accuracy and even bring up system distortion or disability. The optimal estimation of the system state can be obtained from the observation equations using Kalman filter or other state observation methods such as time delay system observer [22], discrete-time system observer [23], sliding mode observer [24], and so on, but the observation equations are based on the object model, which limits its application. Extracting the derivatives of real-time signals is a common problem.  
Figure 3: The sliding mode variable structure control block diagram.  
For the signals that are encountered in practical applications, developing the differentiator to take derivative is a realistic option [25]. The general structure of the differentiator is expressed as:  
\[\left\{\begin{array}{l}\dot{x}_{1}=x_{2}\\ \dot{x}_{2}=f(x_{1}-v(t),x_{2})\end{array}\right.. \tag{41}\]  
Under the condition of existence of the solution of Equation (41), make \(x_{1}\) converges to input signal \(v(t)\) and \(x_{2}\) converges to desired derivative \(\dot{v}(t)\).  
To solve the engineering questions, researchers proposed many practical differentiators such as linear high gain differentiator [26], sliding mode differentiator [27], hybrid differentiator [28], nonlinear integration chain differentiator [29], and so on. Adopted in this experiment is a third-order nonlinear integration chain differentiator which has multiple integration structure and high disturbance suppression performance and its form is expressed as Equation (42) [30].  
\[\left\{\begin{array}{l}\dot{x}_{1}=x_{2}\\ \dot{x}_{2}=x_{3}\\ \dot{x}_{3}=-\dfrac{1}{\varepsilon^{3}}\Big{[}a_{1}sig(x_{1}-v(t))^{\alpha_{ 1}}+a_{2}sig\big{(}\varepsilon^{1}x_{2}\big{)}^{\alpha_{2}}+a_{3}sig\big{(} \varepsilon^{2}x_{3}\big{)}^{\alpha_{3}}\Big{]}\end{array}\right. \tag{42}\]  
where \(x\ =\ \Big{[}\ x_{1}\ \ \ x_{2}\ \ \ x_{3}\ \Big{]}^{T}\) are the system state variables, and \(sig(x)\alpha=|x|^{\alpha}\text{sgn}(x)\). In the following experiments, \(x_{1}\), \(x_{2}\), and \(x_{3}\) correspond to joint positions, velocities, and accelerations, respectively.  
In the simulink model of the designed third-order nonlinear integration chain differentiator expressed by Equation (42), the parameters are set as \(a_{1}=10\), \(a_{2}=10\), \(a_{3}=10\), \(\alpha_{1}=1\), \(\alpha_{2}=1\), \(\alpha_{3}=1\), and \(\varepsilon=0.01\). A first order low pass filter \(1/(0.02s+1)\) is added after the second derivative output to eliminate the excessive amount of disturbances.