# Inverse Kinematics of a Serial Manipulator with a Free Joint for Aerial Manipulation
## 3 Inverse Kinematics of the Manipulator with a Non-Actuated  
### Revolute Joint  
In order to solve the inverse kinematics of a manipulator attached to a mobile base through a non-actuated revolute joint, the dynamics of the system must be considered. In fact, the motion of actuated joints causes a motion of the base and the rotation of the passive joint. Also, external forces acting on the base and on the end-effector cause undesired motion of the robot. The effects of base motion and external forces on the end effector are described in Section 2.3; thus, it can be considered and compensated for in the solution of the inverse kinematics. However, before using Equation (12), the acceleration of the non-actuated joint must be expressed as a function of the acceleration of the actuated joints. Inverting Equation (3) and using Equation (4), the acceleration of the base is expressed as a function of joint acceleration and external forces:  
\[\ddot{\boldsymbol{x}}_{b}=-\boldsymbol{H}_{b}^{-1}\boldsymbol{H}_{bm}\ddot{ \boldsymbol{q}}+\boldsymbol{H}_{b}^{-1}\left(\boldsymbol{F}_{b}-\boldsymbol{c }_{b}+\boldsymbol{J}_{b}^{T}\boldsymbol{F}_{h}\right). \tag{13}\]  
If one of the joints is free, the corresponding component of \(\boldsymbol{\tau}\) is null; alternatively, if this joint is not actuated but is subject to damping, the corresponding component of \(\boldsymbol{\tau}\) is proportional to the joint velocity. This is exploited to express the acceleration of the free joint in terms of the acceleration of actuated joints. Substituting (13) in (4), the following relationship between joint accelerations is found:  
\[\boldsymbol{H}_{\tau}\ddot{\boldsymbol{q}}=\boldsymbol{F}_{\tau}+\boldsymbol {\tau} \tag{14}\]  
in (14) the following definitions are used for brevity:  
\[\boldsymbol{H}_{\tau}=\boldsymbol{H}_{m}-\boldsymbol{H}_{bm}^{T}\boldsymbol{ H}_{b}^{-1}\boldsymbol{H}_{bm} \tag{15}\]  
\[\boldsymbol{F}_{\tau}=-\boldsymbol{H}_{bm}^{T}\boldsymbol{H}_{b}^{-1}\Big{(} \boldsymbol{F}_{b}-\boldsymbol{c}_{b}+\boldsymbol{J}_{b}^{T}\boldsymbol{F}_{ h}\Big{)}-\boldsymbol{c}_{m}+\boldsymbol{J}_{m}^{T}\boldsymbol{F}_{h} \tag{16}\]  
Then, the acceleration of the non-actuated joint (the first joint) is expressed as a function of the acceleration of other joints selecting the first row of (14) and isolating \(\ddot{q}_{1}\):  
\[\ddot{q}_{1}=\frac{1}{H_{\tau 11}}\left(F_{\tau 1}+\tau_{1}-\sum_{i=2}^{N}H_{ \tau 1i}\,\ddot{q}_{i}\right) \tag{17}\]  
where \(\tau_{1}=0\) if the first joint is free, or \(\tau_{1}=C\dot{q}_{1}\) if the damping of the first joint is considered. It is worth noticing that the following derivation is still valid even if the non-actuated joint is not the first joint. Therefore, introducing the vector of actuated joints \(\ddot{\boldsymbol{q}}^{*}=[\ddot{q}_{2}\,\ddot{q}_{3}\ldots\dot{q}_{i}\ldots \dot{q}_{N}]^{T}\), joint accelerations are expressed as:  
\[\ddot{\boldsymbol{q}}= \begin{bmatrix}-\frac{H_{\tau 12}}{H_{\tau 11}}&\ldots&- \frac{H_{\tau 1i}}{H_{\tau 11}}&\ldots&-\frac{H_{\tau 11N}}{H_{\tau 11}}\\ &&\boldsymbol{I}_{N-1}&&&\end{bmatrix} \ddot{\boldsymbol{q}}^{*}+\frac{1}{H_{ \tau 11}} \begin{bmatrix}F_{\tau 1}+\tau_{1}\\ 0\\ \vdots\\ 0\end{bmatrix}  \tag{18}\]  
where \(I_{N-1}\in\mathbb{R}^{N-1}\) is the identity matrix. Rewriting Equation (18) in a concise form gives:  
\[\ddot{\boldsymbol{q}}=\boldsymbol{Q}\ddot{\boldsymbol{q}}^{*}+\boldsymbol{a} \tag{19}\]  
where:  
\[\boldsymbol{Q}= \begin{bmatrix}-\frac{H_{\tau 12}}{H_{\tau 11}}&\ldots&- \frac{H_{\tau 1i}}{H_{\tau 11}}&\ldots&-\frac{H_{\tau 1N}}{H_{\tau 11}}\\ &&\boldsymbol{I}_{N-1}&&&\end{bmatrix} \]\[\mathbf{a}=\frac{1}{H_{\tau 11}} \begin{bmatrix}F_{\tau 1}+\tau_{1}\\ 0\\ \vdots\\ 0\end{bmatrix} \]  
Substituting (19) in (12) and solving for the actuated joint accelerations gives the inverse kinematics equation:  
\[\ddot{\mathbf{q}}^{*}=\left(\mathbf{J}_{gen}\mathbf{Q}\right)^{-1}\left(\dot{v}_{ee}-\mathbf{j }_{gen}\dot{\mathbf{q}}-\mathbf{J}_{b}\mathbf{H}_{b}^{-1} \begin{bmatrix}\dot{\mathbf{p}}\\ \dot{\mathbf{K}}\end{bmatrix}