1 Introduction

A multibody mechanical system is composed of three main ingredients, i.e., a collection of bodies describing large rotational and translational motions, joints kinematically constraining the relative motion of the bodies, and force elements acting upon those bodies [1,2,3,4]. For spatial systems, each body has six degrees of freedom, namely three translations and three rotations. When introducing a mechanical joint into a certain multibody system, the number of degrees of freedom is reduced. Depending on the relative degrees of freedom allowed, mechanical joints can be classified as revolute joints, translational joints, spherical joints, universal joints, among others. Each type of joint allows certain relative motion between adjacent bodies [1, 3]. In classical joint models, the relative motion associated with each joint does not have any limits or restrictions. In other words, the range of motion (RoM) is limitless and unrestricted. These features are not compatible with actual mechanical joints, where some bounds are necessary from the functional and operating point of view.

In a simple manner, the RoM can be defined as the relative amplitude of motion permitted at a joint and it is influenced by the geometric configuration of the bodies adjacent to the joint, by the joint itself, and by the materials existing around the joint. The materials allow energy dissipation and have an effect on the functionality and durability of the joint. In the multibody systems formulation, mechanical joints are typically formulated as classical kinematic constraints, which do not allow the restriction of the RoM of the bodies connected by them. Thus, additional restrictions to prevent the joints from performing movements that are not acceptable and to avoid unrealistic or unacceptable configurations of the connected bodies must be incorporated into the formulation. Although this may not be a problem for some studies, in many applications, the mechanical joints are subjected to physical limits. Consequently, the restriction of the RoM of the bodies connected by mechanical joints is required to allow the appropriate functioning of the multibody system. Two typical examples where the restriction to the RoM on the joints is utilized are car suspensions [5, 6] and human articulations [7,8,9,10], in which the relative motion associated with them is restricted by the physical limits related to the adjacent bodies and actual joint nature.

The RoM restriction is of particular interest in optimization studies considering a forward dynamics analysis, as it ensures that the simulation does not converge into unrealistic solutions. The reliability of a dynamic simulation of a multibody system is highly dependent on the accuracy of its mechanical response. Therefore, the development of methodologies that realistically and accurately restrict the RoM of mechanical joints is needed to correctly model multibody systems, providing more accurate results. An assessment of the scientific literature indicates that the restriction of the RoM of mechanical joints has been explored in many research areas employing different approaches. In the particular area of biomechanics, to restrict the range of motion of joints, Yamaguchi [11] utilized moments that represent the passive elastic structures surrounding the joint, such as ligaments and cartilage, which were modeled as nonlinear springs and damper. In robotics, Nasr et al. [12] considered the approach proposed by Yamaguchi [11]. Other authors [13, 14] modeled joint moments as nonlinear springs, but neglected the damping component. Hatze [15] stated that the stress–strain relations of the elastic components of the passive structures and the damping coefficients of the viscous components existing around human joints were both exponential. Nagano et al. [16, 17] utilized the approach proposed by Anderson and Pandy [18], in which moments were applied to simulate the action of the ligaments and to prevent physically impossible joint angle values. The ligament moments were modeled as nonlinear springs. Robbins [19] divided the joint moments into three categories, namely elastic, dissipative, and stop moments. Some authors [20,21,22,23] presented methods to define joint sinus cones and to restrict the RoM of joints, including box limits, spherical polygons, and reach cones. In robotics, several studies [24,25,26,27] utilized optimization techniques to restrict the RoM of the joints of robots. In some approaches, the distance between the current joint position and a position half-way between the upper and lower joint limits was considered in the objective function [24], while other authors [25, 27] established a mapping relation between joint limits and arm angle values using arctangent and arccosine functions. Ambrósio and Pombo [5] employed a penalization method to restrict the RoM of mechanical joints, in which an appropriate force relation is introduced in the force vectors of the bodies connected by the joint. The restriction of the joint’s RoM is also useful for crash test dummies, also known as anthropomorphic test devices, in crashworthiness studies to simulate the human response to impacts, accelerations, and forces generated during a crash [28, 29].

As it was concluded in the previous paragraphs, there are several methods in the literature that allow the restriction of the RoM of joints. However, the focal point of this work relies on the approach proposed by Silva et al. [30], which applies a penalty moment when the RoM is exceeded and constitutes the foundation for the methodology proposed here. The work presented in this paper aims to extend and improve the approach presented by Silva et al. [30], specifically in what regards to the definition of the RoM limits, the calculation of the penalty moments, and the establishment of their direction of application. Thus, the preservation of the mechanical energy of the system is guaranteed when an elastic resistance is considered. Enhanced methods to deal with the detection of unacceptable joint configurations are proposed. The methodology defines the RoM limits based on a circumduction cone, which makes it specifically targeted to joints allowing rotational degrees of freedom, namely spherical, revolute, or universal joints. A parametrization procedure of the circumduction cone is described to correctly calculate the direction of the penalty moments to apply to the connected bodies. The proposed methodology is best suitable to be applied to forward multibody dynamic simulations, since it guarantees that the joints do not reach unfeasible positions.

The remaining of this article is organized as follows. Section 2 provides a short description of the Newton–Euler equations of motion for constrained multibody systems. A complete explanation of the proposed methodology to restrict the RoM of mechanical joints is provided in Sect. 3. In Sect. 4, the methodology is exploited in the dynamic modeling and simulation of one demonstrative example of application, namely a simple pendulum. Several analyses are carried out to assess the influence of the application of the methodology on the dynamic response of the simple pendulum multibody system. Finally, the present work ends with the concluding remarks described in Sect. 5.

2 Multibody systems formulation

The multibody dynamics analysis allows not only the development of mathematical models of the equations of motion of the systems to be analyzed, but also the implementation of computational procedures to simulate, analyze, and optimize the motion generated. The Newton–Euler approach is one of the most commonly used formulations in several fields as it is simple, direct, and quite intuitive to model multibody mechanical systems [2,3,4, 31, 32]. Assembling the Newton–Euler equations of motion for a constrained multibody mechanical system and the accelerations constraints equations, the governing equations for a dynamic multibody system with holonomic constraints are formulated as [1]

$$ \left[ {\begin{array}{*{20}c} {\mathbf{ M}} & {{\mathbf{D}}^{\text{T}} } \\ {\mathbf{D}} & {\mathbf{0}} \\ \end{array} } \right]\left\{ {\begin{array}{*{20}c} {{\dot{\mathbf{v}}}} \\ {{\varvec{\uplambda}}} \\ \end{array} } \right\} = \left\{ {\begin{array}{*{20}c} {\mathbf{g}} \\ {{\boldsymbol{\gamma -}}2\alpha {\dot{\boldsymbol{\Phi }}} - \beta^{2} {{\varvec{\Phi}}}} \\ \end{array} } \right\} $$
(1)

where M is the system mass matrix, D represents the Jacobian matrix of the constraint equations, \({\dot{\mathbf{v}}}\) denotes the vector containing the system accelerations, λ is Lagrange multipliers vector that contains the reaction forces and moments on the kinematic joints, g represents the generalized vector of applied forces and moments, and γ denotes the right-hand side vector of the acceleration constraint equations. Variables α and β are the feedback control parameters of the Baumgarte stabilization technique for velocity and position constraint violations, respectively, and are taken as positive constants. The terms Φ and \({\dot{\boldsymbol\Phi }}\) represent the position and velocity constraint equations, respectively [1, 2, 4].

Equation (1) may be described as a combination of the differential equations of motion and the algebraic kinematic constraint equations, often referred to as a set of differential algebraic equations (DAE). If the Baumgarte method is not considered, the resulting equation does not explicitly include the position, Φ, and velocity, \({\dot{\boldsymbol\Phi }}\), constraint equations. For moderate or long simulations, this results in the violation of the original constraints formulated for the problem. This violation might be related to the integration procedure, selected time step, and/or inaccurate initial conditions [1, 2, 4, 33].

3 Proposed methodology

The methodology proposed in this work lays its foundations on the work developed by Silva et al. [30], which is useful for allowing the restriction of the RoM of mechanical joints with the consideration of energy dissipation. Joint resistance moments are applied to the connected bodies to mimic the dissipative behavior of the materials constituent of mechanical joints and to prevent unacceptable configurations of those bodies. Thus, two terms contribute to the calculation of the joint resistance moments, \({\mathbf{m}}_{h}^{\text{r}}\), as

$$ {\mathbf{m}}_{h}^{{\text{r}}} = {\mathbf{m}}_{h}^{{\text{d}}} + {\mathbf{m}}_{h}^{{\text{mr}}} $$
(2)

where \({\mathbf{m}}_{h}^{\text{d}}\) is the dissipative moment vector, and \({\mathbf{m}}_{h}^{{\text{mr}}}\) represents the motion-restricting moment vector. The subscript h denotes the joint index.

The methodology proposed in this paper aims to extend and improve the approach presented by Silva et al. [30], specifically in what regards to the definition of the RoM limits, the calculation of the penalty moments, and the establishment of their direction of application. These quantities are utilized for the evaluation the joint motion-restricting moment. Thus, the preservation of the mechanical energy of the system is guaranteed when an elastic resistance is considered.

With the purpose to better understand the methodology proposed in this work, it is of paramount importance to become familiar with the concepts of reference body and moving body. Any type of mechanical joint connects two bodies, and, in this work, it is assumed that one of those bodies is named the reference body and the other is the moving body. While the moving body is the one which RoM is intended to be restricted, the reference body enables the definition of the limits inside which the moving body can freely move without exceeding the joint’s RoM. A schematic representation of a multibody system composed of two bodies i and j, which are the reference and moving bodies, respectively, connected by a spherical joint h is presented in Fig. 1.

Fig. 1
figure 1

Schematic representation of a multibody mechanical system composed of bodies i and j, which represent the reference and moving bodies, respectively, connected by a spherical joint h

The proposed methodology is described for a spherical joint since it represents the most general case. However, it can be applied to any type of mechanical joint with rotational degrees of freedom, including, for instance, revolute, cylindrical, or universal joints.

3.1 Joint motion-restricting moment

The joint motion-restricting moment acts to restrict the RoM of the mechanical joint, and it is typically modeled as an element with a nonlinear elastic behavior. The joint motion-restricting moment is null during admissible joint motions, i.e., within the allowable RoM for that specific joint, and varies from zero to a maximum value whenever an unacceptable configuration of the moving body is detected. It should be noticed that the transition from null to the maximum moment magnitude occurs in a very short angular range [30]. In the following paragraphs, the ingredients for the calculation of the joint motion-restricting moment are described in detail.

3.1.1 Circumduction cone definition

The definition of the circumduction cone for the considered mechanical joint is the first step to calculate of the joint motion-restricting moment. Circumduction combines the movements about the three geometric planes of the Cartesian coordinate system, and when it is taken to its maximum latitude, the moving body describes a cone in space, which is the cone of circumduction. The circumduction cone is defined as the three-dimensional surface inside which any configuration of the joint is possible. Thus, the RoM of the joints is associated with the working space of the circumduction cone. The apex of the cone is considered to be located at the center of the joint [30, 34], as it can be observed in Fig. 2. The circumduction cone can be established for any joint with rotational degrees of freedom, independently of its number of degrees of freedom. In the particular case of a revolute joint, some sections of the circumduction cone are not reached by the moving body due to the intrinsic kinematic structure of this type of joint. If a mechanical joint allows simultaneous rotation around more than one joint axis and the axes intersect at a specific point, as in the case of spherical and classical universal joints, the RoM of that mechanical joint can be restricted by only one circumduction cone. On the contrary, if a composite joint [1, 3] is considered, such as modified universal joints or spherical-spherical joints, the RoM associated with each joint axis must be restricted using different circumduction cones. The internal rotational degree of freedom is not restricted by this methodology.

Fig. 2
figure 2

Schematic representation of a system composed of bodies i and j, which represent, respectively, the reference and moving bodies, connected by a general rotational mechanical joint h. The circumduction cone, the joint's local reference ξhηhζh, and the unit vector ur,h are represented

The circumduction cone is characterized by defining the axes of the joint’s local coordinate system using the local coordinate system of the reference body (body i), which can be defined arbitrarily. The joint’s and reference body’s local coordinate systems may not necessarily be coincident. The joint’s local coordinate system must be defined in the most convenient manner, depending on the specificities of the multibody system under analysis. In the cone illustrated in Fig. 2, the unit vectors defining the axes \({\mathbf{u}}_{\xi ,h}^{\prime }\) and \({\mathbf{u}}_{\eta ,h}^{\prime }\) of the joint’s local coordinate system are defined as

$$ {\mathbf{u}}_{\xi ,h}^{\prime }= \left\{ {\begin{array}{*{20}c} 0 & 0 & { - 1} \\ \end{array} } \right\}^{{\text{T}}} \;{\text{and}}\;{\mathbf{u}}_{\eta ,h}^{\prime } = \left\{ {\begin{array}{*{20}c} 0 & 1 & 0 \\ \end{array} } \right\}^{{\text{T}}} $$

where the symbol (\(^{\prime }\)) represents the components of vector u in the body’s local coordinate system [3].

The local and global components of a general vector u relate as

$$ {\mathbf{u}} = {\mathbf{A}}_{k} {\mathbf{u^{\prime}}} $$
(3)

where Ak is the transformation matrix of body k (k = i, j).

The uζ,h unit vector of the joint’s local coordinate system is obtained by the cross-product of the uξ,h and uη,h unit vectors as

$$ {\mathbf{u}}_{\zeta ,h} = {\tilde{\mathbf{u}}}_{\xi ,h} {\mathbf{u}}_{\eta ,h} $$
(4)

where the symbol ( ~) represents the skew-symmetric matrix associated with that vector [3].

After the definition of the joint’s local coordinate system, a unit vector, ur,h, must be established using the moving body’s (body j) local coordinate system. This vector allows to identify, at every configuration, the orientation of the moving body in the joint’s local coordinate system. Analyzing the cone illustrated in Fig. 2, vector \({\mathbf{u}}_{{\mathrm {r}},h}^{\prime }\) is defined as

$$ {\mathbf{u}}_{{\mathrm {r}},h}^{\prime } = \left\{ {\begin{array}{*{20}c} 1 & 0 & 0 \\ \end{array} } \right\}^{{\text{T}}} $$

The unit vector ur,h should not be defined such that its initial configuration is outside the circumduction cone, thus, being in an unacceptable configuration for the joint. Although it is not mandatory, the unit vector and the joint’s local coordinate system are defined such that the vector ur,h and the local ζh axis of the joint’s local coordinate system are coincident at the initial configuration, as it can be observed in Fig. 2.

The moving body is considered to be in an acceptable configuration whenever it is located inside the circumduction cone, as it is depicted in Fig. 2. On the contrary, if the moving body is located outside the circumduction cone, as it can be observed in the representation of Fig. 3, it is considered to be an unacceptable configuration. In this situation, a joint motion-restricting moment must be applied to reposition the moving body into an acceptable configuration.

Fig. 3
figure 3

Schematic representation of the moving body in an unacceptable configuration

With the purpose to determine whether the actual position of the moving body is inside (acceptable configuration) or outside (unacceptable configuration) the circumduction cone, the longitude, ψh, and latitude, σh, of the unit vector ur,h expressed in the joint’s local coordinate system must be determined.

The local and global components of a general vector u in the joint’s local coordinate system relate as

$$ {\mathbf{u}} = {\mathbf{A}}_{i} {\mathbf{B}}_{h} {\mathbf{u}}^{\prime \prime } $$
(5)

where Bh is the transformation matrix of joint h, and the symbol (\(^{\prime \prime }\)) represents the components of vector u in the joint’s local coordinate system.

The longitude, ψh, is established by the joint’s local ξh axis and the projection of vector \({\mathbf{u}}_{{\mathrm {r}},h}^{\prime \prime }\) in the plane ξhηh of the joint’s local coordinate system (see Fig. 4a). Therefore, ψh is calculated as

$$ \psi_{h} = \arctan \left( {\frac{{u_{{\rm {r}},h,\eta }^{\prime \prime } }}{{u_{{\rm {r}},h,\xi }^{\prime \prime } }}} \right) $$
(6)
Fig. 4
figure 4

Schematic representation of the a longitude, ψh, and b latitude, σh, utilized in the calculation of the joint motion-restricting moment. The longitude is defined in the plane ξhηh of the joint’s local coordinate system (top view of the circumduction cone)

It is important to note that, in Eq. (6), the atan2 function, which denotes the four-quadrant inverse tangent, must be utilized. The atan2 function returns values in the closed interval [ − π, π], and, therefore, whenever ψh calculated using Eq. (6) is negative, a value of 2π must be added to ψh in order to obtain values in the closed interval [0, 2π].

The latitude, σh, is established by the joint’s local unit vector uζ,h and the unit vector ur,h, both expressed in the joint’s local coordinate system, as it is illustrated in Fig. 4b. The latitude can be determined according to

$$ \sigma_{h} = \arccos \left({\mathbf{u}}_{ {\text{r}},h }^{\prime \prime{\text{T}}} {\mathbf{u}}_{{\zeta \text{,h}}}^{\prime \prime }\right) $$
(7)

At this stage, it must be noticed that all the necessary ingredients to construct the circumduction cone have been described. The cone is defined by specifying the maximum allowable latitude, σh,max, for certain values of longitude, ψh. The longitude and latitude must be defined in the closed interval [0, 2π] and [0, π] radians, respectively. Indeed, the longitude must cover all the entire domain between zero and 2π, meaning that the first and last values of longitude must always be zero and 2π. On the other hand, the maximum latitude can assume any value in the interval [0, π] radians. For the sake of simplicity, the examples given in this work are in degrees. The simplest circumduction cone can be constructed such that, for all values of longitude, the maximum allowable latitude has always the same value, as it can be observed in Fig. 5a. In this case, the cone can be considered as regular, and it may be defined as

$$\begin{aligned}& {{\varvec{\uppsi}}}_{h} = \left\{ {\begin{array}{*{20}c} {0^\circ } & {90^\circ } & {180^\circ } & {270^\circ } & {360^\circ } \\ \end{array} } \right\}\;{\text{and}}\\&{{\varvec{\upsigma}}}_{h,\max } = \left\{ {\begin{array}{*{20}c} {30^\circ } & {30^\circ } & {30^\circ } & {30^\circ } & {30^\circ } \\ \end{array} } \right\}\end{aligned} $$
Fig. 5
figure 5

Examples of a a regular and b an irregular circumduction cone

The level of complexity of the circumduction cone increases by specifying different values of maximum allowable latitude for the values of longitude, thus defining an irregular cone, as it can be seen in Fig. 5b. The longitude is defined as in the above expression, and the latitude can be specified as

$$ {\boldsymbol{\sigma}}_{h,\max } = \left\{ {\begin{array}{*{20}c} {60^\circ } & {30^\circ } & {45^\circ } & {20^\circ } & {60^\circ } \\ \end{array} } \right\} $$

It must be highlighted that the maximum allowable latitude must have the same value for 0 and 2π radians of longitude; otherwise, the circumduction cone would present a discontinuity.

The definition of the longitude and maximum latitude is dependent on several factors, including (i) the kinematic structure of the joint itself, that is, whether it is a spherical, revolute, universal, or cylindrical joint; (ii) the definition of the local coordinate system of the joint; and (iii) the topology of the bodies of the system under analysis.

The examples presented above are utilized to simply illustrate the definition of the circumduction cone. The longitude can be defined in any arbitrary location, and the latitude essentially establishes the aperture of the circumduction cone. This cone can be defined in multiple manners, depending on the type of joint considered, its RoM, and the multibody system under analysis.

Based on the values of longitude and maximum allowable latitude utilized to define the circumduction cone, an interpolation curve is utilized to determine the values of maximum allowable latitude corresponding to any value of longitude. When the longitude is defined as in the above example, i.e., with 90° intervals, an elliptical approach is considered for the interpolation. Otherwise, a polynomial approach is employed. This topic is addressed in Sect. 3.1.3. At every configuration of the multibody system, both the latitude, longitude, and the corresponding maximum allowable latitude are calculated to assess whether or not the moving body is located in an unacceptable configuration, thus exceeding or not the RoM of the joint.

3.1.2 General problem description

Figure 6 shows the top view of an in irregular circumduction cone. In a specific configuration of the multibody system, the unit vector \({\mathbf{u}}_{{\mathrm {r}},h}^{\prime \prime }\) is pointing at A. Point B represents the point located at the surface of the circumduction cone closest to point A, since it fulfills the minimum distance condition, i.e., for those values of longitude ψh,A and latitude σh,A corresponding to point A, a vector tangent to the cone’s surface, \({\mathbf{t}}^{\prime \prime }\), is perpendicular to the vector \({\mathbf{d}}^{\prime \prime }\) connecting points A and B. Thus, B is the point of interest to calculate the maximum allowable latitude at that configuration.

Fig. 6
figure 6

Schematic representation of the top view of an irregular circumduction cone

To detect whether the joint’s RoM is exceeded, i.e., to determine whether the actual position of the moving body is inside or outside the circumduction cone, the latitude, σh,A, longitude, ψh,A, and the corresponding maximum allowable latitude, σh,max,A, at point A must be calculated. The longitude and latitude are calculated using Eqs. (6) and (7), respectively. The maximum latitude is calculated using either the elliptical or polynomial approaches described in the following Section. If, for a certain longitude, ψh,A, the moving body is inside the circumduction cone (acceptable configuration), i.e., σh,A < σh,max,A, no joint motion-restricting moment is applied. However, if the moving body is outside the circumduction cone (unacceptable configuration), i.e., σh,A > σh,max,A, as it is displayed in Fig. 6, the joint motion-restricting moment must be applied to the connected bodies. In these circumstances, the longitude at point B, ψh,B, and the corresponding maximum allowable latitude, σh,max,B, must be calculated to allow the correct estimation of the joint motion-restricting moment. In Fig. 6, the difference between σh,max,A and σh,max,B, and ψh,A and ψh,B is exaggerated for visualization purposes only. In reality, these values are very close, and, in the case of a regular cone, they are even coincident.

3.1.3 Calculation of the maximum allowable latitude

In order to calculate the maximum allowable latitude, σh,max, at points A and B, either the elliptical or the polynomial approaches must be considered. In the following paragraphs, a detailed explanation of both approaches is given using a generic point C.

The elliptical approach uses the ellipse equation, which is expressed as (see Fig. 7)

$$ \frac{{x^{2} }}{{a^{2} }} + \frac{{y^{2} }}{{b^{2} }} = 1 $$
(8)

where x and y are the Cartesian coordinates of a certain point C located on the ellipse, and a and b are constants representing the length of the semi-axes of the ellipse.

Fig. 7
figure 7

Schematic representation of an ellipse with a certain point C described using the longitude and the latitude

Observing Fig. 7, the values of longitude and maximum latitude can be obtained as

$$ \psi_{h} = \arctan \left( \frac{y}{x} \right) $$
(9)
$$ \sigma_{h,\max } = \left\| {{\mathbf{r}}_{{C}} } \right\| = \sqrt {x^{2} + y^{2} } $$
(10)

where the symbol (\(\| {\,} \|\)) represents the norm of vector rC. Similarly to Eq. (6), the atan2 function must be utilized in Eq. (9).

The ellipse equation (8) can be rewritten in terms of the y coordinate of point C as

$$ y = \pm b\sqrt {1 - \frac{{x^{2} }}{{a^{2} }}} $$
(11)

Then, Eq. (11) can be substituted into Eq. (9) to obtain the corresponding x coordinate as

$$ x = \pm \sqrt {\frac{{b^{2} a^{2} }}{{a^{2} \tan^{2} (\psi_{h} ) + b^{2} }}} $$
(12)

Finally, substituting Eqs. (11) and (12) into Eq. (10), it is possible to obtain the expression for σh,max as a function of ψh using the elliptical approach as

$$ \sigma_{h,\max } \left( {\psi_{h} } \right) = \sqrt {\frac{{b^{2} }}{{\tan^{2} \left( {\psi_{h} } \right) + \frac{{b^{2} }}{{a^{2} }}}}\left( {1 - \frac{{b^{2} }}{{a^{2} }}} \right) + b^{2} } $$
(13)

In the elliptical approach of the proposed RoM methodology, the values of the ellipse semi-axes, illustrated in Fig. 7, correspond to the maximum allowable latitude for five specific values of longitude, namely 0°, 90°, 180°, 270°, and 360°. These longitude values allow to divide the ellipse into four sections, which correspond to the four quadrants. Based on the value of current longitude calculated using Eq. (6), it is possible to determine in which quadrant of the ellipse the moving body is located. Hence, it is only necessary to evaluate the maximum allowable latitude that delimits the quadrant, which corresponds to the values of a and b. In the elliptical approach, the top view of the circumduction cone can be similar to Fig. 8, in which four different quarters of ellipses are present on each of the four quadrants, each quarter having different values for maximum allowable latitude. Since, at each configuration, only the quarters of ellipse are considered, it is not mandatory to strictly consider circumduction cones with the shape illustrated in Fig. 7.

Fig. 8
figure 8

Schematic representation of the top view of a certain circumduction cone partitioned into quarters of ellipses

After knowing the current longitude and, consequently, on which quarter of the ellipse the moving body is located, the following condition can be applied to determine the corresponding values of a and b to utilize in Eq. (13) (see Fig. 8)

$$ \left\{ {\begin{array}{*{20}l} {a = a_{1} ,b = b_{1} } \hfill & {{\text{if }}0^\circ \le \psi_{h} < 90^\circ } \hfill \\ {a = a_{2} ,b = b_{1} } \hfill & {{\text{if }}90^\circ \le \psi_{h} < 180^\circ } \hfill \\ {a = a_{2} ,b = b_{2} } \hfill & {{\text{if }}180^\circ \le \psi_{h} < 270^\circ } \hfill \\ {a = a_{1} ,b = b_{2} } \hfill & {{\text{if }}270^\circ \le \psi_{h} \le 360^\circ } \hfill \\ \end{array} } \right. $$
(14)

Due to the inherent characteristics of ellipse equation, Eq. (8), a limitation of the elliptical approach is that it only allows to define circumduction cones in which the maximum allowable latitude is known for five specific longitude, namely 0°, 90°, 180°, 270°, and 360°. However, depending on the particularities of the joint to be modeled, maximum latitude values for other values of longitude may need to be defined. Thus, in a more general approach, the polynomial approach must be taken into consideration.

A general expression for a polynomial of degree n can be written in the form

$$ f(l) = \sum\limits_{q = 0}^{n} {c_{q}^{k} l^{q} } $$
(15)

where c represents the coefficients of the polynomial, k allows to identify the polynomial curve, and l defines the length of the line that is zero when ψh = 0° and it is equal to the perimeter of the base of the circumduction cone (top view) when ψh = 360°, as it can be observed in Fig. 9.

Fig. 9
figure 9

Schematic representation of the variable l utilized in the polynomial approach

Adopting a periodic cubic spline curve (n = 3) to interpolate the longitude and maximum latitude values, the number of polynomial curves that compose the periodic spline is dependent on the number of ψh and σh,max values utilized to define the circumduction cone. For instance, consider an irregular circumduction cone characterized by the following longitude and maximum latitude

$$\begin{aligned}& {{\varvec{\uppsi}}}_{h} = \left\{ {\begin{array}{*{20}c} {0^\circ } & {45^\circ } & {180^\circ } & {225^\circ } & {360^\circ } \\ \end{array} } \right\}\;{\text{and}}\\&{{\varvec{\upsigma}}}_{h,\max } = \left\{ {\begin{array}{*{20}c} {45^\circ } & {30^\circ } & {45^\circ } & {30^\circ } & {45^\circ } \\ \end{array} } \right\}\end{aligned} $$

Five values are utilized for the longitude and maximum latitude; therefore, four polynomial curves (k = 1, 2, 3, 4) must be considered for the periodic spline. The spline must be periodic because the function to interpolate, which contains the longitude and maximum latitude characteristic of the joint, repeats in the interval between the first and the last defined points. Figure 10 depicts a schematic representation of this particular situation, in which the different polynomial curves are highlighted in distinct shades of blue.

Fig. 10
figure 10

Schematic representation of a circumduction cone with four polynomial curves highlighted in distinct shades of blue. a Perspective and b top views. The polynomial curve numbers are displayed in the figure

Similarly to the elliptical approach, in the polynomial approach, σh,max(ψh) can be determined using Eq. (10). However, in this case, the x and y coordinates of a certain point C (see Fig. 10b) are described by a cubic spline curve and given by the following conditions

$$ x = c_{x,3}^{k} l^{3} + c_{x,2}^{k} l^{2} + c_{x,1}^{k} l + c_{x,0}^{k} $$
(16)
$$ y = c_{y,3}^{k} l^{3} + c_{y,2}^{k} l^{2} + c_{y,1}^{k} l + c_{y,0}^{k} $$
(17)

Since point C in Fig. 10b is located between longitude values of 0° and 45°, the first polynomial curve (darkest blue curve) must be utilized and, thus, k = 1.

It is possible to observe that, substituting Eqs. (16) and (17) into Eq. (10), the maximum allowable latitude is not explicitly dependent on the longitude, as it is in Eq. (13) of the elliptical approach. For the polynomial approach, the expression for σh,max is as

$$ \sigma_{h,\max } = \sqrt {\left( {c_{x,3}^{k} l^{3} + c_{x,2}^{k} l^{2} + c_{x,1}^{k} l + c_{x,0}^{k} } \right)^{2} + \left( {c_{y,3}^{k} l^{3} + c_{y,2}^{k} l^{2} + c_{y,1}^{k} l + c_{y,0}^{k} } \right)^{2} } $$
(18)

In this situation, the variable l must be calculated by solving a set of nonlinear equations using an iterative method, such as the Newton–Raphson method, and considering the following condition

$$ \psi_{h} = \arctan \left( {\frac{{c_{y,3}^{k} l^{3} + c_{y,2}^{k} l^{2} + c_{y,1}^{k} l + c_{y,0}^{k} }}{{c_{x,3}^{k} l^{3} + c_{x,2}^{k} l^{2} + c_{x,1}^{k} l + c_{x,0}^{k} }}} \right) $$
(19)

After calculating the variable l using Eq. (19), the maximum allowable latitude corresponding to the longitude for the polynomial approach can be calculated using Eq. (18).

In a similar manner to the elliptical approach, it is possible to determine where the moving body is located based on the value of current longitude calculated using Eq. (6). In this case, the calculus is utilized to evaluate the corresponding polynomial curve to use (k = 1, 2, 3, or 4, in the example of Fig. 10), which allows to determine the maximum allowable latitude. For example, consider that ψC = 22.50°, as it can be observed in Fig. 10b. In this situation, it is clear the moving body is located between longitude values of 0° and 45°, and the polynomial curve to use is the darkest blue one (k = 1). The corresponding coefficients of that polynomial curve are utilized to solve nonlinear Eqs. (16) and (17), which allow to ultimately calculate σh,max using Eq. (18).

3.1.4 Calculation of the longitude: parametrization of the circumduction cone

In the previous paragraphs, it was concluded that five quantities must be determined in this methodology, namely the longitude at points A and B, latitude at point A, and maximum allowable latitude at points A and B. In order to detect whether the RoM is exceeded, the longitude, latitude, and maximum allowable latitude at point A are determined using Eqs. (6), (7), and (13) or (18), respectively. If the RoM is exceeded, i.e., σh,A > σh,max,A, the joint motion-restricting moment must be correctly estimated and applied to the bodies connected by the mechanical joint h. In these circumstances, the longitude at point B must be calculated. In the following paragraphs, a parametrization of the circumduction cone is considered as the method for the calculation of ψh,B.

The magnitude and direction of the joint motion-restricting moment is dependent on the geometry of the circumduction cone, i.e., whether it is regular or irregular, as it was described above (see Fig. 5). Therefore, a parametrization procedure is implemented on the circumduction cone, which means that any point B on the cone’s surface can be defined by two parameters, namely the distance to the apex, G, and the longitude, ψh. In the following paragraphs, a detailed explanation of this procedure is presented.

For a specific configuration, the moving body is characterized by a longitude ψh and a latitude σh. Let us consider a vector with length G defined in the joint’s local coordinate system as

$$ {\mathbf{v}}_{\mathrm {r}}^{\prime \prime } = \left\{ {\begin{array}{*{20}c} 0 & 0 & G \\ \end{array} } \right\}^{{\text{T}}} $$
(20)

To determine the coordinates of a certain position vector \({\mathbf{r}}^{\prime \prime}\), vector \({\mathbf{v}}_{\mathrm{r}}^{\prime \prime }\) must be rotated, initially, σh around the ηh axis of the joint’s local coordinate system, and then rotated ψh around the ζh axis of the same coordinate system. These rotations are mathematically described by the following conditions

$$ \begin{aligned} {\mathbf{r}}^{\prime \prime} = & {\mathbf{R}}_{h,\zeta } {\mathbf{R}}_{h,\eta } {\mathbf{v}}_{\mathrm{r}}^{\prime \prime } \\ = & \left[ {\begin{array}{*{20}c} {\cos \left( {\psi_{h} } \right)} & { - \sin \left( {\psi_{h} } \right)} & 0 \\ {\sin \left( {\psi_{h} } \right)} & {\cos \left( {\psi_{h} } \right)} & 0 \\ 0 & 0 & 1 \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\cos \left( {\sigma_{h} } \right)} & 0 & {\sin \left( {\sigma_{h} } \right)} \\ 0 & 1 & 0 \\ { - \sin \left( {\sigma_{h} } \right)} & 0 & {\cos \left( {\sigma_{h} } \right)} \\ \end{array} } \right]\left\{ {\begin{array}{*{20}c} 0 \\ 0 \\ G \\ \end{array} } \right\} \\ = & \left\{ {\begin{array}{*{20}l} {G\cos \left( {\psi_{h} } \right)\sin \left( {\sigma_{h} } \right)} \hfill \\ {G\sin \left( {\psi_{h} } \right)\sin \left( {\sigma_{h} } \right)} \hfill \\ {G\cos \left( {\sigma_{h} } \right)} \hfill \\ \end{array} } \right\} \\ \end{aligned} $$
(21)

where Rh,ζ and Rh,η are transformation matrices that produce rotations about the joint’s local ζh and ηh axes, respectively.

If the position vector \({\mathbf{r}}^{\prime \prime }\) is assumed to be located at the surface of the circumduction cone, \({\mathbf{r}}_{B}^{\prime \prime }\), the latitude establishes the maximum allowable latitude, which is expressed as a function of the longitude, i.e., σh,max,B(ψh,B). In this sense, vector \({\mathbf{r}}_{B}^{\prime \prime }\) is written as

$$ {\mathbf{r}}_{B}^{\prime \prime } = \left\{ {\begin{array}{*{20}l} {G\cos \left( {\psi_{h,B} } \right)\sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)} \hfill \\ {G\sin \left( {\psi_{h,B} } \right)\sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)} \hfill \\ {G\cos \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)} \hfill \\ \end{array} } \right\} $$
(22)

in which σh,max,B(ψh,B) is calculated using either Eq. (13) or (18), depending on whether the elliptical or polynomial approaches are considered, respectively. The rotations explained in the previous paragraphs are illustrated in Fig. 11.

Fig. 11
figure 11

Schematic representation of the transformation of vector \({\mathbf{v}}_{\mathrm {r}}^{\prime \prime }\) into vector \({\mathbf{r}}_{B}^{\prime \prime }\). a Perspective and b top views

Since the cone surface is fully defined by Eq. (22), the surface’s tangent vectors, \({\mathbf{t}}_{G}^{\prime \prime }\) and \({\mathbf{t}}_{\psi }^{\prime \prime }\) can be calculated through the derivatives of vector \({\mathbf{r}}_{B}^{\prime \prime }\) with respect to G and ψh,B, respectively, as

$$ {\mathbf{t}}_{G}^{\prime \prime } = \left\{ {\begin{array}{*{20}l} {\cos \left( {\psi_{h,B} } \right)\sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)} \hfill \\ {\sin \left( {\psi_{h,B} } \right)\sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)} \hfill \\ {\cos \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)} \hfill \\ \end{array} } \right\} $$
(23)
$$ {\mathbf{t}}_{\psi }^{\prime \prime } = \left\{ {\begin{array}{*{20}l} {G\left( { - \sin \left( {\psi_{h,B} } \right)\sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right) + \cos \left( {\psi_{h,B} } \right)\cos \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)\frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }}} \right)} \hfill \\ {G\left( {\cos \left( {\psi_{h,B} } \right)\sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right) + \sin \left( {\psi_{h,B} } \right)\cos \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)\frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }}} \right)} \hfill \\ {G\left( { - \sin \left( {\sigma_{h,\max ,B} \left( {\psi_{h,B} } \right)} \right)\frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }}} \right)} \hfill \\ \end{array} } \right\} $$
(24)

where \(\frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }}\) is the derivative of σh,max,B with respect to ψh,B. The value of \(\frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }}\) depends on whether the elliptical or the polynomial approach is considered, and, therefore, this parameter can be expressed, respectively, as

$$ \frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }} = \frac{1}{{a^{2} b^{2} }}\left( {b^{2} - a^{2} } \right)\sin \left( {\psi_{h,B} } \right)\cos \left( {\psi_{h,B} } \right)\left( {\frac{{a^{2} b^{2} \frac{1}{{\cos^{2} \left( {\psi_{h,B} } \right)}}}}{{a^{2} \tan^{2} \left( {\psi_{h,B} } \right) + b^{2} }}} \right)^{3/2} $$
(25)

or

$$ \frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }} = \frac{{\partial \sigma_{h,\max ,B} }}{{\partial \psi_{h,B} }} = \frac{{\partial \sigma_{h,\max ,B} }}{\partial l}\frac{\partial l}{{\partial \psi_{h,B} }} = \frac{{\partial \sigma_{h,\max ,B} }}{\partial l}\frac{1}{{\left( {\frac{{\partial \psi_{h,B} }}{\partial l}} \right)}} $$
(26)

where

$$ \frac{{\partial \sigma_{h,\max ,B} }}{\partial l} = \frac{1}{{\sqrt {x^{2} + y^{2} } }}\left( {\left( {3c_{x,3}^{k} l^{2} + 2c_{x,2}^{k} l + c_{x,1}^{k} } \right)x + 2\left( {3c_{y,3}^{k} l^{2} + 2c_{y,2}^{k} l + c_{y,1}^{k} } \right)y} \right) $$
(27)
$$ \frac{{\partial \psi_{h,B} }}{\partial l} = \frac{{x^{2} }}{{y^{2} + x^{2} }}\left( {\left( {\frac{{3c_{y,3}^{k} l^{2} + 2c_{y,2}^{k} l + c_{y,1}^{k} }}{x}} \right) - \left( {\frac{{y\left( {3c_{x,3}^{k} l^{2} + 2c_{x,2}^{k} l + c_{x,1}^{k} } \right)}}{{x^{2} }}} \right)} \right) $$
(28)

where x and y are given by Eqs. (16) and (17), respectively. In order to determine the expression of \(\frac{{{\text{d}}\sigma_{h,\max ,B} }}{{{\text{d}}\psi_{h,B} }}\) for the polynomial approach, Eq. (26), the inverse function rule is utilized, which states that the derivative of the inverse function is the inverse of the derivative of the original function.

The vectors \({\mathbf{t}}_{G}^{\prime \prime }\) and \({\mathbf{t}}_{\psi}^{\prime \prime }\), given by Eqs. (23) and (24), are tangent to the surface of the circumduction cone along two different directions, namely along the generating line of the cone and along the perimeter of the base of the cone, respectively. A schematic representation of these two vectors is presented in Fig. 12.

Fig. 12
figure 12

Schematic representation of vectors \({\mathbf{t}}_{G}^{\prime \prime }\), \({\mathbf{t}}_{\psi }^{\prime \prime }\), \({\mathbf{r}}_{B}^{\prime \prime }\), \({\mathbf{n}}_{{}}^{\prime \prime }\), \({\mathbf{d}}_{{}}^{\prime \prime }\) and \({\mathbf{u}}_{{\mathrm {r}},h}^{\prime \prime }\) on an arbitrary circumduction cone

In Fig. 12, vector \({\mathbf{n}}^{\prime \prime }\) represents the unit vector normal to the surface of the circumduction cone at point B for the corresponding value of σh,max,B and it is calculated as

$$ {\mathbf{n}}^{\prime \prime } = \frac{{{\tilde{\mathbf{t}}}_{G}^{\prime \prime } {\mathbf{t}}_{\psi }^{\prime \prime } }}{{\left\| {{\tilde{\mathbf{t}}}_{G}^{\prime \prime } {\mathbf{t}}_{\psi }^{\prime \prime } } \right\|}} $$
(29)

In this work, the minimum distance condition is considered to determine point B, i.e., the closest point to A in the cone surface, and, consequently, the corresponding parameters G and ψh. This condition ensures that the distance vector between points A and B, \({\mathbf{d}}^{\prime \prime }\), and the normal vector to the surface of the circumduction cone at point B, \({\mathbf{n}}^{\prime \prime }\), are collinear. Observing Fig. 12, vector \({\mathbf{d^{\prime\prime}}}\) can be calculated as

$$ {\mathbf{d}}^{\prime \prime } = {\mathbf{r}}_{B}^{\prime \prime } - {\mathbf{u}}_{{\mathrm {r}},h}^{\prime \prime } $$
(30)

The mathematical definition of two collinear vectors is given by their null cross-product. In this methodology, the vectors tangent to the surface of the circumduction cone, \({\mathbf{t}}_{G}^{\prime \prime }\) and \({\mathbf{t}}_{\psi }^{\prime \prime }\), are utilized instead of the normal vector \({\mathbf{n}}^{\prime \prime }\). Thus, the minimum distance condition must be modified. The cross-product of vector \({\mathbf{d}}^{\prime \prime }\) and a vector normal to the surface of the circumduction cone, \({\mathbf{n}}^{\prime \prime }\), is equivalent to the inner products of vector \({\mathbf{d}}^{\prime \prime }\) and the tangent vectors to the cone’s surface as

$$ {\tilde{\mathbf{d}}}^{{^{\prime \prime } }} {\mathbf{n}}^{{^{\prime \prime } }} = {\mathbf{0}} \Leftrightarrow \left\{ {\begin{array}{*{20}c} {{\mathbf{d}}^{{^{\prime \prime } \text{T}}} {\mathbf{t}}_{G}^{{^{\prime \prime } }} = 0} \\ {{\mathbf{d}}^{{^{\prime \prime } \text{T}}} {\mathbf{t}}_{\psi }^{{^{\prime \prime } }} = 0} \\ \end{array} } \right. $$
(31)

This set of nonlinear equations can be solved by using a root finding algorithm to obtain the set of parameters G and ψh at point B that satisfy the minimum distance condition. After knowing the longitude at point B, ψh,B, the corresponding maximum allowable latitude, σh,max,B, can be calculated using the elliptical or polynomial approaches and Eqs. (13) or (18), respectively.

3.1.5 Moment evaluation

In this work, the joint motion-restricting moment corresponds to a third-degree polynomial function with the behavior depicted in Fig. 13, and it is expressed as [30]

$$ {\mathbf{m}}_{h}^{\prime \prime {\text{mr}}} = \left\{ {\begin{array}{*{20}l} {\mathbf{0}} \hfill & {{\text{if}}} \hfill & {\sigma_{h,A} \le \sigma_{h,\max ,A} } \hfill \\ {m_{{\mathrm {p}},h} \left[ {3\left( {\frac{\kappa }{{\Delta \sigma_{h} }}} \right)^{2} - 2\left( {\frac{\kappa }{{\Delta \sigma_{h} }}} \right)^{3} } \right]{\tilde{\mathbf{u}}}_{{\mathrm {r}},h}^{\prime \prime } {\mathbf{n}}^{\prime \prime } } \hfill & {{\text{if}}} \hfill & {\sigma_{h,\max ,A} < \sigma_{h,A} {\text{ and }}\kappa \le \Delta \sigma_{h} } \hfill \\ {m_{{\mathrm {p}},h} {\tilde{\mathbf{u}}}_{{\mathrm {r}},h}^{\prime \prime } {\mathbf{n}}^{\prime \prime } } \hfill & {{\text{if}}} \hfill & {\kappa > \Delta \sigma_{h} } \hfill \\ \end{array} } \right. $$
(32)

where mp,h is the magnitude of the maximum penalty moment applied to restrict the joint’s motion, Δσh corresponds to a quantity allowing to adjust the joint’s stiffness, and κ denotes the relative angular motion between the moving body and the limits of the circumduction cone. Parameter κ is calculated as the norm of the vector connecting point A to point B (see Fig. 12), and it can be evaluated as

$$ \kappa = \left\| {{\mathbf{d}}^{\prime \prime } } \right\| = \sqrt {\sigma_{h,A}^{2} + \sigma_{h,\max ,B}^{2} - 2\sigma_{h,A} \sigma_{h,\max ,B} \cos \left( {\psi_{h,A} - \psi_{h,B} } \right)} $$
(33)
Fig. 13
figure 13

Graphical representation of the nonlinear behavior of the joint motion-restricting moment

It is important to note that the maximum magnitude defined for the joint-motion restricting moment, mp,h, corresponds to the value at which the material constituent of the joint reaches its yield limit.

The joint motion-restricting moment is calculated in the local coordinate system of the joint. In order to be applied to the reference and moving bodies, this moment must be expressed in global coordinates using the condition present in Eq. (5).

Finally, expression (32) can easily be substituted by others existing in the literature, such as the ones given in the works of Yamaguchi [11] and Nasr et al. [12], or can be obtained by experimental testing, while keeping unchanged the remaining methodology described in the previous sections.

3.2 Joint dissipative moment

In order to simulate the dissipative behavior of the materials constituent of mechanical joints and to allow energy dissipation, a joint dissipative moment is introduced in the presented formulation. The joint dissipative moment is calculated considering a viscous torsional damper as

$$ {\mathbf{m}}_{h}^{\text{d}} = - j_{h} {{\varvec{\upomega}}}_{h} $$
(34)

where jh is the rotational damping coefficient of the mechanical joint and ωh represents the joint h angular velocity vector, which is calculated as (see Fig. 1)

$$ {{\varvec{\upomega}}}_{h} = {{\varvec{\upomega}}}_{j} - {{\varvec{\upomega}}}_{i} $$
(35)

3.3 Flowchart of the proposed methodology

A flowchart of the methodology to restrict the RoM of mechanical joints proposed in this work is presented in Fig. 14, and it can be summarized by the following steps:

  1. 1.

    Start, at the initial configuration, by defining the input parameters, namely

    1. 1.1.

      Unit vectors defining the ξ and η axis of the joint h local coordinate system expressed in local coordinates of the reference body, \({\mathbf{u}}_{\xi ,h}^{\prime }\) and \({\mathbf{u}}_{\eta ,h}^{\prime }\);

    2. 1.2.

      Unit vector ur expressed in local coordinates of the moving body, \({\mathbf{u}}_{{\mathrm {r}},h}^{\prime }\);

    3. 1.3.

      Longitude, ψh, and maximum allowable latitude, σh,max, vectors of joint h;

    4. 1.4.

      Maximum joint motion-restricting moment magnitude, mp,h;

    5. 1.5.

      Damping coefficient of joint h, jh;

    6. 1.6.

      Compliance of joint h, Δσh.

  2. 2.

    Calculate the joint dissipative moment, \({\mathbf{m}}_{h}^{\text{d}}\), using Eq. (34).

  3. 3.

    Evaluate the following

    1. 3.1.

      Unit vectors \({\mathbf{u}}_{\xi ,h}^{\prime }\), \({\mathbf{u}}_{\eta ,h}^{\prime }\) and \({\mathbf{u}}_{{\mathrm {r}},h}^{\prime }\) expressed in global coordinates using Eq. (3);

    2. 3.2.

      Joint local coordinate system using Eq. (4);

    3. 3.3.

      Unit vector ur,h expressed in the joint local coordinate system utilizing Eq. (5);

    4. 3.4.

      Longitude, ψh,A, and latitude, σh,A, at point A, using Eqs. (6) and (7), respectively.

  4. 4.

    Assess the maximum allowable latitude at point A, σh,max,A, applying either the elliptical or the polynomial approaches and Eqs. (13) and (18), respectively.

  5. 5.

    If the current latitude at point A, σh,A, does not exceed the maximum allowable latitude, σh,max,A, for the corresponding longitude, ψh,A, the joint motion-restricting moment \({\mathbf{m}}_{h}^{{\text{mr}}}\) is null.

  6. 6.

    If the current latitude at point A, σh,A, exceeds the maximum allowable latitude, σh,max,A, for the corresponding longitude, ψh,A, the following steps should be taken

    1. 6.1.

      Solve a system of nonlinear equations for G and ψh,B using Eq. (31).

    2. 6.2.

      Assess the maximum allowable latitude at point B, σh,max,B, applying either the elliptical or polynomial approaches and Eqs. (13) and (18), respectively.

    3. 6.3.

      Calculate the joint motion-restricting moment in local coordinates of the joint coordinate system, \({\mathbf{m}}_{h}^{{\prime \prime {\text{mr}}}}\), using Eq. (32);

    4. 6.4.

      Evaluate the joint motion-restricting moment in global coordinates, \({\mathbf{m}}_{h}^{{\text{mr}}}\), utilizing Eq. (3);

  7. 7.

    Calculate the joint resistance moments, \({\mathbf{m}}_{h}^{\text{r}}\), using Eq. (2) and apply them to the connected bodies.

  8. 8.

    Proceed with the process described in steps 1–7 for a new time step until the final time of analysis is reached.

Fig. 14
figure 14

Flowchart of the improved methodology proposed in this work

The joint resistance moments constitute an action–reaction pair, and thus, the results obtained using Eq. (2) are applied on the moving body and their symmetrical are applied on the reference body. In the multibody systems methodology, these moments are taken as external moments integrated in vector g of Eq. (1), which contains all the external generalized forces acting on system [1, 2].

4 Demonstrative example of application

The objective of this section is to demonstrate the application of the proposed methodology to restrict the RoM of mechanical joints on the dynamic response of multibody systems. One application example is utilized, namely a simple pendulum. All simulations were run in MATLAB® R2021b using an in-house code.

The example of application considered in this work is composed of two rigid bodies, namely the ground and a pendulum. These two bodies are kinematically connected to each other using one ideal spherical joint. The local coordinate systems of each body of the multibody model and their number are shown in Fig. 15. It is important to note that the local coordinate systems of each body are located at their center of mass (see Fig. 15) and are aligned with the principal axes of inertia. The global coordinate system is represented by xyz. This example was chosen to demonstrate the application of the proposed methodology due to its simplicity and because it has direct application in biomechanics, more specifically in the hip joint [35,36,37,38,39], and in vehicle suspensions [2, 40] to restrict the RoM of the spherical joints incorporated in the multibody models. However, the longitude and maximum latitude considered in this work are not targeted to a specific application in order to provide a more generic application scenario.

Fig. 15
figure 15

Schematic representation of the initial configuration of the simple pendulum multibody model

The initial configuration of the multibody model is illustrated in Fig. 15, and the corresponding initial conditions are presented in Table 1. The system is released from the initial configuration with null velocities and under the action of the gravitational force, which acts on the negative z-direction.

Table 1 Initial configuration of the simple pendulum multibody model

The dimensions and inertial properties of the pendulum are listed in Table 2.

Table 2 Dimensions and inertial properties of the simple pendulum multibody model

The simulation parameters utilized in all dynamic simulations are displayed in Table 3.

Table 3 Parameters utilized in the dynamic simulation of the simple pendulum multibody model

Three analyses were carried out, namely, without the consideration of the RoM methodology, and with the consideration of the RoM methodology with and without energy dissipation. Considering the application of the proposed RoM methodology, in this example, the ground is assumed to be the reference body and the pendulum is the moving body. In order to define the joint’s local coordinate system, the local coordinate system of the ground is utilized, resulting in the following unit vectors to define the uξ,h and uη,h axes.

\({\mathbf{u}}_{\xi ,h}^{\prime } = \left\{ {\begin{array}{*{20}c} { - 1} & 0 & 0 \\ \end{array} } \right\}^{{\text{T}}} \;{\text{and}}\;{\mathbf{u}}_{\eta ,h}^{\prime } = \left\{ {\begin{array}{*{20}c} 0 & 1 & 0 \\ \end{array} } \right\}^{{\text{T}}}\)

The uζ,h unit vector of the joint’s local coordinate system is calculated using Eq. (4).

After establishing the joint’s local coordinate system, the unit vector ur,h is defined using the local coordinate system of the pendulum as

$$ {\mathbf{u}}_{{\mathrm {r}},h}^{\prime } = \left\{ {\begin{array}{*{20}c} 0 & 1 & 0 \\ \end{array} } \right\}^{{\text{T}}} $$

Thus, at the initial configuration, vector ur,h is defined such that it is aligned with the moving body, and, therefore, the unit vectors ur,h and uζ,h are perpendicular to each other (see Fig. 16a).

Fig. 16
figure 16

Schematic representation of the simple pendulum multibody model with the a joint’s local coordinate system ξhηhζh and vector ur,h, and b circumduction cone

In order to construct the circumduction cone to restrict the RoM of the spherical joint considered in this application example, the longitude and maximum latitude were defined as

$$ {{\varvec{\uppsi}}}_{h} = \left\{ {\begin{array}{*{20}c} {0^\circ } & {90^\circ } & {135^\circ } & {180^\circ } & {270^\circ } & {315^\circ } & {360^\circ } \\ \end{array} } \right\} $$
$$ {{\varvec{\upsigma}}}_{h,\max } = \left\{ {\begin{array}{*{20}c} {30^\circ } & {70^\circ } & {100^\circ } & {80^\circ } & {50^\circ } & {45^\circ } & {30^\circ } \\ \end{array} } \right\} $$

Since the maximum latitude is defined for longitude values than do not coincide with the edges of the four main quadrants, the polynomial approach must be utilized. In this methodology, depending on the characteristics of the multibody model under analysis and the RoM of the joint, as many values as desired can be defined for the maximum latitude and for the longitude. For this particular application example, seven values of longitude and maximum latitude were specified. A schematic representation of the simple pendulum model with the considered circumduction cone is shown in Fig. 16b.

The parameters utilized in the RoM methodology were 11.50°, 226 N\(\cdot \)m, and 3.39 N\(\cdot \)m\(\cdot \)s for Δσh, mp,h, and jh, respectively, and were retrieved from the work of Silva et al. [30]. In the case in which dissipation is not considered, jh is null.

The trajectory of the center of mass of the pendulum in the three tested cases is depicted in Fig. 17, and it can be concluded that, overall, there are significant differences. For the x-direction, when the RoM methodology is considered without energy dissipation, the amplitude of movement of the center of mass of this segment is reduced when compared with the case in which the methodology is not applied. The is a fact that the center of mass of the pendulum reaches lower position values and also the abrupt changes observed in the blue plot of Fig. 17a confirm the previous conclusion. The trajectory of the center of mass of the pendulum in the z-direction is also reduced (see Fig. 17c), but only for the highest reached values (closer to z = 0.00 m). It is logic that the trajectory of the center of mass of the pendulum in the z-direction still reaches its minimum value when the RoM is applied because this is the configuration in which the segment is vertical. In this situation, the unit vectors ur,h and uζ,h are coincident, σh = 0° (see Fig. 16b) and, thus, the RoM is not exceeded. For the y-direction, the trajectory of the center of mass reaches higher values when the methodology is applied without energy dissipation when compared with the case without RoM restriction. When the methodology is applied without energy dissipation, an unacceptable position of the moving body for one specific longitude triggers the application of the joint motion-restricting moment. This situation may cause the moving body to exceed the y position values observed when the RoM is not applied, but the maximum latitude and the corresponding RoM are not exceeded, as it can be observed in Fig. 18. The addition of energy dissipation causes the pendulum to stop in the vertical configuration, i.e., the least energy position. This is observed in Fig. 17, since the trajectory of the center of mass at the final simulation time is 0 m for the x and y directions, respectively.

Fig. 17
figure 17

Trajectory of the center of mass of the pendulum in the a x, b y, and c z directions (see Online Resources 1, 2, and 3)

Fig. 18
figure 18

Variation of the latitude as a function of the a simulation time and b longitude (in degrees). b represents a top view of the joint’s local coordinate system: case without RoM (gray line), RoM without dissipation (blue dashed line), RoM with dissipation (red dotted line), and limits of the circumduction cone (yellow line)

The analysis of Fig. 17 allows to conclude that, in general, the amplitude of movement of the center of mass of the moving body is reduced when the RoM methodology is applied compared with the case in which it is not considered. However, this information is not sufficient to validate the proposed methodology, in a sense that Fig. 17 does not provide evidence on the latitude values reached by the moving body. Consequently, it is not possible to assess if the current latitude, σh, exceeds or not the maximum latitude, σh,max, for the corresponding longitude, ψh. To do so, the evolution of the latitude as function of the simulation time could be analyzed, as it can be observed in Fig. 18a. However, this plot does not provide information on the corresponding longitude. Therefore, it is not possible to evaluate if the maximum latitude is or is not exceeded. This analysis is sufficient for regular cones in which the maximum allowable latitude is the same for all values of longitude. To carry out a more detailed analysis for the spherical joint considered in this example of application, another plot is needed, i.e., one that provides the evolution of the latitude as a function of the longitude in polar coordinates. This plot can be observed in Fig. 18b, in which the yellow curve represents the top view of the limits of the circumduction cone in the joint’s local coordinate system. It can be concluded that, before the application of the RoM methodology (gray plot), the maximum latitude for a longitude of 315° was exceeded. In addition, when the methodology was applied without energy dissipation (blue plot), it can be seen that there are longitude values for which the latitude slightly exceeds the maximum allowable value. This is the case of, for instance, ψh = 315°, σh ≈ 50°, and σh,max = 45°. Even though the maximum latitude is exceeded by approximately 5°, the parameter that defines the amplitude at which the maximum joint motion-restricting moment is applied and, therefore, allowing to adjust the joint’s stiffness, Δσh, was set to 11.50°. This means that the maximum latitude can be exceeded by 11.50°, which, in this example, would be 56.50°. In this sense, even though the maximum latitude is slightly exceeded for some longitude values, the joint’s RoM is not exceeded. When the improved methodology is applied with energy dissipation, the RoM is not exceeded because the red curve is within the limits of the circumduction cone (yellow plot) in Fig. 18b.

The variations of both the joint motion-restricting moment and the joint dissipative moment are depicted in Fig. 19. When the RoM methodology is not considered, neither of these moments is applied, as expected. However, when the RoM is considered without energy dissipation, the joint motion-restricting moment is applied several times to counteract unacceptable positions of the moving body and, thus, to prevent the RoM from being exceeded. It is important to note that, even though a maximum moment magnitude of 226 N\(\cdot \)m was considered in this model, the maximum magnitude applied during the simulation was approximately 100 N\(\cdot \)m (see Fig. 19a). When the RoM methodology is applied with energy dissipation, no joint motion-restricting moment is applied since the maximum latitude is not reached for any longitude (see Fig. 19b). Overall, the joint dissipative moment magnitude is approximately 20 times lower than that of the joint motion-restricting moment.

Fig. 19
figure 19

Variation of the a joint motion-restricting moment and b joint dissipative moment

The mechanical energy of the simple pendulum multibody model was evaluated, and its evolution throughout the simulation time is displayed in Fig. 20. It can be observed that, as expected, when the RoM methodology is not taken into consideration in the model, there is no energy dissipation, and therefore, the system is conservative. However, when the RoM methodology is utilized without energy dissipation, it can be noted that, at each joint motion-restricting moment application (noticed by the peaks on the blue plot of the mechanical energy), the system momentarily loses energy in the compression phase, but it rapidly recovers during the restitution phase. In this case, the system is, as expected due to the use of the improved RoM methodology, also conservative. When energy dissipation is considered in the RoM methodology, the model clearly dissipates energy.

Fig. 20
figure 20

Evolution of the mechanical energy of the simple pendulum multibody model

Finally, the computational cost of the simple pendulum multibody model with the three tested cases was compared through the number of function evaluations, and it is plotted in Fig. 21. This approach of evaluating the computational cost allows a fair comparison regardless of the computer and programming language utilized in the simulation, since the time consumed for the evaluation of each joint model is nearly the same. The least efficient case is the one in which the RoM methodology is applied without the consideration of energy dissipation, due to the multiple joint motion-restricting moments applications to prevent the RoM from being exceeded, which increases the problem stiffness. However, the addition of energy dissipation to the system significantly decreases the computational cost, making this the most efficient simulation.

Fig. 21
figure 21

Computational cost for the simple pendulum multibody model

The following analyses intend to assess the influence of three parameters, Δσh, mp,h, and jh, of the RoM methodology on the response of the simple pendulum multibody model. The first and second parameters are only utilized in the joint motion-restricting moment, specifically in Eq. (32), and therefore, the analyses are carried out without the consideration of energy dissipation. Consequently, in these two cases, only the joint motion-restricting moment is acting on the model. Table 4 summarizes the parameters considered on each of these three analyses.

Table 4 Parameters utilized in the performed simulations

The first analyzed parameter is Δσh, which allows to adjust the joint’s stiffness, as it can be observed in Fig. 13. The parameter was varied in 5.00° increments, resulting in a minimum and maximum tested values of 1.50° and 21.50°, respectively. The reference is the value utilized in the previous analysis, i.e., 11.50°. The influence of this parameter on the curve depicted in Fig. 13 can be observed in Fig. 22.

Fig. 22
figure 22

Influence of the joint’s compliance, Δσh, on the behavior of the joint motion-restricting moment

The influence of the joint’s compliance, Δσh, on the response of the simple pendulum multibody model is shown in Fig. 23. The trajectory of the center of mass of the pendulum in the x-direction (see Fig. 23a) was chosen to be analyzed since the conclusions reached for this case are similar for both the y and z directions, and also for the velocity and acceleration plots. The trajectory of the center of mass of the pendulum is similar in all five cases before the first joint motion-restricting moment application (see Fig. 23a), which occurs at approximately 0.35 s (see Fig. 23b). However, after this event, significant differences can be observed in Fig. 23a, which are more evidenced as the simulation time increases. It can be concluded that the higher the value of Δσh, the more time the model needs to reach the same position because the increase in Δσh leads to an increase in the relative angular motion between the moving body and the limits of the circumduction cone, that, is parameter κ calculated using Eq. (33). Thus, the higher the Δσh, the more time is necessary to reposition the moving body into an acceptable position. Concerning the variation of the joint motion-restricting moment with time (see Fig. 23b), in which the yellow dotted line represents the threshold for the maximum moment magnitude (226 N\(\cdot \)m), it can be seen that the smaller the value of Δσh, the higher the moment magnitude applied to the model. In addition, the smallest value tested for Δσh induces the model to reach the defined maximum magnitude for the joint motion-restricting moment. In this situation, the joint is so stiff, meaning that the allowable value for parameter κ before reaching the maximum motion-restricting moment is so small, that a higher moment magnitude must be applied in order to prevent the RoM from being exceeded. The time taken to reposition the moving body into an acceptable position is the lowest of all tested cases. Finally, Fig. 23c shows the variation of the latitude as a function of the longitude in the joint’s local coordinate system for the first two seconds of simulation. The limits of the cone are highlighted in yellow. The higher the value of Δσh, the higher the latitude allowed beyond the maximum latitude for the same longitude. This is clearly observed in the zoomed plot of Fig. 23c, and it is associated with the conclusion reached in Fig. 23a, in which the increase in Δσh leads to an increase in the parameter κ. The mechanical energy of the system is conserved in all tested cases.

Fig. 23
figure 23

Influence of the joint’s compliance, Δσh, on the a x–trajectory of the center of mass of the pendulum, b variation of the joint motion-restricting moment, and c variation of the latitude as a function of the longitude. The dotted yellow line observed in b represents the considered maximum moment magnitude, mp,h, i.e., 226 N\(\cdot \)m. c represents the top view of the joint’s local coordinate system for the first two seconds of simulation: 1.50° (gray line), 6.50° (blue dotted line), Reference (red dotted line), 16.50° (green line), 21.50° (black dotted line), and limits of the circumduction cone (yellow line)

The second parameter under analysis is the maximum moment magnitude considered for the joint motion-restricting moment, mp,h. The reference is the value utilized in the previous analysis, i.e., 226 N\(\cdot \)m. In this case, 50 N\(\cdot \)m increments were considered and, thus, the upper and lower bounds of the tested values for mp,h are 126 N\(\cdot \)m and 326 N\(\cdot \)m, respectively. The influence of this parameter on the curve depicted in Fig. 13 can be observed in Fig. 24. It is important to note that varying this parameter also allows to adjust the joint’s stiffness.

Fig. 24
figure 24

Influence of parameter mp,h on the behavior of the joint motion-restricting moment

The trajectory of the center of mass of the pendulum in the x-direction is displayed in Fig. 25a. After the first joint motion-restricting moment application, the trajectory of the center of mass differs between the tested values, but not as evidently as in Fig. 23a. Similarly to Fig. 23a, the increase in the simulation time leads to an increase in the observed differences. Analyzing the variation of the joint motion-restricting moment, it can be seen, in the zoom of Fig. 25b, that the higher the value of mp,h, the more vertical the shape of the curve of the moment, and the peak occurs earlier. This means that less time is needed to reposition the moving body in an acceptable position and a more rapid change of the relative velocity of the bodies occurs. It must be noted that the maximum joint motion-restricting moment magnitude is not reached in any of the tested cases, as the maximum moment is around 115 N\(\cdot \)m (see Fig. 23b). Considering the variation of the latitude as a function of the longitude for the first two seconds of simulation (see Fig. 23c), the higher the value of the maximum moment magnitude, the lower the relative angular motion between the moving body and the limits of the circumduction cone, i.e., the value of parameter κ. This agrees with the previous conclusion in a sense that the higher the value of mp,h, the stiffer the joint. Similarly to the analysis of the joint’s compliance, Δσh, the mechanical energy of the system is conserved in all tested cases.

Fig. 25
figure 25

Influence of the maximum moment magnitude, mp,h, on the a x–trajectory of the center of mass of the pendulum, b variation of the joint motion-restricting moment, and c variation of the latitude as a function of the longitude. c represents the top view of the joint’s local coordinate system for the first two seconds of simulation: 126 N\(\cdot \)m (gray line), 176 N\(\cdot \)m (blue dotted line), Reference (red dotted line), 276 N\(\cdot \)m (green line), 326 N\(\cdot \)m (black dotted line), and limits of the circumduction cone (yellow line)

The influence of the damping coefficient, jh, on the response of the simple pendulum is depicted in Fig. 26. Similarly to the previous analyses, five values for this parameter were considered, namely 0.10, 1.00, 3.39 (reference), 5.00, and 10.00 N\(\cdot \)m\(\cdot \)s. It can be seen that, with the increase in the damping coefficient, less oscillations are observed in both the trajectory of the center of mass of the pendulum (see Fig. 26a) and the curve of the joint dissipative moment (see Fig. 26b). Except for 0.10 N\(\cdot \)m\(\cdot \)s, the remaining tested values for the damping coefficient do not allow the maximum latitude to be exceeded for all longitude values since the latitude curves are within the limits of the circumduction cone, as it can be observed in Fig. 26c. However, when using the lowest value tested for the damping coefficient, the model exceeds the maximum latitude for ψh = 315° (see Fig. 26c), and, consequently, a joint motion-restricting moment is applied to prevent the RoM from being exceeded, as it can be observed in Fig. 26d. Even though all tested values reach similar maximum magnitude of the mechanical energy, the increase in the damping coefficient delays the occurrence of this event. The motion of the pendulum toward the least energy position is performed in a slower way since the high damping value does not allow to reach high velocities. It must be highlighted that, in this example, the RoM limits are only reached in the lowest damping case due to the specific characteristics of this problem, i.e., only gravitational forces are considered, and the equilibrium position of the system occurs without exceeding any maximum allowable latitude. The application of the joint motion-restricting moment is evident in the gray plot of Fig. 26a, b, and e by the observed discontinuity at around 0.40 s of simulation.

Fig. 26
figure 26

Influence of the damping coefficient, jh, on the a x–position of the center of mass of the pendulum, b variation of the joint dissipative moment, c variation of the latitude as a function of the longitude, d variation of the joint motion-restricting moment with the simulation time, and e variation of the mechanical energy of the system. c represents the top view of the joint’s local coordinate system for the first two seconds of simulation: 0.10 N\(\cdot \)m\(\cdot \)s (gray color line), 1.00 N\(\cdot \)m\(\cdot \)s (blue dotted line), Reference (red dotted line), 5.00 N\(\cdot \)m\(\cdot \)s (green line), 10.00 N\(\cdot \)m\(\cdot \)s (black dotted line), and limits of the circumduction cone (yellow line)

5 Concluding remarks

In this work, an improved methodology to restrict the RoM of mechanical joints is proposed. Joint resistance moments are applied to the bodies connected by the joint to mimic the dissipative behavior of the materials constituent of the joint and to prevent unacceptable configurations of those bodies. The proposed methodology defines the RoM limits based on a circumduction cone, which is constructed based on longitude and latitude values, and allows the methodology to be specifically targeted to joints allowing rotational degrees of freedom, including, for instance, spherical, revolute, or universal joints. The work presented in this paper aims to extend and improve the approach presented by Silva et al. [30], specifically in what regards to the definition of the RoM limits, the calculation of the penalty moments, and the establishment of their direction of application. Thus, the preservation of the mechanical energy of the system is guaranteed when an elastic resistance is considered. Enhanced methods to deal with the detection of unacceptable joint configurations, namely the elliptical and the polynomial approaches, are proposed to determine the maximum allowable latitude for each longitude. In addition, a parametrization procedure of the circumduction cone is described in detail in order to correctly calculate the direction of the penalty moments to apply to the connected bodies. The methodology proposed in this work provides a simple and accurate solution to restrict the RoM of mechanical joints. Since the joint resistance moments are incorporated into vector g of Eq. (1), the formulation of the classical joint models does not need to be modified. In addition, contrary to other studies that use optimization strategies in order to restrict the RoM of mechanical joints, the proposed work does not require the use of such complex approaches. The limitations of the work described in this paper include the fact that the internal rotational degree of freedom is not restricted, and the proposed methodology can only be applied to joints with rotational degrees of freedom; thus, the RoM of translational joints cannot be restricted. The methodology is investigated in the dynamic modeling and simulation of one demonstrative example of application, namely, a simple pendulum. A parametric analysis is carried out in order to assess the influence of the parameters utilized in the joint resistance moments in the response of the considered multibody model. The results lead to the conclusion that the modifications incorporated in the proposed methodology allow the correct restriction of the RoM of mechanical joints, while preserving the mechanical energy of the system and providing reliable results to multibody mechanical systems containing real joints with limited RoM. Future studies should aim at applying the proposed methodology to restrict the RoM of mechanical joints in other scientific areas of investigation, such as robotics and biomechanics, to examine the suitability and appropriateness of the proposed approach. Finally, the work described in this paper can also be utilized, for instance, to optimize robot trajectories by finding the best trajectory that the robot can follow that minimizes the joint resistance moments. Similarly, the optimization of sports performance, rehabilitation procedures, or mechanical devices can also be achieved.