# Design and Simulation of On-Orbit Assembly System Based on Insect-Inspired Transportation
## 5 Research on Robot Assembly Process  
During the assembly process, the flexible assembly unit can exert continuously varying forces on the robot, causing the robot to undergo changes in force and displacement. To account for these changes, it is necessary to reconstruct the robot's dynamics model. The Lagrangian calculation method is used to analyze the work and energy involved in the robot system, solving the questions related to robot mechanics. The Lagrangian method analyzes only external constraint forces instead of internal constraint forces within the robot system. The method allows the establishment of coordinate systems according to the task. The Lagrangian equation is expressed as follows:  
\[\frac{d}{dt}\left[\frac{\partial L}{\partial\dot{\theta}_{i}}\right]-\frac{ \partial L}{\partial\dot{\theta}_{i}}=Q_{i}\ \ \ \ \ i=1,2,3,\ldots,m \tag{22}\]  
where the meaning of \(L\) is the Lagrange function expressed by \(V\) and \(T\), the physical meaning of \(V\) is kinetic energy, and the physical meaning of \(T\) is potential energy. \(Q_{i}\) represents a generalized force, which does not contain potential. The method to determine this force is to find the virtual work done by the non-conservative force in the system, thus determining this force. \(m\) is the number of degrees of freedom of the system itself. First, calculate the kinetic energy of the robot, take one of the moving legs as the research object, and establish a coordinate system \(\{L_{i}\}\) in the \(i\)-th moving leg of the robot, then the speed of the \(i\)-th leg is:  
\[ \begin{array}{l}V_{i}^{B}=J_{i}^{B}(\theta)\dot{\theta}\\ T_{i}(\theta,\dot{\theta})=\frac{1}{2}\big{(}v_{i}^{B}\big{)}^{T}N_{i}^{B}V_{i }^{B}\\ =\frac{1}{2}\big{(}I_{i}^{B}(\theta)\dot{\theta}\big{)}^{T}N_{i}^{B}I_{i}^{B}( \theta)\dot{\theta}\\ =\frac{1}{2}\dot{\theta}^{T}\big{(}I_{i}^{B}(\theta)\big{)}^{T}N_{i}^{B}J_{i}^ {B}(\theta)\dot{\theta}\end{array}  \tag{23}\]  
\(N_{i}^{B}\) represents the inertia matrix of the \(i\)-th leg in the robot body coordinate system. \(J_{i}^{B}\) represents the Jacobian matrix of the \(i\)-th leg in the robot body coordinate system. When discussing an inertial coordinate system, the description of the kinetic energy of the \(i\)-th moving leg is as follows:  
\[ \begin{array}{l}T_{i}(\theta,\dot{\theta})=\frac{1}{2}\big{(}V_{i}^{S}\big{)} ^{T}N_{i}^{S}V_{i}^{S}\\ =\frac{1}{2}\big{(}I_{i}^{S}(\theta)\dot{\theta}\big{)}^{T}N_{i}^{S}I_{i}^{S}( \theta)\dot{\theta}\\ =\frac{1}{2}\dot{\theta}^{T}\big{(}I_{i}^{S}(\theta)\dot{\theta}\big{)}^{T}N_{ i}^{S}J_{i}^{S}(\theta)\dot{\theta}\end{array}  \tag{24}\]\(N_{i}^{S}\) represents the inertia matrix of the \(i\)-th leg in the inertial coordinate system. \(J_{i}^{S}\) represents the Jacobian matrix of the \(i\)-th leg in the inertial coordinate system. Thus, it can be deduced that the total kinetic energy of the robot system is:  
\[T=\sum\limits_{i=1}^{n}T_{i}(\theta,\dot{\theta})=\frac{1}{2}\dot{\theta}^{T}N( \theta)\dot{\theta} \tag{25}\]  
\[ \begin{array}{l}N(\theta)=\sum\limits_{i=1}^{n}\left(J_{i}^{B}(\theta)\right) ^{T}N_{i}^{B}I_{i}^{B}(\theta)\\ =\sum\limits_{i=1}^{n}\left(J_{i}^{S}(\theta)\right)^{T}N_{i}^{S}I_{i}^{S}( \theta)\end{array}  \tag{26}\]  
\(N(\theta)\) represents the robot's own inertia matrix. Under the constraint force generated by the assembly unit, the energy expression of the corresponding constraint force on the robot is:  
\[V(\theta)=\sum\limits_{i=1}^{n}V_{i}(\theta)=\sum\limits_{i=1}^{n}P_{i}{}^{T }r_{ci}(\theta) \tag{27}\]  
In this Equation (27), \(P\) represents the constraint torque matrix. We obtain Equation (29) from Equation (28), which clarifies the relationship between the two equations. \[ \begin{array}{l}\left[\begin{array}{c}\overline{\omega}_{i}\\ \overline{\omega}_{ci}^{i}\end{array}\right]=\left[\begin{array}{cc}I_{3}&0 \\ ad(r_{ci})&I_{3}\end{array}\right]\left[\begin{array}{c}0\\ \overline{\omega}_{ci}^{i}\end{array}\right]\\ \left[\begin{array}{c}\overline{\omega}_{i}\\ \overline{\omega}_{ci}^{i}\end{array}\right]=J_{i}\theta\end{array}