Unstable link ( rotational limit + angular motor )

XperienS
Posts: 34
Joined: Fri Nov 25, 2005 10:09 am

Unstable link ( rotational limit + angular motor )

Post by XperienS »

Alone Rotational limit and angular motors works very stable. But when i've tried to make car's wheel ( limit set to suspension axis and motor to motor axis ), model exploded.
Limits and Motors made as in Kenny Erleben paper.
What could be used for this problem?
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine

Post by Erin Catto »

If you are using an iterative solver, you will have problems with a heavy vehicle sitting on substantially lighter wheels. I suggest using a ray cast with a friction and suspension model instead of using a rigid body wheel.
XperienS
Posts: 34
Joined: Fri Nov 25, 2005 10:09 am

Post by XperienS »

I've tested configuration when wheel's mass and vehicle body's mass is identical ( 5 kg :) ) but problem stays. I think that for vehicle i'll need to use raycasting anyway, but that problem make my dreams bad :)
Problem actually looks like this: when vehicle just stays, it's stable. But when i'm powering motor, wheels rotates about motor axis ( i have it Vec3(1, 0, 0) in local coordinate space ) and the more that angle, the more unstable joint is...
If i'll remove limits on suspension axis ( Vec3(0, 1, 0) in lcs ), motors works just fine BUT wheels are rotating freely around suspension axis. Model is stable also if i'll remove motors ( car stays still and wheels are not rotated about suspension axis )...
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine

Post by Erin Catto »

Perhaps you need to clamp the maximum motor torque. It sounds like a complex joint type. You should make sure it works with a single rigid body connected to ground. Apply forces to it, test the limits, the motor, and so forth.
XperienS
Posts: 34
Joined: Fri Nov 25, 2005 10:09 am

Post by XperienS »

I've tested rotational limit as if vehicle's body is unmovable object... Even if i just add torque about steering axis limit is out of control and whole joint explodes... Motor - same effect. I don't understand why - limit is on (0, 1, 0) axis (suspension axis), but rotation of wheel is around (1, 0, 0) axis.. And so on - rotation limit works just perfect in other cases ( like limiting hinge joint for ragdolls to emulate elbows and kneesb limits )...