Tool Velocity

More
2 years 5 months ago #300384 by JT
Tool Velocity was created by JT
I'm trying to figure out how to display the actual tool velocity in at least the XY plane. For example if the tool is moving in the X direction at 10 IPM and in the Y direction at 20 IPM what is the formula to figure out the tool velocity?

JT

Please Log in to join the conversation.

More
2 years 5 months ago #300385 by rodw
Replied by rodw on topic Tool Velocity
I think you need to read joint.N.pos-fb for X & Y and save the last position and calc the distance moved in fperiod
If both pins have a value, use pythagoras therom to calulate the velocity (C in this diagram)
en.wikipedia.org/wiki/Pythagorean_theorem
otherwise report the value for the moving axis.

Note if X& Y are both at max velocity, the actual velocity will be higher because the hypotenuse is longer than the x & Y elements

Please Log in to join the conversation.

More
2 years 5 months ago #300393 by PCW
Replied by PCW on topic Tool Velocity
If you want the the tool velocity (X,Y,Z)  you can use motion.current-vel

If you want just X,Y as rodw says you can use Pythagoras
(see the hypot hal component)

Please Log in to join the conversation.

More
2 years 5 months ago #300435 by JT
Replied by JT on topic Tool Velocity

If you want the the tool velocity (X,Y,Z)  you can use motion.current-vel

If you want just X,Y as rodw says you can use Pythagoras
(see the hypot hal component)
 
I should have mentioned that this is using the Python Interface and motion.current-vel is not a status item.

The status velocity:
Code:
[b]velocity[/b] [i](returns float)[/i] - This property is defined, but it does not have a useful interpretation.

The axis velocity only returns the jogging velocity for each axis
Code:
[b]velocity[/b] [i](returns float)[/i] - current velocity.

The joint velocity works all the time
Code:
[b]velocity[/b] [i](returns float)[/i] - current velocity.

What I came up with is to use the joint velocity and some math.
Code:
    # two joint velocity     for key, value in parent.two_vel.items():         vel_0 = getattr(parent, 'status').joint[value[0]]['velocity']         vel_1 = getattr(parent, 'status').joint[value[1]]['velocity']         vel = sqrt((vel_0 * vel_0) + (vel_1 * vel_1))         getattr(parent, key).setText(f'{vel * 60:.{value[2]}f}')     # three joint velocity     for key, value in parent.three_vel.items():         vel_0 = getattr(parent, 'status').joint[value[0]]['velocity']         vel_1 = getattr(parent, 'status').joint[value[1]]['velocity']         vel_2 = getattr(parent, 'status').joint[value[2]]['velocity']         vel = sqrt((vel_0 * vel_0) + (vel_1 * vel_1) + (vel_2 * vel_2))         getattr(parent, key).setText(f'{vel * 60:.{value[3]}f}')

Seems to work and mirror what Axis reports.

JT

Please Log in to join the conversation.

More
2 years 5 months ago #300436 by JT
Replied by JT on topic Tool Velocity

Please Log in to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum