Note: I had previously posted this question on the Space and Robotics SE sites, but received little/no response. So I've deleted the previous posts and repasted my question here in the hope of getting more responses.
I'm trying to model the dynamics of a free-floating spacecraft with an single-link (revolute) robot arm attached to one end. I'm modeling planar motion and rotation of both the spacecraft and the robot arm link.
I'm familiar with the process of obtaining the dynamics of a system by way of formulating the total kinetic and potential energies of the system and applying the Euler-Lagrange theorem. The problem is that I'm not entirely sure how to formulate the energies of this system.
For inspiration, I looked at modeling my spacecraft + single-link robot system as if it were a two-link robot system with a single revolute joint connecting link 1 with link 2. For simplicity, I'm only considering planar motion in an inertial coordinate system with no gravitational potential forces acting on the spacecraft-robot arm system. For reference, see the image below:
Mounted Two-Link Robot Arm System
In a ordinary planar two rigid link robot system (with two revolute joints mounted to a fixed platform), the potential energies are due to gravity. The kinetic energies for each part can be decomposed into energies from linear motion and from angular rotation.
For link 1, the kinetic energy due to the linear motion of Link 1's center of gravity is constrained to circular motion because it is attached to the base at joint 1. Its linear energy is $$L_1=\frac{1}{2}m_1a_{c1}^2\dot{\theta_1}^2,$$ where $m_1$ is the mass of link 1 and $a_{c1}$ is the half-length of link 1. The rotational energy associated with link 1 is the energy from rotation about its center of mass. Its rotational energy is $$R_1=\frac{1}{2}I_1\dot{\theta_1}^2,$$ where $I_1$ is the moment of inertia of link 1 about its center of mass. So, the total kinetic energy of link 1 is $L_1+R_1$.
For link 2, the kinetic energy also has linear and rotational components to it. The linear energy can be obtained geometrically by noting that the (x,y) position of link 2's center of mass can be obtained as follows:
The position of link 2's center of mass is $$P_x=a_1cos(\theta_1)+a_{c2}cos(\theta_1+\theta_2)$$
and
$$P_y=a_1sin(\theta_1)+a_{c2}sin(\theta_1+\theta_2).$$
Note that $a_1=2*a_{c1}$ is the full length of link 1 and $a_{c2}$ is the half-length of link 2.
Using the chain rule, one can find the linear velocity in the x and y directions as $\dot{P_x}$ and $\dot{P_y}$. Then the kinetic energy due to linear motion at link 2's center of mass is $$L_2=\frac{1}{2}m_2v^Tv,$$ where $v=[\dot{P_x}, \dot{P_y}]^T$.
The rotation energy of link 2's center of mass involves the sum of rotational velocities from both joint 1 and joint 2. So, the rotational energy around link 2's center of mass is $$R_2=\frac{1}{2}I_2(\dot{\theta_1}+\dot{\theta_2})^2.$$ So, the kinetic energy of link 2 is $K_2=L_2+R_2$.
I won't go into the details of the potential energy, but let's just assume there are expressions $P_1$ and $P_2$ for the potential energies of link 1 and link 2 associated with the height of the center of mass of each link.
So for a two-link, two joint revolute mounted planar robot arm, we can write the lagrangian as $$\mathcal{L}=K_1+K2-P1-P2 = L1+R1+L2+R2-P1-P2.$$
Free-Floating Spacecraft with a Single Link Robot Arm System
To obtain the equations of motion for a free floating robot with a single robot arm attached to one end, I take this model and make a few modifications:
Assume that link 1 is a free floating spacecraft. Thus, there is no joint 1 associated with this system.
Re-define the angle $\theta_1$ to be the orientation (attitude) angle of the spacecraft, with respect to an inertial reference frame.
Since the spacecraft-robot system are free-floating in space, I assume the potential energies for both the spacecraft and the robot are zero (e.g. assuming no gravity gradient effects or perturbation forces on the system). So $P_1=P_2=0$.
The spacecraft has a kinetic energy associated with its linear velocity. Denoting $\dot{x}$ and $\dot{y}$ as the linear velocity of the spacecraft (link 1), the linear energy of link 1 becomes $$L_1=\frac{1}{2}m_1(\dot{x}^2+\dot{y}^2).$$ The spacecraft also has a rotational energy associated with its angular velocity $\dot{\theta_1}$ given by $$R_1=\frac{1}{2}I_1\dot{\theta_1}^2.$$
My Question
I'm not sure if I'm characterizing the expressions for the linear and rotational energy in link 2 correctly. I assume link 2's (the robot arm's) center of mass has an (x,y) position given by:
$$P_x = x + a_{c1}cos(\theta_1)+a_{c2}cos(\theta_1+\theta_2)$$
$$P_y = y + a_{c1}sin(\theta_1)+a_{c2}sin(\theta_1+\theta_2)$$
So, if I take time derivatives of $P_x$ and $P_y$ as before, I should obtain an expression for the velocity $v=[\dot{P_x},\dot{P_y}]$ and the kinetic energy due to linear motion should be $L_2=\frac{1}{2}m_2v^Tv$.
Question 1:
Should the kinetic energy of link 2 (the robot arm) include terms with the spacecraft (link 1's) velocity $\dot{x}$ and $\dot{y}$ in it? My mind keeps going back and forth on whether or not to include the space craft's velocity as part of the energy of the robot arm.
Question 2:
Should the rotational energy involve only the sum of the angular velocities of the spacecraft's attitude ($\dot{\theta_1}$) and the robot arm's joint $\dot{\theta_2}$. Specifically, is it correct to write out $R_2=\frac{1}{2}I_2(\dot{\theta_1}+\dot{\theta_2})^2$? I have a doubt that the rotational energy energy of the link should be the same as that for the fixed base two-link robot arm case, but I can't seem to find any other potential sources of rotational energy.
TL;DR: Are my expressions for $P_x$ $P_y$ and $R_2$ correct for the spacecraft-robot arm case? If not, where did I go wrong or what am I missing?