• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
vadevaman

How to make a stable car physics?

24 posts in this topic

Hello,

Well, I'm currently confused on how to achieve a stable simulation. My current simulation is good in terms of driveline, suspension and tires.
It works good with Joysticks and keyboard. But what I noticed is that when I use a ffb wheel, I notice that after a heavy braking the car wants to spin out. And I cant seem to recover. The car setup is a FR drivetrain, with a weight balance of 52/48

 

I use a raycast method for the whole wheel/suspension setup.
I use the calcualted suspension force as the load for the wheel.

I calculate the SlipAngle and SlipRatio the SAE950311 algorithm(with relaxations).
Tho I have to localize the tanSlipAngle and differentialRatio variables, otherwise the car will start springing around on bare ground, mostly caused by slip ratio.

 

The tiremodel I'm using is Pacejka89 + Beckman combined slip model.
I add the tire forces to 4 points of the car (mainly the wheel position + rollcenter offset (I dont know if this is correct, but it seems to make the simulation a little more realistic)

So lately I was looking into another method, that seemed to work better under braking.

Applying forces and torque directly do the body depending on the cg position + roll center positions (as jacking)

But this method seems to not entirely like my wheel load method (because of bumpstops and antirol bar calcs, I have to disable them to get it working) Also at low speed, it seems like this method wants to float sideways.

So I finally decided to come here and ask for some help. How are you guys initialising vechicles these days Do you apply forces to 4 points of the rigid body? Or do you apply the forces & torque directly do the body?
And how to calculate the wheel loads / weight transfer if usuing the cgOriented method?

Also about roll centers, where to use them exactly if I'm using the 4 point method?

 

Any help would be apriciated!

Thanks for your time

0

Share this post


Link to post
Share on other sites

Hi, we are doing pretty much the same, simulation wise smile.png

I was also playing with jacking forces and roll centers but the whole thing proven to be much better without them.

Probably because my not so proper suspension geometry and here would the "super-knowledge-of-setting-up-a-race-car" come handy. Calculating upan a bad setup .... hmm smile.png

 

I apply every forces (tire/aero..etc) on the body.

 

Quick cheats you may try;

1. Lower the CG a bit (not much, centimeters, or inches maybe smile.png )

2. Use stiffer suspensions at the front

3. Check the brake bias, rear wheels should not lock prior to fronts

 

Also make sure your rear wheels touch the groundwhen braking. I had issues with suspension and tire movements (oscillations), and big pitch torques made the rear wheels pop up from ground. So I'm using some threshold, the tires don't lose traction at once when they lift off.

 

Hope some of these help.

Edited by bmarci
0

Share this post


Link to post
Share on other sites

Thanks for the reply, this is exactly what I have done to get stability but, this results in Forza like cars.
You know, behaving correctly, but theres minimal bodyroll and the simulation doesnt seem soo real visually.

I mean when you are going fast, and brake hard the car will introduce bodyroll even with stiff suspesnsion. This is the real behaviour of a car, you can see this sort of behaviour in nfs shift and rfactor. For example a car produces 800nm of torque and has a coilover set of like 80kNm at front and 70kNm at back. At launch and braking you will see the weight transfer, body pitch?.

Anyway I have seen some videos of your sim and its quite impressive. But I have a question, the head movement inside the car, is it caused by G's, like in shift or do you have that bodyroll aswell?


..oh and are you using rays or 5 rigid bodys?

Edited by vadevaman
0

Share this post


Link to post
Share on other sites

Where are you applying the suspension spring forces? at the contact patch or the wheel hub?

 

Edit: I have only fiddled around a little bit with vehicle physics, so I'm no pro at that, at all. But I have found that applying the forces not at the contact point, but a little higher up has resulted in a much more stable and believable car model, even if it might not be realistic.

Edited by Madhed
0

Share this post


Link to post
Share on other sites


I mean when you are going fast, and brake hard the car will introduce bodyroll even with stiff suspesnsion. This is the real behaviour of a car, you can see this sort of behaviour in nfs shift and rfactor. For example a car produces 800nm of torque and has a coilover set of like 80kNm at front and 70kNm at back. At launch and braking you will see the weight transfer, body pitch?

My "race suspension" has a spring rate betwen 55 and 70kNm.

And can see the body pitch (more visible outside) even when shifting.

The "F1 suspension" has 120kNm, so not too many visible body movements.

 


Anyway I have seen some videos of your sim and its quite impressive. But I have a question, the head movement inside the car, is it caused by G's, like in shift or do you have that bodyroll aswell?

..oh and are you using rays or 5 rigid bodys?

 

Thanks! :)

 

The head movement is caused by G's and some speed related random shake. Could be done with a spring, though :)

And I'm using only one rigid body and 4 rays, but "multisampling", so technically 12 rays, and the actual ground position is aproximated with some bezier stuff.

 

I've just read something about suspensions' anti-pitch properties, but I don't realy have the idea how to code that yet. Not sure if I even need it :)

0

Share this post


Link to post
Share on other sites


Where are you applying the suspension spring forces? at the contact patch or the wheel hub?

I'm applying the forces to wheel hub minus a correction factor(wich I call rollcenter at the moment, but obviously is false), so front wheels have their forces applyed lower than ground patch and rear wheels higher on Y axis.

 


And I'm using only one rigid body and 4 rays, but "multisampling", so technically 12 rays, and the actual ground position is aproximated with some bezier stuff.

Hmm what do you mean by multisampling exactly? And the ground position bezier stuff... as I understand is some sort of a blend between tris, to get a smooth ground right? Like in Racer where there is a road spline mesh to get that smoothness.

Anyway, what are your typical brake friction torques and how much of pressure do you but on them and is there some sort of damping done aswell?
For my example car I use braking torque of 1350 at front and 950 at back.

The overall braking im doing like this (per wheel):

brakingTorque = brakingFrictionTorque * brakePressure; // brakepressure is user input in a range of 0 to 1
brakingAngularDelta = brakingTorque * dT / totalInertia;

 

And the angularVelocity(omega) implementation for braking

if (Abs(omega) > brakingAngularDelta)       
    omega -= Sign(omega) * brakingAngularDelta;

else

    omega = 0;

Everything seems to be ok codewise but this oversteering issue is getting on my nerves.

 

Also what do you use as your wheel load? Total suspension forces or do you do some weight transfer calculations depending on the G's?
And do you add some lowspeed friction forces to your car aswell?

Seems like my car wants to slide to somewehere, even if the force is 0, ...actually this is somewhat logical codewise because there is no forces that should be resisting the movement. I'm thinking of using slip velocityes for low speed friction modeling...

0

Share this post


Link to post
Share on other sites


Hmm what do you mean by multisampling exactly? And the ground position bezier stuff... as I understand is some sort of a blend between tris, to get a smooth ground right? Like in Racer where there is a road spline mesh to get that smoothness.

 

That's right, I make 3 ray-casts for each wheel. The rays' distances depend on the speed. And between the 3 intersections I fit a curve.

 

MSPaint forever: :)

ground_bezier.jpg

I use the red dots (intersection points) as the control points for the bezier curve. So I just load a "polygon soup" and voila no need to create a spline mesh for the track. Works nicely on banked curves too.

 


Anyway, what are your typical brake friction torques and how much of pressure do you but on them and is there some sort of damping done aswell?
For my example car I use braking torque of 1350 at front and 950 at back.

 

Now I use 2500Nm maximum brake torque 50:50 works well, probably because the low CG.

I'm in a middle of rewriting the whole driveline since it's a big magic, nothing to do with physics :)

 


Also what do you use as your wheel load? Total suspension forces or do you do some weight transfer calculations depending on the G's?

Total suspension forces and tire forces when there is no more spring.

 

I have a concern about suspension's anti-pitch because in this case the weight is transferred through suspension links instead of the spring. So in my interpretation the tire deflates more than the spring. Not sure though.

 


Seems like my car wants to slide to somewehere, even if the force is 0, ...actually this is somewhat logical codewise because there is no forces that should be resisting the movement. I'm thinking of using slip velocityes for low speed friction modeling...

 

Also just an idea:

It might be because of the relaxation length, since the tires don't "react" instantly to the slip angles/ratios.

This effect will be even worse if you use camber/toe in.

0

Share this post


Link to post
Share on other sites

Hmm your method actually looks pretty cool. And one of my friend does something simmilar actually :) I personaly stick with the single ray per wheel at the moment.


Total suspension forces and tire forces when there is no more spring.

What does your suspension force consist? Mine is spring + damper + antiroll. When bumpstop is reached I switch the spring and damper forces. I dont use tire deflection forces at the moment, because I want to sort out the instability issue first.


It might be because of the relaxation length


Could you tell me how you calculate your slip angle and slip ratio? because when I try changing the relaxation lengths all sorts of crazy stuff happen when the tanSlipAngle and differentialSlipRatio are global variables. When they are local variables (in method) things stabilize a a bit but it's still quite strange.

Also I dont want to complicate things with camber/toe at the moment. I just want to get the simulation stable at first.
0

Share this post


Link to post
Share on other sites


What does your suspension force consist? Mine is spring + damper + antiroll

The suspension forces are all those you mentioned, but the load is spring only (k*x).

 

Take a 50kNm spring rate. That means 50000N force is needed to shrink the spring by one meter.

So if your spring is depressed by 1cm (x=0.01, actually -0.01 when shrinking) it means the spring is being pressed by 500N force, that is the force pushing the wheels down.

 

 

I use the normal slip angle/ratio calculations. For low speed slip ratio I'm working on an alternative method which is similar to SAE950311. It works so far but not sure if it will with the new driveline sim.

 


Could you tell me how you calculate your slip angle and slip ratio? because when I try changing the relaxation lengths all sorts of crazy stuff happen when the tanSlipAngle and differentialSlipRatio are global variables. When they are local variables (in method) things stabilize a a bit but it's still quite strange.

In case of global var, is it possible you have tanSlipAngle instead of tanSlipAngle[4]  ?? ;)

0

Share this post


Link to post
Share on other sites


In case of global var, is it possible you have tanSlipAngle instead of tanSlipAngle[4] ?? ;)


Well, I have a tanSlipAngle per wheel clas, so no I dont have them in an array. Basically whay happens is that the car starts jerking left to right and gains speed, its like I need to reset the value, this is why I use it as a local variable and set it to zero at initialization. The same goes with slip ratio.

I wish it were 2004 when there were al lsorts of private sim projects and sourcecodes to learn from. I remember some demos made with newton physics engine but they are all gone now. :(

Currently Im doing some tests on 5 rigidbody methods, trying to see if there is some stability in this method.
0

Share this post


Link to post
Share on other sites


Basically whay happens is that the car starts jerking left to right and gains speed, its like I need to reset the value, this is why I use it as a local variable and set it to zero at initialization. The same goes with slip ratio.

 

You can abandon slip angle relaxation, since it doesn't affect wheel rotation. It'll oscillate but you won't see it,

At least you'll see if the problem is in there :)

 


I wish it were 2004 when there were al lsorts of private sim projects and sourcecodes to learn from. I remember some demos made with newton physics engine but they are all gone now.

Ohh, yes, good old days.

I think the source of an early version of Racer is still available.

Also you may want to check out REC.AUTOS.SIMULATORS google group, and search for "Car Physics". Lots of interesting topics :)

0

Share this post


Link to post
Share on other sites


You can abandon slip angle relaxation, since it doesn't affect wheel rotation

 

Well if I abandon it and use the regular slipangle formula then there is alot more jerking. This is why I started using the SAE method.

As for racer, this is the game that inspired me to do my own sim stuff back in the day and I have learned alot fro mracers old source, tho it has some pretty messy code, but its a pleasure t ostill have it online.
And yeah I have been at the gropu but totally forgot it. Thanks for reminding it!


As for the sim itself, I switched back to spring force only ( I used to use it but for some reason started using the total suspension force) Ad everything seems to work far better now. Was able to drift the car with ease. Dunno why I made such a change before. Thanks for pointing this out.

0

Share this post


Link to post
Share on other sites


Well if I abandon it and use the regular slipangle formula then there is alot more jerking. This is why I started using the SAE method.

Yes, much more, but should not be seen :) The wheels constantly get like (Fy) +1000N, -1000N, +1000N, -1000N ... and at the end of the simulation step they will remain at the same spot.

 


As for racer, this is the game that inspired me to do my own sim stuff back in the day and I have learned alot fro mracers old source, tho it has some pretty messy code, but its a pleasure t ostill have it online.

Me too, but unfortunately when it first came out around 2001, I didn't understand the first thing from it, I wasn't "smart" enough, physics wise. Reading the the "Physics of Racing Series", packed with funny units like, foot-pounds and slugs, didn't help too much either :D So I just dropped the topic..

 


And yeah I have been at the gropu but totally forgot it. Thanks for reminding it!

Lucky you, I haven't even head of it until maybe a year ago :)

 

Anyway, maybe you could help me too;

As I mentioned I'm rewriting the whole driveline and the torque transfer is not getting to work. Especially with inertias and accelerations.

 

What I achieved so far.

The whole driveline has 2 states: The clutch is locked or not.

1:

If locked, the output torque is calculated down to each wheels (only locked diff for now)

The wheels are accelerated with their inertia (not effective)

Based on the wheels angular velocity I calculate the engine speed.

The clutch has a maximum torque that it can transfer based on the pedal (clutch_factor)

If the torques going through the clutch exceed the maximum, it gets unlocked.

2:

The clutch is slipping, the output torque accelerates the flywheel with the effective inertia (engine to wheel)

Transfer the torque to the wheels and accelerate them with their self inertia as with locked clutch.

All the torques from engine and back from the wheels are clamped to the current max clutch torque (see above)

Also while the clutch is not locked both parts get the clutch torque to reduce the difference in angular velocities.

Once the velocity difference (engine/gearbox) switches sign, the clutch is locked again

 

Probably this is the method we all use, but:

Not sure where should I use effective inertias and where not, and which?

For example at the wheel

wheel_acc=(T_Drive+T_Road_reaction+T_Brake) / Inertia

 

this is the method that seems to work, but where is the inertia from the wheel to the engine

If I make it like:

 

acc=(T_Drive+T_Road_Reaction) / Inertia_engine_to_wheel;

anv_vel+=acc*dt;

 

acc=T_Brake / Inertia_wheel_to_engine;

ang_vel+=acc*dt;

 

It "sucks" big time, so to say... I have pain keeping the car on the road even moving straight.

Calculating the t_road_reaction with t_brake even worse.

 

I don't have a clue yet, just trying different variations hoping for any of them will work. wacko.png

0

Share this post


Link to post
Share on other sites

Yes, much more, but should not be seen smile.png The wheels constantly get like (Fy) +1000N, -1000N, +1000N, -1000N ... and at the end of the simulation step they will remain at the same spot.

 

Thats what I thought, but the force seems to be constant to one side with sae formula, like -100N per wheel.
If I use the standard formula then there is jerking because of the small ocalisions I guess, the slip angle at rest is jumping from -10 deg to 10 deg (just example values) If I cut the longitudinal speed to 0 at some low speed value then there still is that jerking. Dunno what Im doing wrong.
 

 


Me too, but unfortunately when it first came out around 2001, I didn't understand the first thing from it, I wasn't "smart" enough, physics wise. Reading the the "Physics of Racing Series", packed with funny units like, foot-pounds and slugs, didn't help too much either biggrin.png So I just dropped the topic..

 


Exactly the same to me biggrin.png and I started my coding with Blitz3d even made a small demo to racesimcentral biggrin.png
Now I have steped my game into c# and c++ world

 

 

 


Anyway, maybe you could help me too;

 

Sure thing smile.png
First of all, if you are using the common method of angular velocity simulation that counts in road torque, drive torque, braking torque.

As I found out then You cant simulate locked diff's with ease, the simplest Differentials you will simulate are open Differentials.
As I understand by locked you are doing this:
leftWheel = driveTorqueFromDriveline * 0.5f;
rightWheel = driveTorqueFromDriveline * 0.5f;

This Is the simplest differential you can model, but it will simulate open differentials.

Sure if you initialise wheels with a if sentence you can do locked differentials, but I'm not sure if its the way to use.

This is what I had in mind(in your wheel class):
if(driveTorque=0)

   angularVelocity -= rollingAngularDelta:

 

This simply makes sure that there is no rolling torque applyed when there is driving torque. But id go for the first method and simulate open differentials at start and then advance to a locked differential through some modifications that read roling torque from the wheels, so you can easly simulate LSD differentials this way smile.png I havent done this myself yet, but I am using viscous lsd differentials (simplest diffs you can make with the firstly Described wheel code)
It goes something like this (writing from memory):
speedDifferene=leftSpeed-rightSpeed;
leftWheel = (driveTorqueFromDriveline - speedDifferene*lockingTorque) * 0.5f;
rightWheel = (driveTorqueFromDriveline + speedDifferene*lockingTorque) 0.5f;

 

I know it wasnt what you asked but As for the driveline, I'll write you a PM about this (have to go right now).

Edited by vadevaman
0

Share this post


Link to post
Share on other sites

Thats what I thought, but the force seems to be constant to one side with sae formula, like -100N per wheel.

One more thing that I just realized a couple of months ago:

It happened to me that I started tweaking the tire curve so it fitted my needs and later realized it wasn't symmetric any more.

Why is that important?

In your situation when the wheel produces +90/-90 slip angles the tire formula returns different forces.

This is basically true for any slip angles:  Pacejke(SA=10).Fy != Pacejka(SA=-10).Fy

This causes your car to turn better left than right or vice versa, also it could start sliding one direction when stopped.

 

So I came up with the idea of flipping the curve depending on the side of the car. Left tires use the standard calculations and the right side negates the inputs and so the outputs.

 

In case of a right side tire:

In Pacejka calculation:

SA=-SA

Calculate as usual

Fy=-Fy

Mz=-Mz

 

 

 

 

 


This Is the simplest differential you can model, but it will simulate open differentials.

Hmmm this makes sense, as I'm checking the code there is nothing that prevents the wheels from accelerate away from each other.

 

 

 

 


Sure if you initialise wheels with a if sentence you can do locked differentials, but I'm not sure if its the way to use.
This is what I had in mind(in your wheel class):
if(driveTorque=0)
   angularVelocity -= rollingAngularDelta:
 
This simply makes sure that there is no rolling torque applyed when there is driving torque. But id go for the first method and simulate open differentials at start and then advance to a locked differential through some modifications that read roling torque from the wheels, so

 

And how about accelerating the output parts of the diff instead of the wheels? Thus locked diff could be made easily.

Edited by bmarci
0

Share this post


Link to post
Share on other sites


The suspension forces are all those you mentioned, but the load is spring only (k*x).

I was browsing my code yesterday, and I'd correct myself:

 

I have a separate mass for the car body and for the wheels.

So my tire load is the suspension force (see above) and I add the force that the wheel generates due to gravity.

Transform the gravity vector (probably 0,-9.81,0) to the tire space and add the vertical component to the suspension force (k*x)

0

Share this post


Link to post
Share on other sites


Transform the gravity vector (probably 0,-9.81,0) to the tire space and add the vertical component to the suspension force (k*x)


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

Also I corrected my pacejka combining method, and now my slip angle and ratio calculations produce a bit better values(without relaaxation lengths). But I still have to use some damping values, otherwise id run into some numerical occlisions causing the car to jitter alot.

Heres some code:

w=tireVelocity;
u=lonVelocity;
v=latVelocity;

damping = Clamp01( localVelocityMagnitude/ 4.0f );
slipRatio = (w - u) / Abs(u) * damping;
slipAngle = Atan(v/Abs(u)) * damping;

This works quite ok, but the car is still slightly sliding forwards and to the right. Looking at the telemetry I see this:

(wheels: front left, front right, rear left, rear right)
->First frame:
         sr: -0.02, -0.02, -0.02, -0.02
         sa: -0.02, 0.02, 0.02, -0.02
         Fz: 2112.88, 2112.87, 1944.72, 1944.72
         Lon: -1228.94, -1228.93, -1146.63, -1146.62
         Lat: 13.24, -13.24, -11.57, 11.59

->Second frame:

         sr: 0.01, 0.01, 0.01, 0.01
         sa: 0.01, -0.01, -0.01, 0.01
         Fz: 2127.98, 2127.97, 1929.89, 1929.89
         Lon: 1220.38, 1220.37, 1112.45, 1112.45
         Lat: -13.13, 13.13, 11.17, -11.18
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)
But the second frame looks to be half of it (dunno if there is any sense) But this I guess is causing the movement, if the jump would be from -0.02 to 0.02 the car would not move from its position.

 

But the secodn thing is that if the road is angled, the car starts to slide. If I use the method described here (the sae damping) for low speeds the slip ratio gets better, but still jumps a little. When I use the lateral version I get some strange springi action after a stop in sideways (example a drift fail etc.).

 

So is there a cure for this behaviour?

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?

0

Share this post


Link to post
Share on other sites


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... :)

0

Share this post


Link to post
Share on other sites


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


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.

How are you calculating your suspension compression? Is it normalized or in it's range, because when I normalize it (from range of 0 to 1) I get to stiff suspension with 50k springs... Also as for dampers, are you calculating the velocity over time like (compression-lastcompression)/timestep?

Currently I'm applying all the force to the contact patch position so I can get some bodyroll with realistic cg heights. Will try applying suspensions force at the spring connection position, see if something changes or not, 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..

0

Share this post


Link to post
Share on other sites


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.

0

Share this post


Link to post
Share on other sites


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.

0

Share this post


Link to post
Share on other sites


Do you use any physics middleware??

Indeed I am using PhysX and I can change the physics timestep. wich is the speed. So t his is not the problem, its just heavyer on the CPU with smaller timesteps (0.002 is 500hz).
But the simulation actually seems stable at 50hz with stiff suspension. But with softer suspension it gets quite hard to drive. Visually it looks better, but handling is awfull. Maybe its the slip combination...
0

Share this post


Link to post
Share on other sites


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...

0

Share this post


Link to post
Share on other sites

Figured out that I was decresing the load with positive gravity while applying mass, fliped the sign and loads got much better, so did the handling, but now I'm back to low speed friction, since it seems like slip angles are now jumping from ~50 deg to -50 deg. Probably becuse the velocityes are to small for longitudinal and lateral sides. Need a way to damp them down and this seems to be the hardest topic in vechicle simulation. I can do the sim at 1000hz and with SAE method, but there stil lseems to be some jerking wich I dont like. I have seen in games that a car can come to a complete stop with a simulation thats running at 50hz, this is what Im trying to achieve now. Because I noticed that my driveline works also better in 50hz, 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. Maybe I need to design a new clutch instead... but anyways I got the handling fixed I guess and with cars like 300nm the simulation ins quite stable at 1000hz :)

0

Share this post


Link to post
Share on other sites

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? :)
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0