Control System Open End New

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Department of Electrical Engineering and Open Ended Lab

Technology
Subject: Linear control Systems Lab Program: BEET
Course Instructor: Engr. Adnan Rasheed Semester: 5th Section: A
Total Time: 3 Days Total Marks: 10
Student Name: Noman Akram Registration No: BEET-23R20-35

Objective:
Objective of this lab is to develop an analytical and thinking ability of a student regarding
Programmable Logic Control (PLC) in ladder logic algorithms.

Description:
Design a Traffic light controller through PLC in such a way it checks all 4 sides of road square
and let the traffic Go in such a way
1. North and South side should allocate 5 seconds for Green light with One second yellow
light before and with the last second of the Green.
2. East and West sides should allocate 6 seconds for Green light and two seconds yellow
light before and with the last two seconds of the Green.
3. If there is No traffic on the road side it should remain OFF and this time slot should be
added to the busy side.

Apparatus:
 PC or Laptop
 Software

Theory:
Cause 1:
According to statement of cause 1.

1. 1: Identify the inputs and outputs of the traffic light controller. The inputs may include sensors
to detect the presence of vehicles or pedestrians, while the outputs may include the traffic lights
themselves.

2. Write a ladder logic program for the PLC that checks the status of the sensors and controls the
traffic lights. The program should include timers to manage the duration of each traffic light
state.
3. Allocate 5 seconds for the green light on the North and South sides of the road square. This can
be done using a timer in the ladder logic program.

4. Add a one-second yellow light before the green light turns off. This can be accomplished by
setting a timer for the yellow light to turn on one second before the green light turns off.

5. Add another one-second yellow light at the end of the green light. This can also be accomplished
using a timer, with the yellow light turning on during the last second of the green light.

6. Repeat the same process for the East and West sides of the road square, allocating 5 seconds for
the green light, one second for the first yellow light, and one second for the second yellow light.

7. Coordinate the timing of the traffic lights to ensure that traffic flows smoothly and safely. This
may require additional programming in the ladder logic program to ensure that the traffic lights
on all sides of the road square are synchronized.

8. Test the traffic light controller to ensure that it is functioning as intended and making efficient
use of the available road space.

Inputs:
 Vehicle presence sensors on North, South, East, and West sides of the road square

 Timer for 5 seconds of green light and 1 second of yellow light on North and South sides

 Timer for 10 seconds of red light on North and South sides

 Timer for 5 seconds of green light and 1 second of yellow light on East and West sides

 Timer for 10 seconds of red light on East and West sides

Outputs:
 Green light signal on North and South sides

 Yellow light signal on North and South sides

 Red light signal on North and South sides

 Green light signal on East and West sides

 Yellow light signal on East and West sides

 Red light signal on East and West sides

Here's how the traffic light controller would work:


1. When a vehicle presence sensor is triggered on the North or South side of the road square, the
timer for the green light on the North and South sides will start.

2. The green light on the North and South sides will turn on for 5 seconds, with a yellow light signal
for 1 second before the green light ends.

3. The green light on the East and West sides will be red during this time.

4. After 5 seconds, the green light on the North and South sides will turn off, and the yellow light
on the North and South sides will turn on for 1 second.

5. After the yellow light on the North and South sides turns off, the red light on the North and
South sides will turn on for 10 seconds.
6. During this time, the green light on the East and West sides will turn on for 5 seconds, with a
yellow light signal for 1 second before the green light ends.

7. After 5 seconds, the green light on the East and West sides will turn off, and the yellow light on
the East and West sides will turn on for 1 second.

8. After the yellow light on the East and West sides turns off, the red light on the East and West
sides will turn on for 10 seconds.

9. The traffic light controller will then repeat this process, alternating between the North/South
and East/West sides.

This design helps you in creating your traffic light controller using a PLC.

Now design a ladder logic program below.

NETWORK 1:

----| |----[North Sensor]---( )-------[Green North]---| |----[Timer 1 (5 sec)]

+----------------[Yellow North]---( )----|

+---------------( )----[Timer 2 (1 sec)]-|

+----------------[Red North]------------|

NETWORK 2:

----| |----[South Sensor]---( )-------[Green South]---| |----[Timer 3 (5 sec)]

+----------------[Yellow South]---( )----|

+---------------( )----[Timer 4 (1 sec)]-|

+----------------[Red South]------------|

NETWORK 3:

----| |----[East Sensor]---( )-------[Green East]---| |----[Timer 5 (5 sec)]

+----------------[Yellow East]---( )----|

+---------------( )----[Timer 6 (1 sec)]-|

+----------------[Red East]------------|

NETWORK 4:

----| |----[West Sensor]---( )-------[Green West]---| |----[Timer 7 (5 sec)]

+----------------[Yellow West]---( )----|

+---------------( )----[Timer 8 (1 sec)]-|

+----------------[Red West]------------|

NETWORK 5:

----| |----[Timer 1 (5 sec)]----( )----[Timer 4 (1 sec)]----( )----[Timer 6 (1 sec)]----( )----[Timer 8 (1


sec)]----( )-----|

+--| |---[North Sensor]----( )----|

+--| |---[South Sensor]----( )----|


+--| |---[East Sensor]-----( )----|

+--| |---[West Sensor]-----( )----|

The program includes four separate networks, one for each side of the road square, and a fifth
network that coordinates the timing of the traffic lights. Each network includes a sensor input,
green, yellow, and red light outputs, and timers to control the duration of each light state.

A logic table for the ladder logic program provided earlier.

Input Output Timer State


North Sensor Green North Timer 1 Active

North Sensor Yellow North Timer 2 Active

North Sensor Red North None Active

South Sensor Green South Timer 3 Active

South Sensor Yellow South Timer 4 Active

South Sensor Red South None Active

East Sensor Green East Timer 5 Active

East Sensor Yellow East Timer 6 Active

East Sensor Red East None Active

West Sensor Green West Timer 7 Active

West Sensor Yellow West Timer 8 Active

West Sensor Red West None Active

Timer 1 Yellow North Timer 2 Active

Timer 2 Red North None Active

Timer 3 Yellow South Timer 4 Active

Timer 4 Red South None Active

Timer 5 Yellow East Timer 6 Active

Timer 6 Red East None Active

Timer 7 Yellow West Timer 8 Active

Timer 8 Red West None Active

This table shows the different input conditions and the corresponding output states and timers.
It also shows the current state of each output at any given time, which is either "Active" or
"None." I hope this helps you understand the operation of the ladder logic program

Cause 2:
According to statement of cause 2.

To design a traffic light controller through PLC that checks all four sides of a road square and
allows traffic to go in a coordinated manner, we can use the following logic:

1. Initialize the system by setting all the lights to red.


2. Check if there is any vehicle waiting on the East or West side of the square.
3. If there is a vehicle waiting, turn on the green light for East and West sides and turn off
the other lights.
4. Keep the green light on for 6 seconds.
5. After 6 seconds, turn on the yellow light for East and West sides along with the green
light for North and South sides.
6. Keep the yellow and green lights on for 2 seconds.
7. After 2 seconds, turn off the yellow light and turn on the red light for East and West
sides, and keep the green light on for North and South sides.
8. Keep the green light on for North and South sides for 6 seconds.
9. After 6 seconds, turn on the yellow light for North and South sides along with the green
light for East and West sides.
10. Keep the yellow and green lights on for 2 seconds.
11. After 2 seconds, turn off the yellow light and turn on the red light for North and South
sides, and keep the green light on for East and West sides.
12. Repeat the process from step 2.

The traffic light controller is designed to regulate the flow of traffic at an intersection with four
sides of roads. The goal is to make sure that all sides of the intersection get a fair share of time
for their green light and to prevent collisions between cars. To achieve this goal, the controller
will monitor the presence of vehicles at each side of the intersection and adjust the timing of the
lights accordingly.

The inputs and outputs can be represented in the program.

Inputs:
 Vehicle waiting on East side (E)
 Vehicle waiting on West side (W)
 Vehicle waiting on North side (N)
 Vehicle waiting on South side (S)

Outputs:
 Green light for East and West (G_EW)
 Yellow light for East and West (Y_EW)
 Red light for East and West (R_EW)
 Green light for North and South (G_NS)
 Yellow light for North and South (Y_NS)
 Red light for North and South (R_NS)

the ladder logic program can be designed for the traffic light controller with the inputs and
outputs mentioned earlier:
|--------[Check E]--------|--------[Check W]--------|--------[Check N]--------|--------[Check
S]--------|
| | | | |
| | | | |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 0 | 0 | 0 | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 1 | 0 | 0 | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 2 | E | 0 | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 3 | G_EW | 0 | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 4 | G_EW | Y_EW | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 5 | R_EW | Y_EW | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 6 | R_EW | Y_EW | G_NS |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 7 | R_EW | Y_EW | G_NS |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 8 | R_EW | Y_EW | Y_NS |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 9 | 0 | 0 | R_NS |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 10 | 0 | 0 | R_NS |
|-------------------------|-------------------------|-------------------------|-------------------------|
| 11 | 0 | 0 | 0 |
|-------------------------|-------------------------|-------------------------|-------------------------|

In this ladder logic program, the inputs E, W, N, and S represent the presence of a vehicle
waiting at each side of the intersection. The outputs G_EW, Y_EW, and R_EW represent the
green, yellow, and red lights for the East-West direction, while the outputs G_NS, Y_NS, and
R_NS represent the green, yellow, and red lights for the North-South direction.
The program uses a series of steps to control the traffic lights at the intersection. Steps 1-2 check
for the presence of a vehicle on the East side of the intersection, while steps 3-4 control the
timing of the East-West green and yellow lights. Steps 5-8 control the timing of the North-South
green and yellow lights, while steps 9-11 turn off all lights and wait for the next cycle to begin.

The logic table for the traffic light controller:


East & West East & West North & South North & South
Condition Green Yellow Green Yellow
No Vehicle Red Off Red Off
East or West Green On Red Off

EW Green ends Yellow On Green On

EW Yellow ends Red On Green On


NS Green ends Green On Yellow On

NS Yellow ends Green On Red On

Here is an example of a traffic light controller through PLC that checks all four sides of a road
square and allocates 6 seconds for green light on the east and west sides with a 2-second yellow
light before and with the last two seconds of the green light:

Logic Table:

Inputs Outputs
North_Side Green_East
South_Side Green_West
East_Side Yellow_EW
West_Side Yellow_EW

PLC Ladder Program:

|---------------------| |---------------| |-----------------------| |-----------------| |-----------------|


| | | | | | | | | |
| North_Side |--|>| Green_East |--|>| Yellow_EW |--|>| Green_West |--|>|
Yellow_EW |
| | | | | TMR.EN | | | | TMR.EN |
|---------------------| | TMR.EN | | PRESET_VALUE = 6000ms | | TMR.EN | |
PRESET_VALUE = 2000ms |
| PRESET_VALUE = 6000ms | | PRESET_VALUE = 2000ms |
|
|-----------------------| |-----------------------|

In this ladder logic algorithm, the inputs are the four sides of the road square: North_Side,
South_Side, East_Side, and West_Side. The outputs are the three lights: Green_East,
Green_West, and Yellow_EW.
When North_Side or South_Side is active, the Green_East light is turned on for 6 seconds. When
East_Side or West_Side is active, the Yellow_EW light is turned on for 2 seconds before and
with the last 2 seconds of the Green_East light. When Green_East is turned off, Green_West is
turned on for 6 seconds.
The timer block is used to control the duration of the green and yellow lights. The TMR.EN
input is used to enable or disable the timer block. The PRESET_VALUE input is used to set the
duration of the timer in milliseconds. The value of PRESET_VALUE can be set using a data
entry block or by using a value stored in a memory location within the PLC.
This is just one example of a ladder logic algorithm for a traffic light controller through PLC.
There are many other ways to design a traffic light controller, and the specific implementation
will depend on the specific requirements of the application.

Cause 3:
According to statement of cause 3.
To design a traffic light controller through PLC that checks all 4 sides of a road square, follows
the steps below:
1. Create a ladder logic program for the PLC that will check the traffic on each side of the
road.
2. Use sensors to detect the presence or absence of vehicles on each road side. For example,
use magnetic sensors embedded in the road to detect the presence of vehicles.
3. Create a timer function that will add any unused time from a road side with no traffic to
the busy road side. The timer function should be triggered when there is no traffic on a
particular side.
4. Create a traffic light sequence that will direct traffic based on the traffic conditions
detected by the sensors. For example, if there is no traffic on a particular road side, the
traffic light for that side should remain off, and the time slot should be added to the busy
road side.
5. Use output relays to control the traffic lights based on the sequence created in step 4.
6. Test the traffic light controller to ensure it functions as intended and adjust the timing and
sensor sensitivity as needed.
Overall, the traffic light controller should be designed in such a way that it can adapt to changing
traffic conditions and prioritize busy road sides while minimizing wait times for drivers.

Certainly! The goal of the traffic light controller design described in my previous response is to
efficiently manage traffic flow in a road square with four sides.
To achieve this goal, the controller needs to be able to detect the presence or absence of vehicles
on each road side using sensors. These sensors could be magnetic sensors embedded in the road
or other types of sensors that can detect the presence of vehicles.
Once the sensors have detected the traffic conditions on each road side, the traffic light controller
needs to use this information to create a traffic light sequence that directs traffic in the most
efficient way possible. For example, if one road side is busier than the others, the controller
should prioritize that side by giving it more time with a green light.
To further optimize traffic flow, the controller should also include a timer function that can add
any unused time from a road side with no traffic to the busy road side. This means that if there
are no vehicles on a particular road side, the traffic light for that side will remain off and the time
slot allocated to that side will be added to the busy road side. This way, drivers on the busy road
side will experience shorter wait times and traffic will flow more smoothly.
Overall, the traffic light controller should be designed to balance the needs of all road sides and
adapt to changing traffic conditions in real-time. This will help to reduce congestion, improve
safety, and make the intersection more efficient for all road users.

can provide an example of ladder logic algorithms for the traffic light controller design I
described earlier. Please note that this is just one possible implementation, and the exact details
of the algorithms may vary depending on the specific requirements of the system.
In this example, we assume that there are four road sides labeled North, South, East, and West,
and that there are magnetic sensors embedded in each road to detect the presence of vehicles.
Here is the ladder logic algorithm for the traffic light controller.

NETWORK 1: Vehicle Detection


----------------------------------------------
| Coil | Symbol | Description |
----------------------------------------------
| O:0 | NorthSensor | North Sensor |
| O:1 | SouthSensor | South Sensor |
| O:2 | EastSensor | East Sensor |
| O:3 | WestSensor | West Sensor |

NETWORK 2: Traffic Light Sequence


----------------------------------------------
| Coil | Symbol | Description |
----------------------------------------------
| O:4 | NorthGreen | North Green |
| O:5 | NorthYellow | North Yellow |
| O:6 | NorthRed | North Red |
| O:7 | SouthGreen | South Green |
| O:8 | SouthYellow | South Yellow |
| O:9 | SouthRed | South Red |
| O:10 | EastGreen | East Green |
| O:11 | EastYellow | East Yellow |
| O:12 | EastRed | East Red |
| O:13 | WestGreen | West Green |
| O:14 | WestYellow | West Yellow |
| O:15 | WestRed | West Red |

NETWORK 3: Traffic Light Control


-------------------------------------------------------------
| Coil | Symbol | Description |
-------------------------------------------------------------
| O:16 | BusySideNorth | North side has more traffic |
| O:17 | BusySideSouth | South side has more traffic |
| O:18 | BusySideEast | East side has more traffic |
| O:19 | BusySideWest | West side has more traffic |

NETWORK 4: Timer Function


---------------------------------------
| Coil | Symbol | Description |
---------------------------------------
| O:20 | TimerEnabled | Timer |
| O:21 | TimeAdder | Time Adder |

NETWORK 5: Program Logic


----------------------------------------------------------
| Coil | Symbol | Description |
----------------------------------------------------------
| O:22 | NorthGreenLight | North Green Light |
| O:23 | SouthGreenLight | South Green Light |
| O:24 | EastGreenLight | East Green Light |
| O:25 | WestGreenLight | West Green Light |
| O:26 | SequenceComplete | Traffic light sequence done|
| O:27 | Error | Error |

This is just a basic outline of the ladder logic algorithms. To fully implement this design, you
would need to write the actual program code using the ladder logic symbols and functions shown
above.

Conclusions:
The conclusion of this open-ended lab for university students would be that they have
successfully designed a traffic light controller through PLC that efficiently manages traffic
flow at an intersection by allocating specific time slots for each direction of traffic. The
students have demonstrated their ability to understand the traffic flow requirements and
design a system that addresses them.
This lab provides a hands-on experience for students to learn about PLC programming,
electrical circuits, and how to interface them to control the traffic light system.
Additionally, students will have gained knowledge about how to handle situations where
there is no traffic on one or more sides of the road, and how to allocate that time to the
busy sides.
Overall, this lab provides an excellent opportunity for students to apply their theoretical
knowledge to practical scenarios and develop critical thinking skills by identifying
potential issues and troubleshooting the system. The students would have also learned how
to work collaboratively to design and implement a solution to a complex problem.

Evaluation:
Knowledge Safety Communication Procedure/Method Analysis and Discussion Conclusion
on Open Precautions interpretation of results
Ended Lab of Data
(1) (1) (1) (2) (2) (2) (1)

Instructor: Engr. Adnan Rasheed Signature: ________________

You might also like