Tires, questions ..

Tires, questions ..

Postby CryHam » 05 May 2014, 17:31

Yes,
Image

I was tire-d of the translations and other tiny things.
Can we talk about something really serious ?

Is anybody here familiar with car or tire simulation code ?
I remember NaN had some experience, can you help ?
I already talked with my friend Mike again about what's wrong with SR simulation.
And I know what to do, but not really how to do it.
SR has already like everything needed to (without touching code):
edit cars in game, edit tire functions during driving, visualize simulation stuff, etc.

So my questions are:
How do the tire functions need to look like (generally) for gravel ? Has anybody found any references on internet ?
I know somewhat how they should behave (which I describe here) but not exactly the shape nor the Pacejka parameters for that.

ATM, SR has too much grip in longitudinal direction. Cars should spin tires on gravel from start until even 3rd gear.
Also engine torque is so strong that it should be possible to spin them easily and more often even at speed.
Yet even when spinning and sliding they should provide decent longitudinal force (from engine torque, when throttle is pressed ofc).
Also the worst thing I can't seem to do with this simulation:
How do I allow easy turning/steering of car - always ? I.e. with already spinning tires and at high speed too.
Car should loose lateral grip (oversteer) just by turning a bit too much at speed, yet be very steerable when sliding.
Steering left/right should just be turning (directly rotating) the car nearly always.
ATM in SR you can't do shit when sliding at speed, it just sticks to that direction it already had before.
Do I think right that this should be fixed with longitudial (Fx) function being quite flat and not much dropping without even visible peak ?

This is exactly so in Richard Burns Rally too. If you from stopped car press right and up arrow (full throttle and full steer to one side) it will almost instantly spin tires and steer car - won't go straight much, just will turn circles at that place.
How does one do that ? (How in tires, I'm guessing)
Also, do tire friction circle combining method or its parameters influence this much ?

And, do differentials have a lot or not that much to do with this ? I think somewhat yes.
Can anybody explain why in RBR the front diff has 320 Nm torque, rear has 700, and center 600 ? I mean why so different.
Also anybody familiar with the differential mappings, i.e. functions how should diff's (front,rear,center) lock depending from throttle,brake position and car speed. Those are in RBR (like 9 functions) and supposedly were very important for rally drivers.
Next question: How do I achieve differential lock in sim code ?
Does this need some extra code or is it similar to just setting diff. torque to very high value (eg. 10000).
ATM also cars have that stupid angular damping I added. I believe they should have it very low or even none ? I.e. how much should car body damp rotation from air resistance ?

I'm already editing cars yeah since ages, but recently for the hard simulation mode, which I want to have, with all this and be finally closer to RBR.
Also I got no idea, how the engine inertia should be and friction, I'm told that WRC cars have low engine inertia (i.e. pressing throttle peaks rpm very fast on neutral), but also rpms drop fast on neutral, how so?

Here, some cool pictures to help explain what I mean:
http://autocarspeed.com/wp-content/uplo ... t-side.jpg
http://hqdesktop.net/wallpapers/l/1280x ... _49891.jpg
http://www.speedwaymedia.com/wp-content ... -Rally.jpg
http://image.motortrend.com/f/wot/rod-m ... line-2.jpg
http://www.wallchan.com/images/mediums/14367.jpg

Apropo car editing tools in game here is the Wiki, and my favourite image from it, tire functions graphs.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Tires, simulation, questions ..

Postby CryHam » 10 May 2014, 09:02

Okay it's going well. I've figured some things.
There is now a branch 'tires' with hard simulation mode, very WIP, S1 car only and tires under heavy development, changed as usuall on Game tab.
It has a new graphs mode that shows Pacejka functions real-time for all tires, this was crucial to understand where on curves are we.

As for tires:
Allowing great steerability (being able to steer when spinning wheels) comes with very big Fx (longitudinal) force and little Fy (lateral).
Also stiffness is the angle of the curve at start (not maximum). This param, when low, lets you spin wheels at start with throttle, and also for lateral allows more sliding.
Then the shape factors (a0 and b0) tell how much force/grip will we have when spinning (a0) / sliding (b0).
I've also decreased wheel and engine inertias. In RBR you lock wheels nearly instantly with just braking, and usually spin them easily with throttle. Cars in RBR seem to have bigger inertia (rotate slowly) than in SR.

Differentials work like being locked with slip torque at 6000 already. Pressing handbrake also locks front wheels. I need to give input values to diffs and change their params from them.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Tires, questions .. Hard simulation WIP

Postby MrKoala » 17 Aug 2014, 20:26

Maybe a bit late, but here is what I can think of ATM.

How do the tire functions need to look like (generally) for gravel ? Has anybody found any references on internet?


The behavior of tires on loose surfaces depends on how "loose " the surface is. If the cohesion of surface material is greater than the friction between tire and top layer of surface material, the PacejKa curves or any type of friction-slip graph would look very similar to the dry hard surface counterpart, maybe somewhat downscaled. The grip goes up as slip ratio increases and after a certain level there is weakening again. The peak may be found at the same slip ratio as the dry hard surface counterpart, or slightly delayed. If the cohesion is weak, then the layers of surface material under the contact patches would slide against each other and the friction-slip curve/graph could go wild. For very loose solid particle based surfaces like fine sand and dry/packed snow, this slipping behavior is usually Coulomb and the (longitudinal acceleration) friction-slip curve would go up to a certain level and then just flat line. There's no significant strengthening nor weakening after the turning point. If the material is Newtonian like water, there will be significant strengthening and the curve would keep climbing up till a very high slip ratio level. On loose surfaces, the surface material also tends to accumulate in front of the tire under braking and turning, which creates strengthening.

Real life testing data for tire grip on loose surfaces tend to conflict a lot due to those different modes of grip. Therefore in some sense tweaking grip characteristics for gravel in a game is kinda easy. You can just play with whatever combination of those different modes and argue that what you get is the characteristics of that specific imaginary type of gravel surface.

This is just my uneducated guess but I think a reasonable design for typical gravel surface in a rally sim would be the high cohesion type. Just downscale the dry tarmac version a bit, turn down stiffness slightly and add a rising trend on braking and lateral curves.

For very loose surface types like sand pit, make the base grip level low and add a strong accumulation strengthening effect. The car won't get around in the sand easily but sliding side ways into it could result in a roll over.

How do I allow easy turning/steering of car - always ?
... ...
This is exactly so in Richard Burns Rally too. If you from stopped car press right and up arrow (full throttle and full steer to one side) it will almost instantly spin tires and steer car - won't go straight much, just will turn circles at that place.
... ...
And, do differentials have a lot or not that much to do with this ? I think somewhat yes.
Can anybody explain why in RBR the front diff has 320 Nm torque, rear has 700, and center 600 ? I mean why so different.

WRC cars tend to have a rear biased center diff. Additionally the heavier rear diff lock makes the lateral grip on the rear suffer a bit while allowing more effective torque output which is longitudinal. So it's more like a RWD car. The high steer lock also helps.

Center diff anti-slip usually don't have to be the strongest since longitudinal weight transfer is limited compared to lateral.

Steering left/right should just be turning (directly rotating) the car nearly always.
ATM in SR you can't do shit when sliding at speed, it just sticks to that direction it already had before.
Do I think right that this should be fixed with longitudial (Fx) function being quite flat and not much dropping without even visible peak?

It's not that uncommon to understeer on gravel. If you experience more "steerability" in RBR it's likely the accumulation effect in action, so lateral (not longitudinal) need to rise instead of to drop. For short wheelbase or high COG cars longitudinal weight transfer could shift more weight away from the rear when front is turned too much and skidding heavily.

Also anybody familiar with the differential mappings, i.e. functions how should diff's (front,rear,center) lock depending from throttle,brake position and car speed. Those are in RBR (like 9 functions) and supposedly were very important for rally drivers.

RBR's implementation of active diff mapping is really awkward TBO. The 1D curves mask each other, the throttle map doesn't care what gear ratio is in use, and the on-off LFB mode makes it jumpy when it shouldn't be. 2D mapping like this or this combined with a set or modification parameters and some interpolation would be more reasonable.

Allowing great steerability (being able to steer when spinning wheels) comes with very big Fx (longitudinal) force and little Fy (lateral).

As explained above this is probably not going in the realistic direction.


Sorry for not posting references. All the subscription walled stuff became inaccessible after I left the university and my regret for not backing up the papers isn't helping, nor is my Google-Fu.
MrKoala
 
Posts: 5
Joined: 16 Aug 2014, 01:50

Re: Tires, questions .. Hard simulation WIP

Postby CryHam » 17 Aug 2014, 21:15

Wow. I am speechless. This is great, awesome stuff.
So you learned all that at university..
Also great link, I didn't know there is such data on forums.
As for SR, ugh. We don't have code specific to gravel (yet).
I wonder how hard this cohesion is to implement, or is it just a 1 or 2 more params that change pacejka curves a bit.
But IDK maybe we should try first to get what's best from what already is coded. And think of that later.
If you can edit tires in game or know generally the shape or some real values of few points on pacejka curves that would be a good start.
Or if you know the approach of how to develop the simulation to be more real in general.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Tires, questions .. Hard simulation WIP

Postby MrKoala » 19 Aug 2014, 18:35

After taking a brief look into the car config files and VDrift documentation (which is quite sparse and not always clear) there seems to be many strange values, but the most obvious problem is the general grip level. The G graph does not have value labels for reference, so I made a skidpad for testing. Assuming the unit of coordinates in the road file is indeed SI meter then my test with the showroom-stock-looking ES/LanEvo ended up getting near 3G on tarmac and around 2G on gravel. Even the SLOW truck got over 2G on tarmac which is a bit too far from what people typically call "slow". With such crazy grip nothing else in the physical model can make things act normal.

Is there any direct numeric display of acceleration in HUD or some telemetry? Is my testing right?


I found that changing the Tire option in the surface file from asphalt to gravel alone results in significant change in tire behavior. The mysterious understeer is completely gone. What exactly is controlled by this option?
MrKoala
 
Posts: 5
Joined: 16 Aug 2014, 01:50

Re: Tires, questions .. Hard simulation WIP

Postby CryHam » 19 Aug 2014, 19:39

We have a wiki page about .car parameters here
it also explains what I added so far to test and edit cars in game.

What did you exactly change in which file for surface ?

Hmm. Indeed it shows 3G even when sliding.
This could be wrong, graphs aren't well described. I'll check it in code.
We have no telemetry, but there are some simulation values shown in, but there isn't car accel. there.
I could add it. But, do you build from sources ? If not then which OS do you use ?

Ok, accel. graph is updated in source/ogre/Hud_Graphs.cpp, line 418
{l Code}: {l Select All Code}
   MATHVECTOR<Dbl,3> v = dynamics.body.GetForce();
   (-dynamics.Orientation()).RotateVector(v);
   float m = dynamics.body.GetMass();
   for (int i=0; i < 3; ++i)
      pApp->graphs[i]->AddVal( std::max(0.f, std::min(1.f, float(
         v[i]/m *0.63f /9.81f/3.f + (i==2 ? 0.f : 0.5f) ) )));

So force divided by mass gives accel. Graph has total scale of 0..1.
Accel div by 9.81f should be 1G and is divided by 3.
Heh ok, but it is offset by 0.5f (since +,-) so the max value for x, y accel is -1,5 .. +1,5 not 3, my bad.
Or actually its nowhere written. So just assume that 1 grid line is 0.5 G.
Ugh, wait but there is also mul 0.63f, IDK I just probably scaled it so it fits better, and now doesn't have good values.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Tires, questions .. Hard simulation WIP

Postby MrKoala » 20 Aug 2014, 02:40

Thanks.

I'm using the Windows binary release ATM but I've no problem building on either OS. Will do.

The surface file is /data/carsim/normal/surfaces.cfg .

{l Code}: {l Select All Code}
#----------------------------------------------------------------------------------------------------
#-- Asphalt, VDrift
#----------------------------------------------------------------------------------------------------

[ Asphalt ]
BumpAmplitude = 0.01
BumpWaveLength = 40.0
FrictionTread = 1.0
ID = 1
RollResistance = 1
RollingDrag = 1
Tire = gravel         #asphalt

[ AsphaltWet ]
BumpAmplitude = 0.01
BumpWaveLength = 40.0
FrictionTread = 0.5
ID = 1
RollResistance = 1
RollingDrag = 1
Tire = gravel         #old_asphalt

[ grassVdrift ]
BumpAmplitude = 0.12
BumpWaveLength = 20.0
FrictionTread = 0.70
ID = 5
RollResistance = 1
RollingDrag = 60
Tire = gravel
MrKoala
 
Posts: 5
Joined: 16 Aug 2014, 01:50

Re: Tires, questions .. Hard simulation WIP

Postby CryHam » 20 Aug 2014, 17:21

Great.
This way I can fix some visualizations or code and we can test faster.
It is much easier to build on Ubuntu or such. Definitely a lot more trouble on Windows.

Apropo surfaces, they change depending on which car's wheel is.
Gravel is probably best to test on Test1-Flat (and TestC4-ow). (you can remove that junk or customize it in editor)
Asphalt is what you have on Test2-Asphalt. And 2 more VDrift track. Which are not the main thing here.
AsphaltWet is only on mosport (also VDrift track).

So I recommend using Test1-Flat with gravel (don't mind the grass), the whole terrain has a surface 'roadJungle', so it's easier to test.
You can change which surface (if needed) in editor on tab Surface, use mousewheel on combo. Or just in scene.xml for that track, it's in <texture, surf="roadJungle". And if there is road then its in <texture road="1" surf="roadJungle".

Just to test and be sure that you drive exactly on that surface use alt-F9 to show surfaces under each wheel with most of their params (also tire preset). Will show gravel on Test1.

Next thing. I've recently added editing surface params with sliders. Is in Tweak window (Alt-Z), tab Surface. Might be buggy. And no saving yet.
Surfaces

And params for this surface and in data/carsim/hard/surfaces.cfg under [ roadJungle ] section.
I assume we develop here the hard simulation mode, pick it on Game tab. Just to be sure your game.cfg will have then 'sim_mode = hard' somewhere inside.

I've updated a bit the Wikis (and also split to tweak tools and .car params:
Tweak
CarEditing
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Tires, questions .. Hard simulation WIP

Postby CryHam » 12 Dec 2014, 11:49

There is some update on master. Mainly to manage tires.
http://imgur.com/UU9oe3b
One can now load tires from list, delete, there is a reference graph to check it, fixed tire circles vis, added sound for locked braking, etc.
I got like 61 tires now, gathered all my edits so far and I'm picking best.
I have 1 which is awesome, behaves like I wanted at low speeds, but seems to have too little grip when driving fast. IDK yet.
Need to learn sth more from all those setups.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Tires, questions ..

Postby CryHam » 10 Jul 2015, 16:18

OK Hard simulation is being dropped, it will not happen, I won't waste more time on it.
There is lots of debug and develop stuff on tweak tab, if anybody wanted to play/tinker/tweak sim and cars.
And OFC I'm still curious about tires, but not to the point of reading books about them (which won't ever answer the questions I have).
I guess having a new programmer has likely the same improbability as finding a tire expert so whatever.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Who is online

Users browsing this forum: No registered users and 1 guest