McPherson suspension

Nico65
Posts: 8
Joined: Mon Apr 14, 2008 1:48 pm

McPherson suspension

Post by Nico65 »

Hello

first of all sorry for my english, I'm trying my best

I'm trying to simulate a car chassis. McPherson suspensions should be the simpler to model so I decided to use it as a "benchmark" : model a car with a chassis, 4 wheels and 4 McPherson suspensions

I coudn't find anything on the Bullet library to simulate springs so I did it myself : spring are attached on two points (where force are applied) of rigid bodies (here arm & chassis) and push and pull on them according to the spring's size variation. Easy. I used hinge constraints for the arms and the wheel movements, works great

at the first glance it works fine, the spring are holding the chassis on the air and the arms are moving up & down nicely. But everything goes wrong when forces (other than gravity) are applied. I got some sort of "chain explosion" effect and my car dislocate. If a replace the springs by rigid bodies, it works perfect but it's not a suspension anymore. See what I mean ?

tested on Bullet 2.64 (I will try with 2.8 later), any help or advise is welcome ;)

edit : oh yeah I tried the RayCast vehicule, but it feels really weird...
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: McPherson suspension

Post by ola »

Hi,

maybe you could try adding a damper together with the spring? Bullet uses Euler integration for forces, so it is not accurate for simulating springs. For a car simulation you should probably add a damper sooner or later anyway.

When you use constraints, the masses of the bodies you connect shouldn't bee all to different. It might not work too well if you have a heavy car with light suspension parts. You can try to increase the mass of the suspension parts and see if that helps. I gave up modelling the suspension with constraints myself because of this and created my own wheel force generator that simulates the whole wheel and suspension instead. It uses raycasts and applies a force on the car chassis instead.

Also, make sure you are updating your force for every internal simulation step that Bullet does (60 times per second, normally). Recently Erwin added a callback function that you can use for this, I think. Another way to do this is to create your own derived class based on the bullet dynamics world class, I wrote about that here: http://www.bulletphysics.com/Bullet/php ... f=9&t=1570

Cheers,
Ola
Nico65
Posts: 8
Joined: Mon Apr 14, 2008 1:48 pm

Re: McPherson suspension

Post by Nico65 »

thanks
my pseudo-damper was simulated by a friction parameter of my spring
I tried with all object of the same mass, it's more stable but it still explodes
but what do you mean by a "wheel force generator" ?!
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: McPherson suspension

Post by ola »

By a "wheel force generator" i mean a function that calculates the proper force to apply on the car chassis. It simulates the whole wheel and suspension, including a tire friction model. So I use one of those for each wheel. It's a bit similar to what is done in Bullet's own vehicle model.

Cheers,
Ola