lecture 5: plc programming 1. logic functions using ladder diagram 2

20
Lecture 5: PLC Programming 1

Upload: mae-barker

Post on 17-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

1

Lecture 5:

PLC Programming

Page 2: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

2

Logic functions using ladder diagram

Page 3: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

3

Logic Operations

There are also blocks in the ladder programming to implement various logic operations.

Page 4: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

4

Example: 2-Handed RUN Actuation• Consider a metal cutter that slices sheets of metal when actuated by an

operator. • By code, all such machines must have 2-handed RUN actuation. This

means that the machine can only be cycled by an operator pressing two switches simultaneously that are separated by a distance such that both switches cannot be pressed by one hand. This assures that both of the operator’s hands will be on the switches and not in the machine when it is on.

Page 5: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

5

Multiple outputs

Page 6: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

6

Example For the following ladder rung:• Output A occurs when input A occurs. • Output B only occurs when both input A and input B occur.

Page 7: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

7

Math Operations

In the ladder programming, there are blocks to implement different types of mathematical operation such as addition and subtraction.

Page 8: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

8

Latching

• There are often situations where it is necessary to hold an output energized, even when the input ceases.

• A simple example of such a situation is a motor which is started by pressing a push button switch. Though the switch contacts do not remain closed, the motor is required to continue running until a stop push button switch is pressed.

• Latching is particularly useful for making a momentary pushbutton switch perform as if it were a maintained switch.

• The latch circuit is a self-maintaining circuit in that, after being energized, it maintains that state until another input is received.

Page 9: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

9

Latching Circuit with Start Button

• The circuit shown can be used to start a motor using the Start push button.

• When Start is pressed, the motor starts.

• When Start is released, the holding contacts maintain the circuit and hence the power to the motor.

• But how to stop the motor?

Page 10: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

10

Latching Circuit with Start and Stop Buttons

• To stop the motor, we add another push button (Stop) which is normally closed.

• When Stop button is pressed, this disconnects the power to the motor and the holding contacts open. Thus when Stop is released, there is no power connected to the motor.

• In conclusion, we have a motor which is started by Start and stopped by Stop push buttons.

Page 11: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

11

To ensure safety, stop switches has to be very carefully considered.

We have to ensure that the Stop switch will do its job even when it fails.

(a) In the previous start-stop circuit, the stop switch is unsafe

(b) A safe stop switch

Safe and Unsafe Stop switches

Page 12: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

12

Safe and Unsafe Stop Switches

• In electrical circuits, the "open" failures (open switch contacts, broken wire connections, open relay coils, blown fuses, etc.) are statistically more likely to occur than any other type of failure.

• A stop switch is not safe if it is normally open and has to be closed to give the stop action. Imagine that the stop switch fails. It most likely fails open (becomes open permanently). In this case, the system cannot be stopped.

• A better arrangement is to program the stop switch in the ladder program as open and use a stop switch that is normally closed and operating opens it.

Page 13: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

13

Special types of contacts and coils

• There are special types of contacts and coils which are associated with whether the input variable or power flow is having a +ve or –ve edge changes.

• They have the following symbols.

Page 14: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

14

Positive and Negative transition-sensing Contacts

Positive transition-sensing contact: when the associated variable changes from 0 to 1, power flows for one ladder rung evaluation.

Negative transition-sensing contact: when the associated variable changes from 1 to 0, power flows for one ladder rung evaluation.

Page 15: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

15

Positive and Negative transition-sensing coils

Positive transition-sensing coil: if the power flow to it changes from off to on, the output is set on for one ladder rung evaluation.

Negative transition-sensing coil: if the power flow to it changes from on to off, the output is set on for one ladder rung evaluation.

Page 16: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

16

Example• For the ladder rung shown, with the input off there is no

output. When the input switches on, there is an output from the coil.

• However, the next and successive cycles of the program do not give outputs from the coil even though the switch remains on. The coil only gives an output for one ladder rung evaluation the first time the switch is on.

Page 17: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

17

Example: On-off liquid level control

• It is required to keep the water level between two levels: L (Low) and H (High).

• There are two sensors: one that gives 1 if the level is below L and the other gives 1 if the level is above H.

• If the level is below L, the valve is opened to fill the tank till the level reaches H when the valve closes.

• Design the ladder diagram for this control system.

Page 18: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

18

SR Flip-Flop

• You may have noted that the previous example may be solved using the SR flip-flop memory action.

• It is interesting that there is a function block which implements the SR Flip-flop function with following truth table.

Qn R S

Qn-1 0 0

0 1 0

1 0 1

0 1 1

Page 19: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

19

QuizDesign a ladder program to control a heater such that if the temperature is below 15°C, the heater is turned ON and if it is above 25°C, it turns OFF. Add a START button to turn the heater ON and a STOP button to forcibly turn it OFF. Also, there are two sensors: MIN which gives 1 if the temperature is below 15 and MAX which gives 1 if the temperature is above 25.

Page 20: Lecture 5: PLC Programming 1. Logic functions using ladder diagram 2

20

Quiz

قلت إذا بحيث مدفأة تشغيل في للتحكم برنامج صممعن الحرارة درجة 15درجة زادت إذا و التشغيل يتم

عن . 25الحرارة مفتاح هناك عنها الكهرباء فصل يتمSTART آخر و العمل . STOPلبدء إجباريا المدفأة إليقاف

حرارة حساس تكون Logic 1يعطي MINهناك عندمامن أقل الحرارة آخر 15درجة في Logic 1يعطي MAXو

من أعلى الحرارة كانت .25حال