SVM Based Computed Torque for Robot Manipulator Control Foudil Abdessemed* and Yakoub Bazi** *Electronic Dpt., Batna University, Batna-05000- Algeria (e-mail:
[email protected],
[email protected]) **College of Engineering, Al Jouf University, P.O.Box 2048, Sakaka, Al Jouf, Kingdom of Saudi Arabia (e-mail:
[email protected]) Abstract: Because of t he strong need of finding easy and robust methods to control robots, many solutions has been proposed in the literature. The computed torque method is a well established robot control technique which takes account of the dynamic coupling between the robot links. However, its main disadvantage lies on the assumption of an exactly known dynamic model which is not realizable in practice. To overcome this issue, we propose in this paper to estimate the dynamics model of the nonlinear system with a machine learning regression method, namely support vector regressor. Then the output of this regressor is thereafter in conjunction with a PD controller to achieve the tracking trajectory task of a robot manipulator.
1. INTRODUCTION Over many years, the problem of controlling highly nonlinear systems received much attention within the control community especially fast manipulation control. Many papers have dealt with this problem and many approaches have been proposed. May be the most popular and famous technique is the computed torque control [1]. This technique offers a large variety of advantages. However, it requires a precise knowledge of the analytical model of the system in order to determine the feedforward torques required for the execution of the trajectory. Nevertheless the dynamics of robot manipulators are coupled and highly non linear. They contain uncertainties such as friction and unmodeled nonlinearities. This is why a precise model can not be obtained and this why many efforts have been made to developing control methods. Among these methods adaptive control has been investigated for at least one decade[2-6] to be followed by what is called intelligent control such as fuzzy control[7],[8] and neural network control [9]. The former is based on programming actions of human behavior, while the latter is based on unsnupervised/surpervised learning. Recently, Support vector machine (SVMs) have been introduced by Vapnik as an interesting alternative machine learning methods. They were originally designed for pattern recognition and classification tasks [10]. They have been successfully used in a huge variety of classification problems such as 3D object recognition [11], biomedical imaging [12],
image compression [13] and remote sensing [14]. Furthermore; they exhibited very interesting behaviors when they have been extended to solve regression and functions approximation problems. SVMs are based on the idea of structural risk minimization, which shows that the generalization error is bounded by the sum of the training error and a term depending on the Vapnik–Chervonenkis dimension. By minimizing this bound, high generalization capabilities can be achieved. In this paper, we propose to exploit support vector regression for designing an efficient adaptive computed torque control system. In this context, the output command fed to the robot manipulator is composed from two additive terms. The first is provided by an SVM regressor trained offline to estimate the inverse dynamics of the robot; whereas the second one is the standard PD controller. Experimental results obtained on a 2-D robot manipulator confirmed the promising capabilities of the proposed approach. 2. PROBLEM FORMULATION Dynamic Equations of a robot manipulator are found by the use of the Lagrangian formulation, the dynamic equation of an n-degree of freedom manipulator can be written as
τ = M (q)q + C (q, q )q + G (q) + F (q ) + d (t )
(1)
where q ∈ ℜ n is the generalized joint coordinate; M (q) ∈ ℜnxn is the symmetric positive definite inertia matrix, bounded as
mI ≤ M (q ) ≤ m( q ) I for some constant m and function m(q ) ; vector C (q, q )q ∈ ℜ
n
presents the centrifugal and Coriolis
torques and is bounded as C ( q, q )q ≤ a1 q ; G (q) ∈ ℜn and F (q ) ∈ ℜn are the vectors of gravitational torques and friction
not be modeled exactly. Instead of the analytical dynamics model, a kernel regressor is used to predict the feedforward torques and a servo feedback control scheme is involved to improve robustness. To be conform with the feedforward nonlinear control given in figure 1, we rewrite equation (1) as:
and are bounded as G (q ) + F ( q ) ≤ a2 + a3 q ; τ ∈ ℜn is the vector of applied joint torques; and d (t ) ∈ ℜ is the additive bounded disturbance vector presenting, torque disturbance and/or modeling error. It is assumed that the norm of d(t) is bounded as d (t ) ≤ d1 + d 2 q + d3 q , Where d1, d2 and d3 are n
positive constants and all unknowns. It is interesting to note that two different control approaches can be adopted, namely, the feedforward nonlinear control and the inverse dynamics control. Usually, the latter has shown to provide the best tracking performances. In this work, we shall consider the first approach.
-
+
u = M (q)q + V (q, q ) where:
V (q, q ) = C (q, q ) + G(q) + F (q ) + d (t )
qd
Dynamics Model
u = M (q d )qd + V (q d , q d ) + K p e + K v e
where q d , q d , qd denote the desired position, velocity and acceleration respectively. Now, if we replace in equation (4) the value of the control command given in (5), one obtains the following error equation
u
Robot
q q
(6)
The stability and the dynamics of the error is controlled by the parameters Kp and Kv. In case, we approximate the model using a regression technique, equation (5) is changed to
+
u = T (q d , q d , qd ) + K p e + K v e
Kv +
-
+
FEEDFORWARD NONLINEAR CONTROL
qd
Let us consider the robot dynamics given by equation (1). The objective in using the feedforward control is to eliminate the non linearity in the dynamics as shown in Figure 1. Computed torque control techniques are based on controller command regarding a priori knowledge about the system written in a dynamic model. Since the control objective is trajectory tracking in joint space, the desired trajectories are joint angles, velocities and accelerations. The tracking errors are defined as
e = q d - q , e = q d - q
(7)
Where T(.) is the approximate torque determined by an appropriate regressor. Actually, the feedforward nonlinear control based on SVM models will have the structure shown in Figure 2.
-
Fig. 1: Feedforward nonlinear control
3.
(5)
e + M −1 K v e + M −1 K p e = 0
+ +
(4)
V (q, q ) is a term that contains all the forces acting on the system.The Functions C, G, F and d are as defined above. Let us choose the control command u as [1]:
Kp qd q d
(3)
~ M
KP
+ +
+
+
q
d
q d
u
Robot
q q
+ KV
~ V +
-
(2)
Where measurements of q and q are required in the subsequent design. As mentioned previously, in this work, we are interested in robot manipulator control using the feedforward nonlinear control. In practice, robot dynamics can
Fig. 2: SVM based feedforward control 4. REGRESSION WITHnonlinear SVM The SVM regression technique is based on the idea to deduce an estimate gˆ [x] of the true and unknown relationship y = g [x] between the vector of observations x and the desired
biophysical parameter y from a given set of NT training samples (in our case NT will include labeled as well as semi-labeled samples such that gˆ [x] has first at most ε deviation from the desired targets yi (i=1,…, NT) and second, it is as smooth as possible [10]-[15]. This is usually performed by mapping the data from the original d-dimensional feature space to a higher dimensional transformed feature space, i.e., Φ(x) ∈ ℜd’ (d’ > d), in order to increase the flatness of the function, and accordingly to approximate it in a linear way as follows: (8) gˆ x = w* ⋅ Φ ( x) + b*
[ ]
The optimal linear function in the higher dimensional transformed feature space is the one which minimizes the following cost function: Ψ(w,ξ) =
N T 1 * 2 w + c ∑ (ξ + ξ ) 2 i i i =1
(9)
subject to the following constraints: ⎧ ⎪ yi -(w ⋅ Φ(xi ) + b) ≤ ε + ξi ⎪⎪ * ⎨(w ⋅ Φ(x ) + b)-yi ≤ ε + ξ , i= 1, 2, …, NT i i ⎪ ⎪ξ , ξ* ≥ 0 ⎪⎩ i i
(10)
Where the ξi and ξi* ’s are the so-called slack variables introduced to account for samples that do not lie in the εdeviation tube. Constant c represents a regularization parameter that allows tuning the tradeoff between the flatness of the function gˆ [x] and the tolerance of deviations larger than ε. The above optimization problem reformulated through a Lagrange functional into a dual optimization problem leads to a solution that is a function of the data conveniently expressed in the original dimensional feature space as: gˆ [x] =
∑ (α
i
- α *i )K(x i , x) + b *
(11)
i∈W
where K(⋅,⋅) is a kernel function. W is the subset of indices (i=1, 2, …, NT) corresponding to the non-zero Lagrange multipliers αi or αi* ’s. The training samples associated to non-zero weights are called support vectors. The kernel K(⋅,⋅) should be chosen such that it satisfies the condition imposed by the Mercer’s theorem [1]-[2]. Examples of common nonlinear kernels that fulfill Mercer’s condition are the polynomial and the Gaussian kernel functions. 5. COMPUTER SIMULATION AND COMPARISON For simulation and comparison, a simple two-link planar robot manipulator was used to analyze and test the performance of the proposed approach. The rigid manipulator was modeled as a two rigid links of lengths l1=0.432m and l2=.0432m with corresponding masses m1=15.91Kg and m2=11.36 Kg. The
simulation was carried out using the fourth order Runge-Kutta algorithm, with step equal to h=0.01. The objective is to track the desired joint trajectories chosen to be q1 = 1 + 2 ( sin t + sin 2t ) q2 = 2 + cos 4t + cos 6t
(12)
The desired joint, velocity and acceleration trajectories were used to generate the corresponding torques for every sampling time. These values are stored along the position, velocity and acceleration vectors in a Table to be used afterwards by the SVM regressor. Because of the good performances generally achieved by the nonlinear SVM regressor based on the Gaussian kernel [15], we adopted this kernel in all experiments. Accordingly, the vector θ of parameters is θ = [ c, γ ] where c is the regularization
parameter and γ is the width of the Gaussian kernel. During the training phase, the SVM regressor were selected according to a k-fold cross-validation (CV) procedure [14] first by randomly splitting the training data into k mutually exclusive subsets (folds) of equal size. Then we train k times an SVM classifier modeled with the predefined values of C and γ. Each time we left out one of the subsets from training, and used it (the omitted subset) only to obtain an estimate of the classification accuracy. From k times of training and mean square error computation, the average accuracy yielded a prediction of the regression accuracy of the considered SVM regressor. The best SVM classifier parameter values were chosen, to maximize such a prediction. It is interesting to note that, when k is equal to the number of samples, k-fold CV becomes a leave-one-out CV procedure. In this experiment, we used a 3-fold CV by varying the values of C and γ in the range [10-3; 1000] and [10-3; 10], respectively. The ε value of the intensive tube was fixed to 10-3. First the classical computed torque controller is implemented. The evolution of tracking errors and torques at each joint are presented in Fig. 3. We can see that the tracking performances are excellent since nonlinearities are cancelled. Beside we can compare the trajectory tracking obtained using the SVM regressor based computed torque which shows almost the same curves as it is depicted in Fig. 4. Now to see the tracking performance when a perturbation happens, simulations are carried out by suddenly doubling the mass of the second link at time 2sec In this case the tracking performance is relatively degraded for the computed torque method (see Fig. 5). But for the SVM regressor controller, the error tolerance is much better determining by such the accuracy for the regression model (Fig. 6). On the other hand, one can notice the evolution of the torques deployed to control the robot arm. Using SVR method, these torques are small in magnitude compared to those necessary to control the arm using computed torque method. Using the required stored torques, we can solve for the time consuming torque calculation, for which the values has to be provided as fast as the servo-loop.
6. CONCLUSION In this paper we tried a new scheme of nonlinear control based on model dynamic compensation using one type of regressor brought from machine learning concepts. The idea of the computed torque method was one of the successful tools used to control robot manipulators since it eliminates the nonlinear parts of the system allowing the mechanical system to be controlled solely by a servo feedback PD controller. Unfortunately this method presents some drawbacks due to uncertainties in parameters and unforeseen perturbations. This is why some techniques have been proposed in order to overcome this situation. In this work, we proposed a kernel regressor used to predict the feedforward torques. The learning is done offline and the results are almost identical to the computed torque method. The simulation results prove that the tracking performances when SVR is used are preserved at certain degree. As a matter of fact we suggest using this presented scheme in conjunction with an adaptive control law if higher performances are needed.
REFERENCES Craig, J. (1988). Adaptive control of mechanical manipulators, Adison Wesley, New york.. Amestegui, M., R. Ortega, and J.M. Ibarra (1987), Adaptive Linearizing Decoupling Robot Control: A Comparative Study of Different parameterization, in Proc. of the 5th Yale Workshop on Application of Adaptive Systems Theory. New Haven, CT. Sadegh, N. and R. Horowitz (1987 ). Stability Analysis of an Adaptive Controllers for Robotic MAnipulator, in Proc. IEEE Conf. On Robotics and Automation, Raleigh, NC. Slotine, J. and W. Li (1987). Adaptive Robot Control: A New Perspective, IEEE J. Robotics Automation. 3(4), pp 345-351. Landau, I.D. and R. Horowitz (1988). Synthesis of Adaptive Controller for Robot Manipulators Using a Passive Feedback Systems Approach, in Proc. IEEE Conf. On Robotics and Automation, Philadelphia. Abdessemed, F. and K. Benmahammed (1997). Commande d’un Bras Manipulateur avec un PID Flou, Proc. de la 17 journée Tunisienne d’Electronique et d’Automatique, pp 432-441. Abdessemed, F., K. Benmahammed (2001) A Two-Layer Robot Controller Design Using Evolutionnary Algorithms, Journal of Intelligent and Robotic System 30: 73-94. Patino, H.D.; Carelli, R.; Kuchen, B.R.(2002). Neural networks for advanced control of robot manipulators” IEEE Transactions on Neural Networks, vol. 13, Issue 2, Page(s):343 – 354 Lewis, F. L., K. Liu and A. Yesildirek (1993). Neural net robot controller with guaranteed tracking performance, IEEE Symposium on Intelligent Control pp. 225-231. Vapnik, V. (1998), Statistical learning theory, John Wiley and Sons, New York. Pontil, M. and A. Verri (1998.). Support vector machines for 3D object recognition, IEEE Trans. on Pattern Analysis and Machine Intelligence, vol. 20, pp. 637-646. El-Naqa, Y. Yongyi, M.N. Wernick, N.P. Galatsanos, and R.M. Nishikawa (2002). A support vector machine approach for detection of microcalcifications, IEEE Trans. on Medical Imaging, vol. 21, pp. 1552-1563.
Robinson, J. and V. Kecman (2003). Combining support vector machine learning with the discrete cosine transform in image compression, IEEE Trans. on Neural Networks, vol. 14, pp. 950 -958. Bazi, Y. and F. Melgani (2006). Toward an Optimal SVM Classification System forHyperspectral Remote Sensing Images,” IEEE Trans. Geosci. Remote Sens., vol. 44, pp. 3374-3385. Smola, A. and B. Schölkopf (1998). A tutorial on support vector regression, Royal Holloway College, Univ. London, U.K., NeuroCOLT Tech. Rep. NC-TR-98-030.
Fig. 3: Performance of the computed torque method without perturbation
Fig. 4: Performance of the SVM regressor orque method without perturbation
Fig. 5: Performance of the computed torque method with perturbation
Fig. 6: Performance of the SVM regressor orque method with perturbation