Adults Playing With Trains

Bigjimmy

Member
Join Date
Jul 2013
Location
House
Posts
9
Greetings! Second post here...

I've been programming AB plc equipment for some time now so I am pretty comfortable with the function set although I've been scratching my head over how to go about writing a piece of code for the application that I am currently charged with.

Instead of trying to explain all of the particulars about the application, I'll attempt to explain this in general terms. I have an object (a train actually) that will move from left to right. There are 5 boxes, numbered 1 through 5 (also left to right) and each has the ability to determine the presence of the train (we call them “track circuits”). Under normal operation, the object will move according to the following crude diagram.

1 2 3 4 5
[X] [ ] [ ] [ ] [ ]
[X] [X] [ ] [ ] [ ]
[ ] [X] [ ] [ ] [ ]
[ ] [X] [X] [ ] [ ]
[ ] [ ] [X] [ ] [ ] and so forth.

On rare occasions, a track circuit will fail and the failure-mode is such that the system then thinks the train is still present when in fact it is not. Therein, the failure pattern is as follows:

1 2 3 4 5
[X] [ ] [ ] [ ] [ ]
[X] [X] [ ] [ ] [ ]
[ ] [X] [ ] [ ] [ ]
[ ] [X] [X] [ ] [ ]
[ ] [X] [X] [ ] [ ] Tk. Ckt. #2 failed. Train occupies #3
[ ] [X] [X] [X] [ ]
[ ] [X] [ ] [X] [ ]
[ ] [X] [ ] [X] [X]
[ ] [X] [ ] [ ] [X]
[ ] [X] [ ] [ ] [X] [X]
[ ] [X] [ ] [ ] [ ] [X]

The train length (the “consist”) is variable. As it moves from one track circuit to another, it will always show two adjacent cells occupied at the same time until the rear of the train vacates the circuit to the left (remember it is moving to the right). On the other hand, depending on the train’s length, it may occupy up to three adjacent cells simultaneously. Under normal operation (no track circuit failures), there will never be any gap between occupied circuits.

One might suggest that a table could be created with patterns that represent all of the possible logic states that indicate a failure and compared to the current pattern of track circuit states. Unfortunately, this is rapid-transit and depending on the time of day and status of the operation (delays, etc.), there could be two trains that are moving through the same area with only a single unoccupied track circuit between them.

I considered a check-in/check-out system whereby a counter is incremented each time a train enters the section and decremented as it leaves. At that point (i.e. when the counter’s accumulator = zero), if there were one or more circuits indicating “occupied,” I could declare a failure. However, when train density is high, the section that I am monitoring may never be unoccupied (.ACC=0).

Any ideas? I’m looking more for a general direction as opposed to ladder examples. In the end, the excitement comes from generating code that achieves the goal!


(BTW-When there is a failure, trains approaching it are automatically slowed down and then forced to stop short of the failed circuit, as if there was a real train present. That being said, these failures don't typically persist too long as the train operators report them to a central control center. I am simply interested in solving the problem out of accedemic interest.)

Thanks in advance,
Jimmy
 
Jimmy, railway signaling is far more complex than what you've described here. For example, you have to add in the logic for direction of movement. You also have to define what the signal aspects (the actual lights and color combinations and what they mean). For example, you can have two lite (red, green), three lite (red, yellow, green), or four lite (red yellow, green, white). Sometimes the four indication system is done with red, flashing yellow, yellow, and green.
In greatly simplified form, the signal at the entrance to each block is only concerned with the condition of one, two, or three blocks ahead--- not with the "big picture" as you describe it. That reduces the logic somewhat.
 
Dick-

Thanks for your response. Actually, I have been working as a Train Control and Signal Engineer for about 18 years now and I can certainly appreciate the complexity of signaling systems. I purposely chose not to delve far into historical and technical details of a "typical" system as 1. I feared that in doing so I'd lose focus on the problem, and , 2. There are many flavors of "typical" system designs that are engineered to atypical uniqueness based on the application and/or authority/road that operates/owns them. I originally wrote the scenario using balls that occupy boxes however I added in some references to rail in hopes of putting the problem in a particular context. In addition, I wanted to stress that, from the perspective of the train control system, a train can occupy one, two or several circuits depending on length of train and length of track circuits (the latter which is predicated on train dynamics and headway/capacity design).

1. Yes, you are correct in that there is often (although not always) directionality that can be manipulated in a traffic "block," i.e. a section of road between two interlockings or control points (which often comprises multiple track circuits). We describe these states or indications as NF and RF and those would indeed be available if the logic required it. However, I presented the problem assuming that the flow was in a single direction to avoid confusing the issue (obviously if it works in one direction, it can be adapted to a bi-directional system).

2. The signals that you describe (2-aspect, 3-aspect, etc.) suggest an ABS (automatic block) system where you typically (but again not always) have a block signal at each intermediate point/cut-section between CP's (Those signals could be controlled and not necessarily automatic as well). The system that I loosely describe for this problem is based on rapid transit systems that use ATP/continuous cab signaling. Therein there are few, and more often no, wayside signals between interlockings (signal aspects are displayed in the motor cab). In such a system, I have nothing but a quantity of track circuits between CP's or interlockings. Although the signal aspects (and their associated indications) may provide some indication of block occupancy ahead, they only change based on the knowledge of a track circuit or block showing occupied. That is, the system cannot differentiate between an actual train and a failed track circuit.

This "problem" has been one that myself and some of my coworkers have emptied many glasses of beer and other spirits discussing. Again, I was trying to present this problem as something somewhat generic. The type of signal system in use may make this easier or more difficult and in my case, I am assuming that I have nothing more than a collection of track circuits bound on each end by an interlocking or CP. As I noted, these failures are detectable and because they become a nuissance to both operators and rail controllers, they usually get taken care of relatively quickly without some sophisticated system for detecting them.

To me, this is just an interesting problem and I have been looking for a generic solution that is system-independent and whose logic is based on detecting a break in the pattern. Unfortunately, there is no easily-defined pattern which is what makes this so challenging.

Thanks for the input! Go Bronco's!
Jimmy
 
I'm not sure where you want to go with this. Now that it's clear that you work in the field and are familiar with the complexities.

What kind of response are you looking for?
 
Based on the problem as I described it originally, I was simply looking for some possible guidance/input as to how to detect the failure noted. 'Tis, all.
 
Any ideas? I’m looking more for a general direction as opposed to ladder examples.
A general direction that springs to mind immediately is to use the PLCs ability to shift bits that are coordinated with the movement of the track circuit switches. In a PLC bit-shift register, a series of "1" bits are "attached" to physical moving objects. As the objects move, the bits shift position in PLC memory at a scaled rate that matches the movement of the real physical objects. Using that method, any number of objects can be tracked in physical space.

If the length of the train can be verified somehow, then a bit shift register would show a series of moving "1" bits, with the 1 representing a section of the train, and the total number in the string representing the actual length of the train. If a "0" should suddenly appear in a string of "1"s, that would indicte a switch failure. Also, if the length of the string of "1"s should change (outside of a switchyard), that would also indicate a failure.
 
Last edited:
if you know the number of switches each train occupies then using binary code and multipling by 2 should give you the next destination number.
1 2 4 8 16 32 64
 
Lancie-

I'm very much a neophyte when it comes to shift registers but let me see if I can follow. I will attempt to use my 2nd crude diagram and add what I see as the shift register behavior along side. My object will move physically from left to right however I'll show the register moving from LSB to MSB (i.e. like a BSL I think).


1 2 3 4 5
State 1 [X] [ ] [ ] [ ] [ ] B3:0 0000 0000 0000 0001
State 2 [X] [X] [ ] [ ] [ ] B3:0 0000 0000 0000 0011
State 3 [ ] [X] [ ] [ ] [ ] B3:0 0000 0000 0000 0010

This last state is the part that confuses me. My understanding of shift register is that upon false to true transition, the bit field will be shifted and (in the case of AB), the value in the "BIT ADDRESS" will be loaded into the field (i.e. 1 or 0). However, what I've shown as the third state would be incorrect according to how I believe the register/function to work and should actually look like this:

B3:0 0000 0000 0000 0110

Of course, I am wondering if I could do the following in order to make the field match the track circuit occupancies:

1. The change above from State 2 to State 3 is represented by the track circuit behind the train becoming occupied and is shown as a change from 1 to 0.

2. If the new bit is a zero, first make the register move to the right (BSR).

3. Then perform a BSL and load in a zero.

What do you think?
Thanks!
 
Please forgive me for what is probably a very naive question. This seems to be an attempt to determine, by logic, if an indication that a train is present in a section is actually a false signal.

My question is - for what purpose? Even if the likelihood is very high that it is a false signal surely a following train would not be cleared to ignore it. Or maybe I'm missing something.

Wouldn't this (the fact that no obstacles are actually present) have to be verified by actual observation by qualified personnel before further traffic is allowed? And wouldn't such observation have to continue until the signal is returned to an operational status?
 
Please forgive me for what is probably a very naive question. This seems to be an attempt to determine, by logic, if an indication that a train is present in a section is actually a false signal.

Yup.

My question is - for what purpose? Even if the likelihood is very high that it is a false signal surely a following train would not be cleared to ignore it.

For no other reason than it interests me (and I'm an incurable nerd)! :eek:)

Wouldn't this (the fact that no obstacles are actually present) have to be verified by actual observation by qualified personnel before further traffic is allowed? And wouldn't such observation have to continue until the signal is returned to an operational status?

The circuits themselves are fail-safe. When one fails, the system assumes that this represents a real train and slows everything down in approach to it. If this is the case, a qualified operator will approach the circuit and find that there is nothing present however the system will make sure that he stops short of it as if a real train was occupying the block. There are operating rules in place to account for such failures (and with some vehicles, physical acknowledgement is required before the train can move). And yes, each and every train will be subjected to the same degraded operation until the malfunction is corrected.

In the end, we always follow the simple adage "If you don't know, don't go."
 
OK, thanks. Just wondering.

In that case, will two moving trains ever be close enough that they are tripping adjacent indications? Or is there always at least one 'empty' indication between them? If so it would be difficult to detect the 'stuck on' indicator.

If there had to be at least one 'empty' then a following train would not be allowed to enter an 'empty' area if the subsequent one is occupied. This leads to a situation that an indicator turing OFF (transition) implies that a train had just left that section. The section preceeding the transitioning one would still have to be OFF because a following traing had not been allowed to enter. Thus the situation of a transitioning OFF of a signal with ON signals on both sides would indicate a failure. Logic concerning the train's direction of movement would determine which indicator was faulty.
 
Last edited:
This last state is the part that confuses me. My understanding of shift register is that upon false to true transition, the bit field will be shifted and (in the case of AB), the value in the "BIT ADDRESS" will be loaded into the field (i.e. 1 or 0). However, what I've shown as the third state would be incorrect according to how I believe the register function to work and should actually look like this:

B3:0 0000 0000 0000 0110
Yes, if you could figure out a way to use the shift register, it should be based on bits VERTICALLY in your given track-circuit arrays. In other words, in any horizontal PLC word, each bit would represent a string of cars (vertical arrangement of your track circuits, not the horzontal arrrangement). In a bit-sift register, the bits would need to move in the same order and direction as the actual train cars move, not necessarily like your track circuit switch displays are arranged.

 
1 2 3 4 5
State 1 [X] [ ] [ ] [ ] [ ]
State 2 [X] [X] [ ] [ ] [ ]
State 3 [ ] [X] [ ] [ ] [ ]

Bit-shift data starting with State 1-1, doing down to State 3-1, then up to State 2-2, down and up to State 3-3, and so on and ending at State 3-5:

B3:0 (from left to right) = 0000 0000 0011 0011

When a train moves one circuit-switch space like this:

1 2 3 4 5
State 1 [ ] [ ] [ ] [ ] [ ]
State 2 [X] [X] [ ] [ ] [ ]
State 3 [X] [X] [ ] [ ] [ ]

Then the bit-shift register in the PLC should shift and look like this:

B3:0 (from left to right) = 0000 0000 0110 0110

 
Last edited:
if you want to be sure the complete train has left the track you have to look for the entrance car (locomotive) and the end (caboose)
so the locomotive sets a switch (on righttrackside) and the caboose resets this relays on the lefttrackside. for example.
A faulty circuit has to be repaired and as you say they are foolproof you dont have to check for a fault.
 
Then the bit-shift register in the PLC should shift and look like this:


I made a mistake in Post 12. After the train movement, the bit-shift register should look like this:

B3:0 (from left to right) = 0000 0000 0011 0110
 

Similar Topics

Good Evening , I have been asked to do some teaching at a community college for industrial automation for some young adults. I'm thinking 2...
Replies
28
Views
10,951
Hey everyone and anyone that can lend a helping hand. I have a project that I am being asked to add some animations of Solidworks or "3D" models...
Replies
9
Views
371
Using FTview ME to create an HMI screen. Simplest task is giving me trouble. How do I create an HMI tag that will allow the name of the current...
Replies
3
Views
148
Hello Folks, plc : micrologix 1500 The analog output from the loadcell is given to the plc. Using the SCP function I have scaled it into an...
Replies
3
Views
777
Hi Everyone, I am hoping a Red Lion Expert can point me in the right direction. I am experimenting with data logging on a CR3000 10" screen...
Replies
4
Views
619
Back
Top Bottom