# A Data-Driven Approach of Takagi-Sugeno Fuzzy Control of Unknown Nonlinear Systems
## 5 Application Example
\right], \tag{21}\]  
Figure 3: The two-link flexible-joint robot manipulator: physical photograph (left), top-view schematic diagram (right). where \(c_{i}\) is the viscous friction coefficients. The vector of Coulombic friction is given by  
\[\mathbf{D}\Big{(}\dot{\mathbf{\theta}}\Big{)}=\left[ \begin{array}{c}d_{1} \text{sign}\Big{(}\dot{\theta}_{1}\Big{)}\\ d_{2}\text{sign}\Big{(}\dot{\theta}_{2}\Big{)}\\ d_{3}\text{sign}\Big{(}\dot{\theta}_{3}\Big{)}\\ d_{4}\text{sign}\Big{(}\dot{\theta}_{4}\Big{)}\end{array} \right], \tag{22}\]  
where \(d_{i}\) is the friction torque at each joint. The matrix of stiffness coefficients is given by  
\[\mathbf{K}=\left[ \begin{array}{ccc}k_{5}&-\frac{k_{5}}{r}&\\ &k_{6}&-\frac{k_{6}}{r}\\ -\frac{k_{6}}{r}&\frac{k_{5}}{r^{2}}&\\ &-\frac{k_{6}}{r}&\frac{k_{6}}{r^{2}}\end{array} \right], \tag{23}\]  
where \(k_{i}\) denotes the coefficients of the torsional springs at the flexible joints. The torque vector is  
\[\mathbf{T}=\left[ \begin{array}{ccc}0&0&T_{1}&T_{2}\end{array} \right]^{T}. \tag{24}\]  
Table 1 lists the estimated values of the robot's physical parameters. However, deriving the mathematical model and obtaining an accurate estimation of each parameter is quite difficult and time-consuming. The purpose of this paper is to develop a methodology of T-S model construction and controller design when the analytical mathematical model detailed above is not available. Hence, the Equations (18)-(24) and the parameters in Table 1 are only used to validate the fuzzy controller via simulation. In experiments, four encoders are mounted to measure the four arm and motor angles, and the angular velocities and accelerations are obtained from the angular position signals by the central finite difference method:  
\[\dot{\theta}_{i}=\frac{\theta_{i}[k+1]-\theta_{i}[k]}{\Delta T}\quad\ddot{ \theta}_{i}=\frac{\theta_{i}[k+1]-2\theta_{i}[k]+\theta_{i}[k-1]}{\Delta T^{2} }\enspace, \tag{25}\]  
where \(\theta_{i}[k]\), \(k=1\), \(2\), \(\cdots\) are the values of discrete angular position measurements and \(\Delta T=0.001\) s is the sampling time. To reduce noises in the velocity and acceleration signals that mainly originate from the quantization of the position signal, a zero-phase low-pass Butterworth filter with 150 Hz cutoff frequency was applied to the position signals. To avoid the transient effect from filtering in both directions when initializing the filter states, experiments were started with a 0.5 s rest period. This period and the last 0.5 s of the experiment were removed from the data set. To obtain the neuro-fuzzy model of the robot, the motors were excited by sine sweep torques. A combination of a 5-s 1 Hz sine wave and a subsequent 5-s sine sweep signal with an initial frequency of 1 Hz and a final frequency of 5 Hz was used to excite the \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline \(p_{1}\) & 0.1402 kgm\({}^{2}\)/rad & \(c_{4}\) & 1.4975 \(\times\) 10\({}^{-3}\) Nms/rad \\ \(m_{2}a_{2}^{2}+J_{2}\) & 0.01962 kgm\({}^{2}\)/rad & \(c_{5}\) & 0.005 Nms/rad \\ \(l_{1}m_{2}a_{2}\) & 0.02338 kgm\({}^{2}\)/rad & \(c_{6}\) & 8.128 \(\times\) 10\({}^{-3}\) Nms/rad \\ \(l_{3}\) & 4.1751 \(\times\) 10\({}^{-3}\) kgm\({}^{2}\)/rad & \(k_{5}\) & 2.848 Nms/rad \\ \(l_{4}\) & 7.5429 \(\times\) 10\({}^{-4}\) kgm\({}^{2}\)/rad & \(k_{6}\) & 2.848 Nms/rad \\ \(l_{5}\) & 0.025 kgm\({}^{2}\)/rad & \(d_{1}\) & 0.01987 Nm \\ \(l_{6}\) & 0.025 kgm\({}^{2}\)/rad & \(d_{2}\) & 0.0323 Nm \\ \(c_{1}\) & 0.04 Nms/rad & \(d_{3}\) & 0.0053 Nm \\ \(c_{2}\) & 0.02143 Nms/rad & \(d_{4}\) & 0.0271 Nm \\ \(c_{3}\) & 1.8937 \(\times\) 10\({}^{-4}\) Nms/rad & \(r\) & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Estimated Values of the Robot’s Physical Parameters [31]. shoulder motor and elbow motor, as shown in Figure 4. Then, 2000 training data are evenly drawn from the collected input-output pairs and used to train the neuro-fuzzy model.