You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs
+49-4Lines changed: 49 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -215,10 +215,14 @@ public float CurrentLocomotiveSteamHeatBoilerWaterCapacityL
215
215
216
216
// Adhesion parameters
217
217
floatBaseFrictionCoefficientFactor;// Factor used to adjust Curtius formula depending upon weather conditions
218
+
floatSlipFrictionCoefficientFactor;
218
219
publicfloatSteamStaticWheelForce;
219
220
publicfloatSteamTangentialWheelForce;
220
221
publicfloatSteamDrvWheelWeightLbs;// Weight on each drive axle
221
222
publicfloatPreviousThrottleSetting=0.0f;// Holds the value of the previous throttle setting for calculating the correct antislip speed
223
+
floatWheelSlipTimeS;
224
+
floatWheelStopSlipTimeS;
225
+
floatCurrentWheelSlipAdhesionMultiplier;
222
226
223
227
// parameters for Track Sander based upon compressor air and abrasive table for 1/2" sand blasting nozzle @ 50psi
224
228
publicfloatMaxTrackSandBoxCapacityM3=Me3.FromFt3(40.0f);// Capacity of sandbox - assume 40.0 cu ft
@@ -3016,13 +3020,54 @@ public virtual void UpdateFrictionCoefficient(float elapsedClockSeconds)
3016
3020
3017
3021
}
3018
3022
3019
-
if(WheelSlip&&ThrottlePercent>0.2f&&!BrakeSkid)// Test to see if loco wheel is slipping, then coeff of friction will be decreased below static value. Sanding will override this somewhat
3023
+
// When wheel slips or skids, then dynamic (kinetic) coeff of friction will be decreased below static value. Sanding will override this somewhat.
3024
+
// The transition between static and dynamic friction appears to decrease at an exponential rate until it reaches a steady state dynamic value.
3025
+
//
3026
+
3027
+
3028
+
// Test to see if loco wheel is slipping or skidding due to brake application
BaseFrictionCoefficientFactor*=0.5f;// Descrease friction to take into account dynamic (kinetic) friction, typically kinetic friction is approximately 50% of static friction.
3031
+
3032
+
WheelStopSlipTimeS=0;// Reset stop slip time if wheel slip starts
3033
+
3034
+
// Exponential curve is used to transition between static friction and dynamic friction when wheel slips
3035
+
// Exponential constant calculated between two points, using this tool - https://mathcracker.com/exponential-function-calculator#results
3036
+
// Google search suggests that Steel on steel has a static coeff = 0.74, and a dynamic coeff = 0.57. Hence reduction = 0.77.
3037
+
// Constant points facilitate a decrease from 1 to 0.7 in 3 seconds - P1 = (0, 1), P2 = (3, 0.77). Hence exp constant = −0.0871
3038
+
varexpAdhesion=-0.0871;
3039
+
WheelSlipTimeS+=elapsedClockSeconds;
3040
+
WheelSlipTimeS=MathHelper.Clamp(WheelSlipTimeS,0.0f,3.0f);// Ensure that time to transition between the two friction cases is maintained - currently set to 3 secs
BaseFrictionCoefficientFactor*=adhesionMultiplier;// Descrease friction to take into account dynamic (kinetic) friction, typically kinetic friction is approximately 50% of static friction.
BaseFrictionCoefficientFactor=MathHelper.Clamp(BaseFrictionCoefficientFactor,0.05f,1.0f);// Ensure friction coefficient never exceeds a "reasonable" value
3022
3049
}
3023
-
elseif(WheelSlip&&ThrottlePercent<0.1f&&BrakeSkid)// Test to see if loco wheel is skidding due to brake application
3050
+
else
3024
3051
{
3025
-
BaseFrictionCoefficientFactor*=0.5f;// Descrease friction to take into account dynamic (kinetic) friction, typically kinetic friction is approximately 50% of static friction.
3052
+
WheelSlipTimeS=0;// Reset slip time if wheel slip stops
3053
+
3054
+
if(SlipFrictionCoefficientFactor<BaseFrictionCoefficientFactor&&SlipFrictionCoefficientFactor!=0)// Once these two are equal then assume that wheels have stopped slipping.
3055
+
{
3056
+
// Trace.TraceInformation("SlipFriction {0} Base {1}", SlipFrictionCoefficientFactor, BaseFrictionCoefficientFactor);
3057
+
// Exponential curve is used to transition between dynamic friction and static friction when wheel stops slipping
3058
+
// Constant points facilitate an increase from 0.7 to 1 in 3 seconds - P1 = (3, 0.77), P2 = (0, 1). Hence exp constant = 0.0871
3059
+
varexpAdhesion=0.0871;
3060
+
WheelStopSlipTimeS+=elapsedClockSeconds;
3061
+
WheelStopSlipTimeS=MathHelper.Clamp(WheelStopSlipTimeS,0.0f,3.0f);// Ensure that time to transition between the two friction cases is maintained - currently set to 3 secs
// Trace.TraceInformation("adhesion {0} StopTime {1} Base {2} Current {3}", adhesionMultiplier, WheelStopSlipTimeS, BaseFrictionCoefficientFactor, CurrentWheelSlipAdhesionMultiplier);
3066
+
3067
+
BaseFrictionCoefficientFactor*=adhesionMultiplier;// Descrease friction to take into account dynamic (kinetic) friction, typically kinetic friction is approximately 50% of static friction.
BaseFrictionCoefficientFactor=MathHelper.Clamp(BaseFrictionCoefficientFactor,0.05f,1.0f);// Ensure friction coefficient never exceeds a "reasonable" value
3070
+
}
3026
3071
}
3027
3072
3028
3073
varAdhesionMultiplier=Simulator.Settings.AdhesionFactor/100.0f;// Convert to a factor where 100% = no change to adhesion
#region - Steam Adhesion Model Input for Steam Locomotives
4654
4654
4655
-
// Based upon information presented in "Locomotive Operation - A Technical and Practical Analysis" by G. R. Henderson - https://archive.org/details/locomotiveoperat00hend
4655
+
// Based upon information presented on pg 276 of "Locomotive Operation - A Technical and Practical Analysis" by G. R. Henderson - https://archive.org/details/locomotiveoperat00hend
4656
4656
// At its simplest slip occurs when the wheel tangential force exceeds the static frictional force
4657
4657
// Static frictional force = weight on the locomotive driving wheels * frictional co-efficient
4658
4658
// Tangential force = Effective force (Interia + Piston force) * Tangential factor (sin (crank angle) + (crank radius / connecting rod length) * sin (crank angle) * cos (crank angle))
// If locomotive slip is occuring, set parameters to reduce motive force (pulling power), and set wheel rotational speed for wheel viewers
4980
4980
if(IsLocoSlip)
4981
4981
{
4982
-
4982
+
// Based upon information presented in "Locomotive Operation - A Technical and Practical Analysis" by G. R. Henderson - https://archive.org/details/locomotiveoperat00hend
4983
4983
// This next section caluclates the turning speed for the wheel if slip occurs. It is based upon the force applied to the wheel and the moment of inertia for the wheel
4984
4984
// A Generic wheel profile is used, so results may not be applicable to all locomotive, but should provide a "reasonable" guestimation
4985
4985
// Generic wheel assumptions are - 80 inch drive wheels ( 2.032 metre), a pair of drive wheels weighs approx 6,000lbs, axle weighs 1,000 lbs, and has a diameter of 8 inches.
4986
4986
// Moment of Inertia (Wheel and axle) = (Mass x Radius) / 2.0
4987
+
// Reference model assumption
4987
4988
floatWheelRadiusAssumptM=Me.FromIn(80.0f/2.0f);
4988
4989
floatWheelWeightKG=Kg.FromLb(6000.0f);
4989
4990
floatAxleWeighKG=Kg.FromLb(1000.0f);
4990
4991
floatAxleRadiusM=Me.FromIn(8.0f/2.0f);
4992
+
4993
+
// Take into account the actual lcomotive that we are modelling, and vary the above values by the ratio of drive wheel size.
0 commit comments