@@ -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