Skip to content

Commit 6ef735b

Browse files
committed
Adjustement for Full slip control
1 parent 1f7af77 commit 6ef735b

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,11 +2742,27 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds)
27422742
// Simple slip control
27432743
// Motive force is reduced to the maximum adhesive force
27442744
// In wheelslip situations, motive force is set to zero
2745-
float adhesionLimit;
2746-
if (axle.SlipPercent > 115) adhesionLimit = 0;
2747-
else if (axle.SlipPercent > 95) adhesionLimit = axle.MaximumWheelAdhesion * (115 - axle.SlipSpeedPercent) / 20;
2748-
else adhesionLimit = axle.MaximumWheelAdhesion;
2749-
axle.DriveForceN = Math.Sign(axle.DriveForceN) * Math.Min(adhesionLimit * axle.AxleWeightN, Math.Abs(axle.DriveForceN));
2745+
float absForceN = Math.Min(Math.Abs(axle.DriveForceN), axle.MaximumWheelAdhesion * axle.AxleWeightN);
2746+
float newForceN;
2747+
if (axle.HuDIsWheelSlip)
2748+
{
2749+
newForceN = 0;
2750+
}
2751+
else if (!axle.HuDIsWheelSlipWarning)
2752+
{
2753+
// If well below slip threshold, restore full power in 10 seconds
2754+
newForceN = Math.Min(Math.Abs(prevForceN) + absForceN * elapsedClockSeconds / 10, absForceN);
2755+
}
2756+
else if (axle.IsWheelSlip)
2757+
{
2758+
newForceN = Math.Max(Math.Abs(prevForceN) - absForceN * elapsedClockSeconds / 3, 0);
2759+
}
2760+
else
2761+
{
2762+
newForceN = absForceN;
2763+
}
2764+
if (axle.DriveForceN > 0 && prevForceN >= 0) axle.DriveForceN = newForceN;
2765+
else if (axle.DriveForceN < 0 && prevForceN <= 0) axle.DriveForceN = -newForceN;
27502766
}
27512767
else if (SlipControlSystem == SlipControlType.CutPower)
27522768
{

0 commit comments

Comments
 (0)