Pacejka "magic formula" tire model

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Pacejka "magic formula" tire model

Postby kallaspriit » Sun Feb 21, 2010 5:39 pm

I am researching whether I could use the H.B Pacejka "Magic formula" tire model with NGD.

I have ported the Pacejka code from the open racer source and got it to draw some graphs. I put together a simple test program with source code and VS9 project, you can download it here. It also includes the live editor from Racer in the "editor" folder that you can play around with to see which parameters change what.

Basically, what the pacejka magic formula does, is describing an empirical tire model, that matches data from real world using a series of coefficients, that you can use the change the behavior of the tire. As input, it takes:
- load - how hard is the tire pressing against the ground
- slip angle - how big is the angle between tire angle and actual heading - for example when your wheels are turned all the way out but you are going straight because of excessive speed, there is a big slip angle (you are understeering)
- slip ratio - how much faster or slower is the wheel turning relative to actual vehicle speed. for example, the slip ratio is positive when there is wheelspin

Take a look at this graph
pac_curve.jpg
pac_curve.jpg (23.45 KiB) Viewed 9610 times


The black line is longitudinal force (that moves the car forward and helps it to break) and it peaks when the tire is rotating just a bit faster/slower than actual vehicle speed and then drops some when you have excessive wheelspin.

The red line is lateral force (that makes the car steer) and it peaks when you are turning just a bit more then the actual vehicle heading and decreases when you turn too much.

The green line is the feedback that the driver feels on the steering wheel. It increases to a certain angle and then starts to decrease all the way to actually getting positive (helping you steer to the same direction) when your slip angle becomes very large (for example going straight with the wheel turned out). This data can be used to power force-feedback steering wheel.

All the coefficients modify the shape of theses curves to match some tire and conditions.

Now how would I go about using this with NGD?

1. I should be able to get the slip ratio and slip angle relatively easily, this is calculable from what i've already got, right?
2. How would I get tire load when using a car made out of joints (not raycast). The force I am applying as spring-damper is not quite right I guess, can I get the load in the material callback or how?
3. When I have slip angle, slip ratio and load, I can calculate the lateral, longitudinal and aligning forces. How can I apply the longitudinal and lateral forces? I am guessing material callback again, but I'm not quite sure how.

Would be great to get it working, I'm sure this could benefit many trying to make any kind of vehicles with NGD :P
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Pacejka "magic formula" tire model

Postby JernejL » Sun Feb 21, 2010 6:06 pm

It is really easy to use this with newton to simulate tires in a raycast car simulation, and i believe the racer itself uses newton too.

All you have to do is get / set velocity / force at a point on the body and simulate the formula on that point.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Pacejka "magic formula" tire model

Postby Julio Jerez » Sun Feb 21, 2010 8:07 pm

If you check out the racecast car, I use an approximation of the tire corver, you can replace it with the actual formula and badabimm badbum, you get car using Pajeska.
basically the tire joint contain a decrete tire curve model called NormalizeForceCurve, I fill it with a ramp and a flat value but you can fill by plotting the actual Pacejka curve you generate from your editor.
It is very cool for darfting, and power slides.


One of the reason I like the ray cas car aproach is that it is very eassy to implement emperical tire model like Pacejka.
with contrained dynamics this is much more difficult because tire are a hybrid beween soft and as rigid bodies,
but rigid body dynamics do not really allowe the posibility for integration emperical equeations, everything must be and emerging result from physical and algebraric relations.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Pacejka "magic formula" tire model

Postby kallaspriit » Mon Feb 22, 2010 2:37 am

Unfortunately, I am not using the raycast car but the one made out of joints and bodies. Is it really not possible to use the results of this formula with actual bodies, for example in the material callback of the tire?
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Pacejka "magic formula" tire model

Postby kallaspriit » Thu Feb 25, 2010 11:29 am

For example, would it not be possible to rotate wheel contact tangents to be aligned with the tire (longitudinal forward, lateral to the sides), let NGD calculate the force that would keep the tire from sliding longitudinally and laterally and then let it apply maximum longitudinal and lateral forces of F1, F2, that are calculated using the formula?

I'm sorry if this sounds crazy, I don't know how NGD insides work, but I really hope there is a way to do this.
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Pacejka "magic formula" tire model

Postby kallaspriit » Sun Mar 07, 2010 10:16 am

Julio, is it really impossible to use a custom traction system with NGD and bodies?

Sorry for the monologue, but I'd really love to get this to work :P
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Pacejka "magic formula" tire model

Postby PJani » Sun Mar 07, 2010 11:16 am

material contact callback?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Pacejka "magic formula" tire model

Postby JernejL » Sun Mar 07, 2010 11:21 am

PJani wrote:material contact callback?


That's the best way, it works well for conveyor belts, vehicle caterpillar tracks and everything else.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Pacejka "magic formula" tire model

Postby kallaspriit » Sun Mar 07, 2010 12:39 pm

I was thinking the same thing, but I'm not sure how. What the formula gives me is the maximum force the tire is able to generate in longitudinal and lateral directions. I can rotate the tangents to match lateral-longitudinal, but how can I apply the maximum forces? All I can do is set tangent acceleration, but I don't see how this could give the right effect?
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Pacejka "magic formula" tire model

Postby kallaspriit » Sun Apr 04, 2010 2:03 pm

Julio, is it really not possible to apply the maximum forces Pacejka formula generates using material callbacks or any other method using rigid bodies (not raycast)?
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Pacejka "magic formula" tire model

Postby Julio Jerez » Sun Apr 04, 2010 3:04 pm

I have never figured out how to apply force cuvers to a Mutibody vehicle simulation.
A tire cures gives forces that you apply directly to the car, while a physics simulation need coeficent you enter in the simyulation to produce the same forces.
It is like an equation. you have unknown and known variables.
The curves generates the unknown from the independent variable,
The simulation also generates unknowns from the independent variables,
that makes it dificult to use curve with mutibody cars.

Remenber the Curves have not bearing to Physics equation, they are emperical curves generated in laboratory under specific steady driving conditions.
they give are teh mesuare of the the force and torqe at a tire center under restristive driving conditions, they do not simulate drive conditions at the tire treads which is when you need for a tire simulation.
The curve work well with raycast cars because they resemple tah kind of model, the do not work well with realitic multibody car because they are not physics laws for tires.

Tire curve is what you would get from a very elavorated mutibody car simulation, they can never be the imput of a mutibody car simulation.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron