Skip to content

Commit d9e494a

Browse files
committed
Automatic merge of T1.6-rc4-32-g196d83e86 and 13 pull requests
- Pull request #1104 at 6ef735b: Handle simple adhesion within the axle module - Pull request #1057 at 1c2bcb4: Switchable brake system - 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 #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 #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
15 parents ca3a08e + 196d83e + 6ef735b + 1c2bcb4 + e10390b + 7fc8de1 + 387388e + 270f22f + 91d2d26 + 251a677 + 934d29e + 8dc00d5 + 5845a1a + 689494b + fab5457 commit d9e494a

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
@@ -2735,11 +2735,27 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds)
27352735
// Simple slip control
27362736
// Motive force is reduced to the maximum adhesive force
27372737
// In wheelslip situations, motive force is set to zero
2738-
float adhesionLimit;
2739-
if (axle.SlipPercent > 115) adhesionLimit = 0;
2740-
else if (axle.SlipPercent > 95) adhesionLimit = axle.MaximumWheelAdhesion * (115 - axle.SlipSpeedPercent) / 20;
2741-
else adhesionLimit = axle.MaximumWheelAdhesion;
2742-
axle.DriveForceN = Math.Sign(axle.DriveForceN) * Math.Min(adhesionLimit * axle.AxleWeightN, Math.Abs(axle.DriveForceN));
2738+
float absForceN = Math.Min(Math.Abs(axle.DriveForceN), axle.MaximumWheelAdhesion * axle.AxleWeightN);
2739+
float newForceN;
2740+
if (axle.HuDIsWheelSlip)
2741+
{
2742+
newForceN = 0;
2743+
}
2744+
else if (!axle.HuDIsWheelSlipWarning)
2745+
{
2746+
// If well below slip threshold, restore full power in 10 seconds
2747+
newForceN = Math.Min(Math.Abs(prevForceN) + absForceN * elapsedClockSeconds / 10, absForceN);
2748+
}
2749+
else if (axle.IsWheelSlip)
2750+
{
2751+
newForceN = Math.Max(Math.Abs(prevForceN) - absForceN * elapsedClockSeconds / 3, 0);
2752+
}
2753+
else
2754+
{
2755+
newForceN = absForceN;
2756+
}
2757+
if (axle.DriveForceN > 0 && prevForceN >= 0) axle.DriveForceN = newForceN;
2758+
else if (axle.DriveForceN < 0 && prevForceN <= 0) axle.DriveForceN = -newForceN;
27432759
}
27442760
else if (SlipControlSystem == SlipControlType.CutPower)
27452761
{

0 commit comments

Comments
 (0)