traffic light looping

nurul565

Member
Join Date
Mar 2009
Location
Selangor
Posts
6
Im using NAIS brand of PLC's and get some trouble to loop back my traffic light to the 1st state. Can u gimme some suggestion how to do it?
 
Somebody probably could, if you were to add some names for your PLC memory locations, and some rung comments describing what each rung does. Without those things, it is just a collection of logic that is very difficult to understand.
 
its ok...
i got the answer...
just group the event into 3 main situation (for 3 junction)
:D
um, but i forget to label it again..
:p

untitled.jpg
 
No, you didn't "forget" to label it again -- you're getting in a very bad habit of NOT labeling it at all.

One thing I've learned in my 20 years of being in the business -- if you don't do your documentation either as you go or, better yet, before you even start programming, you won't do it. Document first, then program is my best advice.

Also, how do you expect it to operate? How does it start, stop, sequence? We don't know your expectations or design criteria, so we don't know how it's supposed to perform when evaluating your code.

As far as helping evaluate your code, it looks nice and it will operate exactly as programmed. But will it meet your requirements - we cannot even start to guess that answer without documentation.
 
bOk I try to eveluate it :)

First I evaluate it into 3 basic event where each junction will ignites green light



Known that the yellow lamp will ignite before the green lamp change into red so I just manipulate this situation

I set each set of event will done for ten second. And green light will ignite 8s while yellow 2s before it turns to red.

untitled.jpg
 
Last edited:
That still doesn't help.

Document what your i/o are in the program. What outputs drive each of the lights? What are your inputs?

What are events A, B, and C? (We don't know...)

THREE junctions?? What are they?

At one side of the intersection (e.g. the North-South sides), the lights will cycle green and yellow while the East-West holds through red. Then vice versa. Most lights in the US now have a brief period that both directions will be red. Without knowing what each of your timers do, what each of the R's do, etc... I cannot imagine this happening with your code. But we just don't have enough information yet to know this.

Document EVERY element being used!! Give us ALL of the information we need to evaluate it! Without it, we cannot help any more.
 
A 3-junction traffic light? If it really has 3 different sets of 2-way traffic directions, that will be fairly complicated. The timing diagram must look like a jigsaw puzzle.

I do know of a place down close to Florence, AL, where 7 streets come together, with a traffic light for each street. I would not want to set up the timing for that one, either.

The little community is known as Seven Points.
 
Last edited:
I believe that Milldrone is referring to the Stop button in your circuit. Your PLC logic indicates that the physical Stop pushbutton is N.O instead of N.C.

I think that using physical STOP pushbutton that is Normally Open is not so much bad programming practice as it is just poor electrical design practice.

If a closed stop circuit (the proper method) is interrupted by pressing the button (OR by cutting of the wire, or somebody hitting the control station with a 2-ton crane hook, or any of a 1000 other ways that Murphy's Law says will happen sooner or later), then the machinery will still get shut down. However if an open stop circuit is used, and the circuit is cut, then the machine can keep on running with no easy way to stop it except killing the main power.

I am sometimes bothered by some new young designers that have little idea about about how stuff works.

A1.jpg
 
Last edited:
I wonder though, if/when you're talking about TRAFFIC CONTROL, which would be SAFER? Having the lights STOP when there is an electrical issue, or having the lights keep WORKING if there is an electrical issue.

If the operator cant get a traffic light to stop it's not the same safety issue as if he cant get a garbage grinder (for example) to stop.

Since the traffic light works unattended the vast majority of the time, it might be WORSE to have it freeze up every time a flaky set of NC contacts vibrates open a little when a concrete truck rumbles by.

I might go with the NO stop switch, and kill the power or jump the input if I can't get it to stop. Just make sure Barney is there to direct traffic.

: )

Stationmaster
 
Last edited:
Stationmaster,

Truthfully, traffic lights are not controlled by PLCs and do not have stop pushbuttons. Not having a stop circuit is a better guarantee that a device will run anytime the power is on.

But for actual real-world devices that do have stop buttons, I think the closed-circuit logic is the best overall. What type do you use on your water pumping stations?
 
Input;
X0 – Stop button – stop the whole operation
X1 – Start button – start whole system

Process;
R0 – Hold the whole operation
R1 & R2 – Sequence and loop the three main event
R4 – Event 1
R5 – Event 2
R6 – Event 3
T1 to T3 – Main event timer
T4 to T6 – Ignite yellow L.E.D before the event is change

Output;
Y4 – Red light, junction A
Y5 – Yellow light, junction A
Y20 – Green light, junction A
Y22 – Red light, junction B
Y23 – Yellow light, junction B
Y24 – Green light, junction B
Y25 – Red light, junction C
Y26 – Yellow light, junction C
Y27 – Green light, junction C



________________________________________________________________



em, actually i'm using NC for X0 & NO for X1. and that is the symbol in my ladder diagram
 
Dude, you're making us work tooooo hard to get everything together in one place. Please put your documentation into your program line milldrone showed and repost it. Trust me -- when you get a call 3 years from now to figure out why all 3 lights are stuck on green at the same time, you will have forgotten unless it's documented. And if you have to chase around all of creation to get 3 or 4 different documents together that make up what should be a single documention package, you won't be able to put the puzzle back together...

Now, please assume I'm really stupid. That I've never seen a traffic light before.

Define: Event 1 -- What is it?
Define: Event 2 -- What is it?
Define: Event 3 -- What is it?

I'm having trouble visualizing your three-junction intersection. Is this three streets all coming together? If so, this would be a 6-light intersection (A light for each direction at each junction) right? Most stoplights are two-junction (4 light) intersections. Like Lancie1 suggested above (in post 9) a 3-junction intersection is a rather complicated mess.

What do you want junctions 1 and 2 to do while junction 3 is active?
What do you want junctions 2 and 3 to do while junction 1 is active?
What do you want junctions 1 and 3 to do while junction 2 is active?

Make a state logic diagram or a flow chart showing your whole process. What are the triggers to change states or phases?

Remember to include the interactions between all three junctions -- the lanes do NOT run independently of each other. At least two lanes MUST be red at any given time. No more than one lane can be either green or yellow.
 

Similar Topics

I am a complete newbie to this stuff and wanted to try this out and was looking for any information on how I can complete this by Wednesday...
Replies
19
Views
12,737
Hey Folks I've done some browsing along the forum for some help in a matter. It would seem the question has been asked many times but it just...
Replies
41
Views
16,850
I'm looking for a simple, cost-effective way to control traffic lights from a central location. The lights are actually mounted on signs next to...
Replies
2
Views
1,867
Hey guys, I'm fairly new to PLC and RSLogix5000, as I am currently a student. I am doing a traffic light project, which is only running off of...
Replies
8
Views
1,958
Hi all, I am having a problem programming a single traffic light, one red, one green, and one yellow light. I am not a student needing home work...
Replies
12
Views
3,411
Back
Top Bottom