- #1
newlife
- 13
- 0
Hello everybody,
Im trying to model a system made by a suspension and a tire for a vehicle simulator written in c#.
I modeled both the suspension and the tire as a spring and a damper.
So the model is formed by a spring and a damper in parallel (the suspension) in series with another spring and a damper (the tire).
This is a simple scheme:
http://unitypackages.net/spring_damper.png
I modeled the system in this way:
I throw a ray from the point where the suspension is connected to the vehicle towards the ground with length = suspension travel + wheel radius.
If the ray touches the ground, suspension compression is calculated in this way:
compression = suspensionTravel - (rayLength - radiusLoaded);
suspension force is:
springForce = suspensionRate*compression;
suspension damper force is:
damperForce = (damperVelocity - tireDeflectionVelocity)*damperRate;
with damperVelocity:
damperVelocity=(compression-lastCompression)/deltaTime;
total suspension force is springForce+damperForce.
For what concern the tire:
tireDeflection = (suspensionRate*compression)/verticalTireStiffness;
tireForce=verticalTireStiffness*tireDeflection;
damperForce = tireDeflectionVelocity * tireDamping;
with tireDeflectionVelocity:
tireDeflectionVelocity=(tireDeflection - lastTireDeflection)/deltaTime;
total tire force is tireForce+damperForce.
radiusLoaded=maxRadius - tireDeflection;
Everything works like it should, apart when suspensionRate is > verticalTireStiffness (it may happen when suspension is very stiff and tire is low inflated). In this case the system explode, in the sense that wheels shakes violently.
Is there a way to avoid this issue? I tested even with a very small timestep but it seems its not a problem of large timestep.
Sources:
https://docs.google.com/viewer?a=v&...jK471r&sig=AHIEtbSih5uKFNJzLgXZjBH1wFwQ6L93qQ
https://www.physicsforums.com/showthread.php?t=225036
Im trying to model a system made by a suspension and a tire for a vehicle simulator written in c#.
I modeled both the suspension and the tire as a spring and a damper.
So the model is formed by a spring and a damper in parallel (the suspension) in series with another spring and a damper (the tire).
This is a simple scheme:
http://unitypackages.net/spring_damper.png
I modeled the system in this way:
I throw a ray from the point where the suspension is connected to the vehicle towards the ground with length = suspension travel + wheel radius.
If the ray touches the ground, suspension compression is calculated in this way:
compression = suspensionTravel - (rayLength - radiusLoaded);
suspension force is:
springForce = suspensionRate*compression;
suspension damper force is:
damperForce = (damperVelocity - tireDeflectionVelocity)*damperRate;
with damperVelocity:
damperVelocity=(compression-lastCompression)/deltaTime;
total suspension force is springForce+damperForce.
For what concern the tire:
tireDeflection = (suspensionRate*compression)/verticalTireStiffness;
tireForce=verticalTireStiffness*tireDeflection;
damperForce = tireDeflectionVelocity * tireDamping;
with tireDeflectionVelocity:
tireDeflectionVelocity=(tireDeflection - lastTireDeflection)/deltaTime;
total tire force is tireForce+damperForce.
radiusLoaded=maxRadius - tireDeflection;
Everything works like it should, apart when suspensionRate is > verticalTireStiffness (it may happen when suspension is very stiff and tire is low inflated). In this case the system explode, in the sense that wheels shakes violently.
Is there a way to avoid this issue? I tested even with a very small timestep but it seems its not a problem of large timestep.
Sources:
https://docs.google.com/viewer?a=v&...jK471r&sig=AHIEtbSih5uKFNJzLgXZjBH1wFwQ6L93qQ
https://www.physicsforums.com/showthread.php?t=225036
Last edited by a moderator: