Skip to content

Commit 944f427

Browse files
committed
Tune adhesion coefficient
1 parent 560c07c commit 944f427

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,10 +3034,10 @@ public virtual void UpdateFrictionCoefficient(float elapsedClockSeconds)
30343034
// Exponential curve is used to transition between static friction and dynamic friction when wheel slips
30353035
// Exponential constant calculated between two points, using this tool - https://mathcracker.com/exponential-function-calculator#results
30363036
// 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-
var expAdhesion = -0.0871;
3037+
// Constant points facilitate a decrease from 1 to 0.7 in 3 seconds - P1 = (0, 1), P2 = (5, 0.77). Hence exp constant = −0.0523
3038+
var expAdhesion = -0.0523;
30393039
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
3040+
WheelSlipTimeS = MathHelper.Clamp(WheelSlipTimeS, 0.0f, 5.0f); // Ensure that time to transition between the two friction cases is maintained - currently set to 3 secs
30413041

30423042
float adhesionMultiplier = (float) Math.Exp(expAdhesion * WheelSlipTimeS);
30433043
CurrentWheelSlipAdhesionMultiplier = adhesionMultiplier;
@@ -3053,12 +3053,12 @@ public virtual void UpdateFrictionCoefficient(float elapsedClockSeconds)
30533053

30543054
if (SlipFrictionCoefficientFactor < BaseFrictionCoefficientFactor && SlipFrictionCoefficientFactor != 0) // Once these two are equal then assume that wheels have stopped slipping.
30553055
{
3056-
// Trace.TraceInformation("SlipFriction {0} Base {1}", SlipFrictionCoefficientFactor, BaseFrictionCoefficientFactor);
3056+
// Trace.TraceInformation("SlipFriction {0} Base {1}", SlipFrictionCoefficientFactor, BaseFrictionCoefficientFactor);
30573057
// 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-
var expAdhesion = 0.0871;
3058+
// Constant points facilitate an increase from 0.7 to 1 in 3 seconds - P1 = (5, 0.77), P2 = (0, 1). Hence exp constant = 0.0523
3059+
var expAdhesion = 0.0523;
30603060
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
3061+
WheelStopSlipTimeS = MathHelper.Clamp(WheelStopSlipTimeS, 0.0f, 5.0f); // Ensure that time to transition between the two friction cases is maintained - currently set to 3 secs
30623062

30633063
float adhesionMultiplier = CurrentWheelSlipAdhesionMultiplier * (float)Math.Exp(expAdhesion * WheelStopSlipTimeS);
30643064

0 commit comments

Comments
 (0)