You're reading ...
Traincontroller

Traincontroller 41 – Loading Wagons Based on a Timer

Some model railways (like to) simulate the loading or unloading of bulk goods. The task at hand is to stop the train with the first wagon accurately positioned under the silo, wait a few seconds, then advance the train exactly one wagon length … and so on until all wagons have had their turn.

Often a hardware sensor is used to detect the gap between wagons. Its signal is used to stop the train when it is advancing. If the following criteria are met, there’s no need for a sensor, we can simply advance the train with a given speed for a given time.
1: the engine runs smooth and stable at low speed.
2: the number of wagons in a train does not change during a session.

This video shows this time based solution. With the tests I performed this proved more than accurate enough. The next video will show the solution with an additional wagon sensor.

A Macro is used to advance the train one wagon length. The code inside the Macro is the following:

1. Switch the ‘loading’ signal on. It’s here just for the visuals.
2. Label ‘next wagon’. This is the point where the below Goto in line 9 jumps to.
3. Decrease the wagon counter.
4. Engine speed 6.
5. Delay 00:00:02:700. Seconds and ms that the engine drives.
6. Engine stop.
7. Delay 00:00:05:000. Goods loading / unloading time.
8. Prerequisite wagon counter > 0. If counter = 0 the next statement is skipped.
9. Goto label ‘next wagon’. Jump back to the top and repeat the sequence.
10. Switch the ‘loading’ signal off. End of the loading sequence.
11. Start Schedule ‘Exit Loading Area’.

Have fun.

 

..

About RudyB

Hobbyist

Discussion

7 thoughts on “Traincontroller 41 – Loading Wagons Based on a Timer

  1. Rudy I’m trying to setup a wagon counter and have a few questions. How do you have the properties set up in the wagon counter and the prerequisite wagon counter? Is the wagon counter always zero until started? If the train is in the same block as the load out can you still get the schedule to load or unload? I have 14 car coal trains that I want to load and unload. Thank you

    Like

    Posted by William Dunning Sr | December 2, 2016, 12:22
  2. Hi Rudy, i’m still “new in the business” so i wonder how you got the Wagons in to the operations? can you give me a hint?

    Like

    Posted by Brian Ottens | September 1, 2016, 08:42
  3. Hi, Rudy. Thanks for continuing the fantastic job with the TC videos. Everything seems much easier when You show it to us, in Your way. I still have some problems with signals the right way. I want the signal go green, then wait some seconds till the train takes off, and as soon as the trains enters the next block, signal must change to red. I think that is what happends in real life?
    By the way, can You tell me which is the fastest and best of the 3 different wayes of feedback systems:
    S88N, loconet or the Mycon s88 Master Ethernet connection. Thanks, best regards Niels Ove.

    Like

    Posted by Niels Ove Hauge | May 22, 2016, 20:22
    • Yes Niels, that’s exactly how most of us want our signals to work. If you’d put the block green in the trigger of your external signal’s green and the block red or grey in the external signal trigger for red, then it would worklike that. There is a video on signals, I don’t know the number by heart.

      With the S88 I have no other experience than the Arduino’s I use at home and the Dynatrax loconet we use at the club. The very cheap Arduino solution has been proven reliable so far.

      Like

      Posted by RudyB | May 22, 2016, 21:17

Leave a comment

Archive of all posts