0% found this document useful (0 votes)
196 views4 pages

Inverse Kinematics Lab for UR5 Robot

Uploaded by

ammar Hashmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views4 pages

Inverse Kinematics Lab for UR5 Robot

Uploaded by

ammar Hashmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

National University of Sciences & Technology

Course: MTS - 417 Intro to Robotics


Lab Manual
Prepared By: Dr. Tayyab Zafar & LE Hamza Sohail

Lab Number 07
CoppeliaSim EDU – Computing Inverse Kinematics of UR5

Introduction:
Inverse Kinematics is computed when robot needs to move at a known end effector position
and orientation calculating the required joint angles for smooth operation.

Software Used:
CoppeliaSim EDU v4.7

Programming Language:
LUA (SimIk Plugin Used)

Objectives of the Lab:


 To compute Inverse Kinematics of UR5

INVERSE KINEMATICS:
Add 7 reference frames and name them as O0, O1, …. , O6.
Put O0 as a child of UR5 and O1 for joint 1, O2 for joint 2 and so on…

66
National University of Sciences & Technology
Course: MTS - 417 Intro to Robotics
Lab Manual
Prepared By: Dr. Tayyab Zafar & LE Hamza Sohail

Now translate and rotate all the frames relative to parent frame and give them values 0,0,0 for both
position and orientation. Also make sure that UR5 is at 0,0,0 position for smooth measurement.
BASE, TIP and TARGET:
To compute inverse kinematics three dummy object to be placed. Tip to be placed under joint 6
along with O6. Target dummy object to be placed individually without being a child object of
anyone. Base to placed as a child object of UR5. Also make TIP and BASE orientation and position
0,0,0 with respect to the parent frame. Make target near robot for the robot to move in that direction
but it should not be outside workspace of the robot.

CODE & EXPLANATION:


 ADD modules
sim=require'sim'
simIK=require'simIK' - - specifically for inverse kinematics (simIK plugin)
 Initialize the robot, frames in sysCall_init( ) function
function sysCall_init()
-- Get the joint handles
jointHandles = {}
for i = 1, 6 do
jointHandles[i] = [Link]('../joint'..i) -- Replace '/robot_joint_' with your joint
names
end

67
National University of Sciences & Technology
Course: MTS - 417 Intro to Robotics
Lab Manual
Prepared By: Dr. Tayyab Zafar & LE Hamza Sohail

-- Get the frame Handles


O = {}
for i = 1, 6 do
O[i] = [Link]('../O'..i) -- Replace '/robot_joint_' with your joint names
end
 Get object handles of base , tip and target to compute inverse kinematics
simBase = [Link]('..')
simTip = [Link]('../tip')
simGoal = [Link]('/target')
 Create the environment for IK
ikEnv = [Link]()
ikGroup_undamped = [Link](ikEnv)
[Link](ikEnv, ikGroup_undamped, simIK.method_pseudo_inverse, 0, 6)
[Link](ikEnv, ikGroup_undamped, simBase, simTip, simGoal,
simIK.constraint_pose)
end
 In sysCall_actuation( ) function
function sysCall_actuation( )
[Link](ikEnv, ikGroup_undamped, true)
 Optional (calculation of joint angles)
--calculate the angles to validate
jointAngles = {}
for i = 1, #jointHandles do
local rad = [Link](jointHandles[i])
local deg = rad * (180 / [Link]) -- Convert radians to degrees
jointAngles[i] = deg
end

-- Print joint angles in degrees

68
National University of Sciences & Technology
Course: MTS - 417 Intro to Robotics
Lab Manual
Prepared By: Dr. Tayyab Zafar & LE Hamza Sohail

for i, angle in ipairs(jointAngles) do


print('Joint ' .. i .. ' angle: ' .. angle .. ' degrees')
end
end

Now check the joint angles it has moved and verify using joint tool to make sure that the robot
had moved correctly.

69

Common questions

Powered by AI

Reference frames are crucial in defining the spatial configuration of each joint concerning their parent frame, which is essential for computing inverse kinematics. They serve as the coordinate basis from which translations and rotations are applied, ensuring each joint maintains its desired orientation and position. In the setup for UR5, there are seven reference frames named O0 to O6, which correspond to the base and joints. The frames need to be accurately translated and rotated to the origin, ensuring that the robot's movement is smooth and measured correctly with respect to its end effector's position. This structured approach allows the IK algorithm to compute the necessary joint angles that ensure smooth transitions and precise alignment with the target, maintaining operational consistency within the robot's capabilities .

Converting joint angles from radians to degrees aids in validating robot movements within CoppeliaSim by making the angle values more intuitive and interpretable for human operators. By translating these values into degrees, users can quickly understand and relate the robot's configurations to standard angular measurements. This conversion helps in debugging, verifying, and ensuring that the robot adheres to expected movement parameters. It also facilitates easier communication of angle results when comparing with mechanical design specifications or collaborating across teams .

The joint angles calculated during inverse kinematics can be validated by converting the angles from radians to degrees and then printing them out to compare against expected values. This process involves obtaining each joint's position, transforming these values into a human-readable format, typically degrees, and verifying them against the control objectives. Additionally, the validation process can use joint tools within the simulation environment to visually and numerically ensure that each joint has moved to the correct degree, thereby confirming the robot's movement adheres to desired pathways .

CoppeliaSim transitions from the phase of initializing joint handles to actuating UR5's movement through a structured procedure involving the definition and application of IK environments. Initially, joint handles for the robot are acquired and configured. Then, an IK environment and group are established, specifying calculation and pose constraints. During actuation, the defined inverse kinematics environment is applied to the scene through the simIK functions, syncing joint angle calculations with the robot's physical state in the simulation. This actuation phase is enabled within the sysCall_actuation() function, ensuring that the robot movements are guided by accurate IK solutions pre-computed during initialization .

simIK plays a critical role in simplifying the process of implementing inverse kinematics for the UR5 by providing necessary tools and functionalities to compute joint movements accurately. It aids in the creation of IK environments and groups that allow for a structured setup where different constraints and calculation methods can be applied within CoppeliaSim. By defining the IK group with specific methods like pseudo inverse, simIK helps ensure that the algorithm used for solving inverse kinematics problems is efficient and accommodates various joints and movement configurations. This setup aids in precise execution and control of the UR5's end effector positioning, significantly contributing to the mechanical operational efficiency within simulations .

Having an orientation of 0,0,0 for the TIP and BASE is important because it simplifies the kinematic calculations and ensures that the mathematical model aligns with the physical configuration of the robot. This setup eliminates rotational offsets that complicate the computation of necessary joint angles, allowing for direct correspondence between calculated positions and real-world orientations. By ensuring both TIP and BASE are aligned to this neutral orientation, it also facilitates more predictable movement and consistent results when manipulating the environment, thereby enhancing the accuracy and reliability of the inverse kinematics solution .

Ensuring the target is placed near the robot but not outside its workspace is vital for effective inverse kinematics computation because it guarantees the robot can physically reach the target. When the target is placed within the reachable area, the inverse kinematics solutions are feasible, meaning the computed joint angles will result in successful end effector positioning. If the target is outside of the workspace, the solutions may lead to unreachable configurations, causing the robot to fail in achieving the desired position and potentially leading to mechanical strain or simulation errors .

The setup of reference frames and object handles is pivotal for calculating the joint angles as it provides a spatial context and logical structure for the robot's joint hierarchy. By assigning frames from O0 to O6 corresponding to different joints, individual movements can be isolated and computed relative to one another. Object handles for the base, tip, and target create necessary target points and constraints that drive these calculations. This organization allows inverse kinematics algorithms to determine precise joint positions to achieve the desired end effector location and orientation. These structures facilitate the transition from a desired spatial effect to specific, actionable joint movements, ensuring the robot operates correctly and predictably within its designed parameters .

The implementation of inverse kinematics in CoppeliaSim allows the control of the UR5 robot's movement by calculating the required joint angles for moving the end effector to a desired position and orientation. This technique enables the robot to execute precise movements by ensuring the joint configurations achieve the specified target. In the CoppeliaSim environment, using the simIK plugin, the necessary joint angles are derived by defining reference frames and computing pose constraints that align the robot's base, tip, and target configurations. This setup also includes ensuring all frames are appropriately translated and rotated relative to their parent frame, allowing smooth operation of the robot as it moves towards the target within its workspace .

Initializing the UR5 robot in CoppeliaSim involves several key steps: First, the joint handles for the robot are acquired through a loop that assigns each joint a specific handler by referencing their unique names. Additionally, frame handles for O1 to O6 are obtained in a similar manner to create a structured reference for joint-hierarchy. The environment for inverse kinematics is then created by setting up an IK environment and defining an IK group, with calculation methods explicitly set using pseudo inverse solutions. Furthermore, objects such as the base, tip, and target are defined to articulate movement and pose constraints are specified between these objects to accurately compute the inverse kinematics necessary for the desired end effector positions .

You might also like