Author
vishnu-raj
View
218
Download
0
Embed Size (px)
7/27/2019 EGR240_Le09 Ladder Logic
1/20
EGR 240 Mechatronics and Smart System Design
Lesson 09: Introduction to Ladder Logic
Reading Assignment:
Read from your e-text:Lessons in Electric Circuits
Chapter 6: Ladder Logic
Ladder logic represents a graphical way of representing logical flow and control. In
many companies, the electrical documentation is presented using circuits that are verysimilar to the ladder logic form. We will find that ladder logic is also used as a graphical
computer language for simulating and testing control programs for programmable logic
controllers (PLCs).
Today you are going to learn to develop ladder logic programs by using the ladder logic
simulation package Pico Soft produced by the Rockwell Automation company. You
dont have to know how to write program code. You just have to learn how to set up
switches, inputs, and outputs within a graphical user environment. Once formed, youwill be able to use the testing features of the software to simulate the behavior of the
control program and run your control system to see if it performs as expected.
Following todays class, you should be able to
1) Learn Ladder Logic Structure.
2) Use the Pico Soft application to create a ladder logic control system.
3) Use Pico Soft to simulate and monitor the behavior of a ladder logic diagram.
As assigned in homework yesterday, you should have already downloaded and installed
Pico Soft Version 6.22 from the website:
http://ab.rockwellautomation.com/programmable-controllers/picosoft-software
At this time, start the PicoSoft software. You will use it as we explore the use of ladder
logic.
RLY1StartSW1
RLY1
Stop
SW2
7/27/2019 EGR240_Le09 Ladder Logic
2/20
Ladder Logic
Ladder logic is a symbolic representation of an electrical circuit. It is also used as thesymbolic programming language used in industry to communicate with programmable
logic controllers (PLCs). They are called "ladder" diagrams because they look like a
ladder with horizontal and vertical rails. The left vertical leg represent power supply andright vertical leg represents the ground state. The horizontal rungs represent each
individual control circuit.
Power is always supplied on the left. Ground is always the vertical line on the right.Inputs always lie on the left side of a rung. Outputs always lie toward the right end of
the rung.
Lets see if you understand. On the following ladder logic diagram, which lights will be
lit for each control rung? The term ON means the momentary switch is pushed; the termOFF means the momentary switch is not pushed. Recall the following symbols represent
switches:
A)
B)
C)
D)
Input ON
Light
Input OFF
Light
Input OFF
Light
Input ON
Light
On
On
Off
Off
7/27/2019 EGR240_Le09 Ladder Logic
3/20
7/27/2019 EGR240_Le09 Ladder Logic
4/20
Branching:
Rungs may also include branches that contain contacts. Only one branch needs to be
complete in order to supply power to the output on the rung.
Try these examples:
1)
2)
3)
D)
Sw A: Off
Sw B: Off
Light
Sw A
Sw B
Sw A: OffSw B: On
Sw C: On
Light
Sw A
Sw B
Sw C
Sw A: Off
Sw B: On
Sw C: OnSw D: On
Sw E: OffLight
Sw A
Sw C
Sw E
Sw D
Sw B
Sw D
Sw C
Sw A: Off
Sw B: OffSw C: On
Sw D: On
Sw E: Off
Light
Sw A
Sw B
Sw E
On
Off
On
On
7/27/2019 EGR240_Le09 Ladder Logic
5/20
PicoSoft Overview:
The following steps show the normal progression of implementing a control program
using the Pico Soft application.
RLY1StartSW1
RLY1
StopSW2
Step 5: DownloadProgram to PLC and
and Run Actual
Device
Step 3: Construct
Ladder in PicoSoft
Step 1: Design control structure:
Step 2: Pick
Project
Device
Step 4: Run
Simulation and TestLadder Logic
7/27/2019 EGR240_Le09 Ladder Logic
6/20
What is PicoSoft?
PicoSoft/PicoSoft Pro is a PC program that enables you to-- create,
-- save,
-- simulate,-- document,
-- download programs to a connected, operating Pico/Pico GFX controllers.
-- display status of the controller during operation.
A functional ladder logic circuit diagram can be created simply by selecting contacts and
coils, function relays or function blocks from the Toolbox window in the Circuit
Diagram View. You simply select these circuit diagram elements from the Toolbox andplace them in the Circuit Diagram window using drag and drop with your mouse.
You can also use the mouse to draw connections between the individual circuit diagram
elements in addition to the connections that are created automatically.
Comments can also be created for contacts and coils in order to provide greater clarity. Acover sheet, the entry fields and the cross-reference lists with comments can be printed
out to create ideal documentation in which you can even insert your company logo.
The simulation tool allows you to test the completed circuit diagram without the device
having to be connected up. You can test the circuit diagram in sections or in its entirety
and use the simulated inputs, outputs, break points, forcing and display features to help
you.
The program also allows the tested circuit diagram to be transferred to the device using
the PC cable to connect the device to the PC.
Adding operands to the circuit diagram
After entering the Circuit Diagram View Mode, operands can be added to rungs by:1) Click and Drag the operand from the Operand List onto the desired rung location.
or
2) Position the curser using the mouse or arrow keys on the rung structure and use the
quick key combinations to select the operand.
After selecting the operand, you will specify its parameters on the Properties filed
directly below the Rung structure.
7/27/2019 EGR240_Le09 Ladder Logic
7/20
Keys and key combinations in the project and circuit diagram view
Purpose Key (function key) / key combination
Open new project CTRL+N
Open existing project CTRL+O
Save project CTRL+S (in every view)
Shut down PicoSoft/PicoSoft Pro ALT+F4
Keys and key combinations in the Circuit Diagram and Visualization View
Purpose Key/key combination
Undo operation CTRL+Z
Restore operation CTRL+Y
Abort operation ESC (in the Circuit Diagram view)
Cut CTRL+X
Copy CTRL+C
Paste CTRL+V
Delete DEL
Select All CTRL+A
Go To Rung... CTRL+G
Find operand CTRL+F
Insert Rung CTRL+I
Delete Rung CTRL+D
7/27/2019 EGR240_Le09 Ladder Logic
8/20
Arranging screen elements
Align left Shift + Cursor left
Align right Shift + Cursor right
Align top Shift + Cursor up
Align bottom Shift + Cursor down
Arrange horizontally Shift+CTRL+Cursor left
Arrange vertically Shift+CTRL+Cursor down
Flip horizontally CTRL+H
Flip vertically CTRL+J
Rotate to right CTRL+R
Rotate to left CTRL+L
Complete Set of Pico PLC Operands:
Operand
ID/Function
Controller Key/key combination
I Bit input Pico and Pico GFX i
ID Diagnostics input Pico GFX SHIFT+I+D
7/27/2019 EGR240_Le09 Ladder Logic
9/20
M Marker bit Pico and Pico GFX m
P P button Pico and Pico GFX p
Q Bit output Pico and Pico GFX q
R Bit input - Expansion device Pico 1760-L18... and Pico GFX r
RN Bit input via the NET Pico GFX SHIFT+R+N
S Bit output - Expansion device Pico 1760-L18... and Pico GFX s
SN Bit output via the NET Pico GFX SHIFT+S+N
: Jump Pico and Pico GFX :
Operand
ID/Function
Controller Key/key
combination
A Analog values Pico and Pico GFX a
AR Arithmetic Pico GFX SHIFT+A+R
BC Data block comparator Pico GFX SHIFT+B+C
BT Data block transfer Pico GFX SHIFT+B+T
BV Boolean operation Pico GFX SHIFT+B+V
C Counter relay Pico and Pico GFX c
CF Frequency counter Pico GFX SHIFT+C+F
CH High-speed counter Pico GFX SHIFT+C+H
CI Incremental counter Pico GFX SHIFT+C+I
CP Comparator Pico GFX SHIFT+C+P
D Text display Pico 1760-L18... d
7/27/2019 EGR240_Le09 Ladder Logic
10/20
7/27/2019 EGR240_Le09 Ladder Logic
11/20
P Button:On the front of the actual controller there are 4 push buttons. These
buttons can be used to program the PLC as a stand alone device.
These buttons can also be used within an operating program as inputswitches to the ladder logic program. They can each be defined in
the properties field as being NO or NC switches.
M Marker: A marker behaves like a typical relay (which PicoSoft calls a contactor).Supplying a proper input level to the marker allows it to close contacts elsewhere as an
input operand. A marker can also be defined in the properties fields to behave as a devise
which changes states when it reaches an impulse (a low to high transition) which is calledan impulse relay. There are also variations of the marker operand which can be used to
Set Marker and Clear Marker.
T Timer Relay:
You may define up to 16 different timing relays. A timing relay is used to simulate arelay which delays the operation of its contacts for a given length of time. Delay times
may be between 10 ms and 99 hr 59 min. To use a timer you will define a Timer coil
operand (as an output) and a Timer contact operand (as an input). The property fields can
Marker as
Input
Contactor
Operand
Impulse Relay
Operand
Reset Marker
Operand
Set MarkerOperand
7/27/2019 EGR240_Le09 Ladder Logic
12/20
be used to define the time delay (set point) and additional properties of the operand. If
you dont define the set point it will take on a value of 0.
C Counter Relay: There are 16 individual counter relays which may be defined for use
(C1 to C16). A counter relay enables you to count events. The counter relay adds or
subtracts pulses and switches when the actual value is greater than or equal to the setpoint. In other words after receiving a set number of pulses, the counter contacts will be
activated. The set point may be between 0000 and 32000. To use a counter you set up a
counter coil (as an output) and a counter contact (as an input). There is an additionalcounter reset which can be selected using the appropriate properties field setting.
Start/Stop Circuit:
The circuit shown below is known as a start/stop circuit. In industrial applications, oftentimes a machine will have a Start button to begin a process and a separate Stop button to
shut the system off.
Timer
contact
Timer coil
(Trigger)
Timer
Reset
Counter
Contact
Counter
Reset
Counter
Coil
7/27/2019 EGR240_Le09 Ladder Logic
13/20
Implement this using your PicoSoft software:
If both the Start and Stop (shown as generic switches) are momentary push-button
switches, then answer the following questions.
Draw a picture (or symbol) of the pushbutton Start switch:
Draw a picture (or symbol) of the pushbutton Stop Switch.
What happens if the system is off and the Start button is pressed?
What happens if the system is on and the Stop button is pressed?
Using the Circuit Diagram Option, build the Ladder rung circuit shown below
RLY1
Start
SW1
RLY1
Stop
SW2
7/27/2019 EGR240_Le09 Ladder Logic
14/20
Notice that to set Switch 2 as a break switch
you have to check the appropriate button in
the settings below when the switch isselected.
Using the Simulation Option, next declare the type of input under the I/R tabe. For this
example make them both Column 2 switches (push to momentarily close).
Next Run the simulation, and work the switches under the I tab.
State Transitions:
7/27/2019 EGR240_Le09 Ladder Logic
15/20
More complicated control systems may often categorize the process into a number of
functional steps that need to be completed. One functional step only becomes active afterone that precedes it has been completed. After each step turns "Off", control is passed to
the next process step which follows it.
This can be implemented in a ladder diagram using the following structure.
As the process moves from one process stage to the next, the previous stage is turned off.
Only one process stage will be on at a time as the switches are activated.
Construct and demonstrate this control structure using PicoSoft
:
Rly 1
Sw 2
Rly 2
Sw 3
Sw 1
Rly 1
Sw 2
Rly 2
Sw 3
Rly 3
Sw 1 Rly 3
Process
Stage 1
ProcessStage 2
Process
Stage 3
7/27/2019 EGR240_Le09 Ladder Logic
16/20
Boolean Logic as Ladder Logic:
Logical OR: Two switches in parallel
Logical AND: Two switches in series
Logical NOT: Use of a Normally Closed switch
Unknown Example: Complete the truth table for the ladder circuit shown below.What type of logic gate expression is indicated by the following Ladder Logic?
A B Out
0 0
0 1
1 0
1 1
What is the Boolean Expression? A B+A B = A B
7/27/2019 EGR240_Le09 Ladder Logic
17/20
Additional Switch Options in PicoSoft:
Timer (or Timer Coil or Timer Relay):
This is a special kind of relay coil and switch. When the coil of this device is energized,
the device delays a fixed length of time before the contacts are closed. Once the contacts
are closed, they will remain closed as long as the coil remains energized. If the coil is de-energized, the solenoid returns to it original position and the switch contacts immediately
open. For the contacts to again close, the coil must be energized through a full time
delay.
Signal to timer coil
Timer contact.
Counter (or Counter Coil):
This is a special kind of relay that engages a coil (thereby closing contacts) only afterreceiving a given number of state transitions (typically OFF to ON). Usually the counter
is set with a number of counts which decrements with each transition. Then the counter
registers zero, the all of the counter's normally open contacts will be closed. The
contacts will remain ON regardless of whether the input to this device stays energized ornot. To turn OFF these contacts, requires that the device reset the counter using a special
counter reset function.
EGR 240 Mechatronics and Smart System Design
Homework 09:
delay delay
Countercontacts
Reset switch
for count value of 3
Signal
to counter
7/27/2019 EGR240_Le09 Ladder Logic
18/20
Problem 1: Conveyor Belt Process
Consider the conveyor belt system shown below. Manufactured parts of varying height
and weight move along a conveyor from left to right. The three zones perform thefollowing processes: Testing, Painting, and Diverting.
In the Testing Zone: Parts are sensed and classified. A height detector measures the
height of each part and classifies each as either tall or short. A weighing device classifieseach part as light or heavy. The sensors will therefore classify each part as one of four
categories:
tall/light tall/ heavy short/light short/heavy
A switch (LS1) detects when a part passes out of the Testing Zone.
In the Painting Zone: Parts are color-coded.One of four different spray nozzles is turned on and used to paint a stripe on the part as itpasses under the spray stream. A switch (LS2) detects when a part passes out of the
Painting Zone.
In the Diverting Zone: Parts are sorted. One of four different gates is opened and usedto divert the part into an appropriate chute. A switch detects when a part has passed
down any of the chutes (LS3-LS6).
Ladder logic diagram of the switching network required to perform these operations.
7/27/2019 EGR240_Le09 Ladder Logic
19/20
Examine the system and its ladder logic diagram then answer the questions below:
1) What types of switch are appropriate to use for switches, LS1 LS6?
7/27/2019 EGR240_Le09 Ladder Logic
20/20
2) How many relays are used in this system?
3) How many of the relays latch themselves after being energized?
4) What color do short/heavy parts get coded with?
5) What is the purpose of relay, RTAL?
6) The state of relay RDZ affects how many logic circuits (as in rungs)?
7) Which relays must be active for blue paint to be sprayed?
8) How does RDZ get turned off?
Reading Assignment:
Read from your e-text:Lessons in Electric CircuitsChapter 6: Ladder Logic