Skip to content

Commit e68bf95

Browse files
authored
Merge pull request #1132 from SteelFill/correct_questionable_leaks
Fixes For Correct Questionable Braking Parameters
2 parents 4ff58ac + 934d29e commit e68bf95

File tree

2 files changed

+24
-32
lines changed

2 files changed

+24
-32
lines changed

Source/Documentation/Manual/options.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -863,21 +863,23 @@ are a problem for OR, which has a more sophisticated braking model. The
863863
problem usually is that the train brakes require a long time to release,
864864
and in some times do not release at all.
865865

866-
.. index::
867-
single: AirBrakesAirCompressorPowerRating
868-
869866
The following checks and corrections are performed if the option is
870-
checked (only for single-pipe brake system):
867+
checked:
871868

872869
- if the compressor restart pressure is smaller or very near to the max
873870
system pressure, the compressor restart pressure and if necessary the max
874-
main reservoir pressure are increased;
871+
main reservoir pressure are increased (single pipe air brakes only)
875872
- if the main reservoir volume is smaller than 0.3 m\ :sup:`3` and the
876873
engine mass is higher than 20 tons, the reservoir volume is raised to 0.78
877-
m\ :sup:`3`;
878-
- the charging rate of the reservoir is derived from the .eng parameter
879-
``AirBrakesAirCompressorPowerRating`` (if this generates a value greater
880-
than 0.5 psi/s) instead of using a default value.
874+
m\ :sup:`3`
875+
- the maximum brake cylinder pressure will be reduced to the maximum pressure
876+
possible from a full service train brake application if it was set above this
877+
amount
878+
- any brake pipe leakage specified by ``TrainPipeLeakRate`` is limited to 2.5 psi/minute
879+
- the dynamic brake delay on electric locomotives is reduced to 2 seconds
880+
if it was defined to be above 4 seconds
881+
- dynamic brake force left at the default value of 20kN will be increased to
882+
half the locomotive's continuous force, or 150kN, whichever is lower
881883

882884
For a full list of parameters, see :ref:`Developing ORTS Content - Parameters and Tokens<parameters_and_tokens>`
883885

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public float OdometerM
389389
public float CompressorRestartPressurePSI = 110;
390390
public float CompressorChargingRateM3pS = 0.075f;
391391
public bool CompressorIsMUControlled = false;
392-
public float MainResChargingRatePSIpS = 0.4f;
392+
public float MainResChargingRatePSIpS = -1.0f;
393393
public float EngineBrakeReleaseRatePSIpS = 12.5f;
394394
public float EngineBrakeApplyRatePSIpS = 12.5f;
395395
public float BrakePipeTimeFactorS = 0.0015f;
@@ -1869,21 +1869,6 @@ public override void Initialize()
18691869
}
18701870
}
18711871

1872-
// Initialise Train Pipe Leak Rate
1873-
if (TrainBrakePipeLeakPSIorInHgpS == 0) // Check to see if TrainBrakePipeLeakPSIorInHgpS has been set in the ENG file.
1874-
{
1875-
// Set Default Train Brake Pipe Leak depending upon whether locomotive has Vacuum or air brakes - overwritten by ENG file setting.
1876-
// Default currently set to zero - means that by default function is off, and a value must be entered into the ENG file to get it to work
1877-
if ((BrakeSystem is VacuumSinglePipe))
1878-
{
1879-
TrainBrakePipeLeakPSIorInHgpS = 0.0f; // Vacuum brakes
1880-
}
1881-
else
1882-
{
1883-
TrainBrakePipeLeakPSIorInHgpS = 0.0f; // Air brakes
1884-
}
1885-
}
1886-
18871872
if (DynamicBrakeEngineBrakeReplacement && DynamicBrakeEngineBrakeReplacementSpeed == 0)
18881873
{
18891874
DynamicBrakeEngineBrakeReplacementSpeed = DynamicBrakeSpeed2MpS;
@@ -1990,16 +1975,18 @@ protected void CorrectBrakingParams()
19901975
// correct questionable MaxCylPressurePSI
19911976
BrakeSystem.CorrectMaxCylPressurePSI(this);
19921977
}
1993-
if (MainResChargingRatePSIpS <= 0)
1994-
{
1995-
MainResChargingRatePSIpS = Math.Max(0.5f, (CompressorChargingRateM3pS * Bar.ToPSI(1)) / MainResVolumeM3);
1996-
}
1978+
// Limit brake pipe leak to 2.5 psi/min (~ 1 bar every 6 minutes) to prevent stuck brakes
1979+
if (TrainBrakePipeLeakPSIorInHgpS > 2.5f / 60f)
1980+
TrainBrakePipeLeakPSIorInHgpS = 2.5f / 60f;
1981+
}
1982+
// No OR compressor speed defined, use MSTS compressor speed or 0.025 m^3/s (whichever is higher)
1983+
if (MainResChargingRatePSIpS < 0)
1984+
{
1985+
MainResChargingRatePSIpS = Math.Max(0.025f, CompressorChargingRateM3pS) * OneAtmospherePSI / MainResVolumeM3;
19971986
}
1998-
else if (MainResChargingRatePSIpS <= 0) MainResChargingRatePSIpS = 0.4f;
19991987

20001988
// Corrections for dynamic braking parameters
20011989

2002-
if (this is MSTSElectricLocomotive && DynamicBrakeDelayS > 4) DynamicBrakeDelayS = 2; // Electric locomotives have short engaging delays
20031990
if (DynamicBrakeSpeed2MpS > 0 && DynamicBrakeSpeed3MpS > 0 && DynamicBrakeSpeed2MpS > DynamicBrakeSpeed3MpS)
20041991
{
20051992
// also exchanging DynamicBrakesMaximumEffectiveSpeed with DynamicBrakesFadingSpeed is a frequent error that upsets operation of
@@ -2010,8 +1997,11 @@ protected void CorrectBrakingParams()
20101997
}
20111998
if (Simulator.Settings.CorrectQuestionableBrakingParams)
20121999
{
2000+
if (this is MSTSElectricLocomotive && DynamicBrakeDelayS > 4)
2001+
DynamicBrakeDelayS = 2; // Electric locomotives have short engaging delays
2002+
20132003
if (MaxDynamicBrakeForceN > 0 && MaxContinuousForceN > 0 &&
2014-
(MaxDynamicBrakeForceN / MaxContinuousForceN < 0.3f && MaxDynamicBrakeForceN == 20000))
2004+
(MaxDynamicBrakeForceN / MaxContinuousForceN < 0.3f && MaxDynamicBrakeForceN == 20000))
20152005
MaxDynamicBrakeForceN = Math.Min (MaxContinuousForceN * 0.5f, 150000); // 20000 is suggested as standard value in the MSTS documentation, but in general it is a too low value
20162006
}
20172007
}

0 commit comments

Comments
 (0)