Skip to content

Commit 18c5481

Browse files
committed
Reduce chance of static consists going to emergency, add check for unrealistic aux res charging rates
1 parent 2fed4b9 commit 18c5481

File tree

1 file changed

+8
-1
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ public override void Initialize()
407407
Trace.TraceWarning("{0} does not define a brake valve, defaulting to a plain triple valve", (Car as MSTSWagon).WagFilePath);
408408
}
409409

410+
// Reducing reservoir charging rates when set unrealistically high
411+
if (Car.Simulator.Settings.CorrectQuestionableBrakingParams && (MaxAuxilaryChargingRatePSIpS > 10 || EmergResChargingRatePSIpS > 10))
412+
{
413+
MaxAuxilaryChargingRatePSIpS = Math.Min(MaxAuxilaryChargingRatePSIpS, 10.0f);
414+
EmergResChargingRatePSIpS = Math.Min(EmergResChargingRatePSIpS, 10.0f);
415+
}
416+
410417
// In simple brake mode set emergency reservoir volume, override high volume values to allow faster brake release.
411418
if (Car.Simulator.Settings.SimpleControlPhysics && EmergResVolumeM3 > 2.0)
412419
EmergResVolumeM3 = 0.7f;
@@ -468,7 +475,7 @@ public void UpdateTripleValveState(float elapsedClockSeconds)
468475
bool disableGradient = !(Car.Train.LeadLocomotive is MSTSLocomotive) && Car.Train.TrainType != Orts.Simulation.Physics.Train.TRAINTYPE.STATIC;
469476
// Small workaround to allow trains to more reliably go into emergency after uncoupling
470477
bool emergencyTripped = (Car.Train.TrainType == Orts.Simulation.Physics.Train.TRAINTYPE.STATIC) ?
471-
BrakeLine1PressurePSI <= EmergResPressurePSI * AuxCylVolumeRatio / (AuxCylVolumeRatio + 1) : Math.Max(-SmoothedBrakePipeChangePSIpS.SmoothedValue, 0) > EmergencyValveActuationRatePSIpS;
478+
BrakeLine1PressurePSI <= 0.75f * EmergResPressurePSI * AuxCylVolumeRatio / (AuxCylVolumeRatio + 1) : Math.Max(-SmoothedBrakePipeChangePSIpS.SmoothedValue, 0) > EmergencyValveActuationRatePSIpS;
472479

473480
if (valveType == MSTSWagon.BrakeValveType.Distributor)
474481
{

0 commit comments

Comments
 (0)