You are on page 1of 9

UNIVERSITY OF TRIPOLI

Traffic Light SystemAbdulrahman


with a PLC Ladder
SalahProgram
Gweder
021100640
EE461L

Department of Electrical and Electronic


Engineering

Objective:
1.
2.
3.

Create a ladder program permitting sequenced control of a traffic light.


Using timing diagram, state diagram, state table, flowchart, and Boolean equations.
Use timer and comparison instructions.

Equipment Required
1.
2.
3.

Personal computer on which the RSLogix500 software is installed.


Programmable logic Controller Trainer, Model 3240-35 (see figure1).
Traffic light application, Model 3291-00 (see figure2).

Figure1.PLC Training Systems Model 3240-35.

PLC: Allen-Bradley MicroLogix1500.


24 VDC built-in power supply.
12 inputs (24 VDC only) and 12 outputs (24 VDC relay outputs).
Eight fault switches and PID Capability.
Easy expansion using rack less I/O modules (Expansion module3244-3).
Six push-buttons and six toggle switches.
Compatibility with MicroLogix and SLC instruction set
Requires the RSLogix1500 programming software (Model 3245-A).
Programming serial cable is included with the model (with a serial-to-USB converter also included).
Includes curriculum.

PLC Applications

1.

Traffic light system Model 3291-00.

Figure2.Traffic Light System Model 3291-00.

A well-known classic training system.


N-S/E-W traffic control with pedestrian crossing.
Another unit can be added to create a full, four directions traffic light.
Flow management with proximity detectors(optional).
Traffic light synchronization.

Fault insertion.
LEDs (long life).
Ten 24 VDC control inputs.

The RSLogix 500 software


The RSLogix 500 software is used to program and control Allen-Bradley PLC's with a PC-type computer. This software
allows you to create, edit, and monitor PLC ladder programs. It also allows you to document ladder programs, to store
projects(ladder program files and all other associated files) on disk, and to print complete reports on a project.(see
figure3).

Figure3.The main elements in theRSLogix 500 window.

PLC Ladder Program


Figure 4-1 shows a hardwired ladder diagram used to control the turning on and turning off of a pump motor. The
horizontal lines similar to the steps of a ladder are called rungs. The two vertical lines at the rung extremities are
called power rails. The left side rail is the line (L) power rail; it is connected to the hot side of the power supply. The
right side rail is the neutral (N) power rail; it is connected to the common side of the power supply.
In each rung of the ladder diagram, electrical continuity exists when there is an uninterrupted electrical path
between the L and N power rails. In this condition, then electrical contacts that are in the closed state on the rung
form a path that permits electrical current to flow from the L power rail to the N power rail. This causes the output
device on this rung to be energized. Examples of electrical contacts are switch contacts and relay contacts. Examples
of output devices are relay coils and pump motors.

Figure 4-1.Hardwired ladder diagram.

Figure 6-2 shows a PLC ladder program that


accomplishes the same control function as
the ladder diagram of Figure 6-1. A PLC ladder
program is a planned set of instructions
resembling a hardwired ladder diagram. It
consists of a line (L) power rail and a neutral
(N) power rail between which one or more
rungs are inserted.

Each individual rung contains one or more input instructions on its left-hand (L power rail) side, and a single output
instruction or several output instructions placed in parallel on its right-hand (N power rail) side. In Figure 4-2, for
example, the instructions Examine If Closed (XIC) and Examine If Open (XIO) are input instructions analogous to relay
contacts. On the other hand, the instruction Output Energize (OTE) is an output instruction analogous to a relay coil.
Note: "OTE" stands for output energize.
The PLC ladder program is the main component of the project you download to a PLC. The PLC uses this program to
interpret the signals present at its inputs and operate its outputs accordingly.

Figure 4-2.Equivalent PLC ladder program.

Basic traffic light system


On locations where roads intersect, ways to regulate the traffic are established so that vehicles and pedestrians can
circulate as smoothly and securely as possible. Traffic lights, roundabouts, and signs (e.g. yield or stop) are some of
the most popular methods employed. A particular method is chosen in favor of others depending on the type of
traffic, the site configuration, and the local customs.
A typical intersection controlled by traffic lights is depicted in Figure5. On this picture, two roads intersect at 90
degrees and pedestrians can get from one walkway to another. A view of the Traffic Lights module is also presented.
It is assumed that Side 1 of the Traffic Lights module corresponds to the East-West direction whereas Side 2 relates to
the South-North direction.

Figure 5.Typical Two-Road Intersection.

Comparison Instructions
Micrologix Controllers from Allen-Bradley permit the following comparison instructions:

Equal (EQU).
Not equal (NEQ).
Less than (LES).

Less than or equal (LEQ).


Greater than (GRT).
Greater than or equal (GEQ).

In order for a comparison to take place, two sources must be entered.


Source A: Must be a word address (e.g. timer accumulator T4:0.ACC).
Source B: Can be a word address or a constant (e.g. 56).
When the condition is met between the two arithmetical values, the instruction becomes true.

Timer On-Delay (TON) Instruction


Traffic lights use one or more timers to permit sequences of definite time durations. With Micrologix Controllers from
Allen Bradley, the TON instruction starts to count time base intervals when the rung in which it is contained goes
from false to true. As long as the rung remains true, the TON instruction increases its accumulated value until it
reaches the preset value. If the rung becomes false, the accumulated value is reset to zero regardless of whether or
not the preset value has been reached.
Here are the different timer status bits that you can use to control relay-type (XIO and XIC) instructions in your
program (timer T4:0 given as an example):

Done bit (T4:0/DN): Set to logic state 1 when the accumulated value becomes equal to the preset value,
and reset to logic state 0 when the rung becomes false.
Timer timing bit (T4:0/TT): Set to logic state 1 when the TON rung is true and the accumulated value is
less than the preset value.
Timer enable bit (T4:0/EN): Set to logic state value 1 when the TON rung is true.

Here are the timer status words that you can use in your program's comparison instructions (Timer T4:0 given as an
example):

Preset value word (T4:0.PRE): Final value the accumulated value must reach to stop timing and set the
done bit.
Accumulated value word (T4:0.ACC): Value accumulated since the timer was last reset to zero.

Procedure

1.

The traffic light ladder program that you are about to write must respect the following conditions:

The first rung features a TON instruction that resets after every cycle.

The traffic lights sequence is always green - yellow - red - green.

This sequence must repeat continuously.

Green lights stay on for ten seconds.

Yellow lights stay on for three seconds.

There is always a light on in each direction, including one red light.

"Walk" and "Don't Walk" lights are not used.

Each one of the six outputs (see Table1) has a dedicated rung.
The ladder program uses only the following RSLogix instructions:XIC - XIO - TON - GEQ - LES
OTE.

2.

Make these output connections:.


Address

Output

O:0/0

Red Light 1 (R1)

O:0/1

Yellow Light 1 (Y1)

O:0/2

Green Light 1 (G1)

O:0/3

Red Light 2 (R2)

O:0/4

Yellow Light 2 (Y2)

O:0/5

Green Light 2 (G2)


Table 1.Output Connections.

3.

Draw the timing diagram.

4.

Draw the state diagram.

How many transitions do you observe (excluding the first pass)?

State diagram.
26 second, 4state, 4 Transitions.
10s
13s
T3: FROM State 3 TO State 4 UPON TIMER.ACC 23s
T4: FROM State 4 TO State 1 UPON TIMER.ACC 26s
T1: FROM State 1 TO State 2 UPON TIMER.ACC
T2: FROM State 2 TO State 3 UPON TIMER.ACC

5.

Fill up the state table.


State

G2

Y2

R2

G1

Y1

R1

Table 2.State table.

6.

Draw the flowchart.

Flowchart

7.

Write the boolean equations.

8.
Start RSLogix500 and translate the equations into a ladder program.
9.
Test and comment your ladder.
10. Print your ladder and Close RSLogix 500 and turn off the PLC.

You might also like