Car Simulation Headaches Part_#2

Started by
20 comments, last by bmarci 11 years, 6 months ago

As i understand it, when wheels are centered, the lateral response will be perpendicular to wheels, and will then slow down car rotation, but it will not introduce longitudinal force. The longitudinal force component present on the wheel during spinning will just introduce a diffrent slip angle result.

I would argue with that. In your post #6, the blue arrow IS the real velocity of the tyre, which is perpendicular to the vector from CG to wheel pos, but not to the wheel's heading.
So it WILL generate both long/lat forces. If you do the same calculations for the remaining 3 wheels the sum of all Fx's will be zero if the CG is at the center of the car, so that's why there is no movement of the car body.


I re-checked marcos page for the steering section. He claims, after determining lateral force using pacejka curve, that they have to be applied to the car body. He will apply both lateral forces directly to car body, and then use them separatly to calculate torque and finally introduce some yaw. Fine for me, but what does he have to say about the lateral component of the front wheels ?


Since Marco is using only two wheels (front/back) his lateral forces are always tangential to "yawing circle", with centered wheels. If you are thinking in more wheels, this is mostly not the case.

What worked for me is:
1. Calculate long/lat forces for each wheel and create a force vector of them, VForce = {lat_force , long_force} in WHEEL space
2. Transform VForce to the WORLD space (as an ordinary 2d verctor) and add them together for all wheels (so you have a total 2D force vector acting on the car body)
3. Using the Car's mass you will get the acceleration and thus the velocity in WORLD space. acc=ForceTotal/Mass
4. For rotation, transform the VForce to CAR space, and -here comes the tricky part- split the VForce_InCarSpace vector into 2 components. One is perpendicular to the (CG->WHEEL) vector and the other one is parallel
5. You'll need the one that is perpendicular, get some idea from here: http://en.wikipedia.org/wiki/Vector_projection
6. Multiply the resulting force component by the wheel distance from CG and you get the torque that the wheel aplies to the body around the CG
7. Sum all torques and with ang_acc=TorqueTotal/BodyInertia you get the yaw angle acceleration of the car body


Do you know if traction circle should be applied before or after taking count of weight load ? Because when i slow down the car in/before curves, so much weight get transfered to the front that the lateral force increase happens way too fast and the car can make an half-turn really easily. I feel like traction circle should be capped at some maximum load or maybe my weight transfer needs a real spring instead of a simplistic time integration of the weight transfer.


The weight load is an input parameter to the tyre model as well as slip ratio and slip angle, if you want to cap the result to the limit you have two options (I've found so far)
1. The most typical way is to cut down the resulting forces (Fx/Fy), you can perform single vector scaling or prefer one over the other (eg: use all the long_force and use as much from lateral as much remained in the traction budget)
2. The other one that works me the best is to cut down the input parameters (slip angle/slip ratio) See chapter 24/25 of PHORS.
Advertisement
"
I would argue with that. In your post #6, the blue arrow IS the real velocity of the tyre, which is perpendicular to the vector from CG to wheel pos, but not to the wheel's heading.
So it WILL generate both long/lat forces. If you do the same calculations for the remaining 3 wheels the sum of all Fx's will be zero if the CG is at the center of the car, so that's why there is no movement of the car body.
"

Thanks for the explanation Bmarci. smile.png

I see there were flaws in my understanding.

I was assuming that a stationary car spinning on the spot has zero linear velocities and as a result no slip angles could be generated.

But in fact, you show that although the car chassis has no linear velocites, the wheels actually do and therefore the slip angles can be calculated whilst ignoring the angular velocity of the chassis.

Sorry for any confusion pochypoch.
Hi again !

Thank you so much for your detailed answers. I reinvestigated and rechecked every thing you said to me since the beginning, and each time i gain confidence on the fact i'm going the right way, so thanks again. It is very good to be able to say "now i dont have a doubt on the way i do this, anymore, so lets move on" smile.png

@bmarci
Thanks for explaining so clearly. I tried your method over mine (i calculate force/torque for each wheel right away rather than summing), but as expected it gives me the exacts same results. So i guess my calculations must be good there.
I would argue with that. In your post #6, the blue arrow IS the real velocity of the tyre, which is perpendicular to the vector from CG to wheel pos, but not to the wheel's heading.
So it WILL generate both long/lat forces.[/quote]
I agree, but i deactivated slip ratio, wheel angular vels around axle and any braking/acceleration force to simplify my steering behaviour research. I just apply 1*weightLoadOfCar/4 to the powered wheels for the moment. So in my case it will be only lateral forces generated right ?

@both
Thank you for explaining your way of using traction circle. I personnaly was ploting my curves for a normal load, applying traction circle (by croping excedent force) and then multiply by the load. The final result should be the same, but anyway i deactivated this feature right now.

I think i really need your expertise to help me search the right way, because all the maths and physics we reviewed together seems ok everywhere. I have rewritten and triple checked all physics / maths functions. I "hope" i am wrong on this, but everything really seems ok there.

So i would say the problem relies more on the car handling side of the problem.

I have tweaked a LOT of parameters recently, and i can offen "sense" the same defaults in almost every configuration i tried.

My general feelings are :

  • Car seems way too much sensitive, or the total opposite. Controled drift are impossible due to very fast changes in car orientation
  • Car seems to acquire way too much angular velocity, too fast
  • Each time a wheeltrain acquires some force it will happily make my car oversteer/understeer dramatically fast
  • Quite offen, if i go fast enough and start to oversteer in a long controled slide, small changes (gaz/brakes/steer), will cause the car to violently change heading to realign with velocity trajectory (almost instant), or to realign with previous oversteer heading.
  • Car will easily spin, and then continue to travel backward
  • Applying full lateral vector to front wheels when steer angle is near 30° will result in extreme car slowing
  • If i have 5% more lateral traction in front wheels, the car will spin almost everytime !
  • Dividing torque by 2 or 3 makes it better but still not perfect
  • It is almost impossible to have the car at 30°, sliding laterraly and to control the slide movement by changing acceleration or steering. Again, things seems to happen too fast
  • Very important thing i think is that the car will rarely slide laterally for a long time, as there is alway a force (front or back) that is higher and will make the car to align with direction vector one way or the other very fast
  • Car is not unstable or jittering, i test all kind of situations, and the response it gave me seems always appropriate, only way too violent / not enough controlable

Those results are with :

  • No traction circle
  • No weight transfer
  • 1ms time step, which is small enough AFAIK
  • Deactivated wheel angular velocity, slip ratio and engine (only dumb front force when i press forward)
  • Drag/Air resistances (constants multiplied by worldVel or worldVel² to have some damping), very negligeable
  • Regrouped wheels to middle of car (no X), as it changes almost nothing in behaviour, to avoid eventual calculation errors
  • Car mass : 1500Kg
  • Car Weight / Tire : 3700
  • Car inertia : 700
  • Car CG is centered, front wheels are 2m front and back wheels 2m back
  • Car total length is 4m
  • Pacejka lateral curve is like this :


this.slipAngle = [0, 1.0, 3.0, 5.0, 9.0, 11.0, 20.0, 30, 40, 50, 60, 90];
this.lateralForce = [0, 0.7, 0.9, 1.0, 1.1, 1.15, 1.20, 1.15, 1.1, 1.0, 0.9, 0.80];


When i compare this to your racing game K_J_M, (first i am telling me that it is a very nice game you have made ^^), and then the first car available in demo seems to gain some +/- angle easily, then it slides a little to prevent lateral motion, and it seems really soft and smooth. I can use all parameters i want, i still not have succeed to have this kind of nice feeling.

My point of comparison are recent casual games (like death rally), the KJM racing game, my game when i use non-realistic physics to try to have a nice behaviour, and ultimately games like GT, Grid or NFS series. So from most arcadish to most realistic, i still miss a big something to make my car controlable as those games do.

For your implementations, as soon as you had lateral pacejka and base the base physics right, did you managed to create a fun, controllable car right away ? Or did it recquire some more hacks/forces downscaling or real physics features stuff (like front slip ratios) to allow for controled drifting ?

For example the small demo you shared on the "car headache" thread started by marci, if i remember correctly, you apply angular velocity right away as we press left/right. And you scale the lateral pacejka to front speed, too ? Is it because the demo is simple, or is it because it just works better that way ?

I'm shooting a video or two to try to illustrate the fact the car behaves quite good until it spins, and the "trajectory auto-realign" stuff i was talking about.

I look at my samples again and again, but my intuition gives me nothing on this, i feel like i have the basics right and i have tried changing almost every value i have here and here without enjoyable results...

Video 1 : You can see in the second curve the weird alignment thing i was talking about.
Front / Rear lateral forces are the same.
Interesting values on the chart. Last run in slow motion.
The lateral force is simply slipAngleInRads * 1 * weightLoad
All others parameters are as i have explained above.

Except for that, i can have some controlled drift with a linear slipAngleInRad * someConstant force output.

Video 2 : An oversteer manoeuver with the pacejka curve i posted just above.
The front lateral force is 5% higher (multiplied by 1.05).
Along the video i am varying various parameters (lateral output magnitude, trying to accelerate in cornering to help, setting front/rear lateral force to equal, or back lateral to 95% of front).
It demonstrates that very few parameters variation can cause very fast spin vs. successful cornering. No controlable drift with those parameters...
Hi.

For my Autocross Racing game i used lateral Pacejka coeficients similar to this curve.

lateral_pacejka_curve.jpg


This gives a very forgiving tire with a lot of grip at all slip angles.

I noticed in your second video that your car reaches a maximum slip angle before it loses grip and spins around.
This is classic of a Pacejka curve that peaks at a small slip angle.
once past this peak, the tire has no grip and the car spins around.
Altering your Pacejka curve so it looks similar to mine above should help prevent this and allow for drifting.

You should be able to get variable car handling from using different curves. The Racer sim for instance uses different coefficients for front and rear tires.

But specifically for my game, i just rotate the cars velocity vector by the lateral Pacejka force to give that arcade drifting feel.

It's not physically accurate in any way and i did have to tune various attributes to get the correct feel i was after.

In theory, a physically accurate sim should be able to produce a wide range of handling for a car from an arcade drift feel to a simulation mode, by altering such things as the Pacejka curves, engine power, gear ratio's ect.

But in practice creating an accurate sim is going take a long time to do (particularly because theres very little information available on the subject), so it comes down to priorities.

If your priorities are to get an arcade game written as quickly as possible then i see no reason in hacking together an arcade sim, which is exactly what i did for my game.

If on the other hand you want to write a physically accurate sim and then use that as a basis for games, then it will take a long time to get right.
You could use a third party car physics engine and i know some general purpose physics engines support wheel physics and suspension constraints (Newton physics engine for example) , so that may be an easier route for you.
Hi again

Thank you for sharing your experience with me (and other readers if any).

But specifically for my game, i just rotate the cars velocity vector by the lateral Pacejka[/quote]
Mmm, i have some trouble to picture that... You rotate car world velocity vector, from an angle you determine with the normalized lateral force ? Like 1 output = 1 radian rotation for velocity vector ? I'll try that kind of stuff to see the results !

EDIT : i missed this precious piece of knowledge :
I noticed in your second video that your car reaches a maximum slip angle before it loses grip and spins around.
This is classic of a Pacejka curve that peaks at a small slip angle.
once past this peak, the tire has no grip and the car spins around.
Altering your Pacejka curve so it looks similar to mine above should help prevent this and allow for drifting.[/quote]
Thanks ! I'll try that right away smile.png
In your understanding, the controled drifting would occur after the peak (on the descending curve), or rather on the ascending part, before reaching the peak ?

In theory, a physically accurate sim should be able to produce a wide range of handling for a car from an arcade drift feel to a simulation mode, by altering such things as the Pacejka curves, engine power, gear ratio's ect[/quote]
That's what i think too, but it takes indeed quite a long time. The idea is to create a game that allows you to choose from a large variety of parts and even vehicule types. So having a nice basic simulation seemed a good idea. It still is, but we also need to have results as fast as possible. The game will be long term (web-based), so we will continue to investigate and work on the simulation until it produce satisfying result

Ultimately we will want a large variety of game modes so having a rich simulation will also help to achieve that goal.

For my Autocross Racing game i used lateral Pacejka coeficients similar to this curve.[/quote]
I remember ploting one of my curves on this one recently smile.png I even re-used your pacejka formula from your demo source, but the result differ for the last part even when all previous results were the same as yours, i haven't really looked into this issue, so right now i use some simple dots. Oh and the 1164N output force (peak) for a small 1N load input confused me too. But i still can inspire of the general shape.

---

So i guess from now on, i'll try to homebrew some sort of hack to make the game fun, as we would like to release a test version tomorrow.

On the long-term, i think i'll have to find for myself what kind of feature is too violent, what is the acceptable range of effect of weight transfer, wheel slip, etc, and to find some physically not-wrong ways to stabilize the whole thing.

I guess that realistic traction circle, with fine pacejka and 4 wheels weight transfer can produce an interesting result, only if the impact of each system does not exceed a few %.

The ultimate goal is to be able to set any type of parameters and still be able to drive the car. We would like a game where players are able to change everything in the car. So we sort of rely on physics for the itemisation of car parts, as we'd like it to be random instead of predefined stages or prebuilt cars. So you could remove a truck tire to put it on a race car if you want, but the game has to produce something that provides both a physically logical effect and fun driving.

I guess we still have a very long way to go,then !

If your priorities are to get an arcade game written as quickly as possible then i see no reason in hacking together an arcade sim, which is exactly what i did for my game.[/quote]
Well, i will go that way for now, thanks for the advice, it is well appreciated, and as i said i willl then try to stabilize the basics of the car physics to support a more wide range of configuration in the future.

You could use a third party car physics engine and i know some general purpose physics engines support wheel physics and suspension constraints (Newton physics engine for example) , so that may be an easier route for you.[/quote]
Well the game will be full HTML5, so we can look at other libraries, but nothing exists out of the box. That's why we work so hard on this, it is like a challenge ! Maybe i'll buy this one in Unity, and look at the source code to see what i can use. When i read this article, it makes me want to ask a lot of questions to that guy ^^

The demo is quite convincing to me, with both realistic/arcade cars.

---

Thank you so much to both of you for your time and helping me, and if it is not too much asking, (and your interest / work on the subject continues), i'd like to keep you informed of what i do next in the thread.

Let's try to get something fun !

were the same as yours, i haven't really looked into this issue, so right now i use some simple dots. Oh and the 1164N output force (peak) for a small 1N load input confused me too. But i still can inspire of the general shape.


The Pacejka MF, takes KILO NEWTONS as input load, so your 1N is actually 1000N! :)


I was twiddling with stability and controlled drifting and such in the weekend and realized that the weight transfer has significant importance in cornering and control, which makes sense, but also confuses me why anti-roll bars help stabilizing in corners.



Without weight transfer my car was incredibly unstable at high speed (>100km/h), even with a very small (2-3°) steering angle it spun around instantly.
Adding some load transfer helped, but it was still oversteer without throttle. With throttle it was just understeer, but no inbetween... So I cannot play with brakes and throttle to control drifting.


My weigth transfer formula is:

W=m*GRAVITY
Wf=(c/L)*W-(h/L)*Fx
Wr=(b/L)*W+(h/L)*Fx

For 4 wheel weight transfer, I'm not sure if this is the right thing to do:
Just transfer along axles based on lateral acceleration.

Fz_front_left=0.5*Wf+(h/Track)*Fy
Fz_front_right=0.5*Wf-(h/Track)*Fy
...the same for the rear wheels...

Fx, Fy - Forces acting on the car's body in car space
c/b = Axle distance from the CG
h = Height of CG from ground
L = wheelbase
m = Car mass
Wf, Wr = weight on front/rear axle
Track = Distance of wheels on the same axle


Adding some jacking force helps a bit, but still not the result I expected.


F_jack=Fy*h_roll_center/(Track/2)
Fz_front_left-=F_jack
Fz_front_right+=F_jack


h_roll_center = roll center height from ground


Maybe I'm mixing up things, or should I implement a proper suspension model, where all spring and dumping forces do all the weight transfer and the formula above is not needed at all?


I was also playing with car settings, and it seems a front engine car (60:40 weight balance to the front) is more controllable than a mid-engined (40:60) which should not be.
Hi !
I'm glad to read an answer to my topic
So i guess the new subject is "how to make it both physics-based and and fun", eg : have some sort of NFS cornering style. Or at least GT with a very controlable car.


The Pacejka MF, takes KILO NEWTONS as input load, so your 1N is actually 1000N!

Thanks for the precision



I was twiddling with stability and controlled drifting and such in the weekend and realized that the weight transfer has significant importance in cornering and control, which makes sense, but also confuses me why anti-roll bars help stabilizing in corners

Yes, i realized the same thing. I have come to the conclusion that physics-based car SHOULD implement some sort of weight transfer, as ultimately every force get scaled by weight transfer.
For anti-roll bars, their main effect should be to prevent the car to roll in high speed cornering ; in 3D physics, if you generate a lot of lateral forces during cornering, the car inertia makes it want to roll : http://www.euclideanspace.com/threed/games/examples/cars/cornering/car2cornering.png
I think from a 2D point of view, that anti-roll bars will help to prevent too much weight to go left/right of the center of mass during cornering too, which can have some effect in tires grip. Altough, i have read, lateral weight transfer is generally a good thing, as it gives more grip to the tires who needs it. But it must become a bad thing past some critical ratio value i guess.

What i can tell you is what i know (almost) for sure abour car control. In a so primitive state as we are, the things that would tend to have the more effect on the driving feeling would be :

  1. The wheel friction (long/lat, etc)
  2. The wheel springs (weight repartition entirely relies on them)
  3. The control system intelligence (without intelligence even a very fun/arcade car might be unplayable without very carefull throttle/steering management from the player)


I feel like we are more at step 1. Successfully going to step 2 might be quite complex, and maybe we should do some arcadish algorithms to handle weight transfer and its effects the way we want it before blindly implement yet another "real life" physics formula.

I realized those past days that input post-analyzing is maybe even more critical that correct lateral/long forces implementation. If you look at almost every car game, at high speed the wheel is steering of 2-3° against 45° at very low speed. Some games calculate the peak of lateral grip to prevent the player from going besides grip peak. Same goes for front/brake inputs.

It's not ESP or anti lock system at this point, it is more like the driver "listenening" to what the car he is sitting in has to "say". I'll try to come up with some formula to calculate max steer angle in real time to see how much it helps during cornering.


Without weight transfer my car was incredibly unstable at high speed (>100km/h), even with a very small (2-3°) steering angle it spun around instantly.

What kind of lateral friction do you apply ? Because i tend to have some sort of controled lateral drift quite easily with :
a) no weight transfer
b) a linear force returned for cornering forces : slipAngleInRadians * 5 for example (with a 1500kg car, so it is around 3500N for each tire)
[media]
[/media]
I shooted this video to show you what i am saying.

Without weight transfer, i tend to have this behaviour when the lateral forces curves & weight load are == for the 4 wheels. With "real" pacejka curve, i get a lot of understeer after the peak, so i have to limit the steer angle of the wheel.

Sorry for the low framerate it is actually smooth and nice to see (no teleporting). I'm recording with VLC which gives me a not that good framerate.

---

Adding rear/front (no lateral) weight transfer i get :

  • Great instability if turning + braking. Note that braking occur naturally because of front wheel lateral friction, "natural" air/roll friction, + eventually real driver input braking. Anyway, my car spins really fast even with a very small amount of weight transfered from the rear to the front.
  • Increased understeer effect during high speed cornering, especially if i do not limit steer angle.
  • Theorically controled drift could happen, but in reality car spins way too fast for the driver to have any time to react. Even in slow motion, if you have time to react, the situation evolves too quickly. But the physical facts & consequences are not illogical to me.

---

I don't know if my experience is helping or confusing you. (helping, i hope).

I remember using 5% more traction (linear *1.05 multiply) for front or rear wheel train, successively. More grip to rear = understeer and more grip to front = oversteer. Nice to play with without weightload, but as soon as weight get transfered it makes turning even more catastrophic.

My intuition here tells me, the great yaw velocity comes from the lack of balance between front/rear tires lateral response. *1 or *10k is not very important as long as everything scales at the same time. If the lateral force balance comes to F70%/R30%, for example, the car will do spin turns very fast.

When i analyse those ratios at the times the car seems to be in a small oversteer situation (which is a feeling players tend to like), the front wheels quickly (almost instantly) goes from 90% to 51% of the total generated lateral forces in early cornering. If you want to prevent the car to spin, the lateral force of the rear wheel must quickly go over 50% to keep the car heading controllable (in the above video example, the rear wheels go to 51% of the total lateral force generated to "counter" oversteer). So, looking at the problem from this perpective might help you to adjust parameters to stabilize things. It helps me to think clearly at "what i want", anyway.

I know we can use different traction circles/curves for front/back tires, but i have seen very nice drifting behaviour in Edy's car physics which seemed to apply the same curves for every wheel. So i would (will) try to get drifing whithout messing with this for now.

---

Actually i am wondering if lateral weight transfer could greatly influence the wheels in the outside of the turning lane, in a maner that would add more stability to car yaw, and eventually help us to get a nice turning feeling. What is your feeling about this ?

---


Adding some load transfer helped, but it was still oversteer without throttle. With throttle it was just understeer, but no inbetween... So I cannot play with brakes and throttle to control drifting


Same thing here. Worse : if i try to limit traction circle to have throttle/braking to allow for controled drift, i go from normal high speed understeer (due to high speed, despite small deceleration) to instant oversteer because throttle consume too much traction budget. I have the feeling i want the 100% operating range of my drifting to be limited to a very small range of force difference.

Looking at Edys vehicle physics curves in real time, i learned you can saturate front wheels without starting to spin instantly. I still have to figure out if that is dued to springs, more complex formulas, or to input control and magic things.

---


My weigth transfer formula is:
W=m*GRAVITY
Wf=(c/L)*W-(h/L)*Fx
Wr=(b/L)*W+(h/L)*Fx


Here is mine , it looks to be the exact same. Anyway, weight transfer is quite easy to check from real life data available on internet. The problem does not lie in the raw calculations rather in the fact that spring must have a great influence on that, too (i guess).

[spoiler]
updateAxleLoad = function (forwardAcceleration) {
var newWeightLoad = 0;
// Gravity center height
var cgHeight = this.car.cg.h;
// Distance between front/rear axle
var distanceBetweenAxles = this.car.cg.b + this.car.cg.c;
// Distance between actual wheel and gravity center
// TODO : calculate REAL distance (wheels are not centered in axles, rather on the car sides, so we should use pythagore)
var distanceToCenterOfGravity = 0;
if (this.wheelId == WHEEL_FRONT_RIGHT || this.wheelId == WHEEL_FRONT_LEFT) {
distanceToCenterOfGravity = this.car.cg.c;
} else if (this.wheelId == WHEEL_REAR_RIGHT || this.wheelId == WHEEL_REAR_LEFT) {
distanceToCenterOfGravity = this.car.cg.b;
}
// We need ratio cgHeight/distanceBetweenAxles to calculate mass transfer
var h_by_L = cgHeight / distanceBetweenAxles;
// Mass of the car
var totalCarMass = this.car.m_mass;
// Planet gravity
var NEWTON_GRAVITY_CONSTANT = 9.81;
// Weight of the car on the planet
var totalCarWeight = totalCarMass * NEWTON_GRAVITY_CONSTANT;
// Static wheel load (without acceleration)
var staticLoad = (distanceToCenterOfGravity / distanceBetweenAxles) * totalCarWeight;
// Dynamic load due to car acceleration
var dynamicLoad = h_by_L * totalCarMass * forwardAcceleration;
// Taking care of acceleration sign for weight increase/decrease
if (this.wheelId == WHEEL_FRONT_RIGHT || this.wheelId == WHEEL_FRONT_LEFT) {
// Front wheels get less weight with more front acceleration
newWeightLoad = staticLoad; - dynamicLoad;
}
else if (this.wheelId == WHEEL_REAR_RIGHT || this.wheelId == WHEEL_REAR_LEFT) {
// Front wheels get more weight with more front acceleration
newWeightLoad = staticLoad; + dynamicLoad;
}
// The weight was for the axle, now we devide it by 2 for individual wheel weight
this.m_weightLoad = newWeightLoad /= 2;
[/spoiler]

---

For 4 wheel weight transfer, I'm not sure if this is the right thing to do:
Just transfer along axles based on lateral acceleration.
Fz_front_left=0.5*Wf+(h/Track)*Fy
Fz_front_right=0.5*Wf-(h/Track)*Fy
...the same for the rear wheels...[/quote]

I was going to do the same thing. You can indeed get lateral weight transfer the exact same way you get front/rear. The problem is you have 2 differents values for 4 wheels, so it is 8 values. How do you combine that ? I was thinking about this :

For example :

  • static load = 3500N / wheel
  • front/rear load = 4000N front / 3000N / rear (decelerating)
  • left/right load = 5000N left / 2000N right (high speed turning)
  • i think we SHOULD take care of angular velocity in lateral weight transfer, but i haven't looked into it.

So, laterally 42% of weight goes from right to the left.
And 15% of the weight goes from rear to front.

I would say it give me for the different tires :

  1. FL : 3500 + 3500 * (+0.42 + 0.15) = 5495
  2. FR : 3500 + 3500 * (-0.42 + 0.15) = 2555
  3. RL : 3500 + 3500 * (+0.42 - 0.15) = 4445
  4. RR : 3500 + 3500 * (-0.42 - 0.15) = 1505

Total weight = 14.000N, so =3500*4. I think this way the weight is what it is supposed to be. In my example, i have way more lateral acceleration than front deceleration, so the outside wheels should get way more grip with some oversteer due tu front having more traction.

I think those weight repartition values would produce very unstable car (yawspins), but i'll try it anyway.

---

Adding some jacking force helps a bit, but still not the result I expected.

F_jack=Fy*h_roll_center/(Track/2)
Fz_front_left-=F_jack
Fz_front_right+=F_jack
h_roll_center = roll center height from ground[/quote]
I'm not entirely sure how/why it helps, what do you mean by jacking force exactly ? I know it has something to do with suspension, but i havent really looked into in ATM.

I tried to divide weight transfer valye by 250, 500, 1000 to simulate "time to reach the calculated weight", it helps, but still, weight transfer has dramatic effects on behaviour.

---

Maybe I'm mixing up things, or should I implement a proper suspension model, where all spring and dumping forces do all the weight transfer and the formula above is not needed at all?[/quote]
I really don't know, and i really want to know ! As i said, suspension seems to be a critical part of how a car can be handled.

---

I was also playing with car settings, and it seems a front engine car (60:40 weight balance to the front) is more controllable than a mid-engined (40:60) which should not be.[/quote]
Be sure you are using the proper wheel distance to CG. If i have more weight to the front, the car easily align the front in the turns. Even when CG is only closer to front of a few cms, the effect is immediatly noticeable. As with traction, even a few % changes have great consequences.

AFAIK, front engine cars are easier to handle, as they can easily turn compared to rear-mounted engines car which can be tricky to handle during oversteer situations as the back of the car want to go to the front (easier car spins). So i guess you're experiencing something which is good.

But with unstable car turning due to a few % changes in repartion of mass, if you are braking with a front mounted engine, you will obtain even wore oversteering.

---

In facts, all those things leads me to think that my main problem is the effects so small ratios changes are producing. Dramatical effects. Everything should be WAY more stable even with poor wheels/suspensions systems.

So the right question is what should i do (maths shortcut or real physics) to improve my car stability... ?

My currently strategy is :

  • Intelligent analysis of player inputs (ideal max steer angle/throttle ...)
  • Gently decreasing force when coming closer to traction circle edge (when i'll re-introduce it)
  • Try lateral weight transfer to if it improves/worsens car handling during high speed turns
  • Maybe add a "time to build up" to generated forces. I have read, in reality a tire can take 250ms to really produce the max force it can bring. But i'm afraid it will do counterbraking and such things totally impossible to handle.


Extreme measure i might try if results are not good enough in a few days :

  • Directly rotating velocity vector of the car in some situations (i have to define situation+angle, help can be brought by KJM as it seems he is doing it in his game)
  • Limitating max torque / angAcc / angVel of the car
  • Artificially prevent car spins (eg: if rear wheels go to 55% of lateral force + the car has some important yaw velocity, introduce some mechanism that would stabilize it)
  • Limit weight transfer to a VERY small ratio
  • Use a linear pacejka curve

I guess i'll have to implement proper springs/suspensions, but at this point i am not even close to measure the impact it would have on my simulation (good/bad, or more probably good, but not enough to make the game fun).

I'm very interested by your experience and future answers smile.png

I realized those past days that input post-analyzing is maybe even more critical that correct lateral/long forces implementation. If you look at almost every car game, at high speed the wheel is steering of 2-3° against 45° at very low speed. Some games calculate the peak of lateral grip to prevent the player from going besides grip peak. Same goes for front/brake inputs.

Yes, I made a speed sensitive steering which seems to work fine until some heavy intervention is needed, so if my car starts to skid my steering doesn't let me to counteract because of the high speed, and there is only 2-3° of max steering available.


What kind of lateral friction do you apply ? Because i tend to have some sort of controled lateral drift quite easily with :

I use lateral pacejka. The mentioned uncontrollable situation occurs without my special addition.
Earlier I added an extra Vel_long-=wheel_roll_vel; to the contact patch velocity calculation (only for slip angle) since the wheel rolling also affects the contact patch's velocity.
So with that little extra the car is very stable at least on a straight move with lane changes. Maybe it's an "arcadish" tweak for better handling, but without it I have hard time having the car move on a straight line after a little direction change (A simple overtaking is a great challenge, the car is moving off the road and it's a pain in the ...... -somewhere- to put it back on the road again.)


Actually i am wondering if lateral weight transfer could greatly influence the wheels in the outside of the turning lane, in a maner that would add more stability to car yaw, and eventually help us to get a nice turning feeling. What is your feeling about this ?

I made a quick force calculations on lateral traction vs. weight transfer; (and noticed some weird result values, see later)

No weight transfer: (steer angle=1°)
Fz_left=3kN
Fy_left=937N
Fz_right=3kN
Fy_right=937N

That's 1874N total lateral force on the front wheels.

With weight transfer, same steer angle (75%R 25%L)
Fz_left=1.5kN
Fy_left=970N
Fz_right=4.5kN
Fy_right=745N

That's 1715N total lateral force which would mean the lateral weight transfer is bad to the stability???
Also my pacejka curve looks good when I display it, but in the last values more load generates less lateral force? I don't get it. Is that normal?
Could you check it with your formula? The error in my theory is probably somewhere at the two wheels don't have the same slip angle at steering.


Quote
For 4 wheel weight transfer, I'm not sure if this is the right thing to do:
Just transfer along axles based on lateral acceleration.
Fz_front_left=0.5*Wf+(h/Track)*Fy
Fz_front_right=0.5*Wf-(h/Track)*Fy
...the same for the rear wheels...

I was going to do the same thing. You can indeed get lateral weight transfer the exact same way you get front/rear. The problem is you have 2 differents values for 4 wheels, so it is 8 values. How do you combine that ? I was thinking about this :

I meant, "the same method for rear wheels" :)

Fz_rear_left=0.5*Wr+(h/Track)*Fy
Fz_rear_right=0.5*Wr-(h/Track)*Fy

It's basicly the same as what you did (divide the load to front/rear based on Fx, and divide each axle's weight to left/right based on Fy).


Maybe I should buy that steering wheel, which would instantly point out if the problem is in the simulation or in the controls :)
I just got an idea:

Maybe it's time we started using the aligning moment (Mz) from our favourite Pacejka formula :)

I'll try to integrate it into the simulation, so if everything works as I expect the wheels should go back to 0° when I let loose the steering wheel (when moving).
And maybe use steering torques as the drivers hangs on the steering wheel :) and thus at the peak moment the steering and aligning forces should cancel each outher out.

Does it have any sense or absolutely pointless?

I added mouse steering, so any steer angle can be produced instantly. Very unconfortable, but the skidding is much more controllable.
An other note about stability. Since my car has 60% load on the rear axle, I played with the pacejka coeffs for the rear wheels so now they produce more lateral traction and thus more stable and eliminated the sudden oversteer, just a bit more grip as you mentioned.
BUT!
Now I cannot skid, not even with handbrake, also donuts work only with nose-weighted cars.
So now I have almost everything but they don't work together. If I reduce grip on the rear tyres I can make the parking-lot-show-off-manouvers but cannot take the first corner on the track. Soon I'm gonna be out of ideas.

This topic is closed to new replies.

Advertisement