I have some questions about the Generic6DofSpring2Constraint too.
The used bullet version is 2.83.4, and I'm testing a mass-spring-mass system to find the parameter unit.
The current parameters are:
MLCP Dantzig solver @ 1000Hz stepTime(interpole) + @60Hz stepTime(internal default)
RigidBody 1 (top) mass 1kg, fixed position.
RigidBody 2 (bottom) mass 1kg, only connected to the spring.
Spring, setup using Generic6DofSpring2Constraint, connect body1 and body2, allow to move only in the vertical direction.
movable range = 0.3;
stiffness = 500.0;// variable
damping = 0.1;
erp, cfm = 0.1;
However, no matter what the stiffness is, the vibrate frequency doesn't change much.
I've tested stiffness=500, 5000, 50000, 500000...50000000, and the vibrate frequency are about 2.77Hz ~ 3Hz accordingly.
What's the stiffness unit of the constraint?
Another phenomenon happens when the mass ratio between body1 and body2 is large.
ex: body1=50kg, body2=0.01kg, stiffness = 50000.0, damping = 0.1;
The spring seems to accumulate energy as the mass-spring-mass system is dropped to the ground.
And the system jump higher and higher...
that's doesn't make sense. It should at least maintain in the same level.
The system will be stable when the mass ratio is small enough.
ex:
body1=50kg and body2=0.05kg, the system will keep jump to the same height.
body1=50kg and body2=0.5kg, the jump height is decreasing and go to rest.
And ideas?
----------------------------------------------------------
Update:
Previously I was using stepSimulation(stepTime); // stepTime = 0.001s, internalTimeStep = 1/60s
I've tested using stepSimulation(stepTime, 0); // stepTime = 0.001s, no internalTimeStep
And the Generic6DofSpring2Constraint behavior is close to a real spring, but somehow unstable. Higher stiffness makes a stiffer spring.
l'm still wondering the metric unit of stiffness...
It looks like a step frequency(no internalTimeStep) of 200Hz or even higher is necessary to simulate a good spring characteristic...