Creating Stiff Angular Springs

Please don't post Bullet support questions here, use the above forums instead.
crashlander
Posts: 41
Joined: Sat Apr 08, 2006 11:20 am

Post by crashlander »

Interesting. I will try to implement an AnuglarJoint using this and compare them.

@raigan2. In you current implementation for the AngularJoint. Do you use any slop factor? I don't, but was wondering if I should be...
raigan2
Posts: 197
Joined: Sat Aug 19, 2006 11:52 pm

Post by raigan2 »

I'm not -- but let me know if it helps at all. My impression was that the "slop" is left in collision so that the contacts are persistent for warm-starting.. is there any other benefit?
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

If you mean by slop some kind of allowed penetration it will also help with the coherence for limits. Basically this is the same concept like contacts. For limits you can also allow some violation of the position constraint...
crashlander
Posts: 41
Joined: Sat Apr 08, 2006 11:20 am

Post by crashlander »

Yes, "allowed penetration" is what I meant. I can see using it with limits. I was just not sure it would be helpful for a constraint that is designed to simply keep two bodies at a fixed angle with no "play" in either direction.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine

Post by Erin Catto »

You shouldn't use slop for fixed angles. Slop is useful for inequality (unilateral) constraints. What you have is an equality (bilateral) constraint.

Let me explain how slop helps limits. Suppose you have an angular limit. The limit has three states: at_lower, neutral, at_upper. At the lower limit the impulse must be positive. In the neutral state, the impulse is zero, the constraint is off. At the upper limit the impulse must be negative.

Now assume the angle has hit the lower limit because some torque is rotating the body. There will be some overshoot passed the lower limit because of the discrete time step of the integrator. You will detect the overshoot and try to compensate by applying some position bias (or split impulse). You will also arrest any negative angular velocity. There are now two cases:

1. Your position correction does not overshoot the lower limit into the neutral region. The state remains at_lower. All is good.

2. Your position correction overshoots the lower limit into the neutral region. The state goes from at_lower to neutral. The next time step the torques in the system might drive the angle back passed the lower limit. We now have oscillations (this is often called a limit cycle).

Slop remedies case 2 by reducing the chance of overshoot from the lower limit into the neutral region. The position correction only tries to drive the angle up to lower_limit - slop.

An open question is whether the position correction should try to drive the angle down to lower_limit - slop when the angle is in the range [lower_limit-slop, lower_limit]. In my experiments with contact constraints, this did not help. Intuitively it seems wrong to have an inequality constraint "suck."