Write ladder diagram to control an elevator for a two-floor building using a PLC.
The system has the following sensors:
A digital sensor to detect a weight of 600 kg. This sensor is connected to input I0.0 and will turn on when the weight limit is reached.
Photocells on both elevator doors to detect entering and exiting people (assume that people enter through the front door and exit through the back door). These sensors are connected to inputs I0.1 and I0.2 for the ground floor door, and I0.3 and I0.4 for the first-floor door. They will turn on when someone breaks the beam.
Push buttons inside the elevator cabin to select the destination floor. These buttons are connected to inputs I0.5 and I0.6 for the ground floor and first floor, respectively.
Push buttons outside the elevator cabin to call the elevator to the ground floor or first floor. These buttons are connected to inputs I0.7 and I1.0 for the ground floor and I1.1 and I1.2 for the first floor.
An analog sensor that measures the position of the elevator cabin. This sensor is connected to input PIW3 and will output a value between 0 and 1000, where 0 means the cabin is at the ground floor and 1000 means the cabin is at the first floor.
The system also has the following actuators:
A motor that moves the elevator cabin up or down. This motor is connected to output Q0.0 and Q0.1(Q0.0 for up, Q0.1 for down) and Q0.2 controls the speed (on for slow, off for fast).
Solenoids that open or close the doors. These solenoids are connected to outputs Q0.3 for the ground floor and Q0.4 for the first floor (on for open, off for close).
A buzzer for alerts. This buzzer is connected to output Q0.5.
The system should implement to the following features:
The doors should employ a 2 seconds on-off delay.
The system should not allow more than 600 kg of weight in the cabin at any time.
The system should not allow more than 5 people in the cabin at any time.
The system should slow down the motor when the cabin is close to the destination floor (between 0-100 and 900-1000).
Declare position variables:
M1.0 means at ground floor and M1.1 means at first floor
M1.2 means near ground floor and M1.3 means near first floor
scale position sensor readings
compare position to ground and first floor
compare position to near ground floor
compare position to near first floor
Declare calling variables
M1.4 means being called at ground floor
M1.5 means being called at first floor
Save calling state till doors open at the specified floor
Declare doors variables
M1.6 means doors are open at ground floor
M1.7 means doors are open at first floor
M2.0 means doors are closed
Doors logic
doors will open if:
Ground floor
at ground floor and being called at ground floor
selected ground floor and arrived at ground floor
First floor
at first floor and being called at first floor
selected first floor and arrived at first floor
doors will close if:
is open and 2 seconds passed since a person entered or exited and there is no alerts
open doors for each floor after arriving if called or selected and close them after delay
timer for delaying closing doors
wiring for door solenoids
Declare passenger count variables
M2.1 means someone entered
M2.2 means someone exited
MW5 stores passenger count
M0.5 means count > 5
send a pulse for entering and exiting
count and compare count
Declare selecting variables
M2.3 means selected ground floor
M2.4 means selected first floor
save selected floors till doors open at that floor
Motor logic
M2.5 means going up
M2.6 means going down
direction
motor will go up if:
doors closed and at ground floor and being called at first floor
doors closed and at ground floor and selected first floor
motor will down if:
doors closed and at first floor and being called at ground floor
doors closed and at first floor and selected ground floo
speed
motor will slow if:
going up or down and near ground or first floor
run motor up and down till arriving at called or selected floor