Universal Robots Forum

Real time force_mode

Hello there,

We are trying to control a UR3 remotely with the force_mode function via the 30003 interface.

At first we tried to send out force_mode commands at 125 Hz which worked in the simulator but caused the real robot to stutter. However just sending a command once does also not lead to the expected behaviour which to me would be “move with the given force along the given vector” until I stop it or a constraint is violated. But instead of that it moves just a tiny bit until it stops.

So my question is how to properly use this function from the remote interface?

The command I send is the following:

force_mode(p[0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000], [1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000], [0.0000, 0.0000, 10.0000, 0.0000, 0.0000, 0.0000], 2, [1000.0000, 1000.0000, 1000.0000, 1000.0000, 1000.0000, 1000.0000])

E.g. move with a force of 10N along your z_base axis with all compliant axes.

If you need to keep the robot running with a given set of parameters, you need to send this section as a script program instead of just one line.

When sending just one line, the program is terminated and hence force mode stops after 8 ms. That being when the command is executed.

Instead, you should send something like:

def myProgram():
force_mode(...)
 while(some condition)
  sync() # just to pass the time while checking the expression
 end # end of while
end_force_mode()
end # end of program

Hence your condition in the while statement could be used to select when terminating the force mode.

If you want to dynamically change the frame of the force mode, consider checking out this article.

1 Like