Вы находитесь на странице: 1из 8

Stephen Collins Karl Lewis Fall 2013

U9524-9451 U7070-2747

PLCs Ladder Logic to Simulate a Traffic Intersection


A four-way traffic light can be modeled by using PLCs and relay logic as demonstrated here. The traffic light scenario we have demonstrated is to signal for traffic turning left from the north to east and south to west having a green signal for 6 seconds followed with a yellow signal for 4 seconds. Once the turning traffic has switched to a red signal the north to south and south to north traffic will receive a cycle of green and yellow for the same amount of time. This process now repeats for traffic traveling in the east to west and west to east lanes. This traffic light will have a start input and will then run continuously by looping through all cycles repetitively.
Figure 1 Layout of traffic intersection.

PLCs or Programmable Logic Controllers use graphical coding much like schematics of relay logic used in the past. This style of programming allows one to add inputs, memory bits and outputs to be used together to generate the desired output. Many of these components can be compared to Boolean algebra counter parts. Each line in a PLC diagram is a new rung which can call output functions from other rungs to generate a new output. For instance the start function of our PLC is shown to the right, the input switch triggers the memory bit to the far right. This memory bit then triggers the rung beneath it as well as triggers itself to remain Figure 2 Start Rung from PLC project demonstrating relay logic. active. Relay logic is a modern development of the actual relay schematics used in the past to control systems identically but with physical relays. This modern interpretation of relay designs allows the desired results to be quickly tested within software programming and attachable physical models. This PLC design can then be implemented in the design after meeting the requirements of the project. To implement our project into a PLC file we used the variables referenced in the table shown below. These variables will be referenced as the function of the project is explained.

Input Address

Input Description Start

Output Address O2:3 O2:4 O2:5 O2:6 O2:7 O2:8 O2:9 O2:10 O2:11

I1:0 I1:1 I1:2 I1:3 I1:4 I1:5 I1:6 I1:7 I1:8

Output Description Left turn signal N->E Left turn signal S->W Strait traffic N->S Strait traffic S->N Left turn signal E->S Left turn signal W->N Strait traffic E->W Strait traffic W->E

Memory Address B1:0 B1:1 B1:2 B1:3 B1:4 B1:5 B1:6 B1:7 B1:8

Memory Description Run Program Create Bit 2 Start Left Turn 1 Start Straight Lane 1 Start Left Turn 2 Start Straight Lane 2 Restart Program

In this program we have a repeat of functions that will run for the left turn lanes and straight lanes. The way the function works is that it starts by activating a timer. That timer is representative of the green light and will remain solid for six seconds. While this six second counter is active the LED for the lane will be on. Once this is done we move onto a second counter this is a two second counter. For this counter no LED is active. After this counter is done it activates a third timer which turns on and the LED for two seconds. Once the third timer runs the second timer is reactivated and the two timers reoccur. This creates a flashing. Each time the third LED activates its dn bit it adds one to a counter. When that counter reaches two a bit is activated which starts the next direction and this cycle activates for that direction.

This project brought its difficulties, mainly in misconceptions of the logic built into the PLC program. We discovered an output can only be utilized once without errors. We also had created code and wiring to include crosswalk functions which worked as one would expect. The difficulty and error in these crosswalks was that the memory bit remembering the request to cross would clear at the restart of each cycle. We could not find a way to keep this memory bit when the counters and timers were being reset. Due to this complication and time we reduced our code to be that of the fully functional traffic light with turning lanes. Rather than using the output LEDs on the PLC equipment we opted to build our own intersection with LEDs shown below. We discovered that the output of the PLC equipment was 20 Vdc so we got LEDs and resistors to step the voltage down. These resistors are hidden beneath the traffic intersection layout shown below. If given the time and access to the lab, we would like to work out the issues effecting our turnsignals just to have our project fully functional. The following pages contain the graphical code of our reduced project. This project has increased our strength and interest in PLC logic and other control related systems.

Вам также может понравиться