RoboDK Forum
RDK calculate a TCP speed on a running robot- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+--- Thread: RDK calculate a TCP speed on a running robot (/Thread-RDK-calculate-a-TCP-speed-on-a-running-robot)



RDK calculate a TCP speed on a running robot-colinb83-02-24-2021

How would it be possible, ie is there anything in robodk already that can calculate the TCP speed of a running robot.

From the live robot I can feed into RDK an updated joint position every 4ms (i can possibly even get it down to 1ms but that's an expensive Kuka tech pack and probably overkill), what I would like to do is have rdk tell me what the robots TCP speed is so I can modulate a speed for an extruder independent of the acceleration and deceleration of robot joints or override speed setting on the robot etc


thanks

Col


RE: RDK calculate a TCP speed on a running robot-Jeremy-02-24-2021

Hi Collin,

That's a good question.

First, I think that even 4 ms is a bit overkill, I don't see how the extruder could modify the flow fast enough to get even close to that refresh rate, but that's not the point.

What I think I would try is to have RoboDK calculate the actual position of the TCP from the set of joint and TCP measurements using the SolveFK (robolink module) function of the API.
你can then use the Distance (robodk module) function to calculate the distance between the previous point and the actual point.
If the data is coming in at a steady rate you can extrapolate the actual speed of the TCP.

Where I'm unsure is if Python is fast enough to deal with that kind of process.
@Albertany thoughts?

Jeremy


RE: RDK calculate a TCP speed on a running robot-Albert-02-24-2021

Hi Colin,

A Python script like the one attached should allow you to monitor the robot every 4 ms if you don't need to do any calculations.

On the other hand, the default RoboDK driver monitors the robot every 20 ms or so (based on the KUKAVARPROXY).

Albert


RE: RDK calculate a TCP speed on a running robot-colinb83-02-24-2021

This is what im working with to get the data in from the robot, again it doesn't overly matter if the reading of the file isnt as fast as that, as jeremy rightly said, an extruder wont react that fast, or indeed even be that accurate in terms of flow rates anyway.

The RSi module does give that speed of data through put, its just how best to take that information and translate it into a usable extruder speed,


RE: RDK calculate a TCP speed on a running robot-Albert-02-24-2021

This RSI server project looks very good. We can help you integrate it. @Phillip, do you think you can help Colin?

For the time being, if you need to calculate the speed of the TCP in real time I would do something like this based on the real time monitoring example I sent in the previous post:


Code:
# 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