Skip to content

Commit 73dadde

Browse files
committed
Automatic merge of T1.5.1-1887-g07be04456 and 9 pull requests
- Pull request #1072 at a67d510: Content Creation Shortcuts & Advanced Wagon Shape Interactions - Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1094 at b9b4843: Blended Braking Compatibility and Effectiveness Improvements - Pull request #1096 at 7a4f055: When the OR main form does not have the focus, hovering above the main OR form makes the mouse cursor disappear. - Pull request #1097 at 24ff66b: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 1ca03af: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
11 parents 3705435 + 07be044 + a67d510 + 37e2817 + e10390b + b9b4843 + 7a4f055 + 24ff66b + 1ca03af + 5845a1a + 689494b commit 73dadde

File tree

19 files changed

+1165
-1040
lines changed

19 files changed

+1165
-1040
lines changed

Source/Documentation/Manual/cruisecontrol.rst

Lines changed: 33 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ A paragraph is devoted to each of the above topics.
3333
Operation Modes
3434
===============
3535

36-
The CC Speed Regulator can be in two different states (or modes), that is:
36+
The CC Speed Regulator can be in 4 different states (or modes), that is:
3737

3838
1) *Manual*, when the automatic cruise control is disabled and the driver
3939
controls the speed through throttle and brakes as if there were no CC.
4040
2) *Auto*, when the automatic cruise control is enabled, and therefore
4141
the speed is automatically controlled
42+
3) *Testing*, not implemented at the moment
43+
4) *AVV*, not implemented at the moment.
4244

4345
Switching between Manual and Auto mode can be configured to occur either
4446
by a specific cabview control (*ORTS_SELECTED_SPEED_REGULATOR_MODE*) or
@@ -92,16 +94,10 @@ A list of the available .eng file CC parameters follows here below.
9294
"SpeedIsMpH", "KpH if missing", "Boolean", "FALSE"
9395
"MaxForceSteps", "Usually will be 100 meaning 100%, but some locos have limited force steps", "Integer", "0"
9496
"SpeedSelectorStepTimeSeconds", "How fast the selected speed lever adds speed", "Float", "0.1"
97+
"DynamicBrakeMaxForceAtSelectorStep", "The brake will reach 100% at this step, the lower the step, the lower the max brake percent", "Integer", "1"
9598
"NominalSpeedStep", "When pressing Shift+A or Shift+D how many speed units should the selected speed change ", "Integer", "0"
96-
"SpeedSelectorDelayTimeBeforeUpdating", "Time that the speed selector has to be kept unchanged before updating the set speed", "Seconds", "0"
9799
"StartReducingSpeedDelta", "The lower number, the sooner the regulator will decrease power", "Float", "1"
98100
"StartReducingSpeedDeltaDownwards", "If present and different from zero, overrides the above parameter for dynamic braking", "Float", "0"
99-
"SpeedDeltaToStartAccelerating", "Difference between train speed and set speed before applying throttle", "Float (speed)", "0"
100-
"SpeedDeltaToStartBraking", "Difference between train speed and set speed before applying brakes", "Float (speed)", "0.5 m/s"
101-
"SpeedDeltaToStopAccelerating", "Difference between train speed and set speed below which throttle is closed", "Float (speed)", "0"
102-
"SpeedDeltaToStopBraking", "Difference between train speed and set speed below which brakes are released", "Float (speed)", "0.5 m/s"
103-
"SpeedDeltaAcceleratingOffset", "Speed delta at which the demanded acceleration is 0", "Float (speed)", "0"
104-
"SpeedDeltaBrakingOffset", "Speed delta at which the demanded deceleration is 0", "Float (speed)", "0"
105101
"ForceRegulatorAutoWhenNonZeroSpeedSelected", "When a non zero speed is selected, the regulator is set to auto", "Boolean", "FALSE"
106102
"ForceRegulatorAutoWhenNonZeroSpeedSelectedAndThrottleAtZero", "Self explaining", "Boolean", "FALSE"
107103
"MaxForceKeepSelectedStepWhenManualModeSet", "Self explaining", "Boolean", "FALSE"
@@ -111,43 +107,43 @@ A list of the available .eng file CC parameters follows here below.
111107
"ThrottleFullRangeDecreaseTimeSeconds", "Time in seconds needed for the regulator to pass from 100 to 0% of power", "Seconds", "5"
112108
"DynamicBrakeFullRangeIncreaseTimeSeconds", "Same as above, but for dynamic braking", "Seconds", "5"
113109
"DynamicBrakeFullRangeDecreaseTimeSeconds", "Same as above, but for dynamic braking", "Seconds", "5"
114-
"TrainBrakeFullRangeIncreaseTimeSeconds", "Same as above, but for train brakes", "Seconds", "6"
115-
"TrainBrakeFullRangeDecreaseTimeSeconds", "Same as above, but for train brakes", "Seconds", "6"
116-
"SpeedDeltaFunctionMode", "Algorithm used to convert speed delta to required acceleration. Recommended to use Linear mode, Sqrt mode is deprecated", "String", "Sqrt"
117-
"ThrottlePID", "Proportional, Integral and Derivative coefficients used to convert demanded acceleration to throttle percent. Changing it is not recommended", "Floats", ""
118-
"DynamicBrakePID", "Proportional, Integral and Derivative coefficients used to convert demanded deceleration to dynamic brake percent. Changing it is not recommended", "Floats", ""
119-
"TrainBrakePID", "Proportional, Integral and Derivative coefficients used to convert demanded deceleration to train brake percent. Changing it is not recommended", "Floats", ""
110+
"TrainBrakeFullRangeIncreaseTimeSeconds", "Same as above, but for train brakes", "Seconds", "10"
111+
"TrainBrakeFullRangeDecreaseTimeSeconds", "Same as above, but for train brakes", "Seconds", "5"
120112
"DefaultForceStep", "When OR is started, this will be the selected force step, usually set at 0", "Integer", "1"
121113
"DisableCruiseControlOnThrottleAndZeroSpeed", "If train is stationary and throttle is increased and CC is still in auto, this will revert the mode to manual", "Boolean", "FALSE"
122114
"DisableCruiseControlOnThrottleAndZeroForce", "If train is moving and throttle is increased and CC is still in auto and selected force is zero, this will revert the mode to manual", "Boolean", "FALSE"
123115
"DynamicBrakeCommandHasPriorityOverCruiseControl", "When cruise control is in Auto, manually activating the dynamic brake has priority", "Boolean", "TRUE"
124116
"HasIndependentThrottleDynamicBrakeLever", "The cabview is equipped with a combined Throttle-Dynamic brake lever independent from the CC controls", "Boolean", "FALSE"
125117
"DoComputeNumberOfAxles", "Number of train axles automatically computed at game start", "Boolean", "FALSE"
118+
"AntiWheelSpinEquipped", "Self explaining. Note: if there are multiple locos in the consist, the loco with most speed diff takes the decision to activate", "Boolean", "FALSE"
119+
"AntiWheelSpinSpeedDiffThreshold", "The speed difference (MpS) between wheel speed and train speed that activates the anti spin system and reduces power", "Boolean", "FALSE"
126120
"ParkingBrakeEngageSpeed", "The speed when automatic parking brake will be engaged if present", "Float (speed)", "0"
127121
"ParkingBrakePercent", "To what engine brake percent should the parking brake be set if engaged", "Float", "0"
128122
"MaxPowerThreshold", "At this speed, no matter what max force was selected by the driver, the regulator will lineary reach force to 100%", "Float (speed)", "0"
129123
"SafeSpeedForAutomaticOperationMpS", "Some locos/systems need the 'confirm to drive' button to be held until the safe speed is reached. This is the speed above which the loco will continue delivering power.", "Float (speed)", "0"
130124
"ContinuousSpeedIncreasing", " ", "Logical", "FALSE"
125+
"PowerBreakoutAmpers", "Some locos are unable to maintain power when current is lower than this value. In that case, a breakout is generated and the power goes to 0", "Float(Amperes)", "100"
126+
"PowerBreakoutSpeedDelta", "Obsolete", "Float", "100"
127+
"PowerResumeSpeedDelta", "When breakout was activated, this is the speed hysteresis, when speed is reduced by this value the engine will resume power", "Float", "100"
131128
"PowerReductionDelayPaxTrain", "Time required for the loco to reach maximum percent of power set in PowerReductionValue until the whole train is in pull on its couplers for passenger trains", "Float (seconds)", "0"
132129
"PowerReductionDelayCargoTrain", "Time required for the loco to reach maximum percent of power set in PowerReductionValue until the whole train is in pull on its couplers for freight trains", "Float (seconds)", "0"
133130
"PowerReductionValue", "Maximum power in % to maintain until PowerReductionDelay is reached", "Float", "100"
134131
"DisableZeroForceStep", "Minimum force step is limited above zero", "Boolean", "FALSE"
135-
"DisableZeroSelectedSpeedStep", "The minimum speed that can be selected is greater than 0", "Boolean", "FALSE"
136132
"UseThrottleAsSpeedSelector", "if ControllerCruiseControlLogic is set to SpeedOnly, throttle when in Auto mode will change the maximum CC speed", "Boolean", "FALSE"
137133
"UseThrottleAsForceSelector", "if ControllerCruiseControlLogic is set to None, throttle when in Auto mode will change the maximum CC Force", "Boolean", "FALSE"
134+
"UseThrottleInCombinedControl", "Throttle is used as force selector or speed selector even if in combined control, to be used in conjunction of one of the two above parameters", "Boolean", "FALSE"
138135
"ControllerCruiseControlLogic", "Can have values 'None', 'SpeedOnly', 'Full'", "Enum", "Full"
139136
"HasProportionalSpeedSelector", "Speed selector is performed by a lever ranging from 0 to max speed", "Boolean", "FALSE"
140-
"SpeedSelectorIsDiscrete", "Speed selected can have only values multiple of NominalSpeedStep", "Boolean", "FALSE"
137+
"SpeedSelectorIsDiscrete", "Speed selected can have only values multiple of NominalSpeedStep, even if selection is through mouse", "Boolean", "FALSE"
141138
"ModeSwitchAllowedWithThrottleNotAtZero", "Switch from manual to auto and vice-versa can occur also when throttle lever is not at 0", "Boolean", "FALSE"
142139
"DisableManualSwitchToAutoWhenSetSpeedNotAtTop", "Manual Switch to Cruise Control Auto Mode can't occur when speed is not set at maximum value and at the same moment train speed is not 0", "Boolean", "FALSE"
143140
"UseTrainBrakeAndDynBrake", "CC uses train brake and dyn brake together", "Boolean", "FALSE"
144141
"UseDynBrake", "CC uses dyn brake", "Boolean", "TRUE"
145142
"TrainBrakeCommandHasPriorityOverCruiseControl", "A manual train braking inhibits Cruise Control to use both dynamic braking and tractive force", "Boolean", "TRUE"
146143
"TrainBrakeCommandHasPriorityOverAcceleratingCruiseControl", "A manual train braking inhibits Cruise Control to use tractive force", "Boolean", "TRUE"
147-
"BrakeCommandHasPriorityOverASCBraking", "A manual train brake command inhibits the Automatic Speed Control braking, even if the latter is more restrictive", "Boolean", "FALSE"
148-
"ASCSpeedTakesPriorityOverSpeedSelector", "Set speed demanded by the Automatic Speed Control system overrides the speed selected by the driver, even if the latter is lower", "Boolean", "FALSE"
149144
"SpeedDeltaToEnableTrainBrake", "This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake", "Float(speed)", "5m/s"
150-
"TrainBrakeMinPercentValue", "This is the minimum train brake percent used by the CC. 0 means no braking, 100 means full service braking", "Float(percent)", "10"
145+
"SpeedDeltaToEnableFullTrainBrake", "This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake with no reduced intensity", "Float(speed)", "10m/s"
146+
"TrainBrakeMinPercentValue", "This is the minimum train brake percent used by the CC. 0 means no braking, 100 means full service braking", "Float(percent)", "30"
151147
"TrainBrakeMaxPercentValue", "As above for maximum value. It must not be too high to avoid that the brake is not fully released timely", "Float(percent)", "85"
152148
"ThrottleNeutralPosition", "The zero throttle position is neutral in auto mode, that is in such position the CC does not intervene", "Boolean", "FALSE"
153149
"MinimumSpeedForCCEffect", "Below this speed CC has no effect", "Float(speed)", "0"
@@ -166,7 +162,6 @@ found in the table here below.
166162
"RegulatorManual",
167163
"RegulatorTest",
168164
"EngageForceOnNonZeroSpeed",
169-
"EngageParkingOnZeroSpeed",
170165
"StartFromZero", "No need to confirm you want to drive. If speed is set above zero, the train starts to move"
171166
"SelectorNeutral",
172167
"SelectorOn",
@@ -185,42 +180,27 @@ block within the .eng file.
185180

186181
Train brake usage occurs when the delta between the actual train speed and
187182
the target speed is higher than parameter SpeedDeltaToEnableTrainBrake.
188-
Above this value, the train brake is continuously adjusted to achieve
189-
the target deceleration. If available, dynamic brake takes priority. Only when
190-
the requested dynamic brake percent exceeds MinDynamicBrakePercentToEnableTrainBrake,
191-
the train brake is activated to supplement dynamic brakes.
192-
193-
UseTrainBrakeAndDynBrake ( True ) comment (** CC uses train brake and dyn brake together **)
194-
SpeedDeltaToEnableTrainBrake ( 5km/h ) comment (** This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake **)
183+
Between this delta and SpeedDeltaToEnableFullTrainBrake the train brake is
184+
set at TrainBrakeMinPercentValue. Above SpeedDeltaToEnableFullTrainBrake
185+
the train brake is continuously adjusted to achieve a constant deceleration.
186+
In other words, when the speed delta is high, train braking is adjusted to
187+
obtain a constant deceleration when dynamic braking is not enough; when train decelerates
188+
and delta reduces to SpeedDeltaToEnableFullTrainBrake the train brake is reduced to
189+
TrainBrakeMinPercentValue. When train decelerates further and delta reduces to
190+
SpeedDeltaToEnableTrainBrake the train brake is released. By adjusting these
191+
parameters to the locomotive and a typical train it pulls, it can be made sure that
192+
the brake pipe is fully recharged when the target speed is reached. Else the
193+
train speed could be significantly reduced below the target speed.
194+
195+
An example of the relevant lines in the CruiseControl
196+
block within the .eng file follows here::
197+
198+
UseTrainBrakeAndDynBrake ( True ) comment (** CC uses train brake and dyn brake together **)
199+
SpeedDeltaToEnableTrainBrake ( 15km/h ) comment (** This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake **)
200+
SpeedDeltaToEnableFullTrainBrake ( 30km/h ) comment (** This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake with no reduced intensity **)
195201
TrainBrakeMinPercentValue ( 10 ) comment (** This is the minimum train brake percent used by the CC, where 0 means no braking and 100 full braking **)
196202
TrainBrakeMaxPercentValue ( 60 ) comment (** As above for maximum value. It must not be too high to avoid that the brake is not fully released timely **)
197203

198-
Speed and force selectors
199-
-------------------------
200-
Speed and force selectors with custom notches can be defined in the ``EngineControllers`` block of the ENG file,
201-
using ``orts_speed_selector`` and ``orts_force_selector`` controller names. The range should be between 0 and 1,
202-
where 0 means zero force/speed and 1 means maximum force/speed.
203-
204-
Example::
205-
206-
Engine (
207-
EngineControllers (
208-
ORTS_Speed_Selector ( 0 1 0.1 0
209-
NumNotches ( 0 )
210-
ORTSDelayTimeBeforeUpdating ( 0.5s )
211-
)
212-
ORTS_Force_Selector ( 0 1 0.1 0
213-
NumNotches ( 4
214-
Notch ( 0 0 )
215-
Notch ( 0.25 0 )
216-
Notch ( 0.5 0 )
217-
Notch ( 1 0 )
218-
)
219-
)
220-
)
221-
)
222-
223-
224204
Multi Position Controller (MPC)
225205
-------------------------------
226206

@@ -299,31 +279,6 @@ MPC is connected. Controllers linked may be either "Throttle" or
299279
The boolean parameter *CanControlTrainBrake*, which is false by
300280
default, is optional.
301281

302-
Automatic Speed Control
303-
=======================
304-
Cab signaling systems can be integrated with speed control systems to automatically
305-
respect speed restrictions and stop at signals and station stops. The
306-
:ref:`Train Control System scripts <features-scripting-tcs>` can request a setpoint
307-
speed for the cruise control system, eliminating the need for the driver to manually
308-
adjust the train speed. The interface consists of two variables available from
309-
the TCS script:
310-
.. code-block:: csharp
311-
312-
float? SetSpeedMpS
313-
314-
This variable, if not null, instructs the cruise control system to adjust
315-
the train speed in order to reach the requested setpoint.
316-
317-
.. code-block:: csharp
318-
319-
float SetSpeedAccelerationMpS
320-
321-
This variable controls the requested acceleration when the train is at the set speed.
322-
When the set speed is constant because the TCS is supervising a ceiling speed,
323-
the requested acceleration should be 0. However, during a braking curve,
324-
as the set speed is decreasing, the requested acceleration should be negative,
325-
matching the deceleration of the braking curve.
326-
327282
.. _cruisecontrol-cabviewcontrolstable:
328283

329284
Cruise Control Cabview Controls

Source/Orts.Simulation/Common/Scripting/BrakeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public float IntermediateValue
189189
/// <summary>
190190
/// Fraction of train brake demanded by cruise control
191191
/// </summary>
192-
public float CruiseControlBrakeDemand() => Host.CruiseControlBrakeDemand;
192+
public float CruiseControlBrakeDemand() => Locomotive.CruiseControl != null ? Locomotive.CruiseControl.TrainBrakePercent / 100 : 0;
193193

194194
/// <summary>
195195
/// Current notch of the brake controller

Source/Orts.Simulation/Common/Scripting/TrainControlSystem.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -362,36 +362,6 @@ public float BrakeCutsPowerAtBrakeCylinderPressureBar()
362362
/// </summary>
363363
public Action<float> SetDynamicBrakeController;
364364
/// <summary>
365-
/// Sets the target speed of the automatic traction/braking system
366-
/// Gets the current speed enforced by the automatic traction/braking system
367-
/// </summary>
368-
public float? SetSpeedMpS
369-
{
370-
get
371-
{
372-
if (Locomotive.CruiseControl?.SpeedRegMode == CruiseControl.SpeedRegulatorMode.Auto) return Locomotive.CruiseControl.SetSpeedMpS;
373-
return null;
374-
}
375-
set
376-
{
377-
if (Locomotive.CruiseControl != null) Locomotive.CruiseControl.ASCSetSpeedMpS = value;
378-
}
379-
}
380-
/// <summary>
381-
/// Controls the target acceleration of the automatic traction/braking system when a braking curve is active
382-
/// </summary>
383-
public float SetSpeedAccelerationMpSS
384-
{
385-
get
386-
{
387-
return Locomotive?.CruiseControl.ASCAccelerationMpSS ?? 0;
388-
}
389-
set
390-
{
391-
if (Locomotive.CruiseControl != null) Locomotive.CruiseControl.ASCAccelerationMpSS = value;
392-
}
393-
}
394-
/// <summary>
395365
/// Cut power by pull all pantographs down.
396366
/// </summary>
397367
public Action SetPantographsDown;

Source/Orts.Simulation/Simulation/Confirmer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public Confirmer(Simulator simulator, double defaultDurationS)
257257
, new string [] { GetString("Battery"), GetString("off"), null, GetString("on") }
258258
, new string [] { GetString("Master key"), GetString("off"), null, GetString("on") }
259259
// Cruise control
260-
, new string [] { GetString("Max acceleration"), null, null, null, GetString("decrease"), GetString("increase") }
260+
, new string [] { GetString("Max acceleration"), null, null, null }
261261
, new string [] { GetString("Restricted speed zone"), GetString("off"), null, GetString("on") }
262262
// Train Devices
263263
, new string [] { GetString("Doors Left"), GetString("close"), null, GetString("open") }

0 commit comments

Comments
 (0)