Skip to content

Conversation

@SteelFill
Copy link
Contributor

@SteelFill SteelFill commented Jul 7, 2023

My first enhancement for OR, this adds multiple new features to the air brake code to allow for simulating some features of more modern brake valve types (eg: ABD, ABDW), and also refactors/reorganizes some brake system behaviors to accommodate the new features better.

(Start of) Discussion on ElvasTower
Trello Card

  • Refactor of triple valve state updates
  • Smoothing added to final stages of application/release to hopefully prevent triple valve from rapidly toggling states
  • Changes to aux/emerg res charging behavior to better accommodate graduated release systems
  • Quick release: Emerg res air can be piped into the brake pipe during release to speed up release. Enable with ORTSEmergencyResQuickRelease ( 1 ) [default is 0]
  • Uniform charging: Aux res charging can be slowed down when the brake pipe pressure is substantially higher than the aux res pressure to allow faster releases. Set the difference between BP and AUX to activate uniform charging with ORTSUniformChargingThreshold ( 3psi ) [default is 3 psi], and the factor by which the rate of charging is reduced with ORTSUniformChargingRatio ( 2 ) [default is 0, disabling the feature] {setting of 2 halves the rate, 0.5 would double the rate}.
  • Quick service: When changing from release to apply, the brake valve will vent some air from the brake pipe to speed up initial applications until the brake cylinder pressure has reached a certain level. Set the target brake cylinder feed line pressure using ORTSQuickServiceLimit ( 10psi ) [default is 0, disabling the feature], set the rate of brake pipe venting with ORTSQuickServiceVentRate ( 2.5psi/s ) [default is 0] or leave it at 0 psi/s to simulate systems which don't vent the brake pipe, and optionally allow for brake cylinder feed pressure to increase faster than usual using ORTSQuickServiceApplicationRate ( 15psi/s ) [default is 0].
  • Accelerated application: During applications, the brake valve will measure the rate of reduction of the brake pipe and will vent air from the brake pipe in proportion to the rate of reduction to dramatically speed up service applications. Set the proportionality constant of air vented to measured reduction using ORTSAcceleratedApplicationFactor ( 0.5 ) [default is 0, disabling the feature] but beware that this is an open loop control system, and setting ratios too large can cause too much air to be vented (I found factors above 1 start to risk the brake pipe emptying itself). Additionally, set a limit on the venting rate of accelerated application with ORTSAcceleratedApplicationMaxVentRate ( 1psi/s ) [default is 5 psi].
  • Sensitivity to initial reductions: Not all brake valves are built equal, and some will not change to 'apply' when in 'release' until the brake pipe pressure drops by a few psi. The pressure difference required to trip the valve from release to apply can be set with ORTSInitialApplicationThreshold ( 2psi ) [default is 1 psi of direct release, 0.15 bar for graduated release].
  • Brake cylinder springs: The return spring inside each brake cylinder will result in some very low brake cylinder pressures producing no force at the brake pads. If desired, the minimum brake cylinder pressure for any brake force to result can be set with ORTSCylinderSpringPressure ( 3psi ) [default is 0, resulting in force with any brake cylinder pressure].
  • Separate pressure limits in service and emergency: Some brake systems will have different brake cylinder pressure limits for service applications than for emergency applications. A limit on the output of the triple valve for service applications can be set with ORTSMaxServiceCylinderPressure ( 72psi ) [default is 0, resulting in this limit being ignored], while ORTSMaxTripleValveCylinderPressure acts as the pressure limit in emergency.
  • Accelerated emergency release: On cars with emergency reservoirs, release after an emergency application is sped up by pushing air from the brake cylinder and auxiliary reservoir into the brake pipe. This occurs when the brake pipe pressure is restored above 20 psi. This feature has no tokens as I haven't seen any evidence that the behavior varies substantially between different types of brake valve. It will be disabled entirely if ORTSEmergencyDumpValveTimer is set to 0.

Copy link
Contributor

@cesarBLG cesarBLG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements! They look OK to me, unfortunately they will conflict with my PR. I'll try to find reviewers for my PRs, and as soon as they are merged I'll add this PR to the Unstable releases

@cesarBLG
Copy link
Contributor

My two PRs have been approved and merged (thanks Peter). You can now merge the master branch into your branch and solve conflicts. Basically, the conflicting point will be the creation of two different Initialize() methods. One is intended for initial configuration of brakes (e.g. to configure parameters to a default value if they are not defined), and the other one is to reset brakes with shift+/

After conflicts are solved, your changes will be available in the Unstable release, as I've tagged this PR as "for-unstable"

@cesarBLG cesarBLG added the for-unstable Special label to include a pull request in the Unstable Version label Jul 13, 2023
twpol pushed a commit that referenced this pull request Jul 13, 2023
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at cf9f306: New Triple Valve Features
- Pull request #852 at d599941: Remove unneeded adhesion options
@SteelFill
Copy link
Contributor Author

SteelFill commented Jul 13, 2023

Got the conflicts with the relay valve code sorted, and I did a scan to make sure I'm using AutoCylPressurePSI instead of CylPressurePSI which should mean my code will function as expected with relay valves (all pressures are in terms of the brake cylinder feed line, not the actual brake cylinder pressure). That said, I am not at home so I have not had an opportunity to actually do a build and test that theory.

Also it looks like my brake cylinder return spring code got lost when resolving conflicts with the brake shoe enhancement. Oops.

twpol pushed a commit that referenced this pull request Jul 14, 2023
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at cf9f306: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
twpol pushed a commit that referenced this pull request Jul 14, 2023
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 1bdb7df: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at cf9f306: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
@SteelFill SteelFill marked this pull request as ready for review July 15, 2023 03:38
twpol pushed a commit that referenced this pull request Jul 15, 2023
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 1bdb7df: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at 858fa7e: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
twpol pushed a commit that referenced this pull request Jul 17, 2023
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 1bdb7df: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
@cesarBLG
Copy link
Contributor

Could you please add a Trello card for the feature, and link it here? Also, a link to the relevant forum posts is required. (see https://github.com/openrails/openrails/blob/master/Docs/Contributing.md for further information). Once the Trello card is approved, I can review and merge this PR.

twpol pushed a commit that referenced this pull request Jul 18, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 1bdb7df: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
twpol pushed a commit that referenced this pull request Jul 19, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 1bdb7df: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
- Pull request #853 at c8f02ad: Notify out of focus
twpol pushed a commit that referenced this pull request Jul 21, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 1bdb7df: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #852 at 72b9655: Remove unneeded adhesion options
- Pull request #853 at c8f02ad: Notify out of focus
- Pull request #854 at 027fac8: fix: Updating manual to match PR 647
@cjakeman cjakeman added the enhancement New feature or request label Jul 22, 2023
@cjakeman
Copy link
Contributor

cjakeman commented Jul 22, 2023

Could you please add a Trello card for the feature, and link it here?

Trello card added and approved by moving to stack v1.6

twpol pushed a commit that referenced this pull request Jul 22, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at 98f1c45: Initialize cars before restore
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #853 at c8f02ad: Notify out of focus
- Pull request #854 at 027fac8: fix: Updating manual to match PR 647
@SteelFill
Copy link
Contributor Author

Thanks for approving the Trello card Chris!

twpol pushed a commit that referenced this pull request Jul 23, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at eae6246: Initialize cars before restore
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #853 at c8f02ad: Notify out of focus
- Pull request #854 at 027fac8: fix: Updating manual to match PR 647
Copy link
Contributor

@cesarBLG cesarBLG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just a couple of suggestions, nothing really important. Thanks for all the new features!

twpol pushed a commit that referenced this pull request Jul 23, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at eae6246: Initialize cars before restore
- Pull request #851 at d3e8c3e: New Triple Valve Features
- Pull request #853 at 8357922: Notify out of focus
- Pull request #854 at 027fac8: fix: Updating manual to match PR 647
twpol pushed a commit that referenced this pull request Jul 23, 2023
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #844 at 3f42c30: Animate axles separately
- Pull request #846 at eae6246: Initialize cars before restore
- Pull request #851 at f4feee3: New Triple Valve Features
- Pull request #853 at 8357922: Notify out of focus
- Pull request #854 at 027fac8: fix: Updating manual to match PR 647
Copy link
Contributor

@cesarBLG cesarBLG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, everything looks OK to me.

@cesarBLG cesarBLG merged commit fc86323 into openrails:master Jul 24, 2023
@SteelFill SteelFill deleted the triplevalve-improvements branch July 24, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request for-unstable Special label to include a pull request in the Unstable Version

Development

Successfully merging this pull request may close these issues.

3 participants