Skip to content

Commit d323f5b

Browse files
committed
Automatic merge of T1.6-rc4-34-g041d7ab18 and 14 pull requests
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at aa72c13: Automatic speed control - Pull request #1104 at 86d38a2: Handle simple adhesion within the axle module - Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception - Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached - Pull request #1120 at ba3c47f: Automatically Calculate Friction Values if Missing - Pull request #1121 at 91d2d26: Manually Override Articulation - Pull request #1130 at 8ae6bb7: Fix F9 points to an incorrect car ID. - Pull request #1133 at 8dc00d5: Minor Fix for Brake Pipe Charging - Pull request #1139 at b47224d: Fix for bug https://bugs.launchpad.net/or/+bug/2117357. - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification - Pull request #1124 at fab5457: Built-in PBL2 brake controller - Pull request #1128 at 58de4c3: Particle Emitter Overhaul
16 parents 87b1df4 + 041d7ab + e10390b + aa72c13 + 86d38a2 + 387388e + 270f22f + ba3c47f + 91d2d26 + 8ae6bb7 + 8dc00d5 + b47224d + 5845a1a + 689494b + fab5457 + 58de4c3 commit d323f5b

File tree

4 files changed

+37
-31
lines changed

4 files changed

+37
-31
lines changed

Source/Documentation/Manual/options.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -863,23 +863,21 @@ 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+
866869
The following checks and corrections are performed if the option is
867-
checked:
870+
checked (only for single-pipe brake system):
868871

869872
- if the compressor restart pressure is smaller or very near to the max
870873
system pressure, the compressor restart pressure and if necessary the max
871-
main reservoir pressure are increased (single pipe air brakes only)
874+
main reservoir pressure are increased;
872875
- if the main reservoir volume is smaller than 0.3 m\ :sup:`3` and the
873876
engine mass is higher than 20 tons, the reservoir volume is raised to 0.78
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
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.
883881

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

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

Lines changed: 21 additions & 11 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 = -1.0f;
392+
public float MainResChargingRatePSIpS = 0.4f;
393393
public float EngineBrakeReleaseRatePSIpS = 12.5f;
394394
public float EngineBrakeApplyRatePSIpS = 12.5f;
395395
public float BrakePipeTimeFactorS = 0.0015f;
@@ -1887,6 +1887,21 @@ public override void Initialize()
18871887
}
18881888
}
18891889

1890+
// Initialise Train Pipe Leak Rate
1891+
if (TrainBrakePipeLeakPSIorInHgpS == 0) // Check to see if TrainBrakePipeLeakPSIorInHgpS has been set in the ENG file.
1892+
{
1893+
// Set Default Train Brake Pipe Leak depending upon whether locomotive has Vacuum or air brakes - overwritten by ENG file setting.
1894+
// 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
1895+
if ((BrakeSystem is VacuumSinglePipe))
1896+
{
1897+
TrainBrakePipeLeakPSIorInHgpS = 0.0f; // Vacuum brakes
1898+
}
1899+
else
1900+
{
1901+
TrainBrakePipeLeakPSIorInHgpS = 0.0f; // Air brakes
1902+
}
1903+
}
1904+
18901905
if (DynamicBrakeEngineBrakeReplacement && DynamicBrakeEngineBrakeReplacementSpeed == 0)
18911906
{
18921907
DynamicBrakeEngineBrakeReplacementSpeed = DynamicBrakeSpeed2MpS;
@@ -2008,18 +2023,16 @@ protected void CorrectBrakingParams()
20082023
// correct questionable MaxCylPressurePSI
20092024
BrakeSystem.CorrectMaxCylPressurePSI(this);
20102025
}
2011-
// Limit brake pipe leak to 2.5 psi/min (~ 1 bar every 6 minutes) to prevent stuck brakes
2012-
if (TrainBrakePipeLeakPSIorInHgpS > 2.5f / 60f)
2013-
TrainBrakePipeLeakPSIorInHgpS = 2.5f / 60f;
2014-
}
2015-
// No OR compressor speed defined, use MSTS compressor speed or 0.025 m^3/s (whichever is higher)
2016-
if (MainResChargingRatePSIpS < 0)
2026+
if (MainResChargingRatePSIpS <= 0)
20172027
{
2018-
MainResChargingRatePSIpS = Math.Max(0.025f, CompressorChargingRateM3pS) * OneAtmospherePSI / MainResVolumeM3;
2028+
MainResChargingRatePSIpS = Math.Max(0.5f, (CompressorChargingRateM3pS * Bar.ToPSI(1)) / MainResVolumeM3);
20192029
}
2030+
}
2031+
else if (MainResChargingRatePSIpS <= 0) MainResChargingRatePSIpS = 0.4f;
20202032

20212033
// Corrections for dynamic braking parameters
20222034

2035+
if (this is MSTSElectricLocomotive && DynamicBrakeDelayS > 4) DynamicBrakeDelayS = 2; // Electric locomotives have short engaging delays
20232036
if (DynamicBrakeSpeed2MpS > 0 && DynamicBrakeSpeed3MpS > 0 && DynamicBrakeSpeed2MpS > DynamicBrakeSpeed3MpS)
20242037
{
20252038
// also exchanging DynamicBrakesMaximumEffectiveSpeed with DynamicBrakesFadingSpeed is a frequent error that upsets operation of
@@ -2030,9 +2043,6 @@ protected void CorrectBrakingParams()
20302043
}
20312044
if (Simulator.Settings.CorrectQuestionableBrakingParams)
20322045
{
2033-
if (this is MSTSElectricLocomotive && DynamicBrakeDelayS > 4)
2034-
DynamicBrakeDelayS = 2; // Electric locomotives have short engaging delays
2035-
20362046
if (MaxDynamicBrakeForceN > 0 && MaxContinuousForceN > 0 &&
20372047
(MaxDynamicBrakeForceN / MaxContinuousForceN < 0.3f && MaxDynamicBrakeForceN == 20000))
20382048
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

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Controllers/MSTSBrakeController.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
105105
{
106106
PreviousNotchPosition = NotchController.GetCurrentNotch();
107107
BrakeControllerInitialised = true;
108-
if (PreviousNotchPosition != null)
109-
{
110-
var type = PreviousNotchPosition.Type;
111-
if (type == ControllerState.Lap || type == ControllerState.MinimalReduction) EnforceMinimalReduction = true;
112-
}
113108
}
114109
if (notch == null)
115110
{

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@
3737
using Orts.Common;
3838
using Orts.Formats.Msts;
3939
using Orts.Parsers.Msts;
40+
using Orts.Simulation.AIs;
4041
using Orts.Simulation.Physics;
4142
using Orts.Simulation.RollingStocks.Coupling;
4243
using Orts.Simulation.RollingStocks.SubSystems;
4344
using Orts.Simulation.RollingStocks.SubSystems.Brakes;
4445
using Orts.Simulation.RollingStocks.SubSystems.PowerSupplies;
4546
using Orts.Simulation.Signalling;
47+
using Orts.Simulation.Timetables;
4648
using ORTS.Common;
4749
using ORTS.Scripting.Api;
4850
using System;
@@ -2075,13 +2077,14 @@ public virtual void UpdateCurveForce(float elapsedClockSeconds)
20752077
// Base Curve Resistance (from refernce i)) = (Vehicle mass x Coeff Friction) * (Track Gauge + Vehicle Fixed Wheelbase) / (2 * curve radius)
20762078
// Vehicle Fixed Wheel base is the distance between the wheels, ie bogie or fixed wheels
20772079

2078-
float rBaseWagonN = GravitationalAccelerationMpS2 * MassKG * Train.WagonCoefficientFriction * (TrackGaugeM + RigidWheelBaseM) / (2.0f * CurrentCurveRadiusM);
2080+
var rBaseWagonN = 9.81f * MassKG * Train.WagonCoefficientFriction * (TrackGaugeM + RigidWheelBaseM) / (2.0f * CurrentCurveRadiusM);
20792081

20802082
// Speed Curve Resistance (from reference ii) - second term only) = ((Speed^2 / Curve Radius) - (Superelevation / Track Gauge) * Gravitational acceleration) * Constant
20812083

2082-
float speedConstant = 1.5f;
2083-
float rspeedKgpTonne = speedConstant * Math.Abs((SpeedMpS * SpeedMpS / CurrentCurveRadiusM) - (GravitationalAccelerationMpS2 * SuperElevationM / TrackGaugeM));
2084-
float rSpeedWagonN = GravitationalAccelerationMpS2 * (Kg.ToTonne(MassKG) * rspeedKgpTonne);
2084+
var speedConstant = 1.5f;
2085+
var MToMM = 1000;
2086+
var rspeedKgpTonne = speedConstant * Math.Abs((SpeedMpS * SpeedMpS / CurrentCurveRadiusM) - ((MToMM * SuperElevationM / MToMM * TrackGaugeM) * GravitationalAccelerationMpS2));
2087+
var rSpeedWagonN = GravitationalAccelerationMpS2 * (Kg.ToTonne(MassKG) * rspeedKgpTonne);
20852088

20862089
CurveForceN = rBaseWagonN + rSpeedWagonN;
20872090
}

0 commit comments

Comments
 (0)