Jump to content

A traffic light routine at a simple 'T' junction V7


Empfohlene Beiträge

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

'T' junction.jpg

Link zu diesem Kommentar
Auf anderen Seiten teilen

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

1760919075_2021-10-1617_38_47-D23Demo_ToolDiversionIIIV6v02-3DTrainStudioV7.jpg.a03f1b89daa7ca3d6cddc737ec42ee3b.jpg

Bearbeitet von Dad3353
Link zu diesem Kommentar
Auf anderen Seiten teilen

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:

1100791859_trafficlights1.thumb.jpg.d2e91cd6b751fda4ace7d286e436a9f0.jpg

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.

1122312513_trafficlights2.jpg.928afbf48fb76f2f21880ab7a61f127d.jpg 

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 von Goetz
Link zu diesem Kommentar
Auf anderen Seiten teilen

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:

1100791859_trafficlights1.thumb.jpg.d2e91cd6b751fda4ace7d286e436a9f0.jpg

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.

1122312513_trafficlights2.jpg.928afbf48fb76f2f21880ab7a61f127d.jpg 

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

Link zu diesem Kommentar
Auf anderen Seiten teilen

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 von Goetz
Link zu diesem Kommentar
Auf anderen Seiten teilen

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

Link zu diesem Kommentar
Auf anderen Seiten teilen

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(y). 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

Junction EV.jpg

Junction.jpg

Link zu diesem Kommentar
Auf anderen Seiten teilen

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

Link zu diesem Kommentar
Auf anderen Seiten teilen

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

Link zu diesem Kommentar
Auf anderen Seiten teilen

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

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 21 Minuten schrieb 220hotwheels:

Clearly I am missing the magic dust

Not at all, Pete.
I forgot to point out one nasty trap:

257847676_t-junctionbranching.thumb.jpg.0202f687d659e61ba41441db6a0423b8.jpg

 

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:

1391866037_t-junctionMflaw1.jpg.e6a92f9b62a7fdcb2b1559967a6185ef.jpg

 

and the sequence B has most of it's commands below the separation line for "condition met / condition NOT met"

1033396214_t-junctionMflaw2.jpg.27ffefd68b0fc0fad063f60c969c2806.jpg

See if that helps, please?

Greets
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

14 minutes ago, Goetz said:

Not at all, Pete.
I forgot to point out one nasty trap:

257847676_t-junctionbranching.thumb.jpg.0202f687d659e61ba41441db6a0423b8.jpg

 

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:

1391866037_t-junctionMflaw1.jpg.e6a92f9b62a7fdcb2b1559967a6185ef.jpg

 

and the sequence B has most of it's commands below the separation line for "condition met / condition NOT met"

1033396214_t-junctionMflaw2.jpg.27ffefd68b0fc0fad063f60c969c2806.jpg

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:

257847676_t-junctionbranching.thumb.jpg.0202f687d659e61ba41441db6a0423b8.jpg

 

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:

1391866037_t-junctionMflaw1.jpg.e6a92f9b62a7fdcb2b1559967a6185ef.jpg

 

and the sequence B has most of it's commands below the separation line for "condition met / condition NOT met"

1033396214_t-junctionMflaw2.jpg.27ffefd68b0fc0fad063f60c969c2806.jpg

See if that helps, please?

Greets
Goetz

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

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...

152758219_2021-10-1717_38_18-3DTrainStudioV7.thumb.jpg.96d4d5a05a159ad47f8afcc91e8c30a4.jpg

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.

Link zu diesem Kommentar
Auf anderen Seiten teilen

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

Link zu diesem Kommentar
Auf anderen Seiten teilen

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 erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...