220hotwheels Geschrieben 16. Oktober 2021 Geschrieben 16. Oktober 2021 Hi Everyone To many of you the question that I am about to ask will probably have a very simply and maybe obvious answer but I am afraid to me it does not. The basic principle would seem to be relatively logical but putting that into practice is proving to be less straightforward. I wish to set up a traffic light system to control road vehicles. Whilst my layout has many complicated junctions generated in V6 I have concluded that if I can sort out the basics for one simple 'T' junction using V7 components then all of the rest will follow even if it means redoing all other junctions. My conclusion thus far is to assume that control comes in two parts. The first to set the traffic lights to change from red to amber/green or visa versa. This I assume would be done in the form of a timer so that the two lights on the main road would be "connected" and therefore work simultaneously with the one controlling the traffic from the side road changing in reverse to the other two but still at the same time. Part two, I assume, is to tell the respective vehicles to stop or start at the appropriate time using a suitable variable. If the basic principle is right then I am at somewhat of a loss as to just how to achieve this in EV. I've looked through and tried various options but so far got no where. Any guidance that anyone can offer would be most appreciated but please keep said advice as simple as possible, assume you are dealing with a complete novice when it comes to EV work. I have attached a screenshot of the junction involved Kind regards Pete
Dad3353 Geschrieben 16. Oktober 2021 Geschrieben 16. Oktober 2021 (bearbeitet) I had an identical issue when I couldn't get ordinary 'Stop' junctions to work reliably. Here's the Traffic Light system that I used as inspiration; it works very well indeed, and I found it clear enough to work out, as it's in English. Try it..? The ID to search for is ... Ich hatte ein identisches Problem, als ich normale 'Stop'-Kreuzungen nicht dazu bringen konnte, zuverlässig zu funktionieren. Hier ist das Ampelsystem, das ich als Inspiration verwendet habe; es funktioniert in der Tat sehr gut, und ich fand es klar genug, um es herauszufinden, da es auf Englisch ist. Versuch es..? Die gesuchte ID lautet ... AAE7AAB2-09C8-4948-A640-C8445EDB8E8A Bearbeitet 16. Oktober 2021 von Dad3353
220hotwheels Geschrieben 16. Oktober 2021 Autor Geschrieben 16. Oktober 2021 Hi Douglas That's brilliant, many thanks. I'll take a look in the next hour and get back to you if I have any questions. My attempt thus far has got the vehicles to stop on red and go on green just so long as I operate the traffic lights manually, not really ideal. I'll get back to you later. Pete
220hotwheels Geschrieben 16. Oktober 2021 Autor Geschrieben 16. Oktober 2021 HI Douglas Just taken a good look at the demo you sent me. Whilst it may well solve issues with general junctions for later I cannot figure out how to adapt it for traffic light control. Perhaps I'm missing something, you know me, at times a lead short of a pencil!!! Pete
Goetz Geschrieben 16. Oktober 2021 Geschrieben 16. Oktober 2021 (bearbeitet) Hello Pete, vor 4 Stunden schrieb 220hotwheels: to set the traffic lights to change [...] I assume would be done in the form of a timer one might lean to assume so, alas it isn't the answer. Because your traffic light sequence consits of multiple phases of different lengths. Your better option is to set up one (user-defined) event with a series of signal changes and time delays inbetween, like thus: At the end of the sequence, you trigger the user defined event that holds all actions for the other traffic light. You may want to directly link all traffic lights that have the same sequence (e.g. those immediate opposite, for oncoming traffic) with each other, so that your event manager only needs to address one of them. On the streets, place stop contacts, visit the contact properties sub section and link the contact to the corresponding traffic light. Now you can define the contact's own properties differently for each of the traffic light's conditions. Here's a short video (with German commentary) demonstrating that process (beginning at 2:30): https://youtu.be/2r_hy6-uXhQ?t=151 The final ingredient is one initial trigger to start either of the two user-defined events. From then on, they will trigger each other forever. I like to use a push button for that purpose and add a bit more in the EM, to turn that button into an on/off switch. Kind regards Goetz Bearbeitet 16. Oktober 2021 von Goetz
Dad3353 Geschrieben 16. Oktober 2021 Geschrieben 16. Oktober 2021 Here's a layout that works well, and is easy to see what happens and why... Traf_Ligh.mbp
220hotwheels Geschrieben 16. Oktober 2021 Autor Geschrieben 16. Oktober 2021 41 minutes ago, Goetz said: Hello Pete, one might lean to assume so, alas it isn't the answer. Because your traffic light sequence consits of multiple phases of different lengths. Your better option is to set up one (user-defined) event with a series of signal changes and time delays inbetween, like thus: At the end of the sequence, you trigger the user defined event that holds all actions for the other traffic light. You may want to directly link all traffic lights that have the same sequence (e.g. those immediate opposite, for oncoming traffic) with each other, so that your event manager only needs to address one of them. On the streets, place stop contacts, visit the contact properties sub section and link the contact to the corresponding traffic light. Now you can define the contact's own properties differently for each of the traffic light's conditions. Here's a short video (with German commentary) demonstrating that process (beginning at 2:30): https://youtu.be/2r_hy6-uXhQ?t=151 The final ingredient is one initial trigger to start either of the two user-defined events. From then on, they will trigger each other forever. I like to use a push button for that purpose and add a bit more in the EM, to turn that button into an on/off switch. Kind regards Goetz Hi Goetz As you rightly stated, it's not good to assume anything even if at the time it sounds logical. Your example above seems to be just the ticket, so to speak, I have only one extra small favour to ask. Would it be possible to provide a larger screen shot of your EV please. I can almost follow the one above but not too sure on one or two bits. Old eyesight does have it's drawbacks!! I'll let you know how I get on over the next day or so. Pete
Goetz Geschrieben 16. Oktober 2021 Geschrieben 16. Oktober 2021 (bearbeitet) vor 13 Minuten schrieb 220hotwheels: a larger screen shot can be optained by clicking on the picture (probably more than once) to see it at full size. And you may even zoom in ... The screenshot itself is at full resolution, identical to what you'd see in the studio. But embedded in the text, the picture is reduced in size ... Bearbeitet 16. Oktober 2021 von Goetz
220hotwheels Geschrieben 16. Oktober 2021 Autor Geschrieben 16. Oktober 2021 Yet more learning this evening. That's great, thanks. I'll give it a try now. Pete
220hotwheels Geschrieben 16. Oktober 2021 Autor Geschrieben 16. Oktober 2021 52 minutes ago, Dad3353 said: Here's a layout that works well, and is easy to see what happens and why... Traf_Ligh.mbp 6.69 kB · 2 downloads Hi Douglas I've taken a quick look at the file you sent me and it does look as though it would be easy to follow so many thanks for that. Goetz has also sent me a reply with a detailed explanation as to what I need to do. I am going to try to work through his system first and then move on to yours. Hopefully by working through both I will learn just a little more and end up with a better understanding which I'm sure will assist me with other elements of my EV. As you probable noted from my unfinished Fairmont layout my EV needs more than just a little help. By the way since V7, Fairmont has gained a holiday island, Sandown, which can be reached via a tunnel system under what I have named Fairmont Sound. I do so enjoy the construction bit, it's the EV part getting things to work properly that I keep putting off. Anyway many thanks for taking the trouble to provide me with a solution, it is greatly appreciated. Pete
220hotwheels Geschrieben 16. Oktober 2021 Autor Geschrieben 16. Oktober 2021 1 hour ago, 220hotwheels said: Yet more learning this evening. That's great, thanks. I'll give it a try now. Pete Hi Goetz I've managed to work through your suggested solution and watched the video, which despite the language element was most informative and the instructions were very easy to follow, great video. This now brings me to the final bit, the switch. What is this connected to? There are two elements that will allow a connection, the car and the traffic light opposite the side junction. I have tried both and neither provides any change in the traffic lights. Clearly I am missing something but not really sure what. Pete
Goetz Geschrieben 16. Oktober 2021 Geschrieben 16. Oktober 2021 Hi Pete, vor 27 Minuten schrieb 220hotwheels: This now brings me to the final bit, the switch. Set up an event "when switch is pressed", add a condition "switch is in on position" and inside the condition an action "trigger user-defined event". I managed to put together a small demo, albeit with bad behavior from drivers that do left turns! T-junctions.mbp still - the traffic lights do their job Greets Goetz
220hotwheels Geschrieben 17. Oktober 2021 Autor Geschrieben 17. Oktober 2021 Good morning Goetz The demo is absolutely great, many thanks for that. It makes abundantly clear what I was lacking in my attempt to copy your initial instructions and so today will hopefully see my first junction performing smoothly. As everywhere there are always bad drivers, perhaps I will have to introduce traffic police with speed cameras and impose heavy fines on such bad behaviour!!!! Impatience in all walks of life today has become the norm and that includes me when trying to learn something new with this hobby. I have duly reprimanded myself for such bad behaviour. Many thanks once again. Pete
Goetz Geschrieben 17. Oktober 2021 Geschrieben 17. Oktober 2021 vor 2 Minuten schrieb 220hotwheels: I have duly reprimanded myself for such bad behaviour. Like Dobby, the house elf?
220hotwheels Geschrieben 17. Oktober 2021 Autor Geschrieben 17. Oktober 2021 If I didn't know better I would think you had a camera installed in my study. How else could you possible come up with such an accurate analogy!!
220hotwheels Geschrieben 17. Oktober 2021 Autor Geschrieben 17. Oktober 2021 Hi Goetz Dobby's back I've followed your example, I feel sure accurately. I've even tried my magic wand but all to no avail. If the lights are on green then vehicles go, if on amber then they go but a bit slower, if on red and amber they wait and if on red they stop but clearly they only do so providing I change them manually. Nothing works automatically. The only element that I have not used is the "random destinations" as the two vehicles on this test junction are set on a fixed course. Surely this is not my problem!! Clearly I am missing the magic dust needed kick start the auto element but I haven't been able to find it yet. Might I therefore intrude on 'Dumbledore' once more for what I hope to be final guidance on the element. I have attached the relevant mbp file which I hope will enable you to point out the errors of my ways. Kind regards Pete (Dobby) traffic light test layout.mbp
Goetz Geschrieben 17. Oktober 2021 Geschrieben 17. Oktober 2021 vor 21 Minuten schrieb 220hotwheels: Clearly I am missing the magic dust Not at all, Pete. I forgot to point out one nasty trap: Too far forward (i.e. at the stop line) you've placed the contact where both routes (left and right) already separate. Only just, but they do. Meaning that the contact sits on only one of the two and the other has none. You may either add one more contact with the same specs and place it on the other branch. Or pull the contact back a little. In addition, your switch currently triggers no specified user event: and the sequence B has most of it's commands below the separation line for "condition met / condition NOT met" See if that helps, please? Greets Goetz
Dad3353 Geschrieben 17. Oktober 2021 Geschrieben 17. Oktober 2021 The problem lies here ... I'll see if I can see why this error occurs...
Dad3353 Geschrieben 17. Oktober 2021 Geschrieben 17. Oktober 2021 In the 'Switch is Toggled', you only have the 'On' Event (Traffic Light A...). Copy this to the 'Off' side of the condition, and change this copy to Traffic Light B and try again...
220hotwheels Geschrieben 17. Oktober 2021 Autor Geschrieben 17. Oktober 2021 14 minutes ago, Goetz said: Not at all, Pete. I forgot to point out one nasty trap: Too far forward (i.e. at the stop line) you've placed the contact where both routes (left and right) already separate. Only just, but they do. Meaning that the contact sits on only one of the two and the other has none. You may either add one more contact with the same specs and place it on the other branch. Or pull the contact back a little. In addition, your switch currently triggers no specified user event: and the sequence B has most of it's commands below the separation line for "condition met / condition NOT met" See if that helps, please? Greets Goetz Well now I don't feel quite such a fool, still rather clumsy but not so bad. I'll apply each of your solutions and see if it all works OK. To be absolutely honest I could have looked at the EV for sequence B and never in a month of Sundays spotted my error. Just goes to show how careful one needs to be. Fingers crossed that it will all work fine now. Once again many thanks. If I have got to grips with this one junction then many more await. Kind regards Pete 14 minutes ago, Goetz said: Not at all, Pete. I forgot to point out one nasty trap: Too far forward (i.e. at the stop line) you've placed the contact where both routes (left and right) already separate. Only just, but they do. Meaning that the contact sits on only one of the two and the other has none. You may either add one more contact with the same specs and place it on the other branch. Or pull the contact back a little. In addition, your switch currently triggers no specified user event: and the sequence B has most of it's commands below the separation line for "condition met / condition NOT met" See if that helps, please? Greets Goetz
Goetz Geschrieben 17. Oktober 2021 Geschrieben 17. Oktober 2021 vor 10 Minuten schrieb Dad3353: Copy this to the 'Off' side of the condition Nooo! Please Dad, take a look at my example layout to understand why you should NOT do this
220hotwheels Geschrieben 17. Oktober 2021 Autor Geschrieben 17. Oktober 2021 11 minutes ago, Dad3353 said: In the 'Switch is Toggled', you only have the 'On' Event (Traffic Light A...). Copy this to the 'Off' side of the condition, and change this copy to Traffic Light B and try again... Hi Douglas Many thanks for your input. Between Goetz and you I might just get the hang of traffic lights. Dare I hope for a final eureka moment just round the corner.
Dad3353 Geschrieben 17. Oktober 2021 Geschrieben 17. Oktober 2021 1 minute ago, Goetz said: Nooo! Please Dad, take a look at my example layout to understand why you should NOT do this ? ? ? Certainly, but it's working on my PC right now. Maybe I've missed something..?
220hotwheels Geschrieben 17. Oktober 2021 Autor Geschrieben 17. Oktober 2021 2 minutes ago, Goetz said: Nooo! Please Dad, take a look at my example layout to understand why you should NOT do this Well I'm glad I hadn't got any further yet, just dealing with replies to very kind members for their advice. Now I'll make inroads into your recommendations Goetz. Many thanks once again Pete
Empfohlene Beiträge
Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren
Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können
Benutzerkonto erstellen
Neues Benutzerkonto für unsere Community erstellen.
Neues Benutzerkonto erstellenAnmelden
Du hast bereits ein Benutzerkonto? Melde dich hier an.
Jetzt anmelden