traffic light - don't burn me yet!!!

There is an error on Rung 010 also. Change T4:3/EN to T4:5/DN.

In an attempt to more closely match your instructions, with your current setup, I can get all specified times by changing the 2 Delay timers to a Preset of "20", and changing T4:0 to "140". This allows the specified 12-second Red light with a 2-second overlap on each end (for a total Red cycle of 2 + 12 + 2 = 16 seconds or 160 x 0.1 seconds for each Red direction.

Here is a ZIPped file with 3 included Revision 5 files (LogixPro program, picture of the program, and a revised timing diagram with those times plotted).
 
Last edited:
"Lancie1", I recently programed the red light with a sequencer. Any ideas on a home project to further develop my understanding of this function? I cant come up with an idea and would very much like to explore this logic method. Apologies to "westikle" for being off subject from his post.
 
Any ideas on a home project to further develop my understanding of this function?
Here is a Sequencer problem to be programmed with LogixPro and by using the LogixPro I/O Simulator graphic:

1. Set up Stop and Start Pushbuttons that control a Run relay.

2. When RUN is energized, 6 fans run in sequence, each for 5 seconds (to make it easy to troubleshoot - could be 5 hours each).

3. On the first scan of the PLC, numbers representing the run sequencer are loaded into B3:2 to B3:7. Each decimal sequencer number is 2^X (2 to the X power), where X is the Fan Number from 1 to 6. Assume the first sequence to be run in order is Fan Numbers 1, 3, 5, 6, 2, and 4. Use the MOV instruction to insert the sequence into B3 memory.

4. Once the Fan sequence is loaded, and Start is pressed, the fans should run sequentially until Stop is pressed. Use the SQO Sequencer Output instruction to control outputs O:2/1 to O:2/6.

5. Make sure that when Stop is pressed, you reset the 3 items that must be handled in order to shut down the SQO (Clear O:2, reset the timer, and set the Sequencer Position to 0).

6. Of course use a symbol description for each address, and a rung comment for each rung.
 
Last edited:
I recently programed the red light with a sequencer. Any ideas on a home project to further develop my understanding of this function?
How about a washing machine. Watch yours to get an understanding of what happens and what the PLC inputs and outputs would be. Then write ladder logic to duplicate the sequence.
 
Lancie1, I've studied and and am still studying the solutions you've provided. While they are starting to make more sense, I didn't stray from my original work and finally got it to work. Turns out all I had to do was delete one redundant instruction on rung 6 for the north red light. I ran it at 100% for over 30 minutes without any crashes. I'm sure that I'm going against some fundamental laws of PLC instruction, and that is something I'm still trying to learn. However, it works. I finally got some input from my instructor, and even he had to watch it for a good while trying to figure out what exactly was going on with my logic. But he told me technically it was fine, and like i said, it works. Both delay timers are controlling the North red light, and the West red light is still dependent on one instruction. Now that i got it working, i'll experiment on other methods. Once again, thanks for all your help.

wes

traffic success.jpg

View attachment traffic success.rsl.zip
 
I'm sure that I'm going against some fundamental laws of PLC instruction, and that is something I'm still trying to learn. However, it works.
How many times have I heard "but it works!" from students. Really it appears to work. Visually it is correct, but techically it is incorrect. The LogixPro Traffic Light problem has hundreds of solutions that will run without crashes, but only a few solutions that meet all the specifications.

Look at the attached timing diagram for your Post #21 program. The previous timing diagrams were for the program AS IT SHOULD BE, but this one is LIKE YOURS (except for the 1-second red time correction noted below).

Do you see the difference between what happens from: YELLOW WEST light to RED NORTH light (2 seconds overlap of both reds), and from YELLOW NORTH light to RED WEST light (Red West is ON for 2 seconds after Yellow, but Red North is not)? Look at it until you see that the two directions are not identical - it is "one-sided" with an overlap of reds on one end but not on the other end. Also Red West is ON 2 seconds longer (16 seconds total) than Red North (14 seconds).

The above actions should be identical as to timing and sequence of events (but for different directions). They are not, although the program appears to work just fine and dandy. The reason is that in this case there is nothing in the LogixPro graphics program to detect the difference. However, in many PLC programs, if the logic is not "parallel" for two sides of the same "coin", the program will not work properly. This only matters if you later add something that DOES depend on the program being "symmetrical".

For example, if you add the Left Turn option in the advanced traffic light program, then suddenly the difference betwen the two light directions in your program will make it difficult to arrive at a way that will work for both N/S and E/W directions - due to the fact that your red lights only overlap on one end, but not on both ends. Also, technically the overlap is supposed to be 2 seconds, not 3 as you have it (I corrected that in the timing diagram).

In the real world, many traffic lights have green lights that stay on longer in one direction (thus reds lights that stay on longer in the tangential direction). But for this problem, the instructions state the SAME times for boths reds, both greens, and both yellows. You have not achieved that symmetry for your red lights.

Traffic Light w Delays-Westikle Post 21.JPG
 
Last edited:
After studying your program again, I now see that you did achieve the red overlap on the right end. I apologize for my mistake. If you change your T4 and T5 timers to a "20" preset, then you will have met all specifications given. Here is the corrected timing diagram.

Traffic Light w Delays-Westikle Post 21.JPG
 
Last edited:
ok i thought i had delay on both ends, but i totally see what you mean by not being symmetrical and how that would affect any further additions to the program. the 14 vs 16 second red light was something i had not noticed though, and am thinking that one through. i understand the overlapping in a diagram, but i have a harder time seeing it in the ladder. at least now i know how NOT to start a logic program. i've got a long way to go.


attached is a ladder file of another guy in class that went the same route as me but got it to work on his own. he was curious what this board might say about it.

View attachment Traffictesting6 1 delay4timer.rsl.zip


thanks
wes
 
Here are my comments on your friend's program:

1. Add symbols to all timer EN and DN bits that you used. Without these descriptive symbols, it is hard to see how the program works.

2. Set the timers to the speciied Presets. T4:1 should be "40", not "80, while T4:2 is supposed to be "80", not "40" as it is now. Set T4:4 and T4:5 to the specified "20" for 2-second overlaps, instead of 3 seconds as they are now. In a real-world program, setting the timers correctly is as important as getting the logic correct.

3. Delete the blank rung 006. In a real RSLogix 500 program, this blank rung would result in an error message.

4. On Rung 007, delete both of the unnecessary EN bits on both branches. They are not needed for the logic on this rung.
 
Last edited:

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,758
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,864
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,869
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,964
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,417
Back
Top Bottom