# Forums

Full Version: Wrong calculation of rolling resistance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I've had this fixed in my rewrite by limiting friction torque to the torque needed to reduce contact velocity to zero if I remember correctly.
Another bug elsewhere:

I have dumped input parameters coming into PacejkaFy function and in a spin I see slip angles alpha of 100, 300, 2000 degrees and more!

Pacejka Fy formula does not work for slip angle outside of +-90 degrees! It is not designed to be periodical. From common sense it has to be symmetrical around 90 degrees but it is responsibility of the calling function to wrap around slip angles.

This has to be fixed at the calling point where slip angle is generated.
The output of atan2 is [-pi,+pi] -> [-180, 180].

But then there is also the Fx, Fy combining method which I can't really comment, no idea what is going on there.
NaN Wrote:The output of atan2 is [-pi,+pi] -> [-180, 180].

But then there is also the Fx, Fy combining method which I can't really comment, no idea what is going on there.

Even this is not right, 180 degrees means tyre just freely rolling backwards and its Fy should be almost zero. PacejkaFy on the other hand will produce lateral force at 0.5...1 Fz level if you just calculate Fy(180).

Code:
```assert (btFabs(alpha) <= 180); if (alpha > 90) alpha = 180 - alpha; if (alpha < 90) alpha = -180 - alpha;``` Same story with Mz: PacejkaMz will generate non-zero aligning torque at 90 degrees and above while common sense suggests that if you drag the tyre sidewise it will not have any aligning torque due to its symmetry. Thus real world Mz has to be anti-simmetrical around 90 degrees value.
Quote:Even this is not right, 180 degrees means tyre
I didn't want to imply that it is correct, was just looking for the reason for this values.

The slip angle should be obviously atan(v_lat/abs(v_lon)) not atan2.

But there is still the combining equation which will scale it.
For Mz I suggest using this:

Code:
```btScalar CARTIRE::PacejkaMz(btScalar sigma, btScalar alpha, btScalar Fz, btScalar gamma, btScalar friction_coeff, btScalar & max_Mz) const {     btScalar Input_alpha = alpha;                // save slip angle on entry     if (alpha > 90.0) alpha = 180.0 - alpha;    // symmetry around +90 degrees if caller missed it     if (alpha < -90.0) alpha = -180.0 - alpha;    // symmetry around -90 degrees if caller missed it ... calculations     // anti-symmetry around +-90 degrees     Mz *= cos(Input_alpha * M_PI / 180.0);     return Mz; }```
Here is what we get as a result compared to existing formula. Of course anything beyond 10-20 degrees slip angle is already a heavy slide but at least we get common sense outputs in this calculations.

Caller still has to limit the input slip angle to +-180 degrees! Update: Haha! I have just had a look in Pacejka's 2006 book and he includes cos(alpha) factor in Mz stating
Quote:factor cos(a) appearing in the equations for the aligning torque to properly handle the case of large slip angles and possibly backwards running...

:lol:
Pages: 1 2 3