@@ -2740,27 +2740,43 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds)
2740
2740
if ( SlipControlSystem == SlipControlType . Full )
2741
2741
{
2742
2742
// Simple slip control
2743
- // Motive force is reduced to the maximum adhesive force
2744
- // In wheelslip situations, motive force is set to zero
2743
+ // Motive force is limited to the maximum adhesive force
2744
+ // In wheelslip situations, motive force is reduced to zero
2745
2745
float absForceN = Math . Min ( Math . Abs ( axle . DriveForceN ) , axle . MaximumWheelAdhesion * axle . AxleWeightN ) ;
2746
2746
float newForceN ;
2747
- if ( axle . HuDIsWheelSlip )
2747
+ if ( axle . DriveForceN != 0 )
2748
2748
{
2749
- newForceN = 0 ;
2749
+ if ( axle . HuDIsWheelSlip ) SlipControlActive [ i ] = true ;
2750
2750
}
2751
- else if ( ! axle . HuDIsWheelSlipWarning )
2751
+ else
2752
2752
{
2753
- // If well below slip threshold, restore full power in 10 seconds
2754
- newForceN = Math . Min ( Math . Abs ( prevForceN ) + absForceN * elapsedClockSeconds / 10 , absForceN ) ;
2753
+ SlipControlActive [ i ] = false ;
2755
2754
}
2756
- else if ( axle . IsWheelSlip )
2755
+
2756
+ if ( SlipControlActive [ i ] )
2757
2757
{
2758
- newForceN = Math . Max ( Math . Abs ( prevForceN ) - absForceN * elapsedClockSeconds / 3 , 0 ) ;
2758
+ if ( ! axle . HuDIsWheelSlip )
2759
+ {
2760
+ // If well below slip threshold, restore full power in 10 seconds
2761
+ newForceN = Math . Min ( Math . Abs ( prevForceN ) + absForceN * elapsedClockSeconds / 10 , absForceN ) ;
2762
+
2763
+ // If full force is restored, disengage slip control (but limiting force to max adhesion)
2764
+ if ( newForceN / absForceN > 0.95f ) SlipControlActive [ i ] = false ;
2765
+ }
2766
+ else if ( axle . IsWheelSlip )
2767
+ {
2768
+ newForceN = Math . Max ( Math . Abs ( prevForceN ) - absForceN * elapsedClockSeconds / 3 , 0 ) ;
2769
+ }
2770
+ else
2771
+ {
2772
+ newForceN = Math . Min ( Math . Abs ( prevForceN ) , absForceN ) ;
2773
+ }
2759
2774
}
2760
2775
else
2761
2776
{
2762
2777
newForceN = absForceN ;
2763
2778
}
2779
+
2764
2780
if ( axle . DriveForceN > 0 && prevForceN >= 0 ) axle . DriveForceN = newForceN ;
2765
2781
else if ( axle . DriveForceN < 0 && prevForceN <= 0 ) axle . DriveForceN = - newForceN ;
2766
2782
}
@@ -2806,7 +2822,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds)
2806
2822
}
2807
2823
else
2808
2824
{
2809
- newForceN = absForceN ;
2825
+ newForceN = Math . Min ( Math . Abs ( prevForceN ) , absForceN ) ;
2810
2826
}
2811
2827
if ( axle . DriveForceN > 0 && prevForceN >= 0 ) axle . DriveForceN = newForceN ;
2812
2828
else if ( axle . DriveForceN < 0 && prevForceN <= 0 ) axle . DriveForceN = - newForceN ;
0 commit comments