VIET NAM NATIONAL UNIVERSITY, HA NOIINTERNATIONAL SCHOOL STUDENT RESEARCH REPORT MODELING AND SIMULATION OF DUAL-ARM ROBOT WITH SIMCAPE AND MATLAB/SIMULINK Project Code:CN.NC.SV.23_40 Te
INTRODUCTION
Motivation
The manufacturing industry has experienced a profound transformation with the integration of robotics technology, which has been the driving force behind significant advancements over the past several decades The push for moderniza- tion within this sector has led to the widespread adoption of sophisticated systems and improved interconnectivity among components, thereby enhancing production capacity and the scope of automation One of the most remarkable developments is the emergence of collaborative robots, or "cobots," which are designed to work alongside humans, complementing their tasks with precision and efficiency that’s augmented by artificial intelligence This partnership epitomizes a new paradigm in manufacturing environments, increasing operational efficiency and providing the agility needed to adapt to various production demands.
Figure 1.1: The YUMI robot by ABB
Technological advancements are driving the evolution of intelligent infrastructure, fueling the digital transformation of Industry 4.0 and the IoT This trend has led to the widespread adoption of robotics across diverse sectors, including military, aerospace, and healthcare In Vietnam, industrial robots have played a significant role in automating manual tasks such as casting, welding, and palletizing.
Yet, many intricate tasks necessitate the synergistic operation of multiple robotic limbs Enter the dual-arm robot, with its expansive work envelope, robust load capacity, and distinct advantages in heavy lifting and complex assembly operations. Known as bimanual robots, these systems feature two distinct manipulators that mirror the human arms’ complex motions and dexterity Designed to operate in synchrony, these robots are adept in executing tasks that require a high degree of coordination, much like a pair of human hands These versatile robots come in various configurations, including articulated, collaborative, and SCARA designs.
With two arms operating in parallel or interaction, it opens up new applications across sectors such as manufacturing, healthcare, and services The system’s flexi- bility and versatility enhance productivity, precision, and safety in various work processes The report outlines the objectives and scope, highlighting the wide- ranging applications and benefits of dual-arm systems:
• Flexibility in Manufacturing: In the manufacturing industry, this system can perform various tasks such as assembly, welding, and quality inspection.
• High Efficiency: The ability to work in parallel with two arms helps to in- crease speed and improve efficiency in manufacturing processes.
• Safe Interaction: With safety features such as collision sensors and safety con- trol systems, the dual arm system can work alongside humans without posing any danger.
• Medical Applications: In the medical field, the dual arm system is used in robotic surgery and medical research to perform complex procedures with high precision.
Figure 1.2: The dual-arm robot is currently performing tasks that demand high precision and complexity.
• Services and Utility: Dual-arm robots can be utilized in service applications such as cleaning, food serving, and assisting people with disabilities.
Objectives and scope of the report
The main objectives of this study are to contribute to the advancement of dual- arm systems by focusing on three key areas:
• System Modeling: The first objective is to develop comprehensive mathemat- ical models that accurately represent the behavior and dynamics of dual-arm robots These models will serve as a theoretical foundation for understanding the system’s operation and behavior.
The second objective involves designing the dual-arm robot's physical structure and components, encompassing joints, actuators, and end-effectors This design process prioritizes stability, flexibility, and efficiency to enable the robot to execute diverse tasks effectively.
• Simulation and Testing: The third objective is to utilize Matlab software to simulate the behavior of the dual-arm system under different conditions These simulations will help assess the system’s performance and behavior before conducting real-world experiments.
Overall, this research aims to contribute to the advancement of dual-arm systems by enhancing understanding through system modeling, optimizing performance through mechanical design, and validating functionality through simulation and testing.
Contribitions
Some other research works on control for dual-arm robots focus on improving complex control algorithms, with Nguyen Ngoc Linh and colleagues introducing disturbance compensation control for dual-arm manipulators using neural networks and adaptive networks[6] Thus, experimental issues for dual-arm robots are al- ways of interest alongside the development of algorithms for this mechanical sys- tem In this report, the authors contribute to the dual-arm system with the following contributions:
• Simulation on MATLAB/SIMULINK and testing
This study aims to lay a solid theoretical groundwork for real-world applications of dual-arm robots in industrial settings It provides a platform for testing and implementing novel control algorithms, with the potential to enhance the efficiency and precision of these robots.
Report organization
This report is structured into six chapters, each aimed at systematically explor- ing the simulation and modeling of robotic systems:
• Chapter 1: Introduction – Provides the background, motivation, and objec- tives of the research, and outlines the contributions of this study.
• Chapter 2: Literature Review– Discusses the kinematic and dynamic chal- lenges of dual-arm robots, reviews forward and inverse kinematics models, and explores dynamic modeling using Lagrangian mechanics.
• Chapter 3: Methodology – Details the methodological approach, including an introduction to the tools used (Simscape and Robotics System Toolbox in Simulink), the simulation methods, and mechanical design considerations.
• Chapter 4: Simulation with Low-Fidelity Models– Presents simulation re- sults using low-fidelity models, detailing the findings and insights from three sets of results.
• Chapter 5: Simulation with Multibody – Focuses on more complex multi- body simulation setups and results, providing detailed analyses of the out- comes.
• Chapter 6: Conclusion – Concludes the report with a summary of the find- ings and discusses potential directions for future research.
This organization ensures a coherent flow from an introductory framework through detailed methodological exposition to sophisticated simulation results and final conclusions.
LITERATURE REVIEW
Structure a dual arm robot
Looking at the structure in Figure 2.1, we see that the nature of the dual arm robot system includes two robot arms operating independently So, in this project,
I consider each robot arm as shown in the following picture.
Figure 2.1: Diagram of a dual arm manipulator
It is assumed that both the manipulators rigidly attach to the load so that there is no slip between the grasping points and the grasped load.
Let m i , I i , l i denote the mass, mass moment of inertia and length of the corre- sponding link in the model, respectively.
We also defined 1 andd 2 as the length of the object and distance between the two arms at the robot’s base.
The distance from the mass centre of a link to a joint is denoted as k i while the joint angle between a link and the base or its preceding link is denoted asθ i. Operationally, in this work we consider that the robot manipulators make motions on the horizontal “XY” plane To consider a single arm of a dual-arm robot, we need to consider the following.
Combining the above parts, we can have a comprehensive model for the arm of the robot, allowing us to compute the position and motion of the end-effector based on input parameters and initial conditions.
Robot kinematics
1 Forward kinematics of the robot.
The forward kinematics of a robot arm are determined by a group of pa- rameters called Denavit-Hartenberg (DH) parameters, used to derive uniform transformation matrices between different frames assigned to the robot arm structure [3] The DH parameters for a two-degree-of-freedom robot arm are determined as follows:
Table 2.1: Denavit-Hartenberg parameters for a two-degree-of-freedom robot arm.
The uniform transformation matrices for the 2-DOF robot arm shown in Fig- ure 2.1 are derived as follows:
cos(θ 1 ) − sin(θ 1 ) 0 L 1 cos(θ 1 ) sin(θ 1 ) cos(θ 1 ) 0 L 1 sin(θ 2 )
cos(θ 2 ) − sin(θ 2 ) 0 L 2 sin(θ 2 ) sin(θ 2 ) cos(θ 2 ) 0 L 2 cos(θ 2 )
From the above two equations, the most dynamic transformation matrix T 0 2 can be found as follows:
cos(θ 1 + θ 2 ) − sin(θ 1 + θ 2 ) 0 L 1 cos(θ 1 ) + L 2 cos(θ 1 + θ 1 ) sin(θ 1 + θ 2 ) cos(θ 1 + θ 2 ) 0 L 1 sin(θ 1 ) + L 2 sin(θ 1 + θ 2 )
To calculate the position of the end-effector in the x and y directions (P x and
P y) from the transformation matrix 0 2 T, we can use the following equations:
Here,T 0 1 (1, 4)represents the element at the first row and fourth column of the transformation matrixT 0 1 , and similarly forT 0 1 (2, 4).
Inverse kinematics of a robot arm is a solution to find the joint variables of the robot arm according to the Cartesian coordinates of the given end effector. The mathematical equations used to solve the inverse kinematics problem can be derived algebraically or geometrically The geometric method is consid- ered much easier for robotic arms with high degrees of freedom In my case,
I solved the inverse kinematics equations for the 2-DOF robot arm shown in Figure 2.2 using the geometric method.[8]
Figure 2.2: Inverse kinematics of a 2-DOF robot (Arm1+2)
From Figure 2.2, the mathematical equation to solve the elbow joint angle θ 2 can be deduced using the Pythagoras theorem as follows: p 2 x + p 2 y = L 2 1 + L 2 2 + 2L 1 L 2 cos θ 2 (2.1) cos θ 2 = 1
Therefore, the angle of the second link can be calculated by: θ 2 = ± arctan sin θ 2 cos θ 2
We have the forward kinematics of the 2-DOF robot as follows. p x = (L 1 + L 2 cos θ 2 ) cos θ 1 − L 2 sin θ 1 sin θ 2 p y = L 2 sin θ 2 cos θ 1 + (L 1 + L 2 cos θ 2 ) sin θ 1
(2.6) and: p 2 x + p 2 y = (L 1 + L 2 cos θ 2 ) 2 + (L 2 sin θ 2 ) (2.7) Therefore: δ sin θ 1 =
It can be deduced that the trigonometric value of the first link deflection angle is: sin θ 1 = δ sin θ 1 δ = (L 1 + L 2 cos θ 2 )p y − L 2 sin θ 2 p y p 2 x + p 2 y (2.10) cos θ 1 = δ cos θ 1 δ = (L 1 + L 2 cos θ 2 )p y + L 2 sin θ 2 p y p 2 x + p 2 y (2.11)
From there, the inverse kinematics of the robot is achieved as follows. θ 1 = arctan sin θ 1 cos θ 2 = arctan (L 1 + L 2 cos θ 2 )p y ± L 2 sin θ 2 p x
Dynamic model of Two -Link Planar Arm
The dynamic modeling of a robot arm entails analyzing its motion and forces, and establishing mathematical relationships between its joint variables and dimensions Two common methods for implementing dynamic equations are the Euler-Lagrange and Newton-Euler methods Utilizing the Euler-Lagrange method, we derive the Lagrangian (L) by calculating the kinetic and potential energies of the arm From this Lagrangian, we solve the Euler-Lagrange equations via partial derivatives, yielding the equations of motion that describe the time-dependent motion of the arm's joints.
- F is the force acting on the general coordinates.
- L is the Lagrange equation of motion.
The Lagrangian functionLrepresents the difference between the kinetic energyK and the potential energyP:
• K(q, q) ˙ is the kinetic energy, which depends on the coordinates q and the ve- locitiesq ˙.
• P (q)is the potential energy, which depends only on the coordinatesq.
Figure 2.3: Schematic of a Two-Link Planar Robotic Arm
To solve the Lagrange equation 2.15, we first need to calculate the kinetic energy
KE and potential energy PE as follows
Velocity is determined by taking the derivative of position with respect to time so, the position at the end of the link is determined using familiar known variables: x 1 = L 1 sin θ 1 (2.18) y 1 = L 2 cos θ 2 (2.19) x 2 = L 1 sin θ 1 + L2 sin(θ 1 + θ 2 ) (2.20) y 2 = L 1 cos θ 1 + L2 cos(θ 1 + θ 2 ) (2.21) Then substitute into the kinetic energy equation:
2 m 2 y ˙ 2 2 (2.22) Replace,we have the kinetic energy equation of the system:
And the potential energy equation of the system:
P E = m 1 gL 1 cos θ 1 + m 2 g(L 1 cos θ 1 + L 2 cos(θ 1 + θ 2 )) (2.24) Therefore, there is a Lagrangian equation as follows:
To calculate the force acting on the robot, we establish the above Lagrange-Euler Equation with LagrangeL
After simplification, the force acting at joint one is given by.
− (m 1 + m 2 )L 1 g sin θ 1 − m 2 L 2 g sin (θ 1 + θ 2 ) (2.27) and the force acting on joint two is given by.
(2.28) The motion of the system is given by the following nonlinear equation[7]:
• M (q)is the mass matrix which depends on the generalized coordinatesq, and it is a real, symmetric, and positive definite matrix.
• C(q, q) ˙ is the matrix that accounts for Coriolis and centrifugal forces, depend- ing on the positionqand the velocity q ˙.
• g(q) represents the gravity vector which depends on the generalized coordi- natesq.
METHODOLOGY
Overview
In this chapter, we outline a structured methodology for the development and management of multi-arm robotic systems, incorporating the concepts depicted in the MATLAB/Simulink diagram This methodology is articulated through four primary steps designed to transition from the theoretical underpinnings of robotic kinematics to the practical control of multi-arm robots for synchronized operations.[1]
Figure 3.1: Autonomous Robot Development Process using MATLAB/Simulink: Design, Simulation, Analysis, Implementation, and Testing
1 Kinematics Verification for the Robot System: We initiate by examining the robot’s kinematics, ensuring that the mathematical models accurately reflect the motion capabilities and constraints of the entire system This step lays the foundation for precise control by confirming that the theoretical models correspond to the robot’s physical movements.
2 Kinematics Assessment for a Single Robot Arm: The focus then narrows to a single robotic arm, scrutinizing its kinematic chain This involves validating joint parameters, degrees of freedom, and the arm’s ability to reach and orient in the designated workspace.
3 Control of a Single Arm Using the Kinematic Model: With verified kine- matics, we proceed to control an individual arm This step applies the kine- matic model to direct the arm through its range of motion, enabling the exe- cution of tasks with precision.
4 Synchronous Control of Dual Arms for Object Manipulation: The final step expands control to two arms working in concert, based on their kinematic models This dual-arm control strategy is pivotal for tasks requiring coopera- tive action, such as grasping and maneuvering objects in a coordinated man- ner.
Introduction to Simscape and Robotics System Toolbox Simulink
Simcape is a multidisciplinary dynamic simulation software within the Math- Works MATLAB/Simulink system that allows users to explicitly model and simu- late physical systems It provides a graphical interface for dragging and dropping components to build models of physical systems, including mechanical, electrical, hydraulic, thermal, and other energy systems.
Application: Simcape is widely used in many different fields, including:
• Automotive Engineering: Simulate powertrain, suspension, and steering sys- tems.
• Aviation and Space: Flight control system analysis and fuel system simulation
• Solar and Renewable Energy: Simulation and analysis of solar panel and wind turbine systems.
• Robotics: Simulation of kinematics and control of robotic systems.
Below are the main features of the Robotics System Toolbox Simulink[2]:
1 Blocks Library: The toolbox provides a series of Simulink blocks to model robot components such as sensors, motors, controllers, and robot behavior. These blocks facilitate the easy creation of global models of robotic systems in the Simulink environment.
2 Integration with MATLAB and Simulink: It integrates well with MAT- LAB and Simulink, allowing users to utilize the computational features of MATLAB and the modeling features of Simulink during the development and testing of robot systems.
3 Support for Developing Control Algorithms: The toolbox provides control tools and algorithms for developing control algorithms for robots Users can utilize available control algorithms or define their own.
4 Simulate and Test Robotic Systems: It allows users to simulate and test the behavior of robotic systems in Simulink’s simulation environment This helps users understand and evaluate system performance before actual deployment.
5 Support for Many Types of Robots: The toolbox supports a wide range of robots including mobile robots, industrial robots, handheld robots, and collab- orative robots This versatility helps users apply the toolbox to many different types of robotics applications.
Simulation Method
With slogan "Simulate First and Simulate Often!" encourages the use of simula- tion as an essential part of the robot development process, aimed at minimizing risk and enhancing performance before deployment in real-world environments.Therefore,In Chapter 4 of this document will present the outcomes of simulations conducted with low-fidelity models, emphasizing the kinematics and dynamics of rigid bod- ies We will explore the application of simulation techniques to accurately depict the fundamental behavior of robots Following that, Chapter 5 will delve into multi- body modeling, building upon the foundation established in the previous chapter to include the increased complexity of multibody systems It will provide a deeper insight into how the various components of a robot interact with each other and with their environment within the simulation.
Mechanical design
For the Simscape simulation outlined in Chapter 5, it’s necessary to engineer a comprehensive mechanical system This entails both generating prototype schemat- ics for the robot and evaluating the design’s efficacy Such tasks are accomplished utilizing 3D CAD software, which allows for meticulous modeling, simulation, and analysis of the mechanical components and systems prior to physical production. This approach not only enhances the precision of the designs but also facilitates the identification and resolution of potential issues in the early stages of development.
Figure 3.4: Model of dual-arm robot system
The design consists of a table, two arms, and a rectangular box The individual components of the two arms are the main body, the right arm (arm 1), the left arm (arm 2), and the motor The dual-arm robot’s main body connects the right and left branches Two SERVO motors that control the initial stage of the two arms are mounted on the machine’s main body This machine body is fixed to the table through the base and circular column.
Both machines’ first phase is a strong box with a motor at the end that controls the next phase.
The second of the two arms are cylindrical and has the same shape as the first.After the second stage, there is a hemisphere that tangent the object at the same angle.
SIUMLATION WITH LOW - FIDELITY MODELS
Result 1 forward and inverse kinematics problems with Matlab Simulink
Task: Simulate Forward and inverse kinematics problems with Matlab Simulink for 2 links Planar Robot Arm.[5]
Set up system representation on Matlab Simulink:
Using the blocks provided in Simscape, build a 2-degree-of-freedom robot as follows.
Figure 4.1: Simscape diagram of a 2-degree-of-freedom robot
To verify the forward and inverse kinematic models of the robot, we will in- put a sine wave for the joints to rotate Then, to calculate forward kinematics, we will measure the angle and calculate the position Conversely, to calculate inverse kinematics, we will measure the position and calculate the angle.
• Check the forward kinetic response
Figure 4.2: Results of x-position response when testing forward kinematic response
Figure 4.3: Y position response results when testing the forward kinematic response
• Check the inverse kinematic response
Figure 4.4: Results of theta1 angular response when testing inverse kinematics
Figure 4.5: Results of theta2 angular response when testing inverse kinematics.
Comment: Thus, the equations given to describe the system’s dynamics are correct. However, for inverse kinematics, the problem will have two satisfactory solutions. This should be kept in mind when driving
Robotics System Toolbox Simulink is an extended toolbox of MATLAB andSimulink, developed by MathWorks It supports the development, simulation, and testing of robotic systems and robot-related applications.
Result 2 - Design simpler robot controls
Use the Robotics System Toolbox to design simpler robot controls
Figure 4.6: Controlling a robot arm based on kinematics.
Therefore, we have the following intuitive result:
Figure 4.8: The Robot in its initial position and the points it needs to pass through.
• From the starting position, the robot moves(0, 4)to(1, 2)
Therefore, we have the following intuitive result:
Figure 4.10: Simulation results of the position of the end-effector
Result 3 Pick up object
To pick up objects, you need to use the Contact block in Simscape Proceed to add another robot arm into the simulation with the same configuration as the previous arm.
Figure 4.12: Controlling a two arm based on kinematics
Simulation results of kinematic control of a two-arm robot picking up object system
Figure 4.13: Position of robot end-effectors one
Figure 4.14: Angles of the robot’s joints one
Figure 4.15: Position of end-effector of robot two.
Figure 4.16: Deviation angle of the robot’s joints two
- The simulation results are visualized as follows.
Figure 4.17: Two robot arms prepare to pick up objects
Figure 4.18: Two robot arms pick up objects
Figure 4.19: Two robot arms move objects
SIMULATION WITH MULTIBODY
Simulation set up
The graphic 5.1 depicts the full system The rectangle box’s desired trajectory for movement will be provided by the trajectory generator block Based on the di- mensions of the rectangular box and the radius of the hemisphere at the ends of the two manipulator arms, the "Control Arm" block will then provide the coordinates of the end points of the two manipulator arms that need to be moved Inverse kine- matics must be used to calculate the requisite motor rotation angle from the ends of the two arms The Sim Mechanics toolbox will be used to import the dual-arm robots’s CAD model created in the Inventor software environment in the preced- ing section into MATLAB/Simulink With the connections between the stages, we can create the Sim Mechanics model of the robot [4] 5.1 Sensors were implanted to determine the end location of the manipulators that had passed to evaluate the Robot’s performance and movement accuracy Therefore, we can compare the real position of the robot arms with the desired position.
Figure 5.1: Dual Robot Arm control system
Figure 5.3: Position control of DC motor block
Result 4
We let the two robot arms come from different locations to test their synchro- nization The two arms will simultaneously move to the object’s location The ob- ject will then be gripped by the two arms and moved to the next position.In 1st test: Arm 1 has an initial position ofA 3(872,800), while arm 2 has an initial position of
B 3 (-472,400) The object will be positioned at O(0, 610) and moved via locations
(400, 1010), (-200, 410) consecutively All of the locations listed above are coordi- nates based on the reference system shown in Graph X coordinate graph of arm 1 with the reference system shown in.
We see: Some of the results achieved are quite similar to the results seen when simulating in chapter 4, it completely matches the results.
From the graph, it seems that the robot arm is following the target position quite closely, with very little deviation This suggests that the control system for the robot arm is performing well, maintaining accuracy in its movements compared to the target positions over the time period displayed.
The simulations carried out using both Simscape and the Robotics System Tool- box in Simulink have demonstrated the capability of these tools to accurately pre- dict the movements and forces within a dual-arm robot The simulations have high- lighted the accuracy of the kinematic models and the fidelity of the dynamic mod- els in reflecting real-world behaviors.
The outcomes of our simulations exhibit a remarkable correlation with the find- ings reported by Hiep Dam Dinh and Linh Ngoc Nguyen in their seminal work,
"Modeling and Simulation of Dual Arm Robots using Simscape and MATLAB Simulink."[4] Our research corroborates the effectiveness of Simscape and MAT-
LAB/Simulink tools excel in modeling complex robotic systems, ensuring accuracy and reliability Our findings validate their model's precision and the effectiveness of their simulation approach in practical real-world applications.
The progression of our simulation work as discussed in theSimulation Method chapter has set a foundation for advancing to higher fidelity simulations and real- world testing Our future direction aims to refine our simulation processes through the integration of Gazebo, an advanced robotics simulator, which would enable us to simulate more complex scenarios with greater precision.
The next step would be to transition from virtual simulations to the creation and testing of actual products By manufacturing prototypes and subjecting them to rig- orous testing environments, we will be able to assess the practicality of our models and identify areas for improvement that are not as evident in virtual simulations.This hands-on approach will be crucial in bridging the gap between theoretical models and practical applications, ensuring that our robotic systems can meet the demands of real-world operations .