## 5 Generalized Jacobian with External Forces  
### Derivation of Generalized Jacobian with External Forces for Trajectory Tracking  
A more complete model of the UAM includes the effect of the base translations and rotation as well as the external forces applied by the controller on the UAM and the gravity force. This is based on the generalized Jacobian approach outlined in Section 2.3. The manipulator modeled is a serial link arm, that is mounted at an offset \(r_{m}\) (as defined in Section 2.1) from the UAV base CoG \(G_{UAV}\). The reaction forces between the base and manipulator are considered internal, and the controller forces \(U_{1}\) and \(U_{2}\) as well as the gravity force on the system are considered external. First, we consider the fact that the change in linear momentum \(L(t)\in\mathbb{R}^{3}\) over time of a mechanical system occurs due to external forces \(F(t)\in\mathbb{R}^{3}\):  
\[\frac{dL(t)}{dt}=F(t) \tag{19}\]  
where \(L(t)=[L_{x}(t)\;\;\;L_{y}(t)\;\;\;L_{z}(t)]^{T}\) is the linear momentum, and \(F(t)=[F_{x}(t)\;\;F_{y}(t)\;\;\;F_{z}(t)]^{T}\) is the force with its three components along \(x_{I}\), \(y_{I}\), and \(z_{I}\). Similarly, the change in angular momentum \(K(t)\in\mathbb{R}^{3}\) occurs due to external torques \(\tau(t)\in\mathbb{R}^{3}\):  
\[\frac{dK(t)}{dt}=\tau(t) \tag{20}\]  
where \(K(t)= \begin{bmatrix}K_{x}(t)\;\;\;L_{y}(t)\;\;\;L_{z}(t)\end{bmatrix} ^{T}\) and \(\tau(t)= \begin{bmatrix}\tau_{x}(t)\;\;\;\tau_{y}(t)\;\;\;\tau_{z}(t)\end{bmatrix} ^ {T}\) are the angular momenta and external torques about each axis. Therefore, the linear and angular momenta of a system with external forces and torques at time \(t\) can be obtained by integrating the forces and torques over time, starting from the initial time \(t_{0}\):  
\[ \begin{array}{l}L(t)=\int_{t_{0}}^{t}F(t)dt+L(t_{0})\\ K(t)=\int_{t_{0}}^{t}\tau(t)dt+K(t_{0})\end{array}  \tag{21}\]  
We discretize these equations to obtain the linear and angular momentum at each timestep \(k=\Delta t\), where \(\Delta t\) is the sampling time interval. The discretized forms of (21) at each \(k\) are the following:  
\[ \begin{array}{l}L_{k+1}=F_{k}\Delta t+L_{k}\\ K_{k+1}=\tau_{k}\Delta t+K_{k}\end{array}  \tag{22}\]  
The momentum equation is expressed in terms of the mass/inertia matrix of the system \(H\in\mathbb{R}^{6\times(6+n_{e})}\), base generalized coordinates \(\hat{q}_{b}\in\mathbb{R}^{6}\), and manipulator generalized coordinates \(\hat{q}_{m}\in\mathbb{R}^{n_{e}}\):  
\[H \begin{bmatrix}\hat{q}_{b}(t)\\ \hat{q}_{m}(t)\end{bmatrix} = \begin{bmatrix}L(t)\\ K(t)\end{bmatrix}  \tag{23}\]  
We partition \(H\) into a base component \(H_{b}\in\mathbb{R}^{6\times 6}\) and manipulator component \(H_{m}\in\mathbb{R}^{6\times n_{e}}\):  
\[H= \begin{bmatrix}H_{b}\;\;\;\;H_{m}\end{bmatrix}  \tag{24}\]  
We combine the kinematic equation in (9) with (23) and (24), to obtain the end-effector velocity in terms of our Jacobians, mass/inertia matrices, and momenta:  
\[v_{e,k+1}=(J_{m}-J_{b}\;H_{b}^{-1}\;H_{m})\hat{q}_{m}+J_{b}H_{b}^{-1} \begin{bmatrix} L_{k}\\ K_{k}\end{bmatrix} =J_{\rm C}\;\hat{q}_{m}+J_{b}H_{b}^{-1} \begin{bmatrix}L_{k} \\ K_{k}\end{bmatrix}  \tag{25}\]  
where \(J_{\rm C}\) is the generalized Jacobian of our system. To find the required joint velocities, we solve for \(\hat{q}_{m}\) (dropping the notation of timestep for brevity):  
\[\hat{q}_{m}=J_{\rm C}^{-1}\bigg{(}v_{e}-J_{b}H_{b}^{-1} \begin{bmatrix}L_{k}\\ K_{k}\end{bmatrix} \bigg{)} \tag{26}\]To find the current momenta of the system based on the external forces as stated in (22), we first define the following vectors as illustrated in Figure 9:  
* \(r_{B}\): vector from the inertial frame origin to the UAV CoG \(G_{UAV}\);
* \(r_{C}\): vector from the inertial frame origin to the whole system CoG \(G_{m}\). The linear momentum at timestep \(k\) under the external forces comprising the controller force and UAM gravity is found with the following equation:  
\[L_{k+1}=L_{k}+\left(A_{0} \begin{bmatrix}0\\ 0\\ U_{1}\end{bmatrix} +