Constraint Flexibility

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Constraint Flexibility

Postby AntonSynytsia » Thu May 15, 2014 4:05 am

Hello,

While testing joints I found that constraints are to flexible - it doesn't require much force to turn the hinged body away from its rotational axes.
Is there a way to reduce flexibility?
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm

Re: Constraint Flexibility

Postby AntonSynytsia » Thu May 15, 2014 4:31 am

MIN_JOINT_PIN_LENGTH in custom joints seems to control the flexibility.
A value of 0.01 makes joints very flexible, meanwhile a value 1.0 makes it tight.
The thing is 1.0 and 10000.0 seems to have the same tightness.

Another thing is when joints pin gets turned by force, the joint realigns the child body to the assigned pin very slowly, I mean it should realign it fast. Is there any suggestions for that?
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm

Re: Constraint Flexibility

Postby JoeJ » Thu May 15, 2014 6:01 am

Pin length control stiffness, because a longer pin vector results in a longer lever of applied force.
But the better way to control that ist to set minimum and maximum friction (for hinge the interface is ::SetFriction()).
This sets the maximum allowed forces applied on the 'pin vector lever'.

AntonSynytsia wrote:the joint realigns the child body to the assigned pin very slowly, I mean it should realign it fast

The slow error correction is a good thing. If it would be fast, penetrations, explosions and unstable simulation could happen.
I don't know how this can be tuned, but you should try to prevent it from happening first (Maybe by tuning the friction values of all joints - if you use unusual mass or world scale, the default values will not work well).

There are no 100% stiff joints - that's impossible, but another new way to improve it is discussed here:
http://newtondynamics.com/forum/viewtopic.php?f=9&t=8150
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Constraint Flexibility

Postby AntonSynytsia » Thu May 15, 2014 11:33 am

JoeJ wrote: set minimum and maximum friction

Hmm, thanks! My friction values were zero :roll:

JoeJ wrote:The slow error correction is a good thing. If it would be fast, penetrations, explosions and unstable simulation could happen.

Good point!

JoeJ wrote:There are no 100% stiff joints - that's impossible, but another new way to improve it is discussed here

I read some of it, stopped at last and post and saw a ProjectError function, which makes me wonder whether it does exactly what I need. But, was it written to be called manually rather than in the submit_constraints callback because I never found a reference where that function is called as a callback.

EDIT: Setting joint solver mode to exact is exactly what I need! It makes the joint a lot stronger :twisted:
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron