Skip to content

Commit 5e9d9c9

Browse files
committed
Adjust dump valve lockout function
1 parent f220735 commit 5e9d9c9

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,9 @@ public override void Update(float elapsedClockSeconds)
491491
// dump valves. When axle rotations which are sensed electrically, differ by a predetermined speed the dump valves are operated releasing brake cylinder pressure to both axles of the affected
492492
// bogie.
493493

494-
// Dump valve operation will cease when differences in axle rotations arewithin specified limits or the axle accelerates faster than a specified rate. The dump valve will only operate for a
495-
// maximum period of seven seconds after which time it will be de-energised and the dump valve will not re-operate until the train has stopped or the throttle operated.
494+
// Dump valve operation will cease when differences in axle rotations arewithin specified limits or the axle accelerates faster than a specified rate. The dump valve resets whenever the wheel
495+
// creep speed drops to normal. The dump valve will only operate continuously for a maximum period of seven seconds after which time it will be de-energised and the dump valve will not
496+
// re-operate until the train has stopped or the throttle operated.
496497

497498
// Dump valve operation is prevented under the following conditions:-
498499
// (i) When the Power Controller is open.
@@ -501,27 +502,30 @@ public override void Update(float elapsedClockSeconds)
501502

502503
if (Car.WheelBrakeSlideProtectionFitted)
503504
{
504-
if ((Car.BrakeSkidWarning || Car.BrakeSkid) && ( !Car.WheelBrakeSlideProtectionEmergencyDisabled && BrakeLine1PressurePSI > 36.25) && Car.WheelBrakeSlideProtectionTimerS != 0)
505+
// WSP dump valve active
506+
if ((Car.BrakeSkidWarning || Car.BrakeSkid) && ( !Car.WheelBrakeSlideProtectionEmergencyDisabled && BrakeLine1PressurePSI > 36.25) && Car.WheelBrakeSlideProtectionTimerS != 0 && !Car.WheelBrakeSlideProtectionDumpValveLockout)
505507
{
506508
Car.WheelBrakeSlideProtectionActive = true;
507-
// Trace.TraceInformation("WSP#1 - CarID {0} BC {1} Auto {2} BP1 {3}", Car.CarID, CylPressurePSI, AutoCylPressurePSI, BrakeLine1PressurePSI);
508509
AutoCylPressurePSI -= elapsedClockSeconds * MaxReleaseRatePSIpS;
509510
CylPressurePSI = AutoCylPressurePSI;
510-
// Trace.TraceInformation("WSP#2 - CarID {0} BC {1} Auto {2}", Car.CarID, CylPressurePSI, AutoCylPressurePSI);
511511
Car.WheelBrakeSlideProtectionTimerS -= elapsedClockSeconds;
512+
513+
// Lockout WSP dump valve if it is open for greater then 7 seconds continuously
514+
if (Car.WheelBrakeSlideProtectionTimerS <= 0)
515+
{
516+
Car.WheelBrakeSlideProtectionDumpValveLockout = true;
517+
}
518+
512519
}
513-
else
520+
else if (!Car.WheelBrakeSlideProtectionDumpValveLockout)
514521
{
522+
// WSP dump valve stops
515523
Car.WheelBrakeSlideProtectionActive = false;
516-
// Trace.TraceInformation("WSP Non-active - CarID {0} BC {1} Auto {2} BP1 {3}", Car.CarID, CylPressurePSI, AutoCylPressurePSI, BrakeLine1PressurePSI);
524+
Car.WheelBrakeSlideProtectionTimerS = 7.0f; // Reset WSP timer if
517525
}
518526

519-
520-
521527
}
522-
523-
524-
528+
525529
// Record HUD display values for brake cylinders depending upon whether they are wagons or locomotives/tenders (which are subject to their own engine brakes)
526530
if (Car.WagonType == MSTSWagon.WagonTypes.Engine || Car.WagonType == MSTSWagon.WagonTypes.Tender)
527531
{

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public float ConvectionFactor
260260
public bool WheelBrakeSlideProtectionActive = false;
261261
public bool WheelBrakeSlideProtectionEmergencyDisabled = false;
262262
public float WheelBrakeSlideProtectionTimerS = 7;
263+
public bool WheelBrakeSlideProtectionDumpValveLockout = false;
263264

264265
public bool BrakeSkid = false;
265266
public bool BrakeSkidWarning = false;
@@ -968,11 +969,11 @@ public virtual void UpdateBrakeSlideCalculation()
968969
BrakeSkidWarning = false; // wagon wheel is back to normal
969970
}
970971

971-
// Reset WSP timer
972-
973-
if (WheelBrakeSlideProtectionFitted && (ThrottlePercent == 0 || AbsSpeedMpS == 0))
972+
// Reset WSP dump valve lockout
973+
if (WheelBrakeSlideProtectionFitted && WheelBrakeSlideProtectionDumpValveLockout && (ThrottlePercent == 0 || AbsSpeedMpS == 0))
974974
{
975975
WheelBrakeSlideProtectionTimerS = 7;
976+
WheelBrakeSlideProtectionDumpValveLockout = false;
976977

977978
}
978979

0 commit comments

Comments
 (0)