Defining car speed relative to rear wheels rotation

Started by
17 comments, last by jujunosuke 12 years, 3 months ago
Ok, Here is my new drivetrain model.

But i have one problem, actually i am testing the acceleration with the first gear.
And my car just keep acceleration, i go over 200 kmh in first gear...



//Get Torque from curve
var maxTorque:Number = getTorqueCurve( getRpmEngine() );

//Calculate Drive Torque
TorqueDrive = maxTorque * firstGear * differentialRatio * transmissionEfficiency;
ForceDrive = TorqueDrive / WHEEL_RADIUS;


//Traction torque
TorqueTotal = TorqueDrive + TorqueTraction + TorqueBrake;

//Back wheel angular velocity
backWheelsAngularAcceleration = TorqueTotal / (getCylinderInertia( 1000, WHEEL_RADIUS) * 2);
backWheelsAngularVelocity += backWheelsAngularAcceleration * TIME_STEP;

var rpsWheels:Number = backWheelsAngularVelocity / (2 * Math.PI);
rpmWheels = rpsWheels * 60;

var slipRatio:Number = getSlipRatio(backWheelsAngularVelocity, velocity);
var ForcePacejka = Pacejka.longitudinal( slipRatio );//pacejka force
ForceTraction = -ForcePacejka;//I don't know if it is correct but i put a minus sign to counteract the drive force

TorqueTraction = ForceTraction * WHEEL_RADIUS;

//Calculate resultant car acceleration and velocity
acceleration = ForcePacejka / mass;
velocity += acceleration * TIME_STEP;



Any suggestion on the following code ?
regards.
Advertisement
Sorry to spam the board :)

I found a soluction (hack) that solved my problem.

I just set the slipRatio to 0 if the slip ratio is under some value.
example :


if (slipRatio < 1) {
slipRatio = 0;
}


This help me to get more stable results. I hope it can help someone who is stuck in a similar situation.
Thank you for the help.

regards.
what are the parameters used in the pacejika formula?

It is very important you take some time to understand those values, build yourself a small editor that is able to plot the curve generated by a set of parameters so you can understand how each one of them is affecting the curves.

I would suggest you to drop the pacejika aside for a moment and just use a linear force vs slip relation. Make sure everything works as expected then dive into more complex slip models. At the moment there are too many things that can go wrong in that code.

There is no reason to cut the slip ratio under 1. Actually most of the time the slip is very low, reaching a peak at around 0.2 .

Recode with a linear relationship and have the program print out a line per iteration with all the relevant torques, forces and velocities.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

Hi Kunos.
You are right, my formula was wrong and not stable. That is why i used hack.

Here is my drive model (which is believe is wrong).

//Get Torque from curve
var maxTorque:Number = getTorqueCurve( getRpmEngine() );

TorqueDrive = maxTorque * firstGear * differentialRatio * transmissionEfficiency;
ForceDrive = TorqueDrive / WHEEL_RADIUS;


//Traction torque
TorqueTotal = TorqueDrive + TorqueTraction + TorqueBrake;

//Back wheel angular velocity
backWheelsAngularAcceleration = TorqueTotal / (getCylinderInertia( 1500, WHEEL_RADIUS) * 2);
backWheelsAngularVelocity += backWheelsAngularAcceleration * TIME_STEP;
var rpsWheels:Number = backWheelsAngularVelocity / (2 * Math.PI);
rpmWheels = rpsWheels * 60;


var sr:Number = getSlipRatio(backWheelsAngularVelocity, velocity);

//Normalized pacejka force
var ForcePacejka = Pacejka.longitudinal( sr );

ForceTraction = ForceDrive * ForcePacejka;
TorqueTraction = ForceTraction * WHEEL_RADIUS;

ForceLong = ForceTraction;

//Calculate resultant car acceleration and velocity
acceleration = ForceLong / mass;
velocity += acceleration * TIME_STEP;

var kmh:Number = (velocity / 1000) * 60 * 60;//if velocity is in m/s (need to be verified).


And here is the output results i get. It is crazy output.


TDrive 3461 TTraction 977 rearWheelsAngV 0.3 velocity 0 SR 0.3 kmh 0.1
TDrive 3461 TTraction 65021 rearWheelsAngV 0.8 velocity 2.2 SR 23.4 kmh 7.9
TDrive 3461 TTraction 6941 rearWheelsAngV 7.7 velocity 2.4 SR 2.5 kmh 8.8
TDrive 3461 TTraction 7213 rearWheelsAngV 8.8 velocity 2.6 SR 2.6 kmh 9.7
TDrive 3488 TTraction 7495 rearWheelsAngV 9.9 velocity 2.9 SR 2.6 kmh 10.6
TDrive 3547 TTraction 7810 rearWheelsAngV 11 velocity 3.2 SR 2.7 kmh 11.5
TDrive 3604 TTraction 8095 rearWheelsAngV 12.2 velocity 3.4 SR 2.8 kmh 12.5
TDrive 3659 TTraction 8355 rearWheelsAngV 13.4 velocity 3.7 SR 2.8 kmh 13.5
TDrive 3712 TTraction 8592 rearWheelsAngV 14.6 velocity 4 SR 2.8 kmh 14.6
TDrive 3762 TTraction 8808 rearWheelsAngV 15.9 velocity 4.3 SR 2.9 kmh 15.6
TDrive 3810 TTraction 9005 rearWheelsAngV 17.2 velocity 4.6 SR 2.9 kmh 16.7
TDrive 3854 TTraction 9185 rearWheelsAngV 18.5 velocity 4.9 SR 2.9 kmh 17.8
TDrive 3896 TTraction 9349 rearWheelsAngV 19.8 velocity 5.2 SR 2.9 kmh 19
TDrive 3934 TTraction 9497 rearWheelsAngV 21.2 velocity 5.6 SR 3 kmh 20.1
TDrive 3968 TTraction 9632 rearWheelsAngV 22.5 velocity 5.9 SR 3 kmh 21.3
TDrive 4000 TTraction 9752 rearWheelsAngV 23.9 velocity 6.2 SR 3 kmh 22.5
TDrive 4028 TTraction 9861 rearWheelsAngV 25.3 velocity 6.5 SR 3 kmh 23.7
TDrive 4053 TTraction 9957 rearWheelsAngV 26.8 velocity 6.9 SR 3 kmh 24.9


My linear pacejka. (I made it linear)

//=============================================================================
// LONGITUDINAL
//==============================================================================
public static function longitudinal( slipRatio:Number ):Number {
/*
var b:Number = 0.714;
var c:Number = 1.40;
var d:Number = 1.0;
var e:Number = -0.20;

var maxValue:Number = 9000;

var force:Number = d * Math.sin( c * Math.atan( b * (1-e) * slipRatio + e * Math.atan(b * slipRatio) ) );
return force * maxValue;
*/

return slipRatio * 0.8;
}
k.. it's getting more clear now..here are some mistakes:

ForceTraction = ForceDrive * ForcePacejka;

This should be something like :

ForceTraction = WheelLoad * ForcePacejka;

Remember, engine torque accelerate the wheel, this create slip and the slip accelerate the car.

To be correct, the pacejka "force" function should have a load as input:

public static float PacejkaLong(float slipRatio, float load);

And do the multiplication in there.

The load could be a static value calculated from the car's mass and the weight distribution or a dynamic one that takes into a account the weight shift (you should definitely do this one)

I also thing this:

TorqueTotal = TorqueDrive + TorqueTraction + TorqueBrake;

Should change into:

TorqueTotal = TorqueDrive - TorqueTraction + TorqueBrake;

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

kunos, again, your help is so much appreciated !
Thank you so much for taking time to help me.

I think i understand where was my mistakes. Your explanations about the load make sense. I will make the modifications and give it a try.
Hi !
Ok, here is my report, everything is ALMOST perfect !
Acceleration, cruising, and brake looks to work exept one thing.

Actually i have a funny problem, right now in my model, the acceleration of the car is calculated with the slip ratio generated from rearWheel vel vs car vel.
At the end of the first gear, the rpm go over 6000 and the drive torque fall down to 0.
Then, my rearWheels angAcceleration become 0 and my rearWheelsAngV stay at 55.9

But the car speed seems to be late compared to the rearWheels speed, this mean that at that time there is still some slipratio and my car continue to accelerate !wacko.png

Here is my output illustration :

TDrive 3461 TTraction -1980 TTotal 3461 rearWheelsAngV 0.7 velocity 0 SR 0.7 kmh 0.2
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 1 velocity 0.1 SR 14.1 kmh 0.4
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 1.3 velocity 0.1 SR 8.8 kmh 0.7
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 1.6 velocity 0.2 SR 7 kmh 0.9
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 1.9 velocity 0.3 SR 6.1 kmh 1.1
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 2.2 velocity 0.3 SR 5.6 kmh 1.4
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 2.5 velocity 0.4 SR 5.3 kmh 1.6
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 2.8 velocity 0.5 SR 5 kmh 1.9
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 3.1 velocity 0.5 SR 4.8 kmh 2.1
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 3.4 velocity 0.6 SR 4.7 kmh 2.3
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 3.7 velocity 0.7 SR 4.5 kmh 2.6
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 4 velocity 0.7 SR 4.5 kmh 2.8
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 4.3 velocity 0.8 SR 4.4 kmh 3.1
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 4.6 velocity 0.9 SR 4.3 kmh 3.3
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 4.9 velocity 0.9 SR 4.2 kmh 3.5
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 5.2 velocity 1 SR 4.2 kmh 3.8
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 5.5 velocity 1.1 SR 4.2 kmh 4
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 5.8 velocity 1.1 SR 4.1 kmh 4.3
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 6.1 velocity 1.2 SR 4.1 kmh 4.5
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 6.4 velocity 1.3 SR 4 kmh 4.7
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 6.7 velocity 1.3 SR 4 kmh 5
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 7 velocity 1.4 SR 4 kmh 5.2
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 7.3 velocity 1.5 SR 4 kmh 5.5
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 7.6 velocity 1.5 SR 4 kmh 5.7
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 7.9 velocity 1.6 SR 3.9 kmh 5.9
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 8.2 velocity 1.7 SR 3.9 kmh 6.2
TDrive 3461 TTraction -1980 TTotal 1481 rearWheelsAngV 8.5 velocity 1.7 SR 3.9 kmh 6.4
TDrive 3472 TTraction -1980 TTotal 1492 rearWheelsAngV 8.8 velocity 1.8 SR 3.9 kmh 6.7
TDrive 3489 TTraction -1980 TTotal 1509 rearWheelsAngV 9.1 velocity 1.9 SR 3.9 kmh 6.9
TDrive 3506 TTraction -1980 TTotal 1526 rearWheelsAngV 9.4 velocity 1.9 SR 3.9 kmh 7.1
TDrive 3523 TTraction -1980 TTotal 1543 rearWheelsAngV 9.8 velocity 2 SR 3.9 kmh 7.4
TDrive 3539 TTraction -1980 TTotal 1559 rearWheelsAngV 10.1 velocity 2.1 SR 3.9 kmh 7.6
TDrive 3556 TTraction -1980 TTotal 1576 rearWheelsAngV 10.4 velocity 2.1 SR 3.9 kmh 7.9
TDrive 3573 TTraction -1980 TTotal 1593 rearWheelsAngV 10.7 velocity 2.2 SR 3.9 kmh 8.1
TDrive 3589 TTraction -1980 TTotal 1609 rearWheelsAngV 11 velocity 2.3 SR 3.9 kmh 8.3
TDrive 3605 TTraction -1980 TTotal 1625 rearWheelsAngV 11.4 velocity 2.3 SR 3.9 kmh 8.6
TDrive 3621 TTraction -1980 TTotal 1641 rearWheelsAngV 11.7 velocity 2.4 SR 3.9 kmh 8.8
TDrive 3637 TTraction -1980 TTotal 1657 rearWheelsAngV 12.1 velocity 2.5 SR 3.9 kmh 9
TDrive 3653 TTraction -1980 TTotal 1673 rearWheelsAngV 12.4 velocity 2.5 SR 3.9 kmh 9.3
TDrive 3669 TTraction -1980 TTotal 1689 rearWheelsAngV 12.7 velocity 2.6 SR 3.9 kmh 9.5
TDrive 3684 TTraction -1980 TTotal 1704 rearWheelsAngV 13.1 velocity 2.7 SR 3.9 kmh 9.8
TDrive 3699 TTraction -1980 TTotal 1719 rearWheelsAngV 13.4 velocity 2.7 SR 3.9 kmh 10
TDrive 3714 TTraction -1980 TTotal 1734 rearWheelsAngV 13.8 velocity 2.8 SR 3.9 kmh 10.2
TDrive 3729 TTraction -1980 TTotal 1749 rearWheelsAngV 14.1 velocity 2.9 SR 3.9 kmh 10.5
TDrive 3744 TTraction -1980 TTotal 1764 rearWheelsAngV 14.5 velocity 2.9 SR 3.9 kmh 10.7
TDrive 3758 TTraction -1980 TTotal 1778 rearWheelsAngV 14.9 velocity 3 SR 3.9 kmh 11
TDrive 3772 TTraction -1980 TTotal 1792 rearWheelsAngV 15.2 velocity 3.1 SR 4 kmh 11.2
TDrive 3786 TTraction -1980 TTotal 1806 rearWheelsAngV 15.6 velocity 3.1 SR 4 kmh 11.4
TDrive 3800 TTraction -1980 TTotal 1820 rearWheelsAngV 16 velocity 3.2 SR 4 kmh 11.7
TDrive 3813 TTraction -1980 TTotal 1833 rearWheelsAngV 16.4 velocity 3.3 SR 4 kmh 11.9
TDrive 3827 TTraction -1980 TTotal 1847 rearWheelsAngV 16.7 velocity 3.3 SR 4 kmh 12.1
TDrive 3840 TTraction -1980 TTotal 1860 rearWheelsAngV 17.1 velocity 3.4 SR 4 kmh 12.4
TDrive 3852 TTraction -1980 TTotal 1872 rearWheelsAngV 17.5 velocity 3.5 SR 4 kmh 12.6
TDrive 3865 TTraction -1980 TTotal 1885 rearWheelsAngV 17.9 velocity 3.5 SR 4 kmh 12.9
TDrive 3877 TTraction -1980 TTotal 1897 rearWheelsAngV 18.3 velocity 3.6 SR 4.1 kmh 13.1
TDrive 3889 TTraction -1980 TTotal 1909 rearWheelsAngV 18.7 velocity 3.7 SR 4.1 kmh 13.3
TDrive 3901 TTraction -1980 TTotal 1921 rearWheelsAngV 19 velocity 3.7 SR 4.1 kmh 13.6
TDrive 3912 TTraction -1980 TTotal 1932 rearWheelsAngV 19.4 velocity 3.8 SR 4.1 kmh 13.8
TDrive 3923 TTraction -1980 TTotal 1943 rearWheelsAngV 19.8 velocity 3.9 SR 4.1 kmh 14
TDrive 3934 TTraction -1980 TTotal 1954 rearWheelsAngV 20.2 velocity 3.9 SR 4.1 kmh 14.3
TDrive 3945 TTraction -1980 TTotal 1965 rearWheelsAngV 20.6 velocity 4 SR 4.1 kmh 14.5
TDrive 3955 TTraction -1980 TTotal 1975 rearWheelsAngV 21 velocity 4.1 SR 4.2 kmh 14.8
TDrive 3965 TTraction -1980 TTotal 1985 rearWheelsAngV 21.4 velocity 4.1 SR 4.2 kmh 15
TDrive 3975 TTraction -1980 TTotal 1995 rearWheelsAngV 21.8 velocity 4.2 SR 4.2 kmh 15.2
TDrive 3984 TTraction -1980 TTotal 2004 rearWheelsAngV 22.3 velocity 4.3 SR 4.2 kmh 15.5
TDrive 3993 TTraction -1980 TTotal 2013 rearWheelsAngV 22.7 velocity 4.3 SR 4.2 kmh 15.7
TDrive 4002 TTraction -1980 TTotal 2022 rearWheelsAngV 23.1 velocity 4.4 SR 4.2 kmh 15.9
TDrive 4011 TTraction -1980 TTotal 2031 rearWheelsAngV 23.5 velocity 4.5 SR 4.2 kmh 16.2
TDrive 4019 TTraction -1980 TTotal 2039 rearWheelsAngV 23.9 velocity 4.5 SR 4.3 kmh 16.4
TDrive 4027 TTraction -1980 TTotal 2047 rearWheelsAngV 24.3 velocity 4.6 SR 4.3 kmh 16.7
TDrive 4035 TTraction -1980 TTotal 2055 rearWheelsAngV 24.7 velocity 4.7 SR 4.3 kmh 16.9
TDrive 4043 TTraction -1980 TTotal 2063 rearWheelsAngV 25.2 velocity 4.7 SR 4.3 kmh 17.1
TDrive 4050 TTraction -1980 TTotal 2070 rearWheelsAngV 25.6 velocity 4.8 SR 4.3 kmh 17.4
TDrive 4057 TTraction -1980 TTotal 2077 rearWheelsAngV 26 velocity 4.9 SR 4.3 kmh 17.6
TDrive 4063 TTraction -1980 TTotal 2083 rearWheelsAngV 26.4 velocity 4.9 SR 4.4 kmh 17.8
TDrive 4070 TTraction -1980 TTotal 2090 rearWheelsAngV 26.9 velocity 5 SR 4.4 kmh 18.1
TDrive 4076 TTraction -1980 TTotal 2096 rearWheelsAngV 27.3 velocity 5.1 SR 4.4 kmh 18.3
TDrive 4082 TTraction -1980 TTotal 2102 rearWheelsAngV 27.7 velocity 5.1 SR 4.4 kmh 18.6
TDrive 4087 TTraction -1980 TTotal 2107 rearWheelsAngV 28.2 velocity 5.2 SR 4.4 kmh 18.8
TDrive 4093 TTraction -1980 TTotal 2113 rearWheelsAngV 28.6 velocity 5.3 SR 4.4 kmh 19
TDrive 4098 TTraction -1980 TTotal 2118 rearWheelsAngV 29 velocity 5.3 SR 4.4 kmh 19.3
TDrive 4103 TTraction -1980 TTotal 2123 rearWheelsAngV 29.5 velocity 5.4 SR 4.4 kmh 19.5
TDrive 4107 TTraction -1980 TTotal 2127 rearWheelsAngV 29.9 velocity 5.4 SR 4.5 kmh 19.7
TDrive 4112 TTraction -1980 TTotal 2132 rearWheelsAngV 30.3 velocity 5.5 SR 4.5 kmh 20
TDrive 4116 TTraction -1980 TTotal 2136 rearWheelsAngV 30.8 velocity 5.6 SR 4.5 kmh 20.2
TDrive 4120 TTraction -1980 TTotal 2140 rearWheelsAngV 31.2 velocity 5.6 SR 4.5 kmh 20.5
TDrive 4123 TTraction -1980 TTotal 2143 rearWheelsAngV 31.6 velocity 5.7 SR 4.5 kmh 20.7
TDrive 4127 TTraction -1980 TTotal 2147 rearWheelsAngV 32.1 velocity 5.8 SR 4.5 kmh 20.9
TDrive 4130 TTraction -1980 TTotal 2150 rearWheelsAngV 32.5 velocity 5.8 SR 4.5 kmh 21.2
TDrive 4133 TTraction -1980 TTotal 2153 rearWheelsAngV 32.9 velocity 5.9 SR 4.6 kmh 21.4
TDrive 4136 TTraction -1980 TTotal 2156 rearWheelsAngV 33.4 velocity 6 SR 4.6 kmh 21.6
TDrive 4139 TTraction -1980 TTotal 2159 rearWheelsAngV 33.8 velocity 6 SR 4.6 kmh 21.9
TDrive 4141 TTraction -1980 TTotal 2161 rearWheelsAngV 34.3 velocity 6.1 SR 4.6 kmh 22.1
TDrive 4143 TTraction -1980 TTotal 2163 rearWheelsAngV 34.7 velocity 6.2 SR 4.6 kmh 22.3
TDrive 4146 TTraction -1980 TTotal 2166 rearWheelsAngV 35.2 velocity 6.2 SR 4.6 kmh 22.6
TDrive 4148 TTraction -1980 TTotal 2168 rearWheelsAngV 35.6 velocity 6.3 SR 4.6 kmh 22.8
TDrive 4149 TTraction -1980 TTotal 2169 rearWheelsAngV 36 velocity 6.4 SR 4.6 kmh 23
TDrive 4151 TTraction -1980 TTotal 2171 rearWheelsAngV 36.5 velocity 6.4 SR 4.6 kmh 23.3
TDrive 4152 TTraction -1980 TTotal 2172 rearWheelsAngV 36.9 velocity 6.5 SR 4.7 kmh 23.5
TDrive 4161 TTraction -1980 TTotal 2181 rearWheelsAngV 37.4 velocity 6.6 SR 4.7 kmh 23.8
TDrive 4161 TTraction -1980 TTotal 2181 rearWheelsAngV 37.8 velocity 6.6 SR 4.7 kmh 24
TDrive 4161 TTraction -1980 TTotal 2181 rearWheelsAngV 38.3 velocity 6.7 SR 4.7 kmh 24.2
TDrive 4160 TTraction -1980 TTotal 2180 rearWheelsAngV 38.7 velocity 6.8 SR 4.7 kmh 24.5
TDrive 4159 TTraction -1980 TTotal 2179 rearWheelsAngV 39.2 velocity 6.8 SR 4.7 kmh 24.7
TDrive 4157 TTraction -1980 TTotal 2177 rearWheelsAngV 39.6 velocity 6.9 SR 4.7 kmh 24.9
TDrive 4154 TTraction -1980 TTotal 2174 rearWheelsAngV 40 velocity 7 SR 4.7 kmh 25.2
TDrive 4151 TTraction -1980 TTotal 2171 rearWheelsAngV 40.5 velocity 7 SR 4.7 kmh 25.4
TDrive 4145 TTraction -1980 TTotal 2165 rearWheelsAngV 40.9 velocity 7.1 SR 4.7 kmh 25.6
TDrive 4139 TTraction -1980 TTotal 2159 rearWheelsAngV 41.4 velocity 7.2 SR 4.8 kmh 25.9
TDrive 4131 TTraction -1980 TTotal 2151 rearWheelsAngV 41.8 velocity 7.2 SR 4.8 kmh 26.1
TDrive 4122 TTraction -1980 TTotal 2142 rearWheelsAngV 42.2 velocity 7.3 SR 4.8 kmh 26.3
TDrive 4110 TTraction -1980 TTotal 2130 rearWheelsAngV 42.7 velocity 7.3 SR 4.8 kmh 26.6
TDrive 4097 TTraction -1980 TTotal 2117 rearWheelsAngV 43.1 velocity 7.4 SR 4.8 kmh 26.8
TDrive 4082 TTraction -1980 TTotal 2102 rearWheelsAngV 43.5 velocity 7.5 SR 4.8 kmh 27.1
TDrive 4065 TTraction -1980 TTotal 2085 rearWheelsAngV 44 velocity 7.5 SR 4.8 kmh 27.3
TDrive 4045 TTraction -1980 TTotal 2065 rearWheelsAngV 44.4 velocity 7.6 SR 4.8 kmh 27.5
TDrive 4024 TTraction -1980 TTotal 2044 rearWheelsAngV 44.8 velocity 7.7 SR 4.8 kmh 27.8
TDrive 4000 TTraction -1980 TTotal 2020 rearWheelsAngV 45.2 velocity 7.7 SR 4.8 kmh 28
TDrive 3974 TTraction -1980 TTotal 1994 rearWheelsAngV 45.6 velocity 7.8 SR 4.8 kmh 28.2
TDrive 3945 TTraction -1980 TTotal 1965 rearWheelsAngV 46 velocity 7.9 SR 4.8 kmh 28.5
TDrive 3915 TTraction -1980 TTotal 1935 rearWheelsAngV 46.4 velocity 7.9 SR 4.8 kmh 28.7
TDrive 3882 TTraction -1980 TTotal 1902 rearWheelsAngV 46.8 velocity 8 SR 4.8 kmh 28.9
TDrive 3847 TTraction -1980 TTotal 1867 rearWheelsAngV 47.2 velocity 8.1 SR 4.8 kmh 29.2
TDrive 3810 TTraction -1980 TTotal 1830 rearWheelsAngV 47.6 velocity 8.1 SR 4.8 kmh 29.4
TDrive 3770 TTraction -1980 TTotal 1790 rearWheelsAngV 47.9 velocity 8.2 SR 4.8 kmh 29.6
TDrive 3729 TTraction -1980 TTotal 1749 rearWheelsAngV 48.3 velocity 8.3 SR 4.8 kmh 29.9
TDrive 3687 TTraction -1980 TTotal 1707 rearWheelsAngV 48.6 velocity 8.3 SR 4.8 kmh 30.1
TDrive 3642 TTraction -1980 TTotal 1662 rearWheelsAngV 49 velocity 8.4 SR 4.8 kmh 30.3
TDrive 3596 TTraction -1980 TTotal 1616 rearWheelsAngV 49.3 velocity 8.5 SR 4.8 kmh 30.6
TDrive 3549 TTraction -1980 TTotal 1569 rearWheelsAngV 49.6 velocity 8.5 SR 4.8 kmh 30.8
TDrive 3501 TTraction -1980 TTotal 1521 rearWheelsAngV 49.9 velocity 8.6 SR 4.8 kmh 31
TDrive 3452 TTraction -1980 TTotal 1472 rearWheelsAngV 50.2 velocity 8.7 SR 4.8 kmh 31.3
TDrive 3402 TTraction -1980 TTotal 1422 rearWheelsAngV 50.5 velocity 8.7 SR 4.8 kmh 31.5
TDrive 3352 TTraction -1980 TTotal 1372 rearWheelsAngV 50.8 velocity 8.8 SR 4.7 kmh 31.7
TDrive 3302 TTraction -1980 TTotal 1322 rearWheelsAngV 51.1 velocity 8.8 SR 4.7 kmh 32
TDrive 3251 TTraction -1980 TTotal 1271 rearWheelsAngV 51.3 velocity 8.9 SR 4.7 kmh 32.2
TDrive 3201 TTraction -1980 TTotal 1221 rearWheelsAngV 51.6 velocity 9 SR 4.7 kmh 32.5
TDrive 3151 TTraction -1980 TTotal 1171 rearWheelsAngV 51.8 velocity 9 SR 4.7 kmh 32.7
TDrive 3101 TTraction -1980 TTotal 1121 rearWheelsAngV 52 velocity 9.1 SR 4.7 kmh 32.9
TDrive 3052 TTraction -1980 TTotal 1072 rearWheelsAngV 52.3 velocity 9.2 SR 4.7 kmh 33.2
TDrive 3004 TTraction -1980 TTotal 1024 rearWheelsAngV 52.5 velocity 9.2 SR 4.6 kmh 33.4
TDrive 2956 TTraction -1980 TTotal 976 rearWheelsAngV 52.7 velocity 9.3 SR 4.6 kmh 33.6
TDrive 2910 TTraction -1980 TTotal 930 rearWheelsAngV 52.9 velocity 9.4 SR 4.6 kmh 33.9
TDrive 2864 TTraction -1980 TTotal 884 rearWheelsAngV 53 velocity 9.4 SR 4.6 kmh 34.1
TDrive 2820 TTraction -1980 TTotal 840 rearWheelsAngV 53.2 velocity 9.5 SR 4.6 kmh 34.3
TDrive 2778 TTraction -1980 TTotal 798 rearWheelsAngV 53.4 velocity 9.6 SR 4.5 kmh 34.6
TDrive 2736 TTraction -1980 TTotal 756 rearWheelsAngV 53.5 velocity 9.6 SR 4.5 kmh 34.8
TDrive 2696 TTraction -1980 TTotal 716 rearWheelsAngV 53.7 velocity 9.7 SR 4.5 kmh 35
TDrive 2657 TTraction -1980 TTotal 677 rearWheelsAngV 53.8 velocity 9.8 SR 4.5 kmh 35.3
TDrive 2620 TTraction -1980 TTotal 640 rearWheelsAngV 53.9 velocity 9.8 SR 4.5 kmh 35.5
TDrive 2584 TTraction -1980 TTotal 604 rearWheelsAngV 54.1 velocity 9.9 SR 4.4 kmh 35.7
TDrive 2550 TTraction -1980 TTotal 570 rearWheelsAngV 54.2 velocity 10 SR 4.4 kmh 36
TDrive 2517 TTraction -1980 TTotal 537 rearWheelsAngV 54.3 velocity 10 SR 4.4 kmh 36.2
TDrive 2486 TTraction -1980 TTotal 506 rearWheelsAngV 54.4 velocity 10.1 SR 4.4 kmh 36.4
TDrive 2456 TTraction -1980 TTotal 476 rearWheelsAngV 54.5 velocity 10.1 SR 4.3 kmh 36.7
TDrive 2428 TTraction -1980 TTotal 448 rearWheelsAngV 54.6 velocity 10.2 SR 4.3 kmh 36.9
TDrive 2401 TTraction -1980 TTotal 421 rearWheelsAngV 54.7 velocity 10.3 SR 4.3 kmh 37.1
TDrive 2375 TTraction -1980 TTotal 395 rearWheelsAngV 54.8 velocity 10.3 SR 4.3 kmh 37.4
TDrive 2351 TTraction -1980 TTotal 371 rearWheelsAngV 54.8 velocity 10.4 SR 4.2 kmh 37.6
TDrive 2328 TTraction -1980 TTotal 348 rearWheelsAngV 54.9 velocity 10.5 SR 4.2 kmh 37.8
TDrive 2306 TTraction -1980 TTotal 326 rearWheelsAngV 55 velocity 10.5 SR 4.2 kmh 38.1
TDrive 2286 TTraction -1980 TTotal 306 rearWheelsAngV 55 velocity 10.6 SR 4.2 kmh 38.3
TDrive 2267 TTraction -1980 TTotal 287 rearWheelsAngV 55.1 velocity 10.7 SR 4.1 kmh 38.5
TDrive 2248 TTraction -1980 TTotal 268 rearWheelsAngV 55.1 velocity 10.7 SR 4.1 kmh 38.7
TDrive 2231 TTraction -1980 TTotal 251 rearWheelsAngV 55.2 velocity 10.8 SR 4.1 kmh 39
TDrive 2215 TTraction -1980 TTotal 235 rearWheelsAngV 55.2 velocity 10.9 SR 4.1 kmh 39.2
TDrive 2200 TTraction -1980 TTotal 220 rearWheelsAngV 55.3 velocity 10.9 SR 4 kmh 39.4
TDrive 2185 TTraction -1980 TTotal 205 rearWheelsAngV 55.3 velocity 11 SR 4 kmh 39.7
TDrive 2172 TTraction -1980 TTotal 192 rearWheelsAngV 55.4 velocity 11.1 SR 4 kmh 39.9
TDrive 2159 TTraction -1980 TTotal 179 rearWheelsAngV 55.4 velocity 11.1 SR 3.9 kmh 40.1
TDrive 2147 TTraction -1980 TTotal 167 rearWheelsAngV 55.4 velocity 11.2 SR 3.9 kmh 40.4
TDrive 2136 TTraction -1980 TTotal 156 rearWheelsAngV 55.5 velocity 11.2 SR 3.9 kmh 40.6
TDrive 2126 TTraction -1980 TTotal 146 rearWheelsAngV 55.5 velocity 11.3 SR 3.9 kmh 40.8
TDrive 2116 TTraction -1980 TTotal 136 rearWheelsAngV 55.5 velocity 11.4 SR 3.8 kmh 41.1
TDrive 2107 TTraction -1980 TTotal 127 rearWheelsAngV 55.6 velocity 11.4 SR 3.8 kmh 41.3
TDrive 2098 TTraction -1980 TTotal 118 rearWheelsAngV 55.6 velocity 11.5 SR 3.8 kmh 41.5
TDrive 2090 TTraction -1980 TTotal 110 rearWheelsAngV 55.6 velocity 11.6 SR 3.8 kmh 41.8
TDrive 2083 TTraction -1980 TTotal 103 rearWheelsAngV 55.6 velocity 11.6 SR 3.7 kmh 42
TDrive 2076 TTraction -1980 TTotal 96 rearWheelsAngV 55.6 velocity 11.7 SR 3.7 kmh 42.2
TDrive 2069 TTraction -1980 TTotal 89 rearWheelsAngV 55.7 velocity 11.8 SR 3.7 kmh 42.5
TDrive 2063 TTraction -1980 TTotal 83 rearWheelsAngV 55.7 velocity 11.8 SR 3.7 kmh 42.7
TDrive 2058 TTraction -1980 TTotal 78 rearWheelsAngV 55.7 velocity 11.9 SR 3.6 kmh 42.9
TDrive 2052 TTraction -1980 TTotal 72 rearWheelsAngV 55.7 velocity 12 SR 3.6 kmh 43.2
TDrive 2047 TTraction -1980 TTotal 67 rearWheelsAngV 55.7 velocity 12 SR 3.6 kmh 43.4
TDrive 2043 TTraction -1980 TTotal 63 rearWheelsAngV 55.7 velocity 12.1 SR 3.6 kmh 43.6
TDrive 2038 TTraction -1980 TTotal 58 rearWheelsAngV 55.8 velocity 12.1 SR 3.6 kmh 43.9
TDrive 2034 TTraction -1980 TTotal 54 rearWheelsAngV 55.8 velocity 12.2 SR 3.5 kmh 44.1
TDrive 2031 TTraction -1980 TTotal 51 rearWheelsAngV 55.8 velocity 12.3 SR 3.5 kmh 44.3
TDrive 2027 TTraction -1980 TTotal 47 rearWheelsAngV 55.8 velocity 12.3 SR 3.5 kmh 44.5
TDrive 2024 TTraction -1980 TTotal 44 rearWheelsAngV 55.8 velocity 12.4 SR 3.5 kmh 44.8
TDrive 2021 TTraction -1980 TTotal 41 rearWheelsAngV 55.8 velocity 12.5 SR 3.4 kmh 45
TDrive 2018 TTraction -1980 TTotal 38 rearWheelsAngV 55.8 velocity 12.5 SR 3.4 kmh 45.2
TDrive 2015 TTraction -1980 TTotal 35 rearWheelsAngV 55.8 velocity 12.6 SR 3.4 kmh 45.5
TDrive 2013 TTraction -1980 TTotal 33 rearWheelsAngV 55.8 velocity 12.7 SR 3.4 kmh 45.7
TDrive 2010 TTraction -1980 TTotal 30 rearWheelsAngV 55.8 velocity 12.7 SR 3.3 kmh 45.9
TDrive 2008 TTraction -1980 TTotal 28 rearWheelsAngV 55.8 velocity 12.8 SR 3.3 kmh 46.2
TDrive 2006 TTraction -1980 TTotal 26 rearWheelsAngV 55.8 velocity 12.9 SR 3.3 kmh 46.4
TDrive 2004 TTraction -1980 TTotal 24 rearWheelsAngV 55.8 velocity 12.9 SR 3.3 kmh 46.6
TDrive 2003 TTraction -1980 TTotal 23 rearWheelsAngV 55.9 velocity 13 SR 3.3 kmh 46.9
TDrive 2001 TTraction -1980 TTotal 21 rearWheelsAngV 55.9 velocity 13 SR 3.2 kmh 47.1
TDrive 2000 TTraction -1980 TTotal 20 rearWheelsAngV 55.9 velocity 13.1 SR 3.2 kmh 47.3
TDrive 1998 TTraction -1980 TTotal 18 rearWheelsAngV 55.9 velocity 13.2 SR 3.2 kmh 47.5
TDrive 1997 TTraction -1980 TTotal 17 rearWheelsAngV 55.9 velocity 13.2 SR 3.2 kmh 47.8
TDrive 1996 TTraction -1980 TTotal 16 rearWheelsAngV 55.9 velocity 13.3 SR 3.2 kmh 48
TDrive 1995 TTraction -1980 TTotal 15 rearWheelsAngV 55.9 velocity 13.4 SR 3.1 kmh 48.2
TDrive 1994 TTraction -1980 TTotal 14 rearWheelsAngV 55.9 velocity 13.4 SR 3.1 kmh 48.5
TDrive 1993 TTraction -1980 TTotal 13 rearWheelsAngV 55.9 velocity 13.5 SR 3.1 kmh 48.7
TDrive 1992 TTraction -1980 TTotal 12 rearWheelsAngV 55.9 velocity 13.6 SR 3.1 kmh 48.9
TDrive 1991 TTraction -1980 TTotal 11 rearWheelsAngV 55.9 velocity 13.6 SR 3.1 kmh 49.2
TDrive 1990 TTraction -1980 TTotal 10 rearWheelsAngV 55.9 velocity 13.7 SR 3 kmh 49.4
TDrive 1989 TTraction -1980 TTotal 9 rearWheelsAngV 55.9 velocity 13.7 SR 3 kmh 49.6
TDrive 1989 TTraction -1980 TTotal 9 rearWheelsAngV 55.9 velocity 13.8 SR 3 kmh 49.8
TDrive 1988 TTraction -1980 TTotal 8 rearWheelsAngV 55.9 velocity 13.9 SR 3 kmh 50.1
TDrive 1987 TTraction -1980 TTotal 7 rearWheelsAngV 55.9 velocity 13.9 SR 3 kmh 50.3


I have some questions.

At the end of all gears, should the Drive force fall down to 0 ? (If not, how to avoid car accelerating forever ?)

When calculating the car speed with the traction generated from slip ratio even if the rearWheelVel is 0 is there is some slipRatio, the car will continue accelerating.
At 0 driveForce, doen't the model should be inverted ??The rearWheels speed should follow the car speed and not the inverse right ?
Usually cars have a rpm limiter that will engage when the rpm go over a certain limit. This is usually working by cutting the electric power to the sparks, so the effect is instant (ie.. no detonation). With the RPM on the engine will produce a negative torque due to friction between elements. In cars without a rpm limiter the torque goes quickly down after the optimal rpm regime and the entire engine will eventually blow up.

So you can either model the rpm limiter with a simple:

if (rpms>limiter)
return -50;

Where -50 is an indicative negative torque you can use. Or you can model the descending torque curve after the optimal rpm regime.

In your example I don't see TDrive going to 0, it stays in the 1980 range. Also your slip ratio is VERY high, reaching 4, this means tyres are spinning 4x the speed of the road. If you have a linear relationship between SR and force you should increase the stiffness of the formula until you see values of about SR 0.2 once the car has passed 20-30 kmh (this depends also on the time step you are using).
With a slip ratio of 4, even if the engine produces 0 torque you still have to wait for the tyres to slow down and stop producing accelerating forces. This will also depend on the angular inertia you have set for the wheels and drivetrain system.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

Kunos, one more time your explanation make sense and are great help !
This is very interesting reading.
I think i understand how to fix the problem now.

Yes, i have noticed that i need to find the good combination for wheels angular inertia + force returned by pacejka to reduce my slip ratio.
As always i will report you my next try.

I am sure i can do it !
best regards.
Hi !

I made some change in the force returned by Pacejka longitudinal. I increased a bit the Force. And now the slip ratio is lower than before. It almost never pass 1 (Only at the begining).
So i believe that it is a really better result value.

I have also noticed that if the force returned by pacejka is too strong my car go reverse !
Because the Traction Force generate a Traction Torque that act in an opposing force to the wheel drive, and if that Traction Torque is stronger than the Drive Torque it make my car go backward hehe.
I believe that it should be true ?
So i need to be careful about the returned force by pacejka to make it just a little smaller than the drive force.

I almost succeed in implementing longitudinal pacejka, also the tip you gave me for the rev limiter work very well. Thanks !

The only problem i am facing right now is that i still get very high speed for my first gear. (About 170 km/h).

****EDIT****
I have changed my diferential ratio value and now i managed to get around 70kmh for my first gear !
I think i made it working now !

Kunos thank you so much for your great help!

This topic is closed to new replies.

Advertisement