## 4 Ideal Control 2-DOF Trolley Model  
### Model Derivation  
We first formulate a simple model of our UAM system, assuming that our UAV base has perfect vertical and rotational tracking of hover conditions through its controller. This  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Coordinate (i)** & \(k_{Pi}\) & \(k_{Di}\) & \(k_{Hi}\) \\ \hline \(z\) & 37 & 18 & 8 \\ \hline \(\phi\) & 40 & 3 & 35 \\ \hline \hline \end{tabular}
\end{table}
Table 2: PID controller tunings.  
Figure 4: End-effector desired velocities for the circular trajectory (**left**) and initial configuration for a 3-DOF manipulator (**right**). The UAV base is the large green marker, joints are the black circles, links are the blue lines, and end-effector positions tracked are the red crosses.  
is modeled as a horizontal trolley with a 2-DOF manipulator mounted at the CoG position of the UAV base (\(G_{UAV}\)), with mass \(m_{UAV}\) and rotational inertia \(l_{UAV}\).  
Our generalized coordinates are the joint angles \(q_{1}\) and \(q_{2}\). The following parameters are defined: \(i\) is the link number, \(m_{i}\) is its mass, \(l_{i}\) is the length, and \(a_{i}\) is the distance from the first joint of the link to the link CoG position \(G_{i}\). The geometry and dynamic parameters of the system are illustrated in Figure 5.  
The end-effector task velocities \(v_{e}\) consisting of \(x\) and \(z\) velocities \(v_{x}\) and \(v_{z}\) are derived with respect to the joint velocities \(\dot{q}\) and kinematic Jacobian \(J_{k}\):  
\[\begin{bmatrix}v_{x}\\ v_{z}\end{bmatrix}=\begin{bmatrix}I_{11}(q)&I_{12}(q)\\ I_{12}(q)&J_{22}(q)\end{bmatrix}\begin{bmatrix}\dot{q}_{1}\\ \dot{q}_{2}\end{bmatrix}=\begin{bmatrix}I_{1}\cos(q_{1})+I_{2}\cos(q_{1}+q_{2 })&I_{2}\cos(q_{1}+q_{2})\\ I_{1}\sin(q_{1})+I_{2}\sin(q_{1}+q_{2})&I_{2}\sin(q_{1}+q_{2})\end{bmatrix} \dot{q}=J_{k}\dot{q} \tag{14}\]  
The joint movements induce motion of the base and manipulator along the horizontal (\(x_{l}\)) axis. We define the linear momentum along this axis:  
\[(m_{UAV}+m_{1}+m_{2})\dot{x}_{B}+m_{1}a_{1}\cos(q_{1})\dot{q}_{1}+m_{2}\big{(}( l_{1}\cos(q_{1})+a_{2}\cos(q_{1}+q_{2}))\dot{q}_{1}+a_{2}\cos(q_{1}+q_{2}) \dot{q}_{2}\big{)}=0 \tag{15}\]  
We rearrange (15) to solve for the base velocity \(\dot{x}_{B}\), and combine the result with (14) to derive the generalized Jacobian \(J_{G}\) for the 2-DOF trolley model  
\[\begin{bmatrix}v_{x}\\ v_{z}\end{bmatrix}=\begin{bmatrix}I_{11}(q)+A_{1}(q)&I_{12}(q)+A_{2}(q)\\ I_{12}(q)&J_{22}(q)\end{bmatrix}\begin{bmatrix}\dot{q}_{1}\\ \dot{q}_{2}\end{bmatrix}=J_{G}\dot{q} \tag{16}\]  
where:  
\[A_{1}(q)=-\frac{(m_{1}q_{1}\cos(q_{1})+m_{2}(l_{1}\cos(q_{1})+a_{2}\cos(q_{1} +q_{2}))}{(m_{UAV}+m_{1}+m_{2})}\]  
\[A_{2}(q)=-\frac{m_{2}q_{2}\cos(q_{1}+q_{2})}{(m_{UAV}+m_{1}+m_{2})}\]  
The inverse kinematic control equation for the 2-DOF trolley model is the following:  
\[\dot{q}=J_{G}^{-1}v_{e} \tag{18}\]  
The inverse kinematics is solved through a time discretization and an iterative process: at every timestep \(k\), the end-effector velocities are known and, by assuming that joint angles \(q_{k}\) do not significantly change between two consecutive timesteps \(k\) and \(k+1\), the generalized Jacobian can be calculated through (16) by substituting \(q=q_{k}\).