Lua Automatic Train Control version 2.0

!!! Please ensure, that your contribution or question is placed into the relevant section !!!
Questions about rolling stock, for example, do not belong in "Questions about the Forum". Following is perhaps the right area where your question will be better looked after:
General questions to EEP , Splines, rolling stock, Structures in EEP, landscape elements, Signalling system and controlling, designers, Europe-wide EEP meetings , Gossip
Your cooperation to keep the forum clear is appreciated.
In the case of pictures that are attached to the article, the source must also be stated. This also applies to your own pictures, which were taken by you. Pictures without source information will be deleted!
  • Thanks. The video is available now.

    Für nicht-HolländischeTexte verwende ich ein Online-Übersetzungstool. Entschuldigung, wenn die Sätze grammatikalisch falsch sind.

    For the non-Dutch Text I use an online translation tool (DeepL) Sorry for some grammer errors.



    Grüße aus Holland.


    Warner


    Laptop: Dell G15 - AMD Ryzen 7 5800H - RTX 3060 6GB - 16Gb - Windows 11 / EEP 15.1 Patch 2 - Plugin 1 / EEP 17 Patch 3

  • Hey Frank ( frank.buchholz ) and Rudy ( RudyB ),


    I have downloaded the latest version of the module BlockControl v2.2.0 from 02.06.2022 and placed it in the LUA directory.


    My test track looks like this:


    I then used the WebTool to compile the LUA file belonging to the test track. I no longer use a contact point for reversing the direction according to the last video by Rudy . As Rudy explains in his Demo 7 video, the deadend tracks must have a certain waiting time otherwise the train will reverse immediately. Once that is all sorted out, EVERYTHING WORKS PRIMATELY.


    But....

    Because the dead-end tracks should have an exit signal, I added an HP01 signal on block 17 and 18. These are connected to the invisible signals of the concerning blocks with the settings Fahrt=Fahrt and Halt=Halt.

    Next I compiled the Lua file via WebTools. Although the added exit signals (6 and 8) have no further function, they are included in the Lua file. The reverse function is not overruled, but for some reason the exit signals are delayed set to Fahrt. No delay has been entered. I expected these exit signals to be set to Fahrt immediately.


    Do you have an explanation for this behaviour?


    I am very curious about it.

    Für nicht-HolländischeTexte verwende ich ein Online-Übersetzungstool. Entschuldigung, wenn die Sätze grammatikalisch falsch sind.

    For the non-Dutch Text I use an online translation tool (DeepL) Sorry for some grammer errors.



    Grüße aus Holland.


    Warner


    Laptop: Dell G15 - AMD Ryzen 7 5800H - RTX 3060 6GB - 16Gb - Windows 11 / EEP 15.1 Patch 2 - Plugin 1 / EEP 17 Patch 3

  • Warner ... I have no idea, I bet Frank will have a clue.


    But just as an experiment ... how do the signals react if they are not already placed when you create the Lua code with the ATC Code Generator, and you place them afterwards? Or, maybe quicker, if you delete every line of code that mentions them from the Lua file?

  • Quote

    Although the added exit signals (6 and 8) have no further function, they are included in the Lua file. The reverse function is not overruled, but for some reason the exit signals are delayed set to Fahrt. No delay has been entered. I expected these exit signals to be set to Fahrt immediately.

    Currently these signals act as normal blocks producing routes. Trains travel from block to block and have to request new routes when entering the destination block. Our blockControl program assigns one new route to one train in every cycle of EEPMain - we never let go multiple trains per cycle. Therefore it could happen that there is a small delay.


    The purpose of these exit signals is just to show a signal pattern without affecting the trains. Therefore you can take them out of blockControl and manage them in EEP:

    • You couple the exit signal with the block signal: when the block signal turns green, the exit signal turns green as well
    • A contact which triggers at the rear of the train turns the exit signal to red as soon as the train passes the signal.




    How to tell the generation program to ignore the exit signals?


    If there exist additional signals on the layout which should not get controlled by blockControl (e.g. connected signals for display purpose), you can add them into the „other signals“ field of the generation program.


    As Rudy wrote, you could remove such additional signals temporary before generation the Lua code as well, but that's not recommended.


    If such additional signals do not affect trains, you can place them on extra tracks which are not connected to the main line (or on other track types like control tracks). Such inactive tracks and their signals are ignored as well.


    If you are interested in technical details you find a short description, how the generation of the Lua code works, on the wiki at Github.

  • Hey Frank ( frank.buchholz ) and Ruud ( RudyB ),


    I followed Ruud's advice. First I compiled the Lua control file without the exit signals. Then I installed the exit signals. Again I compiled the Lua control file but I used the Routes and the 2-way blocks from the first file. In addition, I manually removed both exit signals from the local block-signals table.

    Now the exit signals work synchronously with the hidden signals on the dead-end tracks.


    I think I have tested all current functionality here. I am curious about the functionalities in the pipeline.

    Ruud has already mentioned something about reversing the driving direction on 2-way tracks. I am also curious about the control of signals with the different speeds.


    I am looking forward to the new functions.

    Für nicht-HolländischeTexte verwende ich ein Online-Übersetzungstool. Entschuldigung, wenn die Sätze grammatikalisch falsch sind.

    For the non-Dutch Text I use an online translation tool (DeepL) Sorry for some grammer errors.



    Grüße aus Holland.


    Warner


    Laptop: Dell G15 - AMD Ryzen 7 5800H - RTX 3060 6GB - 16Gb - Windows 11 / EEP 15.1 Patch 2 - Plugin 1 / EEP 17 Patch 3

  • Hi Warner, nice that you got it to work.


    You said 'Again I compiled the Lua control ...'. I can't imagine that to be a necessary step ... if you omit that step does it then not work OK?


    What Frank mentioned, that you can list the signals that you want the code generator to ignore should work fine too.


    A video on reversing on a non dead end block will be in the making this weekend.

  • What Frank mentioned, that you can list the signals that you want the code generator to ignore should work fine too.


    A video on reversing on a non dead end block will be in the making this weekend.

    I found out after submitting my message. :aa_1:


    Looking forward to the new video.

    Für nicht-HolländischeTexte verwende ich ein Online-Übersetzungstool. Entschuldigung, wenn die Sätze grammatikalisch falsch sind.

    For the non-Dutch Text I use an online translation tool (DeepL) Sorry for some grammer errors.



    Grüße aus Holland.


    Warner


    Laptop: Dell G15 - AMD Ryzen 7 5800H - RTX 3060 6GB - 16Gb - Windows 11 / EEP 15.1 Patch 2 - Plugin 1 / EEP 17 Patch 3

  • Automatic Train Control on any EEP Layout with Lua - v2.2 - 8


    Automatic Train Control version 2.2 has the feature of being able to reverse trains without using any track sensors, Lua takes care of the reversal. This makes it possible to reverse a train on any block, not only on dead ends. The block need not even be a two-way block, trains can reverse on any block.


    The Lua ATC Code Generator can not guess our intentions, it will always generate routes without reversals, and reverse trains only in dead ends. When we want a train to reverse on a non dead end block we’ll have to add the routes for this ourselves and specify reverse=true for those routes. If you leave both the forward and the reversal route in the table, the result will be that trains will drive on 50% of the time and reverse the other 50% of the times.


    The video shows how to do this.


    These are the tools to generate the Lua code for any layout. Open them in your web browser.

    Link to the EEP Layout Tool

    Link to the Lua Code Generator (Open this in a new tab)


    Link to the video.


    To download the ZIP with demo layouts and User Manual: see the first post in this thread.


  • Hey Frank ( frank.buchholz ) and Ruud ( RudyB ),


    Thanks for the last video. I have again all kinds of different possibilities to use and test your script.

    You started this series with the statement that you have found a way to automate a layout with Lua without having knowledge of Lua. That seemed like a no-go to me. In the last video, you show that manual adjustments are needed to make the reverse mechanism work.

    Isn't it possible to include these 'reverse' signals in a new variable just like the signals that should be disregarded? Then you would also please the EEP-user with no Lua knowledge. Just an idea...


    I am curious about the next adjustments.

    Für nicht-HolländischeTexte verwende ich ein Online-Übersetzungstool. Entschuldigung, wenn die Sätze grammatikalisch falsch sind.

    For the non-Dutch Text I use an online translation tool (DeepL) Sorry for some grammer errors.



    Grüße aus Holland.


    Warner


    Laptop: Dell G15 - AMD Ryzen 7 5800H - RTX 3060 6GB - 16Gb - Windows 11 / EEP 15.1 Patch 2 - Plugin 1 / EEP 17 Patch 3

  • Hello Warner

    That‘s a nice idea - I put it onto the bucket list.


    However, there is a twist, especially in small stations with two-way-blocks. Depending on the positioning of the entry sensor approaching signal of the other two-way-block the train will either stop at this block or skip it. Therefore, I do not see any 100% foolproof solution.


    Greetings. Frank

  • Hi Frank ( frank.buchholz ),


    What is your calculated minimum lenght of a two-way Block? And is there a role for the sound contact setting (beginning or end of train)?

    Für nicht-HolländischeTexte verwende ich ein Online-Übersetzungstool. Entschuldigung, wenn die Sätze grammatikalisch falsch sind.

    For the non-Dutch Text I use an online translation tool (DeepL) Sorry for some grammer errors.



    Grüße aus Holland.


    Warner


    Laptop: Dell G15 - AMD Ryzen 7 5800H - RTX 3060 6GB - 16Gb - Windows 11 / EEP 15.1 Patch 2 - Plugin 1 / EEP 17 Patch 3

  • What is your calculated minimum lenght of a two-way Block? And is there a role for the sound contact setting (beginning or end of train)?

    Hello Warner ,


    I do not see any special requirements concerning the length of two-way-blocks, just treat both blocks as usual (*).


    As soon as a block-entry-sensor triggers following happens:

    • the block turns from status "reserved" into "occupied" and the wait timer for this block starts tickeling down. As soon as the timer reaches zero, the train will request a new route/path.
    • the turnouts and (if not jet done) the block behind the train turn into status "free". Other trains may now use these turnouts and blocks. Therefore, you should ensure that no part of the train still stays any any turnout behind the train.

    Because of this you usually place block-entry-sensors in stations shortly after the last turnout before the block and use "end-of-train" for triggering the sensor. This way you ensure that the train has left completely all turnouts before entering the block. You do not need to enter any wait time for this sensor.


    If there is plenty of space than you might want to put the sensor nearer to the block signals (to make it easier to find them on the layout) and in this case it does not matter if you use "head" or "end" because the trains do not stay on any preceeding turnouts in any case. However, I still use "end" in most cases.


    (*) If you want reverse the direction of trains in two-way-blocks, then you get special requirements concerning the location of the pre-signals.


    Greetings, Frank

  • Hallo,

    Ich versuche mal das Lua Programm "Lua Automatic Train Control for Any Layout: Version 2" zu verwenden. Leider kann ich kein Englisch und die Filme die es darüber gibt sind für mich sinnlos.

    ich habe das Problem das bei mir immer wieder der Fehler Error in ´routes´/`parts:Block 195 is not a via or an ending block of any path, sowie Error in ´routes´/`parts:Block 173 is not a starting block of any path.

    Wie kann ich das Beheben.

    EEP 7 bis EEP 17

    Rechner I7 3,4GHz

    18 GB Ram

    GeForce GTX 660

    Windows 10 Pro 64 Bit


    Notb. I7 Acer E17

    GeForce 940 M

    1TB Festplatte

    8GB Ram

    Windows 11


    neu 29.11.21

    Acer Nitro5

    AN517-41-R7JY

    GeForceRTX3080

    Windows 11

  • Hallo @Johanes,


    ja, die Mehrsprachigkeit der Meldungen des Moduls ist schon länger auf meiner Arbeitsliste.

    (Die Dokumentation gibt es auf DE und EN und die Online-Tools zur Generierung des Lua-Codes zeigen ja bereits DE, EN, und FR).


    Zu den Meldungen:

    • ´routes´/`parts:Block 195 is not a via or an ending block of any path
      Block 195 ist weder ein Durchgangs- noch ein Endblock eines Pfades
    • ´routes´/`parts:Block 173 is not a starting block of any path.
      Block 173 ist kein Startblock für einen Pfad.

    Das Modul steuert die Blocksignale und weist den Zügen bei Ankunft in einem Block neue Routen (bzw. Pfade) zu. Damit ein sinnvoller Zugbetrieb von Block zu Block möglich ist werden bestimmte Prüfungen gemacht und ggf. (leider noch englische) Meldungen ausgegeben:

    • Für jeden Block muss es mind. eine Route geben über die dieser Block erreicht werden kann.
      Jeder Block muss also in mind. einer Route der Zielblock sein.
      (Das trifft für Block 195 nicht zu.)
    • Für jeden Block muss es mind. eine Route geben über die ein nächster Block erreicht werden kann
      Jeder Block muss also in mind. einer Route der Startblock sein.
      (Das trifft für Block 173 nicht zu.)

    Aufgrund der hohen Signalnummern vermute ich, dass du dich an eine recht große Anlage heranwagst und dass es eine Anlage ist, die bereits eine Signalsteuerung besitzt. Das ist nicht so einfach umzuwandeln. Vielleicht ist es gut, zuerst die einfachen Demos zu untersuchen. (Meine bislang größte Test-Anlage für das Modul verwendet 44 Block-Signale und steuert 14 Züge.)


    Du kannst gerne ein Bildschirmfoto von dem Gleisplan-Programm und den verwendeten Lua-Code entweder hier oder in einen Konversation zeigen. Dann schauen wir und das gemeinsam an.


    Schönen Gruß
    Frank

  • genau das ist es gewesen . Der Fehler ist weg. Danke für die Info.

    EEP 7 bis EEP 17

    Rechner I7 3,4GHz

    18 GB Ram

    GeForce GTX 660

    Windows 10 Pro 64 Bit


    Notb. I7 Acer E17

    GeForce 940 M

    1TB Festplatte

    8GB Ram

    Windows 11


    neu 29.11.21

    Acer Nitro5

    AN517-41-R7JY

    GeForceRTX3080

    Windows 11

  • hallo,


    die letzte hilfe war sehr gut.

    Jetzt habe ich das Problem das die Anlage sich nicht bewegt obwohl der Hauptschalter grün ist . Und die drei Signale auf Fahrt stehen, für die 3 Loks. Ein Fehler wird auch nicht angezeigt.. Was ist da los?. Die Pausetaste ist auch nicht aktiv.

    EEP 7 bis EEP 17

    Rechner I7 3,4GHz

    18 GB Ram

    GeForce GTX 660

    Windows 10 Pro 64 Bit


    Notb. I7 Acer E17

    GeForce 940 M

    1TB Festplatte

    8GB Ram

    Windows 11


    neu 29.11.21

    Acer Nitro5

    AN517-41-R7JY

    GeForceRTX3080

    Windows 11