Dynamic torque application

I would like to implement a child safety cap opening with a UR3. To open these cap, you should press the cap down, then twist it until the tamper-evident rim breaks ( I attached a picture of the caps). I want to implement the decapping procedure using the force sensor. So, basically, when the cap is still closed, the robot should sense a higher counter-torque given by the safety system. When the torque drops it should mean that the tamper evident rim is broken and the robot should stop applying a downward force.

How can I implement it?

I would try to make it up of two Force nodes.

Start by making a thread that monitors the force in all axis’. Variable := get_tcp_force()
Then use a sync() to delay the thread as little as possible.

Then make the first Force node in Frame setting (upper right corner) with a downward force and rotational torque. Make the rotational force in Rz rotate slowly.
Then create a Wait that looks at your force reading in Rz (Variable[5]) and first make it wait for a high value then make it wait for a low value afterwards.

Give that a try.

What is the purpose of the first thread? What effect does it have on the rest of the program?

You’re writing the Force/Torque sensor readings to a variable constantly, which you can use in your main program. And you can monitor them yourself in the Variables window to get an idea of how everything behaves.

So something like this? Do I need to add a move function?

thread GetForce():
 force = get_tcp_force()
 return False
end
thrd = run GetForce()
join thrd 

force_mode(get_actual_tcp_pose(), [0,0,1,0,0,1], [0,0,-60,0,0,10], 2, [.1,.1,.01, 0.785,0.785,1.57])

# Then the two waits

I don’t do script very often, since there really rarely is a need for it in the UR. So I can’t help you with that part. :slight_smile:

Here you go:

Second Force doesn’t have the Z compliance.

1 Like