Elvas Tower: Refactoring the air brake code - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Refactoring the air brake code Rate Topic: -----

#1 User is offline   Serana 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 21 October 2016 - 03:58 PM

Hello,

Currently, all of the parts of the air brake system is mixed in a single block of code called AirSinglePipe, AirTwinPipe, etc. depending on the type of brake system.
The code is highly difficult to maintain. For example, the most important function of AirSinglePipe (the Update function) is really complex because most components of the brake system are updated in this function.

So the brake system has to be separated into different bits of code.

The components that have to be separated are :
  • Equalising reservoir
  • Brake pipe pressure regulator
  • Main pipe pressure regulator
  • Triple valve
  • Distributor
  • Auxiliary reservoir
  • Brake cylinder

The AirSinglePipe, AirTwinPipe, etc. classes will only do the propagation of the air in the pipes.


Another important part of the refactoring will be the conversion of the pressure variables to bar.
It's a really old decision (from 2014), that we never had the time to apply.

#2 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,336
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 21 October 2016 - 07:14 PM

Sounds like a good thing to do. No feature or functionality changes, right?

For those of us who have specified display units of measure to something other than metric, will your conversion to Bar also address the various displays of train line pressure, etc., etc. such that we will continue to see the same units we see now?

#3 User is offline   Serana 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 21 October 2016 - 07:39 PM

The displayed pressures will still have the same unit.

#4 User is offline   steamer_ctn 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 1,888
  • Joined: 24-June 11
  • Gender:Male
  • Country:

Posted 22 October 2016 - 04:45 PM

Sounds good.

A couple of other aspects that perhaps might be worth considering as part of the :

i) Clearer "separation" of the Engine and Train brakes systems?
ii) Is the current linkage between Brake Controllers (Engine and Train) flexible enough to allow for some additional brake system operational features for different brake types?
iii) Is the Emergency Reservoir a separate section or part of the Auxiliary Reservoir section?
iv) Does the current code adequately allow for the various volumes of the auxiliary reservoirs when recharging the brake system?

Thanks for taking on the code rework.

#5 User is offline   Serana 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 22 October 2016 - 10:14 PM

View Poststeamer_ctn, on 22 October 2016 - 04:45 PM, said:

i) Clearer "separation" of the Engine and Train brakes systems?


Yes, the Engine and Train brake systems will be separated.
I was thinking something like this :
LocomotiveBrakeSystem ------------> PipeSystem (AirSinglePipe, AirTwinPipe,  ElectricAssistedetc.)
                            |-----> Valve (TripleValve, Distributor)
                            |   	|-----> AuxiliaryReservoir
                            |   	|-----> EmergencyReservoir
                            |-----> BrakeCylinder
                            |-----> EngineBrakeController
                            |-----> TrainBrakeController
                            |-----> EqualizingReservoir
                            |-----> BrakePipeRegulator

WagonBrakeSystem -----------------> PipeSystem (AirSinglePipe, AirTwinPipe, etc.)
                            |-----> Valve (TripleValve, Distributor)
                            |   	|-----> AuxiliaryReservoir
                            |   	|-----> EmergencyReservoir
                            |-----> BrakeCylinder

This separation will also allow to use scripting interfaces to model some particularities of the brake system.
For example, in Europe, ElectroPneumatic braking is done differently.
In France, we use a brake pipe pressure electric control.
In Great Britain, a brake cylinder pressure electric control is done.


We can also have a locomotive with no equalizing reservoir. The brake controller will control the brake pipe directly.

View Poststeamer_ctn, on 22 October 2016 - 04:45 PM, said:

ii) Is the current linkage between Brake Controllers (Engine and Train) flexible enough to allow for some additional brake system operational features for different brake types?

The 2 types of brake controller will be separated. The current scripting API will change.

View Poststeamer_ctn, on 22 October 2016 - 04:45 PM, said:


iii) Is the Emergency Reservoir a separate section or part of the Auxiliary Reservoir section?

Yes, it will be separated.

View Poststeamer_ctn, on 22 October 2016 - 04:45 PM, said:


iv) Does the current code adequately allow for the various volumes of the auxiliary reservoirs when recharging the brake system?

I don't think so : no volume variable exists for the auxiliary reservoir.

#6 User is offline   steamer_ctn 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 1,888
  • Joined: 24-June 11
  • Gender:Male
  • Country:

Posted 22 October 2016 - 11:31 PM

Thanks for your thoughts.

View PostSerana, on 22 October 2016 - 10:14 PM, said:

Yes, the Engine and Train brake systems will be separated.

I was thinking something like this :


Will the PipeSystem be the same on both the Loco and Wagon Brake systems, ie to cater for electrically operated brake cylinders on wagons, thus with different operational timings?

How will Vacuum brakes be allowed for, given that they have a number of fundamental differences to air brakes, such as no reservoirs or triple valves on wagons (even though some of this functionality is built into the brake cylinder), etc?

How will grade control and load compensation be incorporated?

View PostSerana, on 22 October 2016 - 10:14 PM, said:

I don't think so : no volume variable exists for the auxiliary reservoir.

You are correct that no direct input variable exists for the auxiliary reservoir volume, however it appears to be currently in the code, and calculated by a multiplication factor of the Emergency Reservoir.

My personal preference would be to see it added as an input parameter so that it can be correctly specified.

It would also be nice to see the brakes take into account the auxiliary reservoir volume when recharging the brake system, as this might provide a more accurate charging time calculation (impacting the pressure gradient along the train).

#7 User is offline   Nicolò 

  • Apprentice
  • Group: Status: Dispatcher
  • Posts: 47
  • Joined: 25-October 14
  • Simulator:OpenRails
  • Country:

Posted 23 October 2016 - 07:07 AM

There will be possible to have an electronic train brake controller that doesn't insist on the equaliser reservoir, as for modern locomotives, with this huge update?

#8 User is offline   Serana 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 23 October 2016 - 03:26 PM

View PostNicolò, on 23 October 2016 - 07:07 AM, said:

There will be possible to have an electronic train brake controller that doesn't insist on the equaliser reservoir, as for modern locomotives, with this huge update?


You mean having an electronically controlled pneumatic brake (ECP brake)? Yes, it will be possible.




#9 User is offline   Nicolò 

  • Apprentice
  • Group: Status: Dispatcher
  • Posts: 47
  • Joined: 25-October 14
  • Simulator:OpenRails
  • Country:

Posted 24 October 2016 - 03:37 AM

No, normal operations of the train brake. The only difference is that it isn't present the equalizing Reservoir. The reduction of the brake pipe pressure is controlled electronically.

#10 User is offline   Serana 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 24 October 2016 - 04:29 AM

Yes, it will be possible to have an electronic brake controller.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users