# An Approach to the Dynamics and Control of Uncertain Robot Manipulators
## 2 Udwadia-Kalaba Equation  
Consider the unconstrained mechanical system, moving under the influence of gravity alone, described by \(n\) generalized coordinates \(q:=\left[q_{1},q_{2},\cdots,q_{n}\right]^{T}\), and with equations of motion expressed in Newtonian or Lagrangian form as  
\[M\left(q,t\right)\ddot{q}=Q\left(q,q,t\right), \tag{1}\]  
with initial conditions  
\[q\left(0\right)=q_{0},\quad\dot{q}\left(0\right)=\dot{q}_{0}. \tag{2}\]  
Here \(t\in R\) is the time, \(M\) is an \(n\times n\) matrix that can be either positive-semidefinite \(\left(M\geq 0\right)\) or positive-definite \(\left(M>0\right)\) at each instant of time. \(\dot{q}\) is the \(n\times 1\) velocity vector, \(\ddot{q}\) is the \(n\times 1\) acceleration vector, and \(Q\left(q,q,t\right)\), called the given force, collects together the normal and Coriolis inertial terms and the applied forces related to \(q\), \(\dot{q}\), and \(t\). From (1), when \(q\), \(\dot{q}\), and \(t\) are known, the acceleration can be obtained as follows:  
\[a\left(q,\dot{q},t\right):=M^{-1}\left(q,t\right)Q\left(q,\dot{q},t\right). \tag{3}\]  
Suppose the mechanical system is subject to \(l(l<n)\) Paffian (holonomic or non-holonomic) constraints [23]:\[\sum_{i=1}^{n}A_{li}(q,t)\dot{q}_{i}=c_{l}(q,t),\quad l=1,2,\cdots,m, \tag{4}\]  
in which \(A_{li}(*):R^{n}\times R\to R\) are both \(C^{1}\), \(m\leq n\). By differentiating the Equation (4), we can obtain the second-order form constraints as  
\[\sum_{i=1}^{n}(\frac{d}{dt}A_{li(q,t)})\dot{q}_{i}=\sum_{i=1}^{n}(\frac{d}{dt}A _{li(q,t)})\dot{q}_{i}=\frac{d}{dt}c_{l}(q,t), \tag{5}\]  
in which  
\[ \begin{cases}\frac{d}{dt}A_{li}(q,t)=\sum_{k=1}^{n}\frac{2A_{li}(q,t)}{\dot{q} _{k}}\dot{q}_{k}+\frac{2A_{li}(q,t)}{\dot{q}},\\ \frac{d}{dt}c_{l}(q,t)=\sum_{k=1}^{n}\frac{\partial c_{l}(q,t)}{\partial q_{k }}\dot{q}_{k}+\frac{\partial c_{l}(q,t)}{\partial t}.\end{cases}  \tag{6}\]  
Let  
\[b_{l}(q,\dot{q},t):=\frac{d}{dt}c_{l}(q,t)-\sum_{i=1}^{n}(\frac{d}{dt}A_{li}( q,t))\dot{q}_{i}. \tag{7}\]  
Then Equation (5) can be written as the matrix form  
\[A(q,\dot{q},t)\ddot{q}=b(q,\dot{q},t), \tag{8}\]  
where \(b=[b_{1},b_{2},\cdots,b_{m}]^{T}\). When the system is constrained, an additional set of forces act on the manipulator system, and the equation of motion of this constrained manipulator system can then be written as  
\[M\left(q,t\right)\ddot{q}=Q\left(q,\dot{q},t\right)+Q^{c}\left(q,\dot{i},t \right), \tag{9}\]  
where \(Q^{c}\left(q,\dot{q},t\right)\) is an \(n\times 1\) vector, which is present because of the additional constraint force and satisfies the constraint conditions. In Lagrangian mechanics, when the constraints are ideal, \(Q^{c}\left(q,\dot{q},t\right)\) is governed by the usual D'Alembert principle. However, the constraints can also be nonideal, and the constrained system can be subject to both ideal and nonideal constraints at the same time, in which case \(Q^{c}\left(q,\dot{q},t\right)\) can be written as  
\[Q^{c}\left(q,\dot{q},t\right)=Q^{c}_{\text{id}}\left(q,\dot{q},t\right)+Q^{c} _{\text{nid}}\left(q,\dot{q},t\right), \tag{10}\]  
where \(Q^{c}_{\text{id}}\left(q,\dot{q},t\right)\) is the ideal constraint force and \(Q^{c}_{\text{nid}}\left(q,\dot{q},t\right)\) the nonideal constraint force. Assuming that the virtual displacement is \(\
u\), the work done by the ideal constraint force is zero, i.e.,  
\[\
u^{T}Q^{c}_{\text{id}}=0, \tag{11}\]  
while the work done by the nonideal constraint force \(Q^{c}_{\text{nid}}\left(q,\dot{q},t\right)\) is nonzero. i.e.,  
\[\
u^{T}Q^{c}_{\text{nid}}\
eq 0. \tag{12}\]  
[PERSON] and [PERSON] showed that the ideal constraint force is given by  
\[Q^{c}_{\text{id}}\left(q,\dot{q},t\right)=M^{\frac{1}{2}}B^{+}\left(b-AM^{-1} Q\right), \tag{13}\]  
and the nonideal constraint force by  
\[Q^{c}_{\text{nid}}\left(q,\dot{q},t\right)=M^{\frac{1}{2}}B^{+}\left(I-B^{+}B \right)M^{-\frac{1}{2}}\mathbf{c}, \tag{14}\]where the matrix \(B=AM^{-\frac{1}{2}}\) and the superscript \"+\" indicates the Moore-Penrose inverse matrix.