## 3 Sliding Mode Controller Design
### Sliding Mode Control Based on Model  
Utilizing controller decomposition, a dynamic control law combining the linearized feedback of joints' parameters and servo compensator is investigated. The feedback linearization method which is often called computed torque method is a kind of design method based on system dynamical model. Define the driving torque as Equation (29). \[\mathbf{\tau}=\mathbf{\alpha}\mathbf{u}+\mathbf{\beta} \tag{29}\]  
with  
\[\mathbf{\alpha}=\mathbf{D}(\mathbf{\Theta}) \tag{30}\]  
where \(\mathbf{u}\) denotes control quality. Substituting Equations (29) and (30) into Equation (26), we can obtain that:  
\[\ddot{\mathbf{\Theta}}=\mathbf{u} \tag{31}\]  
A sliding mode control based on reaching law is designed according to the dynamical model. The switch function is taken as:  
\[\mathbf{S}\ =\ \mathbf{Ce}\ +\ \dot{\mathbf{e}} \tag{32}\]  
where \(\mathbf{C}=\mathrm{diag}(c_{1},\ c_{2})\), \(c_{1}\ >\ 0\), \(c_{2}\ >\ 0\), and \(\mathbf{e}=\mathrm{diag}(e_{1},\ e_{2})\) is the position tracking error matrix, \(e_{1}\) and \(e_{2}\) are the tracking error of the joints 1 and 2, respectively. Because \(\mathbf{S}=\mathbf{0}\) denotes the sliding mode surface and the state of the phase trajectory moving along the sliding mode surface, only \(\mathbf{S}\
eq\mathbf{0}\) is considered. To demonstrate the stability of the designed controller, a Liapunov's function is made as:  
\[\mathbf{V}=\frac{\mathbf{1}}{\mathbf{2}}\mathbf{S}^{\mathbf{T}}\mathbf{S}> \mathbf{0}. \tag{33}\]  
The first-order derivative of Equation (32) is calculated as:  
\[\dot{\mathbf{V}}=\mathbf{S}^{\mathbf{T}}\dot{\mathbf{S}}. \tag{34}\]  
Using switch law can ensure the dynamic quality of the phase trajectory during reaching segment by designing the change rate function of the switch function of reaching segment. This method makes the system reach the sliding surface quickly according to the dynamical characteristic of the change rate function \(\dot{\mathbf{s}}\). The constant plus exponential rate reaching law combines the advantages of both constant rate reaching law and exponential rate reaching law and has good dynamic characteristics that make the system reach the sliding surface quickly and eliminate system chattering effectively. The constant plus exponential rate reaching law is expressed as [21]:  
\[\dot{\mathbf{S}}=-\ \epsilon\mathrm{sgn}(\mathbf{S})-\mathbf{K}\mathbf{S} \tag{35}\]  
with  
\[\mathbf{\varepsilon}\ =\ \mathrm{diag}(\varepsilon_{1},\ \varepsilon_{2}),\ \varepsilon_{1}\ >\ 0,\ \varepsilon_{2}\ >\ 0 \tag{36}\]  
\[\mathbf{K}\ =\ \mathrm{diag}(k_{1},\ k_{2}),\ k_{1}\ >\ 0,\ k_{2}\ >\ 0.\]  
By derivation of Equation (32) and then substituting Equation (31) into it, the change rate function can be acquired as:  
\[\dot{\mathbf{S}}=\mathbf{C}\dot{\mathbf{e}}+\ddot{\mathbf{\Theta}}_{\mathbf{d}}- \mathbf{u}. \tag{37}\]By correlating Equations (35) and (37), the controlling quantity can be calculated as:  
\[\mathbf{\alpha}=\mathbf{D}(\mathbf{\Theta}) \tag{30}\]0  
Substituting Equations (32) and (35) into Equation (34), we can obtain that:  
\[\mathbf{\alpha}=\mathbf{D}(\mathbf{\Theta}) \tag{30}\]1  
Thus, the stability of the control law is verified. Through the aforementioned method of calculation, it is obvious that the control law expressed by Equation (38) is in accord with [PERSON] stability theorem. The control block diagram of the sliding mode variable structure control based on the model with friction compensation and gravity compensation is shown as \[\mathbf{\alpha}=\mathbf{D}(\mathbf{\Theta}) \tag{30}\]2 The output control quality \(\mathbf{u}\) of a servo compensator with the sliding mode variable structure acts as the input of the linearizing compensator. The final output torque \(\mathbf{\tau}\) of the controller can be deduced by substituting Equation (38) into Equation (29) as:  
\[\mathbf{\alpha}=\mathbf{D}(\mathbf{\Theta}) \tag{30}\]3