Abstract
The simulation of robot systems is becoming very popular, especially with the lowering of the cost of computers, and it can be used for layout evaluation, feasibility studies, presentations with animation and off-line programming.
The trajectory planning of redundant manipulators is a very active area since many tasks require special characteristics to be satisfied. The importance of redundant manipulators has increased over the last two decades because of the possibility of avoiding singularities as well as obstacles within the course of motion. The angle that the last link of a 2 DOF manipulator makes with the x-axis is required in order to find the solution for the inverse kinematics problem. This angle could be optimized with respect to a given specified key factor (time, velocity, torques) while the end-effector performs a chosen trajectory (i.e., avoiding an obstacle) in the task space.
Modeling and simulation of robots could be achieved using either of the following models: the geometrical model (positions, postures), the kinematic model and the dynamic model.
To do so, the modelization of a 2-R robot type is implemented. Our main tasks are comparing two robot postures with the same trajectory (path) and for the same length of time, and establishing a computing code to obtain the kinematic and dynamic parameters.
SolidWorks and MATLAB/Simulink softwares are used to check the theory and the robot motion simulation.
This could be easily generalized to a 3-R robot and possibly therefore to any serial robot (Scara, Puma, etc.).
The verification of the obtained results by both softwares allows us to qualitatively evaluate and underline the validityof the chosen model and obtain the right conclusions. The results of the simulations are discussed and an agreement between the two softwares is certainly obtained.
Keywords
1. Introduction
Robotics is a special engineering science which deals with robot design, modelling, controlling and utilization. Nowadays robots accompany people in everyday life and have taken over some of their daily procedures. The range of robot utilization is very wide, from toys through to office and industrial robots, through to very sophisticated ones needed for space exploration.
A large family of robot manufacturing equipment exists, supplying the motion required in manufacturing processes such as arc welding, spray painting, assembly, pick and place, cutting, polishing, milling, drilling, etc. Of this class of equipment, an increasingly popular type is the industrial robot. Different manipulator configurations are available such as rectangular, cylindrical, spherical, revolute and horizontal jointed.
Kinematically redundant manipulators have many advantages over non-redundant robots. A redundant manipulator is defined as having an infinite number of solutions to the joint variables of the manipulator for a given task. It can avoid obstacles and singularities, and is an excellent candidate for optimization techniques. Many optimization techniques have been applied to select the optimal trajectory of a manipulator using different criteria such as minimum time, minimum kinetic energy and obstacle avoidance.
A manipulation task is usually given in terms of a desired end-effector trajectory. Since the manipulator is controlled by joint servos, a mapping from the task space to the joint space is required. Trajectory planning converts a description of a desired motion to a trajectory defining the time sequence of intermediate configurations of the arm between the origin and the final destination. An effective approach to the motion control problem for robotic manipulators is the so-called kinematic control.
This is based on an inverse kinematic transformation which feeds the reference values corresponding to an assigned end-effector trajectory to the joint servos.
A vertical revolute configuration, a 2-R robot with two degrees of freedom is generally well-suited for small parts insertion tasks for assembly lines like electronic components insertion [2]. Although the final aim is real robotics, it is often very useful to perform simulations prior to investigations with real robots [1]. This is because simulations are easier to setup, less expensive, faster and more convenient to use. Building up new robot models and setting up experiments only takes a few hours. A simulated robotics setup is less expensive than real robots and real world setups, thus allowing better design exploration. Simulations often run faster than real robots while all the parameters are easily displayed on screen [3].
The possibility to perform real-time simulations becomes particularly important in the later stages of the design process. The final design can be verified before one embarks on the costly and time consuming process of building a prototype [4].
The need for accurate and computationally efficient manipulator dynamics has been extensively emphasized in recent years. The modelling and simulation of robot systems by using various program softwares will facilitate the process of designing, constructing and inspecting the robots in the real world. A simulation is important for robot programmers in allowing them to evaluate and predict the behaviour of a robot, and in addition to verify and optimize the path planning of the process [5]. Moreover, this will save time and money, and play an important role in the evaluation of manufacturing automation [6]. Being able to simulate opens up a wide range of options, helping to solve many problems creatively. One can investigate, design, visualize and test an object before making it a reality [7].
In this work, a two axis 2-R robot system for a “pick and place” operation will be designed and developed using the SolidWorks program and MATLAB/Simulink simultaneously as shown in Figure 1 and Figure 2.

A 2-R robot using SolidWorks

The same 2-R robot modelled in MATLAB/Simulink
The structure will be built depending on the principles of solid bodies' modelling with SD technology [8, 9].
The individual joints' trajectories, velocities and accelerations can be obtained using inverse kinematics equations.
To emphasize the obtained results in the SolidWorks program, simulations using MATLAB/Simulink software will be carried out. The results of both sofwares will be presented and discussed. In the paper, the kinematic equations for a 2-R robot as well as the robot dynamics for each joint were developed using the D-H formulation.
The paper is organized as follows: in chapter 2 forward (direct) kinematics, inverse kinematics as well as the dynamics of the 2R robot are presented. In chapter 3 we present the simulation applications, implementing both softwares, and finally in the concluding chapter 4 some important results are shown.
2. Robot kinematics and dynamics
2.1 Forward kinematics
Consider the two DOF planar redundant manipulator as shown in Figure 3 where the joints' axes are assigned based on the Denavit-Hartenberg representation (Table 1). The manipulator moves in a vertical plane so the gravity force is included in the numerical simulation.
D-H parameters of the 2-R robot

D-H parameters of the two-joint 2-R robot
The (4×4) rigid transformation matrices are:
For the first link:
and the second link:
We can then get the overall manipulator transformation matrix:
2.2 Inverse kinematics of the robot
The desired location of the 2-R robot is given by the (4×4) matrix:
For the joint variable θ2:
The final equation representing the robot is:[10]:
We get:
We then have:
The joint variable θ1:
Rearranging equation (6) and equation (7) yields:
Solving equations (11) and (12) by Cramer's rule:
and we have:
and finally we have:
The sign (±) indicates the two postures, “elbow up” and “elbow down”, of the manipulator.
The angles for elbow up are:
and the angles for elbow down are:

The two postures of the 2-R robot
2.3 Robot dynamics
2.3.1 Kinetic energy
2.3.2 Potential energy
2.3.3 Joints torques
Using the Newton-Euler recursive method we can calculate the necessary torques for each joint:
3. Simulation results
3.1 Application
This application will bear the energetic comparison during the movement of the 2-R robot with m1 = m2 = 16.92Kg and l1 = l2 = 1m, for the two postures.
We can easily follow and observe the movements of the two postures “elbow down” and “elbow up” for the same nature of the trajectory (path), reaching the same desired position during the same interval of time of 1s as shown in the following diagram:
The initial position (at t = 0) from the homogeneous transformation matrix (3) where θ1 = 0° and θ2 = 0° as shown in the following figures:
Starting from a given initial position, i.e.,
To a desired position, i.e,
The equations of movement for the borrowed path for “elbow down” to reach the desired positions are given by the two following chosen polynomials [11]:
While the equations of movement for the followed trajectory for “elbow up” to reach the desired position will be given by the relations

Link:mass parameters

The home position of the 2-R robot (two postures): MATLAB/Simulink

The home position of the 2-R robot (two postures): SolidWorks
The choice of expressions of θ1 and θ2 must satisfy the following two conditions [11]:
In the meantime (interval time) must verify the initial and the desired position.
At every moment the two postures (elbow down and up) must have the same coordinates Px and Py.
NB: Another example of trajectory generation is given in the Appendix at the end of this paper.
3.1.1 The resulting path
We may check the path:
Applying the relations (20), (21), (22) and (23) in (6) and (7) we can obtain the following table:
3.1.2 Checking the theoretical results of Table 2 using SolidWorks and MATLAB/Simulink
The position for the two postures during 1s
At t=0.5s
Elbow down;

Elbow down (MATLAB/Simulink)

Elbow down (SolidWorks)
Elbow up:

Elbow up (MATLAB/Simulink)

Elbow up (SolidWorks)
and at t=1s
Elbow down;

Elbow down (MATLAB/Simulink)

Elbow down (SolidWorks)
Elbow up;

Elbow up (MATLAB/Simulink)
The joint variables expressed in MATLAB/Simulink are in radians.
3.1.3 Individual change of position of the two links for the two postures during 1s.
We can take advantage of this analysis using SolidWorks to study the behaviour of the robot for the two postures to establish an energetic balance comparative to these postures.
NOTE 1: The results obtained, whether using SolidWorks or MATLAB/Simulink, are exactly the same. This similarity of results confirms the reliability of the kinematic model.

Elbow up (SolidWorks)

Elbow down

Elbow up

Link 1(x) elbow up

link 2(x) elbow up

Link 1(y) elbow up

link 2(y) elbow up

Link 1(x) elbow down

link 2(x) elbow down

Link 1(y) elbow down

Link 2(y) elbow down

Kinetic energy
NOTE 2: According to the results, we notice that the displacement and velocity of the links 1 and 2 of elbow up are higher than the displacement and velocity of the links 1 and 2 of elbow down, this difference can induce a difference in the consumed energy for the two postures, for the same trajectory and the same desired position.
3.1.5 Simulation of dynamic model

Potential energy

Joint torque (1)

Joint torque (2)
NOTE 3: Comparison between the two postures:
We notice from the simulation results that:
The variation of the total kinetic energy calculated according to posture elbow up is higher than the variation of the total kinetic energy calculated for posture elbow down with: ΔK = 243.02J
The variation of the total potential energy calculated according to posture elbow up is higher than the variation of the total potential energy calculated according to posture elbow down with: ΔV = 82.95J.
We notice also that the torque of joint 1 calculated according to posture elbow up at t=1s is τ1 = 446.33Nm with a max τ1 = 900Nm,on the other hand the torque of joint 1 calculated for posture elbow down is τ1=395.18Nmwith a max τ1=820Nm
Otherwise the torque of joint 2 calculated according to posture elbow up at t=1s is τ2 = -127Nm with a max τ2=300Nm,while the torque of joint 2 calculated according to posture elbow down is τ2 = 319.65Nm with a max τ2=330Nm
NOTE 4: The robot consumes much more energy when it is requested to work according to elbow up, for the same trajectory and the same desired position according to elbow down; [10] [11][12]
4. Conclusion
In this paper we used both softwares SolidWorks and MATLAB/Simulink to verify the theory (Table 2) and the simulation of the robot motion.
Checking the results obtained by the two softwares, SolidWorks and MATLAB/Simulink, permitted us to qualitatively develop and highlight the relevance of the studied model.
This can be easily justified when bearing in mind that the effect of different combinations of the two angles will play a major role in determining the value of the potential energy of the second link, and the potential energy of a link will play the greatest role in determining the torque value of that link.
In our case, we can conclude (depending on the obtained results by the comparative analysis of the two postures) that the dissipated energies during the movement of the robot according to the first posture (elbow down) are lower than those which would be dissipated if the robot performs the movement according to the second posture (elbow up), and this is for the same trajectory and the same duration according to the presentations listed above. See notes 1,2,3 and 4.
Footnotes
Appendix
Some trajectories obtained in the displacements of the two postures for the same desired position during 1s:
