SOLVED route switch time and multiple trains

Märklin Central Station 2
Post Reply
woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

SOLVED route switch time and multiple trains

Post by woodyboy » 16.01.2014, 23:19

With the route switch time I try to moderate the number of switch commands to a gleisbox. But if i run >4 trains and three or four are in a waiting state, when they find simultanious a new route then the route switch time for each train is respected. But I suppose the threads for the different trains fire all within milliseconds the first switch. After waiting for the route switch time then all threads fire the second switch command. This method saturates the gleisbox at the second, third or fourth switch, with the result that a switch command is lost.
Is there a method to serialize the switchcommands to the GFP?
Last edited by woodyboy on 28.01.2014, 23:37, edited 3 times in total.

rjversluis
Site Admin
Posts: 41142
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 17.01.2014, 07:42

This could be implemented in the mcs2 library.
It would pause between all commands...

There is already a sleep of 10ms between commands send to the CAN.

Besra
Moderator
Posts: 3733
Joined: 10.08.2009, 17:54
Location: North Rhine-Westphalia, Germany

Post by Besra » 17.01.2014, 08:39

Hi,

what about synchronizing routes? Shouldn't this do the trick? :arrow: One route at a time.

Best regards
Besra

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 17.01.2014, 09:45

@Rob
When the switch command is lost by the GFP then the CAN message is not replied, ie no CAN packet transmit with the response bit set to acknowledge the command by the GFP. So it is in a few milli seconds clear that the command will not be executed.
If you want I am able to generate a trace.
The GFP answers every command, but when it is heavily loaded, then the next command is send before the previous command is acknowledged. After the latest command then both commands are Acknowledged in "fifo". If a command is not acknowledged it is dropped by the GFP or lost during transport and will not be executed. IMHO this is conform the CAN specifications.

But I will also check if I have checked the "Synchronize routes" option.
@Besra, thanks for the hint! I will evaluate it this evening and post the results.

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 17.01.2014, 23:34

This evening I have made some tests and it seems to be ok now. I had one observation that a switch was not fully set. But in the trace I found out that the coil only 200ms was powered by the GFP. However the command contained 250ms. I have increased my switch command time to 300ms and the have the route switch adapted accordingly. My impression is that synchronize routes checkbox, which was not checked, does the trick.

I have one remark, the signals are not included in the tests. Are the signals commands also subject of the route switch time?

@Besra, THANKS for your reply and recommendation!

Besra
Moderator
Posts: 3733
Joined: 10.08.2009, 17:54
Location: North Rhine-Westphalia, Germany

Post by Besra » 18.01.2014, 10:25

Bert wrote:Are the signals commands also subject of the route switch time?
Hi Bert,

the signal aspect is set after the last switch in the route's command list is set. Additionally signals feature a command time of their own, if necessary.

Best regards
Besra

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 18.01.2014, 15:42

Hi Besra,

Thanks for your reply about the signals. I expect to have tomorrow some time to test the layout inclusive the signals. I spend just some time to test and it looks very reliable how the switches are operating. No accidents or in dutch TAO's= treindienst aantastende onregelmatigheden :lol: . Even more relible than the GFP itself. I'm now at the point that I suspect the GFP of crashing/restarting. With 6 trains running, it is about 15 minutes that I lost the connection to the GFP. Power is switching off without any commands or reason f.i. shortcircuit. Tomorrow I have to connect the scope to see which signal is on the track. But as I wrote I suspect the box of restarting. With 5 trains running it takes about half an hour when the same issue occurs.

Thanks for your support!

Besra
Moderator
Posts: 3733
Joined: 10.08.2009, 17:54
Location: North Rhine-Westphalia, Germany

Post by Besra » 18.01.2014, 18:21

Hi Bert,

concerning the Gleisbox switching off after some time: Could that be a matter of overloading / overheating? It just came to my mind because you wrote it is happening earlier the more trains are running.

Best regards
Besra

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 18.01.2014, 18:38

Hi Besra,

Heating is not the problem, because I don't use the power output of the Gleisbox. I've described my configuration here http://forum.rocrail.net/viewtopic.php?t=6864 It is just the firmware of the Gleisbox which I suspect. But I believe there is a newer version of the fw. But it is strange that it happens after such a relative long time. Maybe it contains a memory leak or something. It is immediate responding again after it fails. In the moment before failing it response bad to the CAN commands, The executed command is not replied but is executed. At the next command I suspect it crashed.

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 20.01.2014, 12:31

I think I found the main problem. Ugh :oops: error in my gateway library. The CAN message was send twice :oops: :oops: Ugh Ugh

I will upload a corrected version to the DIY area.

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 20.01.2014, 17:24

rjversluis wrote:This could be implemented in the mcs2 library.
It would pause between all commands...

There is already a sleep of 10ms between commands send to the CAN.
Rob,

I observe the 10ms is not for all commands. During initialization there is no 10ms between the commands, and this is also the issue for some other commands as you can see in the attached screenshot.
It is at time 737863. The time is in ms. Exactly 1 second later it happened again. It happens frequently, but not every second.
Can I configure this option? In the controller configuration all valid options are unchecked.
Attachments
CAN log.JPG
CAN log.JPG (195.15 KiB) Viewed 122 times

rjversluis
Site Admin
Posts: 41142
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 20.01.2014, 17:33

The pause between every command was fixed at 10ms.
With the latest versions you can adjust this command pause.
Your logger sees UDP packets, but maybe they are collected by you computer to save bandwidth; Check your settings.

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Post by woodyboy » 20.01.2014, 22:19

Thanks for making the command pause flexible! I think it is a great improvement for the combination with the GFP.

Post Reply

Return to “CS2”