Introduction to Mechatronics 2014 6

33
8/17/2019 Introduction to Mechatronics 2014 6 http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 1/33 PLC programming

Transcript of Introduction to Mechatronics 2014 6

Page 1: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 1/33

PLC programming

Page 2: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 2/33

What is a PLC ?

A PLC works by looking at its inputs and depending on their

state, and the user entered program, turns on/off outputs.

A PLC can be thought of as:

•Industrial Computers with specially designed architecture in both their central

units (the PLC itself) and their interfacing circuitry to field devices (input /

output connections to the real world).

• Special form of micro-processor-based controller that uses a programmable

memory to store instructions and to implement functions such as logic,

sequencing, timing, counting and arthimatic to control machine and process.

Page 3: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 3/33

Dr. Osama Esmail

What is a PLC ?

Page 4: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 4/33

Commercial And Industrial Computers

CommercialComputer

IndustrialComputer

Page 5: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 5/33

Dr. Osama Esmail

PLC Hardware

Page 6: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 6/33

Dr. Osama Esmail

PLC Hardware

The processor unit or central processing unit (CPU) This unit interprets the input signals and carries out the

control actions according to the program stored in its memory,communicating the decisions as action signals to the outputs.

The power supply unit

Convert the mains AC voltage to the low DC voltage necessaryfor the processor and circuits in the input and output interfacemodules.

The programming device

Used to enter the required program into the memory of theprocessor.

Page 7: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 7/33

Dr. Osama Esmail

PLC Hardware

The memory unit It is where the program containing the control actions to be

exercised by the microprocessor is stored and where the datais stored from the input for processing and for the output.

The input and output sections

It are where the processor receives information from externaldevices and communicates information to external devices.

The communications interface

It is used to receive and transmit data on communicationnetworks from or to other remote PLCs.

Page 8: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 8/33

Basic PLC Schema

CPU

Power Supply

Memory

Input Module

Output Module

Programming devices

Communications Expansion Connections

Page 9: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 9/33

Dr. Osama Esmail

Internal Architecture

Page 10: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 10/33

Dr. Osama Esmail

Input Scan

Program ScanOutput Scan

Housekeeping

START

Each ladder rung is scannedusing the data in the Inputfile. The resulting status(Logic being solved) iswritten to the Output file(“Output Image”).

The status of external inputs(terminal block voltage) iswritten to the Input image(“Input file”).

The Output Image datais transferred to theexternal outputcircuits, turning theoutput devices ON orOFF.

Internal checks onmemory, speed andoperation. Service anycommunicationrequests, etc.

PLC Operating Cycle Cont’d.

Page 11: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 11/33

Dr. Osama Esmail

Scan Time

The scan time is the total time the PLC takes to

complete the program and I/O update scans

Page 12: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 12/33

Dr. Osama Esmail

Scan Time Cont’d

The program scan time generally depends on two factors:

the amount of memory taken by the control program

the type of instructions used in the program (which

affects the time needed to execute the instructions)

The time required to make a single scan can vary from a

few tenths of a millisecond to 50 milliseconds.

Page 13: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 13/33

Dr. Osama Esmail

An AC/DC Input

Block diagram

Circuit

Page 14: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 14/33

Input Devices

Pushbuttons

Selector Switches Limit Switches

Level Switches

Photoelectric Sensors

Proximity Sensors

Motor Starter Contacts

Relay Contacts

Thumbwheel Switches

Page 15: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 15/33

Dr. Osama Esmail

An AC Output

Circuit

Page 16: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 16/33

Dr. Osama Esmail

DC Output

As in DC inputs, DC output modules may have eithersinking or sourcing configurations. If a module has a

sinking configuration, current flows from the load into

the module’s terminal, switching the negative (return or

common) voltage to the load. The positive current flows

from the load to the common via the module’s powertransistor.

In a sourcing module configuration, current flows from

the module into the load, switching the positive voltage

to the load

Page 17: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 17/33

An Example of a Relay Output Card

Page 18: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 18/33

Outputs

Typical output voltages are listed below,

5 Volts DC TTL level

24 Volts AC/DC

48 Volts AC/DC

110 Volts AC/DC

220 Volts AC/DC

WARNING: Always check rated voltages and currents for PLCs

and never exceed.

Page 19: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 19/33

Output Devices

Valves

Motor Starters Solenoids

Control Relays Alarms

Lights

Fans

Horns

Page 20: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 20/33

Dr. Osama Esmail

Programming Techniques Ladder Diagrams (LAD)

Instruction List (IL)

Sequential Function Charts (SFC)

Structure Text (ST)

Function Block Diagram (FBD)

Page 21: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 21/33

Dr. Osama Esmail

Ladder Diagram

Page 22: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 22/33

Dr. Osama Esmail

Logic Function

It is a group of conditions that is evaluated and theoutput of the function give the result of this evaluation

AND

OR

NOT

NAND

NOR

Page 23: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 23/33

Dr. Osama Esmail

AND Logic Function

Page 24: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 24/33

Dr. Osama Esmail

OR

Page 25: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 25/33

Dr. Osama Esmail

NOT Logic Function

Page 26: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 26/33

Dr. Osama Esmail

Exclusive OR (XOR)

Page 27: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 27/33

Dr. Osama Esmail

Latching Circuit

Page 28: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 28/33

Dr. Osama Esmail

Time diagram

Page 29: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 29/33

Dr. Osama Esmail

Time diagram

Page 30: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 30/33

Dr. Osama Esmail

Time diagram

Page 31: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 31/33

Dr. Osama Esmail

Time diagram

Page 32: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 32/33

Dr. Osama Esmail

Programming Language Instruction List (IL)

It is programming method gives the programs as a series of instructions, with each instruction

on a new line. Each instruction consists of an operator followed by one or more operands, thatis, the subjects of the operator.

Page 33: Introduction to Mechatronics 2014 6

8/17/2019 Introduction to Mechatronics 2014 6

http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 33/33

Dr. Osama Esmail

Programming Language Instruction List (IL)