Skip to content

Commit a0a37ac

Browse files
committed
Correct issue with dynamic loading and drivewheel weight
1 parent b227eec commit a0a37ac

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,10 +2039,11 @@ public override void Initialize()
20392039
}
20402040

20412041
// Calculate factor of adhesion for display purposes
2042-
// Per Engine
2042+
// Per Engine, and set Initial drivewheelweight
20432043
for (int i = 0; i < SteamEngines.Count; i++)
20442044
{
20452045
SteamEngines[i].CalculatedFactorOfAdhesion = Kg.ToLb(SteamEngines[i].AttachedAxle.WheelWeightKg) / SteamEngines[i].MaxTractiveEffortLbf;
2046+
SteamEngines[i].AttachedAxle.InitialDrvWheelWeightKg = SteamEngines[i].AttachedAxle.WheelWeightKg;
20462047
}
20472048

20482049
// Calculate "critical" power of locomotive to determine limit of max IHP
@@ -6338,13 +6339,15 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63386339
// geared locomotive or booster locomotive
63396340
{
63406341
// Moment of Inertia (Wheel and axle) = (Mass x Radius^2) / 2.0
6342+
float wheelMassKG = Kg.FromLb(6000.0f);
6343+
float AxleMassKG = Kg.FromLb(1000.0f);
63416344
float AxleRadiusM = Me.FromIn(8.0f / 2.0f);
6342-
float WheelMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6343-
float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
6345+
float WheelMomentInertia = (wheelMassKG * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6346+
float AxleMomentInertia = (AxleMassKG * AxleRadiusM * AxleRadiusM) / 2.0f;
63446347
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63456348
float TotalMomentInertia = TotalWheelMomentofInertia;
63466349
axle.InertiaKgm2 = TotalMomentInertia;
6347-
axle.DampingNs = linkedEngine.AttachedAxle.AxleWeightN / 200;
6350+
63486351
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
63496352
axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(linkedEngine.AttachedAxle.WheelRadiusM * 2.0f)));
63506353
}
@@ -6357,10 +6360,11 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63576360
// 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.
63586361
// Moment of Inertia (Wheel and axle) = (Mass x Radius^2) / 2.0
63596362

6360-
float AxleWeighKG = Kg.FromLb(1000.0f);
6363+
float wheelMassKG = Kg.FromLb(6000.0f);
6364+
float AxleMassKG = Kg.FromLb(1000.0f);
63616365
float AxleRadiusM = Me.FromIn(8.0f / 2.0f);
6362-
float WheelMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6363-
float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
6366+
float WheelMomentInertia = (wheelMassKG * linkedEngine.AttachedAxle.WheelRadiusM * linkedEngine.AttachedAxle.WheelRadiusM) / 2.0f;
6367+
float AxleMomentInertia = (AxleMassKG * AxleRadiusM * AxleRadiusM) / 2.0f;
63646368
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63656369

63666370
// The moment of inertia needs to be increased by the number of wheels in each set
@@ -6378,6 +6382,7 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63786382

63796383
float TotalMomentInertia = TotalWheelMomentofInertia + RodMomentInertia;
63806384
axle.InertiaKgm2 = TotalMomentInertia;
6385+
63816386
axle.DampingNs = axle.AxleWeightN / 200;
63826387
// Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
63836388
axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(linkedEngine.AttachedAxle.WheelRadiusM * 2.0f)));

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,6 @@ private void UpdateLocomotiveLoadPhysics()
21952195
// update drive wheel weight for each multiple steam engine
21962196
UpdateDriveWheelWeight(LocoIndex, MassKG, SteamLocomotiveIdentification.SteamEngines.Count);
21972197

2198-
21992198
}
22002199
else // locomotive must be a tender type locomotive
22012200
// This is a tender locomotive. A tender locomotive does not have any fuel onboard.
@@ -2296,7 +2295,7 @@ private void UpdateDriveWheelWeight(int index, float masskg, int numberofengine
22962295
for (int i = 0; i < LocoIdentification.SteamEngines.Count; i++)
22972296
{
22982297
LocoIdentification.SteamEngines[i].AttachedAxle.WheelWeightKg = (MassKG / InitialMassKG) * LocoIdentification.SteamEngines[i].AttachedAxle.InitialDrvWheelWeightKg;
2299-
}
2298+
}
23002299
}
23012300
}
23022301

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerTransmissions/Axle.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ public void Initialize()
246246
// Because of the irregular force around the wheel for a steam engine during a revolution, "response" time for warnings needs to be lower
247247
if (locomotive.EngineType == TrainCar.EngineTypes.Steam)
248248
{
249-
axle.WheelSlipThresholdTimeS = 0.01f;
250-
axle.WheelSlipWarningThresholdTimeS = 0.005f;
249+
axle.WheelSlipThresholdTimeS = 0.1f;
250+
axle.WheelSlipWarningThresholdTimeS = 0.05f;
251251
}
252252
else
253253
{
@@ -419,6 +419,7 @@ public float InertiaKgm2
419419
{
420420
if (value <= 0.0)
421421
throw new NotSupportedException("Inertia must be greater than zero");
422+
422423
inertiaKgm2 = value;
423424
switch (DriveType)
424425
{

0 commit comments

Comments
 (0)