BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Train.dat and Deceleration Rates

2 posters

Go down

Train.dat and Deceleration Rates Empty Train.dat and Deceleration Rates

Post by waterburn Fri May 08, 2015 12:30 pm

I see that there is a Deceleration rate in the train.dat file.. how would we calculate the deceleration rate of the individual service brake settings? I guess it would depend on your speed too.

waterburn

Posts : 55
Join date : 2012-06-29

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by leezer3 Fri May 08, 2015 1:26 pm

I believe you'll find this is the deceleration at the maximum service brake notch.
The deceleration for other brake notches should be proportional to this, e.g.
Set a deceleration of 20km/h per second on a train with 10 brake notches:
Code:
#Deceleration
20
0.35
0
0.0025
1.1
Brake notch 1 will provide 2km/h per second of deceleration, brake notch 5 will provide 10km/h per second of deceleration and so-on.
Using the partial air brake, it should work as a percentage based upon the brake pipe pressure.

Be aware, that this is effected by the brake type defined in the #Brake section, as follows:
Brake Control System set to 0:
The deceleration rate is the train's maximum acceleration (The documentation isn't clear on this, but I presume this is at the current speed, would have to check the code) *plus* the deceleration rate stated above.
Brake Control System set to 1:
If the speed is below that set by BrakeControlSpeed, use the value calculated above, otherwise, use this figure:
Code:
0.5 * (MaximumAcceleration + Deceleration calculated above)
Brake Control System set to 2:
First, this sum is performed:
Code:
0.5 * (MaximumAcceleration + Deceleration calculated above)
If the figure produced from this sum is equal to or above that of maximum acceleration, this is used.
Otherwise, the Deceleration calculated above is added to this figure.

To use the figure calculated solely, you want a #Brake section that looks like this (Unless you plan a train that goes faster than 999km/h....):
Code:
#Brake
0
1
999

Disclaimer:
I haven't tried this or thought about it before now, but it's based upon a reasonable understanding of the workings of the sim, and seems reasonably logical to me Razz
None of the trains I've had a brief look at seem to follow this pattern, and a lot of the documentation I can find suggests just fudging the deceleration figure until you get one that's right.

The original BVE train.dat was built to simulate a standard Japanese EMU, with engine braking in addition to the train brakes, and OpenBVE never got as far as implementing a newer format, and so I'm afraid that anything other than this is somewhat of a fudge....

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1980
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by waterburn Sat May 09, 2015 7:12 am

#PERFORMANCE
8.8            ; Deceleration

#BRAKE
1              ; BrakeType
1              ; BrakeControlSystem
1              ; BrakeControlSpeed

For B3 it would be 8.8/5*3 (5 brake settings not incl. emergency)=5.28

And for a speed above 1 km/h it would 0.5*(8.8+5.28) - the deceleration seems greater than what I get in the simulator using F10. The speed I am entering the station is 72 km/h

waterburn

Posts : 55
Join date : 2012-06-29

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by leezer3 Sat May 09, 2015 12:37 pm

You're confusing acceleration with deceleration in your calculations, which is why I think your speed is off.

The MaximumAcceleration figure is the train's maximum acceleration under power (As calculated in the #Acceleration section), *not* the maximum deceleration figure.
With your current #Brake section, the sim is taking into account engine braking.

Worked Example:
Your calculation should therefore look like this for B3:
Below 1km/h
(8.8 /  5) * 3 = 5.28km/h per second
Above 1km/h
0.5 * (MaximumAcceleration + ((8.8 /  5) * 3))
I haven't got the maximum acceleration for your train.dat, so let's take an example #Acceleration section (OpenBVE format exponents, although the result should be broadly similar):
Code:
#ACCELERATION
0.9,0.8,30,30,0.99
1.2,1,40,40,0.99
1.5,1.2,50,50,0.99
1.8,1.5,60,60,0.99
2.2,1.8,70,70,0.99
2.5,2.1,80,80,0.99
For the maximum acceleration figure, we want the last notch (This is an assumption, again haven't tested this at the minute) at a reference speed of 72km/h.
Please refer to the documentation for the exact formula (The board doesn't like exponent symbols...), but this gives us a maximum acceleration figure of:
Code:
2.330876215941685
This gives us a final calculation of:
Code:
0.5 * (2.330876215941685 + 5.28)
The result is a deceleration figure of 3.805438107970843 km/h per second at 72km/h Smile
This will decrease/ increase in line with the acceleration curve for your final power notch.

Post the #Acceleration section of your train.dat if you're not sure, and I can work out the exact figure.

Same disclaimer as above applies:
Haven't personally tested this, but it's a logical working through based upon the documentation and a good understanding of how the sim works.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1980
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by waterburn Fri May 15, 2015 9:37 pm

Hey Chris thanks for your explanation. Here is the #Acceleration section

Code:
#ACCELERATION
1.6,1.4,13,18,3.3
2.2,2,20,30,3.6834
3.3,3,24,40,2.6

waterburn

Posts : 55
Join date : 2012-06-29

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by leezer3 Sat May 16, 2015 1:51 pm

Right, so I make your maximum acceleration at 72km/h figure this (I've assumed that your train.dat is in #BVE2000 or #OPENBVE format):
Code:
0.3904487095765743
Plug that into the formula above:
Code:
0.5 * (0.3904487095765743 + 5.28)
Gives me a final deceleration figure of:
Code:
2.835224354788287

Your final figure in the sim will differ slightly, as this is the pure calculation, without static friction or air resistance applied and assumes that the brakes are at 100% efficiency at 72km/h.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1980
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by waterburn Sat May 16, 2015 3:47 pm

Is there a way to account for air resistance? I am trying to place brake markers. Or is there an easier way?

waterburn

Posts : 55
Join date : 2012-06-29

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by leezer3 Thu May 21, 2015 3:13 pm

Haven't forgotten this Smile
I make this your stopping distance at 72km/h from a purely mathematical point of view:
Code:
70.54115476337127

I'd expect the wind resistance/ static friction to make this off by approx a meter or two.

Workings:
Take the basic equation of motion-
Code:
v² = u² + 2a * d
v = current velocity
u = initial velocity
a = acceleration
d = distance

Rearrange to solve this for d:
Code:
d = -u² / 2a
This gives us an equation that looks like this:
Code:
Distance = 20² / 2 * (-2.835224354788287)

That figure is mathematically correct, but having tested, OpenBVE is doing something funky with the deceleration rates- Your train.dat is giving me a deceleration figure bouncing between 0.7m/s and about 1.5m/s
I think that using a figure of about 1.1 (Fiddle around until you get something you're happy with, but driver reactions will differ so go high) in the equation above:
Code:
Distance = 20² / 2 * (-1.1)
will probably give you the results you want, but that's not really the point Smile

I'm in the process of working through exactly what's going on in the code, but frankly it's an under-documented mess in there Razz

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1980
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by leezer3 Thu May 21, 2015 10:50 pm

Sorry, I know where I went wrong....
One of the biggest issues with OpenBVE is that there are a nasty mix of units all over the place, and forgetting to convert once will throw everything off...

Revised:
Our deceleration figure above is in km/h per second.
Remembering to look closely (lol), you'll note that OpenBVE provides deceleration figures in meters per second, and this is also what the equation works in!
Thus, we need to multiply our deceleration figure by 0.277777778 before trying to use or compare it.
This gives us a this figure for deceleration in meters per second:
Code:
0.787562321404574
If you'll note above, the deceleration figures I observed under testing bounced around a little between 0.7 & 1.5 meters per second, and so this mathematical deceleration figure is broadly in accordance with what the sim is reporting once we've taken into account air resistance, wheelsip & gradient Smile

Let's try again with the calculation:
Code:
Distance = 20² / 2 * (-0.787562321404574)
Our result this time is this:
Code:
-253.948156944978
I'd round up to a nice whole number and add 25m for something that will work reasonably well in the sim Smile

This is on level track; I can go digging for how gradient effects things if you really want.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1980
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Train.dat and Deceleration Rates Empty Re: Train.dat and Deceleration Rates

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum