Skip to content

Commit 4a0e48a

Browse files
committed
First phase of wheel slide protection
1 parent de02eda commit 4a0e48a

File tree

4 files changed

+80
-3
lines changed

4 files changed

+80
-3
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,18 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
10181018
case "wagon(ortsbrakeshoefriction": BrakeShoeFrictionFactor = new Interpolator(stf); break;
10191019
case "wagon(maxhandbrakeforce": InitialMaxHandbrakeForceN = stf.ReadFloatBlock(STFReader.UNITS.Force, null); break;
10201020
case "wagon(maxbrakeforce": InitialMaxBrakeForceN = stf.ReadFloatBlock(STFReader.UNITS.Force, null); break;
1021+
case "wagon(ortswheelbrakeslipprotection":
1022+
// stf.MustMatch("(");
1023+
var brakeslipprotection = stf.ReadFloatBlock(STFReader.UNITS.None, null);
1024+
if (brakeslipprotection == 1)
1025+
{
1026+
WheelBrakeSlipProtectionFitted = true;
1027+
}
1028+
else
1029+
{
1030+
WheelBrakeSlipProtectionFitted = false;
1031+
}
1032+
break;
10211033
case "wagon(ortsdavis_a": DavisAN = stf.ReadFloatBlock(STFReader.UNITS.Force, null); break;
10221034
case "wagon(ortsdavis_b": DavisBNSpM = stf.ReadFloatBlock(STFReader.UNITS.Resistance, null); break;
10231035
case "wagon(ortsdavis_c": DavisCNSSpMM = stf.ReadFloatBlock(STFReader.UNITS.ResistanceDavisC, null); break;
@@ -1341,6 +1353,7 @@ public virtual void Copy(MSTSWagon copy)
13411353
DriverWheelRadiusM = copy.DriverWheelRadiusM;
13421354
MainSoundFileName = copy.MainSoundFileName;
13431355
BrakeShoeFrictionFactor = copy.BrakeShoeFrictionFactor;
1356+
WheelBrakeSlipProtectionFitted = copy.WheelBrakeSlipProtectionFitted;
13441357
InitialMaxBrakeForceN = copy.InitialMaxBrakeForceN;
13451358
InitialMaxHandbrakeForceN = copy.InitialMaxHandbrakeForceN;
13461359
MaxBrakeForceN = copy.MaxBrakeForceN;

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

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public override void Update(float elapsedClockSeconds)
377377
UpdateTripleValveState(threshold);
378378

379379
// triple valve is set to charge the brake cylinder
380-
if (TripleValveState == ValveState.Apply || TripleValveState == ValveState.Emergency)
380+
if ((TripleValveState == ValveState.Apply || TripleValveState == ValveState.Emergency) && !Car.WheelBrakeSlipProtectionActive)
381381
{
382382
float dp = elapsedClockSeconds * MaxApplicationRatePSIpS;
383383
if (AuxResPressurePSI - dp / AuxCylVolumeRatio < AutoCylPressurePSI + dp)
@@ -487,6 +487,42 @@ public override void Update(float elapsedClockSeconds)
487487
else
488488
CylPressurePSI = AutoCylPressurePSI;
489489

490+
// During braking wheelslide control is effected throughout the train by additional equipment on each vehicle. In the piping to each pair of brake cylinders are fitted electrically operated
491+
// 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
492+
// bogie.
493+
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.
496+
497+
// Dump valve operation is prevented under the following conditions:-
498+
// (i) When the Power Controller is open.
499+
500+
// (ii) When Brake Pipe Pressure has been reduced below 250 kPa (36.25psi).
501+
502+
if (Car.WheelBrakeSlipProtectionFitted)
503+
{
504+
if ((Car.BrakeSkidWarning || Car.BrakeSkid) && BrakeLine1PressurePSI > 36.25)
505+
{
506+
Car.WheelBrakeSlipProtectionActive = true;
507+
// Trace.TraceInformation("WSP#1 - CarID {0} BC {1} Auto {2} BP1 {3}", Car.CarID, CylPressurePSI, AutoCylPressurePSI, BrakeLine1PressurePSI);
508+
AutoCylPressurePSI -= elapsedClockSeconds * MaxReleaseRatePSIpS;
509+
CylPressurePSI = AutoCylPressurePSI;
510+
// Trace.TraceInformation("WSP#2 - CarID {0} BC {1} Auto {2}", Car.CarID, CylPressurePSI, AutoCylPressurePSI);
511+
}
512+
else
513+
{
514+
Car.WheelBrakeSlipProtectionActive = false;
515+
// Trace.TraceInformation("WSP Non-active - CarID {0} BC {1} Auto {2} BP1 {3}", Car.CarID, CylPressurePSI, AutoCylPressurePSI, BrakeLine1PressurePSI);
516+
}
517+
518+
519+
520+
521+
522+
}
523+
524+
525+
490526
// Record HUD display values for brake cylinders depending upon whether they are wagons or locomotives/tenders (which are subject to their own engine brakes)
491527
if (Car.WagonType == MSTSWagon.WagonTypes.Engine || Car.WagonType == MSTSWagon.WagonTypes.Tender)
492528
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public override void Update(float elapsedClockSeconds)
4949

5050
base.Update(elapsedClockSeconds);
5151

52-
if (AutoCylPressurePSI < demandedAutoCylPressurePSI)
52+
if (AutoCylPressurePSI < demandedAutoCylPressurePSI && !Car.WheelBrakeSlipProtectionActive)
5353
{
5454
float dp = elapsedClockSeconds * MaxApplicationRatePSIpS;
5555
if (BrakeLine2PressurePSI - dp * AuxBrakeLineVolumeRatio / AuxCylVolumeRatio < AutoCylPressurePSI + dp)

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ public float ConvectionFactor
256256
}
257257

258258
// Used to calculate wheel sliding for locked brake
259+
public bool WheelBrakeSlipProtectionFitted = false;
260+
public bool WheelBrakeSlipProtectionActive = false;
259261
public bool BrakeSkid = false;
262+
public bool BrakeSkidWarning = false;
260263
public bool HUDBrakeSkid = false;
261264
public float BrakeShoeCoefficientFriction = 1.0f; // Brake Shoe coefficient - for simple adhesion model set to 1
262265
public float BrakeShoeCoefficientFrictionAdjFactor = 1.0f; // Factor to adjust Brake force by - based upon changing friction coefficient with speed, will change when wheel goes into skid
@@ -922,7 +925,17 @@ public virtual void UpdateBrakeSlideCalculation()
922925

923926
if (this is MSTSDieselLocomotive || this is MSTSElectricLocomotive)
924927
{
925-
if (WheelSlip && ThrottlePercent < 0.1f && BrakeRetardForceN > 25.0) // If advanced adhesion model indicates wheel slip, then check other conditiond (throttle and brake force) to determine whether it is a wheel slip or brake skid
928+
929+
if (WheelSlipWarning && ThrottlePercent < 0.1f && BrakeRetardForceN > 25.0) // If advanced adhesion model indicates wheel slip, then check other conditiond (throttle and brake force) to determine whether it is a wheel slip or brake skid
930+
{
931+
BrakeSkidWarning = true; // set brake skid flag true
932+
}
933+
else
934+
{
935+
BrakeSkidWarning = false;
936+
}
937+
938+
if (WheelSlip && ThrottlePercent < 0.1f && BrakeRetardForceN > 25.0) // If advanced adhesion model indicates wheel slip, then check other conditiond (throttle and brake force) to determine whether it is a wheel slip or brake skid
926939
{
927940
BrakeSkid = true; // set brake skid flag true
928941
}
@@ -938,6 +951,20 @@ public virtual void UpdateBrakeSlideCalculation()
938951
// Calculate tread force on wheel - use the retard force as this is related to brakeshoe coefficient, and doesn't vary with skid.
939952
BrakeWheelTreadForceN = BrakeRetardForceN;
940953

954+
if (!BrakeSkidWarning && AbsSpeedMpS > 0.01)
955+
{
956+
var wagonbrakeadhesiveforcen = MassKG * GravitationalAccelerationMpS2 * Train.WagonCoefficientFriction; // Adhesive force wheel normal
957+
958+
if (BrakeWheelTreadForceN > 0.80f * WagonBrakeAdhesiveForceN)
959+
{
960+
BrakeSkidWarning = true; // wagon wheel is about to slip
961+
}
962+
}
963+
else if ( BrakeWheelTreadForceN < 0.75f * WagonBrakeAdhesiveForceN)
964+
{
965+
BrakeSkidWarning = false; // wagon wheel is back to normal
966+
}
967+
941968

942969
// Calculate adhesive force based upon whether in skid or not
943970
if (BrakeSkid)
@@ -948,6 +975,7 @@ public virtual void UpdateBrakeSlideCalculation()
948975
{
949976
WagonBrakeAdhesiveForceN = MassKG * GravitationalAccelerationMpS2 * Train.WagonCoefficientFriction; // Adhesive force wheel normal
950977
}
978+
951979

952980
// Test if wheel forces are high enough to induce a slip. Set slip flag if slip occuring
953981
if (!BrakeSkid && AbsSpeedMpS > 0.01) // Train must be moving forward to experience skid

0 commit comments

Comments
 (0)