Sign in to follow this  
Bow_vernon

Pacejka just doesnt make sense (yet)

Recommended Posts

Sorry if I flood the board with my own confusion, but I humbly ask for any help here....
So I finally give up on my tire physics model, and read about pacejka *magic* formula.
I dont understand what should I input to the formula. It said slip angle for lateral forces, and slip ratio for longtitudinal...
Suddenly, I said "Woa wait, where's the velocity of contact patch used?". I re-read it and it kept saying the same thing.
Im too confused to even start plotting a graph or something, so I desperately write this thread, and wanna know maybe someone have experienced the same thing??

Is pacejka truly depends on slip angle and slip ratio?? So far I know that the slip angle is the angle between tire's direction and tire's velocity.
Can I use the contact velocity instead??

So slip_angle = (lateral_direction_of_tire * velocity_of_contact);
and put it into the function.

and so slip_ratio = (forward_direction_of_tire * velocity_of_contact);

where
:
-velocity_of_contact is the velocity of the wheel's contact with the ground
-forward direction is the forward direction of the tire
-lateral direction is the lateral direction (orthogonal to forward direction)

Unh, I just cant understand it, why pacejka doesnt relate to velocity? I thank you for any help here....
Best Regards,
Bow Vernon

You can tell that Im confused just by reading this post.....zzz +.+

Share this post


Link to post
Share on other sites
Hahah, welcome to the world of tyre physics Voodoo. They call the Pacejka Magic Formula "magic" for many reasons. ;)

[quote]Unh, I just cant understand it, why pacejka doesnt relate to velocity?[/quote]

The Pacejka formula is a unit-less function. It does not care what parameters you feed it, whether it be a slip [b]ratio[/b] or a slip [b]angle[/b]. The formula simply attempts to model traction forces due to the [i]adhesion properties[/i] of the tyre's contact patch with the road surface. In a nutshell, tyre adhesion is not governed by velocity alone, it is mostly related to the tyre geometry and how it changes shape.

In order to experience traction, there always needs to be small discrepancy between the tangential velocity at the contact patch and linear velocity at the wheel hub. In other words, the tangential speed of the tyre needs to be slightly faster when accelerating, and slower when braking. If you think about it, this kinda make sense; a typical tyre has deformable properties. When the vehicle is accelerating or braking, the rubber experiences all sorts of [i]dynamic[/i] compression and shear forces, which is never zero. To make life easier, we want to represent these shear forces using a much simpler slip ratio, and then use the the Pacejka formula to establish a relationship between the slip ratio and the traction forces that affects the car handling.

Visualise this with a simple experiment. Get a pencil eraser, hold one end with your finger and push the other end vertically down onto a table surface. Now slowly slide the eraser along the table surface. If you do this slowly enough, you will notice the eraser will not slide at all, rather it starts to deform (shear). This is the [i]adhesion region[/i] of the Pacejka curve, which represents the almost linear slope from zero to the peak of the curve. You will feel a degree of resistance there, which is the actual traction/braking/lateral force (all the same concept really), it prevents your hand from "losing control" on the table surface! Suddenly the eraser gives way, and starts to slide. The very moment just before it starts to slide represents your peak traction in the curve; under ideal circumstances that is equivalent to the down-force you exert on the eraser. Beyond that, the eraser slides, the traction force starts to drop. The faster you go, less the traction you experience. That is the decaying part of the curve... basically this where the fun stuff happens in the car.

Slip ratios and slip angles are basically the same concepts, except you compute the ratios differently for each situation. For lateral forces, we use slip angles because the amount of deformation happens to be related to the angle between the direction they tyre is pointing and the actual direction of travel. For longitudinal forces, we use slip ratios because the amount of rubber deformation is mostly related to how fast the wheel moves with respect to the body of the car. The formula doesn't care what units they are. We simple choose a bunch of magic constants in the formula that's tailored for a particular input in order to get the output we want (or rather, to best approximate the physical behaviour of a tyre under that input condition).

Share this post


Link to post
Share on other sites
I guess I have to make special cases (when long_vel or lat_vel is zero), right?
Suppose Ive calculated the right force magnitude, where do they point?
for lateral = lateral direction of the wheel?
I should apply the force to the chassis at wheel pos right? It surely will induce torque at the chassis

Share this post


Link to post
Share on other sites
Sorry double post :)
How do I calculate slip angle? for slip ratio it's
(wheel contact vel-wheel vel)/wheel vel, right?
For slip angle is it
lat = contact vel * latdir
long = contact vel * longdir
slipangle= atan2(long, lat), is it right?(latdir and longdir is in world frame and normalized)

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1298570693' post='4778529']
Sorry double post :)
How do I calculate slip angle? for slip ratio it's
(wheel contact vel-wheel vel)/wheel vel, right?
For slip angle is it
lat = contact vel * latdir
long = contact vel * longdir
slipangle= atan2(long, lat), is it right?(latdir and longdir is in world frame and normalized)
[/quote]

Slip is basically the difference between the velocity of the tire at the contact point and the velocity of the center of the "hub" of the tire. This "slip" is what actually generates the forces to move the car. There is lateral slip and longitudinal slip.

So

longSlip = (velocity_at_contact_point - velocity_hub) / velocity_hub....which is more specifically....(wheel_angular_velocity * wheel_radius) - (velocity_hub) / velocity_hub.

velocity_hub is the same as saying GetVelocity(wheel_hub_offset_from_car_center_of_mass); or more specifically....bodyVelocity + (offset - center_of_mass) x bodyAngularVelocity

latSlip is different...its still the delta between the velocity of the tire contact and hub but on the lateral axis of the wheels world facing vector (or just angle)...or in other words this is the difference between the actual path line of the car and the angle of the wheel

latSlip = VectorToAngle(wheel_hub_velocity) - wheel_angle;

That's the basics of it. If you want to see some of this stuff in practice you should take a look at TORCS...its an open source racer. Its a little dated but the concepts are all there. Hope that helps.

Also, don't worry about the Magic Formula. It works but its not all its cracked up to be. Just use friction to scale your forces based on the slip you calculated. All the magic formula does is give you a scalar for the force based on properties of the wheel.

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1298570334' post='4778526']I guess I have to make special cases (when long_vel or lat_vel is zero), right?[/quote]

Yes, at near zero conditions I just take the sign of the tangential velocity and use either s=-1 or s=1 to compute traction force vector. On top of that, I use a static rolling resistance function to dampen the system to 0.

[quote]Suppose Ive calculated the right force magnitude, where do they point?
for lateral = lateral direction of the wheel?[/quote]

For lateral, the force vector is usually in the opposite direction of travel. For longitudinal, it depends on the tyre rotation. The slip ratio can be computed as:

s = (V[sub]T[/sub] - V) / |V|

Where, V[sub]T[/sub] is the tyre tangential velocity, and V is the velocity of the wheel hub. The equation above will produce a signed result. Use the sign to determine the direction of the traction force. You may need to use sign reversal, depending where you measure the tangential velocity (top or bottom of tyre) .

[quote]I should apply the force to the chassis at wheel pos right? It surely will induce torque at the chassis[/quote]

Yes, and yes. It's ok, the torque is correct behaviour. If you are worried that the car body is going to rotate by itself, it won't happen. Remember that lateral forces are resistive, they will always act in the opposite direction of the contact patch travel.

[quote]Also, don't worry about the Magic Formula. It works but its not all its cracked up to be. Just use friction to scale your forces based on the slip you calculated. All the magic formula does is give you a scalar for the force based on properties of the wheel.[/quote]
I reckon it's worthwhile to experiment with it, you can get some pretty interesting results when shaping the traction curve. What I usually do is setup a spreadsheet, plot out the Pacejka, then plug in different constants to get a nice shape that works really well. Computationally Pacejka is really not a big deal on modern processors, so might as well give it a shot.

Share this post


Link to post
Share on other sites
Excuse me tachikoma, but you said the lateral force is against the direction of travel, right? that means it will only slow down the car and wont turn the chassis?? (+.+)a doh I think it works in lateral direction of wheels...

Share this post


Link to post
Share on other sites
Push one corner of the car laterally, while resting on rubber wheels. The resistive force you are experiencing is the actual lateral forces acting at the contact patches, due to the slip angle being 90 degrees to the alignment of the wheels. So the net angular component of the body will largely zero as a result.

Share this post


Link to post
Share on other sites
yes, but it acts in a lateral direction of the wheel (suppose a wheel is facing front, I push it to the left, there'll be a resistive force in the lateral direction of the wheel, it will push back to the right). And the lateral direction is perpendicular to up and forward direction, right?
(=.=)a

Share this post


Link to post
Share on other sites
Ok. thx tachikoma(r u japanese)? in which I should say arigatokuzaimasu?I'll test the lateral pacejka first. but it's kinda weird. it depends only on slip angle, so it will generate the same force no mater how fast the car is? uhk I can feel this is my last doubt..
hmmhmm I can almost feel it,...

Share this post


Link to post
Share on other sites
I managed to calculate slip angle based on angle of wheelhubvel and wheeldir. thing is, the car jiggles a bit even when it should stand still. but when moving it's quite fine. how do I solve the stability problem?

Share this post


Link to post
Share on other sites
Nah, not Japanese, I just happen to like Japanese things... :P

[quote]I managed to calculate slip angle based on angle of wheelhubvel and wheeldir. thing is, the car jiggles a bit even when it should stand still. but when moving it's quite fine. how do I solve the stability problem[/quote]
You don't compute the slip angle using the wheel hub velocity. The slip angle is found using the [i]orientation[/i] of the wheel, and the [i]direction [/i]of travel. These are all normalised direction vectors.

The jiggling problem is due to the integrator alternating the force vector direction when the body starts to come to rest. You will see also this when you start implementing the longitudinal traction force calculations. Naturally this will also affect the vector used to indicate direction of travel for the lateral stuff. To minimise this oscillation problem, I simply I apply manual damping on the system when the velocity drops below a threshold. You can do this via a rolling resistance function, or something equivalent. It's a hack but it works well.

Share this post


Link to post
Share on other sites
heheh seems the lateral force is working. I need to get my hands on the longitudinal version now. It behaves so good, I even compared it to the marco monster cardemo. I somehow wonder how his car can 'power slide', it even slides too much, you have any idea?

Share this post


Link to post
Share on other sites
Hey good you got it working.
Actually that is where the friction circle comes in. When the car is RWD and you accelerate, the maximum lateral force is reduced for the rear wheels. That means your car tend to oversteer --> Powerslide.

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1298701971' post='4779239']
Umm I'll try that, ugh hacks.
[/quote]
It's not as bad as you think. You should be applying the rolling resistance anyway - or any other resistive forces that act on the car body, such as drag, engine braking, etc. It's a good way to keep oscillations in check.

[quote]heheh seems the lateral force is working. I need to get my hands on the longitudinal version now. It behaves so good, I even compared it to the marco monster cardemo. I somehow wonder how his car can 'power slide', it even slides too much, you have any idea?[/quote]
Marco's implementation is a just a rough approximation of the Pacejka. His version is basically a two step function, where it has a linear adhesion region (the ramp in the plot), then the plot is capped to a maximum. That region is what causes the car to slide.

Share this post


Link to post
Share on other sites
You mean I should reduce the lateral force and favor the longitudinal? hmm Im confused. From googling, I read that the friction circle is not neccessarily a circle, but rather ellipsoidal. Does it mean the sum of long and lat force should lie within the circle? How would I do that?

Share this post


Link to post
Share on other sites
[quote]You mean I should reduce the lateral force and favor the longitudinal? [/quote]
You raised a good question. To clarify things, the 'damping' aspect is applied on the longitudinal component of your system. However, this has an indirect implication for the lateral calculations. Ultimately you will compute the net force vector acting on the car body, which has contributions both from the long and lateral calculations. From this you also compute the velocity vector (in the integrator), and the direction of travel. This direction vector is eventually fed back into your slip angle calculations. Basically if you stabilise your longitudinal calculations, the lateral system should also stabilise. Does this make sense?

[quote]Does it mean the sum of long and lat force should lie within the circle? [/quote]
To further clarify the oscillation problem has nothing to do with the traction circle. It's a [i]numerical instability[/i] problem caused by your integrator. Do not confuse this with 'car stability', that is, keeping the vehicle under control while driving.

The traction circle simply refers to the car's maximum traction in any direction of travel. If you think about it, when you contribute the lateral and longitudinal traction forces on the body, the combination can be considered as a traction circle, or ellipse. The perimeter of the circle represents the peak traction of your system in any direction along 2D plane of the car body. If you look at one of Brian Beckman's [url="http://phors.locost7.info/phors25.htm"]articles[/url], he illustrates this concept well [url="http://phors.locost7.info/images/25image32.gif"]with this image[/url]. The graph shows the lateral and the longitudinal Pacejka formulas plotted together. The base of the graph signifies the lateral and longitudinal (i.e. 2D) direction of the car body. Inside that hole is the 'adhesion region' of the tyres, rim of that plot is the maximum traction circle, and slope outside of that is the region where the car loses traction control.

Share this post


Link to post
Share on other sites
Actually tachikoma, the oscillation is gone now, thx ^^. but now I need to grasp the method of combined traction and lateral forces. I guess I have to cap'em so they lie within the circle? and will it make the driving smoother? I'll read the beckman articles first, and (maybe) come back here again..

Share this post


Link to post
Share on other sites
To combine them together, it's simple:

TractionForce.X = PacejkaLateral(......);
TractionForce.Y = PacejkaLongitudinal(......);

This gives you the final 2D force vector you can contribute to the car body. I'm assuming the lateral is X, and the long is Y within the XY plane. Some tutorials have this reversed.

[quote]I guess I have to cap'em so they lie within the circle?[/quote]
Well, you don't have to. The whole point is to model car spins and other crazy out of control situations when you push the vehicle too far. In order for that to happen, you need to make allowances for the slip angle and ratio to map outside the traction circle. If you cap at the traction circle, then you are effectively flattening region outside the circle. This means that your slides will be consistently the same no matter how extreme are your slip parameters are. Of course it all depends what you want out of the game. Give either a test and use whatever feels good.

This is where having the Pacejka plots in a spreadsheet is so useful. You can easily manipulate its constants and try out different curves and slopes outside the peak traction.

Share this post


Link to post
Share on other sites
Yes, I plot it in ms excel. Very useful. Well my previous versions didnt cap the forces. The current version did. Ok I think I'll just revert back. I didnt use pacejka for the longitdnl version, it's just not working, but it's ok. Anyway, why lateral force doesnt depend on velocity? Any insight?

Share this post


Link to post
Share on other sites
[quote] I didnt use pacejka for the longitdnl version, it's just not working, but it's ok.[/quote]
what's wrong with it?

[quote] Anyway, why lateral force doesnt depend on velocity? Any insight? [/quote]
I thought this was already clear from the previous discussions? The resistance of car sliding laterally is a function of tyre orientation with respect to the movement of the body. More precisely, lateral force is result of the slip angle, computed from the [b]direction of the tyre[/b], and [b]direction of travel[/b]. So the velocity of the car is immaterial, except when the car is not moving, which in that case the direction of travel is undefined (and therefore you can assume there is no lateral forces acting on the car).

Share this post


Link to post
Share on other sites
Ok, I didnt use pacejka for longitudinal, simply because I apply torque to wheels, the wheel spins and apply force, there's reactive force, give counter torques. with pacejka, I got small force and the reactive force isnot big enough to give counter torque

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