Archived

This topic is now archived and is closed to further replies.

d000hg

Integrator for suspension in a car.

Recommended Posts

Currently for my timestep I get the position+velocity of the suspension point at the start and end of the timestep assuming the spring does nothing. From those positions I work out how far the spring is compressed at both times and from the average find an impulse to apply. But obviously as the car is moving the effect of the spring means the position/velocity at the end of the timestep is not independent of the spring. It wors well for 0.01s timesteps but not larger. Since it''s at the corner of the car I can''t do a simple mass-spring system: any ideas?

Share this post


Link to post
Share on other sites
Well basically I''m modelling suspension as simple damped hooke''s law springs. The compression force is F=kx and the damping force F=cv (c,k are constants x,v are pos and vel - there are some minus signs somewhere too). Using the method already explained I get position of the atachment points at start/projected end of update and drop a vertical of lengthl=spring length. The depth this penetrates the ground generates x and the velocity in this direction is the z component of the velocity of the point on the car at the time. The car is treated as a box with a centre of mass and inertial tensor which the force calculated is applied to at the attachment points.

Share this post


Link to post
Share on other sites
I do it in a diff. way:
I handle spring force like any other force. I calculate it when integrating and simply apply it to the body. A don''t understand why you average. It''s a force like any other, no need to handle it diferently.

Share this post


Link to post
Share on other sites
In my update I take the force+torque applied to a body at the start of the timeStep as constant and integrate the rotation,position and velocities from this. My integrator doesn''t understand non-constant forces while the force from the suspension does change over time. If I just take the initial force on the suspension for the whole timeStep it''s not as good (like using x+=v.dt instead of x+=v.dt+ 1/2.a.dt.dt) so I''m doing a very approximate integral kind of

Share this post


Link to post
Share on other sites