Hyperstatism with slider joint ?

gee
Posts: 14
Joined: Mon Aug 14, 2006 8:36 am
Location: Paris, France

Hyperstatism with slider joint ?

Post by gee »

Hello,

I have a little problem when I use two slider joints on the same object.

A, B, C are 3 rigid bodies. A and B are fixed and cannot collide with B.
B have a small linear velocity along the axis of the sliders.

If I have this :

A --------
C
B --------

It works well.

But it I have this :

A ----- C ----- B

It does not. Well it seems to work but the error correction for the 3 rotations makes C go into a rotation to go somewhere else, then the error correction for the position will make it come back to where it should.
I have tried 2 different error correction for the rotations and I get the same result, but I'm guessing the problem is not there as these calculous do not use the position of A, B, C.

So either I'm getting something wrong somewhere else, or this case can not be done like I thought.

If you have any idea on the matter, I'll be glad to hear them.

Just to clarify, I'm using an interative MLCP (SOR), velocity-based constraint, and Baumgarte error correction. I've tried various small time-steps, precisions and such, but it does not help.

Thanks
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

How do you formulate the constraint?
gee
Posts: 14
Joined: Mon Aug 14, 2006 8:36 am
Location: Paris, France

Post by gee »

Well I've just made a test with B not fixed (which test I should have made earlier) and it works well.

So I'm more thinking of an hyperstatism problem now.
gee
Posts: 14
Joined: Mon Aug 14, 2006 8:36 am
Location: Paris, France

Post by gee »

DonDickieD wrote:How do you formulate the constraint?
Sorry I replied to myself without refreshing the page,
The constraints are the same used by Kenny in his thesis.
The difference will come from the way we calculate the error (both angular and linear).

For the rotations, I'm using the rotation matrix to go from the base of object 1 to the one of object 2. From that I'm getting the sin(phi).v which I approximate to phi.v. I'm using the local axis and local version of the two orthogonals to compute the base.

For the linear error, I save the initial distance between the two gravity centers projected on the two orthogonals, and I calculate them back at each iteration.

Thanks
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

I found the formulation of Kenny (which is the same like in the ODE) very unstable, actually I am not sure if it is correct. What you have is a constraint that removes 5 relative DOF.

Given the slider axis n which is stored arbitrarily in body 1. t1 and t2 are two perpendicular vectors to n also stored w.r.t. to body1. r_i are the leverarms from center of gravity to some attachment points on the bodies. We formulate the constraints as follows.

Linear constraints - assuming t1 and t2 stored w.r.t body1:
C1 = ( x1 + r1 - x2 - r2 ) * t1 => dC1/dt = (v1 + omega1 x r1 - v2 - omega2 x r2 ) * t1 + ( x1 + r1 - x2 - r2 ) * ( omega1 x t1 )
C2 = ( x1 + r1 - x2 - r2 ) * t2 => dC2/dt = (v1 + omega1 x r1 - v2 - omega2 x r2 ) * t2 + ( x1 + r1 - x2 - r2 ) * ( omega1 x t2 )

Angular constraints:
C3 = v1 * w2 => (v1 x w2) * omega1 - (v1 x w2) * omega2
C4 = -u1 * w2 => (w2 x u1) * omega1 - (w2 x u1) * omega2
C5 = u1 * v2 => (u1 x v2) * omega1 - (u1 x v2) * omega2

From my experience you can't ignore the time derivative of the axes perpendicular to the slider axis, as you do for non-penetration constraints. This gave me rock-solid sliders. Let me know if you can't find the Jacobians by inspection.

HTH,
-Dirk

Edit:
u, v, w, define the constraint space, that is three arbitrary perpendicular axes stored w.r.t to body1 and body2

Maybe also interessting to know:
If you look at the angular constraints and maybe draw the constraint space you will see that the following holds:
v1 x w2 ~ u
w2 x u1 ~ v
u1 x v2 ~ w

This is what the ODE does for the joints that need angular constraints and what makes them very unstable from my experience. You really want to start with the position constraints and find the velocity constraint from there through build the time derivative. Otherwise it is IMO very difficult to find the correct stabilization (Baumgarte) term...
gee
Posts: 14
Joined: Mon Aug 14, 2006 8:36 am
Location: Paris, France

Post by gee »

Hello,

thanks for the long replied, I read your answer this morning and did not really understood what you need u,v,w. For the base I use my axis, and the 2 orthogonals. Yet I have not read all very carefully, so I may have missed something big.

For now the slider seems okay as long as I don't do some complexe scenes, but I really have to look at your code soon. It seems it'll take me some time to diggest it all, and as I have other joints based on the slider, it might take again more time :) So I'll see that tomorrow or next week.

Thanks, and if you have other remarks like this on the "easy" joints Kenny is using, I'm interested.
gee
Posts: 14
Joined: Mon Aug 14, 2006 8:36 am
Location: Paris, France

Post by gee »

Hello,

I have quickly tried with a cylindrical joint instead of the slider, and it seems to work just fine.

So maybe my implementation of the cylindrical as a slider should be better than the one I have for a slider.

I will try more soon and keep you informed on that.
gee
Posts: 14
Joined: Mon Aug 14, 2006 8:36 am
Location: Paris, France

Post by gee »

Hello,

well the answer was not as soon as I thought sorry.

I've changed a bit my slider implementation (no change on the equations) and I can't get in any of those problems right now, so it seems ok.

Though, I will try to look at the equations you gave me, even if it's just for myself.

Thanks