Next Article in Journal
Study on the Simplified Chemical Kinetic Combustion Mechanism of Mixed Methanol/PODE Fuel for Marine Diesel Engines
Previous Article in Journal
Simulation of Ni2+ Chelating Peptides Separation in IMAC: Prediction of Langmuir Isotherm Parameters from SPR Affinity Data
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automated Symbolic Processes for Dynamic Modeling of Redundant Manipulator Robots

Electrical Engineering Department, Faculty of Engineering, University of Santiago of Chile, Las Sophoras 165, Estación Central, Santiago 9170124, Chile
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Processes 2024, 12(3), 593; https://doi.org/10.3390/pr12030593
Submission received: 27 February 2024 / Revised: 11 March 2024 / Accepted: 13 March 2024 / Published: 15 March 2024
(This article belongs to the Section Automation Control Systems)

Abstract

:
In this study, groundbreaking software has been developed to automate the generation of equations of motion for manipulator robots with varying configurations and degrees of freedom (DoF). The implementation of three algorithms rooted in the Lagrange–Euler (L-E) formulation is achieved through the utilization of .m files in MATLAB R2020a software.This results in the derivation of a symbolic dynamic model for industrial manipulator robots. To comprehend the unique features and advantages of the developed software, dynamic simulations are conducted for two 6- and 9-DoF redundant manipulator robots as well as for a 3-DoF non-redundant manipulator robot equipped with prismatic and rotational joints, which is used to simplify the dynamic equations of the redundant prototypes. Notably, for the 6-DoF manipulator robot, model predictive control (MPC) is employed using insights gained from the dynamic model. This enables optimal control by predicting the future evolution of state variables: specifically, the values of the robot’s joint variables. The software is executed to model the dynamics of different types of robots, and the CPU time for a MacBook Pro with a 3 GHz Dual-Core Intel Core i7 processor is less than a minute. Ultimately, the theoretical findings are validated through response graphs and performance indicators of the MPC, affirming the accurate functionality of the developed software. The significance of this work lies in the automation of motion equation generation for manipulator robots, paving the way for enhanced control strategies and facilitating advancements in the field of robotics.

1. Introduction

Manipulator robots are complex mechanisms, and their mathematical modeling has always been a crucial aspect, especially when considering dynamic phenomena. In recent decades, dynamic modeling of classical industrial manipulator robots has been the subject of unprecedented attention [1] because it is critical for mechanical design and is of paramount importance for controller simulation and implementation [2,3]. This area of study has not only focused on robotic arms but also on other types of robot morphologies, such as wheeled mobile robots [4], space robots [5], submarine robots [6], flexible robots [7], and parallel manipulator robots [8].
Deep understanding of the dynamic characteristics of a manipulator robot is fundamental for practical robot applications. Many of these applications require, for example, effective trajectory tracking capacities that—to improve their performance—should consider a dynamic model of a manipulator robot [9,10,11]. Knowledge and modeling of a manipulator robot’s dynamics are crucial for the optimal performance of its control strategies (based on the robot model), such as inverse dynamic control, calculated torque control, and model predictive control [12,13,14]. An effective dynamic model together with a robust controller not only allow for the optimal design of the trajectory planning scheme but also for the safe and accurate maneuvering of the manipulator robot when getting close to the grip point of an object [15,16]. Controllers that consider the dynamic behavior of manipulator robots are faster, more dexterous, and more efficient as well as smoother in tracking than static controllers [17]. Knowing the dynamics can guide both the design and construction of robot systems, including the selection of their actuators and transmission components to initiate motion. Particularly, dynamic equations play an important role in real-time control applications, as they help determine the forces/torques necessary to generate the desired trajectories (position, velocity, and acceleration) [18].
MPC controllers are a promising candidate for handling constraints and enhancing system robustness. However, the convergence of the system cannot be assured in the face of the uncertainty of the modeling procedure, which significantly influences the execution of the MPC. Several current works have included a robot manipulator model in the construction of this type of controller; however, they have had to incorporate adaptive mechanisms to the controller mainly due to imprecise models or external disturbances. For example, in [19], a sliding-mode-based MPC with an auxiliary controller based on a node-adaptive neural network is constructed to dynamically compensate for nonlinear uncertain dynamics and to enhance the trajectory tracking of a robotic manipulator with state constraints. Similar work was carried out in [20], wherein a linear extended-state observer (LESO)-based MPC was proposed for high-precision trajectory tracking of space robotic manipulators. Particularly, the LESO was designed to minimize the impact of the inaccuracies in the dynamic model. In [21], the impact of external noise and imprecise models on the system performance is eliminated through a radial basis function neural network (RBFNN) integrated into a Lyapunov-based MPC (LMPC) strategy for dual-arm manipulators. Therefore, in these types of model-based control strategies, it is crucial to have accurate dynamic models in order to improve system performance and/or to avoid adding components from other control methods.
Usually, equations of motion are described in the 3D Euclidean space, which rapidly produces a great quantity of equations for connected body systems. Due to the need to design and implement systems that operate in real-time, especially in terms of controllers, the robotics community has focused on the computational efficiency problem. In the literature, several Information Technology (IT) programs for modeling the dynamics of robots with different capacities and properties have been proposed, and most of them are based on numerical calculations (instead of symbolic calculations) [22]. The concept “symbolic” is used in robotics when the dynamics of manipulator robots are described by symbolic expressions using symbolic variables that do not have numerical values. A symbolic calculation program is more powerful than a numerical one, since, from a design perspective, a symbolic representation is easier to analyze when verifying, for example, the influence of parameters such as mass or length of the links in the model [23]. In general, the execution of a simulation based on a symbolic (exact) model is faster than that based on a numerical model. In addition, from a research point of view, symbolic programming allows for using some special control approaches that are impossible to address through a numerical model [24].
Specifically, to generate the dynamic equations of a manipulator robot in symbolic form, simulation programs are used, which include algebraic systems and advanced algorithms that minimize computational costs and reorganize calculations in a smart way. Dynamic methods can be mainly divided into two types: explicit and recursive. These procedures include the recursive Lagrange method, the generalized D’Alembert principle, the Kane method, the recursive Newton–Euler algorithm (RNEA), and the Lagrange–Euler formulation (L-E) [25,26,27].
More than four decades ago, researchers started to focus on developing software to generate the dynamic representation of manipulator robots. In [28], an open source program is presented—namely, Dynamic Models of Industrial Robots (DYMIR)—which uses the Lagrangian formulation, kinematic description, and some characteristics of a system based on the LISt Processor (LISP) to perform the symbolic calculation of dynamic models with up to 12 degrees of freedom (DoF). Another computer program based on LISP and the C language, the Algebraic Robot Modeler (ARM), was implemented to generate the model’s components in a symbolic form—namely, the inertial, centripetal, Coriolis, and gravitational parts of a Lagrangian dynamic model—using a special Q matrix formulation [29]. Additionally, the Robotic Toolbox for MATLAB provides numerical calculations of inverse dynamics employing the Newton–Euler recursive formula. In its library, this program only includes PUMA (Programmable Universal Manipulation Arm) and Stanford industrial manipulator robots as examples [30].
During recent decades, the MATLAB software has enabled the implementation of the Planar Manipulators Toolbox program for modeling and simulating the dynamics of planar manipulator robots with n-DoF and which include only rotary joints. Using this program, dynamic equations are obtained from the Lagrange–Euler formulation [31]. In addition, other computer programs have been created for robot systems, but these were conceived to adequately study the dynamics of serial manipulator robots, and their use is limited by the number of DoF of the robot [32,33]. Recently, some works have incorporated the use of computer programs for the automatic generation of kinematic and dynamic models. Among these, the Hybrid Robot Dynamics (HyRoDyn) software stands out; its application in the dynamic modeling of series–parallel hybrid robots is based on previous knowledge of the modeling of submechanisms that are already available in its library [34]. In turn, the MATLAB software allows for obtaining, in a symbolic form, a dynamic model of two collaborative robots: Kinova Gen2 and Kuka LWR4+ with 7-DoF; for these two types of robots, users should input the Denavit–Hartenberg (D-H) parameters and the vector parameters of the robots into a script .m file [35]. Additionally, a Unified Robot Description Format (URDF) file created in the SolidWorks software allows for calculating dynamic models of non-conventional robot configurations of n-DoF. However, continuously modeling new configurations in computer-assisted design (CAD) software is not time efficient [36].
Based on the aforementioned research, it is inferred that most authors propose a numerical solution (instead of a symbolic one) to solve the dynamic problem of manipulator robots. Existing software programs that do focus on generating symbolic models have several strengths (already highlighted above) but also some weaknesses, such as limitations to the maximum number of DoF and/or omission of the robot’s prismatic joints, slow response time of the program for displaying the desired dynamic models, limited library of available robots, and a request for input information that sometimes is not intuitive and which implies more interaction time with the user. Currently, all programs that have been designed have one or more of these weaknesses. The motivation for this research is to create software that eliminates all the above shortcomings and, additionally, facilitates the construction of mathematical models, optimizes the implementation of simulators, and ensures the correct operation of control systems. Thanks to the creation of this software, errors inherent in the manipulation of complex dynamic equations are avoided, and more reliable dynamic models are obtained in real-time. The main contributions of this article are listed below.
  • In Section 3, novel software for the automatic generation of robot dynamic models in a symbolic form is developed, specifically for n-DoF industrial manipulator robots with varying configurations. Section 4 presents examples of manipulator robot dynamics generated by the program, particularly for the 3-, 6-, and 9-DoF robot arms that have been calculated manually in Section 2. The dynamics of a 3-DoF non-redundant manipulator robot equipped with prismatic and rotational joints are used to simplify the equations of the redundant prototypes;
  • In Section 4, an intuitive graphical user interface (GUI) in MATLAB is written. Through this interface, the user can select the joint variables (rotational or prismatic) and interactively change the manipulator robot model using editing boxes. The combination of rotational and prismatic joints generates an infinite number of manipulator robot configurations.
  • In Section 5, an MPC-based control strategy for the 6-DoF redundant manipulator robot is proposed. This controller and the generated dynamic model are implemented in the MATLAB/Simulink environment to conduct dynamic simulations and to validate the theoretical results. Finally, the correct operation, characteristics, and ease-of-use of the software are confirmed.

2. Dynamics of Robotic Manipulators

The dynamic equations of an n-DoF manipulator robot are derived based on the Lagrange–Euler formulation. The standard form (matrix–vector) of the dynamics is presented in Equation (1) [37,38,39]:
M ( p ) p ¨ + C ( p , p ˙ ) p ˙ + g ( p ) + f ( p ˙ ) + τ 0 = τ
where p , p ¨ , p ¨ R n are the generalized position, velocity, and acceleration vectors, respectively; M R n × n is the symmetric positive-definite inertia (generalized mass) matrix; C R n × n is the damping, Coriolis, and centripetal forces matrix; g R n is the gravitational forces vector; f R n is the friction forces vector; τ 0 R n is the external disturbances and uncertainties vector of the system parameters; and τ R n is the control input vector (consisting of forces and torques exerted by the actuators).
As a result of the rotational and linear motion of the joints of a manipulator robot, additional forces known as Coriolis and centripetal forces are generated. These forces represent the j k -th element that forms the matrix C ( p , p ˙ ) and are calculated through Equation (2) [40]:
C j k ( p , p ˙ ) = i = 1 n C i j k ( p ) p i ˙
where p i ˙ is the i-th component of the generalized velocity vector, and C i j k ( p ) are the Christoffel symbols (coefficients) of the first kind described by Equation (3) [41]:
C i j k ( p ) = 1 2 M k i p j + M k j p i M i j p k
where M i j ( p ) is the i j -th element from the mass matrix M ( p ) , and p i is the i-th component of the generalized position vector. Using Equations (2) and (3), the damping, centripetal, and Coriolis forces vector c ( p , p ˙ ) presented in Equation (4) is obtained.
c ( p , p ˙ ) = C ( p , p ˙ ) p ˙ = [ c i 1 ( n D o F ) ]
where c i 1 ( n D o F ) is the i 1 -th component of the c ( p , p ˙ ) vector corresponding to an n-DoF robot, with i = 1 , , n .
The gravity force g j ( p ) on the j-th robot joint (component of the vector g ( p ) ) is obtained through Equation (5) [42]:
g j ( p ) = i = 1 n m i g r T · J v i j
where J v i j is the vector of the j-th column of the Jacobian matrix for linear speed J v i corresponding to the i-th link of the manipulator robot, and g r , defined in Equation (6), corresponds to gravitational acceleration:
g r = [ 0 0 g ] T
The vector of friction forces f ( p ˙ ) of the manipulator robot is given by Equation (7):
f ( p ˙ ) = [ F v i ] p ˙
where F v i are the friction coefficients of the manipulator robot’s joints, with i = 1 , , n .
A dynamic model of the actuators is not considered in the modeling process nor in the simulations below.

2.1. Description and Dynamic Modeling of a 3-DoF Planar Manipulator Robot

Figure 1 shows the structure of a 3-DoF planar manipulator robot with an RPR (Rotational–Prismatic–Rotational) configuration. The robot has two articulated arms composed of two links that rotate in the xy plane and one link that translates (moves linearly) in the same plane to create a 2D serial rigid-link manipulator. The first rotational joint θ 1 , assembles the fixed base and the first arm; the second prismatic joint d 2 , between links 1 and 2, elongates/shrinks the first arm; and the third rotational joint θ 3 , between links 2 and 3, assembles both arms. For motion control, the dynamic equations of the mechanism are conveniently described by the Lagrange–Euler formulation represented in the joint-space form. Vectors f ( p ˙ ) and τ 0 are not considered in the modeling process of this planar robot.
where L 1 is the length of the first and third link; L 2 is the length of the second link; and l c i is the length from the origin of link i to its centroid of i = 1 , 2 , 3 mass.
The elements of the mass matrix, M ( p ) are:
M 11 ( 3 D o F ) = I 1 + I 3 + m 1 l c 1 2 + m 2 λ 2 2 + m 3 [ l 2 2 + l c 3 2 + 2 l 2 l c 3 c 3 ]
M 12 ( 3 D o F ) = M 21 ( 3 D o F ) = M 23 ( 3 D o F ) = M 32 ( 3 D o F ) = m 3 l c 3 s 3
M 13 ( 3 D o F ) = M 31 ( 3 D o F ) = I 3 + m 3 [ l c 3 2 + l 2 l c 3 c 3 ]
M 22 ( 3 D o F ) = m 2 + m 3
M 33 ( 3 D o F ) = I 3 + m 3 l c 3 2
The elements of the Coriolis–centripetal forces matrix C ( p , p ˙ ) are:
C 11 ( 3 D o F ) = [ m 2 λ 2 + m 3 ( l 2 + l c 3 c 3 ) ] d 2 ˙ m 3 [ l c 3 l 2 s 3 ] θ ˙ 3
C 12 ( 3 D o F ) = [ m 2 λ 2 + m 3 ( l 2 + l c 3 c 3 ) ] θ ˙ 1
C 13 ( 3 D o F ) = m 3 [ l c 3 l 2 s 3 ] ( θ ˙ 1 + θ ˙ 3 )
C 21 ( 3 D o F ) = [ m 2 λ 2 + m 3 ( l 2 + l c 3 c 3 ) ] θ 1 ˙ m 3 [ l c 3 c 3 ] θ 3 ˙
C 22 ( 3 D o F ) = C 33 ( 3 D o F ) = 0
C 23 ( 3 D o F ) = m 3 l c 3 c 3 ( θ 1 ˙ + θ 3 ˙ )
C 31 ( 3 D o F ) = m 3 [ l 2 l c 3 s 3 ] θ 1 ˙ + m 3 [ l c 3 c 3 ] d 2 ˙
C 32 ( 3 D o F ) = m 3 [ l c 3 c 3 ] θ 1 ˙
Considering that gravitational acceleration acts in the negative direction of the y-axis, i.e., g r = [ 0 g ] T , the components of the gravity forces vector are:
g 1 = m 1 g l c 1 c 1 + m 2 g λ 2 c 1 + m 3 g ( l c 3 + l 2 ) c 13
g 2 = ( m 2 + m 3 ) g s 1
g 3 = m 3 g l c 3 c 13
with c 1 = cos ( θ 1 ) , c 3 = cos ( θ 3 ) , s 1 = sin ( θ 1 ) , s 3 = sin ( θ 3 ) , c 13 = cos ( θ 1 + θ 3 ) , λ 2 = L 1 + d 2 + l c 2 , and l 2 = L 1 + d 2 + L 2 ; where l 2 is the length of the first arm (m); m i is the i-th link mass (kg), i = 1 , 2 , 3 ; and I j is the j-th link inertia moment with respect to the first z-axis of its joint (kg· m2), j = 1 , 3 .

2.2. Description and Dynamic Modeling of a 6-DoF Planar Manipulator Robot

As a second example, a 6-DoF planar manipulator robot with an RPRPRP (Rotational–Prismatic–Rotational–Prismatic–Rotational–Prismatic) configuration is considered. Figure 2 shows a 9-DoF non-planar manipulator robot, for which only the first 6-DoF were included in the dynamic model after neglecting the degrees of freedom in the robot’s end-effector. The robot has three articulated arms composed of six links in total that rotate and translate in the same plane xy. Rotational and prismatic joints are responsible for assembling and elongating/shrinking the robot’s arms, respectively.
The dynamic model for the RPRPRP mechanism inherits the RPR robot dynamics model derived from Section 2.1. For the sake of space and conciseness, the mass matrix M ( p ), Coriolis–centripetal matrix terms in C ( p , p ˙ ), as well as the gravity matrix g ( p ) as derived by the authors for the 6-DoF robot dynamics are stored at https://dynamics.6-DoF.robot for reference.

2.3. Description and Dynamic Modeling of a 9-DoF Non-Planar Manipulator Robot

As a third example, a 9-DoF non-planar manipulator robot with an RPRPRPPRR (Rotational–Prismatic–Rotational–Prismatic–Rotational–Prismatic-Prismatic–Rotational– Rotational) configuration is considered, as shown in Figure 2. The robot has four arms in total, with six links that rotate/translate in the xy plane and three links out-of-plane to create a 3D rigid-link redundant manipulator. The seventh prismatic joint, d 7 , between links 6 and 7, elongates/shrinks the fourth robot arm, and the last two rotational joints, θ 8 and θ 9 , position the end-effector in xyz space in a pitch–roll way. The dynamic model for the RPRPRPPRR mechanism inherits the RPRPRP robot dynamics model derived from Section 2.2.
The elements of the mass matrix M ( p ) , the components of the Coriolis–centripetal forces vector c ( p , p ˙ ) , and the components of the gravity forces vector g ( p ) of the 9-DoF manipulator robot are presented in extenso in Appendix A. All these calculations (Equations (8) and (A40))will be conducted manually to validate the correct operation of the proposed software for planar, non-planar, and multiple-DoF manipulator robots.
Figure 2. Diagram of a pitch–roll type 9-DoF non-planar manipulator robot considering the location of the centroids.
Figure 2. Diagram of a pitch–roll type 9-DoF non-planar manipulator robot considering the location of the centroids.
Processes 12 00593 g002
where L j is the length of link j (m), j = 7 , 8 , 9 ; and l c i is the length from the origin of link i to its centroid of i = 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 mass (m).

3. Description of the Designed Software

To conduct the identification of the dynamic model of an n-DoF redundant manipulator robot, the designed software is composed of three algorithms.

3.1. First Algorithm

The first algorithm conducts the symbolic calculation of speed, acceleration, kinetic energy, and potential energy of each robot link. To this end, using a GUI, the program file (script) energy.m is executed, which requests the user to enter the following robot specifications in the command window of MATLAB:
  • Number of degrees-of-freedom;
  • Type of configuration;
  • Location of links in the workspace.
For the location of links in the workspace, the Cartesian plane (xy, xz, or yz) on which the robot link is placed at rest should be specified. In case the point is not specified on the Cartesian plane, it is assumed by default that the robot is planar and that all its links are located in the xy plane. With the specifications already entered, the first algorithm states, in a symbolic form, the scalar and vector variables in the workspace of MATLAB and searches for the centroid positions, from which kinetic and potential energy are obtained and saved in the workspace as energy.mat. Then, the software notifies the user that energy.mat has been successfully created and asks the user whether he/she authorizes the execution of the energy_opt.m script. If the user denies permission, the loop is repeated. Otherwise, energy_opt.m uses an algorithm to refine the symbology of this part of the robot’s dynamic model and saves the response as energy_opt.mat. In this way, the first algorithm—summarized in Algorithm 1—ends its execution successfully.
Algorithm 1 Calculate the energy of the system
Require: 
Number of degrees of freedom of the manipulator robot ( n ) , configuration type ( R , P ) , and location of links in the workspace ( 2 D , 3 D )
Ensure: 
Velocity ( v ), acceleration ( a ), and the kinetic and potential energy of the robotic system (K,U)
1:
s y m s scalar variables and functions
2:
c = c 1 = p ( 1 ) = p ( 2 ) = 0 ; p ( 3 ) = L ▹ Initial condition of the position of the center of gravity
3:
for  i = 1 , 2 , , n   do
4:
    if type_of_robot = 2D then
5:
         l i n k ( i ) = Y
6:
    else[type_of_robot = 3D]
7:
         l i n k ( i ) = i n p u t ( Y o r N )
8:
    end if
9:
end for
10:
for  i = 1 , 2 , , n   do
11:
    if  j o i n t ( i ) = R  then
12:
        if  l i n k ( i ) = Y  then
13:
            p i = [ p ( 1 ) + l c i cos ( c + θ i ) , p ( 2 ) + l c i sin ( c + θ i ) , p ( 3 ) ]
14:
        else[ l i n k ( i ) = N ]
15:
            c 1 = c 1 + p i
16:
            p i = [ p ( 1 ) + l c i sin ( c 1 ) sin ( c ) , p ( 2 ) l c i sin ( c 1 ) cos ( c ) , p ( 3 ) ]
17:
        end if
18:
        if  i 2  ∧  j o i n t ( i 1 ) = P  ∧  l i n k ( i ) = N  then
19:
            s u b s ( p i , [ l c ( i 1 ) , L ] , [ L 2 , L l c i cos ( c 1 ) ] )
20:
        else if  i 2  ∧  j o i n t ( i 1 ) = R  ∧  l i n k ( i ) = N  then
21:
            s u b s ( p i , [ l c ( i 1 ) , L ] , [ L 1 + L 2 , L l c i cos ( c 1 ) ] )
22:
        else if  i 2  ∧  j o i n t ( i 1 ) = R  then
23:
            s u b s ( p i , l c ( i 1 ) , L 1 + L 2 )
24:
        else if  i 2  then
25:
            s u b s ( p i , l c ( i 1 ) , L 2 )
26:
        end if
27:
    else[ j o i n t ( i ) = P ]
28:
        if  i = 1  ∧  j o i n t ( 1 ) = P  then
29:
            p i = [ p ( 1 ) + L 1 + d i + l c i , p ( 2 ) , p ( 3 ) ]
30:
        else
31:
            p i = [ p ( 1 ) , p ( 2 ) , p ( 3 ) ]
32:
        end if
33:
        if  i 2  ∧  j o i n t ( i 1 ) = P  ∧  l i n k ( i ) = N  then
34:
            s u b s ( p i , [ l c ( i 1 ) , L ] , [ L 2 , L l c i L 1 d i ] )
35:
        else if  i 2  ∧  j o i n t ( i 1 ) = R  ∧  l i n k ( i ) = N  then
36:
            s u b s ( p i , [ l c ( i 1 ) , L ] , [ L 1 + L 2 , L l c i L 1 d i ] )
37:
        else if  i 2  ∧  j o i n t ( i 1 ) = R  then
38:
            s u b s ( p i , l c ( i 1 ) , L 1 + l c i + d i )
39:
        else if  i 2  then
40:
            s u b s ( p i , l c ( i 1 ) , L 1 + L 2 + l c i + d i )
41:
        end if
42:
         v i = v e l o c i t y _ v e c t o r ( p i ) ; a i = a c c e l e r a t i o n _ v e c t o r ( v i ) ; K i = k i n e t i c _ e n e r g y ( m i , I i , v i ) ; U i = p o t e n t i a l _ e n e r g y ( m i , p i , g )
43:
    end if
44:
end for
In the algorithm, p i is the i-th link centroid position, and g is the gravitational acceleration vector. The velocity_vector(), acceleration_vector(), kinetic_energy(), and potential_energy() functions compute the centroid velocity, centroid acceleration, kinetic energy, and potential energy, respectively, of link i. These equations are described based on the Lagrange–Euler formulation and the MATLAB functions ‘syms’ and ‘subs’, which create and convert, respectively, the symbolic variables and functions.

3.2. Second Algorithm

The second algorithm develops the equations of motion of the manipulator robot. To this end, the generalized_forces.m script should be executed, as it loads the information from the energy_opt.mat file. Then, this algorithm calculates the Lagrangian from the energies obtained through the first algorithm and uses it to calculate the generalized forces applied to the robot’s joints. Once the script’s execution is over, data from the .m file are automatically stored as a .mat file, i.e., the symbolic expressions of torques and forces necessary to move the system are saved in the force_torque.mat file. In this way, the second algorithm—summarized in Algorithm 2—ends its execution successfully.
Algorithm 2 Calculate the robot’s equations of motion
Require: 
Kinetic and potential energy of the robotic system ( K , U )
Ensure: 
Vector of generalized forces applied at the robot joints ( τ )
1:
L S = l a g r a n g i a n ( K , U )
2:
L = l a g r a n g i a n _ t i m e ( L S )
3:
for  i = 1 , 2 , , n   do
4:
     D L i = d e r i v a t i v e _ l ( L )
5:
     D T i = c o n v e r t ( D L i )
6:
     D D T i = d e r i v a t i v e _ d t ( D T i )
7:
     R T i = r e m o v e _ t i m e ( D D T i )
8:
     T i = d e r i v a t i v e _ l s ( L S )
9:
     τ i = g e n e r a l i z e d _ f o r c e s ( R T i , T i )
10:
end for
In the algorithm, lagrangian() computes the Lagrangian of the system, lagrangian_time() defines the elements of L S and the joint angle/displacement vector as a function of time, derivative_l() derives L with respect to the i-th joint speed, convert() converts the elements of the derivative of L i as a function of time, derivative_dt() derives D T i with respect to time, remove_time() temporarily removes the time variable from D D T i , derivative_ls() derives L S with respect to the generalized coordinate q i of the vector q, and generalized_forces() computes the force/torque applied to the i-th robot joint.

3.3. Third Algorithm

The third algorithm is formed by four loops that—from the second algorithm—extract the most relevant terms of the inverse dynamic model of the robot. To this end, the user executes the dynamic.m script, after which the energy_opt.mat and force_torque.mat files are loaded from the first and second algorithm, respectively. Then, the third algorithm notifies the user that dynamic.mat has been successfully created and asks the user whether he/she wants to execute the terms.m script; if the request is denied, the loop is repeated. Otherwise, the terms.m script optimizes the dynamic model and saves the results as terms.mat. This file contains the symbolic forms of the elements in the mass matrix and the elements in the Coriolis–centripetal forces matrix. Additionally, the third algorithm saves the components of the gravity forces vector of non-planar manipulator robots. In this way, the software notifies the user of the output, and the third algorithm—summarized in Algorithm 3—ends its execution successfully.
Algorithm 3 Calculate the terms of the generalized forces vector
Require: 
Vector of the generalized forces applied at the robot joints ( τ )
Ensure: 
Elements of the inertia matrix ( M ), elements of the centrifugal and Coriolis forces matrix ( C ), and components of the gravitational forces vector ( g )
1:
for  i = 1 , 2 , , n   do
2:
    for  j = 1 , 2 , , n  do
3:
         M i j = i n e r t i a _ m a t r i x _ e l e m e n t ( τ i )
4:
    end for
5:
end for
6:
for  k = 1 , 2 , , n   do
7:
    for  j = 1 , 2 , , n  do
8:
        for  i = 1 , 2 , , n  do
9:
            C i j k = c h r i s t o f f e l _ c o e f f i c i e n t s ( M k j , M k i , M i j )
10:
        end for
11:
    end for
12:
end for
13:
for  i = 1 , 2 , , n   do
14:
    for  j = 1 , 2 , , n  do
15:
         C i j = c c _ m a t r i x _ e l e m e n t ( C i j k , p ˙ )
16:
    end for
17:
end for
18:
for  i = 1 , 2 , , n   do
19:
     g i = g f _ v e c t o r _ c o m p o n e n t ( U )
20:
end for
In the algorithm, inertia_matrix_element() derives τ i with respect to the acceleration q ¨ j ; christoffel_coefficients() computes the Christoffel coefficients; matrix_element() computes the elements of the centrifugal and Coriolis forces matrix; and GF_vector_component() derives U with respect to the generalized coordinate q i of the vector q.
The flowchart in Figure 3 summarizes the structure and working principle of the three algorithms.

4. Graphic User Interface

The designed GUI provides intuitive access to the simulations as well as an interactive and real-time view of manipulator robot modeling. In the main GUI box, users can create different types of robots capable of maneuvering their grippers both in the Cartesian plane xy and the Cartesian space xyz along with searching for the robot dynamics by selecting one of the following options:
  • Dynamics of a robot from the library;
  • Dynamics of a new robot prototype.
The first option provides access to a library that includes dynamic models of some well-known robots, including PUMA, Stanford, SCARA (Selective Compliance Articulated Robot Arm), and planar manipulator robots. The second option allows for obtaining the dynamic model of a new robot type created by the user, who should specify the number of degrees of freedom, the type of configuration, and the workspace. These three statements (five maximum) are entered into the command window of MATLAB once the software is executed and requests the input. Specifically, to indicate the robot’s DoF (input 1), a number must be entered at the command line; to set up the type of robot (input 2), the characters R and/or P should be typed, as they denote rotational and prismatic joints, respectively; while for the workspace (input 3), the initial location of each link in space should be indicated through the statement 2D or 3D. If the input is 2D, the software computes the complete robot dynamics and confirms that it is a planar prototype that starts to operate from the xy plane with its links resting on the positive semi-axis x, whereas if the input is 3D, the software confirms that the robot is non-planar and immediately requests additional information (inputs 4 and 5) to define the initial position of each link. For example, for a 2-DoF non-planar robot, if the first combination of inputs is 3D and Y (input 4), then the first link is positioned in the xy plane, whereas if the second combination of inputs is 3D and N, the second link is positioned in the xz or yz plane depending on what the user specifies (input 5). The general description and organization of the GUI is illustrated in Figure 4.
Figure 5 shows a sub-window of the GUI, which displays the applications of the robot dynamics that can be accessed. These include the elements of the mass matrix (M); the elements of the damping, Coriolis, and centripetal forces matrix (C); the components of the gravity forces vector (G), positions (P), velocities (V), and accelerations (A) of the center of gravity (centroid); and the kinetic energies (K) and potential energies (U) of the robot links. Additionally, the toolbox allows for the monitoring of the generalized forces acting on each manipulator robot joint in a numerical, graphic, or symbolic form. For example, with the ‘Symbolic’ icon, the symbolic equations of the torques and forces are displayed in a GUI static text box. To improve readability, these expressions can be shown in code or plain-text format.
To better illustrate the qualities of the software, robots with 3-DoF, 6-DoF, and 9-DoF are presented in Section 2. In the particular case of the 6-DoF manipulator robot, its mass and Coriolis–centripetal forces matrices are composed of 36 elements, while the gravity forces vector has six components. By clicking on the corresponding icon on the menu in Figure 5, any matrix or vector forming the inverse dynamic model can be obtained along with other applications. Figure 6, Figure 7 and Figure 8 show some of the equations that the software generates as code.

5. Results

To validate the dynamic model, the manual calculations (Equations (8) and (A40)) are compared with the results of this software (Figure 6, Figure 7 and Figure 8). It is confirmed that the program completely solves the problem of direct and inverse dynamics of manipulator robots. A proof of the model matching in the case of the 6-DoF manipulator robot is shown in Figure 9.
The software is executed to generate the dynamics for different types of robots, and the CPU time for a MacBook Pro with a 3 GHz Dual-Core Intel Core i7 processor is between 15 and 35 s for a symbolic-model-based approach and between 25 and 60 s for a numerical-model-based approach. Additionally, dynamic simulations are conducted using the MATLAB/Simulink software to test the performance of the constructed 6-DoF manipulator robot model considering the dynamic parameters described in Table 1.
Figure 9. Comparison between the results obtained by the program (top) and those calculated manually (bottom).
Figure 9. Comparison between the results obtained by the program (top) and those calculated manually (bottom).
Processes 12 00593 g009
In the table, F v i is the motor’s viscous friction, i = 1 , 2 , 3 , 4 , 5 , 6 .
In this specific simulation, the desired angles of the robot’s rotational joints are θ 1 = 0.5 (rad), θ 3 = 0.7 (rad), and θ 5 = 1 (rad); the lengths of the prismatic joints are d 2 = 0.2 (m), d 4 = 0.1 (m) and d 6 = 0.15 (m); and the simulation time is preset to 3.5 s.
Model predictive control (MPC)-based controllers for each DoF of the robot were also developed; these require knowing the dynamic model of the robot. Predictive control is a technique in which an explicit model is required for the prediction of the output of the process. Future values of the manipulated variables are predicted by optimizing the reduction of the difference between the current and desired trajectory. MPC-based control is described by Equation (24):
J = j = n 1 n 2 ( q r ( t + j ) q ( t + j ) ) 2 + ρ j = 1 n u ( u ( t + j 1 ) u ( t + j 2 ) ) 2
where n 1 is the prediction horizon, n 2 is the cost horizon, n u is the control horizon, u ( t ) is the tentative control signal at instant t, q r is the desired response, q is the network model response, and ρ is the controller weighting factor. The values n 1 , n 2 , and n u assist with evaluation of the control increments, while the factor ρ determines the contribution that the sum of the squares of the control increments has on the performance index.
Figure 10 shows the control scheme of the simulator for the 6-DoF robot.
where m v i is the i-th manipulated variable (torque or force); m o i is the i-th measured output (angle or displacement); τ i is the i-th generalized force applied over the robot’s joints; θ i r is the i-th reference joint position; and θ i , θ i ˙ , θ i ¨ are the i-th actual joint position, speed, and acceleration, respectively, with i = 1 , 2 , 3 , 4 , 5 , 6 .
The best performance of the controllers was obtained considering the following values: sample time = 0.08, n 1 = 150 , n 2 = 200 , n u = 2 , ρ = 0.5 , state estimation = faster, and closed-loop performance = moderately aggressive. These parameters were empirically tuned using the MPC Toolbox of the MATLAB/Simulink software. Additionally, saturation blocks were incorporated to limit the extreme values of the generalized forces exerted on the robot joints. Table 2 shows the lower and upper limits of the saturators installed at the output of each MPC controller.
To monitor the instant numerical values or the graphics of the control signal, the icons ‘Numeric’ and ‘Graphs’, respectively, in Figure 5 are selected. Specifically, for a view of the control signal graphics, the value of each joint needs to have been previously entered in the editable box. In general, by clicking the icons ‘Simulate’ and ‘ θ and τ ’ (or ‘d and f’) in Figure 11,the graphs of the generalized forces and motion of the 6-DoF redundant manipulator robot joints can be seen. Additionally, graphs of the velocities and accelerations of the robot joints can be displayed by pushing the ‘Simulate’ and ‘v and a’ buttons, as shown in Figure 12.
By clicking on the ’Reset’ icon, shown in Figure 11 and Figure 12, the information saved in the editable boxes is erased, and in turn, the screen graphics are cleared, allowing for entering the new desired joint values. In addition, by clicking on the ‘Update’ icon, the user returns to the main menu of the GUI and is able to change the current configuration of the robot and to specify new desired values and parameters for subsequent simulations.
The performance of the MPC controller is also evaluated from the following performance indicators: residual mean square (RMS), which measures the variability of the residuals (the differences between the desired and actual joint positions of the robot); residual standard deviation (RSD), which explains the deviation of the series; and index of agreement (IA), which provides the trends between two series to be compared. Equations (25)–(27) detail the expressions to calculate these indicators:
RMS = 1 c i = 1 c ( p i p d i ) 2
RSD = i = 1 c ( p i p d i ) 2 i = 1 c p i 2
IA = 1 i = 1 c ( p i p d i ) 2 i = 1 c ( | p i | | p d i | ) 2
with | p i | = p i p m , | p d i | = p d i p m , where c is the total number of observed data; p i is the i-th current joint value; p d i is the i-th desired joint value; and p m is the mean joint value.
Table 3 shows the results of the joint error indicators calculated considering c = 1008 in 10 s of simulation. In particular, the results reveal good performance of the proposed controller since the RMS and RSD indices have values close to zero, while the IA indicator has values close to unity.

6. Conclusions

This work presented the development of software that automatically generates the equations of motion of industrial manipulator robots with any configuration type and number of DoF. The designed algorithms are based on the Lagrange–Euler formulation and allow for obtaining the dynamics of robotic manipulators formed by inflexible bodies (links) interconnected through n rotation and/or translation joints. To enter both the manipulator robot parameters and the desired values for their joints, a GUI was developed, which provides intuitive access to the simulation as well as an interactive and real-time view of the robots. This software is a powerful tool not only for modeling robotic arms but also for the design of diverse control systems. As an example, software simulations were conducted to generate the dynamics of a 3-DoF non-redundant manipulator robot and two 6- and 9-DoF redundant manipulator robots that included prismatic and rotational joints. The software, running on a MacBook Pro with a 3 GHz Dual-Core Intel Core i7 processor, takes less than a minute to model the symbolic dynamics of different robotic arms. Specifically, a model of the 3-DoF non-redundant manipulator robot was constructed to simplify the equations of motion of the redundant robots. In the case of the 6-DoF robot, MPC was performed based on the previous knowledge of its dynamic model, thanks to which optimal control to predict the future evolution of its state variables was achieved, i.e., the values of the joint variables of the robot. It was confirmed that manual calculations of the dynamic models of these three types of robots match the results of the software. Thus, the developed software is validated, as it correctly solves the direct and inverse dynamics problems of manipulator robots.
In future research work, it is contemplated to build other relevant mathematical models—for example, direct and inverse kinematics models—by taking advantage of the ideas of this study. In addition, it is desired to expand the gallery of robots available in the software library, possibly by incorporating mobile, flexible, and spatial robots. The large amount of information requested by the program before displaying the dynamic models is an aspect that is also being considered for the future. Addressing the latter would improve the efficiency of this work by ensuring that the interaction between the software and user is minimal and that any person in general is able to manipulate this type of program.

Author Contributions

Conceptualization, C.U., D.S. and J.K.; methodology, C.U., D.S. and J.K.; software, C.U., D.S. and J.K.; validation, C.U. and D.S.; formal analysis, C.U., D.S. and J.K.; investigation, C.U., D.S. and J.K.; resources, C.U. and D.S.; data curation, C.U., D.S. and J.K.; writing—original draft preparation, C.U. and D.S.; writing—review and editing, C.U. and D.S.; visualization, C.U., D.S. and J.K.; supervision, C.U.; project administration, C.U.; funding acquisition, C.U. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within the article.

Acknowledgments

This work was supported by the Faculty of Engineering of the University of Santiago, Chile.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ARMAlgebraic Robot Modeler
CADComputer-Assisted Design
D-HDenavit–Hartenberg
DoFDegrees of Freedom
DYMIRDynamic Models of Industrial Robots
GUIGraphical User Interface
HyRoDynHybrid Robot Dynamics
IAIndex of Agreement
ITInformation Technology
L-ELagrange–Euler
LESOLinear Extended-State Observer
LISPLISt Processor
LMPCLyapunov-based MPC
MPCModel Predictive Control
PUMAProgrammable Universal Manipulation Arm
RBFNNRadial Basis Function Neural Network
RMSResidual Mean Square
RNEARecursive Newton–Euler Algorithm
RPRRotational-Prismatic-Rotational
RPRPRPRotational-Prismatic-Rotational-Prismatic-Rotational-Prismatic
RSDResidual Standard Deviation
SCARASelective Compliance Articulated Robot Arm
URDFUnified Robot Description Format

Appendix A. Dynamic Modeling of a 9-DoF Non-planar Manipulator Robot

The elements of the mass matrix M ( p ) are:
M 11 ( 9 D o F ) = M 11 ( 6 D o F ) M 33 ( 6 D o F ) + M 33 ( 9 D o F ) + ( f 16 + f 23 ) l 2
M 12 ( 9 D o F ) = M 21 ( 9 D o F ) = M 23 ( 9 D o F ) = M 32 ( 9 D o F ) = M 12 ( 6 D o F ) f 17 l 2
M 13 ( 9 D o F ) = M 31 ( 9 D o F ) = m 3 l 2 l c 3 c 3 + M 33 ( 9 D o F ) + ( f 6 + f 23 ) l 2
M 14 ( 9 D o F ) = M 41 ( 9 D o F ) = M 34 ( 9 D o F ) + ( f 7 + f 24 ) l 2
M 15 ( 9 D o F ) = M 51 ( 9 D o F ) = M 35 ( 9 D o F ) + ( f 8 + f 25 ) l 2
M 16 ( 9 D o F ) = M 61 ( 9 D o F ) = M 16 ( 6 D o F ) + ( f 19 f 22 f 39 ) / l 6
M 17 ( 9 D o F ) = M 71 = M 19 = M 91 = M 27 = M 72 = M 29 = M 92 = M 37 = M 73 = M 47 = M 74 = M 49 = M 94 = M 57 = M 75 = M 59 = M 95 = M 67 = M 76 = M 68 = M 86 = M 69 = M 96 = M 79 = M 97 = M 89 = M 98 = 0
M 18 ( 9 D o F ) = M 81 ( 9 D o F ) = ( m 8 + m 9 ) [ l 6 + l 4 c 5 + l 2 c 35 ] l c 8 c 8
M 22 ( 9 D o F ) = M 22 ( 6 D o F ) + M 77 ( 9 D o F )
M 24 ( 9 D o F ) = M 42 ( 9 D o F ) = M 24 ( 6 D o F ) + M 77 ( 9 D o F ) c 3
M 25 ( 9 D o F ) = M 52 ( 9 D o F ) = M 25 ( 6 D o F ) + ( m 8 + m 9 ) l c 8 s 8 c 35 f 26 l 6
M 26 ( 9 D o F ) = M 62 ( 9 D o F ) = M 26 ( 6 D o F ) + M 77 ( 9 D o F ) c 35
M 28 ( 9 D o F ) = M 82 ( 9 D o F ) = ( m 8 + m 9 ) l c 8 s 35 c 8
M 33 ( 9 D o F ) = M 33 ( 6 D o F ) M 55 ( 6 D o F ) + M 55 ( 9 D o F ) + ( f 29 + f 33 ) l 4
M 34 ( 9 D o F ) = M 43 ( 9 D o F ) = M 45 ( 9 D o F ) = M 54 ( 9 D o F ) = ( f 11 + f 30 ) / l 4
M 35 ( 9 D o F ) = M 53 ( 9 D o F ) = M 55 ( 9 D o F ) + ( f 13 + f 33 ) l 4
M 36 ( 9 D o F ) = M 63 ( 9 D o F ) = M 36 ( 6 D o F ) + M 56 ( 9 D o F ) + f 34 l 4
M 38 ( 9 D o F ) = M 83 ( 9 D o F ) = ( m 8 + m 9 ) [ l 6 + l 4 c 5 ] l c 8 c 8
M 39 ( 9 D o F ) = M 93 ( 9 D o F ) = M 99 ( 9 D o F ) = I 9
M 44 ( 9 D o F ) = M 44 ( 6 D o F ) + M 77 ( 9 D o F )
M 46 ( 9 D o F ) = M 64 ( 9 D o F ) = M 46 ( 6 D o F ) + M 77 ( 9 D o F ) c 5
M 48 ( 9 D o F ) = M 84 ( 9 D o F ) = ( m 8 + m 9 ) l c 8 s 5 c 8
M 55 ( 9 D o F ) = M 55 ( 6 D o F ) + m 7 l 6 2 + ( m 8 + m 9 ) [ l 6 2 + l c 8 2 s 8 2 ]
M 56 ( 9 D o F ) = M 65 ( 9 D o F ) = M 78 ( 9 D o F ) = M 87 ( 9 D o F ) = f 39 / l 6
M 58 ( 9 D o F ) = M 85 ( 9 D o F ) = ( m 8 + m 9 ) l c 8 l 6 c 8
M 66 ( 9 D o F ) = M 66 ( 6 D o F ) + M 77 ( 9 D o F )
M 77 ( 9 D o F ) = m 7 + m 8 + m 9
M 88 ( 9 D o F ) = ( m 8 + m 9 ) l c 8 2 + I 8
The components of the Coriolis–centripetal forces vector c ( p , p ˙ ) are:
c 11 ( 9 D o F ) = c 11 ( 6 D o F ) + [ f 16 d 2 ˙ f 17 θ 3 ˙ + f 18 d 4 ˙ f 19 θ 5 ˙ + f 20 d 6 ˙ + f 21 θ 8 ˙ ] θ 1 ˙ + [ f 16 θ 1 ˙ ] d 2 ˙ + [ f 17 ( θ 1 ˙ + θ 3 ˙ ) + f 18 d 4 ˙ f 19 θ 5 ˙ + f 20 d 6 ˙ + f 21 θ 8 ˙ ] θ 3 ˙ + [ f 18 ( θ 1 ˙ + θ 3 ˙ ) ] d 4 ˙ + [ f 19 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) + f 20 d 6 ˙ + f 21 θ 8 ˙ ] θ 5 ˙ + [ f 20 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] d 6 ˙ + [ f 21 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) + f 22 θ 8 ˙ ] θ 8 ˙
c 21 ( 9 D o F ) = c 21 ( 6 D o F ) + [ f 16 θ 1 ˙ f 23 θ 3 ˙ f 24 d 4 ˙ f 25 θ 5 ˙ f 26 d 6 ˙ + f 27 θ 8 ˙ ] θ 1 ˙ + [ f 23 ( θ 1 ˙ + θ 3 ˙ ) f 24 d 4 ˙ f 25 θ 5 ˙ f 26 d 6 ˙ + f 27 θ 8 ˙ ] θ 3 ˙ + [ f 24 ( θ 1 ˙ + θ 3 ˙ ) ] d 4 ˙ + [ f 25 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) f 26 d 6 ˙ + f 27 θ 8 ˙ ] θ 5 ˙ + [ f 26 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] d 6 ˙ + [ f 27 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) f 28 θ 8 ˙ ] θ 8 ˙
c 31 ( 9 D o F ) = c 31 ( 6 D o F ) + [ f 17 θ 1 ˙ + f 23 d 2 ˙ + f 29 d 4 ˙ f 30 θ 5 ˙ + f 31 d 6 ˙ + f 32 θ 8 ˙ ] θ 1 ˙ + [ f 23 θ 1 ˙ ] d 2 ˙ + [ f 29 d 4 ˙ f 30 θ 5 ˙ + f 31 d 6 ˙ + f 32 θ 8 ˙ ] θ 3 ˙ + [ f 29 ( θ 1 ˙ + θ 3 ˙ ) ] d 4 ˙ + [ f 30 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) + f 31 d 6 ˙ + f 32 θ 8 ˙ ] θ 5 ˙ + [ f 31 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] d 6 ˙ + [ f 32 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] θ 8 ˙
c 41 ( 9 D o F ) = c 41 ( 6 D o F ) + [ f 18 θ 1 ˙ + f 24 d 2 ˙ f 29 θ 3 ˙ f 33 θ 5 ˙ f 34 d 6 ˙ + f 35 θ 8 ˙ ] θ 1 ˙ + [ f 24 θ 1 ˙ ] d 2 ˙ + [ f 29 ( θ 1 ˙ + θ 3 ˙ ) f 33 θ 5 ˙ f 34 d 6 ˙ + f 35 θ 8 ˙ ] θ 3 ˙ + [ f 33 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) f 34 d 6 ˙ + f 35 θ 8 ˙ ] θ 5 ˙ + [ f 34 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] d 6 ˙ + [ f 35 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) f 36 θ 8 ˙ ] θ 8 ˙
c 51 ( 9 D o F ) = c 51 ( 6 D o F ) + [ f 19 θ 1 ˙ + f 25 d 2 ˙ + f 30 θ 3 ˙ + f 33 d 4 ˙ + f 37 d 6 ˙ + f 38 θ 8 ˙ ] θ 1 ˙ + [ f 25 θ 1 ˙ ] d 2 ˙ + [ f 30 ( θ 1 ˙ + θ 3 ˙ ) + f 33 d 4 ˙ + f 37 d 6 ˙ + f 38 θ 8 ˙ ] θ 3 ˙ + [ f 33 ( θ 1 ˙ + θ 3 ˙ ) ] d 4 ˙ + [ f 37 d 6 ˙ + f 38 θ 8 ˙ ] θ 5 ˙ + [ f 37 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] d 6 ˙ + [ f 38 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) + f 39 θ 8 ˙ ] θ 8 ˙
c 61 ( 9 D o F ) = c 61 ( 6 D o F ) + [ f 20 θ 1 ˙ + f 26 d 2 ˙ f 31 θ 3 ˙ + f 34 d 4 ˙ f 37 θ 5 ˙ + f 40 θ 8 ˙ ] θ 1 ˙ + [ f 26 θ 1 ˙ ] d 2 ˙ + [ f 31 ( θ 1 ˙ + θ 3 ˙ ) + f 34 d 4 ˙ f 37 θ 5 ˙ + f 40 θ 8 ˙ ] θ 3 ˙ + [ f 34 ( θ 1 ˙ + θ 3 ˙ ) ] d 4 ˙ + [ f 37 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) + f 40 θ 8 ˙ ] θ 5 ˙ + [ f 40 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] θ 8 ˙
c 71 ( 9 D o F ) = [ f 40 θ 8 ˙ ] θ 8 ˙
c 81 ( 9 D o F ) = [ f 21 θ 1 ˙ f 27 d 2 ˙ f 32 θ 3 ˙ f 35 d 4 ˙ f 38 θ 5 ˙ f 40 d 6 ˙ ] θ 1 ˙ + [ f 27 θ 1 ˙ ] d 2 ˙ + [ f 32 ( θ 1 ˙ + θ 3 ˙ ) f 35 d 4 ˙ f 38 θ 5 ˙ f 40 d 6 ˙ ] θ 3 ˙ + [ f 35 ( θ 1 ˙ + θ 3 ˙ ) ] d 4 ˙ + [ f 38 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) f 40 d 6 ˙ ] θ 5 ˙ + [ f 40 ( θ 1 ˙ + θ 3 ˙ + θ 5 ˙ ) ] d 6 ˙
c 91 ( 9 D o F ) = 0
The components of the gravity forces vector g ( p ) are:
g 1 = g 2 = g 3 = g 4 = g 5 = g 6 = g 9 = 0
g 7 = ( m 7 + m 8 + m 9 ) g
g 8 = ( m 8 + m 9 ) l c 8 s 8 g
with f 16 = m 789 l 2 + f 23 ; f 17 = l 2 l 4 f 24 + f 19 f 30 ; f 18 = m 789 l 2 c 3 + f 29 ; f 19 = m 89 l 2 c 35 l c 8 s 8 + l 2 l 6 f 26 + f 30 ; f 20 = m 789 l 2 c 35 + f 31 ; f 21 = m 89 l 2 l c 8 s 35 c 8 + f 32 ; f 22 = m 89 ( l 4 c 5 + l 2 c 35 ) l c 8 s 8 + f 39 ; f 23 = m 789 l 4 c 3 + f 25 ; f 24 = m 789 s 3 ; f 25 = c 35 f 37 + f 28 ; f 26 = m 789 s 35 ; f 27 = m 89 l c 8 c 35 c 8 ; f 28 = m 89 l c 8 s 35 s 8 ; f 29 = m 789 l 4 + f 33 ; f 30 = l 4 [ l 6 f 34 m 89 l c 8 c 5 s 8 ] ; f 31 = m 789 ( l 6 + l 4 c 5 ) ; f 32 = l 4 s 5 f 40 + f 38 ; f 33 = c 5 f 37 + f 36 ; f 34 = m 789 s 5 ; f 35 = m 89 l c 8 c 5 c 8 ; f 36 = m 89 l c 8 s 5 s 8 ; f 37 = m 789 l 6 ; f 38 = m 89 l c 8 2 s 8 c 8 ; f 39 = m 89 l 6 l c 8 s 8 ; f 40 = m 89 l c 8 c 8 ; c 8 = cos ( θ 8 ) ; s 8 = sin ( θ 8 ) ; m 89 = m 8 + m 9 ; m 789 = m 7 + m 8 + m 9 , where m i is the i-th link mass (kg), i = 7 , 8 , 9 ; and I k is the k-th link inertia moment with respect to the first z-axis of its joint (kg· m2), k = 8 , 9 .

References

  1. Urrea, C.; Kern, J.; Alvarez, E. Design and implementation of fault-tolerant control strategies for a real underactuated manipulator robot. Complex Intell. Syst. 2022, 8, 5101–5123. [Google Scholar] [CrossRef]
  2. Rognant, M.; Courteille, E.; Maurine, P. A systematic procedure for the elastodynamic modeling and identification of robot manipulators. IEEE Trans. Robot. 2010, 26, 1085–1093. [Google Scholar] [CrossRef]
  3. Raviola, A.; Guida, R.; Bertolino, A.C.; De Martin, A.; Mauro, S.; Sorli, M. A comprehensive multibody model of a collaborative robot to support model-based health management. Robotics 2023, 12, 71. [Google Scholar] [CrossRef]
  4. Khan, H.; Khatoon, S.; Gaur, P.; Abbas, M.; Saleel, C.A.; Khan, S.A. Speed control of wheeled mobile robot by nature-inspired social spider algorithm-based PID controller. Processes 2023, 11, 1202. [Google Scholar] [CrossRef]
  5. Chen, X.; Jia, Y. Dynamic modeling and responses investigation of spatial parallel robot considering lubricated spherical joint. Eur. J. Mech. A Solids 2022, 92, 104458. [Google Scholar] [CrossRef]
  6. Yang, J.; Ni, J.; Xi, M.; Wen, J.; Li, Y. Intelligent path planning of underwater robot based on reinforcement learning. IEEE Trans. Autom. Sci. Eng. 2022, 20, 1983–1996. [Google Scholar] [CrossRef]
  7. Zhang, F.; Yuan, Z. The study of coupling dynamics modeling and characteristic analysis for flexible robots with nonlinear and frictional joints. Arab. J. Sci. Eng. 2022, 47, 15347–15363. [Google Scholar] [CrossRef]
  8. Zidane, I.F.; Khattab, Y.; El-Habrouk, M.; Rezeka, S. Trajectory control of a laparoscopic 3-PUU parallel manipulator based on neural network in Simscape Simulink environment. Alex. Eng. J. 2022, 61, 9335–9363. [Google Scholar] [CrossRef]
  9. Ying, K.-C.; Pourhejazy, P.; Cheng, C.-Y.; Cai, Z.-Y. Deep learning-based optimization for motion planning of dual-arm assembly robots. Comput. Ind. Eng. 2021, 160, 107603. [Google Scholar] [CrossRef]
  10. Qian, K.; Tian, L. Data-driven physical law learning model for chaotic robot dynamics prediction. Appl. Intell. 2022, 52, 11160–11171. [Google Scholar] [CrossRef]
  11. Kern, J.; Marrero, D.; Urrea, C. Fuzzy control strategies development for a 3-DoF robotic manipulator in trajectory tracking. Processes 2023, 11, 3267. [Google Scholar] [CrossRef]
  12. Guo, W.; Li, R.; Cao, C.; Gao, Y. Kinematics, dynamics, and control system of a new 5-degree-of-freedom hybrid robot manipulator. Adv. Mech. Eng. 2016, 8, 1687814016680309. [Google Scholar] [CrossRef]
  13. Qiao, B.; Qu, H.; Deng, Y. Decentralized robust control of robotic manipulator in joint space based on torque feedbacks. Arab. J. Sci. Eng. 2022, 48, 11277–11284. [Google Scholar] [CrossRef]
  14. Galati, R.; Mantriota, G. Path following for an omnidirectional robot using a non-linear model predictive controller for intelligent warehouses. Robotics 2023, 12, 78. [Google Scholar] [CrossRef]
  15. Ogbemhe, J.; Mpofu, K.; Mokakabye, M. Robot dynamic model: Freudenstein-based optimal trajectory and parameter identification. Cogent Eng. 2022, 9, 2046682. [Google Scholar] [CrossRef]
  16. Meng, X.; Liu, W.; Tang, L.; Lu, Z.; Lin, H.; Fang, J. Trot gait stability control of small quadruped robot based on MPC and ZMP methods. Processes 2023, 11, 252. [Google Scholar] [CrossRef]
  17. Wang, C.; Frazelle, C.G.; Wagner, J.R.; Walker, I.D. Dynamic control of multisection three-dimensional continuum manipulators based on virtual discrete-jointed robot models. IEEE/ASME Trans. Mechatron. 2021, 26, 777–788. [Google Scholar] [CrossRef]
  18. Urrea, C.; Agramonte, R. Evaluation of parameter identification of a real manipulator robot. Symmetry 2022, 14, 1446. [Google Scholar] [CrossRef]
  19. Kang, E.; Liu, Y.; Qiao, H. Sliding mode-based adaptive tube model predictive control for robotic manipulators with model uncertainty and state constraints. Control Theory Technol. 2023, 21, 334–351. [Google Scholar] [CrossRef]
  20. Li, Y.; Xu, Z.; Yang, X.; Zhao, Z.; Zhuang, L.; Zhao, J.; Liu, H. Identification and high-precision trajectory tracking control for space robotic manipulator. Acta Astronaut. 2024, 214, 484–495. [Google Scholar] [CrossRef]
  21. Nguyen, V.C.; Thi, H.L.; Nguyen, T.L. A Lyapunov-based model predictive control strategy with a disturbances compensation mechanism for dual-arm manipulators. Eur. J. Control 2024, 75, 100913. [Google Scholar] [CrossRef]
  22. Lloyd, S.; Irani, R.; Ahmadi, M. A numeric derivation for fast regressive modeling of manipulator dynamics. Mech. Mach. Theory 2021, 156, 104149. [Google Scholar] [CrossRef]
  23. Wu, Y.; Qiao, Z.; Xue, J.; Wang, B.; Chen, W. A newly treated boundary conditions to enhance accuracy of finite element analysis for orifice-type aerostatic bearings. Adv. Eng. Softw. 2022, 173, 103277. [Google Scholar] [CrossRef]
  24. Hroncova, D.; Mikova, L.; Virgala, I.; Prada, E. Kinematics of two link manipulator in MATLAB/Simulink and Msc Adams/View software. MM Sci. J. 2021, 2021, 4749–4756. [Google Scholar] [CrossRef]
  25. Yang, X.; Zhang, X.; Xu, S.; Ding, Y.; Zhu, K.; Liu, P.X. An approach to the dynamics and control of uncertain robot manipulators. Algorithms 2019, 12, 66. [Google Scholar] [CrossRef]
  26. Rodriguez, F.; Diaz-Banez, J.-M.; Sanchez-Laulhe, E.; Capitan, J.; Ollero, A. Kinodynamic planning for an energy-efficient autonomous ornithopter. Comput. Ind. Eng. 2022, 163, 107814. [Google Scholar] [CrossRef]
  27. Kusaka, T.; Tanaka, T. Partial lagrangian for efficient extension and reconstruction of multi-DoF systems and efficient analysis using automatic differentiation. Robotics 2022, 11, 149. [Google Scholar] [CrossRef]
  28. Cesareo, G.; Nicolo, F.; Nicosia, S. DYMIR: A code for generating dynamic model of robots. In Proceedings of the 1984 IEEE International Conference on Robotics and Automation Proceedings, Atlanta, GA, USA, 13–15 March 1984; pp. 115–120. [Google Scholar]
  29. Murray, J.; Neuman, C. ARM: An algebraic robot dynamic modeling program. In Proceedings of the 1984 IEEE International Conference on Robotics and Automation Proceedings, Atlanta, GA, USA, 13–15 March 1984; pp. 103–114. [Google Scholar]
  30. Corke, P.I. A robotics toolbox for MATLAB. IEEE Robot. Autom. Mag. 1996, 3, 24–32. [Google Scholar] [CrossRef]
  31. Žlajpah, L. Integrated environment for modelling, simulation and control design for robotic manipulators. J. Intell. Robot. Syst. 2001, 32, 219–234. [Google Scholar] [CrossRef]
  32. Cakir, M.; Butun, E. An educational tool for 6-DOF industrial robots with quaternion algebra. Comput. Appl. Eng. Educ. 2007, 15, 143–154. [Google Scholar] [CrossRef]
  33. Kucuk, S.; Bingul, Z. An off-line robot simulation toolbox. Comput. Appl. Eng. Educ. 2010, 18, 41–52. [Google Scholar] [CrossRef]
  34. Kumar, S.; von Szadkowski, K.A.; Mueller, A.; Kirchner, F. An analytical and modular software workbench for solving kinematics and dynamics of series-parallel hybrid robots. J. Mech. Robot. 2020, 12, 021114. [Google Scholar] [CrossRef]
  35. Ayvaci, Ö.; Szulczyński, P.; Kiełczewski, M. Identifying dynamic parameters with a novel software design for the M-DoF collaborative robot. IEEE Access 2022, 10, 24627–24637. [Google Scholar] [CrossRef]
  36. Dogra, A.; Mahna, S.; Padhee, S.S.; Singla, E. Unified modeling of unconventional modular and reconfigurable manipulation system. Robot. Comput. Integr. Manuf. 2022, 78, 102385. [Google Scholar] [CrossRef]
  37. Li, Y.; Wang, Z.; Yang, H.; Zhang, H.; Wei, Y. Energy-optimal planning of robot trajectory based on dynamics. Arab. J. Sci. Eng. 2022, 48, 3523–3536. [Google Scholar] [CrossRef]
  38. Sun, Y.; Zhao, T.; Liu, N. Self-organizing interval type-2 fuzzy neural network compensation control based on real-time data information entropy and its application in n-DOF manipulator. Entropy 2023, 25, 789. [Google Scholar] [CrossRef]
  39. Patel, P.; Roy, S.B.; Bhasin, S. Adaptive compensation of uncertain Euler–Lagrange systems with multiple time-varying actuator faults. Nonlinear Anal. Hybrid Syst. 2022, 46, 101236. [Google Scholar] [CrossRef]
  40. Seddaoui, A.; Saaj, C.M.; Nair, M.H. Modeling a controlled-floating space robot for in-space services: A beginner’s tutorial. Front. Robot. AI 2021, 8, 725333. [Google Scholar] [CrossRef] [PubMed]
  41. Echeandia, S.; Wensing, P.M. Numerical methods to compute the Coriolis matrix and Christoffel symbols for rigid-body systems. J. Comput. Nonlinear Dyn. 2021, 16, 091004. [Google Scholar] [CrossRef]
  42. Zheng, S.; Ding, R.; Zhang, J.; Xu, B. Global energy efficiency improvement of redundant hydraulic manipulator with dynamic programming. Energy Convers. Manag. 2021, 230, 113762. [Google Scholar] [CrossRef]
  43. Urrea, C.; Saa, D. Design and implementation of a graphic simulator for calculating the inverse kinematics of a redundant planar manipulator robot. Appl. Sci. 2020, 10, 6770. [Google Scholar] [CrossRef]
Figure 1. Diagram of a 3-DoF planar manipulator robot considering the location of centroids.
Figure 1. Diagram of a 3-DoF planar manipulator robot considering the location of centroids.
Processes 12 00593 g001
Figure 3. Flowchart of the algorithms.
Figure 3. Flowchart of the algorithms.
Processes 12 00593 g003
Figure 4. General description and organization of the software in MATLAB.
Figure 4. General description and organization of the software in MATLAB.
Processes 12 00593 g004
Figure 5. GUI for dynamics applications of a manipulator robot with n-DoF.
Figure 5. GUI for dynamics applications of a manipulator robot with n-DoF.
Processes 12 00593 g005
Figure 6. First element of the mass matrix of a 3-DoF robot.
Figure 6. First element of the mass matrix of a 3-DoF robot.
Processes 12 00593 g006
Figure 7. First element of the Coriolis–centripetal forces matrix of a 6-DoF robot.
Figure 7. First element of the Coriolis–centripetal forces matrix of a 6-DoF robot.
Processes 12 00593 g007
Figure 8. First element of the mass matrix of a 9-DoF robot.
Figure 8. First element of the mass matrix of a 9-DoF robot.
Processes 12 00593 g008
Figure 10. Simulation diagram of the MPC-based controllers for a 6-DoF manipulator robot.
Figure 10. Simulation diagram of the MPC-based controllers for a 6-DoF manipulator robot.
Processes 12 00593 g010
Figure 11. Torque signal applied to the first robot joint and response of the MPC.
Figure 11. Torque signal applied to the first robot joint and response of the MPC.
Processes 12 00593 g011
Figure 12. Velocity and acceleration of the first rotational joint.
Figure 12. Velocity and acceleration of the first rotational joint.
Processes 12 00593 g012
Table 1. Parameters for 6-DoF redundant manipulator robot [43].
Table 1. Parameters for 6-DoF redundant manipulator robot [43].
Links 1, 3, 5Links 2, 4, 6Units
m 1 = m 3 = m 5 = 0.4822 m 2 = m 4 = m 6 = 0.65 (kg)
L 1 = 0.093 L 2 = 0.067 (m)
l c 1 = l c 3 = l c 5 = 0.0317 l c 2 = l c 4 = l c 6 = 0.0105 (m)
I 1 = I 3 = I 5 = 0.0058 (kg· m2)
F v 1 = F v 3 = F v 5 = 0.01313 F v 2 = F v 4 = F v 6 = 0.01208 (N· m· s/rad)
Table 2. Lower and upper saturation block values.
Table 2. Lower and upper saturation block values.
SaturationLower LimitUpper Limit
1.2 3 3
3.4 2 2
5.6 1 1
Table 3. Joint error indexes of MPC-based controllers.
Table 3. Joint error indexes of MPC-based controllers.
PerformanceRotaryPrismaticRotaryPrismaticRotaryPrismatic
Indicator Joint 1 Joint 2 Joint 3 Joint 4 Joint 5 Joint 6
MPC-based controllersRMS0.13910.04050.11690.02050.20830.0304
RSD0.29640.21360.17160.21500.22260.2141
IA0.97420.98730.99220.98720.98600.9872
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Urrea, C.; Saa, D.; Kern, J. Automated Symbolic Processes for Dynamic Modeling of Redundant Manipulator Robots. Processes 2024, 12, 593. https://doi.org/10.3390/pr12030593

AMA Style

Urrea C, Saa D, Kern J. Automated Symbolic Processes for Dynamic Modeling of Redundant Manipulator Robots. Processes. 2024; 12(3):593. https://doi.org/10.3390/pr12030593

Chicago/Turabian Style

Urrea, Claudio, Daniel Saa, and John Kern. 2024. "Automated Symbolic Processes for Dynamic Modeling of Redundant Manipulator Robots" Processes 12, no. 3: 593. https://doi.org/10.3390/pr12030593

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop