Discussion

Left ArrowBack to discussions page
ur5eUserur5eUser Posts: 3 Apprentice
Hello everyone,

as the title says, I would like to access the force of the tools z-Axis on my UR5e. Saying that, the task my robot has to accomplish is to press lots valves into drillings. The force here has to be at a level of 50 newtons. Once that is reached the robot has to stop and go back to its original position, as this means that the valve has already been pressed into the drilling successfully.

As every drilling has got a different position and more importantly different angles, im having problems with just grabbing the current value of the "force()" function, as it seems to calculate a three dimensional force vector. The "force()" function works perfectly fine as long as the drillings are in a vertical position. However, as soon as they are not in a vertical position, meaning angles are involved, the "force()" function does not fulfill my requirements. Hence i would like to have access to the tools z-Axis force component only, as its always oriented exactly vertically to the tool.

I am using a C# program, that writes a .script language program, which gets sent to the UR5e by Ethernet (Port 30002). Here's a minimized example of what Im sending to the UR5e (i've deleted some parts which, in this matter, are not neccessary). Also i've marked the crucial parts:


def myfunction():
 threadId_Thread_1 = run Thread_1()
 while i < 2:
  set_payload(0.0)
  pose_wrt_tool = p[0,0,0.065,0,0,0]
  global pose_wrt_base2 = pose_trans(pose_wrt_base, pose_wrt_tool)
  global thread_flag_4 = 0
  thread Thread_if_1():
   movel( pose_wrt_base2 , a=0.03, v=0.03)
   thread_flag_4 = 1
  end
  if ( force ()<50):
   global thread_handler_4 = run Thread_if_1()
   while (thread_flag_4 == 0):
    if not( force ()<50):
     kill thread_handler_4
     thread_flag_4 = 2
    else:
     sync()
    end
   end
  else:
   thread_flag_4 = 2
  end
  set_payload(0.0)
  movel( pose_wrt_base , a=0.03, v=0.03)
  i = i + 1
 end
end

So, basically all I want to do is to replace "if ( force ()<50):" with something like "if (Fz_Tool < 50):". However, I could not find a way to achieve this yet. Also, if somebody knows the .script language command on how to grab the force of the tools z-Axis it would help me most. However, a polyscope (.urp) command would also be helpful as then it could executed and thus translated into the corresponding .script language file.

Comments

  • matthewd92matthewd92 Posts: 927Founding Pro, Tactile Sensor Beta Testers Handy
    get_tcp_force() returns a list of the 6 forces, Fx, Fy, Fz, Tx, Ty, Tz, then all you need to do is get the one you want with something like this pseudo code

    local forces = get_actual_tcp_force()
    local Fz = forces[2]
    
    The thing to remember is that UR gives those forces in base coordinates, so the Z axis is the base Z, not the tool flange Z

    the force() function returns the normal value of the vector of the forces so as you change the orientation of the tool that vector will change but the normal value of the vector should stay the same.

    Also, you can zero out the sensor before you use it for measurement which will make the vector more accurate since it will take out the effect of gravity on any vector that is not parallel with the Z axis (assuming the robot is mounted in a vertical way). The command for zeroing the sensor is zero_ftsensor().  We generally have a wait before we zero, generally use a command like the one below to ensure that the robot has steadied itself and then we will fire the zero command and go on with the program

    # Commands that get us close to where we want to use the force
    while (not is_steady()):
      sync()
    end
    zero_ftsensor()
    # Commands where we use the force

Sign In or Register to comment.
Left ArrowBack to discussions page