Ignored spring - Physic engines

Typically: "How do I... ", "How can I... " questions
Post Reply
javl0p

Ignored spring - Physic engines

Post by javl0p »

Hello again!

In the project I am currently working on I have to simulate a couple iiwa robots that grasp and lift an object by friction. Both grippers at the robot's end effectors are simple cuboids; and the object, in order to make it deformable, is composed of a set of rigid cuboid-spring-rigid cuboid.

The theory is that the grippers must exert a certain force to both sides of the object-set. Thus, friction should make appearance and create a force big enough to hold the object to the grippers when lifting is carried out.

The problem here is that, depending on the physic engine I use, behavior is very different. Here the results of my tests:

-Bullet 2.78: Spring doesn't move and even though pretty high contact forces appear, the object is not lifted, as if friction was zero.
-Bullet 2.83: Spring doesn't move and contact forces are really high. This time gripping is done and the object is accordingly lifted. However, due to the high opposite contact forces, the grip is vibrating and unstable.
-ODE: Spring doesn't move, gripping is carried out in a similar way as in Bulet 2.83.
-Vortex: Spring doesn't move either, contact forces are insanely high, however the object partially slides down when lifted.
-Newton: Spring behaves as it should, it gets compressed due to contact forces and their magnitude is similar to the one I previously had calculated. However, friction seems to have no effect on the object since it can not be gripped. (similar as it happened in Bullet 2.73)

In every case, friction is set to be equal (0.56) between contact surfaces.

Thank you!

coppelia
Site Admin
Posts: 10337
Joined: 14 Dec 2012, 00:25

Re: Ignored spring - Physic engines

Post by coppelia »

Hello,

can you post the scene, this would make things much easier to see what is going on.
Next to the differences and specificities of each physics engine, there is another thing that comes on top of that: when designing a gripper, make sure you have only one active joint that does the gripping, otherwise you will get a lot of vibration. What I mean with one active joint is following:

Imagine you have two chopsticks. To lift an object, you have two possibilities:
  • you take one stick in each hand and try to grab/lift the object. You will see that the task is very difficult and unstable
  • you take the two sticks in one hand and try to grab/lift the object: You will see that the task is much easier than previously
So instead of having two joints push the objects from each side, have one joint to squeezes the object, and another position-controlled joint to centers the first joint correctly. Results will be much better. Take a look at the demo scene scenes/youBotAndHanoiTower.ttt.

Cheers

javl0p

Re: Ignored spring - Physic engines

Post by javl0p »

Dual manipulation is, indeed, the main subject I am working on right now and it's a major topic which I will focus on in the near future. The scene is available through this public dropbox link:

https://www.dropbox.com/s/29lvwpwxqoqhe ... 3.ttt?dl=0

I'll also have a look at the demo scene scenes/youBotAndHanoiTower.ttt. Thanks for the comments, they are useful and make a lot of sense.

However, my question was also pointing the fact the, depending on the physic engines used, the simulated spring I am using, works or not. So far the Newton engine is the only one that gave possitive results in that aspect, but maybe I am missing some joint parameters. Also I am wondering why depending on the engine I use, friction seems to be ignored.

Thank you!!

coppelia
Site Admin
Posts: 10337
Joined: 14 Dec 2012, 00:25

Re: Ignored spring - Physic engines

Post by coppelia »

Ok you have following problems in your scene:
  • the joint that is supposed to act as a spring has no movement range! Solution: set Pos. range to 1 and Pos. min. to -0.5
  • the end-effector rotation makes the two robots try to turn the part into different directions, but not always. The reason is that your joints are cyclic and you set a rotation of PI --> the physics engine will pick the closes distance direction. So if your joint is at 0.00001, it will turn positively, but if it is at -0.00001, it will turn negatively. So you will never know for sure. The solution: set a rotation distance smaller than Pi (or make the joints non-cyclic)
  • with Bullet2.78, you will have to check Sticky contact for the end-effectors.
  • Finally, you might have to adjust the spring joint's maximum force (this represents the maximum force, independent of what you have set for the spring constant K. It is an upper threshold)
Cheers

javl0p

Re: Ignored spring - Physic engines

Post by javl0p »

Thank you very much for the fast answer!

i've only been using V-REP for a couple weeks so there are still a lot of options and parameters that scape out of my control, thanks for pointing them out. Now everything works as it should, well, almost everything. I couldn't manage to make the 7th joints rotate the way I want.

Rotation has to be 180º, so I'm trying to use the last parameter of the simRMLMoveToJointPositions command, the one that adjusts the rotation direction. I understand that this parameter only works if joints are set to cyclic mode and that rotation directions are related to the global reference system, so that in my case in which robots are facing each other, both joint parameters have to be set in the same number (both 1 or both -1) to move in the same direction. Is this right?

In either case, changes in this parameter seem to have no effect in the rotation directions of the joints.

I post the scene here:

https://www.dropbox.com/s/bi6fv4ras3z9b ... 4.ttt?dl=0

Thank you!!

coppelia
Site Admin
Posts: 10337
Joined: 14 Dec 2012, 00:25

Re: Ignored spring - Physic engines

Post by coppelia »

You set the wrong argument for the rotation direction. You forgot about the target velocity. So instead of

Code: Select all

simRMLMoveToJointPositions({joint7_2},-1,nil,nil,{1},{1},{1},{pos},{-1})
it should be

Code: Select all

simRMLMoveToJointPositions({joint7_2},-1,nil,nil,{1},{1},{1},{pos},{0},{-1})
Then, each robot should use an opposite rotation direction, since their respective 7th joint are pointing into opposite directions.

Cheers

javl0p

Re: Ignored spring - Physic engines

Post by javl0p »

Thank you, all figured out I guess!!

javl0p

Re: Ignored spring - Physic engines

Post by javl0p »

Hi again!

Going back to your first response in the thread, when you talked about different ways of handling an object by using two manipulators: yes, indeed, applying a squeezing force from both sides causes the object to be lifted in a very unstable way. The box that I handle in my scene shakes from side to side and if I graph the grasping forces I see there is a lot of noise.

As you said, a better way to do this would be to apply this squeezing force only with one manipulator while the other one helps to centre the position. The problem is that I have abslolutely no idea on how to do this in VREP.

I repost my scene here: https://www.dropbox.com/s/bi6fv4ras3z9b ... 4.ttt?dl=0

Any comments would be greatly appreciated!

javl0p

Re: Ignored spring - Physic engines

Post by javl0p »

Here I post two more scenes in which I include an iiwa 14 performing a very simple linear motion. Torques at each joint are graphed. Even though they are almost identical scenes, you will see that the graphs are really different, iiwa_torque_test one presents a lot of noise in their joint torques while the ones in iiwa_torque_test2 are smooth. Im still trying to figure out the reasons of such difference but I believe it is somehow related to the previous problem of instability.

iiwa_torque_test: https://www.dropbox.com/s/qku4zprj8awyy ... t.ttt?dl=0

iiwa_torque_test2: https://www.dropbox.com/s/229kel0stygoc ... 2.ttt?dl=0

Thank you very much!

coppelia
Site Admin
Posts: 10337
Joined: 14 Dec 2012, 00:25

Re: Ignored spring - Physic engines

Post by coppelia »

In the two scenes you have you:
  • Do not perform the same motion
  • Do not use the same physics engine
This is the main difference. Try playing around with the different physics engines and see which one fits your needs best.

cheers

Post Reply