1 Introduction

Thin-walled components serve as core elements extensively employed in aerospace, aviation, and military sectors. These components pose machining challenges, such as large dimensions, intricate shapes, limited rigidity, and demanding precision requirements. Compared to traditional machining techniques such as chemical milling and NC profiling milling, robotic milling is more suitable for fabricating sizable and complex surfaces, owing to its benefits including cost-effectiveness, multiple degrees of freedom, and superior spatial reachability. To counter the axial force of milling, suppress machining vibrations, and minimize workpiece deformation [1], a secondary robot equipped with a flexible supporting head can be positioned on the opposite side of the workpiece for supportive follow-up processing. In this setup, the dual robots and the workpiece create a mirror milling system, with the system layout depicted in Fig. 1.

Fig. 1
figure 1

Layout of dual-robot collaborative mirror milling system

The quality of machining in the manufacturing process is directly impacted by the collaborative interaction between the milling head and the supporting head. Researchers, such as Xiao et al. [2], have focused on the extraction of normal constraint relationships between the milling head and the supporting head during the machining of surfaces with equal thickness. By extending the concept of virtual length for the milling head using a parametric equation, they established a dual-robot cooperative motion equation based on a five-degree-of-freedom hybrid TriMule platform. In another study, Lan et al. [3], developed an intelligent mirror milling system equipped with two supporting heads. During the processing, the two supporting heads move according to a path planned using the finite difference method and genetic algorithm. Other researchers, such as Qian et al. [4], have concentrated on extracting kinematics constraints in mirror milling and optimizing the tool axis vector based on the projection of tool positioning points and the optimal feed speed of the robot tool. These studies have effectively established the constraint relationships and optimization methods between the milling head and the supporting head in mirror milling. However, the majority of analyzed workpieces are of constant curvature or equal thickness. Additionally, the explanation of the coupling relationship between position constraints, orientation constraints, and workpiece geometric constraints is not systematic and comprehensive enough.

The mirror milling system is a representative example of a dual-robot cooperative system. Apart from conducting kinematic analysis, it is essential to develop its dynamic model to lay the groundwork for subsequent control design and machining optimization. In the domain of dynamic modeling of dual-robot cooperation, notable researchers, such as Korayem et al. [5], have established the dynamic equation of a flexible cooperative manipulator by utilizing the Gibbs-Appell formula. They defined motion constraints, considered the geometric dimensions of the common object, and employed a closed kinematics cooperation model. Hedayat et al. [6] have examined the modeling and control problem of a constrained object controlled by two robotic arms. They established a reduced order dynamic model of the system based on the Lagrangian equation and Jacobian matrix. Similarly, Wang et al. [7] have analyzed the dynamic coupling characteristics of the new hybrid rigid continuous dual-arm space robot system. They constructed its dynamic equation by calculating the generalized Jacobian matrix, linear momentum, and angular momentum. Yan et al. [8] have proposed a virtual base modeling method for dual-arm space robots, in which they derived the kinematics and dynamic equations of the combined manipulator with a virtual base. While these studies are innovative and feasible for dynamic modeling of collaborative systems, they are mostly limited to simple constraint scenarios such as collaborative transportation. In the dynamic system of mirror milling, multiple sources of constraints and complex coupling relationships exist, thereby increasing the complexity of system dynamics modeling.

The Udwadia-Kalaba (U-K) method provides a new approach to solving this problem. Kalaba et al. [9] proposed a method to obtain the explicit motion equation of a general Hamiltonian system under holonomic and/or non-holonomic constraints. They established a connection between virtual displacement and Hamiltonian formula, which was used to develop the explicit motion equation of the constrained system. This approach is widely applicable, and the modeling process is concise and systematic without introducing additional auxiliary variables. The U-K method has been successfully applied in dynamic modeling of various systems. Dong et al. utilized the U-K method to complete the dynamic modeling of parallel robots [10] and dual mobile robots [11] under complex constraints, demonstrating the accuracy of the model.

This study tackles the challenge of multi-source constraint coupling in the mirror milling process, a factor that complicates comprehensive system modeling. Herein, we propose a concise, procedural collaborative modeling approach that provides enhanced handling of constraint extraction, transformation, and introduction. The organization of the remainder of this article is as follows: Section 2 presents a brief overview of the steps involved in establishing the U-K method. In Section 3, we construct the kinematics and dynamics models of the unconstrained system, based on the principle of similarity. Section 4 deals with the extraction and transformation of the position and orientation collaborative constraints of the dual-robot end effectors into four-point trajectory constraints, considering the shape constraints of the workpiece surface. Section 5 uses the U-K method to integrate the results obtained in Sections 3 and 4. In Section 6, a visual dynamic model of the system is constructed using Matlab and Solidworks joint simulation, and the feasibility and accuracy of the modeling are validated through the position and orientation of the equation solution in a specific case. Finally, Section 7 concludes the paper and discusses future prospects.

2 Preliminary knowledge for U-K method

The U-K method can be derived via the Gauss principle, d’Alembert’s principle, or extended d’Alembert’s principle. The general process for utilizing this method is as follows [12]:

Assuming that an unconstrained mechanical system can be characterized by n independent state variables \({q_i}\), the dynamic equations of the system under unconstrained conditions can be formulated as follows:

$$\begin{aligned} {\varvec{M}}({\varvec{q}},t){\varvec{\ddot{q}}} = {\varvec{Q}}({\varvec{q}},{\varvec{\dot{q}}},t) \end{aligned}$$
(1)

where t represents time, while \({\varvec{q}} = {\left[ {{q_1},{q_2}, \cdots ,{q_n}} \right] ^T}\) denotes the generalized coordinate. The vector \({\varvec{\dot{q}}}\) corresponds to the generalized velocity, and \({\varvec{\ddot{q}}}\) signifies the generalized acceleration. The system inertia matrix is represented by \({\varvec{M}} \in {{\varvec{R}}^{n \times n}}\), and \({\varvec{Q}} \in {{\varvec{R}}^n}\) stands for the applied generalized force within the system.

Then, Extract the constraint equations \({{\varvec{\varphi }}_j}({\varvec{q}},{\varvec{\dot{q}}},t) = 0\) that the extraction system receives. Take the first derivative of the non-holonomic constraint equation with respect to t, which explicitly contains \({\varvec{\dot{q}}}\), and take the second derivative of the holonomic constraint equation with respect to t, which does not explicitly contain \({\varvec{\dot{q}}}\). Organize these equations to obtain the second-order standard differential form of the constraint equation:

$$\begin{aligned} {\varvec{A}}({\varvec{\dot{q}}},{\varvec{q}},t){\varvec{\ddot{q}}} = {\varvec{b}}({\varvec{\dot{q}}},{\varvec{q}},t) \end{aligned}$$
(2)

By combining Eqs. (1) and (2), the analytical form of the constraint force \({{\varvec{Q}}^c}\) can be obtained [13]:

$$\begin{aligned} {{\varvec{Q}}^c} = {{\varvec{M}}^{1/2}}{({\varvec{A}}{{\varvec{{M}}}^{ - 1/2}})^ + }({\varvec{b}} - {\varvec{A}}{{\varvec{M}}^{ - 1}}{\varvec{Q}}) \end{aligned}$$
(3)

where superscript “\(\mathrm{{ + }}\)” denotes the Moore-Penrose generalized inverse. Moreover, the constraint force (3) must satisfy Eq. (2) and have the minimum norm among all feasible alternatives.

Finally, the constraint force \({{\varvec{Q}}^c}\) is added to Eq. (1) to obtain the dynamic model of the system under constraints:

$$\begin{aligned} {\varvec{M}}({\varvec{q}},t){\varvec{\ddot{q}}} = {\varvec{Q}}({\varvec{q}},{\varvec{\dot{q}}},t) + {{\varvec{Q}}^c}({\varvec{q}},{\varvec{\dot{q}}},t) \end{aligned}$$
(4)

It is worth mentioning that, as the physical characteristics of a given system remain constant, the essence of the mathematical expressions derived from different modeling methods remains consistent. The advantage of the U-K method lies in its approach to the modeling process, which allows for the deconstruction and reduction of complex systems. Additionally, compared to traditional constraint handling methods, such as the Lagrange multiplier method, it can handle both holonomic and non-holonomic constraints without the need to introduce auxiliary variables or increase the system’s dimensionality [14].

3 Unconstrained dynamic modeling

Without considering the constraints of the mirror milling system, we can use classical theory to model one of the robot subsystems, and then obtain the unconstrained dynamic model of the system based on the principles of symmetry and similarity. This approach effectively reduces the dimensionality of the system under analysis, enhancing modeling efficiency.

Remark 1

In the subsequent text, the left superscript is used to describe the coordinate system upon which the variable is based. Simultaneously, the right superscript “l” or “r” is used to distinguish between the left and right subsystems.

Taking a conventional six-degree-of-freedom serial robot as the analysis object, let \(\{ {O_b}\}\) represent the base coordinate system, and \(\{ {O_i}\} \) denote the coordinate system fixed to the robot. When \(i = 0\), it signifies the robot’s base coordinate system; When \(i = 6\), it represents the tool coordinate system that is fixed to the TCP of the robot which named point E. The remaining coordinate systems are fixed to the robot’s intermediary links.

The construction of the coordinate system adopts the standard D-H convention, which is commonly used in series open-chain robots. Under this convention, the transformation relationship between adjacent coordinate systems can be represented by a \(4 \times 4\) homogeneous transformation matrix:

(5)

where \({d_i}\), \({a_i}\), and \({\alpha _i}\) are constants determined by the robot’s configuration, whereas the joint rotation angle \({\theta _i}\) is a variable. Moreover, \({\varvec{q}} = {\left[ {{\theta _1},{\theta _2},{\theta _3},{\theta _4},{\theta _5},{\theta _6}} \right] ^T}\) is taken as the generalized coordinates of this robot.

Concurrently, a homogeneous transformation matrix is used to characterize the relative relationships between the centroid coordinate system \(\{ {O_{Ci}}\} \) of the robot’s i-th link and \(\{ {O_{i}}\} \), as well as between the robot’s base coordinate system \(\{ {O_{0}}\} \) and the base coordinate system \(\{ {O_{b}}\} \). This matrix is expressed as:

$$\begin{aligned} {}^i{{\varvec{T}}_{Ci}}(or{}^b{{\varvec{T}}_0}) = \left[ {\begin{array}{*{20}{c}} {{{\varvec{E}}_{3 \times 3}}}&{}{{}^i{{\varvec{P}}_{Ci}}{{(or{}^b{{\varvec{P}}_0})}_{3 \times 1}}}\\ {{{\varvec{0}}_{1 \times 3}}}&{}1 \end{array}} \right] \end{aligned}$$
(6)

where \({{}^i{{\varvec{P}}_{Ci}}(or{}^b{{\varvec{P}}_0})}={[\begin{array}{*{20}{c}} {{r_x}}&{{r_y}}&{{r_z}} \end{array}]^T}\) denotes the distance between the origins of the relevant coordinate systems in the x, y, and z directions.

By multiplying the transformation matrices in sequence according to the transitivity property, the coordinate systems of this robot can be described in the base coordinate system \(\{ {O_b}\} \).

$$\begin{aligned} \left\{ \begin{array}{l} {}^b{{\varvec{T}}_i} = {}^b{{\varvec{T}}_0}{}^0{\mathbf{{T}}_1} \cdots {}^{i - 1}{{\varvec{T}}_i}\\ {}^b{{\varvec{T}}_{Ci}} = {}^b{{\varvec{T}}_i}{}^i{{\varvec{T}}_{Ci}} \end{array} \right. \end{aligned}$$
(7)

Specifically, when \(i=6\), the matrix \({\varvec{T}}_6\) represents the mapping relationship between the position and orientation of the robot’s end effector and its joint angles. Furthermore, we can derive the Jacobian matrix \({{\varvec{J}}_{Ci}}\) using Eq. (7). This establishes a mapping relationship between the velocity and angular velocity of the centroids of the robot links and the derivative of the joint angles [15]:

$$\begin{aligned} \left[ \begin{array}{l} {{\varvec{v}}_{Ci}}\\ {{\varvec{\omega }}_{Ci}} \end{array} \right] = {{\varvec{J}}_{Ci}}{\varvec{\dot{q}}} \end{aligned}$$
(8)
$$\begin{aligned} {{\varvec{J}}_{Ci}} = \left[ \begin{array}{l} \begin{array}{*{20}{c}} {{\varvec{J}}_{Ci}^{v1}}&{\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} \cdots&{\begin{array}{*{20}{c}} {{\varvec{J}}_{Ci}^{vj}}&\cdots \end{array}} \end{array}}&{\begin{array}{*{20}{c}} {{\varvec{J}}_{Ci}^{vi}}&{\begin{array}{*{20}{c}} {\varvec{0}}&{} \cdots \end{array}} \end{array}} \end{array}}&{}{\varvec{0}} \end{array}} \end{array}\\ \begin{array}{*{20}{c}} {{\varvec{J}}_{Ci}^{\omega 1}}&{}{\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} \cdots &{}{\begin{array}{*{20}{c}} {{\varvec{J}}_{Ci}^{\omega j}}&{} \cdots \end{array}} \end{array}}&{\begin{array}{*{20}{c}} {{\varvec{J}}_{Ci}^{\omega i}}&{\begin{array}{*{20}{c}} {\varvec{0}}&\cdots \end{array}} \end{array}} \end{array}}&{\varvec{0}} \end{array}} \end{array} \end{array} \right] \end{aligned}$$
(9)
$$\begin{aligned}\left[ \begin{array}{l} {\varvec{J}}_{Ci}^{vj}\\ {\varvec{J}}_{Ci}^{\omega j} \end{array} \right]= \left[ \begin{array}{l}^b{\varvec{z}}_{j - 1} \times (^b{\varvec{P}}_{Ci}- ^b{\varvec{P}}_{j - 1})\\ ^b{\varvec{z}}_{j - 1}\end{array}\right] \end{aligned}$$
(10)

Where the matrix \(\varvec{P}\) represents the translational part of the homogeneous transformation matrix \(\varvec{T}\), and the vector \(\varvec{z}\) represents the third column of its rotational part \(\varvec{R}\).

Building upon the kinematics analysis, we can construct a dynamic model of the robot. The modeling method employed in this study is the Lagrangian method, which formulates equations from an energy-centric perspective. The process of establishing these equations is straightforward, systematic, and exhibits strong universality.

Taking generalized coordinates \({\varvec{q}}\) as previously defined and the external force \({\varvec{\tau }} = {\left[ {\tau _1^{},\tau _2^{},\tau _3^{},\tau _4^{},\tau _5^{},\tau _6^{}} \right] ^T}\), the following Lagrangian equation emerges:

$$\begin{aligned} \frac{d}{{dt}}\left( \frac{{\partial L}}{{\partial {{{\varvec{\dot{q}}}}^{}}}}\right) - \frac{{\partial L}}{{\partial {{\varvec{q}}^{}}}} = {{\varvec{\tau }}^{}} \end{aligned}$$
(11)

where L represents the difference between the system’s total kinetic energy \({E_k}\) and total potential energy \({E_p}\).

Due to the superposition principle of energy, a single component of the robotic arm can be analyzed independently. According to Konig’s theorem, the total kinetic energy of a rigid body in space is equal to the sum of the translational kinetic energy of the centroid and the kinetic energy of rotation around the centroid. Within the coordinate system \(\{ {O_b}\} \), the following relationship holds:

$$\begin{aligned} {E_{ki}} = \frac{1}{2}{}^b{\varvec{v}}_{Ci}^T{m_i}{}^b{{\varvec{v}}_{Ci}} + \frac{1}{2}{}^b{\varvec{\omega }}_{Ci}^T{}^b{{\varvec{I}}_i}{}^b{{\varvec{\omega }}_{Ci}} \end{aligned}$$
(12)

The formula presented above involves the inertia tensor of i-th link, which is expressed in the base coordinate system and changes with the spatial movement of the manipulator. This expression can be transformed into a representation based on the centroid coordinate system using a rotation matrix [16].

$$\begin{aligned} {}^b{{\varvec{I}}_i} = {}^b{{\varvec{R}}_{Ci}}{}^{Ci}{{\varvec{I}}_i}{}^b{{\varvec{R}}_{Ci}}^T \end{aligned}$$
(13)

The total kinetic energy of the system can be determined by substituting Eqs. (8) and (13) into Eq. (12).

$$\begin{aligned} {E_k} =&\frac{1}{2}{{{\varvec{\dot{q}}}}^T}\left( \sum \limits _{i = 1}^6 {{\varvec{J}}{{_{Ci}^\omega }^T}{}^b{{\varvec{R}}_{Ci}}{}^{Ci}{\mathbf{{I}}_i}{}^b{{\varvec{R}}_{Ci}}^T} {\varvec{J}}_{Ci}^\omega \right) {\varvec{\dot{q}}} \\ {}&+\frac{1}{2}{{{\varvec{\dot{q}}}}^T}\left( \sum \limits _{i = 1}^6 {\mathbf{{J}}{{_{Ci}^v}^T}{m_i}{\varvec{J}}_{Ci}^v}\right) {\varvec{\dot{q}}} \end{aligned}$$
(14)

Assuming that gravitational acceleration follows the negative z-axis direction of the base coordinate system \(\{ {O_b}\} \), and \({\varvec{g}} = {\left[ {\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} 0&0 \end{array}}&{ - 9.8} \end{array}} \right] ^T}\), the total potential energy of the system can be obtained:

$$\begin{aligned} {E_p} = \sum \limits _{i = 1}^6 {{E_{pi}}} = - \sum \limits _{i = 1}^6 {{m_i}} {{\varvec{g}}^T}{}^b{{\varvec{P}}_{Ci}} \end{aligned}$$
(15)

By subtracting Eqs. (14) and (15), substituting the result into Eq. (11), and then simplifying, we can obtain the relationship equation:

$$\begin{aligned} {\varvec{M}}({\varvec{q}},t){\varvec{\ddot{q}}} + {\varvec{C}}({\varvec{q}},{\varvec{\dot{q}}},t){\varvec{\dot{q}}} + {\varvec{G}}({\varvec{q}},t) = {\varvec{\tau }} \end{aligned}$$
(16)

where \({\varvec{M}}\) represents the inertia matrix, \({\varvec{C}}\) represents the matrix of centrifugal force and coriolis forces, and \({\varvec{G}}\) represents the gravity matrix. Their specific expressions are as follows:

$$\begin{aligned} {\varvec{M}} = \sum \limits _{i = 1}^6 {[{\varvec{J}}{{_{Ci}^v}^T}{m_i}{\varvec{J}}_{Ci}^v + {\varvec{J}}{{_{Ci}^\omega }^T}{}^b{{\varvec{R}}_{Ci}}{}^{Ci}{{\varvec{I}}_i}{}^b{{\varvec{R}}_{Ci}}^T} {\varvec{J}}_{Ci}^\omega ] \end{aligned}$$
(17)
$$\begin{aligned} {{\varvec{C}}_{ij}} = \frac{1}{2}\sum \limits _{k = 1}^6 {\left( {\frac{{\partial {{\varvec{M}}_{ij}}}}{{\partial {{\varvec{q}}_k}}} + \frac{{\partial {{\varvec{M}}_{ik}}}}{{\partial {{\varvec{q}}_j}}} - \frac{{\partial {{\varvec{M}}_{jk}}}}{{\partial {{\varvec{q}}_i}}}} \right) } {{\varvec{\dot{q}}}_k} \end{aligned}$$
(18)
$$\begin{aligned} {{\varvec{G}}_i} = - \sum \limits _{i = 1}^6 {{m_i}} {{\varvec{g}}^T}{\varvec{J}}_{Ci}^v \end{aligned}$$
(19)

Following the process outlined above, dynamic modeling is performed separately on both the left and right robots, yielding \({{\varvec{M}}^{l/r}}\), \({{\varvec{C}}^{l/r}}\), and \({{\varvec{G}}^{l/r}}\) respectively. We define the generalized coordinate of the dual-robot system as \({{\varvec{q}}} = {\left[ {\theta _1^l \cdots \theta _6^l,\theta _1^r \cdots \theta _6^r} \right] ^T}\). Subsequently, through matrix simplification, the unconstrained dynamic model of this system is derived:

$$\begin{aligned} {{\varvec{M}}_s}({\varvec{q}},t){\varvec{\ddot{q}}} = {{\varvec{Q}}_s}({\varvec{q}},{\varvec{\dot{q}}},t) \end{aligned}$$
(20)

where:

$$\begin{aligned} {{\varvec{M}}_s} = \left[ {\begin{array}{*{20}{c}} {{{\varvec{M}}^l}}&{}{}\\ {}&{}{{{\varvec{M}}^r}} \end{array}} \right] \end{aligned}$$
(21)
$$\begin{aligned} {{\varvec{Q}}_s} = \left[ \begin{array}{l} {{\varvec{\tau }}^l}\\ {{\varvec{\tau }}^r} \end{array} \right] - \left[ {\begin{array}{*{20}{c}} {{{\varvec{C}}^l}}&{}{}\\ {}&{}{{{\varvec{C}}^r}} \end{array}} \right] \cdot {\varvec{\dot{q}}} - \left[ \begin{array}{l} {{\varvec{G}}^l}\\ {{\varvec{G}}^r} \end{array} \right] \end{aligned}$$
(22)

In summary, the schematic representation of the kinematics and dynamics model of the unconstrained system is depicted in Fig. 2.

Fig. 2
figure 2

Kinematics and dynamics modeling of unconstrained system

4 Constraints extraction and standardization

In dual-robot collaborative operations for thin-walled surface mirror milling, multiple sources introduce complex constraints. Classical methods typically addressed constraints in a singular space or transformed other constraints equivalently into the same space, resulting in an incomplete consideration of the system. Leveraging the U-K method, it becomes possible to simultaneously extract constraints from various spaces without worrying about whether the constraint is holonomic or non-holonomic, as it will ultimately be recast into the form of a second-order differential canonical equation. In this section, we articulate these constraints through mathematical expressions, and the implementation of appropriate transformations and standardizations based on constraint-following theory presents another essential aspect in constructing a closed-chain dynamic model of the system using the U-K method.

First and foremost, the core constraint that we need to address in this study pertains to the collaborative control of the position and orientation of the dual-robot end effectors within the machining space. It is essential to ensure that the positions of the TCPs of the effectors on both sides of the complex surface remain corresponding, while simultaneously maintaining the axis directions of the two as always collinear. Fundamentally, this constraint requires the construction of collaborative equations integrating position constraints, orientation constraints, and workpiece geometric constraints.

Considering position constraints, let’s assume that the anticipated trajectory of point \(E^r\) on the machining side surface has been pre-determined. This path is decomposed into the x, y, and z directions of the \(\{ {O_b}\}\), followed by obtaining an explicit equation parameterized by time through either solving or fitting methods. Concurrently, the translation matrix \({}^b{\varvec{P}}_6^r\), ascertained in Section 3, depicts the position of point \(E^r\) within the \(\{ {O_b}\}\), with the varying rotation angles \({\theta _i}\) over time. By correlating it with the anticipated trajectory parameter equation, we can derive the following constraint equation:

$$\begin{aligned} \left\{ \begin{array}{l} x_E^r({\theta _1} \cdots {\theta _6},t) = {\alpha ^r}(t)\\ y_E^r({\theta _1} \cdots {\theta _6},t) = {\beta ^r}(t)\\ z_E^r({\theta _1} \cdots {\theta _6},t) = {\gamma ^r}(t) \end{array} \right. \end{aligned}$$
(23)

Remark 2

The \({\alpha ^r}(t)\), \({\beta ^r}(t)\) and \({\gamma ^r}(t)\) are time-dependent equations, serving to represent both the discretization of the trajectory and the derivative information corresponding to speed planning results. Here, our focus is on elucidating how to construct constraint equations using preplanned information in a generalized scenario, rather than exploring specific planning methods.

In order to ascertain the trajectory of point \(E^l\) on the follow-up support side, we combine the trajectory of point \(E^r\) with information about the workpiece surface. Let’s denote the closed equations of the surfaces on both sides under the coordinate system \(\{ {O_b}\}\) as follows: \(F^l(x,y,z) = 0\) and \(F^r(x,y,z) = 0\). We define the distance from a point on the right surface to the left surface, taken along the normal direction of the surface at that point, as the wall thickness \(\delta (t)\) [17], with this information already measured. The normal vector \({\varvec{n}}\) at a point \((x_0,y_0,z_0)\) on the surface can be obtained as follows:

$$\begin{aligned} {\varvec{n}}({x_0},{y_0},{z_0}) = {\left. {\left( \frac{{\partial {F^r}}}{{\partial x}},\frac{{\partial {F^r}}}{{\partial y}},\frac{{\partial {F^r}}}{{\partial z}}\right) } \right| _{x = {x_0},y = {y_0},z = {z_0}}} \end{aligned}$$
(24)

We substitute the analyzed points into the parametric equation of the trajectory curve, thereby converting \({\varvec{n}}\) into an expression dependent on t:

$$\begin{aligned} {\varvec{n}}(t) = {\left. {\left( \frac{{\partial {F^r}}}{{\partial x}},\frac{{\partial {F^r}}}{{\partial y}},\frac{{\partial {F^r}}}{{\partial z}}\right) } \right| _{x = {\alpha ^r}(t),y = {\beta ^r}(t),z = {\gamma ^r}(t)}} \end{aligned}$$
(25)

By integrating the information about point \({E^l}\) on the surface \({F^l}(x,y,z) = 0\), considering the direction of the line connecting \({E^l}\) and \({E^r}\) along the normal direction of the right surface, and taking into account the distance between the two points as \(\delta (t)\), we can determine the constraint equation for \({E^l}\):

$$\begin{aligned} \left\{ \begin{array}{l} {F^l}(x_E^l,y_E^l,z_E^l) = 0\\ {(x_E^l - x_E^r)^2} + {(y_E^l - y_E^r)^2} + {(z_E^l - z_E^r)^2} = {\delta ^2}(t)\\ \left| {\frac{{x_E^l - x_E^r}}{{{n_x}}}} \right| = \left| {\frac{{y_E^l - y_E^r}}{{{n_y}}}} \right| = \left| {\frac{{z_E^l - z_E^r}}{{{n_z}}}} \right| = \frac{{\delta (t)}}{{\left\| {\varvec{n}} \right\| }} \end{array} \right. \end{aligned}$$
(26)

By substituting Eqs. (23) and (25) into Eq. (26), the trajectory constraint equation of the follow-up point \({E^l}\) can be solved:

$$\begin{aligned} \left\{ \begin{array}{l} x_E^l({\theta _1} \cdots {\theta _6},t) = {\alpha ^l}(t)\\ y_E^l({\theta _1} \cdots {\theta _6},t) = {\beta ^l}(t)\\ z_E^l({\theta _1} \cdots {\theta _6},t) = {\gamma ^l}(t) \end{array} \right. \end{aligned}$$
(27)

Unlike the simplicity and straightforwardness of position description, existing methods for orientation description, such as rotation matrices, Euler angles, and quaternions, require a unique set of processing concepts for each approach, thereby lacking universality. Furthermore, in some methods, orientation is described from a coupled perspective, complicating subsequent constraint standardization processes and rendering the physical meaning unclear.

To address these issues, this study introduces a concise and versatile equivalent substitution approach. We define point H on the axis of the dual-robot end effector such that its distance from point E is l. We can obtain the coordinates of point H by modifying the final set of D-H parameters for point E. Since the relative positioning of the two points on the rigid body remains constant, we can use the vector \({{\varvec{n}}_{EH}}\), formed by their connecting lines, to represent the considered orientation. Utilizing this approach, we can construct the orientation constraint equation by ensuring that the projected component lengths of each vector onto the three axes of the base coordinate system are equivalent.

$$\begin{aligned} \left\{ \begin{array}{l} \left| {\frac{{{n_x}}}{{\left\| {\varvec{n}}\right\| }}} \right| = \frac{{\left| {x_E^l - x_H^l} \right| }}{{{l^l}}} = \frac{{\left| {x_E^r - x_H^r} \right| }}{{{l^r}}}\\ \left| {\frac{{{n_y}}}{{\left\| {\varvec{n}} \right\| }}} \right| = \frac{{\left| {y_E^l - y_H^l} \right| }}{{{l^l}}} = \frac{{\left| {y_E^r - y_H^r} \right| }}{{{l^r}}}\\ \left| {\frac{{{n_z}}}{{\left\| {\varvec{n}} \right\| }}} \right| = \frac{{\left| {z_E^l - z_H^l} \right| }}{{{l^l}}} = \frac{{\left| {z_E^r - z_H^r} \right| }}{{{l^r}}} \end{array} \right. \end{aligned}$$
(28)

By substituting Eqs. (23) and (27) into Eq. (28), we can solve the trajectory constraint equation for points \({H^l}\) and \({H^r}\):

$$\begin{aligned} \left\{ \begin{array}{l} x_H^{l/r}({\theta _1} \cdots {\theta _6},t) = {\lambda ^{l/r}}(t)\\ y_H^{l/r}({\theta _1} \cdots {\theta _6},t) = {\mu ^{l/r}}(t)\\ z_H^{l/r}({\theta _1} \cdots {\theta _6},t) = {\eta ^{l/r}}(t) \end{array} \right. \end{aligned}$$
(29)

As illustrated in Fig. 3, the trajectory constraints of the four points \({E^l}\), \({E^r}\), \({H^l}\), and \({H^r}\) now correspond to the transformed position and orientation collaborative constraints of the dual-robot end effector. Furthermore, owing to the generalization of the constructed collaborative constraints, this method can be viewed as a conceptual extension of the “extended tool virtual length" approach [2], mentioned in Section 1 for constant thickness and curvature scenarios, allowing its application to more general situations with varying curvature and thickness.

Fig. 3
figure 3

The conversion of the synergistic constraints of position and orientation to the equivalent four-point trajectory constraint

In some instances, along with ensuring coordination within the machining space, it is also necessary to introduce certain rotational speed requirements for the joint space. These can be expressed as non-holonomic constraints, as shown below:

$$\begin{aligned} \left\{ \begin{array}{l} \dot{\theta }_i^l = \kappa _i^l(t)\\ \dot{\theta }_j^r = \kappa _j^r(t) \end{array} \right. \end{aligned}$$
(30)

We take the first derivative with respect to time for Eq. (30), which serves as the non-holonomic constraint, and take the second derivative with respect to time for Eqs. (23), (27), and (29), which serve as the holonomic constraints. These derivative results are then reorganized to obtain the second-order standard differential form of the constraint:

$$\begin{aligned} {{\varvec{A}}_s}({\varvec{\dot{q}}},{\varvec{q}},t){\varvec{\ddot{q}}} = {{\varvec{b}}_s}({\varvec{\dot{q}}},{\varvec{q}},t) \end{aligned}$$
(31)

Particularly in the realm of practical engineering, cylindrical thin-walled shells stand out. They are widely utilized due to their optimal geometric shape, high specific strength, and high specific modulus. In such a specific scenario, the machining trajectory of the robot’s TCP on the surface can be depicted as a cylindrical helix or its simplified variant. Assuming that the direction of the surface guide line aligns with the x-axis of the \(\{ {O_b}\}\) system, and denoting the radius of the right surface as r and the thin-wall thickness as \(\delta \), we can formulate the constraint equation for point \({E^r}\) as follows:

$$\begin{aligned} \left\{ \begin{array}{l} x_E^r({\theta _1} \cdots {\theta _6},t) = kt + {c_1}\\ y_E^r({\theta _1} \cdots {\theta _6},t) = r\cos (\omega t) + {c_2}\\ z_E^r({\theta _1} \cdots {\theta _6},t) = r\sin (\omega t) + {c_3} \end{array} \right. \end{aligned}$$
(32)

Subsequently, the trajectory constraints for the remaining three points can be directly established through projection. This involves decomposing the total trajectory of the helix into circular arc motion around the surface generatrix and linear motion along the surface guide line. From a dimensionality reduction perspective, as illustrated in Figs. 4 and 5, one can intuitively observe that under the sub-motion around the generatrix, the trajectories of the four points form concentric circles, and the connection lines on both sides consistently follow the direction of the generatrix radius. Conversely, under the sub-motion along the guide line, the trajectories of the four points form parallel lines, with the connection lines on both sides remaining perpendicular to the guide line direction. Therefore, the trajectory constraint equations for the corresponding points \({E^l}\), \({H^l}\), and \({H^r}\) can be obtained by simply replacing the part related to r in Eq. (32) with \(r - \delta \), \(r - \delta - {l^l}\), and \(r + {l^r}\) respectively.

Fig. 4
figure 4

Concentric circular trajectories around the direction of the surface generatrix

Fig. 5
figure 5

Parallel trajectories along the direction of the surface guide line

5 System integration and solution

By combining the matrices \({{\varvec{M}}_s}\), \({{\varvec{Q}}_s}\) obtained from Eq. (20) with the matrix \({{\varvec{A}}_s}\) and vector \({{\varvec{b}}_s}\) obtained from Eq. (31), the explicit equation for the constraint can be obtained using the U-K method:

$$\begin{aligned} {\varvec{Q}}_s^c = {\varvec{{M}}}_s^{1/2}{({{\varvec{A}}_s}{\varvec{M}}_s^{ - 1/2})^ + }({{\varvec{b}}_s} - {{\varvec{A}}_s}{\varvec{M}}_s^{ - 1}{{\varvec{Q}}_s}) \end{aligned}$$
(33)

By adding the constraint term obtained to Eq. (20), we can derive the complete dynamic equation of the system under multi-source constraints.

$$\begin{aligned} {{\varvec{M}}_s}({\varvec{q}},t){\varvec{\ddot{q}}} = {{\varvec{Q}}_s}({\varvec{q}},{\varvec{\dot{q}}},t) + {\varvec{Q}}_s^c({\varvec{q}},{\varvec{\dot{q}}},t) \end{aligned}$$
(34)

Then, we multiply both sides of Eq. (34) by \({\varvec{M}}_s^{-1}\) from the left, enabling us to retain only the second-order terms on the left side while reorganizing the right side. Consequently, we arrive at a second-order ordinary differential equation that pertains to the generalized coordinate \({{\varvec{q}}}\):

$$\begin{aligned} \left\{ \begin{array}{l} {{{\varvec{\ddot{q}}}}}(t) = f({{\varvec{q}}}(t),{{{\varvec{\dot{q}}}}}(t),t)\\ {{\varvec{q}}}(0) = {{\varvec{q}}_0},{{{\varvec{\dot{q}}}}}(0) = {{{\varvec{\dot{q}}}}_0} \end{array} \right. \end{aligned}$$
(35)

where \({{\varvec{q}}_0} = {\left[ {\theta _1^{l0} \cdots \theta _6^{l0},\theta _1^{r0} \cdots \theta _6^{r0}} \right] ^T}\) and \({{\varvec{\dot{q}}}_0} =\) \({\left[ {\dot{\theta }_1^{l0} \cdots \dot{\theta }_6^{l0},\dot{\theta }_1^{r0} \cdots \dot{\theta }_6^{r0}} \right] ^T}\) represent the zero-order initial value and the first-order initial value of the system, respectively. These values can be obtained through inverse kinematics, by integrating the position information from the constraint equations constructed in Section 4 at the initial time, along with the speed information implicit in the derivative.

Equation (35) can be iteratively solved using the ode45 function, which implements the Runge-Kutta algorithm, built into Matlab. Summarily, the entire process of system modeling and solution is depicted in Fig. 6.

Fig. 6
figure 6

System modeling and solution flowchart

In real-world machining systems, the presence of friction, flexibility, and various sources of errors make it challenging to describe mirror milling system completely using the above-mentioned model. Therefore, we opt for an approach similar to common dynamics research, where we primarily focus on describing the fundamental characteristics of the system at the modeling level. The aspects that deviate from reality due to idealized modeling are addressed through feedback and compensation at the control level, aiming to achieve optimal machining outcomes. Additionally, our team possesses a mature adaptive robust control strategy, treating factors not considered in physical modeling as system uncertainties. This is also the focal point of our subsequent research.

Table 1 The D-H parameters and joint angle scope of the left robot

6 Numerical simulation and validation

Having established the overarching theoretical framework for the aforementioned mirror milling system, it is essential to validate its feasibility and accuracy. Currently, as we have not yet designed the corresponding control strategy based on this model, we are unable to offer experimental verification. Nevertheless, given that this research emphasizes the modeling of collaboration, we can directly utilize kinematic numerical simulations of the system to verify the correctness of the constructed equations. The main idea is to present a case and corresponding parameters, solve Eq. (35) to derive the robot’s various angular values at different times, and subsequently substitute these solutions back into Eq. (7). By doing so, we can examine whether the position and orientation of the robot’s end effector meet the expected requirements.

We take two parallel six-degree-of-freedom serial robots as simulation subjects, setting the relationship between their own base coordinate system \(\{ O_0^{l/r}\}\) and the base coordinate system \(\{ {O_b}\} \) as \({}^b{\varvec{P}}_0^l = {\left[ {\begin{array}{c} 0 \ 0 \ 0 \end{array}} \right] ^T} (\mathrm{{mm}})\) and \({}^b{\varvec{P}}_0^r = {\left[ {\begin{array}{c} 0 \ 3000 \ 0 \end{array}} \right] ^T} (\mathrm{{mm}})\), respectively. The D-H parameters and angle ranges for the dual robots are displayed in Tables 1 and 2. These parameters are imported into the Matlab robot toolbox [18] to establish a visual kinematic model. Further, we import a 3D model drawn in SolidWorks using the plot3d command, providing a visual representation of the robot’s structure. As illustrated in Fig. 7, the robot’s joints are well interconnected, and the relative positioning of the two robots aligns with expectations. Then, the dynamic parameters of the dual-robot system are taken as shown in Tables 3 and 4.

Table 2 The D-H parameters and joint angle scope of the right robot
Fig. 7
figure 7

Simulation model of dual robots

Table 3 The dynamic parameters of the left robot

Taking a thin-walled equally thick cylindrical surface as the part to be machined, and assume that the equations for the left and right curved surfaces in the coordinate system \(\{ {O_b}\} \) are:

$$\begin{aligned} \left\{ \begin{array}{l} {F^l}:{(y - 950)^2} + {(z - 1400)^2} = {500^2}\\ {F^r}:{(y - 950)^2} + {(z - 1400)^2} = {505^2}\\ x \in [ - 800,800] \end{array} \right. (\mathrm{{mm}}) \end{aligned}$$
(36)

As shown in Fig. 8, the cylindrical spiral line from the midpoint to the edge point of the developed surface on both sides of the part is taken as the simulation trajectory to explore the positional and orientational coordination of the two robot terminals.

Combining the equations of the curved surface, we can obtain \(r = 500\mathrm{{mm}}\), \({c_1} = 0\mathrm{{mm}}\), \({c_2} = 950\mathrm{{mm}}\), \({c_3} = 1400\mathrm{{mm}}\), \(\delta = 5\mathrm{{mm}}\), while setting \({l^l} = {l^r} = 100\mathrm{{mm}}\), \(\omega = 1\), and \(k = - 500\). Meanwhile, to demonstrate the versatility of our method with different types of constraints across various spaces, we apply fixed constraints to the sixth joint of the left robot and the fourth joint of the right robot. This serves as an example of non-holonomic constraints in the joint space. Once all the above parameters are substituted into Eq. (35), we can obtain the numerical solutions for the joint angles of the two robots at different times.

Table 4 The dynamic parameters of the right robot
Fig. 8
figure 8

The simulated workpiece and machining path selection

As illustrated in Fig. 9, the calculated values of the angles for both robots are within their respective ranges, and the line shapes are smooth without abrupt changes. Simultaneously, the angle values of the sixth joint of the left robot and the fourth joint of the right robot remain constant, satisfying the previously set fixed constraint requirements. By assigning the solved angle values to the established simulation model using the plot3d command, the motion process of the dual-robot system can be visualized. During the collaboration process, the end poses of both robots met expectations, and there was no collision or interference. The simulation process of the two robots is depicted in Fig. 10.

Fig. 9
figure 9

Numerical solutions of the various joint angles of the dual-robot over time

Fig. 10
figure 10

Mirror milling simulation process. a State of the system at the beginning of the simulation. b State of the system at 1/3 of the simulation time. c State of the system at 2/3 of the simulation time. d State of the system at the end of the simulation

We substitute the solution from Eq. (35) into Eq. (7) to define the actual trajectory in the simulation environment and compare it with the expected trajectory. The trajectories are decomposed into the x, y, and z directions of the coordinate system \(\{ {O_b}\}\) for comparison. As shown in Figs. 11, 12 and 13, the trajectories of the dual-terminal in the x, y, and z directions are straight lines, cosine curves, and sine curves, respectively. These trajectories align well with the expected values and maintain synergy.

Fig. 11
figure 11

The position of point E in the x-direction

Fig. 12
figure 12

The position of point E in the y-direction

Fig. 13
figure 13

The position of point E in the z-direction

Define the position error of the end effectors of the dual robots as the spatial distance between the actual and expected positions of point E at each moment.

$$\begin{aligned} e = \sqrt{{{({x_E} - \alpha (t))}^2} + {{({y_E} - \beta (t))}^2} + {{({z_E} - \gamma (t))}^2}} \end{aligned}$$
(37)

As shown in Fig. 14, the magnitudes of the position errors \({e_1}\) and \({e_2}\) for both left and right robots are around \({10^{ - 4}}\mathrm{{mm}}\), which can satisfy the requirements of machining accuracy.

Furthermore, the coordination of the dual-robot end effector’s orientation is evaluated using the vector formed by the connection of points E and H. As shown in Fig. 15, different line types distinguish left and right vectors, and gradient colors represent different moments, allowing for a direct observation of the consistency of the axial orientations of the dual-robot end effectors during the machining process. As shown in Figs. 16 and 17, projecting the two vector clusters onto the yoz-plane and yox-plane reveals their directions along the radial circular arc and the line perpendicular to the x-axis, respectively, corroborating the consistency of the dual end effector direction with the surface normal from the dimensional reduction perspectives shown in Figs. 4 and 5.

Fig. 14
figure 14

Position error

Fig. 15
figure 15

Directional vector of dual robots’ end effector

Fig. 16
figure 16

Projection of the directional vector of dual robots’ end effector on the yoz plane

Fig. 17
figure 17

Projection of the directional vector of dual robots’ end effector on the yox plane

Fig. 18
figure 18

Orientation error

Combining the cross product formula between vectors, the orientation deviation is defined as follows:

$$\begin{aligned} \varepsilon = \arcsin \left( \frac{{\left| {{\varvec{\xi }} \times {\varvec{\psi }}} \right| }}{{\left| {\varvec{\xi }} \right| \cdot \left| {\varvec{\psi }} \right| }}\right) \end{aligned}$$
(38)

where \({\varvec{\xi }}\) and \({\varvec{\psi }}\) represent the two vectors for which the degree of collinearity needs to be determined.

As shown in Fig. 18, the orientation errors between the actual and expected orientations of the left and right vectors, denoted as \(\varepsilon _1\) and \(\varepsilon _2\), are in the magnitude of \({10^{ - 7}}^ \circ \) to \({10^{ - 6}}^ \circ \). This confirms that the collaboration of orientations is highly effective, meeting the machining requirements of counteracting axial forces and reducing collisions.

Remark 3

The accuracy of solving a given model without incorporating external feedback and compensation is predominantly influenced by factors such as the precision of the initial value, the chosen iterative algorithm, and the calculated step size and tolerance. In our study, we validated that the position and orientation derived from the solution could concurrently achieve high accuracy. This result underpins the effectiveness of our collaborative modeling.

7 Conclusion

A system modeling approach grounded in the U-K method is proposed to tackle the challenge of constructing system dynamics due to the coupling effect of multiple-source constraints on robots during mirror milling operations. We have constructed the system’s unconstrained dynamics equation through the D-H convention, Jacobian matrix, and Lagrange equations, while simultaneously extracting multi-source constraints from the processing system and transforming them into a standardized constraint form. Then, using the U-K method, we integrate both to obtain the complete dynamics equations of the system. Lastly, the model’s effectiveness in terms of collaboration is verified through joint simulations with Matlab and Solidworks.

The innovations of this study are as follows:

  1. 1.

    Constraint extraction: Comprehensive constraints from both the joint and machining spaces are extracted, which are either holonomic or non-holonomic, catering to diversified machining needs.

  2. 2.

    Constraint transformation: By coupling the workpiece’s geometric constraints related to varying curvature and thickness, the position and orientation synergy constraints of the dual-robot end effectors are transformed into four-point trajectory constraints, enhancing both versatility and modeling convenience.

  3. 3.

    Constraint introduction: The U-K method is utilized, allowing constraints to be introduced into the system without the need for auxiliary variables or increasing system dimensionality, making the operation systematic and concise.

In future research, we will attempt to consider the stiffness and singularity of robots as special constraints and introduce them using the hierarchical clustering characteristics [19] of the U-K method to conduct more comprehensive modeling and optimization of existing systems. At the same time, we will also proceed with control design based on existing models, using adaptive robust strategies to treat the ignored factors in modeling as uncertainties, enabling them to be applied to real machining systems and improve machining quality.