Traffic Light PLC Help

JOHNAL80

Member
Join Date
Mar 2009
Location
JOHNSON
Posts
2
I am trying to simplify my program to not use the GEQ and LES functions. Can I substitute timers for this?

traffic light bit logic.jpg
 

Attachments

  • PLC.doc
    276.5 KB · Views: 179
First, let me say congratulations for looking for different ways to accomplish the same task. It appears that you looked at the solution in the appendix and decided to keep some ideas from it and use some of your own. Bravo for you!

You certainly can use multiple timers, but I'm not sure that will lead to a simpler program overall. But give it a shot and see how it works out. It's only a simulation after all. The body shop isn't going to get any business if it doesn't turn out the way expect.

You should also consider whether your approach makes it easy or difficult to change the timings for the lights.
 
With 22 rungs and some logic jumping back and forth, it looks a little "wordy". Does your program include options such as turn lanes? It is hard to tell without some rung comments....

You should be able to do the basic 4-directional traffic light with about 8 rungs, 1 timer, and some LIM instructions as Devo said. Here is an example. This version uses an RTO timer so that if power is lost and restored, it resumes at exactly the same place in the cycle. That would be important in a REAL light to avoid irate drivers.
 
Last edited:
There are lot's of good ideas here, and lots of ways of making a good program, and lots of ways of making a sloppy program that still works.

One thing to note, in your program: You inserted a new branch each time you extended a rung down.... In AB, if you right click on the left line on the branch you can choose to extend the branch up or down. This will make make a series of branches that are straight down, instead of looking cascaded, as in your program. You can also insert a branch above a previous one easily, without re-writing the whole branch circuit.

-MUR
 
Another thing to consider... While I often like using one timer, and then splitting up the time, into different segments. I don't know that it is the best in this case.

Think about it this way. If you want to change the green light duration on one of the streets (something that is very possible on a traffic light) You would then have to recalculate the times for each light sequence. Not only making more work, to make a change, but also increasing the chance of making a mistake. I would also want the yellow light to be a set duration (based on the speed of the road), and something that someone had to deliberately change and that someone changing the green light duration, couldn't accidentally shorten.

-MUR
 
Wow, a lot of great feedback going on in this thread! Thank you everyone, I will be modifying this sometime this week taking into account everything said here. Thanks again!
 
Mur,

If you want to change the green light duration on one of the streets, (something that is very possible on a traffic light) you would then have to recalculate the times for each light sequence. Not only making more work, to make a change, but also increasing the chance of making a mistake.
I have studied the traffic light problem in detail, and if you change the green light, you also have to change the time for the opposing red light (in the cross-street direction). So you can't just start changing times willy-nilly and hope it works. I have found that a detailed timing diagram is needed to get the times correct.

Therefore, you might as well just use one timer, because you are going to have to recalculate all other times when you change one light.

Or you can use my handy SmartLight version (in the Downloads Allen-Bradly Section), which continually re-adjusts and recalcuates the times on the fly, based on the number of cars passing in each direction during the previous cycle. If there were more cars passing in the North-South direction than in the East-West, then on the next cycle the time for the North-South Green gets increased by 5 seconds (and East-West decreased by 5 seconds, up to a preset limit). How many times have you stopped at a red light and seen that in the perpendicular direction there is not a vehicle in sight as far as you can see? The SmartLight would never allow that to happen, immediately changing a light to green if the opposing sensor shows zero traffic. This way, the maximum number of vehicles (regardless of travel direction) gets passed through the light in the shortest time, which is after all the bottom-line goal.

Now if we could just get the SmartLight implemented in every city in the world, it would save thousands of gallons of fuel each year. If people are really interested in "going green", this is an improvement to the infrastructure that would cost very little but has the potential to prevent lots of air pollution and has the added bonus of helping to reduce road rage!

John,

The version I posted previously also has the so-called Delayed Green feature, where the red lights overlap by 1 second, so that people running the yellow lights are less likely to have collisions. The SmartLight also includes that feature.
 
Last edited:

Similar Topics

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,851
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,412
Hey guys am doin ME project based on PLC. The title is "Density based Traffic Light using PLC". Am using 3 sensors. Am having a little probs in...
Replies
4
Views
2,232
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,742
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,868
Back
Top Bottom