Hole alignment for rivetage

Hello everybody,

I try to set up a riveting action with a UR10. I am having some difficulty, I cannot get the coverings through when the holes are not perfectly aligned, knowing that the holes 3.4mm in diameter and the rivets 3.3mm in diameter.

Do you have any suggestions for me?

hank you in advance for your ideas.

Sincerely

Hello!

You can use the internal Force-Mode of the UR to make a small spiral movement. The Force mode would be lined up with the tool direction. With currently measuring the TCP-Force you can check for any significant changes in the tool direction. Once you have detected the hole your program can continue as intended.

Here having an eSeries robot is big benefit, as it has a F/T-sensor build in the tool already. This gives you a far more sensitive measurement, than on the blank CB-Series.

1 Like

Hello,
Can you provide the script code example?
Thank you in advance

Hi Milan,

take a look at the following code snippet:

thread ForceThread():
curForce=10        
sleep( 1.0 )      
while ( curForce > 2 ):      
    global tempForce= get_tcp_force()       
    global curForce=tempForce[ 2 ]       
    sync()
end     
popup( "Hole Detected", "Message", False, False, blocking = False )
halt
end  
threadId_Thread_1 = run ForceThread()

actDegree = 0
distPos = 0.1 #deg
stepsFor360 = 360/distPos
distPerStep= 0.005 / stepsFor360
x = distPerStep
radius = 0.05 # radius in m
r = 0

lastPos = get_actual_tcp_pose()
newPose=get_actual_tcp_pose() # Next Position
middlePose= get_actual_tcp_pose() # Spiral middle position

sleep(0.02)
zero_ftsensor()
force_mode(tool_pose(), [0, 0, 1, 0, 0, 0], [0.0, 0.0, 5.0, 0.0, 0.0, 0.0], 2, [0.1, 0.1, 0.05, 0.3490658503988659, 0.3490658503988659, 0.3490658503988659])  

while ( r < radius ):
    while( point_dist( lastPos, newPose ) < 0.0001 ):
        actDegree = actDegree + distPos
        x = x + distPerStep
        global r = 0.0005 + x
        newPose=pose_trans( middlePose, p[ ( cos( d2r( actDegree ) ) * r ),( sin( d2r( actDegree ) ) * r ),0 ,0 ,0 ,0 ] )
    end
    servoj( get_inverse_kin( newPose ),t = 0.005, lookahead_time = 0.005, gain = 700 )
    lastPos = newPose
end

end_force_mode()
stopl(5.0)

Please be aware, that this is just for sample use :slight_smile:

Hope this helps you out!

sko

3 Likes

Hey Sko,

Was just wondering if this will work with UR10 CB-series. I know you said above that the eSeries has an advantage in this but could the CB still be used.

With that code snippet how does it work? when you are trying to enter the hole do you put it into force mode and then if it hits the side it will spiral until it finds the hole. sorry if these are questions are to simple just having a little bit of a tough time understanding it.

Thanks

Hello @design2

First welcome to the Forum! :slight_smile:

Yes, this could also work with a CB series robot, but the force measurement is far less precise. You may want to add an additional Force Torque Sensor to improve it.

In the Script above two parallel while - loops are running.
The first one is started in a thread and check continuously the current force value in Z - direction. If this value falls below the threshold, it indicates a hole was found and stops the program. The second one calculates the spiral trajectory. To limit the spiral size it is stopped after a predefined radius.

1 Like

Thanks very much @sko .

Just say my tool TCP points in the Y-direction, would the force still be able to be detected correctly in that case. Also, again iā€™m sorry for the simple question but i am new to the UR coding, is there any resources or anything where i can make myself more familiar with URscript

The part of the script code the force value is chosen can be seen below.

The command get_tcp_force() returns a pose array containing six values: p[Fx(N), Fy(N), Fz(N), TRx(Nm), TRy(Nm), TRz(Nm)]
With the current index 2 the Force in Z direction is selected from the tempForce variable. You can adjust this index according to your needs.

The full command description can be found here:
tcpForce

This is an excerpt from our UR Script Manual. You can find the latest version on our support site. Downloads ā†’ Manuals ā†’ Script ā†’ Desired SW Version.

Here you can access the current one.

1 Like

Thanks very much sko you have been very helpful

1 Like