Use an if statement and check the box for checking the condition continuously. The condition you are looking for is the force to below a certain threshold, 100 N for instance.
Under the if statement you place the full move followed by a flag to let you know the full motion was completed. If the If statement exits before the full point was reached the flag will not turn true
Then in the else else you will place a stopj(12) command, this will bring the robot to a clean stop quickly following any breaking of the if statement.
You can then then wrap this whole statement in a loop that executed so long as the made it flag is false. Something like this pseudo code
var madeIt=False
Loop (not madeIt)
if ( force()<100) # make sure check box is checked makes it a while loop
MoveL
OffTheBobbinPoint
madeIt=True
else
stopj(12)
end if
end Loop
How to perform a move with a force limit?
My UR10 removes coils from a bobbin. Friction between coil and bobbin is an issue so simply using MoveL with any speed/acceleration parameter results in a protective stop.
I currently run this: (pseudocode)
Loop 10 times:
- 5mm relative move on tool X-axis
- Wait force()<100
The above performs reasonably well, but as it comes to a stop nine times, the robot must also overcome the resting friction of the coil each time, so it takes ages. Since sliding friction is always less (yay physics), it would be better to get run the movement in one go.
I tried using the Force function in the Polyscope, but it doesn't really do what I want it to do, which is to move along tool axis with a limited force. If I set it to 100N on X-axis and give a relative 50mm movement command, the robot never reaches the end point of the movement but instead tries for a random amount of time and then skips to the next step in the program which causes it to try to move through the winding machine's frame. Why doesn't the robot finish the movement?