Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting/determining the speed of the TCP
#1
I am trying to accurately simulate the cycle time of my process using a UR10e and I found documentation stating that 1000 mm/sec is the typical max speed for the TCP of a UR10e. Is it accurate to set the robot speed (using set speed) to 1000 mm/sec to simulate the TCP moving at 1000 mm/sec or is there a different way to simulate how fast the TCP would be moving. 

Thank you!
#2
Hello,

You can calculate the distance between the previous point and the present point. And if you know the time in between, you will get the TCP speed at that time.
Attached script does the same.


Code:
def joints_changed(j1, j2, tolerance=0.0001):
   """Returns True if joints 1 and joints 2 are different"""
   if j1 is None or j2 is None:
       return True
       
   for j1,j2 in zip(j1,j2):
       if abs(j1-j2) > tolerance:
           return True
           
   return False

joints_last = None
t_last = None
tcp_xyz_last = None


# Infinite loop to calculate speed
while True:
   # If we are connected, this retrieves the position of the real robot
   # (blocks until it receives an update from the real robot)
   joints = robot.Joints().list()
   if joints_changed(joints, joints_last):
       # Get the TCP with respect to the coordinate system
       # (the robot position was just updated from the real robot using Joints())
       tcp_xyz = robot.Pose().Pos()
       
       t = time.time()
       if t_last is not None: # Skip the first update            
           # Calculate delta time (s) and delta travel (mm)
           d_time = t - t_last
           # d_time = d_time * RDK.SimulationSpeed() # adjust for real time when simulating
           d_move = norm(subs3(tcp_xyz, tcp_xyz_last))
           if d_time > 0:
               speed = d_move / d_time
               print("TCP speed (mm/s): %.1f" % speed)
       
       joints_last = joints
       tcp_xyz_last = tcp_xyz
       t_last = t

Run the script, and then run any program on your station or on your real robot if connected to a real robot. Keep in mind the time interval of obtaining pose from the actual robot is every 4 ms.

You can read more about Cycle Time here: https://robodk.com/doc/en/General.html#CycleTime


Attached Files
.py   Monitor_TCP_Speed.py (Size: 2.21 KB / Downloads: 44)
#3
Juste take a look at this video: https://www.youtube.com/watch?app=deskto...e=youtu.be

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


  




Users browsing this thread:
1 Guest(s)