-
Notifications
You must be signed in to change notification settings - Fork 97
Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics #1098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…(always use wheel speed in order to obey conservation of energy)
- 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
Please note that it was decided that train speed should be used for the tractive force curves instead of wheel speed. The motivation was that, when applying traction power, there will be a wheel creep and wheel speed will be a little bit higher. However, the tractive force curves available in the manuals may have been measured regarding the train speed, so the output force would be a bit lower than expected. I'm not saying that I agree with this argument, in fact I tried to change that a few years ago, and I was told this. But I would really like getting rid of AbsTractionSpeedMpS and just use AbsWheelSpeedMpS for the traction physics, that's what makes more sense. I have been working on some adhesion tweaks (I separated the adhesion-related changes from the rheostatic-controller part that I shared with you). In particular, I did further cleanup of the steam engine code (ideally everything should be moved to the SteamEngine class, instead of adding "numberOfEngine" to every method, but that will take some time, so I'm doing it step by step). Also I wanted to get rid of the 'Compensated' motive force output of the axle module. I'll rebase my changes to this branch, so it's ready to go into unstable just after this is merged. |
Whilst I agree that it would be ideal that train speed and wheel speed should be clearly defined and used, I would suggest that any changes in this area should be done with due consideration, perhaps on a use by use basis, as it may impact the user inputs or the physics in OR. For example, as Cesar has suggested, the typical traction curves shown by a manufacturer and potentially by test results uses the train speed as far as I am aware, so to make it easier for user configuration the user should always be able to use train speed when entering this type of information. This will retain the highest degree of accuracy if prototypical information can be used directly. I would envisage that slip characteristics would be overlaid these figures as appropriate. |
Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs
Outdated
Show resolved
Hide resolved
Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs
Outdated
Show resolved
Hide resolved
Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs
Outdated
Show resolved
Hide resolved
- 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 6bbd2c6: 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
- Pull request #1072 at 52d5886: 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 6bbd2c6: 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
- Pull request #1072 at 52d5886: 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 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1072 at 52d5886: 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 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1072 at 52d5886: 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 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1101 at 6813c06: Added help buttons on Simulations options in Menu - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
I agree that the discrepancy due to wheel creep will be minimal, and using the wheel speed has much more advantages. Could you create a bug report? |
I have made a formal bug report on launchpad https://bugs.launchpad.net/or/+bug/2112223 I am still tentatively willing to add additional behavior should it be firmly decided that there is justification to use ground speed sometimes, but I would rather folks keep testing existing content with the behavior as-is to look out for any visible differences. The change is not supposed to be that noticeable except during wheel slip. (Of course, if I missed something that should/shouldn't use wheel speed, that is still worth noting, keep an eye out for anything unusual.) |
- Pull request #1072 at 52d5886: 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 #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 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1101 at 6813c06: Added help buttons on Simulations options in Menu - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
openrails/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs Line 656 in 6bbd2c6
Code using this variable is a candidate, at least to look at. Also, given that we also have AbsSpeedMpS, having another variable named 'absSpeedMpS' is confusing. |
- Pull request #1072 at 52d5886: 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 #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 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1101 at 6813c06: Added help buttons on Simulations options in Menu - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
Looks to me that absSpeedMpS should be the true speed as it's driving lots of systems unrelated to tractive effort...but at the same time, it appears to be entirely redundant to AbsSpeedMpS, can't tell why it would need to be a separate variable. |
There's a mix, see openrails/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs Line 6605 in 6bbd2c6
Also there is openrails/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs Line 4884 in 6bbd2c6
openrails/Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs Line 7081 in 6bbd2c6
|
- Pull request #1072 at 52d5886: 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 #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 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1101 at 296d878: Added help buttons on Simulations options in Menu - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1072 at 52d5886: Content Creation Shortcuts & Advanced Wagon Shape Interactions - Pull request #1084 at 70ab352: Timetable: Calculate Delay While Stopped at a Station - 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 #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 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1097 at 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1097 at 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 6bbd2c6: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1102 at c96c499: Fix Stuck Locomotive Brakes After Initialization - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
Drawbar power is measured relative to the couplers, not the wheels, so the true speed is the most appropriate measure there. In real life you wouldn't know the drawbar power without a dynamometer car, but the dynamometer wouldn't care about the wheel speed of the locomotive. (A dynamometer would probably use its own wheel speed or a radar speedometer to calculate power.)
The calls to UpdateCylinders have already been changed to use the (attached) wheel speed, that is just a local variable with the same name as the global one (not confusing at all...)
And yeah a crosshead pump should use the wheel speed to derive pumping speed (unusual strategies; use wheelslip to intentionally increase pumping rate). Though the energy needed to pump the water may suppress wheel slip...Looks like this could also do with a calculation of the horsepower malus, that is one of the major disadvantages of a crosshead pump. |
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1097 at 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 34bd6a7: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1102 at c96c499: Fix Stuck Locomotive Brakes After Initialization - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1097 at 63248a0: Fix For Delayed Particle Emitter Spawning - Pull request #1098 at 34bd6a7: Correct Use of Wheel Speed vs Ground Speed in Locomotive Physics - Pull request #1099 at 5e8b056: Fix TCS orders not being sent to pantographs - Pull request #1100 at cccb40a: Updates to German translations - Pull request #1102 at c96c499: Fix Stuck Locomotive Brakes After Initialization - Pull request #1103 at d2fae0f: Fix diverging force when exceeding max speed - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drawbar power is measured relative to the couplers, not the wheels, so the true speed is the most appropriate measure there. In real life you wouldn't know the drawbar power without a dynamometer car, but the dynamometer wouldn't care about the wheel speed of the locomotive. (A dynamometer would probably use its own wheel speed or a radar speedometer to calculate power.)
Right, I don't know what I was thinking about here.
The calls to UpdateCylinders have already been changed to use the (attached) wheel speed, that is just a local variable with the same name as the global one (not confusing at all...)
Ah, fine
And yeah a crosshead pump should use the wheel speed to derive pumping speed (unusual strategies; use wheelslip to intentionally increase pumping rate). Though the energy needed to pump the water may suppress wheel slip...Looks like this could also do with a calculation of the horsepower malus, that is one of the major disadvantages of a crosshead pump.
This could be added as extra force to the axle module in the future (maybe as extra friction, but first it makes sense to move Davis A and Davis B to the axle).
These changes make sense to me, the physics related to traction shouldn't 'see' the train speed, only the wheel speed.
After years of development, parts of OR have become quite crowded between different types of train speed (is this the speed of the wheels? the true speed relative to the ground? is it the absolute value of speed? or is it negative in reverse and positive forwards?) This has led to a variety of issues like locomotives exceeding their power rating, wheels spinning impossibly fast during wheelslip, wheelslip being too difficult to recover from, and so on.
I talked about this problem 4 years ago in this Elvas Tower thread but it was only ever partially solved.
Formal bug report can be found here.
This PR refactors all that under one guiding principle: anything that applies force to the wheels should always use the wheel speed. Intuitively, this makes sense, but this also makes sense from a conservation of energy perspective. The transmission of a locomotive does not 'know' the ground speed (except if an advanced wheel slip protection system is present, but that does not change the laws of physics), so the best a locomotive transmission can do is output a certain amount of energy to the motors/gearbox/pistons and then hope for the best. The current implementation allows for the transmission to output a certain amount of energy to the rails in some cases, and then the motor/gearbox/piston energy is adjusted accordingly...which can result in the motor/gearbox/piston power exceeding the power available from the wire/engine/boiler, breaking conservation of energy (this generally occurs during wheel slip).
As an example of breaking the laws of physics, let's assume a locomotive has a dynamic brake table that produces 60,000 pounds of dynamic brake force at 25 mph, but, "oh no!", even though the locomotive is currently moving at 25 mph, the wheels are skidding due to poor adhesion and are actually moving at only 5 mph. Before this PR, the dynamic brake force would still be 60,000 pounds at 5 mph wheel speed because dynamic brake force used the ground speed, not the wheel speed. This 60,000 pound force continues to decelerate the wheels, eventually causing the wheels to start turning in the opposite direction. Before long, the wheels are spinning at -50 mph in dynamic braking (giving a wheel power of 8,000 hp, when our dynamic brakes should only be capable of 4,000 hp, breaking conservation of energy) despite the locomotive moving at 25 mph, which (hopefully) is obviously nonsensical. After this PR, the wheel speed would determine the dynamic brake force, so the wheels spinning at 5 mph would only be given a dynamic brake force of say 12,000 pounds (assuming the dynamic brake curve linearly drops to 0 pounds at 0 mph), which would not be enough to spin the wheels in the opposite direction, producing more accurate response during wheel skid.
Expected results of this PR are:
Note that the changes here ended up concentrated on steam locomotives, there's a lot going on there that I don't understand/might not be correct, but my goal here was simply to use wheel speed for steam locomotive physics while preventing physics explosions during wheel slip. Multiple parts of steam locomotive code appeared to have been built with the assumption that steam locomotive physics were being driven at the locomotive ground speed, even when wheel slipping (this leads to nonsensical situations like the cylinders consuming steam as if you are moving 5 mph while the cylinders and wheels are actually going crazy at 50 mph), so some subtle tweaking was required to disable those assumptions but I believe I've avoided potential program crashes and made steam locomotive wheelslip sensible, predictable, and correctable.
(I think this trello card was created in response to this problem on steam locomotives.)
I've tested out all sorts of rolling stock, but I recommend simply trying a bit of everything in situations where wheelslip is likely and checking to make sure wheelslip doesn't lead to nonsensical situations, such as spinning the wheel speed above the maximum speed of the locomotive.
I consider this PR a prerequisite to some of the other work I want to do, particularly electric motor simulation, that would behave suboptimally with the current implementation's use of ground speed for traction calculations.