Strange Behavior With Slider Joint.

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Strange Behavior With Slider Joint.

Postby MeltingPlastic » Tue Apr 30, 2019 4:02 pm

Here is a demo: https://drive.google.com/open?id=1tKBWD ... 4ulDWYmvCh
just click the sleeve piece and then click on the rod. once they are attached, you can click to pick up the whole assembly and drop it. It's built in debug mode if it helps.
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 5:00 pm

al right, I setup the repro test and committed it, I can see the bug yes.
I will debug it tonight.
I will also check you demo, I can't download stuff form the net from here.
anyway if you sync and just run the demo, see if this is similar to what you are doing?
I had to make some assumption, like the limits and the out box size, your seem bigger because is not a box. I am also testing with the real inertias, let see what we can fix before moving to the hack.

somehow in your video the model looks bigger, but maybe your camera is closer.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 5:05 pm

the limit seem important, I set it to +- 0.5 are those you limits.
some how in the test I can see that is does detach by does not seem as weak as yours.

can you please try it out, an tell me is this is close to yours?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby MeltingPlastic » Tue Apr 30, 2019 5:31 pm

Hey Thanks, the demo looks close to mine yes.

The object sizes should be the same as in the original video from a couple weeks ago.

I checked the demo out. Sorry I miss-told you about which joint I'm using. I am using the dCustomCorkScrew - not dCustomSlider. Once I changed the newton demos to dCustomCorkSkew, the demo shows the same wobble.

I think the problem lies somewhere in the corkscrew portion

I don't think the slider limits are important
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 5:41 pm

MeltingPlastic wrote:I checked the demo out. Sorry I miss-told you about which joint I'm using. I am using the dCustomCorkScrew - not dCustomSlider. Once I changed the newton demos to dCustomCorkSkew, the demo shows the same wobble.
I think the problem lies somewhere in the corkscrew portion

ah that's new information.
no necessarily for the better because the corkscrew joint is the one of those that can benefit from the Gyro torque.
this because a slider constraint the angular velocity of both bodies, so the effect is zero, the cock screw on the other hand let one body have an angular velocity therefore the next effect is not zero.

but I think you are right there must be a bug on the joint itself, it is one of those joints that gets very little used. I will check that them.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 5:46 pm

and yes, that si a serius bug, I can see it :mrgreen: :mrgreen:
Is that funny how that is such a huge bug and we can get soo happy that there is such bug?

can you guess why?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby MeltingPlastic » Tue Apr 30, 2019 6:14 pm

Does the bug effect the slider as well? other than that idk
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 6:45 pm

yes I think saw, In fact I copied the code from the slider and I realized the joint angle is calculated wrong. I will fix that later.
anyway I added a quick fix, please try is out.

I am tracing the angle error on the fix, and it seems to be as high as 20 degrees. which seems too high.
-14.479181 12.879178
-17.701553 8.018874
-19.026295 2.270039
-18.489519 -3.535457
-16.261606 -8.624683
-12.619725 -12.469845
-7.966176 -14.816460

but the softness should be much less than before, please see if this is better.
from here there are things we can do to make better. but let use see how this goes first.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 6:50 pm

same test with gyro torque enable produce these errors, that's a big improvement.

0.132377 9.130427
0.344000 9.047849
1.393170 8.950901
2.434409 8.801109
3.458358 8.568740
3.793913 8.389691
4.106900 8.165361
4.404891 7.928539
4.688142 7.682553
4.956455 7.428216
5.209652 7.166129
5.447554 6.896908
5.670045 6.621157
5.877048 6.339511
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 6:53 pm

after you test it, and tell me if it is better,
Them I will make a fix that check is the error is large than some value and them apply a correction.
but firs we most make sure that is robust enough .
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby MeltingPlastic » Tue Apr 30, 2019 7:04 pm

I just tested in the demo app - looks better. seems harder to get the joint to go off-center after flinging it around.
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 7:08 pm

ok, is moving on the right direction, now I added the max angle error before start capping it.
is set to 5 degrees , and I get these values after smacking is on the floor hard.

    4.002464 -3.967056
    3.652727 -4.445404
    3.242948 -4.871996
    2.782357 -5.240138
    2.383118 -4.313088
    2.024755 -4.490459
    1.645295 -4.721584
    1.241216 -4.913349
    0.818370 -5.055923
    0.485065 -3.948819
    0.211100 -3.929741
    -0.060825 -3.978935
    -0.336804 -4.008320
    -0.614421 -4.010348
    -0.890278 -3.984776

please run one more test.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Tue Apr 30, 2019 8:06 pm

ah and BTW on this,
So now I am wondering if my cylinders in my game are just too small? When building the cylinders I get Final Inertia Matrix: [0.00102273 0 0 0, 0 0.00102273 0 0, 0 0 2.34265e-05 0, 0 0 0 1]
Edit:
the cylinders still seem "Jumpy":
https://www.youtube.com/watch?v=V6uubKn ... Vw&index=1


this is where the Gyro torque make a huge difference in the simulation quality, when you have time please try the same cylinder with e gyro torque enable, the wobbling should go away be very small.
and that us a mazing thong abut Gyro, it bring the right kind of wobbling. and is why I want to make a standard feature, no an option.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Wed May 01, 2019 1:45 am

ok now the three joints that has the slider as base are fixed.
dCustomCorkScrew, dCustomSlider, dCustomSlidingContact

there is also a new function on the dCustomJoint class, void SetMaxAngleError(dFloat angleError);

this let you set the max angle error before it makes a motor correction.
by default is set to 5 degrees. I think this is a reasonable value,
the value is clamped between 1 and 10 degrees, and before you ask,
no it can't be set to zero, that's a recipe for an explosion.

please see if this is better.
later I will use the same motor correction for all angular constraints, it seems a good idea.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Strange Behavior With Slider Joint.

Postby Julio Jerez » Wed May 01, 2019 10:11 am

and now the same recovery trick is applied to the hinge family of joints.

I tries to test it in your demo, but I do no knwo if some change is needed but seem to be worse.
the slightest movement make it crazy wobble but the same setting seem very good in the sandbox.

I let you verify in your own test, this is too hard for my.

EDIT:
I submitted the repro test case, so that you can try it out and see if ther is something different with your setup.

notice that other that me setting the gyro torque option, there is not inertia hack.
also the inerta tweak are not really hacks, it is the equivalent of saying the cylinder is hollow
and so that the inertia is concentrated on the outer layer.
Engineers actually do that when making construction materials for many reasons:
cost, strength, stability, weight, etc.
so the inertia tweak is in fact a good thing, but beside that it should behave the same without the tweaks.

EDIT2:
ups the reason I saw worse was because I only copied the newton.dll, the code fix is in the dCustomJoints.dll, but I will let you test anyway, I think it should be much better now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 3 guests