Upload
yousef-salah
View
220
Download
0
Embed Size (px)
Citation preview
8/17/2019 Introduction to Mechatronics 2014 6
http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 1/33
PLC programming
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.
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 ?
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
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
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.
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.
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
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
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.
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
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.
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
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
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
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
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
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.
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
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)
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
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
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
8/17/2019 Introduction to Mechatronics 2014 6
http://slidepdf.com/reader/full/introduction-to-mechatronics-2014-6 24/33
Dr. Osama Esmail
OR
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
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)
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
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
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
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
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
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.
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)