How to solve the problem that the constraint is too elastic

xiaoQ0903
Posts: 10
Joined: Thu Jan 13, 2011 12:42 pm

How to solve the problem that the constraint is too elastic

Post by xiaoQ0903 »

We are making the crane simulation , and requiring the hoisting to be High mass ratios and High stiffness and can intract with the other objects in the virtual environment , we use the constraint connecting the rigidbodys to simulate the hoisting cable ,but we find that the constraint is too elastic .how can we solve the problem? Is there anybody can give me some suggestion?
The first method to solve the problem I have thought :
I have read some papers about the hoisting cable simulation ,and now I want to write a algorithm to contruct a new constraint ,but the algorithm need the collision information,for example ,when the hoisting cable or the load colliders with the objects in the VE,the algorithm need a inpulse based collision model to handle contact between the load and other heavy or static objects and slacking cable with self-contact or contact with environment! because I am not familar with the bullet 、 ode or physX ,I do not know how to get the inpulse or force in the physics engine when collision
The second :
just to adjust the parameters of the existing constraint in the physics engine(Bullet\ODE\Physics),but can I get the expected results as in our project the mass ratio of the hoisting cable is required to be 1000 or more.
xiaoQ0903
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: How to solve the problem that the constraint is too elas

Post by Dirk Gregorius »

The usual combinations are:

1) Smaller timestep (e.g. 120 - 240 Hz if your simulation allows for this)
2) Larger ERP (e.g. 0.2 - 0.8)
3) More iterations (e.g. 32 - 128)

It is usually a combination of all three. I would make these settings available in your debug menu and play with it. Note that smaller timesteps (aka substepping) is pretty expensive.

Also note the large differences between masses can make constraints too elastic. Make sure the ratio stays roughly 1 : 10. Finally there is a trick to tweak the inertia tensor. If you have oblong shapes attached with the constraint it might help to force the inertia tensor to have the same values on the diagonal (sphere inertia). This might help, but the simulation can look weird. So use with caution as last resort.

HTH,
-Dirk
xiaoQ0903
Posts: 10
Joined: Thu Jan 13, 2011 12:42 pm

Re: How to solve the problem that the constraint is too elas

Post by xiaoQ0903 »

Dirk Gregorius wrote:The usual combinations are:

1) Smaller timestep (e.g. 120 - 240 Hz if your simulation allows for this)
2) Larger ERP (e.g. 0.2 - 0.8)
3) More iterations (e.g. 32 - 128)

It is usually a combination of all three. I would make these settings available in your debug menu and play with it. Note that smaller timesteps (aka substepping) is pretty expensive.

Also note the large differences between masses can make constraints too elastic. Make sure the ratio stays roughly 1 : 10. Finally there is a trick to tweak the inertia tensor. If you have oblong shapes attached with the constraint it might help to force the inertia tensor to have the same values on the diagonal (sphere inertia). This might help, but the simulation can look weird. So use with caution as last resort.

HTH,
-Dirk
Hi Dirk!
Thanks for your reply! But our project requires the mass ratio is higher than 1000:1,We have tried in PhysX engine and it can get 100:1 ,however we can not adjust the parameters in PhysX engine because it is not open source . I think it will get higher mass ratio through parameter adjustment in Bullet or ODE engine ,but your reply and the user guide of Bullet engine hits my confidence .So I want to know how to get the collision information (such as the impulse or force ......)when the rigidbody colliders with each other,because I want to know if I can use my own constraint(a new ball and socket constraint) to replace the existing constraint. Can you give some suggestion? Thanks!
xiaoQ0903
priest_wd
Posts: 10
Joined: Wed Sep 22, 2010 3:33 pm

Re: How to solve the problem that the constraint is too elas

Post by priest_wd »

Hi xiaoQ0903!

Have you tried using btUniversalConstraint or btGeneric6DofSpringConstraint? The first one (btUniversalConstraint) have only 2 degrees of freedom.
http://www.bulletphysics.com/Bullet/Bul ... raint.html
I haven't use it yet, but maybe works better than other constraints.

I'm using btGeneric6DofSpringConstraint because in theory ^^ is one of the most customizable constraints because it benefits from its own functions and its parents functions. (Almost on the top of the tree of inheritance XD)
http://www.bulletphysics.com/Bullet/Bul ... raint.html

Check out the documentation of Constraints here:
http://www.bulletphysics.com/Bullet/Bul ... raint.html
There are several functions that could interest you like: getAppliedImpulse(), enableFeedback()

About rigid bodies, maybe this could help:
The info about btrigidbody:
http://www.bulletphysics.com/Bullet/Bul ... dBody.html
Here are listed functions like: getTotalForce(), getAngularVelocity(), getLinearVelocity()

Also check:
http://www.bulletphysics.com/Bullet/Bul ... bject.html
http://www.bulletphysics.com/Bullet/Bul ... Shape.html

If you need to know bullet code deeper, these is the best place to start I think
http://www.continuousphysics.com/Bullet ... index.html

Remember to update your version of Bullet if you installed time ago.

Well that is what comes to my mind now. Sorry for answering late :S. It has been a busy new year.

Keep us posted about your progress.

Greetings!
xiaoQ0903
Posts: 10
Joined: Thu Jan 13, 2011 12:42 pm

Re: How to solve the problem that the constraint is too elas

Post by xiaoQ0903 »

Hi priest_wd !Thank you very much for your warm-heartedness!
Sorry for replying so late! For the past two month I have learned about ODE ,because in the forum someone had said that the joint in BULLET is not so good as the ODE.I also read many papers about the rigidbody simulation .Now I want to write my own algorithm to simulate the cable .But I find I don not know how to begin.So I want to refer a simple rigidbody simulation program with joint constraint . Can you give me some help?
xiaoq0903
Greetings!