Chap19 S
Chap19 S
Introduction
The PID algorithm is used to control an analog process having a single control point and a single
feedback signal. The PID algorithm controls the output to the control point so that a setpoint is
achieved. The setpoint may be entered as a static variable or as a dynamic variable that is
calculated from a mathematical operation.
For many years, the PID algorithm was not accepted as a function suitable for a PLC. It was
included in a DCS (Distributed Control System) or configured from a number of stand-alone PID
controllers. However, as PLC prices continued to fall during the 1980’s and later and more
economical HMI systems were developed for the PLC, PLCs became more accepted as PID
controllers. In fact, because PLCs have undercut the cost of competing systems, DCSs and other
PID controllers have been forced to drop prices dramatically or no longer remain competitive.
An early hybrid design was introduced into the Allen-Bradley 1771 I/O family including 2 PID
stand-alone controllers attached to a single I/O slot and executing the PID algorithm from the
controller in the I/O slot. Newer control schemes have the PID algorithm executing in the PLC
with other programs and controlling complicated processes with good success.
Chapter 19 uses the PID block to control a process. This chapter looks at the PID block from a
view of discovery, mine. The group I worked for in industry was a controls group and there was
a wall between the controls group and the instrumentation group. We worked with PLCs and
they worked with PID controllers. They designed P&ID Diagrams. They worked with analog
and we worked with digital systems. After accepting a teaching position, I was asked by a local
company to help install a PID block in a process. I accepted (for money). That started an
interest I had in process control that I have continued to this day. The chapter is organized
around the path I took in discovery of how to successfully implement the PID algorithm in
control processes.
The chapter describes the SLC PID block followed by the CompactLogix processor as well as the
Siemens 1200 and its implementations of the PID function. Using these various PLC
configurations demonstrates differences between the newer PID blocks and the SLC PID block.
The SLC processor was integer-based. Integer-based blocks have the disadvantage that scaling
must be used to convert numbers to more meaningful real values. Scaling adds complexity to the
program that becomes transparent with a floating-point PID block. More sophisticated PID
blocks such as is available in the PLC/5 and ControLogix processors as well as Siemens allow
floating-point calculations. These more robust PID blocks also provide more sophistication in
their functionality. All PID blocks are not created equal.
"Closed loop control is a process where the value of a variable is established and maintained
continuously through intervention based on measurements of this variable. This generates a
sequence of effects that takes place in a closed loop -the control loop- because the process runs
based on measurements of a variable that is influenced in turn by itself.” This variable that is to
be controlled is measured continuously and compared with a setpoint variable. The difference or
error between these two variables determines an output that hopefully controls the input variable
satisfactorily. An equation that is explained below is used to determine the best output.
Ch 19 PID Block 1
The following diagram gives an over-all picture of what a PID controller sets out to accomplish.
The Setpoint is the desired value of a variable. In order to achieve this Setpoint (SP), a controller
is inserted in a process with two main parts – a Manipulating Element and a Process. The
manipulating element may be a control valve or an inverter controlling motor speed. The process
is usually unknown mathematically. That said, it is always good to strive to understand the
mathematical equations that drive the process as much as possible. Fact is, it is not possible in
most cases.
The controller can be looked at as a one-eyed device with feed-back from the process with a
three element equation to try to manipulate the process to achieve the setpoint. The three
elements are P (Proportional), I (Integral) and D (Derivative. The feedback comes from a
controlled variable through a transmitter (measuring device) which outputs a signal called the
controlled variable (Cm) or process variable (PV).
In the case of P-controllers, the output of the controller is proportional to the error. The output of
the controller goes to zero if the error is zero. This never is the case and there is always an offset
between the desired value (Setpoint) and the process value. The proportional pressure regulator
sketched in the figure below compares the power FS of the setpoint spring with the power FB that
the pressure P2 generates in the spring-elastic metal bellows. If the forces are off balance, the
lever rotates around the pivot point D. The valve position changes and accordingly the pressure
P2 changes until a new balance of forces is established.
To keep the error as small as possible, a proportional factor as large as possible is selected. This
has the effect of quicker response to a change. There can be over-shoots however and instability
can occur. The P-controller needs help in solving the two problems of potential overshoot and
not being able to move to the setpoint but only to an off-set of the setpoint.
It is interesting to note that early PID controllers were built entirely from mechanical components
Ch 19 PID Block 2
– no electrical components at all. The P-controller below is an example of a mechanical only
controller with only the P component.
Metal bellows
Setpoint spring
Fig. 19-2
𝑦(𝑜𝑢𝑡𝑝𝑢𝑡) = 𝐾𝑝 ∙ 𝑒
Control
variable
Setpoint
Deviation
Actual
value
Fig. 19-3
time
Integrating controllers are used to completely correct the error from the P-controller. Only when
the Setpoint and controlled variable are equal is the control system in a steady state.
Ch 19 PID Block 3
1
𝑦 = 𝐾𝑖 ∫( ) 𝑤𝑖𝑡ℎ 𝐾𝑖 = Eq. 19-1
𝑇𝑛
How fast the manipulated variable rises (or falls) depends on the error and the integration time.
Block diagram
Fig. 19-4
PI-Controller
The PI-controller is a type often used in practice. It results from connecting a P-controller and an
I-controller in parallel. When laid out correctly it unites the advantages of both controller types
(stable and fast, no permanent system deviation).
Fig. 19-5
Block diagram
Fig. 19-6
The behavior with respect to time is identified by the proportional coefficient Kp and the reset
time Tn. Because of the proportional component, the manipulated variable responds immediately
to every system deviation e, while the integral component takes effect only in the course of time.
Tn represents the time that passes until the I-component generates the same amplitude of flow as
occurs immediately because of Tn to increase the integral component.
Ch 19 PID Block 4
Differential Controller (D-Controller)
The D-controller generates its manipulated variable from the rate of change of the system
deviation, and not, as the P-controller, from its amplitude. For that reason, it responds
considerably faster than the P-controller. Even if the deviation is small, it generates (looking
ahead) large amplitudes of flow as soon as an amplitude change occurs. However, the D-
controller does not detect permanent deviations, because no matter how large it is, its rate of
change equals zero. For that reason, the D-controller is used only rarely by itself in practice.
Rather, it is used jointly with other control elements, usually in connection with a proportional
component.
PID Controller
If we expand the PI controller with a D-component, the universal PID controller is created. As in
the case of the PD controller, adding the D-component has the effect that, if laid out correctly,
the controlled variable reaches its setpoint sooner and its steady state faster.
Fig. 19-7
𝑑𝑒 𝐾𝑝
𝑦 = 𝐾𝑝 ∙ 𝑒 + 𝐾𝑖 ∫ 𝑒 ∙ 𝑑𝑡 + 𝐾𝐷 𝑑𝑡 with 𝐾𝑖 = , 𝐾𝐷 = 𝐾𝑝 ∙ 𝑇𝑣
𝑇𝑛
The following example gives an analytical view of an Output (V) with PI control. We will leave D
alone. First, observe the relationship of Output to only the Integral term:
Ch 19 PID Block 5
Fig. 19-8a Graph of PI Error/Output
Ch 19 PID Block 6
With values assigned for the PI controller, the output can be calculated as time increases from
t=0. We will not include the D or Derivative component since this variable dramatically
complicates the example.
We assign numbers to the variables in the equation and observe the output. Let:
P =2
V0 = 32%
Starting at t = 0,
0
𝑣 = 2 ∗ 0 + (2)(0.02) ∫ 𝑒 𝑑𝑡 + 32 = 32 Eq. 19-4
0
Next, at t = 20,
20
𝑣 = 2 ∗ 10 + (2)(0.02) ∫ 𝑒 𝑑𝑡 + 32 = 20 + 0 + 32 = 52
0
Then, at t = 70,
70
𝑣 = 2 ∗ 10 + (2)(0.02) ∫ 𝑒 𝑑𝑡 + 32 = 72
0
This may be a little harder to see but look at the rectangle from 20 to 70. It is 10 high. Also,
look at the time. It is 50. The integral is the sum over time of the error or the area under this
curve, or 2x.02x50x10. This gives 20 to add to the total or 52+20 = 72.
Completing the graph for the 100 seconds would look like the following:
Ch 19 PID Block 7
Fig. 19-8c Graph of PID Output
The first PID algorithm implemented by this instructor was the following. This was a dog-food
manufacturing facility. The basic process for making the dog food is the extruder whose
function is to make dog food from dry ingredients along with some steam, fat, and other wet
ingredients. As the motor speeds up, more ingredients are to be added and as the motor slows
down, the added ingredients are to slow down as well. The PID block will be used to add one
wet ingredient, fat.
Other Raw
Ingredients
Fat
Control Valve
Kibbles ‘n Bits
Since the extruder motor speed runs the feed speeds for the other ingredients in the process, its
speed sets the master speed for the process. All other feed speeds will be a percent of the motor
speed.
Ch 19 PID Block 8
Motor Speed
When the PID algorithm is in remote, the motor speed furnishes the value for the setpoint.
Variables are usually multiplied by a constant with motor speed * multiplier giving the value of
the setpoint when the local-remote switch is in remote.
It was discovered that the PID algorithm needed to be designed to operate in one of three modes:
Manual, Auto Local and Auto Cascade. This was necessary since the start-up of the dog-food
process involved manipulation of the Fat valve. The valve was checked out to see that it
operated freely within the range of the signal by sending a signal through the Manual Cv path
shown below. Then the algorithm for the PID solution was checked out and appropriate
variables were found for P, I and D using the Local Setpoint. Then the process was turned to full
auto – or remote or cascade to follow the process of the extruder. All three stages were necessary
and useful to achieve a successful start-up and running the process.
Motor Speed
Flow Valve to
Proces Variable Setpoint in PID
PID Solver
Cv or Output Manual Cv
Signal to Valve
In its simplest form, the SLC PID block is used as a single block with no input contacts and
surrounded by only two SCP blocks. This PID instruction is located in Ladder 2. The SCP block
is configured to retrieve a numerical value from the analog input channel, linearly scale the input
and move the resultant value to the PID block. The input is a 4-20 mA signal from a flow
transmitter. The output is a 4-20 mA signal to a variable flow valve.
The flow transmitter is the best way to find the actual flow. One could calculate the height of the
liquid in the tank, the flow resistance of the pipe, the viscosity of the liquid and the flow at the
valve for various pressures associated with these variables. But, it is easier and more accurate to
use the pulsed input from the flow meter. The pulses are converted to 4-20 mA through an
electronic circuit and then fed to the PLC.
PID
Control Block
Process Variable
Control Variable
Control Block Length
In the first SCP instruction, values found in the Input Min and Input Max of the SCP instruction
are from the I/O card. The engineer must first decide which I/O card to use and then find the
proper lower and upper limits from the literature on the card to enter values in the SCP
instruction.
In this case, the analog card selected is the 1746-NIO4I Ser. A from Rockwell/Allen Bradley.
This card is a combination card with 2 analog inputs and 2 analog outputs. From the web, select
I/O Analog Modules, Analog I/O Modules for SLC 500 Programmable Controllers – Technical
Data. Then select 4 Channel Module Configuration, 4 Channel Module Wiring, and 4 Channel
Module Specifications to find the choices available for Analog Inputs and Analog Outputs.
Ch 19 PID Block 10
In the section describing 4 Channel Module Specifications are found the following Channel Data
sheets:
Using the value 4 to 20 mA from the Input Type column, the value in Engineering Units is 3277
min to 16384 max. These values are entered in the SCP instruction to scale the variables
correctly.
The scaled min and max values that are sent to the PID’s process variable are found in the setup
documentation of the PID block. The min value is 0 and the max value is 16383. A location
must be selected. In this case, the process variable or PV is selected to be N10:28. It is
advisable to keep the PID block data separated from other integer data. In order to do keep the
data for the PID separated, the data file N10 was created to handle the PID data.
The input address may also be selected. Remember the value is I:s.w where s is the slot number
and w is the relative word address down the card. In this case, the slot address chosen is 1 and
the w or word address is 0, the first analog input point on the card. The other option for the input
in slot 1 is I:1.1.
Ch 19 PID Block 11
SCP – Scale with Parameters
Input I:1.0
Input Min 3277
Input Max 16384
Scaled Min 0
Scaled Max 16383
Output N10:28
PID
Control Block
Process Variable N10:28
Control Variable
Control Block Length 23
Fig. 19-16 Moving the Process Variable into the PID Block
The control block address is chosen. This address requires 23 contiguous words reserved in an
integer table. The block N10:0 (through N10:22) was chosen. Also reserve a location for the
control variable or output of the PID function. N10:29 was chosen.
This control variable or output is then sent to the analog output card. Scaling again must be
chosen. The min for the PID output is 0 and the max is 16383. These are the same values as are
used for the PID input. To use the entire range of values for a PID input or output, choose the
range 0 to 16383. Always strive to use the entire range of the PID block when programming an
integer PID block. This gives the greatest accuracy.
The scaled output must be ranged to fit a 4 to 20 mA analog output card. Use the values as were
found in the reference manual, 6,242 min and 31,208 max. Use the first output point on the same
card as the input. Its slot number is O:1.0. Now, the PID and two SCP blocks can be finished.
PID
Control Block
Process Variable N10:28
Control Variable N10:29
Control Block Length 23
Handling wiring and other hardware issues is found from information in the instruction manual
for the module. In the case above, the card used was the 1746-NI04I module from Allen-
Bradley. Look specifically in the chapter on installation and wiring.
In addition to the actual wiring diagram for the application, important information including dip
switch settings should be noted. If possible, all dip switch settings should be copied to the
installation drawing for the card or added as notes to the schematic drawings. In the case of the
1746-NI04I card, no dip switches were found.
To wire a 4-20 mA control circuit for a PLC input, wire a loop with the power supply,
transmitter, and PLC input. To wire a 4-20 mA PLC output, wire a power supply, valve and
output. From the manufacturer's diagram, it should be noted whether the 4-20 mA output
requires loop power or the analog output card provides loop power.
For the analog input, the transmitter varies the resistance to the PLC input so that the current
ranges from 4 mA for no flow to 20 mA for maximum flow. The transmitter “borrows” enough
voltage from the 24 V dc to activate electronics inside the transmitter. The voltage drop across
the transmitter does not affect the current range of the loop. The PLC analog output varies the
resistance to the control valve in a similar manner.
Transmitter-
Variable Resistor
4-20 mA
PLC
24 V dc Analog
Input
24 V dc Control
(may be Element
external) (valve)
Ch 19 PID Block 13
or
Control
Element
(valve)
In the case of output cards, care must be taken to find whether or not the 24V dc power supply
should be added to the loop. The drawing from the installation manual provides direction here.
From the figure below, note that there is no power supply needing to be added in the output
current loop diagram for this specific card (NI04I).
The figure below shows the catalog information for wiring this card. In fact, the analog output
does not need a power supply since the output furnishes this power internally. The term "analog
source" for the input implies inclusion of the 24V power supply. Load for the output implies no
external power supply. Note the jumpers installed for inputs not used.
+
analog 0 In 0+
source 1 In 0-
-
2 ANL COM
3 In 1+
jumper
unused 4 In 1-
inputs 5 ANL COM
6 not used
Load 10 Out 1
(valve) 11 ANL COM
The description of the SCP instruction mentions that the inputs may be integer, floating point,
immediate data values, or indirect referenced values. The minimum and maximum values for
Ch 19 PID Block 14
both input and output form a range over which the variables are scaled. The instruction solves
the equation y = mx + b without the user responsible to calculate actual values for ‘m’ and ‘b’.
Care must be taken to keep the program performing in an acceptable manner if the input value is
less than the card minimum value. The scaled output value should continue to solve the equation
and the output value should scale to less than the minimum value of the instruction. The same
result should also occur if the value exceeds the maximum.
“This output instruction is used to control physical properties such as temperature, pressure, liquid level,
or flow rate of process loops.
The PID instruction normally controls a closed loop using inputs from an analog input module and
providing an output to an analog output module as a response to effectively hold a process variable at a
desired setpoint.”
The PID instruction can be chosen to be operated in either the timed mode or the STI mode. In
the timed mode, the instruction updates the output algorithm periodically at a rate selected in the
block. In the STI mode, the PID instruction is placed in an STI (Software Timed Interrupt)
subroutine. The PID block updates the PID algorithm each time the STI subroutine is called. A-
B points out that the STI time interval and the PID loop update rate must be equal in order for the
equation to perform properly. The suggested time duration for the STI or timed mode is .1
second.
PID
Control Block
Process Variable N10:28
Control Variable N10:29
Control Block Length 23
setup screen
Ch 19 PID Block 15
From the A-B Text and the Instruction Help Screen is shown the Block Layout of the PID
Instruction:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 0 EN DN PV SP LL UL DB DA TF SC RG OL CM AM TM
Word 1 PID Sub Error Code (MSB)
Word 2 Setpoint SP
Word 3 Gain Kc
Word 4 Reset Ti
Word 5 Rate Td
Word 6 Feed Forward Bias
Word 7 Setpoint Maximum (Smax)
Word 8 Setpoint Minimum (Smin)
Word 9 Deadband
Word 10 INTERNAL USE – DO NOT CHANGE
Word 11 Output Max
Word 12 Output Min
Word 13 Loop Update
Word 14 Scaled Process Variable
Word 15 Scaled Error SE
Word 16 Output CV% (0-100%)
Word 17 MSW Integral Sum
Word 18 LSW Integral Sum
Word 19 Altered Derivative Term (Low word)
Word 20 Altered Derivative Term (High word)
Word 21 Time of Last Update
Word 22 Setpoint Old Value
The table above corresponds to N10:0 through N10:22 found in our example above. Word 0
(N10:0) is used for bit control storage. For example, bit 1 is the AM or Auto/Manual bit. When
bit 1 is on, the block is in manual. When bit 1 is off, the PID block is in auto. The address for
AM in is N10:0/1. Words 1 through 22 are used for constants and variables used in the solution
of the PID algorithm.
The PID Setup Screen shown below describes variables found in the table above that may be
changed from the programming software.
Once the analog value of the process variable is mapped from the SCP instruction to the PID
block, the PID block solves the equation for the Control Variable (CV) or Output. A more
thorough explanation of how the output is achieved may be found in a text on control systems.
Equations vary but the three most common equations are given later in the chapter.
The PID block has two analog inputs. One is the PV or process variable and the other is the SP
or setpoint. The setpoint is manually entered into the PID block. This may be done through the
PID Setup screen, through an HMI such as PanelView, or through a program statement (a MOV).
If the SP is entered manually through the program, the SP is considered static and should never
be changed by operator control since an operator is not generally considered reliable enough to
enter variables through the RSLogix500 Setup Screen.
Ch 19 PID Block 16
The PID Setup screen is pictured below. The setup screen allows the engineer or technician full
capability of modifying the PID block.
The SP may be entered through the PID Setup screen. The PV is entered using the SCP
instruction.
“Process Variable PV is an element address that stores the process input value. This address
can be the location of the analog input word where the value of the input A/D is stored. This value
could also be an integer if you choose to pre-scale your input value to the range 0 to 16383.”
The output is referred to as the CV or Control Variable. It is described in the same manual as:
“Control Variable CV is an element address that stores the output of the PID instruction. The
output value ranges from 0 to 16383, with 16383 being the 100% ‘on’ value. This is normally an
integer value, so that you can scale the PID output range to the particular analog range your
application requires.”
The PID block is very much like a black box function with inputs entering and outputs leaving
the block. The block diagram for the PID block in auto is:
Ch 19 PID Block 17
In Auto:
Process Variable Setpoint
(AM bit = 0)
Control Variable
or Output
The PID algorithm is solved while the block is in auto. Auto is determined by the status of the
AM bit. When AM = 0 the operation is automatic. When AM = 1, the operation is manual.
The PID algorithm does not output a value for the PID block if the block is in manual. It is as if
the block has been manually disengaged. The PV or SP may change and the output stays at its
last value unless a new value is written into the CV location. The CV location may be over-
written in manual. In auto, the PID block constantly writes the value to the CV. The range of the
CV is from 0 to 16383. Writing to the CV allows the user to manipulate the valve in the manual
mode.
Ch 19 PID Block 18
Process Variable Setpoint may be
In Manual: may be entered entered but 1 must be written to
(AM bit = 1) but equation is not equation is not AM bit when in Auto
being executed being executed
CV may be written to
Control Variable from the program or
or Output fram an HMI
Another bit that must be set correctly for the PID block to work is the Control (CM) bit. It
determines whether the error term E = SP – PV or E = PV – SP. If the CM bit is set incorrectly,
the valve will quickly go to full on (100%) or full off (0%). This bit is never to be set by an
operator. Use the PID Setup screen to set it. The bit is not to be changed after it is set in the
initial configuration of the auto mode.
The simple PID algorithm from the SLC processor demonstrates many important steps in
implementing the PID block successfully. First, the input must be correctly signal conditioned
and the output signal conditioned as well. The wiring must be correct. The PID block must be
correctly configured including all min and max values plus all tuning parameters. Then the
engineer can control the program either in manual or auto from the programming helps menu.
The PID block must be placed in a block that executes on a clocked interrupt or the PID block
itself must be programmed to execute on a timer in the main or OB1 block. Either method works
but the preferred method is to program the PID algorithm in a separate timed interrupt block.
Also the data must be guaranteed to be ‘fresh’. That is, the data that is used for the algorithm
must have been gathered recently. This may be as recent as an immediate read or from a scanned
card that reports to the main CPU on a regular basis. This data must be guaranteed to have been
read less than 10% of the time since the last execution of the PID block. This is a rule of thumb
– 10%.
As can be seen, the PID algorithm, to be set up properly and run in the PLC requires several
steps. The inputs and outputs must be scaled properly, modes must be considered and
programmed. A start-up screen is used to set up the PID block and input parameters such as P, I,
Ch 19 PID Block 19
D, and other limits as well as run the PID block to observe stability. Later we will be introduced
to an auto-tune feature with the Siemens PLC but for now, the P, I, and D variables must be
guessed. Finally, a program is written using the PID block to control the output variable y. A
discussion of how the interface to the operator is discussed ater. This interface is commonly
referred to as the faceplate, a term used from the original PID controllers which were stand-alone
controllers, each with its own interface (faceplate).
Faceplates of some stand-alone PID controllers are shown below. These include the Red Lion
stand-alone TCU controller and the Honeywell stand-alone controller faceplates.
Some time after the first experience with the dog food PID block, another company inquired if I
was interested in aiding their efforts with programming a glass furnace. I was available and
interested. The process included converting the entire program from Allen-Bradley to Modicon.
I was familiar with both languages so it was a good fit for me to help. In the process, I learned
much about how PID blocks were used to control large processes. The basic algorithm for each
zone of the furnace and forehearth used three PID blocks.
Many systems used in process control require a number of PID loops working together. In the
example of the dog food extruder, the system would have included a PID controller for each
ingredient. In general, each control element requires a PID block.
In the case of temperature control with gas and oxygen combustion, temperature is a PID block
as well as gas and oxygen flow. The interaction of temp, gas and air are shown below:
Ch 19 PID Block 20
Temp PV
Temp SP
Temperature
Controller
Gas PV Oxygen PV
Gas SP Oxygen SP
Gas Oxygen
Controller Controller
Gas CV Oxygen CV
This algorithm controls the combustion for a furnace or section of a furnace. Temperature
Setpoint may come from a number of sources. The local SP may come from an entry from an
operator. Setpoints may also be calculated using a formula for best performance. Setpoints from
a formula would be considered as remote setpoints in the temperature PID loop.
This experience was an introduction to design of more sophisticated HMI designs. This included
faceplates. Commonly used tags in the HMI are:
Auto/Manual
Setpoint
Process Variable
Output (CV)
Error (Deviation) (May be on restricted access page.)
Deadband (May be on restricted access page.)
Gain, Reset, Rate (May be on restricted access page.)
Mode switches such as Auto/Manual are included in the PID block. Other modes normally used
but not part of the SLC PID block include:
Local/Remote
Maintenance
In Local, the operator is able to change the setpoint manually and verify the output’s response
while the PID loop is in auto.
In Remote, the process (program) sets the SP and the PID loop responds to the changes. The PID
loop is in auto mode in both local and remote modes. Remote mode is referenced as Cascade
mode by some PID controller manufacturers.
In Maintenance mode, the loop is in manual and any variable can be changed from the operator
station. This mode should be password protected.
A faceplate may be drawn on the HMI similar to the one below. This faceplate is typical for a
system of PID loops controlling a process.
Ch 19 PID Block 21
Fig. 19-26
The triangles on the left and right side of the bar graphs are used to add or subtract 5% or 1% of
the SP or CV. They provide a quick method to adjust SP or CV to get to a desired number. The
more exact approach is to enter a number in the data box for either SP or CV. This approach is
slower to implement than the method of touching a triangle when making small changes.
Faults occur at different levels in the program and require a variety of responses. Some types of
faults should shut the process down. Shutting down may require that valves turn off. Many
times, to shut down automatic operation is desired and the valves are to stop moving, staying in
the same position. If the desire is to move from Auto to Manual, the bit in the PID algorithm
labeled AM must be changed from 0 to 1. The bit is set to 0 in Auto and 1 in Manual. The fault
contact represents various faults that can harm the process if the PID algorithm is allowed to
continue in auto.
Two levels are present in most processes. As with the dog food application, the process is
capable of being run in remote or local for both automatic modes or in manual. In a hierarchical
picture, remote mode is favored over local mode and the manual mode is the least desirable mode
to run the process. This may be pictured as:
One of the control button types in PanelView is ideal to program the Remote/Local and
Auto/Manual layout for the PID block. It is the Multistate Button. It was discussed in Ch. 15 –
HMI.
Multistate buttons are used for remote/local and auto/manual so one button can be used instead of
two buttons. Most graphical applications encourage the use of a single button as opposed to two
separate buttons. Using the multistate button provides a single button with toggle functionality.
Multistate buttons also respond to program logic in the PLC and will turn on or off with logic
internal to the program.
Faults that move the operation from remote to local are different than faults that move the
operation from automatic to local. Always, the option most highly sought is for the operation to
run in remote. However, if a fault occurs in the process but not necessarily in the individual PID
block, the fault should cause the process to revert to local from remote and sound an alarm.
If a fault occurs in the PID block, the best practice is to change the block from automatic to
manual. One of these faults is referred to as anti-reset windup. In manual, the algorithm is not
active and the error term is reset to zero eliminating the integral term from growing with a
growing error.
When looking at PV, a temperature profile may be found to form a composite PV. The values of
a number of different temperature inputs are summed together. The sum is weighted with the
weighted values having to add to 100%. If the weights do not add to 100%, the individual PID
blocks used to control their CV outputs are switched to local mode. The local setpoint is used
until the weights have been adjusted to add to 100% and the operator switches control back to
remote.
Weight 1 x Temperature 1
Weight 2 x Temperature 2
Weight 3 x Temperature 3
+ Fig. 19-28
Temperature PV
In the example, Weights 1-3 must add to 100 % for the Temperature PV to run the temperature
PID block in remote.
Ch 19 PID Block 23
Example of Fault Causing Switch from Auto to Manual
When operating between Auto and Manual, the PID block should be monitored so that a failure
to achieve the desired result is not defeated by faulty equipment. If the equipment fails, the PID
block should be faulted to the Manual Mode and an alarm sounded. For instance, if a valve is
attached to the CV and the valve does not turn when the CV changes, this should be considered a
fault condition. To find if this is the case, the CV or output is compared to a position on an
analog scale. The sensor is usually nothing more than a potentiometer. If the CV does not keep
within 10% (or other constant) over a time period such as 10 seconds, the PID block for the valve
should fail.
Another type of failure is the restriction of flow that can cause the CV to travel to full ‘on’. A
restriction in flow may be simulated by simply pinching off a hand valve in the line of flow. Any
restriction over time can cause the CV to not be able to control the process. If the CV is allowed
to go to 100% for a period of time, the PID block should fault and the output be placed in
Manual. Ranges other than 100% may be used as well with a time delay appropriate to shut
down the process in abnormal conditions. The programmer must be able to decide acceptable
ranges for these cutoffs, usually through experience with the PID block and with the process.
In order to avoid anti-reset windup of the PID controller, the controller must be switched from
auto to manual when conditions exist that would wind up the controller integral term. The
integral term is reset to zero in manual mode. To detect integral error, monitor the PV. If the PV
does not follow the CV after a preset time, something is perceived to be wrong with the system
and action should be taken.
For example, a check valve may be turned off starving the system. When this happens, the PID
controller must be placed in manual to eliminate windup and an alarm sounded.
An experienced operator will find the problem and reset the loop to auto control. And the system
will continue to function with only a small upset to the system. If the PID block is allowed to
wind up over several minutes or hours, the output valve may stay open 100% (or closed 100%)
for long periods of time after the system comes back into operation before control is re-
established. In this time period, excessive gas may flow through a gas valve causing an
explosion or too much liquid may flow through a control valve flooding a process vessel
downstream. In any case, the result usually upsets the entire system causing scrapped product or
worse.
When switched from Auto to Manual, the error integral term is reset to zero:
Auto
Manual
Fig. 19-29
E 0 E = 0
windup may occur no windup
When switched from Manual to Auto, the error integral term starts at zero and adjusts:
Ch 19 PID Block 24
Auto
Manual
Fig. 19-30
E = 0 E 0
no windup error term initially 0
Changes from Manual to Auto are usually made by the operator and imply that the operator is
aware that a problem occurred, has found the problem and is ready to put the process back into
Auto.
Processes in Lab
While becoming familiar with PID from an industrial viewpoint, it was clear that the PID block
would be a good addition to the classroom. A first process was a simple valve attached to a ¾
inch water line which allowed the flow to be controlled from 0 to about 90 gallons of water a
minute. The water was allowed to flow down a drain after passing through the valve. This was a
definite waste of water but demonstrated an industrial PID block to students.
The following is a bill of material to construct the flow valve system shown below in Fig. 19-18.
Ch 19 PID Block 25
Fig. 19-31
The valve on the wall was a first lab for EET to activate. It had been available for students from
about academic 2004. We had used it over the years with good success.
The flow sensor is a paddle wheel placed in the flow of water. There is a calibrated readout for
the flow meter that displays the flow in gallons per minute. Included with the flow sensor is a
flow instrument read-out. This read-out is separate from the PLC and HMI and is used by
personnel in the field to read the 4-20 mA reading from the transmitter to the PLC input. It is a
Ch 19 PID Block 26
useful instrument in that it verifies externally from the PLC a value that can be seen in the
program.
The valve has been discontinued as an active lab due to the possibility of water flooding the
downstairs. What had been a good lab is no more. The discussion that follows gives a guide for
setting up the Allen-Bradley version of the valve using RSLogix 5000. No longer would we use
an integer PID block but rather a Floating-Point block.
Wiring diagrams for the card as well as the engineering range of the input and output channels
are found on the next two pages.
Ch 19 PID Block 27
1769-IF4XOF2/A
Terminal Door Label
Vin 0+
Vin 1+
V/Iin 0-
V/Iin 1- 24 VDC
Iin 0+
Iin 1+ Flow
Vin 2+ Xmitter
Vin 3+
V/Iin 2-
V/Iin 3-
Iin 2+
Iin 3+
ANLG Com
ANLG Com
Vout 0+ Flow
Vout 1+ Valve
Iout 0+
Iout 1+ Fig.19-37
Fig. 19-35
The wiring diagram of the card is shown above. The input and output range of the 4-20 mA
engineering units can be found by looking up the accuracy of the signals. Both have a range of 0
mA to 21 mA – 0 to 32640 decimal range. So, 4 mA would be 6217 (32640/21)*4 and 20 mA
would be 31085. Our range for the raw input and output then is 6217 – 31085.
Ch 19 PID Block 28
Instead of the SCP instruction, scaling is handled in the card set-up for the I/O card:
Fig. 19-36
The PID algorithm used the CompactLogix hardware and software to provide control of the same
valve used in the SLC programming experience for the Fat Valve in the Dog Food example. The
graphical operator interface will be upgraded to the newer RSView ME operator interface.
Inclusion of the data tag to create the list shown above. The PID algorithm uses these data tags
to calculate and control a PID block. For instance, the PV value for the block is mypid.PV. The
SP or setpoint is mypid.SP. The example screens that follow show the newer IF4XOF2F/A card and
are used to set up the scaling for the present system in the lab.
Ch 19 PID Block 29
Fig. 19-37 Controller Configuration of the L30ERM
The task was set up to execute every 100 msec in a separate program from Main or the
background task. This is shown in the figure below:
Fig.
Fig. 19-41
19-38
Ch 19 PID Block 30
Fig. 19-39 PID Module Set in Periodic Task
Ch 19 PID Block 31
Fig. 19-41 Data Update Rate Set for I/O Card Here
Ch 19 PID Block 32
Fig. 19-43 Don’t Forget to Enable the Channel
Fig. 19-62
The tuning tab shows the variables used to tune the PID block. The Kp, Ki and Kd tuning
constants in Fig. 19-63 above are probably the best variables for the water valve. These
constants should not vary too much from the numbers shown or the PID block may become
unstable.
Ch 19 PID Block 34
Fig. 19-46 PID Configuration
The configuration tab shows the variables used to set up the type of block used. There are a
number of variables that are not used.
Ch 19 PID Block 35
Fig. 19-47 PID Alarms
The alarms tab shows the alarm variables used to set up the block. The alarm limits are ignored
for now but in a real application will be necessary when setting up a system of alarms.
The scaling tab shows the variables as set up in the block. We need to make a decision whether
to scale the engineering units. The unscaled PV and CV are listed at 3200 low to 21000 high. The
Engineering Units for the PV may be changed or left as is. For water, the engineered units
should be 91 gpm max.
Ch 19 PID Block 36
31085
6217
31085
6217
Ch 19 PID Block 37
Fig. 19-48 Tuning Parameters
Fig. 19-53
Ch 19 PID Block 40
Continuing the Allen-Bradley Configuration Pages
After you enter the PID instruction and specify the PID structure, you use the configuration tabs
to specify how the PID instruction should function.
To specify tuning, select the Tuning tab. Changes take effect as soon as you click on another
field.
Set output % Enter a set output percentage (.SO) (In software manual mode, this value is
used for the output. In auto mode, this value displays the output %.)
Proportional gain (Kp) Enter the proportional gain (.KP).For independent gains, it’s the
proportional gain (unitless). For dependent gains, it’s the controller gain
(unitless).
Integral gain (Ki) Enter the integral gain (.KI). For independent gains, it’s the integral gain
(1/sec). For dependent gains, it’s the reset time (minutes per repeat).
Derivative time (Kd) Enter the derivative gain (.KD). For independent gains, it’s the derivative
gain (seconds). For dependent gains, it’s the rate time minutes).
Manual mode Select either manual (.MO) or software manual (.SWM). Manual mode
overrides software manual mode if both are selected.
PID equation Select independent gains or dependent gains (.PE). Use independent when
you want the three gains (P, I, and D) to operate independently. Use
dependent when you want an overall controller gain that affects all three
terms (P, I, and D).
Control action Select either E=PV-SP or E=SP-PV for the control action (.CA).
Derivative of: Select PV or error (.DOE). Use the derivative of PV to eliminate output
spikes resulting from set-point changes. Use the derivative of error for fast
responses to set-point changes when the algorithm can tolerate
overshoots.
Loop update time Enter the update time (.UPD) for the instruction.
CV high limit Enter a high limit for the control variable (.MAXO).
CV low limit Enter a low limit for the control variable (.MINO).
Ch 19 PID Block 41
No zero crossing in dbnd Enable or disable this selection (.NOZC).
Cascade type If cascade loop is enabled, select either slave or master (.CT).
Specify Alarms
PV high: Enter a PV high alarm value (.PVH).
Specify Scaling
PV unscaled maximum Enter a maximum PV value (.MAXI) that equals the maximum unscaled
value received from the analog input channel for the PV value.
PV unscaled minimum Enter a minimum PV value (.MINI) that equals the minimum unscaled value
received from the analog input channel for the PV value.
PV engineering units maximum Enter the maximum engineering units corresponding to .MAXI (.MAXS)
PV engineering units minimum Enter the minimum engineering units corresponding to .MINI (.MINS)
Tieback maximum Enter a maximum tieback value (.MAXTIE) that equals the maximum
unscaled value received from the analog input channel for the tieback
value.
Tieback minimum Enter a minimum tieback value (.MINTIE) that equals the minimum
unscaled value received from the analog input channel for the tieback
value.
PID Initialized If you change scaling constants during Run mode, turn this off to reinitialize
internal descaling values (.INI)
Ch 19 PID Block 42
Shifting to the HMI Program, RS Studio is entered and the Libraries choice and then Face Plates
choice is entered.
With RSStudio, build a screen from scratch using a face plate. There are a number of face plates
in the template from which to choose.
Ch 19 PID Block 43
Fig. 19-55 HMI Loop Face Plate
The various parts of the face plate are animated. The next screen shows the details:
Ch 19 PID Block 44
Fig. 19-57 Animation of the Numeric Entry
Ch 19 PID Block 45
A Third Industrial Application – A Steel Furnace
As with the Glass Furnace, the Steel Reheat Furnace uses three PID Controllers working together
as shown again below. This was programmed again for a Steel Reheat furnace with one major
exception.
Temp PV
Temp SP
Temperature
Controller
Gas PV Oxygen PV
Gas SP Oxygen SP
Gas Oxygen
Controller Controller
Gas CV Oxygen CV
In some applications involving gas and oxygen, the oxygen must be guaranteed to be in excess
relative to fuel. Otherwise, excess gas may build up in the chamber and explode. Above certain
temperatures, gas will burn without exploding. This is an especially prevalent condition in some
steel reheat furnaces.
In the case of gas and oxygen below the critical temperature for gas to burn, a cross-limiting
control scheme is introduced to allow only enough gas to be present to burn with at least enough
oxygen or combustion air to burn all the gas all the time. This implies that the gas valve always
must be more closed than the oxygen valve (times the air-fuel ratio). Control of the cross-
limiting requires the same temperature control as the master control but introduces lag control,
high select, low select and other control blocks in addition to the PID control. The oxygen
control for the cross-limiting control algorithm would be:
Temp PV
Temp SP
Temperature
Controller
Gas PV
Lag High Select
Oxygen PV
Oxygen SP
Oxygen
Controller
Ch 19 PID Block 46
The gas control for the cross-limiting control algorithm would be:
Temp PV
Temp SP
Temperature
Controller
Oxygen PV
Gas PV Gas SP
Fig. 19-60
Gas
Controller
Gas CV
As can be seen, the Gas PID block selects the lower of the values of the Temperature Setpoint or
the Oxygen value after a lag has occurred. The effect of the cross-limiting control is to assure a
Gas-Oxygen ratio that will never allow more gas into the combustion chamber than can be
burned in the combustion process. This is an example of a much more complex algorithm than
was first discussed earlier with a simple PID block. The same PID blocks are still used but with
more sophisticated program control in addition to perform the task at hand.
Example of PID Block for Feedforward Control – Also First Encountered in The Steel Furnace
The PID block is a device used for feedback control. Many times, however, a small amount of
feed-forward control is required. Feed-forward control may include control that anticipates an
action and is ready to apply control as a situation arises more quickly than the pure feedback
solution is able to provide. Since there is only one set of tuning parameters for the PID block, it
is not practical to switch to a second set of parameters for a special case.
The following example shows how a little tweaking of the PID block can be useful for some
anticipatory or feed-forward control. The example below is of a furnace with a door on the front.
This example shows just one of many additions to the PID block to give it characteristics not
normally associated with PID control.
The gas burners use air for combustion and the air must be exhausted through an exhaust stack.
Pressure in the furnace is adjusted by adjusting the damper in the stack. Pressure should be
adjusted to be slightly negative so flames do not jump out of the door when the door is opened.
Ch 19 PID Block 47
Fig. 19-61
Stack Damper
Pressure
Sensor
This is a major concern because the PID loop must respond in a much different manner in this
circumstance than under normal operating conditions with the door closed. The fact that an
event such as the door opening occurs helps to accomplish the control of this task. While not
true feed forward, augmentation of the PID block will help offset the pressure upset and keep the
flames pretty much inside the furnace. (Flames coming out the furnace tend to ignite grease from
bearings causing grease fires around the furnace.)
To accomplish better pressure control, place a limit switch on the door and adjust the output of
the PID block so the output will open the damper rapidly and then recover. The constant of the
jump is a number that should be adjustable by an operator in the maintenance mode only.
Ch 19 PID Block 48
When the door swings open, perform the following operation using a one-shot rung:
CV = CV + constant
This statement should be written only once to the CV. Use a one-shot circuit to add the constant
to CV. The CV then is allowed to recover to its new value but from a new higher starting point
as opposed to the original value. The value of the constant is the amount shown by the arrow
below. This is a constant that is adjusted to fit the application. Once set, it should not be
changed.
New
One Shot Response Fig. 19-62
Furnace Add to Cv
Pressure
(negative)
Old Response
The response is a simulated response but makes the point that the response to a pressure change
requires fast action to adjust to the conditions of the door opening. A change in the CV provides
this type of change. The change in CV will start the adjustment procedure and trick the PID
tuning parameters into responding to the new situation quickly instead of a slow acting controller
as would be the case for the regular control of oven pressure.
While the addition of a small incremental value to CV may be considered a trick on the PID
block, it is important to note that such an action may be accomplished in the PLC very easily.
Ladder logic accommodates this type of programming through the use of one-shot ladder logic
and math functions. This type of change to the PID block provides quick response to an upset
outside the normal range of the PID block's algorithm. The actual move may only be able in the
manual mode. To move to manual, change the CV and then move back to auto is recommended
for this action to occur successfully.
P&ID Symbols
To read a P&ID Diagram one needs to understand the symbols and nomenclature of the P&ID
Diagram. The example below shows two PID Controllers and their associated hardware and
logic. This drawing is one of many found in industry. The course uses the Process Control text
from Liptak for many of its examples including this one below:
Fig. 19-63
Ch 19 PID Block 49
The circles are referred to as ‘bubbles’. Inside the bubbles there are letters and usually numbers.
The letters have meaning based on the tables below. To understand what is represented, look for
the bubbles with xIC or xRC letters. These represent PID blocks that are to be implemented in
the control logic. The third letter is ‘controller’ and the second letter is either I for ‘indicator’ or
R for ‘Recorder’. The indicator label refers to a faceplate. This today symbolizes a single
faceplate on an HMI screen. The recorder label refers to a histogram recording device, today
usually symbolized by a historical data plot for the variable being controlled. Both I and R may
be present today since it is easy to include both functions in a PID block inside a computer
system such as a PLC.
If there are two arrows coming to the xIC or xRC, then one is the PV and one is the SP. It takes
some intuition to determine which is which. If there is only one arrow coming into the PID
controller, then this is the PV and the SP is entered through a faceplate.
A Analysis Alarm
B Burner Flame
C Conductivity Control
Density /
D
Differential
E Voltage
G Gaging Glass
H Hand High
I Current Indicate
J Power / Scan
K Time
N Choice
O Choice
P Pressure
R Radioactivity Record
S Speed Switch
T Temperature Transmit
V Viscosity Valve
W Weight Well
X Interlock
Y Choice Relay
Z Position Drive
Ch 19 PID Block 50
Element Indicator Ratio
Process Type Element Transmitter Indicator controller Controller Controller Recorder
Measurement Code E T I IC C FC R
Analysis A AE AT AI AIC AC AFC AR
The table above contains descriptions of various types of transmitters, indicators, controllers and
recorders. Most PID blocks are used to program controller items. There is a one-to-one
programming transfer for most xIC (various, Indicating Controller) or xC controllers.
Process and Instrumentation Drawings (P&ID) are formalized drawings of a process explaining
flow and movement of material. It is important to know the symbols for this type of drawing. It
is also important to be able to understand the functionality of the devices on the drawing so the
engineer or technologist can program the process on the PLC or other computer.
It is also hoped that down the road, the engineer or technologist is allowed to design the P&ID
for others. The programmer usually understands the process as well as anyone and has insight
into the complexities of the process and should be allowed to take responsibility for design of the
P&ID.
A note about PID vs P&ID: Of course, the similarities are glaring. PID refers to the control
block Proportional Integral Derivative, a control algorithm. P&ID refers to Process and
Instrumentation Drawings. Some refer to them as Piping and Instrumentation Drawings.
Ch 19 PID Block 51
Element Hand Hand Indicating Solenoid Control
Type Switch Valve Totalizer Totalizer Valve Valve Calculation
Process
Measurement Code HS HV Q IQ XV V Y
Analysis A AHS AHV AQ AIQ AXV AV AY
Conductivity C CHS CHV CQ CIQ CXV CV CY
Density D DHS DHV DQ DIQ DXV DV DY
Voltage E EHS EHV EQ EIQ EXV EV EY
Flow F FHS FHV FQ FIQ FXV FV FY
Dimension G GHS GHV GQ GIQ GXV GV GY
Hand H HHS HHV HQ HIQ HXV HV HY
Current I IHS IHV IQ IIQ IXV IV IY
Time K KHS KHV KQ KIQ KXV KV KY
Level L LHS LHV LQ LIQ LXV LV LY
Humidity M MHS MHV MQ MIQ MXV MV MY
Power N NHS NHV NQ NIQ NXV NV NY
Pressure P PHS PHV PQ PIQ PXV PV PY
Delta Pressure dP dPHS dPHV dPQ dPIQ dPXV dPV dPY
Quantity Q QHS QHV QQ QIQ QXV QV QY
Radioactivity R RHS RHV RQ RIQ RXV RV RY
Speed S SHS SHV SQ SIQ SXV SV SY
Temperature T THS THV TQ TIQ TXV TV TY
Delta
Temperature dT dTHS dTHV dTQ dTIQ dTXV dTV dTY
Viscosity V VHS VHV VQ VIQ VXV VV VY
Weight W WHS WHV WQ WIQ WXV WV WY
Vibration Y YHS YHV YQ YIQ YXV YV YY
Position Z ZHS ZHV ZQ ZIQ ZXV ZV ZY
Devices such as hand switches, valves and some electronic devices such as totalizers and
calculation elements are described here. Most calculation elements are executed inside the
computer and algorithms become much too difficult to describe on the P&ID. The designer of
the P&ID is free to decide how much of the calculation information is to be included on the
drawing.
Devices such as those of the table above are primarily used for checking position of switches and
for various types of alarm. It is not uncommon to assign switches for end-of-travel on analog
devices. With most analog systems, there is an alarm reserved for both low and low-low. Low-
low is the signal that is just past low and should be attached to an alarm as well as shut-off logic.
The same logic is used for high and high-high. The inner alarm is the low or high alarm bit and
the low-low and high-high are the outer or fail-safe alarm.
Ch 19 PID Block 52
Element Ratio Switch Alarm Alarm Alarm Alarm
Type Calculation Low Switch High Low Low Low High High
Process High
Measurement Code FY SL SH AL ALL AH AHH
These tables demonstrate the breadth of labeling that can be included on a device. The devices
are also numbered and contain a 3 or 4 digit number in addition to the device type name. These
numbers are usually assigned sequentially and are placed on a metal tag that is attached to the
device itself. In the plant, one should be able to find a device, then find its metal tag, and find the
reference to the device on the P&ID. Names of devices are used on electrical drawings as well as
on the P&ID. If a device is referenced as a flow transmitter and numbered 087, then FT-087 is
referenced on all drawings using the same name.
The design of a P&ID may start with a senior engineer familiar with the process. Other sources
for P&ID’s are reference books such as the Liptak reference handbook Process Control. Texts
and company reference drawings are good sources for a starting point for a new P&ID. Of
course, names such as those listed above are to be used in defining the devices used in the
process.
Ch 19 PID Block 53
Example Program from P&ID:
A P&ID Drawing may be used to begin the process of programming the PLC. A P&ID such as
the following may be used to generate a simple program that only works in auto mode with just
logic to run the PID blocks in auto using the Setup Blocks from Allen-Bradley or Siemens. This
is a first step in setting up a complete PID program. This example shows the two PID blocks
found (DIC, FIC) and the corresponding relationships with PV, SP and CV’s. The goal of this
pseudo-coded program is to write a first pass of the PID program.
PDT DIC
001 001
FIC
x
001
Fig. 19-64
FT DT
001 001
This program is not complete but a start. It gives the linkage between the various PID
controllers. What is not included are the modes and their programming as well as any alarms and
HMI interface. Also not included are the bumpless transfer programs.
Ch 19 PID Block 54
Example Programming for P&ID (The PLC program is left as an exercise for the student):
FIC
x
001
Shut
off
FSL
001
FT
001
Fig. 19-65
FIC FT
002 002
The following diagrams show more extensive P&ID drawings for a complete system.
Ch 19 PID Block 55
Ch 19 PID Block 56
Other Labs Built at School Using Siemens PLCs
The ball-in tube lab was built over the 2013-14 academic year. It has served students well.
The laser is the feedback device for the ball-in-tube experiment. The laser gives an accurate
position of the top of the ball. Specifications for the laser are given in the following figure.
Fig. 19-67
This lab was an effort to mimic a lab from a major educational equipment manufacturer. The
first attempt is pictured below. The later design is pictured further below. The number of
different sensors used in the design is significant. What first seemed to work may not work in
the final design. This was found to be the case in both the level and flow sensors.
Ch 19 PID Block 58
Level Control
of Upper Tank
with Multiple
Drains and
Feedback from
Level Sensor
Fig. 19-68
The first system used a cheap level sensor before settling on the sonic sensor (yellow) seen
below. The flow sensor changed from a cheap $10 sensor to a $110 sensor and finally a better
$160 sensor. These changes were seen as necessary to control the process accurately.
Fig. 19-69
The pump control was from a digital output to a drive control module and finally to the pump
motor. The drive control module is shown below as attached to the system. The actual
device is shown below as well. The pump is a submersible bilge pump selected by the
plastics manufacturer known by him since his experience had been with boats and boat
construction. The speed control of the bilge pump is the same as that used in the later DC
motor designs using PWM control. These are discussed further in the description of these
Ch 19 PID Block 59
devices.
Fig. 19-70
Fig. 19-71
Fig. 19-72
The level control selected first had been one that was attached to the Arduino
microprocessor. That level control failed. It is not even on the pages of Arduino sensors at
this time. Seems as if more than one discovered that it didn’t work. This is a commo n story
with low-cost sensors. Many will work for a while. Some do not work at all.
Fig. 19-73
Ch 19 PID Block 60
The level sensor below is an industrial sensor and is guaranteed to work long -term. It does
cost significantly more but is worth the money. The price of the sensor shown below is
approximately $250.
Fig. 19-74
Ch 19 PID Block 61
The yellow ultrasonic level transmitter worked very well and gives a stable accurate signal to
the PLC from the tank level. The output of this device is 4-20 mA.
We now look at the flow sensors tried. The first again was a low-cost sensor. It worked for a
little while (about an hour or so) only to fail. We purchased a number of these and they all
failed in a short while. The electronics was not robust and the signal stopped shortly after
initially running.
Fig. 19-75
The flow sensor shown here is the second. The third device is shown further below. At the
bottom is a fourth which was held in reserve but may be used down the road. This sensor
worked (but was not accurate). We looked at it because we wanted something that would
work. It worked but if we want an accurate signal across the range, it lacked accuracy in the
lower end of the range.
Fig. 19-76
The sensor below is the third flow sensor and is the best so far. It is more costly but is accurate
across the entire range and more accurate than the one above across the entire range.
Fig. 19-77
Ch 19 PID Block 62
This meter was found and is possibly a useful flowmeter for this project. Its cost is significantly
less than the two above but has not been validated yet. The one above is about $160 and this one
is about $60.
Fig. 19-78
Speed and
Position Control
of DC Motor
Fig. 19-79
Ch 19 PID Block 63
Fig. 19-80
The following gear motor replaces the geared motor shown above.
Fig. 19-81
The design shown below gives speed control for the two dc motors with tension control between
the two.
Fig. 19-82
Ch 19 PID Block 64
Fig. 19-83
In this design, two motors are involved with a tensioner between. The motors cannot both run at
constant speed. One can run at constant speed or at a ramped speed. The second follows the first
based on the angle of the dancer roll between the two. The tension on the second can be changed
based on the angle of the tension arm. Weight can be added to the arm if additional tension is
desired.
Combining of two speed/position-controlled motors results in a lab similar to the one above in
Fig 19-83. This lab is inexpensive and provides a pair of PID loops to control the two dc motors
and a third PID loop to control the tension between the two. The third loop uses the dancer roll
potentiometer as a feedback device. This lab concentrates on loop-in-loop control. Also
important are start-up control issues. The lab also asks the question of which loop is the master.
For instance, should the right loop be constant speed? Should the left loop be constant speed?
Or should the speed be constant across the dancer roll? The program is written differently for
each. Also, a sensor must be added if the dancer roll is to be constant speed. This project has
many different possible results depending on where the design starts. The advances from the
earlier toilet paper lab to the present design are many and include the addition of 80-20 extruded
aluminum instead of the cheaper erector-set metal construction. This one addition gave added
stability to the machine from the earlier design.
All present labs use the Siemens PLC due to the flexibility of the I/O to control analog quantities.
The Siemens’ PID implementation is used in all the active applications shown above. First, the
address of all I/O is required as well as the wiring diagram for each analog point. The S7-1200
has two analog inputs located on the controller.
Addressing for the two analog input channels is found below: IW64 and IW66. The two analog
inputs are wired to these two points and programmed with these addresses.
Ch 19 PID Block 65
Fig. 19-84
To read or write an analog value, use the immediate read or write instruction as shown below:
Use a cyclic interrupt event to house the PID function. The event is defined as an OB or Object
Block. We will use OB 30 for the program containing the PID Block for the present
applications.
Analog values are available from high-speed digital input pulses. Analog output values may be
realized through PTO or PWM signals from digital outputs. An example is the Tank over Tank
problem discussed in Chapter 25 of the Hybrid Lab Text. The configuration of the pulse input is
as follows:
Ch 19 PID Block 66
Fig. 19-85
Under the Function tab, choose single phase unless quadrature is to be used:
No need to choose an interrupt. The interrupt should be the cyclical interrupt executing the PID
function:
Fig. 19-86
Ch 19 PID Block 67
Then, identify the input address ID:1000-1003:
The address of the input used is IW1002. It is used in the following statement as the rolling
value of the input count. This logic executes each time period and calculates the pulses in the
last scan:
The address of the output is QW1000. It is used in the following statement as the value of the
output count.
The configuration of the PWM output for control of the bilge pump for the Tank lab as well as
the gear motor lab is a single PWM 24 V output that turns on a dc motor controller input:
The pulse width modulated output is set up in microseconds. Other constants in the set-up
include the overall pulse duration. The pulse length is 10 msec with a base of 10,000 counts:
Ch 19 PID Block 68
The following statement identifies the output to be pulse modulated:
The following address gives the output address to load the pwm time into QW1000:
The following views of the output show various PWM settings. The first one is approximately
75% or a value in QW1000 of 7,500:
Fig. 19-87
Ch 19 PID Block 69
This view shows approximately 90% on:
Fig. 19-88
A list of hardware identifiers for the various I/O points is found in the list of system constants
under the system constant tab:
The final set-up of the pwm and hsc devices includes a DB for each. This is found in the OB1
code. The hardware identifier is found in this instruction and ties the device to the action:
Ch 19 PID Block 70
Fig. 19-89
STEP 7 provides the following PID instructions for the S7-1200 CPU:
The PID_Compact instruction is used to control technical processes with continuous input and
output variables. The PID_3Step instruction is used to control motor-actuated devices, such as
valves that require discrete signals for open- and close actuation.
Both PID instructions (PID_3Step and PID_Compact) can calculate the P-, I-, and D components
during startup (if configured for "pretuning"). You can also configure the instruction for "fine
tuning" to allow you to optimize the parameters. You do not need to manually determine the
parameters.
Note: Execute the PID instruction at constant intervals of the sampling time (preferably in a cyclic OB).
Because the PID loop needs a certain time to respond to changes of the control value, do not
calculate the output value in every cycle. Do not execute the PID instruction in the main program
cycle OB (such as OB 1).
The sampling time of the PID algorithm represents the time between two calculations of the
output value (control value). The output value is calculated during self-tuning and rounded to a
multiple of the cycle time. All other functions of PID instruction are executed at every call.
The PID (Proportional/Integral/Derivative) controller measures the time interval between two
calls and then evaluates the results for monitoring the sampling time. A mean value of the
sampling time is generated at each mode changeover and during initial startup. This value is
used as reference for the monitoring function and is used for calculation. Monitoring includes
the current measuring time between two calls and the mean value of the defined controller
sampling time.
Tuning of the Siemens PID loops is somewhat automatic with an autotune feature present. If the
autotune does not give adequate results (as in the DC Motor speed loop, guessing is helpful.
Ch 19 PID Block 71
Link to S7-1200/1500 PID Manual:
https://support.industry.siemens.com/cs/us/en/view/108210036
The tuning rules are found on pgs. 265 - 266 under the descriptions of operating modes
"Pretuning" and "Fine tuning" in the 1200.
This formula is more complex than the formula explained earlier. The three variables used are
the same, however. KP is the proportional constant, TI is the integral constant and TD is the
derivative constant.
To set up a PID block in your program, choose ‘Technology’ from Instructions and then ‘PID
Compact’. See below:
Ch 19 PID Block 72
Fig. 19-90
The settings for the controller may be reached by clicking the icon in the upper right of the PID
block. The block should also be placed in a Timed Interrupt OB:
An example from the Ball in Tube program is included in the following explanation. The second
PID program developed is the Tank over Tank.
STEP 7 provides two instructions for PID control. Use the PID_Compact instruction for the lab
in this course, please!
The PID_Compact instruction and its associated technological object provide a universal PID
controller with tuning. The technological object contains all of the settings for the control loop.
The PID_3Step instruction and its associated technological object provide a PID controller with
specific settings for motor-activated valves. The technological object contains all of the settings
for the control loop. The PID_3Step controller provides two additional Boolean outputs.
Ch 19 PID Block 73
After creating the technological object, you must configure the parameters. You also adjust the
autotuning parameters ("pretuning" during startup or manual "fine tuning") to commission the
operation of the PID controller.
Fig. 19-91
When programming the inputs and outputs, the following two instructions are used to scale and
normalize the analog value. Use the NORM_X function first to convert the number to a real in
the range 0-1 and then use SCALE_X to scale the normalized value to a range for the real value.
Ch 19 PID Block 74
The values in the table above are necessary to make the PID block work correctly. Some may be
set once and not included in the program as variables. Others must be included as programmed
variables. For example, if Input_PER is used, this input must be represented as a percent from 0
to 100.0. This value is the value fed to the PID block from the analog process variable, in this
case the laser. The variable must be represented in Input_PER as a ratio from 0 to 100.
Other variables in the table above are useful when coordinating with the faceplate. For example,
if the PID algorithm is set to manual, the ManualValue variable must be set to the desired state of
the output of the PID. The variable is moved to this location and the output is set to this value.
Ch 19 PID Block 75
Likewise, these variables contain information to allow the PID algorithm to function properly.
The state is a number from 0 to 8. We only use the values of 3 and 4 for the application given in
the Ball-in-Tube program.
The I/O address of the analog input point is shown in the analog input addresses of the base
processor unit. If additional analog points beyond two or if these points need a floating neutral,
then an additional analog input card is needed. In our example for the ball-in-tube lab, the input
addresses start at I:64. The first address is bytes I:64 and 65. The second input address is bytes
I:66 and 67.
Ch 19 PID Block 76
Fig. 19-92 Addresses of the Analog Inputs
Display of the analog points is done on a historical data plot shown below.
Fig. 19-93
Ch 19 PID Block 77
Project
Tree for
Ball-in-
Tube
Physical
Layout
of Ball-
in-TUbe
Fig. 19-94
A separate Cyclic Interrupt Program must be built to provide execution of the PID Block. The
PID program executes the PID algorithm after reading the Process Variable input. After
execution of the algorithm, the PWM output determines the state of the output to the fan.
The PID algorithm for the Ball-in-Tube program is shown below. The instruction is configured
and set up from programming statements as well as constants entered into the tables above.
Ch 19 PID Block 78
Fig. 19-96 The PID Block for the Ball-in-Tube Lab
The HMI panel below has a button to choose between auto and manual. In PID_PWM, the
button is in automatic. When in auto, the setpoint is entered on a separate page. The manual
value for the PID output may be entered below the button in manual mode.
Fig. 19-97
Ch 19 PID Block 79
Below the button is a data entry window for the value of percent on time for the fan. In this
window is the percent on time for the output.
The Configuration editor for PID_Compact shows the following screen. Here, the user selects
the units such as temperature or pressure. The user also determines whether variables such as the
PV are Input or Input_Per. Most users would select ‘general’ for controller type.
Use the commissioning editor to configure the controller for auto-tuning at startup and for auto-
tuning during operation. To open the commissioning editor, click the icon on either the
instruction or the project navigator.
Fig. 19-98
The following table lists some common suggested actions for assisting the set-up of the PID
controller:
Ch 19 PID Block 80
Other General Considerations for PID Programs
The faceplates below are samples of single loop faceplates that are accepted by most industry.
They resemble faceplates of actual PID controllers used prior to the computer. They may be
more or less sophisticated than these and may include the 3-d look or not. These are samples of
what is expected for proper HMI design of a faceplate.
Choose a faceplate and begin modifying it for the application. Several tags are provided with
each faceplate. These tags may set a number, allow entry of a number, move an animated arrow
or fill a sliding window. Bits may be added for auto/manual and local/remote. Note that alarms
may also be included such as the red and yellow tags above.
These faceplates may be modified with additional components. They may also be built from
scratch using existing components. At one time, the faceplate could be unbundled. While no
longer possible, the individual components may be animated by clicking them and then
Ch 19 PID Block 81
answering the questions.
The next two pages show the animation of the faceplates from Siemens and Allen-Bradley using
the faceplate as the starting point for the animation. While the faceplate given is not available
from Siemens, it can be built from parts using existing Siemens components. The up and down
triangles shown in the earlier faceplate may also be added to these faceplates for a more complete
system. The logic in the Siemens faceplate below show how to add the triangles.
The following logic can be used to add 1 % to the full scale value of the Setpoint. Similar logic
can be used for 5% increase or for 1% or 5% decreases. The triangle buttons on the original
faceplate showed these triangles. Similar buttons can be added to the CV or Output logic when
the PID algorithm is in manual. Similar logic can be added to the Allen-Bradley program.
The following from HPHMI examples in Chapter 15 show a group of PID controllers. Each
gives just the information necessary for the running of that controller. To change the mode of the
controller or to run the controller in a mode other than remote requires a more complete
faceplate. To add this feature, simply program an invisible button that calls a pop-up faceplate
similar to the one below.
Two new topics not explored in the earlier PanelView were alarm screens and trends. Alarm
banners were available in the older PanelView but were not as flexible as the newer alarm screen.
Also, trends are needed. Trend data is very important in that a trend of any variable can be used
to diagnose a problem either in the start-up phase of a project or later during daily operation.
Historical data trends will show long-term trends as well.
Control Valve
The graphical application may be run from the PC or downloaded to a target system. The tags
for the graphical screen may be those in the PLC. Care must be taken when selecting where the
process is to be displayed. If it is displayed from the computer screen, then Local is selected. If
the display is downloaded to the Panelview32, then Target is selected. In order to display the
process locally, a number of steps must be incorporated for the local application to correctly
“see” the PLC.
It is interesting that a number of different PID algorithms exist. No one standard equation is used
in all controllers. While the PID block has the same general function, nomenclature and the
action of the block may differ.
Three classifications of PID algorithms are considered major classes of design equations. They
are ideal, parallel and series or interacting. Equations for the three are listed below:
1 de(t )
Ideal: Output = Kc e(t ) + e(t )d (t ) + D
I dt
1 de(t )
Parallel: Output = Kp[e(t )] +
I e(t )d (t ) + D
dt
1 d
Series (Interacting) Output = Kc e(t ) + e(t )d (t ) 1 + D
I dt
Different manufacturers use one of the above control algorithms (except Siemens) as the basis
for their PID block. The three do not respond identically to different situations. A control
algorithm from one manufacturer cannot be guaranteed to work identically to the control
algorithm of a second manufacturer. Differences in the derivative action are especially critical to
the operation. For this reason, many do not use derivative action in the tuning of a loop. To not
use derivative action, set the derivative or D value to zero.
Manufacturers such as Honeywell, Bailey, Allen-Bradley, Modicon, Foxboro, Fisher, and Texas
Instruments pick one of the above types of equation to implement on their controllers. Some
manufacturers allow a choice between which algorithm is used. It is the engineer’s or
technician’s responsibility to understand the application, the PID equation, and choose the best
overall solution for the application.
Ch 19 PID Block 84
Bumpless Transfer
When the PID block is switched from manual to auto, the function responds to the SP presently
available to the block. If the process is sensitive to sudden changes in PID output, then the
program should include logic to give the output a signal matching the present flow when the
block was in manual. This is referred to as bumpless transfer.
With the more advanced PID blocks of the PLC/5 and Control Logix platform, the output value
that is described as the value to write to so that the output will be bumpless is the .SO value. The
.SO value of the PID block should be given the value that the operation would like the output to
have when the PID block is first put in Auto. This value is usually the value of the output when
the PID block is in Manual. The MOV operation should guarantee bumpless transfer when the
block moves from Manual to Auto.
For example, if the block was in manual and flow was 25.5 gallons per minute, when the PID
block is transferred to auto, flow should continue to maintain 25.5 gallons per minute. With PID
blocks, the addition of logic requires writing the present flow rate to the setpoint when the block
transfers from manual to auto.
A number of additional modes may be created for the PID block. Bits must be programmed
externally to the PID block for many of these other control modes.
An example is Control Output Tracking (COT). In COT, the loop is forced to manual and the
output moves to a programmed position until conditions in the program are stable enough for the
system to proceed to auto. In COT, the mode shown to the operator is AUTO with COT. The
system is perceived to be in Auto but the output or CV is actually in Manual.
This mode is ideally suited for burner start-up with a large number of burners. When the burners
are first turned on, the gas and combustion air are not able to be controlled under automatic
control. The burners need to operate in the extreme low range of the CV but the control valve
cannot be allowed to completely shut off. In the low range of most valves, proper flow rates are
not accurate and control becomes very unstable. COT allows the PID loops to operate for a set
period of time in manual at a preset position until the burners are all started and flows are at their
mid-range positions more capable of accurately being controlled. Then the PID algorithms take
effect in Auto and the PID loops begin the process of controlling the temperature in the furnace.
To the operator, the system appears to be in auto but in the program, the PID algorithm is being
controlled in manual until the auto mode is capable of accurately controlling the PID block.
COT is to be used only in start-up situations or in recovery operations in which it is necessary to
operate at a low-end setting to keep the burner system from shutting down.
When operating in a mode such as COT or Maintenance and when the mode is removed, the loop
should resume its former status.
Use a toggle input from the HMI and the following logic to program bits for A/M, L/R, COT,
and Maintenance.
Ch 19 PID Block 85
Auto Auto
B3:0/0 Error1
B3:0/0
Remote Remote
B3:1/0 Error2 Fig. 19-104
B3:1/0
Use of toggle bits to turn on a mode may not at first resemble a seal or latch circuit but in fact
they act in a manner similar to both. The toggle bit (B3:0/0 or /1) may be turned on by an
operator through the HMI and will remain on until the operator removes the toggle or until the
NC contact logic interrupt the flow. When this happens, the circuit reverts to the safer off state.
In the example of auto/manual (bit B3:0/0), the bit will turn off to the manual state. Note that the
actual state of the SLC Auto/Manual bit is reversed from this logic.
The discussion now describes multiple PID blocks used to control a process.
The following example shows how a PID loop can be imbedded within another PID loop:
Level Probe Level = xxxx
In the example above, the inner loop is the flow valve with its setpoint the CV from the Level
PID block. The outer loop is the Level PID block controlling level in the tank.
To successfully tune loops such as these, it is important to establish the order for tuning the
loops. It is also important to establish parameters for tuning them.
1. Tune the inner loop first. In this case, tune the Flow PID loop first.
2. Establish comfortable tuning parameters for it and then proceed to tune the outer loop.
Ch 19 PID Block 86
The outer loop should be tuned to respond more slowly than the inner loop. The outer
loop in the example is the Level PID loop. Try to tune it to respond about 2 to 10
times slower than the inner loop.
3. Stability problems occur in general if the two loops are tuned too closely together or
the outer loop is tuned to respond more quickly than the inner loop. So, keep the
inner loop fast, outer loop slow and observe any instability. Ramp blocks should not
be used on PID blocks such as these unless they are very quick acting. The inner loop
should not have a Ramp block.
We consider whether it is better to program the process in a DCS or PLC system today. We must
consider each element of the list given below. Which is more efficient and which will give the
best return for the customer. Remember the PLC can program in either Ladder or FBD, the
language most like that of the DCS people. Also remember that the DCS will probably need a
PLC also to mop up the digital part of the job.
What is beyond the PID function? Try Kalman Filter for starters. Give Student Dave at
https://www.youtube.com/watch?v=FkCT_LV9Syk or
https://www.youtube.com/watch?v=NT7nYv9Ri2Y a try.
Ch 19 PID Block 87
Summary
This chapter has the purpose of taking the programmer from the state of asking “What is a PID
loop” to being able to program a PID loop, implement a faceplate, consider how more than one
PID block can be combined to control complex processes and encourage the programming of at
least one PID project complete with tuning and HMI panel.
A student should be able to accomplish each of the steps listed above from the examples in the
chapter and implement a PID process in the laboratory.
Students should also be able to read a P&ID and interpret the parts of the P&ID that can be
implemented in a controller including the PID algorithm.
HMI considerations also should be heeded and alarms that control the mode of the PID block
were discussed.
Several Lab Text Labs expand on the discussions of this chapter. They may be found in the Lab
Text under:
Ch 19 PID Block 88
1. Lab 19.1 PID
Use the Extruder/Mixing System making Dog Food of Fig. 19-60 to design a PID
controller for the Fat Valve. A potentiometer may be present and (if present) may be
used to represent the motor speed. Input the potentiometer into a second analog input.
To simulate the change of speed of the motor, change the analog value from the pot.
Demonstrate the running face-plate with auto-manual and local-remote to the instructor.
When the PID algorithm crosses between auto and manual or between auto-remote and
auto-local provide a bump-less transfer (optional). You may program the A-B and
Siemens processors in either Ladder or FBD. Both processors must be demonstrated and
their PID control discussed in a lab report. The Siemens process is the ball-in-tube and
the A-B process is the water valve.
Add logic to PID Lab 17.1 to program to ramp from the old setpoint to a new setpoint
using a ramping block. Program the ramping only for the remote mode (although the
ramping function typically done in all automatic modes since it is needed to protect the
process). When a new value is entered in the remote Sp entry location, the PID’s Sp is
not to immediately change to the new Sp, but rather it is to be ramped up or down from
the present value (found in the Pv). Save the Pv when the new Sp is detected and
determine whether the Pv is below or above the new Sp. Set a seal coil or latch coil to
remember which way the ramp is going (either up or down). Also, start a timer to time
out each 5 to 10 seconds. When the timer times out, add a small amount (delta) to the
new Sp and then compare it to the Remote Sp. If the ramped Sp went past the Remote
Sp, stop the ramp and put the Remote Sp in the PID’s Sp. Then end the ramp program
and wait for another Sp change. Also, stop the ramp if the PID loop is taken to manual
from auto. Add a fault circuit that detects if the flow is dangerously low for the value of
the output. If this kind of fault occurs, the PID algorithm might begin to wind up (read
about anti-reset-windup in the PID section of the A-B book). If the low-flow fault occurs,
blink an alarm light on the PanelView and turn the PID block to manual. Set the bit in the
alarm banner.
Ch 19 PID Block 89
Exercises
3. T/F The controller performs exactly the same whether the controller is set for E = PV –
SP or E = SP – PV.
4. What is the purpose of the small triangles on the left and right side of the bar graphs of a
faceplate?
LT
LIC
FIC
dTC
6. The process engineer says that you are to move the PID controller from auto to manual if
any of the analog signals (4-20 mA) are invalid in the low range. Show with an example
how to accomplish this in ladder logic. Assume the analog inputs are in slot 5. Label all
rungs explaining your logic.
8. A speed sensor has a high and low alarm attached to it. The signal from the sensor is
transmitted to a computer. Draw a P&ID of the speed signal transmitter, high alarm and
low alarm. Assume the signals are attached to a computer and are field mounted.
9. A differential pressure transducer transmits a signal that is used for flow. However, flow
is proportional to the square root of the differential pressure. An analog input card is to
be used with range 1-5V input for the PV and an analog output card is to be used for the
CV, range 1-5V. The SP is to be input from an HMI. Draw the P&ID showing the
mathematical calculation of the square root. Any symbol type is appropriate. Then write a
program to control the flow using the analog cards listed. Assume the input card is in slot
4 and the output card is in slot 6.
10. In some temperature control, the output device is a switch that turns on or off a resistor to
produce heat. If the output of a PID block is fed to a discrete output that can only turn the
resistors on or off, write a program to turn the discrete output on or off a proportion of 10
seconds based on value of the CV. Assume the output CV can range only from 0 to 100
and is its value is found in a storage location.
11. Build a lag controller capable of a 5 second lag with value changes each .5 second. Build
a lag controller capable of an x second lag with value changes each y second.
Ch 19 PID Block 90
12. Using either the PID blocks from A-B or Siemens, provide a program that will work in
auto mode for the following P&ID. Use variables as inputs, outputs and internal
variables as necessary. Describe these variables in a table.
13. Write logic to provide a 30-second lag given that the variable is to be updated each .1
second. Use A-B ladder format to demonstrate your answer.
14. Using either the PID blocks from A-B or Siemens, provide a program that will work in
auto mode for the following P&ID. Use variables as inputs, outputs and internal
variables as necessary. Describe these variables in a table.
Ch 19 PID Block 91
15. At the end of Ch. 19 is an article:
What does the author claim for the basis of his arguments and what would you do as a
PLC programmer to counter these claims? Be specific:
16. Using either the PID blocks from A-B or Siemens, provide a program that will work in
auto mode for the following P&ID. Use variables as inputs, outputs and internal
variables as necessary. Describe these variables in a table.
17. Give an example of multiple inputs being used instead of just one value for the PV
(Process Variable) of a PID Loop. Write a program using either A-B or Siemens to
demonstrate your answer.
18. An example was given in class describing how to control the pressure in a steel furnace
even when the door was opened. Describe of how you would accomplish this. Be
specific:
Ch 19 PID Block 92
Stack Damper
Pressure
Sensor
19. If an input range is listed as 0 mA to 21 mA range is from 0 to 32640 and we want a 4-20
mA. What is the numeric range of a 4-20 mA signal?
21. A good cyclic time to update the PID Control for a servo:__ _______________________
23. A good cyclic time to update the PID control for a water loop:______________________
25. A good cyclic time for update of the PID control for a temperature loop:_____________
26. Name a PID control loop that does fine with no derivative component:_______________
27. Name a PID control loop that is unstable if the derivative is left at zero:______________
28. The following program is a starter program to control the wind-up of the tape. To start
understanding it, provide comments for each statement in the program listing. All
statements are found in the cyclic interrupt program OB30 which is run each 100 ms.
The individual motor programs can be used to control the speed portion of the gearmotor
project discussed in the chapter.
Ch 19 PID Block 93
Ch 19 PID Block 94
Ch 19 PID Block 95
29. The following program is a starter program to control the control of water level in the top
tank. To start understanding it, provide comments for each statement in the program
listing. All statements are found in the cyclic interrupt program OB30 and start-up
Ch 19 PID Block 96
program OB100. OB30 is run each 1000 ms (1 sec).
Ch 19 PID Block 97
Ch 19 PID Block 98
This work is licensed under a Creative Commons Attribution 4.0 International License.
Ch 19 PID Block 99