## My gripper performs bad repeatability,is it a physical engine problem?

Report crashes, strange behaviour, or apparent bugs
daniel li
Posts: 6
Joined: 12 Mar 2018, 03:28

### My gripper performs bad repeatability,is it a physical engine problem?

Hello,
I build a Robotiq-140 gripper.Different from the example Robotiq-85 in vrep,I use true working principle to build the model.See https://www.dropbox.com/s/0kbzamzzzixwq ... 0.png?dl=0 and https://www.dropbox.com/s/f2elivjsbzh9m ... 9.png?dl=0
I use it to grab a cylinder,it works good at first time.But when I keep repeat the action(open and close the gripper),the gripper is deformed.I checked all the component and the relationship,but the problem remains.

first time close:https://www.dropbox.com/s/1hue2lx5dlteg ... 1.png?dl=0
frist time open:https://www.dropbox.com/s/hty11sw0y84zz ... 1.png?dl=0

second time close:https://www.dropbox.com/s/4zmm2yrrai9kr ... 2.png?dl=0
second time open:https://www.dropbox.com/s/9qg1q790wm5mh ... 2.png?dl=0

We can see at second time the gripper begin to become deformed.Here is a result after several open and close:
result:https://www.dropbox.com/s/mqxlj60v88eb1 ... t.png?dl=0

What is my model's problem?Or it is the physical engine that make the weird behavior?

my scene:https://www.dropbox.com/s/kw8n5r8o8nuv7 ... t.ttt?dl=0
my model:https://www.dropbox.com/s/ygvs4www0qwlk ... 0.ttm?dl=0

System:Window10 64bit
Ver:3.5.0
Physical engine:vortex

thanks

coppelia
Posts: 7597
Joined: 14 Dec 2012, 00:25

### Re: My gripper performs bad repeatability,is it a physical engine problem?

Hello,

looking at your model... why do joints Joint5_L and JointR_R have their motor enabled?
Then, it can have several causes. For instance:
• sometimes kinematic loops are overconstrained (e.g. all joints are parallel, but not exactly. Sometimes very small differences can cause joints to lock). With the Vortex engine you have joint constraint relaxations that you can enabled
• But very probably you can also improve the results by adjusting several parameters for the Vortex engine (have also a look at the general engine properties)
Cheers

daniel li
Posts: 6
Joined: 12 Mar 2018, 03:28

### Re: My gripper performs bad repeatability,is it a physical engine problem?

Sorry for didn't explain clearly how the model works.
Joints Joint5_L and Joint5_R have their motor enabled for a good reason--to simulate the act of a spring.I studied the mechanical working principle of the gripper,found that the two shafts in the middle of the gripper(i.e. Joint5_L and Joint5_R)are not just passive shafts but shafts that can output constant force.
Here's a video that shows what I said
https://www.dropbox.com/s/7xcmz6f9xql4f ... 0.mp4?dl=0
It can be seen that the constant force exists,otherwise when I move away my finger, levers will swing.And if think deeper,it can be found that this constant force is the secret why the two fingers of the gripper can keep parallel.

I would like to explain other considerations why I made the Robotiq140 model as it is.
The bulges on the Lever1_R or Lever1_L,see https://www.dropbox.com/s/sv58trrglt671 ... R.png?dl=0 and https://www.dropbox.com/s/z2g75ejhy2j20 ... l.png?dl=0 ,are very important or even indispensable.They provide real grab force which come from Lever1_R or Lever1_L.Because of the pressure between the bulge on Lever1 and Lever2,the two lever run through each other for the default material is too soft.So I set the compliance of the two levers's material to 1.000e-12.And it works.

Any way,I looked over the whole model and the parameters that I understand for now,but I can't find any mistake.As for the third suggestion in your reply,I can't find any parameters that seems relate to the problem.
Need some help,thanks!

coppelia
Posts: 7597
Joined: 14 Dec 2012, 00:25

### Re: My gripper performs bad repeatability,is it a physical engine problem?

Yes, of course, that spring force is needed!

I can't really reproduce the deformation with your gripper. Or maybe I am doing it wrong. With the cylinder between the fingers, you simply alternate the Joint1_L target velocity from +3 to -3?
Can you identify where the deformation comes from? Are joints slightly breaking apart? Or are the bulges more and more intersecting with the other links? (i.e. deeper and deeper penetration)
Have you tried to use joint limits for joints Joint2_L and Joint2_R, instead of the bulges?

Cheers

daniel li
Posts: 6
Joined: 12 Mar 2018, 03:28

### Re: My gripper performs bad repeatability,is it a physical engine problem?

Yes,I created the deformation by using alternate the Joint1_L target velocity from +3 to -3.But there's an additional condition--Use "Stop" button when changing the target velocity.If I use "Pause" button,or use script,the deformation didn't happen.I made 3 videos for the 3 situations to show what I mean.
Demo1:Use "Stop" button
https://www.dropbox.com/s/qoy1kruok1zkw ... n.mp4?dl=0
Demo2:Use "Pause" button
https://www.dropbox.com/s/w2zbh3x49mau3 ... n.mp4?dl=0
Demo3:Use Script
https://www.dropbox.com/s/8ohbfe4rqdu7w ... t.mp4?dl=0

The videos above illustrate a problem:the deformation seems don't happen when the physical engine works continuously(i.e. not truly stop),but happen when the engine is repeatedly "start" and "stop".This phenomenon makes me wonder if it is because there's an error accumulated every time we use the physical engine. That's why I put my post into the "Bug reports" section.
Here is the scene that the video use.It's quite similar to the scene in my first post,but the difference was that I added a script,and slightly modifed the model(fixed an insignificant error)
https://www.dropbox.com/s/n5i5mp1amsm58 ... 2.ttt?dl=0

-------------------------------------------------------------------------------
The question above shows my doubt about the physical engine,but the deformation problem have another aspect(and I guess that's what you were trying to help me with,and yes,I do need this help).That is the deformation during the simulation,shown in the picture:
https://www.dropbox.com/s/di1cmue3h70xw ... 0.png?dl=0
and if we want to see this deformation more clearly,we can set the Joint1_L's torque to 10000000.like this:
https://www.dropbox.com/s/oiye1jvzjml2m ... 0.png?dl=0

I did some digging,found that the deformation seems comes from joints slightly breaking apart,shown in picture:
https://www.dropbox.com/s/hbng0wqld7j5g ... t.png?dl=0

In my experience, this seems like a very common, very classic problem which usually happens when the torque of the joints is too big.Set some parameters may solve this problem I think(but I don't know how),but if I just need an ideal joint that won't breaking apart in any situation?

-------------------------------------------------------------------------------
As for the last suggestion in your reply:Have you tried to use joint limits for joints Joint2_L and Joint2_R, instead of the bulges?.I didn't try it,for the reason that I need to simulate the real working principle of the gripper as the bulges on the gripper play an important role.
The Robotiq140 has 2 working states--"encompassing grip" and "parallel grip",as shown is the picture:
https://www.dropbox.com/s/g6z8tf3xig3af ... g.jpg?dl=0
and my screenshot in vrep:
https://www.dropbox.com/s/9bq3lhkrem6qr ... p.png?dl=0
If I use other method to build the model,I'm worried about the authenticity the gripper can perform.
And for another reason I didn't try it is that I am not very familiar with using joint limits.:)

Any suggestions?thanks!

coppelia
Posts: 7597
Joined: 14 Dec 2012, 00:25

### Re: My gripper performs bad repeatability,is it a physical engine problem?

Why do you uncheck reset scene to initial state? Of course, if you do that, you will see deformations for following reason: most physics engines will operate by incrementally correcting for some positional errors (e.g. between a joint and its anchor). This means that there are always more or less minimalistic errors that the physics engine tries to correct (you can display them in a graph via the data stream Joint: internal position error). If you stop the simulation with the reset scene to initial state checkbox unset, then the attachment of a link to a joint will slightly be shifted, and used as new initial condition.

To avoid this (while not reseting the scene to its initial state at simulation end), you will have, at start of a simulation, e.g. in the initialization phase of a child script, to memorize the relative position and orientation of a link in relation to its parent joint, and at simulation end (e.g. in the cleanup phase of the script), restore that position and orientation. e.g. in following situation:

init phase:
sim.setObjectMatrix(linkHandle,jointHandle,initRelMatrix)