Sei sulla pagina 1di 69

PLC – The Basics

Programmable Logic Controllers.


PLC - Basics

1. What is a PLC
2. Before PLCs (Before PCs)
3. Advantages of PLC
4. Disadvantages of PLC
5. PLC Configurations
6. PLC versus PC
7. Parts of a PLC
8. PLC in Operation
PLC – The Basics

9. Ladder Logic
10. Programming the PLC
11. Siemens SIMATIC S7 300 – An Overview
12. Troubleshooting & Maintenance
13. Closing (Q/A)
14. Acknowledgements
 A Programmable Logic Controllers (PLC)
is a miniature industrial grade computer
that contains hardware and software –
1. What is a PLC ? capable of being programmed to perform
control functions

Image Source: Siemens


Image Source: Koyo
2. Before the PLC.
The development of the PLC can be compared
analogously to the development of the Personal
Computer,
Before the PC what were the computing devices:
 Abacus
 Slide Rule
 Table of Logarithms
 Electronic Calculator
 Personal Computer (Desktop, Laptop, Mobile
Devices
2. Before the PLC.

How were machines and industrial processes


controlled before the advent of the PLC?

One of the means for controlling machines was


through the use of

 Power Relays and their associated

 Control Relays
2. Before the PLC.

What are the disadvantages of relay based


control systems?

 Complexity,
 Costly
 Hardwiring,
 Logistical nightmare
 Troubleshooting problems
 Strict Maintenance routine
 Not easy to modify
 Etc, etc
2. Before the PLC.

Control devices:

• Rotary drum switch


• Limit switch
• Electromechanical Counter
• Fuses
• Control Transformers
• Motor Starter
• Solenoid Valves
• Pneumatic plunger timers
• etc
2. Before the PLC.
Historical Background
Main Criteria
General Motors
Corporation specified the • The controller had to be designed in modular
design criteria for the first form, so that sub-assemblies could be
programmable controller in removed easily for replacement or repair.
1968
• The control system needed the capability to
The main goal: pass data collection to a central system.
To eliminate the high costs • The system had to be reusable.
associated with inflexible,
relay-controlled systems. • The method used to program the controller
had to be simple, so that it could be easily
understood by plant personnel.
3. Advantages of the PLC.
 A Programmable Logic
Controller (PLC) is a device that
was invented to replace the
necessary sequential relay circuits
for machine control. The PLC
works by looking at its inputs and PLCs are used in all industries.
depending upon their state, turning  Manufacturing
on/off its outputs. The user enters
a program, usually via software,  Process Plants & Systems
that gives the desired results.  Machining,
 Packaging,
 Automated Plants
 Etc
3. Advantages of the PLC.

 They are re-programmable


 Solid state switches last much longer than relays
 Complex logics can be easily represented
 Multiple devices can be embedded in one unit
 Can easily be scaled up or modified.
 Smaller physical size than hard-wire solutions.
 Easier and faster to make changes.
 PLCs have integrated diagnostics and override functions.
 Diagnostics are centrally available.
 Applications can be immediately documented.
 Applications can be duplicated faster and less
expensively.
3. Advantages of the PLC.

 Connection between switches/output can be


modified through software easily.
 Troubleshooting is Easier and Faster.
 Ease of Maintenance – less downtime.
 Easy to develop Programs by offline simulation
 Less amount of Space Needed
 Changes are easier and faster to implement,
 Integrated diagnostics
3. Advantages of the PLC.

 Inputs and Outputs are easier to monitor by


HMI devices....and from PC's
 Can withstand severe environmental
conditions.
 Cost effective for controlling complex
systems.
 Computational abilities make possible more
sophisticated controls
 Reliable components make for long uptime
before failure.
4. Disadvantages of the PLC.

 Most PLCs manufacturers offer only closed


architectures for their products .
 PLC devices are proprietary, proprietary,
which means that parts and from one
manufacturer can’t easily be used in
combination with parts of another
manufacturer, which limits the design and cost
options.
 Subject to the limitations imposed by
semiconductor based systems.
 Setup and training costs could be high
5. PLC – Configurations
Modular Configuration
PLCs are of two main configurations.

• Modular Configuration

• Fixed Configuration .
5. PLC – Configurations
PLCs are of two main configurations.

• Modular Configuration

• Fixed Configuration

Fixed Configuration
6. PLC versus PC
PLC
• Designed for extreme industrial
environments
• Can operation in high
temperature and humidity
• High immunity to noise.
• Integrated Command interpreter
(proprietary)
• No secondary memory like HDD
• Optimized for a Single task
PC
• Mainly for Data Processing & Calculation
• Optimized for Speed
• Not built for extreme enviroments
• Can be programmed in several languages
• Secondary Memory is Built in.
• Built for multitasks
7. Parts of a PLC.
Basic parts of a PLC

 Power Supply

 Processor Module
 CPU
 Memory

 Communication Interface.
 HMI – Status
 HMI – Programming

 I/O Modules
 Discrete/Digital Inputs Sections of a PLC module.
 Analog Inputs (Courtesy: Mitsubishi Automation)

 Output Modules
7. Parts of a PLC.

(Courtesy: Hitachi)
7. Parts of a PLC.
 Power Supply

The system power supply plays a major


role in the total system operation.
Its responsibility is not only to provide
internal DC voltages to the system
components (i.e., processor, memory, and
input/output interfaces), but also:

a) to monitor and regulate the


supplied voltages and warn the
CPU if something is wrong.
b) The power supply, then, has the
function of supplying well-
regulated power and protection
for other system components.

PLC Power Supply (Courtesy: Allen Bradley)


7. Parts of a PLC.
 Power Supply

Usually, PLC power supplies require input The first step in estimating the load is to
from an AC power source; however, some determine how many modules are required
PLCs will accept a DC power source. Those and then compute the total current
that will accept requirement of these modules.
Most PLCs, however, require a 120 VAC or The following table lists the module types,
220 VAC power source, while a few current requirements for all inputs and
controllers will accept 24 VDC. outputs ON at the same time, and the
Since industrial facilities normally available power supplies for our
experience fluctuations in line voltage and programmable controller example.
frequency, a PLC power supply must be
able to tolerate a 10 to 15% variation in
line voltage conditions.
7. Parts of a PLC.
 Power Supply The first step in estimating the load is to determine how many modules are
required and then compute the total current requirement of these modules.
The following table lists the module types, current requirements for all
inputs and outputs ON at the same time, and the available power supplies for
our programmable controller example.

4
 CPU (Controller/ Processor)
7. Parts of a PLC.  Memory

Typical Processor
Module
7. Parts of a PLC.
 CPU (Controller/ Processor)
 Memory

• Processors are either modular or built


into the PLC
• They vary in processing speed and
memory options.
• Processor is optimized for high speed
control and not general purpose
computing.

Allen Bradley SLC 500 CPU

(Courtesy: Allen Bradley)


7. Parts of a PLC.
CPU Functions: RUN
• Places the processor in the Run mode
• Runs Ladder program and energizes output devices
• Executes the operating • Prevents online program editing in this position
system • Prevents use of programmer/operator interface device to change
• Manages memory, the processor mode
• Monitors inputs,
• Evaluates the PROG Position
• Means for connecting to • Sets the processor in the Program mode
an external programming • Prevents the processor from scanning or executing the ladder
device program, and the controller outputs are de-energized
• Enables program entry and editing
• Provide system diagnostics
• Prevents you from using a programmer/operator interface device
with status LED to change the processor mode
indicators.
• It may have a switch for REM Position
selecting mode of • Places the processor in the Remote mode: either the REMote
operation : Run, REMote Program, or REMote Test mode
• RUN, • Allows you to change the processor mode from a
• PROG programmer/operator interface device
• REM • Allows you to perform online program editing
7. Parts of a PLC.

 I/O Module

Typical I/O Module


(Courtesy: Rockwell Automation)
7. Parts of a PLC.

Discrete devices are inputs and outputs that have


only two states: on and off.
Examples of discrete input
Discrete I/O modules perform four tasks in the PLC: devices:

• Sense when a signal is received from a field ON/SWITCHES


device.

• Convert the input signal to the correct voltage Limit switches.


level for the particular PLC.
Push buttons
• Isolate the PLC from fluctuations in the input
signal’s voltage or current. Output can control ON OFF devices only

• Send a signal to the processor indicating which


sensor originated the signal.
7. Parts of a PLC.
Analog I/O modules deals with signals that
are continuously changing. They are
needed for precise control of the process
under the control of the PLC.
Analog devices represent physical
Examples, quantities that can have an infinite
• Temperature number of values. Typical analog
• Pressure
• Humidity inputs and outputs vary from
• Density
0 to 20 milliamps, 4 to 20 milliamps,
• Fluid Level
or 0 to 10 volts.
7. Parts of a PLC.
Communication Modules
Used to establish point-to-point connections
with other intelligent devices for the exchange
of data.

Such connections are normally established with


computers, operator stations, process control
systems, and other PLCs.

Communication modules allow the user to


connect the PLC to high-speed local networks
that may be different from the network
communication provided with the PLC.

Serial Communication Module


(Courtesy: www.automationdirec.com
7. Parts of a PLC.
Other types of output modules

 Motion Control Modules


 PID Modules
 BCD/ASCII Modules
 Stepper Motor Control
 Encoder Counter Module
 High Speed Counters
 Motion & Position Control
8. The PLC in Operation.

Three Phase AC Motor Control

The opposite diagram


illustrates the use of a NC
and NO pushbutton switches
to control the 3 phase AC
motor.

The ON/OFF control of the 3


phase motor can also be
implemented with a PLC.

First, we need to understand


the use of Logic gates.
8. The PLC in Operation.
Logic Gates A logic gate is a circuit with several inputs but only
one output that is activated by particular combinations of
input conditions.

Boolean algebra as related to AND, OR, and NOT functions.


8. The PLC in Operation.

The PLC, as used to control the operation of the AC


motor responds to the presence or absence of Logic
signals at its I/O module to control response the
output devices that receive signal from the output.

Examples of discrete inputs: Push Buttons, selector


switches, limit switches, proximity switches.

Example of discrete outputs devices: Indicator Lights,


Relays, Motor Starters.
8. The PLC in Operation. PLC Control of AC Motor

PLC Control: ( Phase Motor in OFF position)


8. The PLC in Operation. PLC Control of AC Motor

PLC Control: (Phase Motor in START position)


8. The PLC in Operation. PLC Control of AC Motor

PLC Control: (Phase Motor in RUNNING position)


8. The PLC in Operation. PLC Control of AC Motor

PLC Control: (Phase Motor in switch OFF position)


8. The PLC in Operation.
PLC Control – More Examples

Manufacturing,

Mining,

CNC

Assembly Line Processes

PLC Control: (Other Examples)


8. The PLC in Operation. PLC – Program Execution Cycle
The processor (CPU) is the “brain” of the
PLC.

What the CPU does:


 Implements the logic and controlling the
 communications among the modules.
 Stores program information and logical operations
results in memory - EPROM or EEPROM plus RAM.
 Controls all PLC activity.
 Enables user to enter in the desired program in
relay ladder logic

Typical PLC CPU (Courtesy: Rockwell Automation)


8. The PLC in Operation. PLC – Program Execution Cycle

The PLC program is executed as


part of a repetitive process referred
to as a scan.

A typical PLC scan starts with the


CPU reading the status of inputs.

Next, the application program is


executed.

Next, the CPU performs internal


diagnostic and communication tasks.

Finally, the status of all outputs is


updated.

This process is repeated


continuously as long as the PLC is in
the run mode.
9. Ladder Logic

 The devices that control the logic functions of


a control system are physical wired. This is
called hard wired logic.

 Hard wired logic is done by using relay ladder


schematics.

 Control scheme and the associated control


elements are represented between two power
lines.

 All control element are placed in a ladder like


function between the two power lines.
9. Ladder Logic

 The PLC logic function can be similary


represented in a ladder logic diagram.

 Major difference is that the hard wired logic


can only be modified by rewiring and changing
element as needed. The PLC control function
depends on the logic states of the outputs and
these are very easy to change through the
software program.
9. Ladder Logic

Motor Ladder Logic


9. Ladder Logic
• PLC express control logic in terms of contact • Each rung is a combination of input conditions
symbols symbols. (symbols) connected from left to right, with the
symbol that represents the output at the far right.
• Symbols are the same as those used for hard
wired relay control circuits. • The symbols that represent the inputs are connected
in series, parallel, or some combination of the two
• A rung is the contact symbolism required to to obtain the desired logic.
control an output.

• A complete ladder logic program has several


rungs of ladder, each of which controls an CPU Scan Time
output. While in operation, the controller scans the logic
stored in the CPU memory continuously.
• In PLC logiclogic all mechanical switch contacts
are represented by a software contact symbol
and all electromagnetic coils are represented The completion of a cycle of the controller is
by a software coil symbol. called a Scan.

• The PLC uses ladder logic diagrams, the The scan time needed to complete a full cycle by
conversion from any existing relay logic to the controller gives the measure of the speed of
programmed logic is therefore simplified. execution for the PLC.
9. Ladder Logic

Two limit switches connected in series


and used to control a solenoid valve
9. Ladder Logic

Two limit switches connected in parallel


and used to control a solenoid valve
9. Ladder Logic

Two limit switches connected in parallel with each


other and in series with a pressure switch and used
to control a solenoid valve
9. Ladder Logic

A motor control circuit with two start/stop buttons. When


either start button is depressed, the motor runs. By use of
a seal-in contact, it continues to run when the start button
is released. Either stop button stops the motor when it is
depressed
10. Programming the PLC
The system to be controlled by
the PLC is first described in ladder
logic.

Next the ladder logic is compiled


and translated into basic
instructions that are uploaded into
the PLC memory by the
programmer.

The programming is done while


the PLC is set to TERMINAL OR
PROGRAMMING MODE.

Programming can be done through


a PLC Programmer or a PC that
has the programming software.
11. Siemens SIMATIC S7 300
Totally Integrated
Automation
SIMATIC
S7-300
The universal, small
control system
supplemented by new,
compact CPUs
11. Siemens SIMATIC S7 300

Overview SIMATIC S7-300


Comparison
I/O‘s
Upper and mid
performance range in the system family
Process Functions S7-400
Communication
MMC Lower and mid S7-300 - the universal,
small control system for
performance range versatile applications in
S7-300 automation engineering

Bottom
performance range
S7-200
+ Programming devices
+ STEP 7 software
+ Communication
+ HMI
11. Siemens SIMATIC S7 300
The new S7-300 compact CPUs
Overview  The versions differ with respect to
Comparison - I/Os
I/O‘s
 3 basic types: - Onboard interfaces
Process Functions - Process functions
Communication With different memory
MMC sizes and performances

312C
312C: 16 Kbyte

313C
313C: 32 Kbyte 313C-2 PtP
313C-2 DP

314C-2 PtP
314C: 48 Kbyte 314C-2 DP
11. Siemens SIMATIC S7 300
Overview
Dimensions and design
Comparison
I/O‘s 313C-2 PtP 314C-2 PtP
Process Functions 312C 313C 313C-2 DP 314C-2 DP
Communication
MMC
125 mm

80 mm 120 mm 120 mm 120 mm

Onboard I/Os: DI/DO DI/DO + DI/DO DI/DO + AI/AO


AI/AO
Integral interfaces: MPI MPI + MPI + PtP/DP
MPI PtP/DP
Max. design: 1 tier 4 tiers
4 tiers 4 tiers
11. Siemens SIMATIC S7 300

Overview
Comparison
I/O‘s
Process Functions
Communication
MMC 312C 313C 314C
Memory,
performance and Main memory 16 kB 32 kB 48 kB

quantity breakdown Statements 5k 10 k 16 k

Loading memory plug-in 64k-4MB plug-in 64k-4MB plug-in 64k-4MB

Instruction runtime min. 0.2 µs min. 0.1 µs min. 0.1 µs

Alarm response time 800 µs 400 µs 400 µs

Bit memories 1024 2048 2048

Timers / counters 128 / 128 256 / 256 256 / 256

Address space I/O 1024 / 1024 byte 1024 / 1024 byte 1024 / 1024 byte

No. of digital channels 266 1000 1000

No. analog chann. I/O 64 / 64 248 / 248 248 / 248


11. Siemens SIMATIC S7 300
Integral I/Os - summary
Overview  Low-cost onboard I/O channels for universal use
Comparison
 Every digital input can be used as an alarm input
I/O‘s
Process Functions  Analog inputs can also be used as digital inputs
Communication
MMC

312C 313C 314C

313C 313C-2 PtP / DP 314C-2 PtP / DP

Number of DIs 10 24 16 24

Number of DOs 6 16 16 16
* Additional input for resistance measurement
Number of AIs -/- 4 + 1* -/- 4 + 1*

Number of AOs -/- 2 -/- 2


11. Siemens SIMATIC S7 300
Overview
Comparison
Integral digital I/Os
I/O‘s Digital Digital
Process Functions inputs outputs
Communication
MMC Rated voltage DC 24 V DC 24 V
Permissible range DC 20.4 - 28.8 V DC 20.4 - 28.8 V
Current range --- 0.5 A
Input delay 0.1/0.5/3/15 ms ---
Switch-off delay --- 2 ms
Electrical isolation from yes yes
backplane bus
Groups of 16 8
Max. frequency --- 100 Hz
11. Siemens SIMATIC S7 300
Integral analog I/Os
Overview
Comparison Analog Analog
I/O‘s inputs outputs
Process Functions
Communication
MMC
Measuring ranges

Voltage ±10V; 0..10V ±10V; 0..10V

Current ±20mA; 0/4..20mA ±20mA; 0/4..20mA

Resolution 11 bits+sign 11 bits+sign

Filter (50/60 Hz) selectable ---

Input delay 5 ms ---

Output delay --- 1,2 ms

Electrical isolation from yes yes


backplane bus
11. Siemens SIMATIC S7 300
Overview
Summary of process functions
Comparison
I/O‘s
Process Functions
Communication 312C 313C 314C
MMC Counting
Connectable sources Incremental encoder, Incremental encoder, Incremental encoder,
pulse generator with pulse generator with pulse generator with
direction signal direction signal direction signal
Number of channels 2 3 4
Cut-off frequency 10 kHz 30 kHz 60 kHz
Frequency measurem. yes yes yes
PWM
Number of outputs 2 3 4
Cut-off frequency 2.5 kHz 2.5 kHz 2.5 kHz
Positioning no no 1 axis
Control - PID PID
11. Siemens SIMATIC S7 300
Integral counters
Overview  Integral counters in all compact CPUs
Comparison
I/O‘s
- Recording of pulse and incremental encoder
signals (DC 24V)
- Forward/reverse with reference values which
Process Functions
Communication
MMC
can be changed during operation
- 10 - 60 kHz (depending on CPU)
 Various operating modes possible
- Single counting (e.g. filling, dosing)
- Periodic counting (e.g. recording of angle)
- Counting with gate control (e.g. length measurement)
 Frequency measurement
- Counting with fixed time base
11. Siemens SIMATIC S7 300

Overview
Comparison
I/O‘s

PWM outputs
Process Functions
Communication
MMC
 Pulse outputs on all compact CPUs
- Direct control of valves, actuators, switchgear,
heaters etc. (DC 24 V/ 0.5 A)
- Period and pulse/pause ratio can be changed
during operation
- 2.5 kHz switching frequency, up to 4 outputs
(depending on CPU)
11. Siemens SIMATIC S7 300

Overview
Simple motion control
Comparison without additional Components
I/O‘s  Low-price
Process Functions
 Since no additional modules required
Communication
MMC  Optimum memory requirements and runtime
 No additional programming requirements
since function is component of operating
system
 Flexible
 Parameters (delay, acceleration etc.) can be
changed for each travel
 Various operating modes selectable: absolute
or relative positioning, inching etc.
 Simple
 Prepared functionality can be linked into
application program using standard blocks
11. Siemens SIMATIC S7 300
Summary of communications
Overview
Comparison
I/O‘s
Process Functions
Communication 312C 313C-2 PtP 313C-2 DP
MMC
313C 314C-2 PtP 314C-2 DP

Interface present on all CPUs - networking of CPU, programming device and OPs
MPI Low-cost communications without additional HW - extremely simple configuring
Communication with up to 7 OPs simultaneously (depending on type of CPU)

Serial onboard interface


Point-to-
Data exchange e.g. with
point devices from other
vendors
Fast, cyclic data exchange
PROFIBUS High data security
DP
11. Siemens SIMATIC S7 300
 Data exchange: 187.5 kbit/s
Overview
On everyComparison
CPU:  Up to 32 bus stations, up to 12
multipoint
I/O‘s interface MPI active connections per CPU
Process Functions
 Communications functions:
Communication
MMC
- Programming device/operator
panel functions
- Global data communications
without programming input
- S7 basic communication up to 76
byte
- S7 communication (only server)

 Low-cost communication
without additional hardware
11. Siemens SIMATIC S7 300
Overview
Comparison

Point-to-point interface (RS422/485)


I/O‘s
Process Functions
Communication
MMC
Connection of non-system components
 CPU 313C-2 PtP / 314C-2 PtP
 Transmission physics:
- RS 422/485 (X.27)
- Transmission rate: up to 19.2 / 38.4 kbit/s (half duplex/full duplex)

 Protocols:
- ASCII
- 3964(R)
- RK 512
- (only 314C-2 PtP)
11. Siemens SIMATIC S7 300
Overview
Comparison  Versatile use:
I/O‘s master or slave function PG

Process Functions
 Data exchange at 12 Mbit/s
Communication
MMC  Up to 32 DP stations
to master interface
PROCESSFIELDBUS

 Max. distance 23 km using FO


CPU 313C-2 DP,
 Communications functions:
314C-2 DP,
- All programming device/OP
integral PROFIBUS-DP functions
- PROFIBUS-DP
S IE M E N S

 No additional module
or software required!
11. Siemens SIMATIC S7 300
SIMATIC Micro Memory Card
Overview Many functions - small format
Comparison
 Can be used in every S7-300 compact CPU
I/O‘s
Process Functions  Functions as program memory, non-volatile and
Communication resistant to overall reset; transportable for simple
MMC program updating
 Functions as loading memory - flexible as result
of selectable MMC sized between 64kB and 4MB
 Permits project storage on CPU - save your
complete project on the MMC
 Access to the MMC during RUN mode of CPU
- Load data into CPU (recipe)
- Write data onto MMC (archive)
 MMC buffers your data in the main memory in
event of power failure
 no backup battery required

MMC is required to operate the compact CPUs


12. Troubleshooting & Maintenance
• Ground yourself by touching a conductive surface before
handling static-sensitive components.

• Wear a wrist strap that provides a path to bleed off any charge
that may build up during work.

• Be careful not to touch the backplane connector or connector


pins of the PLC system (always handle the circuit cards by the
edge if possible).

• Be careful not to touch other circuit components in a module


when you configure or replace its internal components.

• When not in use, store modules in its static-shield bag.

• If available, use a static-safe work station.


13. Closing
14. Acknowledgements
• © 2011 Frank D Petruzella; Programmable Logic Controllers 4th Edition,
McGraw Hill

• PLC Hand Book; www.automationdirect.com

• http://www.plcs.net/chapters/history2.htm

• http://library.automationdirect.com/plc-software-features-you-want/

• http://advanceelectricaltraining.com/electrical-resources/

• Siemens Automation

• Rockwell Automation

• GE Fanuc

• Koyo

• OMRON

Potrebbero piacerti anche