Skip to content

Commit 57486b1

Browse files
committed
Automatic merge of T1.6-rc4-32-g196d83e86 and 15 pull requests
- Pull request #1104 at 9c7cdbf: Handle simple adhesion within the axle module - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at 7fc8de1: Automatic speed control - Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception - Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached - Pull request #1120 at ba3c47f: Automatically Calculate Friction Values if Missing - Pull request #1121 at 91d2d26: Manually Override Articulation - Pull request #1130 at 251a677: Fix F9 points to an incorrect car ID. - Pull request #1132 at 934d29e: Fixes For Correct Questionable Braking Parameters - Pull request #1133 at 8dc00d5: Minor Fix for Brake Pipe Charging - Pull request #1136 at 6f1b82f: Fix Curve Resistance Calculation - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification - Pull request #1124 at fab5457: Built-in PBL2 brake controller - Pull request #1128 at 1527403: Particle Emitter Overhaul
17 parents 47b7026 + 196d83e + 9c7cdbf + e10390b + 7fc8de1 + 387388e + 270f22f + ba3c47f + 91d2d26 + 251a677 + 934d29e + 8dc00d5 + 6f1b82f + 5845a1a + 689494b + fab5457 + 1527403 commit 57486b1

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,27 +2733,43 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds)
27332733
if (SlipControlSystem == SlipControlType.Full)
27342734
{
27352735
// Simple slip control
2736-
// Motive force is reduced to the maximum adhesive force
2737-
// In wheelslip situations, motive force is set to zero
2736+
// Motive force is limited to the maximum adhesive force
2737+
// In wheelslip situations, motive force is reduced to zero
27382738
float absForceN = Math.Min(Math.Abs(axle.DriveForceN), axle.MaximumWheelAdhesion * axle.AxleWeightN);
27392739
float newForceN;
2740-
if (axle.HuDIsWheelSlip)
2740+
if (axle.DriveForceN != 0)
27412741
{
2742-
newForceN = 0;
2742+
if (axle.HuDIsWheelSlip) SlipControlActive[i] = true;
27432743
}
2744-
else if (!axle.HuDIsWheelSlipWarning)
2744+
else
27452745
{
2746-
// If well below slip threshold, restore full power in 10 seconds
2747-
newForceN = Math.Min(Math.Abs(prevForceN) + absForceN * elapsedClockSeconds / 10, absForceN);
2746+
SlipControlActive[i] = false;
27482747
}
2749-
else if (axle.IsWheelSlip)
2748+
2749+
if (SlipControlActive[i])
27502750
{
2751-
newForceN = Math.Max(Math.Abs(prevForceN) - absForceN * elapsedClockSeconds / 3, 0);
2751+
if (!axle.HuDIsWheelSlip)
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+
// If full force is restored, disengage slip control (but limiting force to max adhesion)
2757+
if (newForceN / absForceN > 0.95f) SlipControlActive[i] = false;
2758+
}
2759+
else if (axle.IsWheelSlip)
2760+
{
2761+
newForceN = Math.Max(Math.Abs(prevForceN) - absForceN * elapsedClockSeconds / 3, 0);
2762+
}
2763+
else
2764+
{
2765+
newForceN = Math.Min(Math.Abs(prevForceN), absForceN);
2766+
}
27522767
}
27532768
else
27542769
{
27552770
newForceN = absForceN;
27562771
}
2772+
27572773
if (axle.DriveForceN > 0 && prevForceN >= 0) axle.DriveForceN = newForceN;
27582774
else if (axle.DriveForceN < 0 && prevForceN <= 0) axle.DriveForceN = -newForceN;
27592775
}
@@ -2799,7 +2815,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds)
27992815
}
28002816
else
28012817
{
2802-
newForceN = absForceN;
2818+
newForceN = Math.Min(Math.Abs(prevForceN), absForceN);
28032819
}
28042820
if (axle.DriveForceN > 0 && prevForceN >= 0) axle.DriveForceN = newForceN;
28052821
else if (axle.DriveForceN < 0 && prevForceN <= 0) axle.DriveForceN = -newForceN;

0 commit comments

Comments
 (0)