Jump to content

  • Log In with Google      Sign In   
  • Create Account


bmarci

Member Since 05 Jul 2002
Offline Last Active Jul 15 2014 04:23 PM
-----

Posts I've Made

In Topic: How to make a stable car physics?

14 February 2014 - 01:36 PM

with 1000hz I get some nasty angular velocity flicks when the car is powerfull (lets say 700nm at peak engine rpm) Its causing the clutch to disengage and do some funny things

yes this flickering is also present in mine. I suspect, it's because the tire slip ratio flickers, those huge reaction torques go back to the engine. I still have issues with the driveline especially with powerful engine ~400Nm.
But meanwhile I managed to improve my tire, and it's now much better over rumblestrips and bumps.
Here are some experiences;
Now I handle the wheel as a separate object (only logical means) and apply separate forces to that. Also I use an other spring representing the rubber. So that spring force is pushing the wheel hub upwards and the gravity and the suspension is pushing it downwards. This generates the movement of the wheel hub as well the suspension spring's. The fx and fy forces are applied at the contact patch and the suspension spring force is at the attach position.
The fy should be applied at various places, though to have proper lateral jacking, but for now this is still satisfying.
An other thing that proven to be important was the tire damping. Some articles mention 500N/m/s, but i'd go for 5000. Maybe I'm overcomplicating it but using variable damping produced the best result. That means, the damping changes as the tire deflects.
Still thinking on surface related camber. It would make sense to change the camber depending on the tire orientation with regard to the ground. But the old pacejka (89) is not designed for motorcycles so not good with high camber values.

Answers generate more questions... will this ever end? :)

In Topic: How to make a stable car physics?

11 February 2014 - 06:25 AM


Visually it looks better, but handling is awfull. Maybe its the slip combination...

 

You can try increasing the lateral grip for the rear wheels. The a2 coeff in pacejka. Sport/race cars have wider tires at rear anyway :)

No too much help, but maybe...


In Topic: How to make a stable car physics?

06 February 2014 - 06:24 AM


This is strange, because when I go from a fixed timestep of 0.02 to 0.002, a 500hz simulation (1/0.002) I get a pretty bouncy suspension with 50k springs.

I think I might know what your problem could be.

 

Do you use any physics middleware??

If so, we have a catch 22 situation here :)

 

Physics engines, like Bullet, Havok, Newton, whaterever, updates at 60Hz.

If you crank up your simulation speed to let's say 300Hz, it means the the car dynamics is updated 5times more frequently than the rigid body physics itself.

Let's see an example:

 

1. step, the suspension and tire generate 2000N force that pushes the chassis upwards. You call, PhysicsEngine->body->ApplyForceAtPosition()..

2. step, The rigid body is not updated because it's time has not came yet, so you update the car again, 2000N force added to the rigid body again...

.

.

.

5. step, the car update has ran 5 times added 10000N force to the body so far

6. step, The physics engine gets updated and all the accumulated forces act on the car's body. Probable 5times more that actually needed.

 

Either you can divide the calculated forces upon the ratio of "physics:dynamics". So AppliedForce=TotalForce*60/300;

The problem with that is if your car's body is updated at only 60Hz, and your calculations depend on the car's body, you don't gain anything with using smaller timesteps, but 50Hz is clearly not enough for a 50KN/m suspension.


In Topic: How to make a stable car physics?

05 February 2014 - 12:11 PM


How are you calculating your suspension compression? Is it normalized or in it's range,

No, I use it as a length of compression in meters.

 


Also as for dampers, are you calculating the velocity over time like (compression-lastcompression)/timestep?

Exactly.

 


one thing I'm thinking of is to angle the force towards tire contact patch to get some sort of physically correct feedback with it, dunno if it would work like i'm thinking hehe..

First I just simply made a "spring" with damper, only one, that I dropped from 2-3 meters. No side forces, just vertical spring on a flat ground, and see how does it behave.

It is at least good to see the suspension in controlled envitonment.

A simple vertical model should work fine, adding angle to it just makes it more "difficult" because the forces don't neccesarily act along that axis, at least not at the contact point.


In Topic: How to make a stable car physics?

04 February 2014 - 03:00 PM


So it would be like:
weight = 20 * 9.81;
load = suspSpringForce + weight;
Right?

Basically yes, but the "weight" vector can change depending on the wheel orientation, eg: on sloped surface it's smaller.

 


As I notice the jumping in sr and sa is about 0.02 in the first frame, its exactly the same as my simulation deltaTime (50hz)

Uhh-Uhh,

The 50Hz seems quite a big timestep, especially for stiff suspensions and tire. I'd suggest 500-1000Hz :)

 


Also, bmarci, Are you applying suspensiopn froces in world cordinates or car/wheel cordinates? As I understand suspension forces should be applyed in world cordinates, am I right?

Yes, I apply every forces in world space but calculate them in their own, tire forces in tire space...etc

If your physics engine supports eg: body->ApplyForceInBodySpace() you can use that and you save some tansformation since some of the forces are already in body space.

 

You can apply the suspension force at the attachment point at first.

It's an interesting topic because not all forces are applied at the contact point. And depending on the suspension geometry different forces act on the various suspension links, and this is the point where you get nowhere with your super formulas without exact knowledge of race car suspension setups.

So my rule of thumb is, simplify, simplify, simplify... :)


PARTNERS