The linear acceleration of frame
$$\dot{v}{a}={}^{U}\dot{V}{AORG}$$
and the angular acceleration is
$$\dot{\omega}{a}=\ ^{U}\dot{\Omega}{AORG}$$
Deriving this equation is hell, so I'll just state the solution. Refer to page.166 of Craig's Intro to Robotics for derivation:
$${}^{A}\dot{V}{Q}={}^{A}\dot{V}{BORG}+{}^{A}\Omega_{B}\times({}^{A}V_{B}\times{}^{A}_{B}R{}^{B}Q)+{}^{A}\dot{\Omega}B\times{}^{A}{B}R{}^{B}Q$$
The "similar" equation for angular velocity is:
$${}^{A}\dot{\Omega}{C}={}^{A}\dot{\Omega}{B}+{}^{A}{B}R\ {}^{B}\dot{\Omega}{C} + {}^{A}\Omega_{B}\times{}^{A}{B}R\ {}^{B}\Omega{C}$$
These can be used along with the equations for velocity to generate iterative equations for linear and rotational acceleration:
$$^{i+1}\dot{\omega}{i+1}={}^{i+1}{i}{R}{}^{i}\dot{\omega}{i}+{}^{i+1}{i}{R}{}^{i}{\omega}{i}\times \dot{\theta}{i+1}{}^{i+1}\hat{Z}{i+1}+\ddot{\theta}{i+1}{}^{i+1}\hat{Z}{i+1}$$ $$\text{(Rot:) }{}^{i+1}\dot{v}{i+1}={}^{i+1}{i}{R}({}^{i}\dot{\omega}{i}\times {}^{i}{P}{i+1}+{}^{i}{\omega}{i}\times({}^{i}{\omega}{i}\times {}^{i}{P}{i+1})+{}^{i}\dot{v}{i})$$ $$\begin{align*} ^{i+1}\dot{v}{C_{i+1}}=&^{i+1}\dot{\omega}{i+1}\times {}^{i+1}{P}{C_{i+1}}\&+{}^{i+1}{\omega}{i+1}\times({}^{i+1}{\omega}{i+1}\times {}^{i+1}{P}{C{i+1}})+{}^{i+1}\dot{v}_{i+1} \end{align*} $$
Along with acceleration, the Newtonian model for dynamics also involves masses and forces, culminating in the iconic Newton's second law, suited better to our needs:
$$F_{i}=ma=m\dot{v}{C{i}}$$
When dealing with rigid bodies, we usually consider their inertia's to take into account the shape of their bodies when using them in equations. The mass distribution of a rigid body can be given by an inertia tensor:
We can use this tensor in Euler's rotation equation, where
This can give us the recursive equations for force and torque applied to the frames {$i$} and {$i+1$}:
$${}^{i+1}{F}{i+1}={m}{i+1}{}^{i+1}\dot{v}{C{i+1}}$$ $${}^{i+1}{N}{i+1}={}^{i+1}{I}{i+1}{}^{i+1}\dot{\omega}{i+1}+{}^{i+1}{\omega}{i+1}\times {}^{i+1}{I}{i+1}{}^{i+1}{\omega}{i+1}$$ $${}^{i}{f}{i}={}^{i}{i+1}{R}{}^{i+1}{f}{i+1}+{}^{i}{F}{i}$$ $${}^{i}{n}{i}={}^{i}{N}{i}+{}^{i}{i+1}{R}{}^{i+1}{n}{i+1}+{}^{i}{P}{C{i}}\times {}^{i}{F}{i}+{}^{i}{P}{i+1}\times {}^{i}{i+1}{R}{}^{i+1}{f}{i+1}$$
To account for gravity, we just assume the entire base frame accelerates up at the same magnitude, which adds the effect with no additional computation cost:
Finally, we use these force and moment equations to find a system for applied torque
$$\uptau_{i}={}^{i}{n}{i}^{T}{}^{i}\hat{Z}{i}$$
And for prismatic joint {$i$}:
$$\uptau_i={}^{i}{f}{i}^{T}{}^{i}\hat{Z}{i}$$
After deriving the dynamic equations for a manipulator's torques, we can simplify these into matrices giving us the state-space representation:
Where the mass matrix contains
The velocity matrix is an
We can then rewrite this form in a configuration-space equation, which has terms dependant only on the joint positions, making it less computationally expensive:
where