SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
Process Control SystemsProcess Control SystemsProcess Control SystemsProcess Control Systems
with a PLCwith a PLCwith a PLCwith a PLC
Saxion University of Applied Sciences
J.W. van Dijk
Version 1.0.2
September 2013
© Saxion. All rights reserved. Nothing from this publication may be copied, stored in an automated information file,
or made public, in any form or in any manner, either electronic, mechanical, through photocopying, recording or
any other way, without previous written permission from the publisher.
Process Control Systems with a PLC
1
ContentsContentsContentsContents
AbbreviationsAbbreviationsAbbreviationsAbbreviations ....................................................................................................................... 2
1111 IntroductionIntroductionIntroductionIntroduction ......................................................................................................................... 3
2222 Three layer model of a factoryThree layer model of a factoryThree layer model of a factoryThree layer model of a factory ............................................................................................. 4
2.1 Enterprise control .................................................................................................... 5
2.2 Factory control ......................................................................................................... 6
2.3 Automation and shop-floor control ......................................................................... 9
3333 TraditionalTraditionalTraditionalTraditional control versus PLC controlcontrol versus PLC controlcontrol versus PLC controlcontrol versus PLC control .............................................................................. 10
4444 PLC controlPLC controlPLC controlPLC control ....................................................................................................................... 12
4.1 Analogue inputs ................................................................................................... 13
4.2 Analogue outputs ................................................................................................ 15
4.3 Filtering of analogue inputs ................................................................................. 15
4.4 PID control with a PLC .......................................................................................... 17
Process Control Systems with a PLC
2
AbbreviationsAbbreviationsAbbreviationsAbbreviations
ADC Analogue to Digital Converter
B2B Business to Business
CAD Computer Aided Design
CAM Computer Added Manufacturing
CIM Computer Integrated Manufacturing
DAC Digital to Analogue Converter
DCS Digital Control System
ERP Enterprise Resource Planning
FBD Function Block Diagram
I/O Input/Output
ISO International Standardisation Organisation
IS Information Systems
IT Information Technology
LIMS Laboratory Information Management System
MES Manufacturing Execution System
OSI Open System Interconnection
PLC Programmable Logic Controller
PID Proportional–Integral–Derivative
SCADA Supervisory Control And Data Acquisition
SPC Statistical Process Control
SQC Statistical Quality Control
ST Structured Text
VSD Variable Speed Drive
Process Control Systems with a PLC
3
1111 IntroductionIntroductionIntroductionIntroduction
Presently a Programmable Logic Controller (PLC) is still the basic component in automation. A PLC can be
found in the lower level of the automation and is the basic component for process control systems and
automation
.
Figure 1.1: PLC, the basic component in automation
Before we can have a look at the PLC, first a better understanding of the different layers in an
industrial environment is essential.
Process Control Systems with a PLC
4
2222 Three layer model of a factoryThree layer model of a factoryThree layer model of a factoryThree layer model of a factory
In the current economic climate, doing more for less is often management’s mandate. Plant floor and
manufacturing information technology (IT) staffs are under pressure to show quick results and solve
problems with increasingly lean budgets. While that’s a tall order, it is not impossible, provided there’s an up-
front investment in time to produce detailed, specific goals and to truly understand what’s needed. Focused,
cross-functional teams that implement flexible and scalable information systems (IS) can deliver a smooth, lean
manufacturing process. When integrating new technology into an existing facility, always three things
should be considered: the hard infrastructure, the soft infrastructure, and information flow.
Hard infrastructure includes client and server hardware and network infrastructure. Soft infrastructure
includes operating systems, existing or legacy software, needed code customisations, and the human
resources to run/support the system.
Information flow includes how data in the new system interacts with legacy systems and what legacy data
the new system will require, as well as who will want to receive/access the information that is held by the
system.
Tracking the information flow within a manufacturing process involves three main layers of control: the
entire enterprise, the factory or facility as a whole, and the shop floor.
Figure 2.1: A manufacturer's three control layers
Process Control Systems with a PLC
5
2.12.12.12.1 Enterprise ControlEnterprise ControlEnterprise ControlEnterprise Control
The enterprise control layer, Enterprise Resource Planning (ERP), is the management layer and has
business-to-business (B2B) tools surrounding it in order to communicate data from one enterprise to
other. The B2B tools overlap into the factory control layer because they can enable data exchange among
facilities, customers and suppliers. Within the enterprise layer we also find tools for enterprise resource
planning, supply chain management, customer response management, and document control.
Data communication in this layer can be characterized by:
• Large amounts of data, file transfer
• Not very frequent, low refresh rate
Major suppliers of ERP products are:
• Oracle
• SAP
• Baan
Figure 2.2: Suppliers of ERP software
Process Control Systems with a PLC
6
2.22.22.22.2 Factory controlFactory controlFactory controlFactory control
The factory control layer controls manufacturing floor processes. Manufacturing Execution System (MES) is
a collection of software functions which are distinct from those included in ERP, CAD/CAM and Industrial
Controls. The uniqueness of functionality is an added benefit because it complements the functionalities
that exist in the other systems. The focus of MES is operations, especially production operations. MES
coordinates all manufacturing data related to operations at a plant wide level. Supervisory control and data
acquisition, recipe management, and advanced planning and scheduling tools add to the MES functionality
by providing tighter factory floor controls.
DescriptioDescriptioDescriptioDescriptionnnn
"Manufacturing Execution Systems deliver information enabling the optimisation of production activities
from order launch to finished goods. Using current and accurate data, MES guides, initiates, responds to,
and reports on plant activities as they occur. The resulting rapid response to changing conditions, coupled
with a focus on reducing non-value-added activities, drives effective plant operations and processes. MES
improves the return on operational assets as well as on-time delivery, inventory turns, gross margin, and
cash flow performance. MES provides mission-critical information about production activities across the
enterprise and supply chain via bi-directional communications."
The concept of MES is widely recognized and used in manufacturing sectors such as automotive,
semiconductor, electronics, food processing, pharmaceuticals, aerospace, medical devices, textiles.
Elements such as scheduling, maintenance management, quality, and time and attendance fall within the
scope of MES and are used in all industries.
The figure below shows the place that is being occupied by MES. While other activities of manufacturing
enterprises like CAD, Controls, ERP, etc. have been helped by computer-based applications for a long
time, the areas related with production operations haven't received so much attention.
Figure 2.3: Plant Information Model
Process Control Systems with a PLC
7
Manufacturing Execution Systems are an essential component of operations in today's competitive
business environments, which require greater production efficiency and effectiveness. MES focuses on the
valuing-adding processes, helping to reduce manufacturing cycle time, improve product quality, reduce or
eliminate paperwork between shifts, reduce lead time, and empowering plant operations staff. This
section includes an overview of MES and quotes from users.
Figure 2.4: MES Functional Model
MES is of particular value to operational management. Functions include resource allocation and status,
dispatching production units, data collection/acquisition, quality management, maintenance management,
performance analysis, operations/detail scheduling, document control, labour management, process
management and product tracking and genealogy. These functions are described more fully below.
Resource Allocation and Status:Resource Allocation and Status:Resource Allocation and Status:Resource Allocation and Status: Manages resources including machines, tools, labour skills, materials,
other equipment, and other entities such as documents that must be available in order for work to start at
the operation. It provides detailed history of resources and insures that equipment is properly set up for
processing and provides status real time. The management of these resources includes reservation and
dispatching to meet operation scheduling objectives.
Operations/Detail Scheduling:Operations/Detail Scheduling:Operations/Detail Scheduling:Operations/Detail Scheduling: Provides sequencing based on priorities, attributes, characteristics, and/or
recipes associated with specific production units at an operation such as shape, colour sequencing, or
other characteristics that, when scheduled in sequence properly, minimize set-up. It is finite and it
recognizes alternative and overlapping/parallel operations in order to calculate, in detail, exact time of
equipment loading adjusted to shift patterns.
Process Control Systems with a PLC
8
DisDisDisDispatching Production Units:patching Production Units:patching Production Units:patching Production Units: Manages flow of production units in the form of jobs, orders, batches, lots,
and work orders. Dispatch information is presented in the sequence in which the work needs to be done
and changes in real time as events occur on the factory floor. It has the ability to alter the prescribed
schedule on the factory floor. Rework and salvage processes are available, as well as the ability to control
the amount of work in process at any point with buffer management.
Document Control:Document Control:Document Control:Document Control: Controls records/forms that must be maintained with the production unit, including
work instructions, recipes, drawings, standard operation procedures, part programs, batch records,
engineering change notices, shift-to-shift communication, as well as the ability to edit "as planned" and
"as built" information. It sends instructions down to the operations, including providing data to operators
or recipes to device controls. It might also include the control and integrity of environmental, health and
safety regulations, and ISO information such as Corrective Action procedures. Storage of historical data is
provided.
Data Collection/Acquisition:Data Collection/Acquisition:Data Collection/Acquisition:Data Collection/Acquisition: This function provides an interface link to obtain the inter-operational
production and parametric data that populate the forms and records that were attached to the production
unit. The data may be collected from the factory floor either manually or automatically from equipment in
an up-to-the-minute time frame.
Labour Management:Labour Management:Labour Management:Labour Management: Provides status of personnel in an up-to-the-minute time frame. It includes time
and attendance reporting, certification tracking, as well as the ability to track indirect activities such as
material preparation or tool room work as a basis for activity based costing. It may interact with resource
allocation to determine optimal assignments.
Quality Management:Quality Management:Quality Management:Quality Management: Provides real time analysis of measurements collected from manufacturing to assure
proper product quality control and to identify problems requiring attention. It may recommend action to
correct the problem, including correlating the symptom, actions and results to determine the cause. May
include SPC/SQC tracking and management of off-line inspection operations, and analysis from a
laboratory information management system (LIMS) could also be included.
Process Management:Process Management:Process Management:Process Management: Monitors production and either automatically corrects or provides decision support
to operators for correcting and improving in-process activities. These activities may be inter-operational
and focus specifically on machines or equipment being monitored and controlled, as well as intra-
operational, which is tracking the process from one operation to the next. It may include alarm
management to make sure factory personnel are aware of process changes that are outside acceptable
tolerances. It provides interfaces between intelligent equipment and MES, possibly through Data
Collection/Acquisition.
Maintenance Management:Maintenance Management:Maintenance Management:Maintenance Management: Tracks and directs the activities to maintain the equipment and tools to insure
their availability for manufacturing and insure scheduling for periodic or preventive maintenance. Also
provides the response (alarms) to immediate problems. It maintains a history of past events or problems
to aid in diagnosing problems.
Product Tracking and Genealogy:Product Tracking and Genealogy:Product Tracking and Genealogy:Product Tracking and Genealogy: Provides the visibility to where work is at all times and its disposition.
Status information may include who is working on it; components, materials by supplier, lot, serial
number, current production conditions, and any alarms, rework, or other exceptions related to the
product. The on-line tracking function creates a historical record, as well. This record allows trace ability
of components and usage of each end product.
Performance Analysis:Performance Analysis:Performance Analysis:Performance Analysis: Provides up-to-the-minute reporting of actual manufacturing operations results
along with the comparison to past history and expected business results. Performance results include
such measurements as resource utilization, resource availability, product unit cycle time, conformance to
schedule and performance to standards. It may include SPC/SQC. Performance Analysis draws on
information gathered from different functions that measure operating parameters. These results may be
prepared as a periodic report or presented on-line as current evaluation of performance.
Process Control Systems with a PLC
9
2.32.32.32.3 Automation and shopAutomation and shopAutomation and shopAutomation and shop----floor controlfloor controlfloor controlfloor control
The automation and shop floor control layers are directly responsible for controlling each step in the
manufacturing process. Computer-Integrated Manufacturing (CIM) is a vital piece of this layer because it
provides in its controlling layers a generic view of the manufacturing process. CIM architectures must be
flexible to manage rapid changes on the factory floor. The idea is CIM can make up the difference MES
lacks. This level has a variety of clients, including machines, operators, engineers, and supervisors.
Here we find Control Panels (e.g. Touch Screens), PLC’s, sensors and actuators.
Typical data communication characteristics for this layer are:
• High update frequencies
• Small amount of data
Figure 2.5: Touch-screen
Figure 2.6: PLCs
Figure 2.7: Sensors and actuators
.
Process Control Systems with a PLC
10
3333 TraditionalTraditionalTraditionalTraditional control versus PLC controlcontrol versus PLC controlcontrol versus PLC controlcontrol versus PLC control
A traditional scheme to start and stop a motor is given in the figure below. Here a motor can be started by
closing ‘S2’. When ‘S2’ is closed the relay ‘K1’ will be activated, its contacts will be closed, and the motor
will run. By using a feedback signal, one of the contacts, from the relay ‘K1’ the motor will continue
running when the start button ‘S2’ is released. The motor will run until ‘S1’ is pressed, it will be opened,
or an over-temperature situation occurs, ‘F3’ is opened.
Figure 3.1: Basic scheme for a motor control
Note that in the scheme two different types of contacts are used:
Normally Open (NO) contact. This type of contact usually is used for a start. Note that in case of a
wiring problem the motor can not be started and also will not start automatically (save operation)
Normally Closed (NC) contact. This type of contact usually is used for a stop. Note that in case of
a wiring problem the motor automatically will be stopped (save operation)
The same functionality implemented in a PLC will look like shown in the figure below.
Figure 3.2: Basic control with a PLC
Note that the feedback of the relay ‘K1’ is not an input for the PLC in the scheme. The feedback now can
be done inside the PLC. In the PLC the following function has to be implemented to obtain the same
functionality as in figure 3.1:
K1 = F3 AND S1 AND (S2 OR K1)
PLC
S2 F3S1
K1
inputs
outputs
Process Control Systems with a PLC
11
For a PLC program written in ST this will look like:
In FBD this function will look like:
Figure 3.3: FBD program
By connecting the PLC to a process computer the start and stop buttons can be omitted or an additional
start or stop location is added. Also the status of the motor can be visualised.
Figure 3.4: Connecting the PLC to a process computer
With this functionality the motor can only be started or stopped. Modern applications however desire very
often that the speed of the motor can be controlled at any value between 0 (stopped) and a maximum
speed.
≥1
&
K1
F3
S1
S2
K1 := F3 AND S1 AND (S2 OR K1);
Process Control Systems with a PLC
12
4444 PLC controlPLC controlPLC controlPLC control
A PLC is very often used to control systems with analogue signals, i.e. temperature, motor speed, flow, or
pressure. The analogue signals can be divided in inputs, for measurement or setpoints, or outputs, to
control and visualize. Inputs are signals coming from the system and going into the PLC, outputs are
signals going from the PLC into the system.
In the figure below a basic control system with a PLC is given. In this system the PLC controls the speed of
a motor. The required speed (setpoint) of the motor is an input for the PLC. The PLC sets its output to a
certain value, in accordance with the setpoint. Because the output of the PLC is always a low voltage
output this signal is amplified, using a Variable Speed Drive (VSD). The actual speed of the motor is
measured with a speed sensor, which output is connected to the input of the PLC. The PLC gives the actual
speed as an output, to i.e. a process computer, for visualisation.
Figure 4.1: PLC control system of a motor with analogue inputs and outputs
In this example the inputs and outputs of the PLC are analogue, continuous voltages between a minimum
and a maximum value. Before analogue inputs can be handled by the software (program) they must be
converted. Also outputs needs to be converted.
Drive
PLC
MotorSpeed sensor
PLC outputPLC input
required speed
(setpoint)
actual_speed
Process Control Systems with a PLC
13
4.14.14.14.1 AnalogAnalogAnalogAnalogueueueue inputsinputsinputsinputs
Analogue inputs should be converted to integers before they can be handled by the software. This
conversion is done by an Analogue to Digital Converter, ADC.
Commonly used input ranges for analogue inputs are:
0 – 10 V
-10V – 10V
0 – 20 mA
In the IEC61131-3 standard for programming PLCs an analogue input is always converted to an integer
value between 0 and 65535. This is the maximum of a 16 bit number (216-1).
Example: a tachometer can measure the speed of a motor in the range from 0 rpm – 1200 rpm. The
output of the tachometer is in the range of 0 – 10V which is going to the input of the PLC. In the PLC the
incoming voltage is converted by the ADC to an integer value in the range from 0 – 65535.
Figure 4.2: Analogue inputs
In the program an integer value between 0 and 65535 doesn’t have a direct relation with the actual speed,
i.e. a speed of 1000 rpm would be in the program a value of 54612. It is much easier if the value in the
program would also be in the range from 0 – 1200, so the input in the range from 0 – 65535 should be
scaled to a value in the range from 0 – 1200. However by scaling down an incoming value of 65535 to
1200 a lot of information would be lost. It is better to scale 65535 down to 12000 (in fact 1200.0), the
accuracy now is ten times better.
Figure 4.3: Scaling of an Analogue input (0-65535 → 0-12000)
This scaling can be done by implementing the following equation in the PLC:
65535/)12000*_( speedispeed =
For a PLC program written in ST this will look like:
speed := (i_speed * 12000) / 65535;
Tachometer ADC PLC program
motor speed
0-1200rpm
PLC input
0-10V
i_speed
0-65535
PLC
Process Control Systems with a PLC
14
This equation scales the integer-input ‘i_speed’ of the PLC and assigns it to the integer-internal ‘speed’:
• When the motor speed is 0 rpm the analogue input of the PLC will be 0 V. This input is converted
to the integer-input ‘i_speed’ value of 0 (using a 0 – 10V input). The result of the equation will be
also 0, which is assigned to the integer- internal ‘speed’ of the PLC.
• When the motor speed is 1200 rpm the analogue input of the PLC will be 10 V. This input is
converted to the integer-input ‘i_speed’ value of 65535 (using a 0 – 10V input). The result of the
equation will now be 12000, which is assigned to the integer- internal ‘speed’ of the PLC.
When the result of the scaling is between 2 values both not equal to 0, the equation will look a bit more
complex. I.e. for scaling of 0-65535 to a value between -5000 and 10000, the equation will be:
500065535/)15000*_( −= unscalediscaled
Figure 4.4: Scaling of an Analogue input (0-65535 → -5000-10000)
4.24.24.24.2 AnalogAnalogAnalogAnalogueueueue outputsoutputsoutputsoutputs
For analogue outputs the integer values coming from the PLC program should be converted to voltages at
the outputs of the PLC. This conversion is done by a Digital to Analogue Converter, DAC.
Commonly used output ranges for analogue outputs are:
0 – 10 V
-10V – 10V
0 – 20 mA
In the IEC61131-3 standard the integer values going into the DAC are always in the range from 0 – 65535.
Figure 4.5: Analogue outputs
The range from 0 - 65535 usually doesn’t have a direct relation with the controlled system, i.e. a motor
speed from 0 – 1200 rpm. Therefore, as with analogue inputs, analogue outputs should be scaled.
ActuatorDACPLC program
motor speed
0-1200rpm
PLC output
0-10V
o_speed
0-65535
PLC
Process Control Systems with a PLC
15
Figure 4.6: Scaling of an Analogue output (0-12000 → 0-65535)
This scaling can be done by implementing the following equation in the PLC:
12000/)65535*(_ speedspeedo =
For a PLC program written in ST this will look like:
This equation scales the integer-internal ‘speed’ of the PLC to the integer-output ‘o_speed’.
• When ‘speed’ is 0 the result of the equation will be that ‘o_speed’ is also 0, the output voltage of
the PLC will be 0 V (using a 0 – 10 V output) and the motor speed will be set to 0 rpm.
• When ‘speed’ is 12000 the result of the equation will be that ‘o_speed’ is 65535, the output
voltage of the PLC will be 10 V (using a 0 – 10 V output) and the motor speed will be set to 1200
rpm.
It is essential that the value, going to the DAC, never is smaller that 0 or greater that 65535! So it is wise
to limit the output, see the following ST code example:
o_speed := (speed * 65535) / 12000;
IF o_speed < 0 THEN
o_speed := 0;
END_IF;
IF o_speed > 65535 THEN
o_speed := 65535;
END_IF;
o_speed := (speed * 65535) / 12000;
Process Control Systems with a PLC
16
When the value to be scaled is between 2 values both not equal to 0, the equation will look a bit more
complex. I.e. for scaling of values in the range of -5000-10000 to 0 and 65535, the equation will be:
15000/65535*)5000(_ += unscaledscaledo
Figure 4.6: Scaling of an Analogue output (-5000-10000 → 0-65535)
4.34.34.34.3 Filtering of analogFiltering of analogFiltering of analogFiltering of analogueueueue inputsinputsinputsinputs
Because of external influences analogue signals often are disturbed and should be filtered by an analogue
filter (i.e. a RC filter) or a digital filter. The advantage of digital filters is that they are easy to implement in
software (the program) and to modify. Every PLC cycle the analogue input is sampled, using an ADC,
giving a digitised signal (xk). Now a new digital filtered value yk can be calculated, based upon the most
recent input sample, previous input samples and previous calculated output values. The calculated value
can be used in the program or send to an output of the PLC, using a DAC.
Figure 4.7: Signal processing
The general formula of a digital filter is:
∑∑ =
−
=
− +=
m
j
jki
n
i
ikik ybxay
10
..
It is essential that the time between the samples (xk .. xk-n) is always the same. In a PLC this can be easily
achieved by setting the PLC cycle time to a fixed value.
A simple digital filter is a ‘Moving Average Filter’. The formula for a ‘Moving Average Filter’ that calculates
the average of the last 4 samples (n = 3, a0 .. a3 = ¼) is given as:
34
1
24
1
14
1
4
1
.... −−− +++= kkkkk xxxxy
PLC
PLC program
Process Control Systems with a PLC
17
The following ST program gives an example of a moving average filter of 4 samples.
Example
Suppose the PLC reads succeeding values (samples) for ‘speed’ as given in the table below. The table also
shows the succeeding values for ‘x_0’ – ‘x_3’ and ‘speed_maf’. Clearly the filtered value ‘speed_maf’
changes less than the incoming value ‘speed’.
With digital filters it is possible to design and implement filters with characteristics which are very difficult
to achieve with analogue filters. The theory behind digital filter design goes beyond the scope of PLC
programming. However, based on the moving average filter a useful application can be given.
Application
In industrial automations, because of electromagnetic interferences, 50Hz disturbances on analogue
signals are very common. The 50 Hz disturbance is added with the original analogue signal
(superposition) and the signal going into the PLC is disturbed.
By using a 4 sample moving average filter with a sample time, which is the PLC cycle time, of 5 ms (20ms
/ 4) the 50 Hz disturbance can be filtered out completely!
Figure 4.8: Signal with 50 Hz disturbance
In the example given in the figure above the following values will be measured:
….. 260 258 254 256 260 258 254 ……..
Now add 4 succeeding values and divide the result by 4. The final result will always be 257, which is
the level of the original undisturbed signal. The 50Hz is completely filtered out!
x_3 := x_2; (* shift *)
x_2 := x_1; (* previous *)
x_1 := x_0; (* samples *)
x_0 := speed; (* new sample *)
y_0 := (x_0 + x_1 + x_2 + x_3)/4; (* 4 samples moving average *)
speed_maf := y_0;
speed 240 234 250 246 236 247 258 245 238
x_0 240 234 250 246 236 247 258 245 238
x_1 - 240 234 250 246 236 247 258 245
x_2 - - 240 234 250 246 236 247 258
x_3 - - - 240 234 250 246 236 247
speed_maf - - - 242 241 244 247 247 247
Process Control Systems with a PLC
18
4.44.44.44.4 PID control with a PLCPID control with a PLCPID control with a PLCPID control with a PLC
In the figure below a basic example is given of a digital control system for controlling the speed of a
motor. In this example a PLC is used as the basic component to control the speed. The PLC has two inputs
(‘setpoint’ and ‘actual_ speed’) and one output to the Drive of the motor. The actual speed of the motor is
measured with a tachometer.
Figure 4.9: Basic control system
With the ‘setpoint’ a desired speed is given. This speed is compared with the measured ‘actual_speed’,
giving an error signal (error := setpoint – actual_ speed) which is used as an input for the PID controller.
A proportional–integral–derivative controller (PID controller) is a generic control loop feedback mechanism
widely used in industrial control systems. A PID controller attempts to correct the error between a
measured process variable and a desired setpoint by calculating and then outputting a corrective action
that can adjust the process accordingly.
The PID controller calculation (algorithm) involves three separate parameters; the Proportional (P), the
Integral (I) and Derivative (D) values. The Proportional value determines the reaction to the current error,
the Integral value determines the reaction based on the sum of recent errors, and the Derivative value
determines the reaction to the rate at which the error has been changing. The weighted sum of these
three actions is used to adjust the process via a control element such as the position of a control valve or
the power supply of a heating element. By "tuning" the three constants in the PID controller algorithm, the
controller can provide control action designed for specific process requirements.
Because the inputs are coming from the outside of the PLC, they should be scaled and filtered. Also
the output should be scaled.
Figure 4.10: Scaling and filtering added to the inputs and output
PID controllerScale + Filter
setpoint
+
-
actual_speed
Scale
PLC
Scale + Filter
PID controller Motor
Tachometer
setpoint
+
-
actual_speed
Drive
PLC
error
Process Control Systems with a PLC
19
The theory behind PID control goes beyond the scope of PLC programming, however it is good to see
how the basic code will look like. The general equation for a PID controller is:
0
0
)(
)()()( u
dt
tde
TKdtte
T
K
teKtu
t
dp
i
p
p +++= ∫
With: u(t) output
e(t) error input
Kp Contant (P action)
Ti Integrating time (I action)
Td Derivative time (D action)
For digital controllers (such as microprocessors and PLCs) this can be written as:
( ) ( ))2()1(2)()()1()()1()( −+−−++−−+−= tetete
T
TK
te
T
TK
teteKtutu
s
dp
i
sp
p
With: u(t) new output
u(t-1) previous output
e(t) actual error input
e(t-1) error signal of the previous cycle
e(t-2) error signal of two cycles before
Kp Contant (P action)
Ts Sampling time (= PLC cycle time)
Ti Integrating time (I action)
Td Derivative time (D action)
Note that the PLC cycle time is part is this equation, so when the PLC cycle time is changed also
contacts in the equation has to be changed!
The given PID equation can now be simplified:
( ) ( ))2()1(2)()()1()()1()( −+−−++−−+−= teteteKteKteteKtutu dip
In the example below the basic code for a PID controller is given:
Note that the value of the constants KP (proportional), KI (integral) and KD (derivative) should be
determined and set according to your system and requirements.
(* Code example for a PID controller *)
(* IN is the error signal, used as the input for the PID function *)
(* OUT is the output of the PID controller *)
(* x_0, x_1, x_2, y_0 and y1 are variables to retain previous states *)
(* min_v and max_v are values used to limit the output *)
(* KP, KI and KD are the PID constants *)
x_2 := x_1;
x_1 := x_0;
x_0 := IN;
y_1 := y_0;
y_0 := y_1 + (KP*(x_0 – x_1) + KI*x_0 + KD*(x_0 – 2*x_1 + x_2))/1000;
(* limit the PID controller between min_v and max_v *)
IF y_0 < min_v THEN
y_0 := min_v;
END_IF;
IF y_0 > max_v THEN
y_0 := max_v;
END_IF;
OUT:=y_0;
Process Control Systems with a PLC
20
notes

Mais conteúdo relacionado

Mais procurados

Dcs or plc
Dcs or plcDcs or plc
Dcs or plcCh Aamir
 
PPT on INDUSTRIAL AUTOMATION, PLC, SCADA
 PPT on INDUSTRIAL AUTOMATION, PLC, SCADA PPT on INDUSTRIAL AUTOMATION, PLC, SCADA
PPT on INDUSTRIAL AUTOMATION, PLC, SCADAAakashkumar276
 
Industrial automation (PLC, SCADA, VFD & HMI)
Industrial automation (PLC, SCADA, VFD & HMI)Industrial automation (PLC, SCADA, VFD & HMI)
Industrial automation (PLC, SCADA, VFD & HMI)Praveen Ramola
 
PLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
PLC, DCS and PLC vs DCS Presentation by Jitender Singh ShekhawatPLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
PLC, DCS and PLC vs DCS Presentation by Jitender Singh ShekhawatJitender Singh Shekhawat
 
Introduction Industrial automation
Introduction Industrial automationIntroduction Industrial automation
Introduction Industrial automationFarid MUSA
 
Industrial Training on PLC SCADA HMI for fresher engineers
Industrial Training on PLC SCADA HMI for fresher engineersIndustrial Training on PLC SCADA HMI for fresher engineers
Industrial Training on PLC SCADA HMI for fresher engineersSneha Yadav
 
Power point presentation on Industrial Automation
Power point presentation on Industrial AutomationPower point presentation on Industrial Automation
Power point presentation on Industrial AutomationJaiPrakash337
 
An industrial automation satyaaaa
An industrial automation  satyaaaaAn industrial automation  satyaaaa
An industrial automation satyaaaasatyarout9090
 
Industrial Automation Field Level
Industrial Automation Field LevelIndustrial Automation Field Level
Industrial Automation Field LevelRamaniIA
 
Industrial automation - Sensors and Transducers
Industrial automation - Sensors and TransducersIndustrial automation - Sensors and Transducers
Industrial automation - Sensors and TransducersRamaniIA
 
automation plc - scada
automation plc - scadaautomation plc - scada
automation plc - scadaSaif Akhtar
 
Industrial Automation (PLC, SCADA & HMI) by Nilesh Jha
Industrial Automation (PLC, SCADA & HMI) by Nilesh JhaIndustrial Automation (PLC, SCADA & HMI) by Nilesh Jha
Industrial Automation (PLC, SCADA & HMI) by Nilesh JhaNilesh Jha
 
Industrial Automation - Introduction
Industrial Automation - IntroductionIndustrial Automation - Introduction
Industrial Automation - IntroductionRamaniIA
 
PLC and SCADA in Industrial Automation
PLC and SCADA in Industrial AutomationPLC and SCADA in Industrial Automation
PLC and SCADA in Industrial AutomationNikhil nnk
 
Chapter 1 introduction to automation
Chapter 1   introduction  to automationChapter 1   introduction  to automation
Chapter 1 introduction to automationMohamad Sahiedan
 

Mais procurados (20)

Dcs or plc
Dcs or plcDcs or plc
Dcs or plc
 
PPT on INDUSTRIAL AUTOMATION, PLC, SCADA
 PPT on INDUSTRIAL AUTOMATION, PLC, SCADA PPT on INDUSTRIAL AUTOMATION, PLC, SCADA
PPT on INDUSTRIAL AUTOMATION, PLC, SCADA
 
Industrial automation (PLC, SCADA, VFD & HMI)
Industrial automation (PLC, SCADA, VFD & HMI)Industrial automation (PLC, SCADA, VFD & HMI)
Industrial automation (PLC, SCADA, VFD & HMI)
 
What is use of PLC in industry?
What is use of PLC in industry?What is use of PLC in industry?
What is use of PLC in industry?
 
PLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
PLC, DCS and PLC vs DCS Presentation by Jitender Singh ShekhawatPLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
PLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
 
Introduction Industrial automation
Introduction Industrial automationIntroduction Industrial automation
Introduction Industrial automation
 
Industrial Training on PLC SCADA HMI for fresher engineers
Industrial Training on PLC SCADA HMI for fresher engineersIndustrial Training on PLC SCADA HMI for fresher engineers
Industrial Training on PLC SCADA HMI for fresher engineers
 
Power point presentation on Industrial Automation
Power point presentation on Industrial AutomationPower point presentation on Industrial Automation
Power point presentation on Industrial Automation
 
An industrial automation satyaaaa
An industrial automation  satyaaaaAn industrial automation  satyaaaa
An industrial automation satyaaaa
 
Industrial Automation Field Level
Industrial Automation Field LevelIndustrial Automation Field Level
Industrial Automation Field Level
 
Working of DCS systems
Working of DCS systemsWorking of DCS systems
Working of DCS systems
 
Scada & hmi
Scada & hmiScada & hmi
Scada & hmi
 
Industrial automation - Sensors and Transducers
Industrial automation - Sensors and TransducersIndustrial automation - Sensors and Transducers
Industrial automation - Sensors and Transducers
 
automation plc - scada
automation plc - scadaautomation plc - scada
automation plc - scada
 
Industrial Automation (PLC, SCADA & HMI) by Nilesh Jha
Industrial Automation (PLC, SCADA & HMI) by Nilesh JhaIndustrial Automation (PLC, SCADA & HMI) by Nilesh Jha
Industrial Automation (PLC, SCADA & HMI) by Nilesh Jha
 
Industrial Automation - Introduction
Industrial Automation - IntroductionIndustrial Automation - Introduction
Industrial Automation - Introduction
 
PLC and SCADA in Industrial Automation
PLC and SCADA in Industrial AutomationPLC and SCADA in Industrial Automation
PLC and SCADA in Industrial Automation
 
Chapter 1 introduction to automation
Chapter 1   introduction  to automationChapter 1   introduction  to automation
Chapter 1 introduction to automation
 
6 Month Industrial Automation Training
6 Month Industrial Automation Training6 Month Industrial Automation Training
6 Month Industrial Automation Training
 
Industrial automation
Industrial automationIndustrial automation
Industrial automation
 

Destaque

Introduction of process control
Introduction of process controlIntroduction of process control
Introduction of process controlchemical ppt
 
Industrial process control
Industrial process controlIndustrial process control
Industrial process controlMohamed A Hakim
 
PES: An Innovative Approach to Process Control Systems (and Energy Managemen...
 PES: An Innovative Approach to Process Control Systems (and Energy Managemen... PES: An Innovative Approach to Process Control Systems (and Energy Managemen...
PES: An Innovative Approach to Process Control Systems (and Energy Managemen...Schneider Electric
 
Basic Concepts for an Integrated Steel Process Control System
Basic Concepts for an Integrated Steel Process Control SystemBasic Concepts for an Integrated Steel Process Control System
Basic Concepts for an Integrated Steel Process Control SystemSchneider Electric
 
Statistical process control technique with example - xbar chart and R chart
Statistical process control technique with example - xbar chart and R chartStatistical process control technique with example - xbar chart and R chart
Statistical process control technique with example - xbar chart and R chartkevin Richard
 
Sucker rod pumping short course!!! ~downhole diagnostic
Sucker rod pumping short course!!!   ~downhole diagnosticSucker rod pumping short course!!!   ~downhole diagnostic
Sucker rod pumping short course!!! ~downhole diagnosticenLightNme888
 
Process Control Power Point
Process Control Power PointProcess Control Power Point
Process Control Power Pointjjhaefner
 
Variable frequency drives rod pump control podcast
Variable frequency drives rod pump control podcastVariable frequency drives rod pump control podcast
Variable frequency drives rod pump control podcastSchneider Electric
 
Chapter 2 Power Supply
Chapter 2 Power SupplyChapter 2 Power Supply
Chapter 2 Power Supplyaskme
 
A Power Supply (Complete)
A Power Supply (Complete)A Power Supply (Complete)
A Power Supply (Complete)Arif Nazeer
 
Power Supply Project
Power Supply ProjectPower Supply Project
Power Supply Projectusmanhadi91
 
Basic concepts in computer security
Basic concepts in computer securityBasic concepts in computer security
Basic concepts in computer securityArzath Areeff
 
automatic mixing & filling bottle using PLC
automatic mixing & filling bottle using PLCautomatic mixing & filling bottle using PLC
automatic mixing & filling bottle using PLCLeelu Veerendra Pulagam
 
analysis and design of information system
analysis and design of information systemanalysis and design of information system
analysis and design of information systemRenu Sharma
 
Parking Control System using PLC
Parking Control System using PLCParking Control System using PLC
Parking Control System using PLCZunAib Ali
 
Process Instrumentation & Control
Process Instrumentation & ControlProcess Instrumentation & Control
Process Instrumentation & ControlZin Eddine Dadach
 
Ppt on automation
Ppt on automation Ppt on automation
Ppt on automation harshaa
 

Destaque (20)

Introduction of process control
Introduction of process controlIntroduction of process control
Introduction of process control
 
Industrial process control
Industrial process controlIndustrial process control
Industrial process control
 
PES: An Innovative Approach to Process Control Systems (and Energy Managemen...
 PES: An Innovative Approach to Process Control Systems (and Energy Managemen... PES: An Innovative Approach to Process Control Systems (and Energy Managemen...
PES: An Innovative Approach to Process Control Systems (and Energy Managemen...
 
Process Control Systems - VE2013
Process Control Systems - VE2013Process Control Systems - VE2013
Process Control Systems - VE2013
 
Basic Concepts for an Integrated Steel Process Control System
Basic Concepts for an Integrated Steel Process Control SystemBasic Concepts for an Integrated Steel Process Control System
Basic Concepts for an Integrated Steel Process Control System
 
Statistical process control technique with example - xbar chart and R chart
Statistical process control technique with example - xbar chart and R chartStatistical process control technique with example - xbar chart and R chart
Statistical process control technique with example - xbar chart and R chart
 
Sucker rod pumping short course!!! ~downhole diagnostic
Sucker rod pumping short course!!!   ~downhole diagnosticSucker rod pumping short course!!!   ~downhole diagnostic
Sucker rod pumping short course!!! ~downhole diagnostic
 
Process Control Power Point
Process Control Power PointProcess Control Power Point
Process Control Power Point
 
Variable frequency drives rod pump control podcast
Variable frequency drives rod pump control podcastVariable frequency drives rod pump control podcast
Variable frequency drives rod pump control podcast
 
Chapter 2 Power Supply
Chapter 2 Power SupplyChapter 2 Power Supply
Chapter 2 Power Supply
 
A Power Supply (Complete)
A Power Supply (Complete)A Power Supply (Complete)
A Power Supply (Complete)
 
Power Supply Project
Power Supply ProjectPower Supply Project
Power Supply Project
 
Basic concepts in computer security
Basic concepts in computer securityBasic concepts in computer security
Basic concepts in computer security
 
automatic mixing & filling bottle using PLC
automatic mixing & filling bottle using PLCautomatic mixing & filling bottle using PLC
automatic mixing & filling bottle using PLC
 
analysis and design of information system
analysis and design of information systemanalysis and design of information system
analysis and design of information system
 
Parking Control System using PLC
Parking Control System using PLCParking Control System using PLC
Parking Control System using PLC
 
Process Instrumentation & Control
Process Instrumentation & ControlProcess Instrumentation & Control
Process Instrumentation & Control
 
Computer Security
Computer SecurityComputer Security
Computer Security
 
PLC - Programmable Logic Controller
PLC - Programmable Logic ControllerPLC - Programmable Logic Controller
PLC - Programmable Logic Controller
 
Ppt on automation
Ppt on automation Ppt on automation
Ppt on automation
 

Semelhante a Process control systems with a plc 1.0.2

Meeting the challenges to adopt visual production management systems hms-whit...
Meeting the challenges to adopt visual production management systems hms-whit...Meeting the challenges to adopt visual production management systems hms-whit...
Meeting the challenges to adopt visual production management systems hms-whit...Ariel Lerer
 
Smart factory IIoT and automation data flow architecture v1.0
Smart factory IIoT and automation data flow architecture v1.0Smart factory IIoT and automation data flow architecture v1.0
Smart factory IIoT and automation data flow architecture v1.0Angel Rodríguez Gil
 
Avanced process control enteprise management system
Avanced process control enteprise management systemAvanced process control enteprise management system
Avanced process control enteprise management systemGyan Prakash
 
Holistic quality management
Holistic quality managementHolistic quality management
Holistic quality managementselinasimpson321
 
Basics of mes
Basics of mesBasics of mes
Basics of mesumaydeo
 
Effective Software Effort Estimation Leveraging Machine Learning for Digital ...
Effective Software Effort Estimation Leveraging Machine Learning for Digital ...Effective Software Effort Estimation Leveraging Machine Learning for Digital ...
Effective Software Effort Estimation Leveraging Machine Learning for Digital ...Shakas Technologies
 
A Real-Time Information System For Multivariate Statistical Process Control
A Real-Time Information System For Multivariate Statistical Process ControlA Real-Time Information System For Multivariate Statistical Process Control
A Real-Time Information System For Multivariate Statistical Process ControlAngie Miller
 
Simplify Data Center Monitoring With a Single-Pane View
Simplify Data Center Monitoring With a Single-Pane ViewSimplify Data Center Monitoring With a Single-Pane View
Simplify Data Center Monitoring With a Single-Pane ViewHitachi Vantara
 
MES (Manufacturing Execution System) Pocket Guide
MES (Manufacturing Execution System) Pocket GuideMES (Manufacturing Execution System) Pocket Guide
MES (Manufacturing Execution System) Pocket GuideVera Leonik-Shilyaeva
 
Construction of Supervisory Control and Data Acquisition in Shop-level based ...
Construction of Supervisory Control and Data Acquisition in Shop-level based ...Construction of Supervisory Control and Data Acquisition in Shop-level based ...
Construction of Supervisory Control and Data Acquisition in Shop-level based ...IJRES Journal
 
Clearpriority Operational Intelligence Platform
Clearpriority Operational Intelligence PlatformClearpriority Operational Intelligence Platform
Clearpriority Operational Intelligence PlatformClearpriority
 
Advantages of Electronic Permit System
Advantages of Electronic Permit SystemAdvantages of Electronic Permit System
Advantages of Electronic Permit SystemOlivia Wilson
 
Whitepaper DPE.pptx
Whitepaper DPE.pptxWhitepaper DPE.pptx
Whitepaper DPE.pptxAndyPenfold2
 
3E’s Approach to Business Process Management Solutions
3E’s Approach to Business Process Management Solutions3E’s Approach to Business Process Management Solutions
3E’s Approach to Business Process Management Solutions3E Software Solutions
 
ERP Industrial Planning
ERP  Industrial PlanningERP  Industrial Planning
ERP Industrial PlanningKiril Iliev
 
Types of Process control system
Types of Process control systemTypes of Process control system
Types of Process control systemArul Kumar
 
BACnet & Building Analytics
BACnet & Building AnalyticsBACnet & Building Analytics
BACnet & Building AnalyticsFiras Obeido
 
The Evolution of Digital Control Towers in Supply Chain
The Evolution of Digital Control Towers in Supply ChainThe Evolution of Digital Control Towers in Supply Chain
The Evolution of Digital Control Towers in Supply ChainTredence Inc
 
Interoperability with HMI Systems Enables Leaner Asset Management
Interoperability with HMI Systems Enables Leaner Asset ManagementInteroperability with HMI Systems Enables Leaner Asset Management
Interoperability with HMI Systems Enables Leaner Asset ManagementeRPortal Software Group
 

Semelhante a Process control systems with a plc 1.0.2 (20)

Meeting the challenges to adopt visual production management systems hms-whit...
Meeting the challenges to adopt visual production management systems hms-whit...Meeting the challenges to adopt visual production management systems hms-whit...
Meeting the challenges to adopt visual production management systems hms-whit...
 
Smart factory IIoT and automation data flow architecture v1.0
Smart factory IIoT and automation data flow architecture v1.0Smart factory IIoT and automation data flow architecture v1.0
Smart factory IIoT and automation data flow architecture v1.0
 
Avanced process control enteprise management system
Avanced process control enteprise management systemAvanced process control enteprise management system
Avanced process control enteprise management system
 
Holistic quality management
Holistic quality managementHolistic quality management
Holistic quality management
 
Basics of mes
Basics of mesBasics of mes
Basics of mes
 
Effective Software Effort Estimation Leveraging Machine Learning for Digital ...
Effective Software Effort Estimation Leveraging Machine Learning for Digital ...Effective Software Effort Estimation Leveraging Machine Learning for Digital ...
Effective Software Effort Estimation Leveraging Machine Learning for Digital ...
 
A Real-Time Information System For Multivariate Statistical Process Control
A Real-Time Information System For Multivariate Statistical Process ControlA Real-Time Information System For Multivariate Statistical Process Control
A Real-Time Information System For Multivariate Statistical Process Control
 
It housekeeping
It housekeepingIt housekeeping
It housekeeping
 
Simplify Data Center Monitoring With a Single-Pane View
Simplify Data Center Monitoring With a Single-Pane ViewSimplify Data Center Monitoring With a Single-Pane View
Simplify Data Center Monitoring With a Single-Pane View
 
MES (Manufacturing Execution System) Pocket Guide
MES (Manufacturing Execution System) Pocket GuideMES (Manufacturing Execution System) Pocket Guide
MES (Manufacturing Execution System) Pocket Guide
 
Construction of Supervisory Control and Data Acquisition in Shop-level based ...
Construction of Supervisory Control and Data Acquisition in Shop-level based ...Construction of Supervisory Control and Data Acquisition in Shop-level based ...
Construction of Supervisory Control and Data Acquisition in Shop-level based ...
 
Clearpriority Operational Intelligence Platform
Clearpriority Operational Intelligence PlatformClearpriority Operational Intelligence Platform
Clearpriority Operational Intelligence Platform
 
Advantages of Electronic Permit System
Advantages of Electronic Permit SystemAdvantages of Electronic Permit System
Advantages of Electronic Permit System
 
Whitepaper DPE.pptx
Whitepaper DPE.pptxWhitepaper DPE.pptx
Whitepaper DPE.pptx
 
3E’s Approach to Business Process Management Solutions
3E’s Approach to Business Process Management Solutions3E’s Approach to Business Process Management Solutions
3E’s Approach to Business Process Management Solutions
 
ERP Industrial Planning
ERP  Industrial PlanningERP  Industrial Planning
ERP Industrial Planning
 
Types of Process control system
Types of Process control systemTypes of Process control system
Types of Process control system
 
BACnet & Building Analytics
BACnet & Building AnalyticsBACnet & Building Analytics
BACnet & Building Analytics
 
The Evolution of Digital Control Towers in Supply Chain
The Evolution of Digital Control Towers in Supply ChainThe Evolution of Digital Control Towers in Supply Chain
The Evolution of Digital Control Towers in Supply Chain
 
Interoperability with HMI Systems Enables Leaner Asset Management
Interoperability with HMI Systems Enables Leaner Asset ManagementInteroperability with HMI Systems Enables Leaner Asset Management
Interoperability with HMI Systems Enables Leaner Asset Management
 

Último

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 

Último (20)

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 

Process control systems with a plc 1.0.2

  • 1. Process Control SystemsProcess Control SystemsProcess Control SystemsProcess Control Systems with a PLCwith a PLCwith a PLCwith a PLC
  • 2. Saxion University of Applied Sciences J.W. van Dijk Version 1.0.2 September 2013 © Saxion. All rights reserved. Nothing from this publication may be copied, stored in an automated information file, or made public, in any form or in any manner, either electronic, mechanical, through photocopying, recording or any other way, without previous written permission from the publisher.
  • 3. Process Control Systems with a PLC 1 ContentsContentsContentsContents AbbreviationsAbbreviationsAbbreviationsAbbreviations ....................................................................................................................... 2 1111 IntroductionIntroductionIntroductionIntroduction ......................................................................................................................... 3 2222 Three layer model of a factoryThree layer model of a factoryThree layer model of a factoryThree layer model of a factory ............................................................................................. 4 2.1 Enterprise control .................................................................................................... 5 2.2 Factory control ......................................................................................................... 6 2.3 Automation and shop-floor control ......................................................................... 9 3333 TraditionalTraditionalTraditionalTraditional control versus PLC controlcontrol versus PLC controlcontrol versus PLC controlcontrol versus PLC control .............................................................................. 10 4444 PLC controlPLC controlPLC controlPLC control ....................................................................................................................... 12 4.1 Analogue inputs ................................................................................................... 13 4.2 Analogue outputs ................................................................................................ 15 4.3 Filtering of analogue inputs ................................................................................. 15 4.4 PID control with a PLC .......................................................................................... 17
  • 4. Process Control Systems with a PLC 2 AbbreviationsAbbreviationsAbbreviationsAbbreviations ADC Analogue to Digital Converter B2B Business to Business CAD Computer Aided Design CAM Computer Added Manufacturing CIM Computer Integrated Manufacturing DAC Digital to Analogue Converter DCS Digital Control System ERP Enterprise Resource Planning FBD Function Block Diagram I/O Input/Output ISO International Standardisation Organisation IS Information Systems IT Information Technology LIMS Laboratory Information Management System MES Manufacturing Execution System OSI Open System Interconnection PLC Programmable Logic Controller PID Proportional–Integral–Derivative SCADA Supervisory Control And Data Acquisition SPC Statistical Process Control SQC Statistical Quality Control ST Structured Text VSD Variable Speed Drive
  • 5. Process Control Systems with a PLC 3 1111 IntroductionIntroductionIntroductionIntroduction Presently a Programmable Logic Controller (PLC) is still the basic component in automation. A PLC can be found in the lower level of the automation and is the basic component for process control systems and automation . Figure 1.1: PLC, the basic component in automation Before we can have a look at the PLC, first a better understanding of the different layers in an industrial environment is essential.
  • 6. Process Control Systems with a PLC 4 2222 Three layer model of a factoryThree layer model of a factoryThree layer model of a factoryThree layer model of a factory In the current economic climate, doing more for less is often management’s mandate. Plant floor and manufacturing information technology (IT) staffs are under pressure to show quick results and solve problems with increasingly lean budgets. While that’s a tall order, it is not impossible, provided there’s an up- front investment in time to produce detailed, specific goals and to truly understand what’s needed. Focused, cross-functional teams that implement flexible and scalable information systems (IS) can deliver a smooth, lean manufacturing process. When integrating new technology into an existing facility, always three things should be considered: the hard infrastructure, the soft infrastructure, and information flow. Hard infrastructure includes client and server hardware and network infrastructure. Soft infrastructure includes operating systems, existing or legacy software, needed code customisations, and the human resources to run/support the system. Information flow includes how data in the new system interacts with legacy systems and what legacy data the new system will require, as well as who will want to receive/access the information that is held by the system. Tracking the information flow within a manufacturing process involves three main layers of control: the entire enterprise, the factory or facility as a whole, and the shop floor. Figure 2.1: A manufacturer's three control layers
  • 7. Process Control Systems with a PLC 5 2.12.12.12.1 Enterprise ControlEnterprise ControlEnterprise ControlEnterprise Control The enterprise control layer, Enterprise Resource Planning (ERP), is the management layer and has business-to-business (B2B) tools surrounding it in order to communicate data from one enterprise to other. The B2B tools overlap into the factory control layer because they can enable data exchange among facilities, customers and suppliers. Within the enterprise layer we also find tools for enterprise resource planning, supply chain management, customer response management, and document control. Data communication in this layer can be characterized by: • Large amounts of data, file transfer • Not very frequent, low refresh rate Major suppliers of ERP products are: • Oracle • SAP • Baan Figure 2.2: Suppliers of ERP software
  • 8. Process Control Systems with a PLC 6 2.22.22.22.2 Factory controlFactory controlFactory controlFactory control The factory control layer controls manufacturing floor processes. Manufacturing Execution System (MES) is a collection of software functions which are distinct from those included in ERP, CAD/CAM and Industrial Controls. The uniqueness of functionality is an added benefit because it complements the functionalities that exist in the other systems. The focus of MES is operations, especially production operations. MES coordinates all manufacturing data related to operations at a plant wide level. Supervisory control and data acquisition, recipe management, and advanced planning and scheduling tools add to the MES functionality by providing tighter factory floor controls. DescriptioDescriptioDescriptioDescriptionnnn "Manufacturing Execution Systems deliver information enabling the optimisation of production activities from order launch to finished goods. Using current and accurate data, MES guides, initiates, responds to, and reports on plant activities as they occur. The resulting rapid response to changing conditions, coupled with a focus on reducing non-value-added activities, drives effective plant operations and processes. MES improves the return on operational assets as well as on-time delivery, inventory turns, gross margin, and cash flow performance. MES provides mission-critical information about production activities across the enterprise and supply chain via bi-directional communications." The concept of MES is widely recognized and used in manufacturing sectors such as automotive, semiconductor, electronics, food processing, pharmaceuticals, aerospace, medical devices, textiles. Elements such as scheduling, maintenance management, quality, and time and attendance fall within the scope of MES and are used in all industries. The figure below shows the place that is being occupied by MES. While other activities of manufacturing enterprises like CAD, Controls, ERP, etc. have been helped by computer-based applications for a long time, the areas related with production operations haven't received so much attention. Figure 2.3: Plant Information Model
  • 9. Process Control Systems with a PLC 7 Manufacturing Execution Systems are an essential component of operations in today's competitive business environments, which require greater production efficiency and effectiveness. MES focuses on the valuing-adding processes, helping to reduce manufacturing cycle time, improve product quality, reduce or eliminate paperwork between shifts, reduce lead time, and empowering plant operations staff. This section includes an overview of MES and quotes from users. Figure 2.4: MES Functional Model MES is of particular value to operational management. Functions include resource allocation and status, dispatching production units, data collection/acquisition, quality management, maintenance management, performance analysis, operations/detail scheduling, document control, labour management, process management and product tracking and genealogy. These functions are described more fully below. Resource Allocation and Status:Resource Allocation and Status:Resource Allocation and Status:Resource Allocation and Status: Manages resources including machines, tools, labour skills, materials, other equipment, and other entities such as documents that must be available in order for work to start at the operation. It provides detailed history of resources and insures that equipment is properly set up for processing and provides status real time. The management of these resources includes reservation and dispatching to meet operation scheduling objectives. Operations/Detail Scheduling:Operations/Detail Scheduling:Operations/Detail Scheduling:Operations/Detail Scheduling: Provides sequencing based on priorities, attributes, characteristics, and/or recipes associated with specific production units at an operation such as shape, colour sequencing, or other characteristics that, when scheduled in sequence properly, minimize set-up. It is finite and it recognizes alternative and overlapping/parallel operations in order to calculate, in detail, exact time of equipment loading adjusted to shift patterns.
  • 10. Process Control Systems with a PLC 8 DisDisDisDispatching Production Units:patching Production Units:patching Production Units:patching Production Units: Manages flow of production units in the form of jobs, orders, batches, lots, and work orders. Dispatch information is presented in the sequence in which the work needs to be done and changes in real time as events occur on the factory floor. It has the ability to alter the prescribed schedule on the factory floor. Rework and salvage processes are available, as well as the ability to control the amount of work in process at any point with buffer management. Document Control:Document Control:Document Control:Document Control: Controls records/forms that must be maintained with the production unit, including work instructions, recipes, drawings, standard operation procedures, part programs, batch records, engineering change notices, shift-to-shift communication, as well as the ability to edit "as planned" and "as built" information. It sends instructions down to the operations, including providing data to operators or recipes to device controls. It might also include the control and integrity of environmental, health and safety regulations, and ISO information such as Corrective Action procedures. Storage of historical data is provided. Data Collection/Acquisition:Data Collection/Acquisition:Data Collection/Acquisition:Data Collection/Acquisition: This function provides an interface link to obtain the inter-operational production and parametric data that populate the forms and records that were attached to the production unit. The data may be collected from the factory floor either manually or automatically from equipment in an up-to-the-minute time frame. Labour Management:Labour Management:Labour Management:Labour Management: Provides status of personnel in an up-to-the-minute time frame. It includes time and attendance reporting, certification tracking, as well as the ability to track indirect activities such as material preparation or tool room work as a basis for activity based costing. It may interact with resource allocation to determine optimal assignments. Quality Management:Quality Management:Quality Management:Quality Management: Provides real time analysis of measurements collected from manufacturing to assure proper product quality control and to identify problems requiring attention. It may recommend action to correct the problem, including correlating the symptom, actions and results to determine the cause. May include SPC/SQC tracking and management of off-line inspection operations, and analysis from a laboratory information management system (LIMS) could also be included. Process Management:Process Management:Process Management:Process Management: Monitors production and either automatically corrects or provides decision support to operators for correcting and improving in-process activities. These activities may be inter-operational and focus specifically on machines or equipment being monitored and controlled, as well as intra- operational, which is tracking the process from one operation to the next. It may include alarm management to make sure factory personnel are aware of process changes that are outside acceptable tolerances. It provides interfaces between intelligent equipment and MES, possibly through Data Collection/Acquisition. Maintenance Management:Maintenance Management:Maintenance Management:Maintenance Management: Tracks and directs the activities to maintain the equipment and tools to insure their availability for manufacturing and insure scheduling for periodic or preventive maintenance. Also provides the response (alarms) to immediate problems. It maintains a history of past events or problems to aid in diagnosing problems. Product Tracking and Genealogy:Product Tracking and Genealogy:Product Tracking and Genealogy:Product Tracking and Genealogy: Provides the visibility to where work is at all times and its disposition. Status information may include who is working on it; components, materials by supplier, lot, serial number, current production conditions, and any alarms, rework, or other exceptions related to the product. The on-line tracking function creates a historical record, as well. This record allows trace ability of components and usage of each end product. Performance Analysis:Performance Analysis:Performance Analysis:Performance Analysis: Provides up-to-the-minute reporting of actual manufacturing operations results along with the comparison to past history and expected business results. Performance results include such measurements as resource utilization, resource availability, product unit cycle time, conformance to schedule and performance to standards. It may include SPC/SQC. Performance Analysis draws on information gathered from different functions that measure operating parameters. These results may be prepared as a periodic report or presented on-line as current evaluation of performance.
  • 11. Process Control Systems with a PLC 9 2.32.32.32.3 Automation and shopAutomation and shopAutomation and shopAutomation and shop----floor controlfloor controlfloor controlfloor control The automation and shop floor control layers are directly responsible for controlling each step in the manufacturing process. Computer-Integrated Manufacturing (CIM) is a vital piece of this layer because it provides in its controlling layers a generic view of the manufacturing process. CIM architectures must be flexible to manage rapid changes on the factory floor. The idea is CIM can make up the difference MES lacks. This level has a variety of clients, including machines, operators, engineers, and supervisors. Here we find Control Panels (e.g. Touch Screens), PLC’s, sensors and actuators. Typical data communication characteristics for this layer are: • High update frequencies • Small amount of data Figure 2.5: Touch-screen Figure 2.6: PLCs Figure 2.7: Sensors and actuators .
  • 12. Process Control Systems with a PLC 10 3333 TraditionalTraditionalTraditionalTraditional control versus PLC controlcontrol versus PLC controlcontrol versus PLC controlcontrol versus PLC control A traditional scheme to start and stop a motor is given in the figure below. Here a motor can be started by closing ‘S2’. When ‘S2’ is closed the relay ‘K1’ will be activated, its contacts will be closed, and the motor will run. By using a feedback signal, one of the contacts, from the relay ‘K1’ the motor will continue running when the start button ‘S2’ is released. The motor will run until ‘S1’ is pressed, it will be opened, or an over-temperature situation occurs, ‘F3’ is opened. Figure 3.1: Basic scheme for a motor control Note that in the scheme two different types of contacts are used: Normally Open (NO) contact. This type of contact usually is used for a start. Note that in case of a wiring problem the motor can not be started and also will not start automatically (save operation) Normally Closed (NC) contact. This type of contact usually is used for a stop. Note that in case of a wiring problem the motor automatically will be stopped (save operation) The same functionality implemented in a PLC will look like shown in the figure below. Figure 3.2: Basic control with a PLC Note that the feedback of the relay ‘K1’ is not an input for the PLC in the scheme. The feedback now can be done inside the PLC. In the PLC the following function has to be implemented to obtain the same functionality as in figure 3.1: K1 = F3 AND S1 AND (S2 OR K1) PLC S2 F3S1 K1 inputs outputs
  • 13. Process Control Systems with a PLC 11 For a PLC program written in ST this will look like: In FBD this function will look like: Figure 3.3: FBD program By connecting the PLC to a process computer the start and stop buttons can be omitted or an additional start or stop location is added. Also the status of the motor can be visualised. Figure 3.4: Connecting the PLC to a process computer With this functionality the motor can only be started or stopped. Modern applications however desire very often that the speed of the motor can be controlled at any value between 0 (stopped) and a maximum speed. ≥1 & K1 F3 S1 S2 K1 := F3 AND S1 AND (S2 OR K1);
  • 14. Process Control Systems with a PLC 12 4444 PLC controlPLC controlPLC controlPLC control A PLC is very often used to control systems with analogue signals, i.e. temperature, motor speed, flow, or pressure. The analogue signals can be divided in inputs, for measurement or setpoints, or outputs, to control and visualize. Inputs are signals coming from the system and going into the PLC, outputs are signals going from the PLC into the system. In the figure below a basic control system with a PLC is given. In this system the PLC controls the speed of a motor. The required speed (setpoint) of the motor is an input for the PLC. The PLC sets its output to a certain value, in accordance with the setpoint. Because the output of the PLC is always a low voltage output this signal is amplified, using a Variable Speed Drive (VSD). The actual speed of the motor is measured with a speed sensor, which output is connected to the input of the PLC. The PLC gives the actual speed as an output, to i.e. a process computer, for visualisation. Figure 4.1: PLC control system of a motor with analogue inputs and outputs In this example the inputs and outputs of the PLC are analogue, continuous voltages between a minimum and a maximum value. Before analogue inputs can be handled by the software (program) they must be converted. Also outputs needs to be converted. Drive PLC MotorSpeed sensor PLC outputPLC input required speed (setpoint) actual_speed
  • 15. Process Control Systems with a PLC 13 4.14.14.14.1 AnalogAnalogAnalogAnalogueueueue inputsinputsinputsinputs Analogue inputs should be converted to integers before they can be handled by the software. This conversion is done by an Analogue to Digital Converter, ADC. Commonly used input ranges for analogue inputs are: 0 – 10 V -10V – 10V 0 – 20 mA In the IEC61131-3 standard for programming PLCs an analogue input is always converted to an integer value between 0 and 65535. This is the maximum of a 16 bit number (216-1). Example: a tachometer can measure the speed of a motor in the range from 0 rpm – 1200 rpm. The output of the tachometer is in the range of 0 – 10V which is going to the input of the PLC. In the PLC the incoming voltage is converted by the ADC to an integer value in the range from 0 – 65535. Figure 4.2: Analogue inputs In the program an integer value between 0 and 65535 doesn’t have a direct relation with the actual speed, i.e. a speed of 1000 rpm would be in the program a value of 54612. It is much easier if the value in the program would also be in the range from 0 – 1200, so the input in the range from 0 – 65535 should be scaled to a value in the range from 0 – 1200. However by scaling down an incoming value of 65535 to 1200 a lot of information would be lost. It is better to scale 65535 down to 12000 (in fact 1200.0), the accuracy now is ten times better. Figure 4.3: Scaling of an Analogue input (0-65535 → 0-12000) This scaling can be done by implementing the following equation in the PLC: 65535/)12000*_( speedispeed = For a PLC program written in ST this will look like: speed := (i_speed * 12000) / 65535; Tachometer ADC PLC program motor speed 0-1200rpm PLC input 0-10V i_speed 0-65535 PLC
  • 16. Process Control Systems with a PLC 14 This equation scales the integer-input ‘i_speed’ of the PLC and assigns it to the integer-internal ‘speed’: • When the motor speed is 0 rpm the analogue input of the PLC will be 0 V. This input is converted to the integer-input ‘i_speed’ value of 0 (using a 0 – 10V input). The result of the equation will be also 0, which is assigned to the integer- internal ‘speed’ of the PLC. • When the motor speed is 1200 rpm the analogue input of the PLC will be 10 V. This input is converted to the integer-input ‘i_speed’ value of 65535 (using a 0 – 10V input). The result of the equation will now be 12000, which is assigned to the integer- internal ‘speed’ of the PLC. When the result of the scaling is between 2 values both not equal to 0, the equation will look a bit more complex. I.e. for scaling of 0-65535 to a value between -5000 and 10000, the equation will be: 500065535/)15000*_( −= unscalediscaled Figure 4.4: Scaling of an Analogue input (0-65535 → -5000-10000) 4.24.24.24.2 AnalogAnalogAnalogAnalogueueueue outputsoutputsoutputsoutputs For analogue outputs the integer values coming from the PLC program should be converted to voltages at the outputs of the PLC. This conversion is done by a Digital to Analogue Converter, DAC. Commonly used output ranges for analogue outputs are: 0 – 10 V -10V – 10V 0 – 20 mA In the IEC61131-3 standard the integer values going into the DAC are always in the range from 0 – 65535. Figure 4.5: Analogue outputs The range from 0 - 65535 usually doesn’t have a direct relation with the controlled system, i.e. a motor speed from 0 – 1200 rpm. Therefore, as with analogue inputs, analogue outputs should be scaled. ActuatorDACPLC program motor speed 0-1200rpm PLC output 0-10V o_speed 0-65535 PLC
  • 17. Process Control Systems with a PLC 15 Figure 4.6: Scaling of an Analogue output (0-12000 → 0-65535) This scaling can be done by implementing the following equation in the PLC: 12000/)65535*(_ speedspeedo = For a PLC program written in ST this will look like: This equation scales the integer-internal ‘speed’ of the PLC to the integer-output ‘o_speed’. • When ‘speed’ is 0 the result of the equation will be that ‘o_speed’ is also 0, the output voltage of the PLC will be 0 V (using a 0 – 10 V output) and the motor speed will be set to 0 rpm. • When ‘speed’ is 12000 the result of the equation will be that ‘o_speed’ is 65535, the output voltage of the PLC will be 10 V (using a 0 – 10 V output) and the motor speed will be set to 1200 rpm. It is essential that the value, going to the DAC, never is smaller that 0 or greater that 65535! So it is wise to limit the output, see the following ST code example: o_speed := (speed * 65535) / 12000; IF o_speed < 0 THEN o_speed := 0; END_IF; IF o_speed > 65535 THEN o_speed := 65535; END_IF; o_speed := (speed * 65535) / 12000;
  • 18. Process Control Systems with a PLC 16 When the value to be scaled is between 2 values both not equal to 0, the equation will look a bit more complex. I.e. for scaling of values in the range of -5000-10000 to 0 and 65535, the equation will be: 15000/65535*)5000(_ += unscaledscaledo Figure 4.6: Scaling of an Analogue output (-5000-10000 → 0-65535) 4.34.34.34.3 Filtering of analogFiltering of analogFiltering of analogFiltering of analogueueueue inputsinputsinputsinputs Because of external influences analogue signals often are disturbed and should be filtered by an analogue filter (i.e. a RC filter) or a digital filter. The advantage of digital filters is that they are easy to implement in software (the program) and to modify. Every PLC cycle the analogue input is sampled, using an ADC, giving a digitised signal (xk). Now a new digital filtered value yk can be calculated, based upon the most recent input sample, previous input samples and previous calculated output values. The calculated value can be used in the program or send to an output of the PLC, using a DAC. Figure 4.7: Signal processing The general formula of a digital filter is: ∑∑ = − = − += m j jki n i ikik ybxay 10 .. It is essential that the time between the samples (xk .. xk-n) is always the same. In a PLC this can be easily achieved by setting the PLC cycle time to a fixed value. A simple digital filter is a ‘Moving Average Filter’. The formula for a ‘Moving Average Filter’ that calculates the average of the last 4 samples (n = 3, a0 .. a3 = ¼) is given as: 34 1 24 1 14 1 4 1 .... −−− +++= kkkkk xxxxy PLC PLC program
  • 19. Process Control Systems with a PLC 17 The following ST program gives an example of a moving average filter of 4 samples. Example Suppose the PLC reads succeeding values (samples) for ‘speed’ as given in the table below. The table also shows the succeeding values for ‘x_0’ – ‘x_3’ and ‘speed_maf’. Clearly the filtered value ‘speed_maf’ changes less than the incoming value ‘speed’. With digital filters it is possible to design and implement filters with characteristics which are very difficult to achieve with analogue filters. The theory behind digital filter design goes beyond the scope of PLC programming. However, based on the moving average filter a useful application can be given. Application In industrial automations, because of electromagnetic interferences, 50Hz disturbances on analogue signals are very common. The 50 Hz disturbance is added with the original analogue signal (superposition) and the signal going into the PLC is disturbed. By using a 4 sample moving average filter with a sample time, which is the PLC cycle time, of 5 ms (20ms / 4) the 50 Hz disturbance can be filtered out completely! Figure 4.8: Signal with 50 Hz disturbance In the example given in the figure above the following values will be measured: ….. 260 258 254 256 260 258 254 …….. Now add 4 succeeding values and divide the result by 4. The final result will always be 257, which is the level of the original undisturbed signal. The 50Hz is completely filtered out! x_3 := x_2; (* shift *) x_2 := x_1; (* previous *) x_1 := x_0; (* samples *) x_0 := speed; (* new sample *) y_0 := (x_0 + x_1 + x_2 + x_3)/4; (* 4 samples moving average *) speed_maf := y_0; speed 240 234 250 246 236 247 258 245 238 x_0 240 234 250 246 236 247 258 245 238 x_1 - 240 234 250 246 236 247 258 245 x_2 - - 240 234 250 246 236 247 258 x_3 - - - 240 234 250 246 236 247 speed_maf - - - 242 241 244 247 247 247
  • 20. Process Control Systems with a PLC 18 4.44.44.44.4 PID control with a PLCPID control with a PLCPID control with a PLCPID control with a PLC In the figure below a basic example is given of a digital control system for controlling the speed of a motor. In this example a PLC is used as the basic component to control the speed. The PLC has two inputs (‘setpoint’ and ‘actual_ speed’) and one output to the Drive of the motor. The actual speed of the motor is measured with a tachometer. Figure 4.9: Basic control system With the ‘setpoint’ a desired speed is given. This speed is compared with the measured ‘actual_speed’, giving an error signal (error := setpoint – actual_ speed) which is used as an input for the PID controller. A proportional–integral–derivative controller (PID controller) is a generic control loop feedback mechanism widely used in industrial control systems. A PID controller attempts to correct the error between a measured process variable and a desired setpoint by calculating and then outputting a corrective action that can adjust the process accordingly. The PID controller calculation (algorithm) involves three separate parameters; the Proportional (P), the Integral (I) and Derivative (D) values. The Proportional value determines the reaction to the current error, the Integral value determines the reaction based on the sum of recent errors, and the Derivative value determines the reaction to the rate at which the error has been changing. The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve or the power supply of a heating element. By "tuning" the three constants in the PID controller algorithm, the controller can provide control action designed for specific process requirements. Because the inputs are coming from the outside of the PLC, they should be scaled and filtered. Also the output should be scaled. Figure 4.10: Scaling and filtering added to the inputs and output PID controllerScale + Filter setpoint + - actual_speed Scale PLC Scale + Filter PID controller Motor Tachometer setpoint + - actual_speed Drive PLC error
  • 21. Process Control Systems with a PLC 19 The theory behind PID control goes beyond the scope of PLC programming, however it is good to see how the basic code will look like. The general equation for a PID controller is: 0 0 )( )()()( u dt tde TKdtte T K teKtu t dp i p p +++= ∫ With: u(t) output e(t) error input Kp Contant (P action) Ti Integrating time (I action) Td Derivative time (D action) For digital controllers (such as microprocessors and PLCs) this can be written as: ( ) ( ))2()1(2)()()1()()1()( −+−−++−−+−= tetete T TK te T TK teteKtutu s dp i sp p With: u(t) new output u(t-1) previous output e(t) actual error input e(t-1) error signal of the previous cycle e(t-2) error signal of two cycles before Kp Contant (P action) Ts Sampling time (= PLC cycle time) Ti Integrating time (I action) Td Derivative time (D action) Note that the PLC cycle time is part is this equation, so when the PLC cycle time is changed also contacts in the equation has to be changed! The given PID equation can now be simplified: ( ) ( ))2()1(2)()()1()()1()( −+−−++−−+−= teteteKteKteteKtutu dip In the example below the basic code for a PID controller is given: Note that the value of the constants KP (proportional), KI (integral) and KD (derivative) should be determined and set according to your system and requirements. (* Code example for a PID controller *) (* IN is the error signal, used as the input for the PID function *) (* OUT is the output of the PID controller *) (* x_0, x_1, x_2, y_0 and y1 are variables to retain previous states *) (* min_v and max_v are values used to limit the output *) (* KP, KI and KD are the PID constants *) x_2 := x_1; x_1 := x_0; x_0 := IN; y_1 := y_0; y_0 := y_1 + (KP*(x_0 – x_1) + KI*x_0 + KD*(x_0 – 2*x_1 + x_2))/1000; (* limit the PID controller between min_v and max_v *) IF y_0 < min_v THEN y_0 := min_v; END_IF; IF y_0 > max_v THEN y_0 := max_v; END_IF; OUT:=y_0;
  • 22. Process Control Systems with a PLC 20 notes