269 points · by mrb · 10y ago · 133 comments
It worked like this: you have a long stretch of single-track line. Trains run in both directions on the line. Obviously you want to prevent collisions. But you don't have communications from one end to the other. How?
At each end of the line, by the signal which lets trains onto the line, there's a hook. There is exactly one token, which is a physical object which hangs on the hook. A train is only allowed onto the single-track line if the token is physically in the possession of the driver. On emerging from the other end of the line the driver hangs the token back on the hook.
Simple and foolproof (if not terribly efficient).
They're putting an awful lot of faith in that counter though if they allow 255 and 257 that means that they expect to never miscount an axle.
In the old times there was a manned caboose car at the end which job was to ensure the completeness of the train (and that switches are cleared).
Here's an example of such an SBB car decommissioned some centuries ago http://www.bahnbilder.de/bilder/gueterwagen-266906.jpg
Video (1986) https://www.youtube.com/watch?v=ev4szZ4iNTY
Decades, perhaps? (A decade is ten years; a century is one hundred.)
Still, given that the warning was issued quite explicitly it would seem that the designers of the operations guide definitely thought it was possible to have a train that long. Otherwise, why bother with the warning?
(Not Swiss, just the first train car I could find with 3 axels)
Do bogies with uneven number of axles even exist?
Voilà.
1,2,3,...,254,255,0,1,2,3...
1 byte.
Although it is mentioned in the comments to the linked article that it is probably an electro-mechanical counter, so I am imagining a four wheel encoder with each wheel having 4 positions (although could be 8 wheels with 2 positions per wheel), electrically readable, and reset-able.
Along with the steep gradients, you have to remember there's far more passenger services on the lines, so pathing constraints force freight services to be shorter (you can't have them accelerating that much slower than passenger services, or they start taking up a disproportionate amount of capacity on the line).
Was that itself a response to the exactly-256 problem, "plus a margin of safety"?
It would appear the maximum length of a train in Switzerland is 1500 meters which would push it well above 256 axles.
At the same time, that was a run through the Gotthard Base Tunnel, and running onto similarly modernised infrastructure, and hence less likely to have 40 year old axle counters in use.
It's not, but considering the context going above would mean going through the limit which would be dangerous, during exit the counter would mark a railroad section as unoccupied before underflowing back to occupied. It might also have interesting failure modes during entry.
The quality of the software the world depends on is so low. We can do so much better and hopefully better will be demanded of us as the field matures.
https://en.wikipedia.org/wiki/End-of-train_device
Also very few non-railroad people understand pneumatic safety brakes, and suddenly breaking a brake hose locks the breaks on both halves of the train until the tanks drain completely down. Pneumatic brakes operate like a mechanical differentiation analog computer and the strength of the brake application is the rate or slope at which the brake hose pressure is dropping.
An axle counter is like the stupidest defect detector imaginable. Modern defect detectors are like robot Q+A inspectors, every 20 miles or so they detect hot bearings, any load hanging out or down or too high, fancy ones can do on the fly weighing (hmm that tank car full of oil is losing 50 pounds per mile, someone has a leak...) for decades there's been work done with various barcode and RFID schemes to track and log individual cars, pretty interesting stuff. I would guess there exist dumb defect detectors that can not detect overheated bearings at exact integer multiples of 1024 degrees F or something. There's a nice one near a park a few miles from my house and using a scanner tuned to railroad frequencies you could hear a synthesized voice identify itself and say something like "no defects found" I never heard it say anything else.
There is nothing wrong with defense in depth. It was paid for in blood, after all. The biggest problem with defense in depth is it leads to lazyness, well, we don't have to care about 256 axle trains because there's at least three other safety systems, etc etc. Then you end up with every one of them in a corner case and someone gets killed resulting in more regulation.
The note is just a sign of the huge safety margin that modern European railway systems implement in regular usage.
http://www.sbb.ch/content/dam/sbb/de/pdf/sbb-konzern/sbb-als...
This the one disadvantage of little endian: an aliasing bug between different integer widths is hidden if the code isn't tested with sufficiently large values. On big endian, it's likely an instant show-stopper, since small values near zero map to zero.
Note how the issue is that the value can't be a multiple of 256: i.e. have the least eight significant bits clear. That's troubling still, because although an axle count of 257 mitigates the signaling problem, the strong suspicion lingers remains that this 257 might be treated as an axle count of 1; and doesn't that have ramifications? I.e. it might be used as an 8 bit value for more than just an "do we have axles or not" test.
And yes, there are concerns about modulo behaviour, but this ultimately is an engineering trade-off: what is the probability of losing exactly 2^8 axles from a consist?
Additionally, the mobile one rel=canonicals to the desktop one.
Two good reasons to think of the desktop version as the actual version, especially when linking in the open web.
So I suppose it is nice to see that things can actually go the other way around.
- 2 axle cars must be longer than 5.76m
- 4 axle cars must be longer than 10.92m
- 6 axle cars must be longer than 16.38m
Found this 6 axle car with a length of 15.0m: https://de.wikipedia.org/wiki/Flachwagen#S-Wagen_f.C3.BCr_sc...
So yes, this seems to be a real problem, as it is possible to arrange a train with with 256 axles with this type of car that does not violate the maximum length restriction.
In Switzerland? Probably not. In other places definitely, large-countries (USA, Canada, Australia) freight and coal/ore trains are hundreds of cars long (and each car has at least 2 bogies of 2 axles), the record is 682 cars and 8 locomotives.
Axle counting guarantees that there isn't a detached, derailed wagon fouling the line, or a wagon with dirty wheels which aren't completing the track circuit.
Eight trains would need a gap between them — typically several km per train — so the capacity of the line is increased by having longer trains.
Air resistance would be higher for eight trains.
See https://en.wikipedia.org/wiki/Distributed_power for more information on running distributed power.
If they use an 8 bit counter, then the detection is basically the axle count % 256. Axle #256 crossing would reset the counter to zero, indicating a safe track, when if wasn't.
If you're trying to save characters in a tweet, you don't have any savings in using exponential over decimal for base two until 2^14.
Considering the tweeter in question, I'd go with the second one.
It's likely that the axle count is stored as a 8-bit unsigned integer.
What are you even talking about?
> It's likely that the axle count is stored as a 8-bit unsigned integer.
Which is exactly the point of writing it as 2^8…
So, technically, 512 would be fine.
"Bilevel cars may not be usable in countries or older railway systems with low loading gauges. This includes much of the rail network in the northeast of the USA and almost the entire British rail network. In some countries such as the UK new lines are built to a higher than the existing structure gauge to allow the use of double-deck trains in future."
That aside, I've often been wondering how these systems work exactly. There must be a challenging engineering problem behind organizing all of this.