Car skidding behavior

This topic is 663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hiya fellow gamedevs!

So I finally implemented the so called Pacejka "magic" formula (correctly). It allows the car to steer around like a car supposed to. However I only use Pacejka for lateral (cornering) force so far, the longitudinal is still using simple formula that works well enough. But that's not my problem. My problem is the car now can skid (spin uncontrollably), and of course a countersteer is sometimes enough to alleviate it. But I haven't factored the driving force in skidding behavior. The question boils down to this:

• suppose a rear wheel drive car (2WD) is spinning to the right, so we do a counter-steer, but suppose this is not enough to stop the car from spinning.
• in that situation, what is the effect of hitting the pedal to the metal? would that make the car spin even worse?
• in that situation, would hitting the brake (slowly perhaps) helps the driver taking back control of the car?

I wonder because:

1. I don't have a car nor a skidpad or a wide field to test it myself lel  :P
2. This video  basically stated that just let go of the gas(let the wheels free rolling?) or was it to push the pedal slightly(reduce drive force?) damn my listening skill is not good :(
3. The behavior of the car in Need For Speed Porsche Unleashed ™  is kinda against the tips in number (2). Usually in the game, when you corner without hitting the pedal (turning while the wheels are free rolling), your car would spin, and hitting the gas in that situation would help reduce the spin (you gain back control). While in the video in number (2) states that hitting the gas while spinning would make your car go 180.
4. Also what I don't understand is, in the game (NFS PU), it's basically impossible to have your car spinning when you turn around the corner while hitting the pedal. Your car would instead do a high speed, understeer turn. What is the true behavior of a car in such situation in real life?

Thanks pal. I've been trying to play the old games again (it has seriously the most realistic physics for the car game in that time IMO), but to no avail. It keeps crashing because it uses DX7 for rendering.

Share on other sites

It's not really such a cut and dry question as to what happens.

It depends on factors such as the weight distribution of the car, the dynamic load at the time being considered, and so on.

Sorry if you already understand the concept of the 'friction circle', but I'm going to explain under the assumption that you don't.

Googling around found this useful picture:

So, you can see that there's a maximum amount of grip the tire can exert in any given direction, and that both longitudinal and lateral forces share this grip. Meaning you can get maximum cornering force only when not accelerating or braking, and maximum braking/acceleration force only when not cornering.

When your car starts to get oversteer, it's generally because the rear tires have exceeded the limit of their available grip, and are now not able to provide any real lateral force to counteract the momentum of the body of the car. The reason people say to "let off the gas" when oversteering is because it takes away some of the acceleration force, which may give you back enough total grip to start meaningfully cornering with the rear again. On the other hand, the point of counter steering is to straighten the car a bit, which means the rear tires are being asked to provide less cornering force - this may also bring you back into the range of slip where you can actually provide enough grip to stop the spin.

However, there are other factors. You can imagine that the 'circle' changes radius based on vertical load - if it has no load (it's not touching the road) it can't provide any grip. If it's only lightly touching it, it can only provide a little grip. If you brake quickly, the load transfers to the front of the car as the car rocks forward on its suspension, reducing load on the rear tires. Reducing it too much will cause the car to start oversteering. In this case, "flooring the throttle" would actually help transfer load back onto the rear, reducing the oversteer.

However, transfer too much load, and you may max out the suspension travel of that corner of the car, meaning any bump will make the car 'hop' and lose traction. If you've maxed out the right rear suspension in a left turn and it's started oversteering due to wheel hop, aside from needing to fire your race engineer, braking may actually help bring load back to the front of the car, allowing the right rear to travel again, which would mean braking has the opposite effect of the previous example.

Finally, what effect braking has on handling is affected by your brake balance - if your brake balance is towards the front, hitting the brakes is pretty much always going to make oversteer worse -- unless, of course, you slam on the brakes so hard that you completely exceed the grip capability of the front tires, locking them up and changing from an oversteer spin to a 4-wheel slide. In some iterations of some games, it has been possible in rear wheel drive cars to simply stomp the brake and accelerator at the same time to save an oversteer spin - it would cause the front tires to lock, while the engine has enough force to overcome the rear brakes and make the rear tires spin a bit, giving them back lateral force while removing all grip from the front tires and reversing the spin. This actually works in the current generation of formula 1 car as well.

As a note, I'd recommend against looking at the handling in Need for Speed games for any reason other than learning how to make a car handle like a Need for Speed game; the physics in those games is not designed to be in any way realistic, and as such, driving tips for real-world cars do not apply to those games.

Edited by ElliottSmith

Share on other sites
suppose a rear wheel drive car (2WD) is spinning to the right

you mean the tail end is coming around to the right - ie the car is rotating CCW as seen from above?

so we do a counter-steer, but suppose this is not enough to stop the car from spinning.

ok, so the tails coming around, my Z does it all the time. you counter steer (hard right turn - try to straighten it out).  And lift - of course.   you don't mention ABS or active traciton control, so i'll leave those out of the equation.

in that situation, what is the effect of hitting the pedal to the metal? would that make the car spin even worse?

if you nail it, you'll add some additional thrust to the spinning motion.  The idea is to slow down the tire until the horizontal force drops below the mass supported by the tire times the coefficient of dynamic friction for that tire compund vs the road surface and current conditions (dry, wet, snow, ice, dust, marbles, etc).

When F > M * Ks you break loose.

When F< M * Kd, you hook up again.

in that situation, would hitting the brake (slowly perhaps) helps the driver taking back control of the car?

Depends on whether you're trying to recover (drive out of it), or just regain full control by whatever means.

when recovering,  without abs or traction control, only lightly or quick pumps would help. the idea is to reduce the difference in speed between the tire and road as fast as possible. if the tire has no traction,and you hit the breaks,  the tire slows down more, compared to the road skidding by, than it would if left free to try to roll with it and catch up.  with light braking, you increase the rolling resistance of the wheels, which slows you faster, reducing the force on the tire from your speed.  With pumping, you momentarily skid to slow dramatically, this is the idea behind ABS.  The momentum of the car, the turning angle, and the thrust from gas and brakes all sum to a shear force at the contact patch between rubber and road. then you use coefficients of static and dynamic friction to determine when you break loose and hook up again.

But rolling reduces rolling resistance. So locking them up would tend to move you from a spin to a slide, but may regain control faster. The downside is you can still control 2 wheels in a spin, but in a slide, you're just along for the ride - and have to hope you don't hit anything before you slide to a stop. As you can see, there's a difference between spin recovery, and simply regaining control when you lose traction.  In spin recovery,you drive out of it.

I don't have a car nor a skidpad or a wide field to test it myself lel

I've been a hot rodder for 38 years, and I took three years of physics in college. During 1st year physics lectures, i would spend my time figuring out the physics and chemistry behind building race engines.

i have a 71 malibu convetible with a 688 HP 489 CID big block chevy 454. No turbo, no nitrous, no blower - runs on pump gas.

and a 1999 Z28 camaro

and a 1971 GMC 1500 stepside 1/4 mile dragster narrowed and tubbed with a 511HP 350 small block chevy motor.  No turbo, no nitrous, no blower - runs on pump gas.

and a 1986 Porshe 944

i've slid all the way across an icy bridge on the DC beltway in the Maibu from one end of the bridge to the other.   VERY SCARY!  20-30 seconds of uncontrolled sliding.

I slid sideways across a field at 70+ MPH in the Z, avoiding a deer. left grass imprints in the clearcoat, the grass was slamming up against the car so hard!

The Z has no weight in the back end. The gas tank hangs behind the rear axle.  If you don't keep a full tank of gas in it, it'll light them up at the slightest provocation. Its actually hard to take off from a light without lighting them up.  and heaven forbid you ever pegged it once they broke loose - with posi, it would never hook up, just whip around.

The truck and Malibu are even more insane. I bought the Porche as a "commuter car".

just let go of the gas

its called "lifting" - as in lift your foot off the gas.

The behavior of the car in Need For Speed Porsche Unleashed ™  is kinda against the tips in number (2)

its a game.

What is the true behavior of a car in such situation in real life?

if your speed is fast enough, the front tires break loose, resulting in understeer, and you tend to go straight instead of turning, and hit a wall usually.

if the back tires break loose, you get oversteer, and the back end comes around. If you then peg it, the car will whip around faster. If you lift, the car will slow - eventually to the point that the rear end hooks up and stops coming around on you.  But lifting also means you're slower through the turn.    Sounds like NFS  decided that being able to power through oversteer like a front wheel drive car was more fun than realistic spin physics for a real wheel drive car.  and therein lies the difference between arcade and hard core simulation games.

http://www.makeuseof.com/tag/4-of-the-most-hardcore-racing-simulators-you-can-play-on-pc-right-now/

I have F1 2010 - its pretty decent physics.

Edited by Norman Barrows

Share on other sites
If you're really keen and those interested, there is a rather large and details series about the physics of car racing http://phors.locost7.info/contents.htm
...I know, it's way beyond the scope of this thread but an interesting read anyway :)

Share on other sites

However I only use Pacejka for lateral (cornering) force so far, the longitudinal is still using simple formula that works well enough. But that's not my problem. My problem is the car now can skid (spin uncontrollably), and of course a countersteer is sometimes enough to alleviate it. But I haven't factored the driving force in skidding behavior.

As mentioned above, lateral and longitudinal friction are interconnected. If you're using all your friction for acceleration or breaking, then you can't use as much for cornering (and vice versa).
It sounds like having a single friction model that handles both longitudinal and latitudinal forces would actually be a solution to this problem.

The question boils down to this:

In general, accelerating during a spin will keep the spin going, while breaking will slow it down... but that's a complicated emergent behaviour, not something that should be coded directly. FWIW in rally driving you left-foot brake, and after initiating a slide though a corner, you actually apply both pedals at the same time, keeping the steering wheel straight and "steering" with your feet like a rudder :o In general, more acceleration than breaking will increase the rate of rotation, while more brake than accelerator will decrease the rate of rotation.

The simple version is that if the back wheels and the road are travelling at vastly different speeds (either foot to the floor + low gear = spinning like mad, or, brake foot to the floor without ABS = skidding, or car is sliding sideways) then the tyre loses grip of the road and the friction model changes completely. Once the wheel's contact patch and the road come back to a similar speed, then the tyre can grip again.
Steering, braking, accelerating and momentum are all connected here.

There's also examples of the general statements above being completely false. You might be spinning out because you slammed the brakes on, causing the wheels to lock up (so now the contact patch and the road are moving at different speeds). The solution to that skid may be to release the brakes and accelerate enough to cause the wheels to start rotating at the right speed again.

Edited by Hodgman

Share on other sites
Finally, what effect braking has on handling is affected by your brake balance - if your brake balance is towards the front, hitting the brakes is pretty much always going to make oversteer worse -- unless, of course, you slam on the brakes so hard that you completely exceed the grip capability of the front tires, locking them up and changing from an oversteer spin to a 4-wheel slide.

Damn, I really wished I had a car lel. I didn't know that car brakes are applied on all 4 wheels (albeit at different rate). Thanks pal, this is gonna change my perspective on this matter.

However, there are other factors. You can imagine that the 'circle' changes radius based on vertical load - if it has no load (it's not touching the road) it can't provide any grip. If it's only lightly touching it, it can only provide a little grip. If you brake quickly, the load transfers to the front of the car as the car rocks forward on its suspension, reducing load on the rear tires. Reducing it too much will cause the car to start oversteering. In this case, "flooring the throttle" would actually help transfer load back onto the rear, reducing the oversteer.

I already factored the wheel load (using suspension force as wheel load) at the calculation. But I also cap the wheel load so it would not reach infinity, instead it will be capped to a maximum value (the wheel has "maximum load" property. But what would actually happen when the wheel get excessive load? (I know it will pop off lel) But I mean, how would it affect the lateral force? I tried re read the old physics books of my sisters, didn't find anything related there :(

As a note, I'd recommend against looking at the handling in Need for Speed games for any reason other than learning how to make a car handle like a Need for Speed game; the physics in those games is not designed to be in any way realistic, and as such, driving tips for real-world cars do not apply to those games.

Ah I see. But seriously, that game's physics still struck me with awe, even today. I haven't found anything similar. Well perhaps DiRT rally, but that's rally game though. Project cars doesn't feel the same.

Bow_vernon, on 07 Feb 2017 - 04:25 AM, said: suppose a rear wheel drive car (2WD) is spinning to the right   you mean the tail end is coming around to the right - ie the car is rotating CCW as seen from above?

Yes, I should have stated it more clearly. Sorry.

Bow_vernon, on 07 Feb 2017 - 04:25 AM, said: so we do a counter-steer, but suppose this is not enough to stop the car from spinning.   ok, so the tails coming around, my Z does it all the time. you counter steer (hard right turn - try to straighten it out).  And lift - of course.   you don't mention ABS or active traciton control, so i'll leave those out of the equation.

Yes, I meant to talk about pure driving without assistance. Learnt new things: "lifting" and "flooring". That's why I was confused about the driving videos. I thought "lifting" means the chassis doing "back-leaning" (like a plane about to take a lift lel).

i have a 71 malibu convetible with a 688 HP 489 CID big block chevy 454. No turbo, no nitrous, no blower - runs on pump gas. and a 1999 Z28 camaro and a 1971 GMC 1500 stepside 1/4 mile dragster narrowed and tubbed with a 511HP 350 small block chevy motor.  No turbo, no nitrous, no blower - runs on pump gas. and a 1986 Porshe 944. I bought the Porche as a "commuter car".

This is why sometimes I envy western people. Most of those cars are considered luxurious here (South East Asia).

If you're really keen and those interested, there is a rather large and details series about the physics of car racing http://phors.locost7.info/contents.htm ...I know, it's way beyond the scope of this thread but an interesting read anyway

Ah the physics of racing. Thanks pal. This is some good quality readings here.

Bow_vernon, on 07 Feb 2017 - 04:25 AM, said: However I only use Pacejka for lateral (cornering) force so far, the longitudinal is still using simple formula that works well enough. But that's not my problem. My problem is the car now can skid (spin uncontrollably), and of course a countersteer is sometimes enough to alleviate it. But I haven't factored the driving force in skidding behavior. As mentioned above, lateral and longitudinal friction are interconnected. If you're using all your friction for acceleration or breaking, then you can't use as much for cornering (and vice versa). It sounds like having a single friction model that handles both longitudinal and latitudinal forces would actually be a solution to this problem.

Yes, at the moment the friction model was "pyramid" (shoud be conical / circle right?) I am at a loss though because I'd like the wheel to have more longitudinal friction than sideway friction (wouldn't this make the friction "cirlce" look more like ellipsoid?).

EDIT:

but that's a complicated emergent behaviour, not something that should be coded directly

Of course, I didn't mean to "hack it" till it just works, just trying to find the logic in skidding. Anyway, now the lateral and longitudinal forces are both using Pacejka magic formula, and both are affected by the driving force (i.e, player hit the pedal) in a way. The lateral force input are the Pacejka magic constants (for lateral force), friction coefficient, max loading of the wheel, real wheel loading (already calculated when solving suspension force), and the slip angle (this one is affected by the difference of speed on the contact patch (between the wheel and ground), and is heavily affected by driving force, since applying driving force changes the contact patch velocity difference. The longitudinal force is also affected by driving force, because its input are Pacejka constants (for longitudinal force), friction coefficient, max loading of the wheel, real wheel loading (already calculated when solving suspension force), and the slip ratio (this one is affected by the driving force, since applying driving force would cause wheel and ground speed difference, which is used to calculate slip ratio).

Now it feels good, but I haven't done any kind of combination / mixing, other than factoring the driving force into the equation. Does Pacejka magic formula need to be mixed or what (perhaps limiting the friction circle)? I'm at a lost now, but my opinion is when one use Pacejka magic formula one doesn't need to do some mixing because the curve is already dictating the behavior of the tire, including the mixing between lateral and longitudinal force, but I'm not sure though.

EDIT2:
I've read Brian Beckman physics of racing, also taken a look at RACER implementation of this. Turns out there are various ways of combining lateral and longitudinal forces. I use one of the modified method (it's called the circle method in RACER), and it works well enough for me. Thanks people for the suggestion and contribution.

Edited by Bow_vernon

Share on other sites

suppose a rear wheel drive car (2WD) is spinning to the right, so we do a counter-steer, but suppose this is not enough to stop the car from spinning. in that situation, what is the effect of hitting the pedal to the metal? would that make the car spin even worse?

Most likely, yes, the car spin will be even worse.

When the wheel is rolling freely (no throttle / brake applied) then it can use all its grip on the lateral force. When throttle is applied causing the wheel to sping faster than the ground then the force direction is deflected forwards, which means that less force is available for compensating the sideways sliding. Thus, the car will likely continue spinning.

I've been doing drifting myself [VIDEO]. The key factor is controlling the throttle carefully. The steering wheel will be mostly rotating itself and all you have to do is apply minor corrections. For example, at around minute 1:20 you can hear how I lift the throttle in order to allow the car to end the spinning. There are many situations in the video where I'm applying throttle gently or no throttle at all while sliding laterally in order to control the car's spin rate.

Later, I applied those lessons to my own simulation model, Vehicle Physics Pro [VIDEO], with great results.

1. 1
2. 2
3. 3
Rutin
24
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• Forum Statistics

• Total Topics
633651
• Total Posts
3013130
×