In automation programming,
we are often required to program a control loop
for a given process to control temperature, pressure, flow rate etc.
This requires a target set point with a controlled feedback process variable.
A PID process loop controller
is designed to generate an output that causes some corrective effort
to be applied to a process
so as to drive a measurable process variable
towards the desired set point value.
The controller uses an actuator to affect the process
and a sensor to measure the results.
Often automation technicians and programmers
are required to become familiar with
configuring and tuning a PID loop control instruction
and it can be one of most overwhelming
when it comes to PLC programming topics.
In this lesson,
we will discuss how a Rockwell Automation ControlLogix 5000 PLC
using the Enhanced PID controller function block instruction (PIDE).
The PIDE is an Allen Bradley Logix5000 Process Automation Controller
or "PAC" family (ControlLogix and CompactLogix) function block
that improves on the standard PID found in all their controllers.
before we get started on today's video
if you love our videos,
be sure to click the like button below.
then make sure to click subscribe
and the little bell to receive notifications of new RealPars videos.
This way you never miss another one!
Function block programming uses diagrams with symbols
to represent function
and input and output connections between functions.
While at first, this function block can be quite intimidating,
it shares similarities of the standard PID instruction
and you’ll only need to turn on parameters required by your control program.
In this example,
we will basically get you off the ground using the PIDE instruction
and the program options essential to get it working.
In case you may have forgotten what PID stands for,
the “P” stands for “Proportional” gain,
“I” for “Integral” time
and “D” for “Derivative” gain.
PID and PIDE are used for "process control"
which includes the automatic control of systems such as temperature,
flow rate, pressure, and speed.
The cruise control on a car is a good example of this type of control.
Basically, you tell the controller how fast you want to go,
the Set point and the controller samples the actual speed,
the Process Variable,
and then the controller calculates an output value, the “Control Variable”,
and sends that signal to the gas pedal.
And just as a PID functional refresher,
and using the car cruise control as an example,
the “P” or proportional
is described as in the farther you are from the desired speed,
the more you press the gas pedal and on the other hand,
the closer you are, the less you press on it.
This works well but when you get at the desired speed,
based on this rule you would let off the gas completely.
And the end result is your car slows down
and stays a little below the desired speed.
Proportional control is the main ingredient of any control
but maybe a little inaccurate.
For “I “or integral, you wait for a little,
and if there is no improvement you push a little more on the pedal.
If you are stuck below the desired speed for a long time without progress,
you push the gas pedal a little further.
If you still do not make it to the desired speed for some time,
you again push the pedal a little further down.
Once you get to the desired speed you leave the pedal where it is.
Integral control gives you accuracy but you have to wait.
And for “D” or derivative, you react to sudden changes.
Let’s say a strong wind gust pushes your car.
Suddenly your speed surges fast upward toward the desired speed.
You become startled so you release the gas pedal.
As the speed surge ends and the speed stabilizes,
you will then return the pedal to where it was.
Derivative control manages sudden surges
and may prevent overshooting your target speed.
If you enjoy function block programming, as I do,
you will benefit from using this enhanced version instruction
over the standard PID instruction for a few reasons.
The PIDE instruction offers a built-in auto tune feature
which works reasonably well,
the PIDE is programmed using a function block
and not available for ladder logic programming,
it uses the velocity form of the PID algorithm.
This is especially useful for adaptive gains
or multi loop and cascade process control.
The PIDE instruction can be switched between “Program” and “Operator” modes
and provides full bumpless transfer
into and out of cascade mode,
and this instruction has more fault handling selections.
The following programming steps assume the reviewer
has Studio 5000 experience.
Okay, let’s get started and create a new “Studio 5000” project.
Locate the desktop or taskbar icon for Studio 5000 and launch the program.
Create a new project,
select a new controller type
such as the 1756-L71 and give the program a name,
in this case, “PIDE_EXAMPLE”.
Hit “Next” and in the next window
keep everything as it is and then click Finish.
For the next step we need to create a new “Routine”
by making a new “Task” and a new “Program”.
So first I’ll create a new scheduled task by right clicking on the “Tasks”
and then clicking on the “New Task”.
In the next window I will consider “PIDE_CONTROL”
as the name for the task.
The period of the task automatically becomes the sample rate of the PID loop.
it is best to set it up in its own periodic task.
So, I’ll leave these settings without any changes
and continue to create a “New Program”
by right clicking on the “PIDE_CONTROL” Task.
In this menu, I’ll open the “Add” menu and click on the “New Program”.
I will name the program as same as the “Task”, which is “PIDE_CONTROL”.
Finally, I’ll click OK to close this window.
The next step in the process is to create a new “Routine”.
To do that I’ll right click on “PIDE_CONTROL” Program,
then “Add” and then I’ll select “New Routine”.
In this window, I will name the “New Routine” as “PIDE”.
Just make sure to select the Type
as “Function Block Diagram” and then click OK.
As you can see, the “PIDE” icon is added here
and I can open it up by double clicking on it.
Now that I have opened the “PIDE” program,
from the “Process” tab in the library,
I will add the PIDE function and add it onto the sheet.
Now let’s suppose we have a mixing tank
where the temperature is to be maintained at a certain set point.
The control valve allows a catalyst to be added to the tank
to increase the temperature
and the temperature transmitter will send the feedback to the PID.
This will represent our process and control loop for programming purposes.
Now to be able to configure this block I need to open up the properties.
To do that I’ll simply double click on the block.
In the “General Configuration” tab,
we will use the default configuration.
However, we just need to make sure that for the “Timing”
it is using “Periodic Mode”,
the “Control Action” is set to “E”
and for the “Calculate” it is using the “Proportional” parameter set to “E”
and the “Derivative Term” is set to “PV”.
Next, in the EUs/Limits tab,
I will set the “Engineering Units Scaling”
for both “CV” and “PV” parameters
from 0 to 2500 degrees Fahrenheit,
with a set point limit of 500 to 2200 degrees Fahrenheit.
The control variable limits will be using the same temperature engineering units.
In the “Parameters” tab,
there are several parameters which PIDE function utilizes them
that you may or may not use them.
These parameters can be manually turned off or on here.
When selected, the parameter will be exposed to allow program connections.
Here there is also a “Description” field for each parameter
which gives you more information about them.
I’ll select the required parameters and deselect the rest.
Next I’ll hit OK to save the configuration.
You can see the required parameters I’ve selected in the PIDE block here.
After the PIDE function block is configured
we can begin to add program control Input and Output reference tags
to adjust the PIDE block performance.
The main Input references are the Temperature PV
or process variable which is a feedback from temperature transmitter,
the SPProg or Program Set point which is defined by the operator on the HMI,
and the CVEU or “Control Value in Engineering Units” output
to control the heat in the tank by opening or closing the control valve.
Other inputs added are inputs for the controlling the set point high and low limits,
the maximum and minimum Engineering Units
and Auto_Manual control
to allow for direct manual control of the catalyst control valve.
The CV_Manual input reference value
will be used for the manual control when Auto_Manual is turned OFF.
The PIDE will need to be tuned and we have set the tuning parameters “P” gain to 1,
“I” gain to 0.5 and “D” gain to 0 to a recommended starting point.
PID tuning can be tricky
so I recommend reviewing procedures for this technique.
The standard reference for PID tuning seems to be the Ziegler-Nichols tuning rules.
This concludes the video ,
Programming Basic ControlLogix PID loop using the PIDE block instruction.
I hope you have enjoyed learning what will support you in your upcoming project.
If you would like to get additional training on a similar subject,
please let us know in the comment section.
If you enjoyed this video, please press the like button.
Please check back with us soon for more automation control topics.
Want to learn PLC programming in an easy to understand format
and take your career to the next level?
Head on over to realpars.com