Vous êtes sur la page 1sur 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 very similar 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, you will 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. Start SW1 Stop SW2

RLY1

RLY1

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.

Ladder Logic Ladder logic is a symbolic representation of an electrical circuit. It is also used as the symbolic 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 and right 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 term OFF means the momentary switch is not pushed. Recall the following symbols represent switches:

A) Input ON Light B) Input OFF Light C) Input ON Light D) Input OFF Light Off Off On On

In ladder logic, each rung represents the logic control circuit of one and only one output. Only one output may only be placed on any single rung. However, there may be multiple switches or contacts that are used on each rung and each input switch may occur on multiple rungs. Multiple contacts: When contacts are in series, each switch must make contact in order for power to be supplied to the output. Recall that Normally Open switches make contact when they are On. Normally Closed switches make contact when they are Off. Try the following examples: 1) Sw A: On Sw B: Off Sw A Sw B Off Light Sw A: On Sw B: On Sw A Sw B Off Light 3) Sw A: Off Sw B: Off Sw A: On Sw B: On Sw C: On Sw A Sw B On Sw A Sw B Sw C Light Off Light 5) Sw A: Off Sw B: On Sw C: On Sw A Sw B Sw C On Light Sw A: On Sw B: Off Sw C: Off Sw A Sw B Sw C On Light

2)

4)

6)

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: Sw A 1) Sw A: Off Sw B: Off On Sw B Light

2)

Sw A: Off Sw B: On Sw C: On

Sw A

Sw C Off

Sw B

Light

3)

Sw A: Off Sw B: On Sw C: On Sw D: On Sw E: Off

Sw A

Sw B

Sw E On

Sw C Sw D

Light

Sw A D) Sw A: Off Sw B: Off Sw C: On Sw D: On Sw E: Off Sw C

Sw E On

Sw B Sw D

Light

PicoSoft Overview: The following steps show the normal progression of implementing a control program using the Pico Soft application. Step 1: Design control structure: Stop Start SW2 SW1 RLY1

RLY1

Step 2: Pick Project Device

Step 3: Construct Ladder in PicoSoft

Step 4: Run Simulation and Test Ladder Logic Step 5: Download Program to PLC and and Run Actual Device

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 and place 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. A cover 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.

Keys and key combinations in the project and circuit diagram view Purpose Open new project Open existing project Save project Shut down PicoSoft/PicoSoft Pro Key (function key) / key combination CTRL+N CTRL+O CTRL+S (in every view) ALT+F4

Keys and key combinations in the Circuit Diagram and Visualization View

Purpose Undo operation Restore operation Abort operation Cut Copy Paste Delete Select All Go To Rung... Find operand Insert Rung Delete Rung

Key/key combination CTRL+Z CTRL+Y ESC (in the Circuit Diagram view) CTRL+X CTRL+C CTRL+V DEL CTRL+A CTRL+G CTRL+F CTRL+I CTRL+D

Arranging screen elements Align left Align right Align top Align bottom Arrange horizontally Arrange vertically Flip horizontally Flip vertically Rotate to right Rotate to left Shift + Cursor left Shift + Cursor right Shift + Cursor up Shift + Cursor down Shift+CTRL+Cursor left Shift+CTRL+Cursor down CTRL+H CTRL+J CTRL+R CTRL+L

Complete Set of Pico PLC Operands:


Operand ID/Function I ID Bit input Diagnostics input Controller Key/key combination

Pico and Pico GFX Pico GFX

i SHIFT+I+D

M P Q R RN S SN :

Marker bit P button Bit output Bit input - Expansion device Bit input via the NET Bit output - Expansion device Bit output via the NET Jump

Pico and Pico GFX Pico and Pico GFX Pico and Pico GFX Pico 1760-L18... and Pico GFX Pico GFX Pico 1760-L18... and Pico GFX Pico GFX Pico and Pico GFX

m p q r SHIFT+R+N s SHIFT+S+N :

Operand ID/Function
A AR BC BT BV C CF CH CI CP D Analog values Arithmetic Data block comparator Data block transfer Boolean operation Counter relay Frequency counter High-speed counter Incremental counter Comparator Text display

Controller

Key/key combination
a SHIFT+A+R SHIFT+B+C SHIFT+B+T SHIFT+B+V c SHIFT+C+F SHIFT+C+H SHIFT+C+I SHIFT+C+P d

Pico and Pico GFX Pico GFX Pico GFX Pico GFX Pico GFX Pico and Pico GFX Pico GFX Pico GFX Pico GFX Pico GFX Pico 1760-L18...

DB DC FT GT H HW HY LS MR NC OT PT PW SC

Data function block PID controller PT1 signal smoothing filter Get value from the NET 7-day time switch 7-day time switch Year time switch Value scaling Master reset Numerical converter Operating hours counter Put value on the NET Pulse width modulation

Pico GFX Pico GFX Pico GFX Pico GFX Pico Pico GFX Pico GFX Pico GFX Pico GFX Pico GFX Pico GFX Pico GFX Pico GFX

SHIFT+D+B SHIFT+D+C SHIFT+F+T SHIFT+G+T h SHIFT+H+W SHIFT+H+Y SHIFT+L+S SHIFT+M+R SHIFT+N+C SHIFT+O+T SHIFT+P+T SHIFT+P+W SHIFT+S+C

Synchronize device clocks via the Pico GFX NET Set cycle time Timing relay Value limitation Pico GFX Pico and Pico GFX Pico GFX

ST T VC

SHIFT+S+T t SHIFT+V+C

Common Operand Types: I Input: This refers to a rung input. This is mapped to one of the 8 or 12 input ports on the Pico controller. Each input can be defined as a Normally Open (Make) or Normally Closed (Break) device.

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 input switches 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 called an impulse relay. There are also variations of the marker operand which can be used to Set Marker and Clear Marker. Contactor Operand Marker as Input Impulse Relay Operand Reset Marker Operand Set Marker Operand

T Timer Relay: You may define up to 16 different timing relays. A timing relay is used to simulate a relay 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

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. Timer coil (Trigger) Timer contact Timer Reset

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 set point. 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 additional counter reset which can be selected using the appropriate properties field setting.

Counter Coil Counter Contact Counter Reset

Start/Stop Circuit: The circuit shown below is known as a start/stop circuit. In industrial applications, often times a machine will have a Start button to begin a process and a separate Stop button to shut the system off.

Implement this using your PicoSoft software:

Start SW1 RLY1

Stop SW2

RLY1

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

Notice that to set Switch 2 as a break switch you have to check the appropriate button in the settings below when the switch is selected. 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:

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 after one 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. Sw 1 Sw 2

Rly 1

Process Stage 1

Rly 1 Sw 2 Sw 3

Rly 2 Process Stage 2

Rly 2 Sw 3 Sw 1

Rly 3

Process Stage 3

Rly 3

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 :

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 0 0 1 1 B 0 1 0 1 Out

What is the Boolean Expression?

A B+A B = A B

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 deenergized, 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 delay delay

Timer contact.

Counter (or Counter Coil): This is a special kind of relay that engages a coil (thereby closing contacts) only after receiving 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 or not. To turn OFF these contacts, requires that the device reset the counter using a special counter reset function. Signal to counter
for count value of 3

Reset switch

Counter contacts

EGR 240 Mechatronics and Smart System Design Homework 09:

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 the following 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 classifies each 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 it passes 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 used to 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.

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?

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 Circuits Chapter 6: Ladder Logic

Vous aimerez peut-être aussi