Projecting robot dynamics onto trajectories

Abstract Machines and mechanisms realize processes, from the shaping process of a milling machine and the motion process of an automotive system to the trajectory realization of a robot. The dynamics of a machine generated by a properly chosen set of constraints in combination with an appropriate drive system is designed to meet the prescribed requirements of the process, which is done by projecting the machine equations of motion on the process dynamics. We get a set of nonlinear relations, which represent the machine motion in terms of the required process motion. A well-known example is the projection of arbitrary many robot degrees of freedom (DOFs) on a given path resulting in a set of nonlinear equations with one DOF only, the path coordinate s. Application of this idea can be used to construct a mobility space 
$(\ddot{s}, \dot{s}, s)$
 for any combination of coordinates and constraints. The paper presents a corresponding approach for n-link robots by applying multibody system theory. Method might be interesting for layout of machines and mechanisms. Practical aspects are discussed, and an example is given.


Introduction
A machine possesses a kinematic and a dynamic structure, so does the process. One art of engineering consists in matching both as optimally as possible. Physics and mathematics of mechanics can help, and this is the goal of the paper. To give an example: The problem of trajectory planning for robotic systems is well known from the beginning of robotic research during the seventies and eighties. Especially, one approach has been particularly successful at that time. It represents a prescribed path by one degree of freedom (DOF) only, namely the curvilinear coordinate s along that path. All robot DOFs were then projected to this single path coordinate coming out with a linear system of ordinary differential equations of motion in the square of the path velocity. Many large applications and comparisons with measurements were carried through at that time [1][2][3][4][5][6]. The original idea for such an approach, by the way, comes from military research, being obvious.
In traditional mechanism theory and related fields, we find also many applications using mathematical concepts with very similar properties. It is possibly the first area trying from the very beginning to find a synthesis for more and more complicated mechanisms of plane and spatial nature, and it has been mainly represented by many scientists of a very high standing community [7][8][9], to name a few.
By analyzing various types of processes, we shall find an astonishingly large number of processes being defined by a trajectory only, from manufacturing and transport technologies to trajectory realization of robots. Therefore, the one-dimensional robot example includes a certain amount of generality. In addition, this idea might be generalized by considering processes with more than one DOF, which means multiple trajectories. We shall not pursue that here.
We may look to this step from the machine to the process or vice versa also in another way of arguing. Forcing a machine to perform a certain process, and the machine can do that only by a correspondingly good arrangement of its own constraints, means nothing else, that the contact element of that machine with the external world must follow the prescribed process kinematics and possibly some forces C The Author(s), 2023. Published by Cambridge University Press. This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited. necessary for the process. A gripper of a robot follows a given path for example, or it performs a pegin-hole process, as perfectly as possible. This is nothing else than running some additional constraints characterizing the process, in our case some path tracking.

Equations of Motion
Usually, kinematics and possibly some forces of a robot process are known, and the dynamics is unknown. This requires a multibody-dynamical model of the robot with the necessity, that all components follow the prescribed path or process. We start with possible models for the robot. In a first step and for later definitions, we consider Jourdain's principle of lost power for a rigid multibody system [2,[10][11][12].
where v O , ω are the translational and rotational velocities; m, I, O are the masses and mass moments of inertia; O , S are the reference point and center of gravity; and f g , f e , f a , f p , f c are the gyroscopic, applied, driving, process, and constraint forces and torques. We have included also the case of a time-dependent mass matrix, which appears for rigid reference frames. Equation (1) is defined in a 6 -space for each component, for n components in a 6n -space. With we come to the corresponding vectors in the 6n -space (n = n c number of components), and with we define the mass matrix of the total system. From this, Eq. (1) takes on the form The virtual velocities δż cannot be chosen arbitrarily, but they must satisfy side conditions in the form of constraints, usually given by (˙ = W Tż +w = 0) [10]. The W-matrices are Jacobians defining the tangential constraint surfaces. The constraint forces are perpendicular to these manifolds. All constraints are assumed to be bilateral and independent from each other. For a classification of constraints, see, for example, refs. [2,10].
Following the ideas of Jacobi [11] in the form given in ref. [10], we come out finally with the typical structure of classical multibody equations with constraints The mass matrix is positive definite and symmetric. The vectorw might be time-dependent elements of a constraint structure, see, for example, Eqs. (32)−(34). The constraints˙ include robot and path constraints . The equations above may be solved using or evaluatedz Due to the special requirements of dealing with multibody systems, many bodies forming a system like a machine, it makes sense to work with body-fixed coordinates and inertial ones. They are connected by a set of transformations, which have to be defined. For our robot case, it will be given in the following sections [2,12].
Furthermore, we shall use a convenient property of the above relations. If the coordinate z depends on some other coordinates q, where z might be non-minimal and q might be minimal, then from ref.
which is helpful for eliminating the constraint force f c = −W(z, t)λ from the equations of motion, by premultiplying with ( ∂z ∂q ) T . This is nothing else than a projection into the tangential planes as spanned by the constraints, characterized by free motion and no constraints anymore. Considering that case [z = z(q)] in more detail and applying Eqs. (8) to (5) If q are robot coordinates, they depend on the path coordinates s, (q = q(s)). Considering in additioṅ we get from (9) a set of ordinary differential equations linear in the square of the path velocityṡ 2 , which can be organized in the following way: These relations define straight lines in the plane (ṡ 2 ) , (ṡ 2 ) for each s = constant in such a way that every of the n q equations describes two parallel lines for a maximum and a minimum value of the driving torques. Note that, due to using an inertial frame, f g q corresponds to the coefficient B(s). Working with body-fixed frames, it must additionally be determined.
If we want in addition to evaluate the constraint forces or torques, we must go back to Eqs. (5) and (6), and we must define the constraints. With respect to these constraints, we might consider two possibilities: first, including all constraints concerning joints and ground contact, or second, including only the ground contact constraint. Last case is of interest, if the joint constraints are already known

Polygon approach
The general mobility problem for a robot (machine) following a prescribed path (process) is, for example, the following: evaluateṡ(t) with s(0) = 0, s(t F ) = s F ,ṡ(0) = 0,ṡ(t F ) = 0 in such a way that some performance criterion will be met. Such criteria might be minimum time, minimum energy, maximum mobility, and the like. The solution of this problem is practically constrained, where the most important ones are as follows. First, the driving torques or forces are limited, which means from the relations above where the last equation can be seen as a further additional constraint. Other possible constraints are the following: The angular or translational velocities of constraining elements may be limited due to some maximum speeds of the drive train components (q i,min ≤ [q iṡ ] ≤q i,max ), and the path velocity itself might become constrained by some manufacturing process (− v max ≤ |r |ṡ ≤ +v max ) with the vector r from the constrained machine (robot) element under consideration to a process path point. These relations define together a maximum velocityṡ L along the path which must not be exceeded ( Fig. 1): Additional limits may enter by process forces, usually in the form of process constraints. A typical example is force vector direction, which occurs when a robot follows a polishing trajectory requiring a certain amount of contact pressure with respect to a prescribed direction. Examples of that type are also typical for many machine tools. Evaluating the polygons of mobility space, such conditions additionally constrain the field of allowed motion, see Fig. 2.
A first step to the solution of the mobility problem may be done in the following way: We look at Eq. (13) for the limiting cases (T i,min , T i,max ) stating that maximum mobility can only be achieved by applying in a maximum number of joints the limiting torques or forces. In addition, we may influence mobility by the distribution of drives in the various DOF elements. Operating at the power limits, we get the two equations which define two straight lines in the [(ṡ 2 ) , (ṡ 2 )]-plane, Fig. 1.
The altogether (2f D ) straight lines (f D ≤ f ) form a polygon confined at the left side by the axis (ṡ 2 ) = 0 and at the right side by the (T i,min , T i,max )-straight-lines or by the constraint (ṡ 2 ) L given by Eq. (14). Additional limits may enter by the constraint forces and corresponding requirements, Fig. 2. Without violating the constraints, which may be extended without much problems, motion can take place only within the polygons or on their straight line boundaries, which contain the following information: the maximum possible velocityṡ 2 max and for each point (ṡ 2 ) a maximum and a minimum acceleration or deceleration [(ṡ 2 ) max , (ṡ 2 ) min ]. For example, finding time-optimal solutions we have to go along the assemblage of these polygons and generate what we call extremals. Combining all polygons for all path points s, we obtain a constrained phase space bounded by ruled surfaces due to the straight line characteristics of the polygons. We call this motion or mobility space. These polygons appear as plain cuts perpendicular to the s-axis, see results of Fig. 10.

Polygon evaluation
Many ways of polygon evaluation are conceivable, where from a test of several methods the numerically most effective one has been selected. In a first step, all double straight lines are assorted according to  The formal steps are (Fig. 3) where the S max,min are depicted by Fig. 3, P s stands for the polygon structure composed by the S m , and P total is the complete structure composed by all S m . In Fig. 3, all points along the cut m are within the blue strip points, being the largest one. One of the dark blue points lies within the two black points, which together with one dark blue point define the smallest range of allowed motion for the corresponding cut. The smallest distance of two points is then the result for one cut m. These two points usually are not two points of the same robot link, but from different ones. This makes a consistent algorithm difficult. But it is mandatory that the upper point comes from a T max -line and the lower one from a T min -line.

Surface differential geometry
The surface differential geometry is not used directly in the following evaluation, but elements of it are needed, when determining time-optimal solutions. For this case, an integration from one polygon line to the next one will be necessary as depicted in   also the robot example of Fig. 10. Applying to these structural elements classical surface theory [13] gives the fundamental form of these ruled surfaces as generated by the relevant polygon lines. According to the relations (15), we putB = B(s)/A(s) not considering here the case A = 0.
As a first step, we introduce the parameters (u, v), where u follows a selected polygon line from r 0 to r 1 , and v = s is the path coordinate. The angle γ is the slope given in the specific coordinate system of Fig. 4. According to Eq. (15) and Fig. 1 the angle γ results from (tan γ (s) =B(s)). Note that the expressionB =B(s) and from that γ = γ (s) = γ (v). Keeping that in mind and using the relations together with vector r from Fig. 4 the first fundamental form of the surface writes (() = ∂ ∂s ) In a similar way, we determine the second fundamental form using the well-known relations Knowing the first and second fundamental form, Gauss and mean curvatures can be determined by the expressions by considering the results above. The main curvatures k i follow from the equation (k 2 i − 2Hk i + K = 0). With K = 0, we get The Gauss curvature is zero, K = 0, a condition defining ruled surfaces. The mean curvature H exists only in path direction s = v and depends on path geometry and certain mass effects. Figure 5 can be used to organize an integration following the ruled surface of the mobility space. This will be necessary for example evaluating the extremals, which go along the ruled surfaces stepping from some polygon i to the neighboring polygon (i + 1) (see chapter 5.2). The problem is solved by considering the following equations: Knowing s these relations is enough to determine the unknown quantities for the polynom (i + 1) by an iteration process being necessary for two reasons: first to realize numerical stability and second to meet the correct line of polynom (i + 1) also in the case of an integration step passing an intersection of two polygon lines.

Example Multi-DOF-Robot with Revolute Joints
In the following, we shall consider the magnitudes used in Eqs. (11) and (12), which stand for the equations of motion and those for the constraint forces. Inertial reference is applied.

Kinematics
A robot with n q revolute joints can be described by Cartesian z-coordinates and by angular q-coordinates. The projections (z → q → s) have been discussed before. With respect to the q-coordinates, relative and absolute versions are needed (Fig. 6) The z-coordinates are defined in the following way (2): With these definitions, the joint vectors z Ji and the center of mass vectors z Ci possess the following elements (J = joint point, C = center of mass): It should be noted that for the rotation around the vertical inertial z 1 -axis (Fig. 6) the above vectors are zero, r Ji = 0, r Ci = 0. The angular velocities ω i are determined by the well-known relations Iωi = A IB A BI =Ȧ IB A T IB with the result [2] (I = inertial, B = body) The matrix A IB follows from two rotations, first around the inertial z-axis, and second around the body-fixed y-axis. For i = 1 (first DOF with q 0 ), the angular velocity is I ω 1 = B ω 1 = (00q 0 ) T . Establishing the equations of motion, the derivations (( ∂z ∂q ),q ,q ) are needed. They can be evaluated from the relations (26) and (27). In the following, only a few examples are given.
The gradient ( ∂z ∂q ) follows from (example IżJi ) Knowing ( ∂z ∂q ), we get by an additional derivation the matrix for ( ∂ 2 z ∂q 2 ). The projections ofq with respect to s are evaluated numerically bȳ To determine the same information for the angle q 0 , we start with the (x,y,z)-position of each trajectory point and calculate q 0 and its derivatives (Fig. 6) For our specific case of a n-link robot following a trajectory, we determineq =q(r(s)) by an optimization algorithm.
For positioning the robot end effector at the target point, we apply formula (26) and require (Fig. 6) r Jn = r(q(s)) = where the path data (xyz) T trajectory are given. The relation above represents then a nonlinear set of equations for the determination of robot coordinatesq, being solved by standard methods [13].

Constraint geometry
A two-link robot tracking a path moves with six constraints, three constraints for vertical and two horizontal joints and three constraints for keeping the robot end effector on a given trajectory, Fig. 8. Starting with the three robot constraints, regarding the structure of Fig. 8 indicating a circular motion of all links, the joint constraints write 0 = x 2 1 + y 2 1 − (l 1 cosq 1 ) 2 = 0, where (x l2 , y l2 , z l2 ) = l 1 d 1 (x 1 , y 1 , z 1 ) are the coordinates of the end point of link 1. Following some trajectory produces three additional constraints These equations must be differentiated twice for the corresponding form [˙ = W Tż +w = 0,¨ = W Tz +ŵ = 0] of Eq. (5), which results in To meet the formal requirements of Eqs. (5) and (25) null-matrix, W 0 has the dimension 3,6 and null-vector w 0 the dimension 3 . The constraints do not include rotations. For constraint kinematics, we have to determine the robot coordinates for some given path point. This is done by going from robot workspace to joint space. The resulting magnitudes are used to evaluate the derivatives with respect to the path coordinate s by numerical methods. The constraint matrix W is needed mainly for determining the constraint forces. At the end of the section, we consider an example.
The motion of the robot may start at a point (ξ 0 , η 0 ) and end at (ξ E , η E ). For generating a spiral path, the number is n x , so the repeating circle step is ξ = (ξ E − ξ 0 )/n x . A point on the "moving" circle is (ξ C = r cos ϕ, η C = r sin ϕ) with r the circle radius. With these data, the end effector position and the rate of change with the path coordinate s are determined as The number n is the number of circles already performed, n ≤ n x . Necessary derivatives write The expression for z follows from Eq. (31), the resulting constraint forces (torques) from the relations (12).

Masses and forces
According to Eq. (1) the mass matrix and its derivatives write For some link i, we choose as a reference point the center of mass S, which makes r O S = 0 anḋ r O S = 0. A special case is the first coordinate q 0 , where the reference point O is the coordinate origin and the distance to the link centers of mass (r O S ) i = 0. For this case and according to Eq. (26), we have (r O S ) i = r Ci . The moment of inertia for the bar-like links alone is . As a further step, we have to evaluate the forces and torques considered in an inertial system. The external and applied forces and torques (Fig. 7) are

Results for a Robot with Three Revolute Joints
An illustrative example is a two-link robot performing a circular vertical path, for which we present some comparisons with old measurements of the time-optimal path torques, Fig. 9 (top, left). Theory and measurements compare well, the high frequency oscillations of the measured data are due to the robot measurement system [2,3,14]. The results confirm the basic idea of the paper.  Figure 9. Comparison theory/measurements for a two-link robot [2,3].

Tracking a given trajectory
To illustrate more in detail the theory above, we consider the motion along a horizontal circle. Evaluating Eq. (15) for each trajectory point with the coordinate s results in Fig. 10, which depicts on the left side (top) the horizontal circle with a robot indication and in addition polygons for six trajectory points. These polygons are scaled equally, giving some feeling for the motion capabilities of the robot around the circle. The points farthest away from the robot base show relatively small motion areas due to the fact that the robot, being there in a stretched position, has to counterbalance his own weight, and very large moments of inertia for the vertical drive leave less power for velocity and acceleration. At the position of start level and of the position 180 • , opposite velocities are largest but accelerations diminished. Motion at these points is dominantly performed by the arm drives and not so much by the vertical drive with angular velocityq 0 . Another situation is illustrated by the two points nearest to the robot base, exhibiting large acceleration capabilities and medium-sized velocities. They are dominated by the drive around z withq 0 .
Beginning at the start position and then going along the trajectory and arranging the six polygons in the [(ṡ 2 ) , (ṡ 2 )] -plane comes out with the right picture (top) of Fig. 10, where each element represents a polygon for s = constant. Taking into consideration, some more polygons result in the left picture (bottom) of Fig. 10. As could be expected, we get for the complete trajectory a "line-free" area of motion allowing any solution within the given drive limits (T i,max , T i,min ) without touching some constraint. Printing these polygons not onto one plane but extending them along the path coordinate s gives the right graph of Fig. 10 bottom. The "entrance" to this structure corresponds to the polygon at the start point of Fig. 10 (top).
Altogether it is a mountain-like construct generated by straight lines forming ruled surfaces as an exterior boundary. Motion can only take place on these ruled surfaces originating from the extremum drive torques or forces, or it can take place in the space bounded by these ruled surfaces. For ruled surfaces, see ref. [15] or elsewhere.
The motion space of Fig. 10 represents a convenient tool for studying various solution and motion concepts. For example, to go with constant velocity within the free space we put (ṡ 2 ) = 0 and get immediately the necessary torques from Eq. (15), namely T(s) = B(s)(ṡ 2 ) + C(s). A more interesting case is that of time-minimum motion requiring to find trajectories on the ruled surfaces.

Extremals
From Eq. (15), the extremals are constructed from the upper part and from the lower part of the polygons, from the side with maximum accelerations (ṡ 2 ) max containing the max-extremals, and the side with minimum accelerations (ṡ 2 ) min containing the min-extremals ( Fig. 1 and section 3.1). Figure 11 illustrates the projections of these extremals together with the maximum velocities from motion space onto the [ṡ 2 − s] -plane.
A time-optimal solution, for example, must be composed by several of these extremals for the following reasons. Requiringṡ 2 = 0 at s = 0 and s = s F requires to follow a certain combination of extremals for arriving at the final point. Such a procedure needs an integration of the equations of motion along the ruled surfaces and thus from polygon at s to the next one at (s + s). Integration on polygons excludes normally a progress along the rim of the motion space, exceptions are possible [3]. Figure 11 illustrates that procedure. The blue extremal at the beginning connects s = 0 with the maximum velocity curve at s ≈ 1.7, and the green extremal at the end connects s = s F ≈ 8.8 with s ≈ 6.9. Note that the blue extremals are on the motion space side with maximum accelerations and the green on the side with minimum accelerations. At a possible intersection point of the blue and green extremals, the torques and forces make a corresponding jump, because such intersection points are usually not minimum points with A i = 0. As a further step, we construct all extremals originating from the saddle points (minimum points) at s ≈ 2.2 and at s ≈ 6.7. These are points, where at least one coefficient A i ∈ A of Eq. (11) vanishes, thus allowing a smooth step from one side of the motion space to the other one. The  extremals emanating from these points intersect the extremals coming from the beginning and from the end, and in addition for our example, they themselves intersect at a point s ≈ 4.3. The resulting ensemble of six curve elements forms the time-optimal solution for the motion under consideration, avoiding any limits and problems with rim contacts.

Driving torques
For considering driving torques along a time-optimal solution, we select a trajectory example as it might be used for polishing work. Figure 12 depicts the situation for a spiral trajectory as shown by the left graph. The ruled surface mountain structure is not shown, but only the projection of this construct onto the (ṡ 2 ) −ṡ 2 -plane, comparable to Fig. 10. This collection of quite a number of constraining polygons reveals again the useful property of such problems, namely a free area not cut by polygon lines. Within the mountain structure of the mobility space, this area indicates a kind of tunnel, in which any motion might take place without touching limiting constraints.
Knowing all kinematic data for time-optimal tracking a given path (Fig. 11), it is easy to calculate the necessary torques for following that path just by applying the equations of motion (11) in a reverse way: prescribed kinematics, solve for the torques. The result is given by the right graph of Fig. 12. It demonstrates the necessity that for time-optimal motion at least one of the three drives must work at its limits. For some rough orientation, the time-optimal extremals are indicated. The following conclusions may be drawn: at the beginning and at the end of the path motion is controlled by the maximum torque of the third joint, the two other joints look for balancing. About the path middle, the basic joint around the vertical axis contributes with maximum torque. These activities bring the robot from the start with path velocity zero to the end again with zero velocity.   Figure 13 illustrates the same situation for a trajectory composed of six spiral elements. It is also a numerical test demonstrating numerical stability, which cannot be taken for granted. The structure as shown in Fig. 12 is repeated six times, the properties for each revolution remain approximately the same.

Constraint torques
The constraint forces and torques are evaluated according to Section 2. For our specific example, it is assumed that all constraints are already satisfied with the exception of the ground contact, see end of section 4.2. We remember also that constraint forces depend only on path velocity and path coordinate and not on the path acceleration, f c = f c (s,ṡ 2 ), Eq. (12). We shall consider a spiral form path with the properties and results as depicted in Fig. 14, which shows velocities and torques for the time-optimal case.
As an example, this time-optimal velocity distribution and its optimal velocities are taken for evaluating the constraint torques. Figure 14 depicts on the left side the maximum and the optimal velocities and on the right side the corresponding torques necessary to generate these velocities. They are the constraint torques for keeping the robot end effector in a plane with constant z. Roughly spoken, these constraint torques are about 40% of the driving torques for the same case, Figs. 12 and 14. Note that these torques are a maximum only for one joint, which is typical for such problems. From the practical standpoint of view, no machine can be operated with all drives working on a maximum power level.

Conclusion
The method presented in this paper is formulated generally by considering multibody systems in a first step, and it is then specialized to a robot with revolute joints as an example. Starting with a formulation according to Lagrange I (Jacobi), the DOFs of any multibody system are projected to one prescribed trajectory of arbitrary shape resulting in relations following one DOF only. The projecting tools are constraint derivatives, which are evaluated from the geometry of the multibody structure together with the given trajectory.
The emerging relations represent a system of ordinary linear differential equations in (ṡ) 2 , the square of path velocity, with highly nonlinear coefficients including the complete MBS (robot) -configuration. They possess a quadratic form related to geodesic type equations. All structural data are compressed in two coefficient systems, an amazing fact. For example, the coefficients A, B, C include the total geometric and topological information of the robot under consideration. And they can be used to build a mobility space, where the motion takes place. This space represents a useful tool for improving and for facilitating design of mechanical systems in general and of robotic systems in particular.
Constructing a mobility space requires some new algorithm. The property "system of ordinary linear differential equations in (ṡ) 2 " together with the definition of two driving torques T i,min , T i,max allows to generate two parallel straight lines for every drive component and for constant s, namely in the plane [(ṡ 2 ) (s),ṡ 2 (s)] of modified acceleration and velocity. The intersections of all these lines form a polygon, where motion can take place without constraints. Arranging all polygons along the path coordinate s produces a space bounded by ruled surfaces, called mobility space.
The relations are specified for a robot with any number of revolute joints and numerically evaluated for one with three joints and two links. The results demonstrate a bounded motion space being used for determining time-optimal solutions or for checking over any other motion possibility without violating constraints. They form the bounds of the motion space composed by ruled surfaces. Method is useful for layout purposes. Financial support. This research received no specific grant from any funding agency, commercial, or not-for-profit sectors.

Conflicts of interest. The author declares no conflicts of interest exist.
Ethical approval. Not applicable.