Você está na página 1de 87

L16 - Model Predictive Control Within the Logix

Controller Lab Manual

For Classroom Use Only!


Important User Information
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances


that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.
PlantPAx® MPC: Optimization in the Logix Controller for Easy Deployment

Contents
Before you begin ............................................................................................................................................................................... 4
About this lab .................................................................................................................................................................................... 4
Introducing Model Predictive Control ................................................................................................................................................ 4

PlantPAx MPC Exercises (Logix embedded MPC)....................................................................................... 6


Model Predictive Control on a Coating Oven .................................................................................................................................... 6
The Process: Oven Advanced Control.............................................................................................................................................. 6
Operating Conditions ........................................................................................................................................................................ 7
Track 1 - Develop, Download and Interact with PlantPAx MPC ....................................................................................................... 7
Track 2 - Process Library Objects for MPC: View Faceplates, on/off control, model quality & plant testing .................................... 9
Lab tools & prerequisites ................................................................................................................................................................ 10

Track 1 – Control Design with PlantPAx MPC ............................................................................................ 12


Lab Shortcuts .................................................................................................................................................................................. 12
Phase 1 – Building Controller Model............................................................................................................................................... 13
Phase 2 – MPC Design................................................................................................................................................................... 28
Phase 3 – Validating MPC Design .................................................................................................................................................. 36
Phase 4 – Exporting MPC to Logix ................................................................................................................................................. 41
Phase 5 – Executing MPC in Logix................................................................................................................................................. 44
Phase 6 – Monitoring MPC ............................................................................................................................................................. 49
Phase 7 – Tuning MPC from Faceplate .......................................................................................................................................... 52

Track 2 - Process Library Objects for MPC ................................................................................................ 55


Phase 1 – Installing and running oven control project .................................................................................................................... 58
Phase 2 – Integrating MPC Accelerator Toolkit into FT View SE Project ....................................................................................... 61
Phase 3 – Interacting with PlantPAx MPC Faceplates ................................................................................................................... 68
Phase 4 – Interacting with MPC Accelerator Faceplates ................................................................................................................ 79

3 of 87
Before you begin
This course introduces users into development and installation of Model Predictive Control (MPC) in Rockwell Automation DCS
PlantPAx environment. The user is assumed familiar with general control vocabulary and general integration concepts of
applications within a DCS/control system environment along with general process behaviors in processing equipment.

About this lab


The lab focuses on new Logix embedded product PlantPAx® MPC and tools from PlantPAx Library of Process Objects that
accelerate integration of MPC functionality into application projects. MPC states for a model predictive control technology that is
described in more detail below. Any MPC package incorporates a configuration software where process models are developed,
a run-time execution program that executes periodically at a selected cycle-time (execution frequency) to calculate optimized
control actions based on continuously varying input data and a run-time visualization environment where advanced features and
user interactions with a running controller are provided.
Steps for designing MPC controller and using MPC in Logix Designer projects will be presented. The lab will provide a brief
introduction to MPC control along with examples demonstrating the value that MPC can offer for process control applications.
You may choose between two options of the Lab.
Track I of the Lab will guide you through:
1. Designing a MPC for a particular process
2. Generating a MPC Add-On Instruction and importing it to a Logix Designer project
3. Downloading the project to a Logix controller and testing it on process simulator
4. Monitoring MPC behavior on-line
This lab takes approximately <90> minutes to complete.
Track II of the Lab focuses on use of components available from PlantPAx Process Library supporting MPC applications
allowing you to:
1. Start with a process control project using PIDs, add MPC to be used instead of PIDs leaving the original control
scheme at place as a backup while adding bumpless MPC-PID transfer
2. Evaluate quality of the model MPC uses for calculating predictions
3. Plan and execute identification experiment efficiently
This lab takes approximately <60> minutes to complete.

Introducing Model Predictive Control


Model Predictive Control (MPC) is an advanced control methodology that uses explicit dynamic models identified from plant tests
to delivery improved control performance particularly with processes with interacting controllers that are better coordinated,
processes with long or complex time lags, processes with measurable disturbances that can be measured before they divert
objectives from targets and processes where an operator wants to routinely push to limits (constraints) to maximize performance.
1. Interacting controllers – MPC is multivariate so different PID loops or process actuators can be coordinated such as
throughput and energy, heating and cooling, different feed materials, etc. The most common challenge is maintaining
product quality and consistency while production rates are increased or decreased.
2. Long or complex time lags – MPC has explicit dynamic models on each interaction so it can directly specify very slow
processes or responses with long delays that are difficult for PID algorithms. MPC can coordinate fast and slow
responses such as hot air in a kiln with slow solid flows and can deal with challenging dynamic responses such as

4 of 87
inverse or responses that vary with throughput.
3. Measurable disturbances – MPC can incorporate measurements of upstream changes that operators are aware and
sometimes watch out for that will cause process upsets such as changing feedstock quality, weather changes or even
daily cooling water and other utility cycling.
4. Maximizing performance up to constraints – MPC can also incorporate operating targets along with process limits.
These constraints can be directly enforced and this allows a more comfortable, safe approach to the process limits that
enable production, energy efficiency and yields to be maximized.
Rockwell’s Model Predictive control is now available in two options, controller based (PlantPAx MPC) and workstation based
(Pavilion8 MPC) platforms.
• PlantPAx MPC – runs on PlantPAx or ControlLogix platform and requires a 1756-MPC module that executes MPC
instruction and their instances in the ControlLogix chassis extending process control capabilities of the ControlLogix Control
System to enable powerful Advanced Control capabilities with a controller. The PlantPAx MPC instruction supports MPC
applications up to 10 Manipulated Variables (MV’s), 10 Controlled Variables (CV’s) and 10 additional Disturbance Variables
(DV’s). The PlantPAx MPC instruction allows a user to change design parameters, including process model parameters, on-
the-fly.
The PlantPAx MPC Instruction Set consists of:
- A Built-in MPC Instruction that executes in dedicated MPC Module, which can support up to five independent instances
of MPC instructions, and
- An MPC Client AOI and the MPC Tag that become parts of a user program running on a Logix Controller.
A workstation-based monitoring option is available for advanced monitoring, but is not required so that all MPC calculations
are workstation independent. This makes integration with your measurement and control system direct and easier, puts
MPC at a closer proximity to measurement and control actuators and delivers MPC on a stable and reliable PlantPAx
platform.
• Pavilion8 MPC – runs on a dedicated workstation connected to any control system via FTLiveData or OPC so it is designed
for applications supporting any DCS including PlantPAx. Because of the higher CPU and memory capabilities available on
a workstation very large-scale MPC problems can be solved with Pavilion8 MPC, nonlinear problems are solved directly and
this controller can incorporate simple real-time optimization directly in the MPC configuration.
For their hardware platform both Rockwell MPC options are some of the most powerful available technologies for advanced
control you can find. They share similar dynamic model and tuning parameters and will in the future use more and more common
advanced tools. Today there are two individual MPC configuration environments, two run-time executables and two advanced
dashboard platforms. In this lab we will work through development of the MPC solution on either platform so you can pick the
toolset of your choice. While we try to describe the ideal application of each option above the simplistic difference is PlantPAx
MPC is even easier to use today, particularly on a Logix-based DCS and Pavilion8 MPC is a more technically capable
technology and designed for any or even multiple different DCS technologies today.
The lab today provides a deep working exercise with PlantPAx MPC based on an oven control example.

5 of 87
PlantPAx MPC Exercises (Logix embedded MPC)

Model Predictive Control on a Coating Oven


The lab offers two design exercises (Tracks) to choose from. Both exercises deal with the same control problem and the process
to control, organic coating oven. Let’s start with introducing the oven control problem.

The Process: Oven Advanced Control


Organic coating stands for surface finish manufactured using a mixture of film-forming binder resins, such as those based on
alkyd, nitrocellulose, acrylic, polyester, or other chemistry and flammable or combustible solvents, such as hydrocarbons, esters,
ketones, and alcohols. Such a process is economic, ecological and offers consistent quality and flexibility in surface finish, color
and gloss. The hearth of the process is a curing oven preceded by coating head applying liquid paint to both sides of the treated
metal strip. The strip is then passed through an oven, where the solvents are extracted and the coating cured.
The following figures show the principal scheme of a coating line and a single zone of the oven considered as a Lab object.

There are two variables under control, oven temperature (CV0) and oven pressure (CV1). Oven temperature has to track the
setpoint which changes dynamically from time to time depending on the recipe while oven pressure should be kept below
atmospheric pressure to prevent poisonous gasses to penetrate to the service area via entry and exit doors that cannot be
hermetically closed. High quality product is manufactured if the oven temperature differs less than ±1degC from the setpoint.
The oven gets heat from two sources, local gas burner and central hot air supply. Heat delivered by hot air is recuperated and
thus it is a preferred heat source over gas due to energy cost. There are two actuators manipulated by a control program, gas
control valve opening setpoint (MV0) and flap valve opening setpoint (MV1). Opening of the flap valve is limited and the limit
varies due to external conditions.

6 of 87
There are four disturbance variables affecting temperature and pressure to some extent. The lab considers hot air supply
temperature (DV0) and pressure (DV1), ambient temperature (DV2) and suction flow (DV3). All of them are measured.
There are mutual interactions between MVs, DVs and CVs. To summarize, the problem is a typical MIMO constrained control
problem for which it is difficult to design an algorithm utilizing conventional means, like PIDs.

Operating Conditions
Operating conditions for the process are shown in the following figure.

Track 1 - Develop, Download and Interact with PlantPAx MPC


The control problem includes maintaining oven temperature and pressure while manipulating with multiple heat supplies
simultaneously with the aim of achieving high quality recipe tracking, using low cost heat whenever possible and rejecting the
effect of various disturbances on-the-fly. This exercise guides you through typical green field installation of MPC replacing an
operator controlling the process manually.
The Lab is organized according to the scheme shown below as follows:
 Upload the trend log file OvenDataSet.CSV into the MPCBuilder and run identification to get parameters of linear process
model that will be used by the MPC for predictions.

7 of 87
 Enter MPC design parameters meeting control requirements and validate your design in simulation using MPCBuilder
software.
 Export MPC to the available Logix Designer project Oven.ACD.
 Open and download the Oven project to Logix and run it. The program will execute a cycled session with changing recipe
(target oven temperature) in Logix. MV1 constraint and disturbances vary automatically being in-built into the session
scenario.
 Monitor what MPC calculates as a prediction for MVs and CVs using MPCBuilder software connected to the MPC instruction
via MPC Tag in Logix on-line
 View and use HMI with Faceplates for process monitoring and tuning.
There is an easy way of quantifying the quality of your design through monitoring of two Key Performance Indicators (KPIs)
associated with oven temperature, Over Limit Time (OLT) and Over Limit Area (OLA) per session cycle. Both are to be as small
as possible as they have quality and thus economic consequences.

There are Lab workflow shortcuts available in case you are running out of time. You can skip some phases taking the advantage
of starting from files with partially completed project as shown in the following scheme. Go to Track 1 – Control Design with
PlantPAx MPC
Lab Shortcuts section on page 12 to get the details.

8 of 87
Note that Oven project (Oven.ACD) contains the complete lab and thus can be used as-built, when lab time expires, for Phase 5,
6 and 7 only.
This lab takes approximately <90> minutes to complete.

Track 2 - Process Library Objects for MPC: View Faceplates, on/off control, model quality & plant testing
This exercise guides you through steps you typically go through when enhancing the capabilities and performance of the existing
control scheme. The task is to enhance the oven control using PIDs maintaining oven temperature by MPC. PIDs should stay in
place and serve as a backup when MPC goes for maintenance.
Let’s assume you have already designed, developed and interacted with embedded Model Predictive Control, i.e. have done the
oven lab in the past. Your task is now to build bumpless switching between PID and MPC and focus on monitoring the
performance and running model identification experiment all with the help of PlantPAx Process Library tools developed for
PlantPAx MPC to assist in project deployment.
The Lab is organized according to the schemes described above and is completed as follows:
 Open and download (Track 2) Logix project OvenPL.ACD and open FT View SE client with HMI ready for the application.
Make a few specific changes to the configuration.
 Add the new process library AOI’s to your project and integrate the three new AOI’s for turning MPC on and off, tracking MPC
model quality and automating plant testing.
 Add the respective set of faceplates to your FT View SE Project using FT View Studio, open your client application and use
each of these objects as designed.
 This lab takes approximately <60> minutes to complete and starts on page 57.

9 of 87
Lab tools & prerequisites
 Software required
 Studio 5000
 FT View Studio
 FT View SE Client
 RSLinx Classic
 PlantPAx MPCBuilder
 Hardware required
 1756-A4B ControlLogix 4 Slot Chassis
 1756-PA72C ControlLogix AC Power Supply
 1756-L75B ControlLogix Controller
 1756-ENBT ControlLogix Ethernet Module
 1756-MPC ControlLogix MPC Module
 Files required
 Oven.ACD … Logix Designer project with process simulator, MPC and session scenarios
 OvenPL.ACD … Logix Designer project with process simulator, PIDs, MPC, Process Library Add-on
Instructions supporting MPC application and session scenarios
 OvenDataSet.CSV … file with pre-recorded process step responses
 OvenVariables.txt … file with names of individual variables used in the project
 Oven_ModelReady.mpc … MPCBuilder project with Controller Model built from Oven data set (for lab shortcut)
 Oven_SimulationReady.mpc … MPCBuilder project with Controller Model and Process Simulator (for lab shortcut)
 Oven_ExportReady.mpc … MPCBuilder project with complete MPC design (for lab shortcut)
 Prerequisites
 Basic skills in Ladder logic and FBD programming in Studio 5000 is assumed for the Lab

10 of 87
The Lab configuration and the shortcuts available from the startup screen of the Lab image is shown in figures below.

11 of 87
Track 1 – Control Design with PlantPAx MPC

Lab Shortcuts
There are couple of shortcuts you can take on the first laboratory track to save time or focus on features you would like to study
in more details. The list of shortcuts follows.

Start from Phase 2 – Designing MPC


 Copy Oven_ModelReady.mpc file from “LabFiles” folder to “Work” folder.
 Open the project in MPC Builder.
 Continue from page 28.

Start from Phase 3 – Validating MPC Design in Simulation


 Copy Oven_SimulationReady.mpc file from “LabFiles” folder to “Work” folder.
 Open the project in MPC Builder.
 Continue from page 36.

Start from Phase 4 – Exporting MPC to Logix


 Copy Oven_ExportReady.mpc file from from “LabFiles” folder to “Work” folder.
 Open the project in MPC Builder.
 Continue from page 41.

12 of 87
Phase 1 – Building Controller Model

01. Double click on MPC Builder shortcut icon on your desktop to start MPC Builder

02. Go to File > New Project

03. Enter number of variables related to the process, i.e. 2 for MVs, 2 for CVs and 4 for DVs

04. Click OK
The MPC Controller matrix with empty Controller Model and default setting of MPC parameters appears as follows.

13 of 87
05. Open the text file OvenVariables.txt (this file is in “Lab Files” an icon on your desktop), which contains our tag
names that will be used in identification. We want to update our variable names to match the tag names in our
dataset. This makes our process models and future control integration more straight-forward and
understandable. Also open the MV information in our controller at the arrow above in the right pane by MV.

14 of 87
06. Select the name next to mv0 in the OvenVariables text file, copy and paste that name into the Name attribute for
MV0 in your new controller (and hit enter).

07. Paste the exact name from your txt file into each controller variable. Do this for all variables in your controller
(remember to select ‘Enter’ to update the variable display name).
The overall controller should now look like the below display (although various attributed on the right are collapsed partially).
Now your MPC application is specified with the used controller variable names.

08. From MPC Builder Menu choose Identification > MPC to ID

15 of 87
to get the startup screen for conducting identification tasks

09. From MPCBuilder Menu choose Identification > Add DataSet

16 of 87
10. Browse the “Lab Files” folder (C:\Lab Files\PlantPAx MPC) and choose OvenDataSet.CSV for the File Name

11. Type OvenDataSet in the Create new data set field of the New Project window

17 of 87
12. Click Next

13. Classify variables available from the data set file to CV/MV/DV categories. The role of variable will be preserved
and thus they should appear in the same category as indicated here, i.e. CVs are Oven Temp and Oven Press,
DVs are Hot Air Temp, Hot Air Pres, Ambient Temp and Suction Flow and MVs are the Gas and Air Flap Valves.

18 of 87
14. Click Next. The Chart Window with raw data view available for OvenDataSet.CSV file appears.

15. Click Next.


A window enabling renaming variables and adjusting the sampling interval appears. Do not rename the variables as they match
variable integration in your controller file. This is much simplified by updating variable names within the previous steps. The
DataSet also uses regular sampling rate with sampling period of 500ms. Leave the sampling period unchanged.

19 of 87
16. Click Finish. You are ready to start controller model identification.

17. Unpin (drag and drop) Raw Data View from the main window to see the data set in more details. In Raw Data
View change plot type from Stack to Normalize if you prefer to normalize all variables to 0-100% and plot them in
the same window area. You will be selecting time ranges to identify plant response and sometimes plant steps
are easier to see in “Stack” (not overlapped) plots and sometimes they are more evident in Normalized plots.
You may change this within identification steps to your preference during different activities.

It is generally recommended to have these plots and the MPCBuilder identification windows side-by-side.

18. Go to the <Identification> Tab and click on the top left cell.
This tells the MPC Builder that you are going to identify parameters of a transfer function describing relation between
Oven_Temp (yellow CV0, process output) and Gas_Valve (blue MV0, process input).

20 of 87
The selected variables are highlighted in the raw data view plot (actual color resolution can be difficult depending on your graphic
driver).

19. Use your mouse to mark the time window that will be processed by the identification routine.

Simply point your mouse where you would like the window to start, keep the left mouse button pressed, drag
the mouse to the right or left and release the left mouse button where the window should end. The MV and
DV moves have been designed such that the marking of windows is clear. Start just before the MV/DV step
is applied and finish before the next different MV/DV starts to move as shown in the figure.

21 of 87
20. Click the right mouse button in the selected cell to view options related to the identification task

21. Choose <Run Identification> from the context menu

The identification is run with MPCBuilder default settings for simplicity. You have number of options to
choose here, e.g. model order and range of transfer function parameters the id routine will have to work with.
The default setting assumes the non-integrating first order transfer function with dead time which fits our
case sufficiently well. Range of parameter values is left undefined before the identification starts.

22 of 87
Good practice is to determine up front what models are integrating (non-stable) or non-integrating and then
initially identify your model with a first order transfer function. Then if the model fit indicates a higher order
transfer function will improve the identified data fit, try the likely second order transfer function.

An analysis window enabling you to plot the raw data against the response of the identified model in window selected for
identification appears. This displays a good fit although there may be a very minor second order underdamped response. For
now we will move forward with a first order transfer function as this initial miss match is very small for an excellent overall fit.

22. Close the analysis window.


The cell in the ID model matrix is now filled with step response of the identified transfer function including the process gain.

Repeat the same procedure, i.e. steps 18-22, for other cells with the exception of cells identified by pairs Oven_Press-
Gas_Valve, Oven_Press-Hot_Air_Temp and Oven_Press-Ambient_Temp as the effect of changing gas control valve, supplied
hot air temperature or ambient temperature on oven pressure is not seen in process responses.

23 of 87
You should arrive at the Controller Model shown in the figure below. Check the individual gains. A perfect
match is not expected as your result will probably use slightly different time windows chosen for identification.
Ask the instructor for help in case you would like to consultation on your results. Also remember that you can
redo an identification until you are satisfied with the results. An error or warning message generally indicates
you have selected a bad region for identification in this lab, although in a real process can indicate you need
an improved plant test.

Do not Do not Do not


identify identify identify

Optional steps: If you want to modify that first model to try for a better fit reselect the model between Gas_Valve and
Oven_Temp shown above with a gain of 1.7. The identified dynamic parameters are displayed and you can change the transfer
function (your model) type from FirstOrder to Second Order by selecting that model type and choosing the desired apparently
better transfer function.
Select second order overdamped (an underdamped response displays a response that overshoots the final stable value),
confirm the relevant testing area is selected (or reselect) and identify the model again.

24 of 87
Notice the improved initial fit.

23. Close Raw Data View.

25 of 87
24. Go to Identification > ID to MPC to transfer the results of identification task to MPC for the use as Controller
Model.

Mapping of variables matches exactly in our case thus do not change anything in the MPC ID mapping window that appears.

25. Click OK to close the MPC ID mapping window.


The MPC Controller window is then populated with the process model that will be used as a Controller Model by the controller for
calculating predictions and optimal control moves.

26 of 87
26. Go to File > Save Project As > Oven.mpc

Your project is ready for setting design parameters of MPC.

27 of 87
Phase 2 – MPC Design
Your task is to design and implement MPC for Logix Project with the following requirements
 Track oven temperature setpoint driven by recipe, ±1°C tolerance
 Keep oven at pressures below atmospheric to avoid pollution (and to protect operator safety)
 Prefer recuperated heat over burning gas whenever possible and economical
 Minimize effects from disturbance variables
The default setting of most of the parameters can be used as a starting point of your design. Only limited number of parameters
require application specific settings. Application specific settings will be discussed next.
Let’s summarize control design considerations for setting application specific parameters.
 Sampling period and Horizon
MPC sampling period selection should take into account process dynamics and settling time of oven temperature in particular.
The rule of thumb is having at least 10 samples per rise time and the prediction horizon should be as long as the settling time of
the process step response. 50 second horizon (=Horizon×OversampleDT = 100×0.5) appears OK. The sampling period is the
frequency of your control moves and the Horizon is the number of samples the prediction horizon of your controller observes.
 MV and CV related parameters
MPC penalizes fast changes in MV using the MoveSupp parameter and difference between desired and calculated value of MV
(or CV) using the Coef parameter. Move suppression is a penalty for larger move sizes by penalizing the square of your MPC
moves and Coef is a weighting parameter to prioritize important variables over less important objectives. Scaling is used to
balance various variables by relative ranges of their engineering units – this scaling makes tuning simpler so that Coef and
MoveSupp is importance and the engineer can ignore unit differences.

Relative importance of setpoint tracking of CVs is also set by the Coef parameter.

There are also limits associated with MV and ∆MV that should be considered (generally safety limits or safety limits based on
maximum allowable move size within one MPC step). These are not tuning parameters, but safety limits.

27. Start MPC Builder and open Oven.mpc project saved in the previous step or just continue your work when your
project is left open.

If you take the shortcut, copy the Oven_ModelReady.mpc file from LabFiles folder to Work folder, open it in
MPC Builder and continue the lab in next step.

28 of 87
28. Open Control parameters and follow changes shown in red below.

29 of 87
29. Open MV0, Gas_Valve parameters and follow changes shown in red below.

30. Open MV1, Air_Flap_Valve parameters and follow changes shown in red below.

True

10
10 10
10
100 100

The reasoning for MV0 parameter settings specific to the control task and process characteristics is as follows.
SPValueReq=True as you would like to keep gas valve closed (MV0 SP value set to 0) whenever possible to save gas.
RocPosLimit=10 %/s and RocNegLimit=10 %/s to cope with the rate position change of gas control valve in the Simulator 10%/s.
Scale=100 % which is the gas control valve operating range. MV1 parameter settings follow the same rules except for
SPValueReq which is kept False as there is no reason for preferring any specific desired position of hot air flap valve. It will be
determined by the control targets.

31. Open CV0 (Oven_Temp) parameters and follow changes shown in red below.
Have in mind that the task is to track CV0 setpoint delivered as a trajectory ahead of time so the MPC can prepare for coming
changes in SP. This is why you set SPValueReq=False and SPTrajectoryReq=True. CV0 should be kept as close to the setpoint
as possible so set Coef=1000 to specify high importance of such a request. The expected operating range of oven temperature
is 100°C and thus Scale=100.

30 of 87
32. Go to CV > Oven_Temp > SPTrajectory and modify setting of parameters indicated in red in the following figure
to define the type and size of setpoint trajectory that will be created later. This will program a future trajectory of
targets for oven temperature.

33. Open CV1 (Oven_Press) parameters and follow changes shown in red below.
You do not set CV1 setpoint as the task is to keep CV1 within limits. This is why you set SPValueReq=False and ZoneReq=True.
Set ZoneHiLimitProg= -1 Pa and ZoneLoLimitProg= -20 Pa to prevent escaping flue gases via oven entry and exit doors and not
allow too low pressure which might cause oven body to deform or suck dust through entry and exit doors. The same limits should
be set for ZoneHiLimitOper and ZoneLoLimitOper, SPHiLimit and SPLoLimit. Also Set SPProg and SPOper to -10 (so these are
within valid limits even if inactive). Coef is set 100x smaller than the same parameter for oven temperature as pressure is not the
key quality parameter here. Scale= 10 Pa is a standard operating range of oven pressure.

34. Go to CVSPTrajectory below other Controller sections, define its size (12) and click OK. A table allowing you to
specify profile of a trajectory appears.

35. Enter Setpoint Trajectory according to the following figure.


There are six points of the piecewise profile that will be cycled as part of the session scenario. The first six entries of
CVSPTrajectory define time index and other six the temperature target values as time progresses.

31 of 87
36. Go to standard toolbar and click on New Simulation Model button to create process model for simulation
purposes and MPC design validation.
An exact copy of the controller model is shown in the same format as the source at the bottom of the main window.
Oven.mpc

37. Go to Process parameter window and set initial conditions of CVs, MVs and DVs specifying operating conditions
shown in red as follows. Gas_Valve = 0, Air_Flap_Valve = 61, Hot_Air_Temp = 600, Hot_Air_Press = 200,
Ambient_Temp = 27, Suction_Flow = 0.2, Oven_Temp = 310, Oven_Press = -2.

32 of 87
37. Go to Process parameter window and set initial conditions of CVs, MVs and DVs specifying operating conditions
shown in red as follows. Gas_Valve = 0, Air_Flap_Valve = 61, Hot_Air_Temp = 600, Hot_Air_Press = 200,
Ambient_Temp = 27, Suction_Flow = 0.2, Oven_Temp = 310, Oven_Press = -2.

61

600 27 310

-2

200 0.2

33 of 87
38. Copy SimulationStartTime from Process model to TimeStamp of SPTrajectory for CV0 to synchronize clock of a
process simulator with time axis of the MPC that is important when predefined trajectory is in use. This is true in
our case as we supply CV0 setpoint profile as a trajectory.

Use Ctrl+C for copying and Ctrl+V for pasting (or right mouse-click copy & paste).

39. Enable Simulation mode of the MPCBuilder.

34 of 87
40. Get familiar with the trend window and the command buttons for executing simulation shown below. Pop-up
identifiers show functions.
Oven.mpc

41. Go to File > Save for saving the current status of your Project.

35 of 87
Phase 3 – Validating MPC Design

If you take the shortcut, copy the Oven_SimulationReady.mpc file from LabFiles folder to Work folder and
open it in MPC Builder.

The Software and Lab allows you to play with setting of MV0 Coef parameter to understand its role and effect it has in closed
loop response to CV0 setpoint changes.

42. Go to MPC Controller parameters and check setting of Gas_Valve, (MV0) Coef. Set Coef=1 (it is probably
already 1). This is the weighting parameter for setpoint (SP) importance.

43. Go to Simulation toolbar and replace 10 by 100 to prepare for simulating 100 steps.

100

36 of 87
44. Click the MultiStep simulation button to execute the simulation which is going to run faster than real time.

45. Analyze the simulation. Note if a plot is red (not green), this indicates a fault. Open the MPC Controller tab and
review that variable for a Fault (true) and open Status (click arrow) at the bottom of that variables parameter list.

The gas control valve opens up to 15% while hot air does not contribute significantly in responding to oven temperature setpoint
increase.

46. Go to the Gas_Valve, MV0 plot, click right mouse button to open edit variable window.

47. Change Auto Zoom to False and enter Yaxis Max = 40, Yaxis Min = -1, to preserve plot scaling for the next
experiment.

Before change After change

37 of 87
48. Close the Trend Variable Editor.

49. Go to the Air_Flap_Valve, MV1 plot, click right mouse button to open edit variable window.

50. Change Auto Zoom to False, enter Yaxis Max = 85, Yaxis Min = 45, to preserve plot scaling for the next
experiment.

Before change After change

Re-scaling the Gas_Valve and Air_Flap_Valve plots will provide more detailed view of trend charts.

38 of 87
51. Close the Trend Variable Editor.

52. Go to MPC Controller parameters and update the setting of Gas_Valve, (MV0) Coef. Set Coef=100. This is the
weighting parameter for setpoint (SP) importance and we have increased it by a factor of 10. Reset simulation
and run Multistep simulation again.

100
Gas_Valve is pushed more towards 0 with satisfactory oven temperature control. This response shows the desired behavior

39 of 87
when no disturbance needs to be eliminated. You may want to change the Coef setting online, later to compromise between
setpoint tracking and disturbance rejection. The change will be done from MPC Faceplate.

53. Save the MPC Builder project as Oven.mpc.


The following window appears in response.

Click YES to confirm Gas_Valve, Coef changes.

40 of 87
Phase 4 – Exporting MPC to Logix

If you take the shortcut, copy the Oven_ExportReady.mpc file from LabFiles folder to Work folder and open it
in MPC Builder.

There are couple of switches requiring changing their status so the MPC will execute in Logix. It is usually simpler to set the
status of those switches before exporting to Logix Designer projects Oven.ACD which interfaces MPC to process simulator and
repeats predefined scenario.

54. It’s a good time to make sure that RSLinx Classic is running. Open RSLinx Classic Launch control panel. If it
shows running, great/done. If it is not running, ‘Start’ it. Then close the Launch control panel.

55. Switch MPCBuilder to Design mode by opening the Mode list and selecting Design following the figure below.

56. Go to Control parameters (on the MPC Controller tab) and change settings as follows: TimeStampExtReq
=False.
Required changes are typed in red below. Time stamp is going to be driven by Wall Clock of the controller internally.

41 of 87
57. Go to File > Export

58. Follow MPC Export window settings shown below and click Export ones the ACD file is located and encircled
values and strings are entered.

42 of 87
59. Open Oven.ACD (Existing Project, in C:\Lab Files\PlantPAx MPC\) in Logix Designer when the Export is finished
and check that the exported routine appears in Unscheduled Programs.

60. Go to Controller Organizer > Tasks > Unscheduled Programs /Phases and look for MPCProgram with
MPCRoutine which is the MPC_Client AOI enabling MPC in your Logix Designer project.

The code of the MPC_Client AOI can be moved into the MPC_Call routine ladder but as it has been there already there is no
need to take any action. You have just updated the MPCTag carrying your setting of MPC parameters while exporting your MPC
project from MPC Builder to Logix Designer project.

61. For checking selected parameters settings go to Controller Organizer > Controller Lab > Controller Tags and
look for MPCTag.
You can check out the UDT, which is much like the MPC properties from MPCBuilder and it will have values from your
identification.

62. Check Project path with ‘Who Active’.


You can confirm that your MPC Module chassis is in the slot you selected during the export of your controller and make sure that

43 of 87
your Module is recognized by ‘Who’ routines.

63. Download Oven Project to the controller (slot 1 assumed, should match) and Run the project.

Leave the controller in Program Mode and inspect the program code before running the controller.
Change controller mode to Remote Run.

Phase 5 – Executing MPC in Logix


Oven project executes in-built scenario. Scenario is a periodic task providing oven temperature (CV0) setpoint, supplied hot air
temperature (DV0) and pressure (DV1) at the source, ambient air temperature (DV2) and flue gas suction flow (DV3). All the

44 of 87
variables vary over time. Limit for hot air flap valve opening (MV1_Constraint) is also generated by Scenario.
MPC instruction is interfaced to the rest of the application project via MPCTag and the actual handshaking is assured by
MPC_Client Add-On Instruction which appears in rung 8 of the MPC_Call routine of the OvenController task.

64. Go to Controller Organizer > Tasks > OvenController > MainControl > MPC_Call ladder to see the wiring of the
MPC to the rest of the project.
Rungs 2-6 wire MPC inputs.

Rung 10 wires MPC outputs.

45 of 87
65. Go Online with the controller and change controller mode to Run Mode.

66. Go to Control Organizer >Trends > CV0_Temperature trend window and Run it

67. Go to Control Organizer >Trends > MVsDVsCVs trend window and Run it

68. Monitor and study trend plots


See the way how MPC tracks oven temperature setpoint profile and keeps it within ±1°C band whenever possible minimizing off-
spec conditions.
Pay special attention to the situation when the max opening of flap valve reduces so the hot air flow must be reduced accordingly
and oven temperature cannot be maintained by hot air any more. Gas burner takes over and substitutes missing heat supply.
This situation is marked in CV0_Temperature trend plot and MVsDVsCVs plot below.

46 of 87
Notice that heating by gas is not sufficient when recuperated heat delivered by hot air is limited. You have to tune the MPC
further to keep oven temperature closer to the setpoint when hot air flap valve (MV1) is constrained. The tuning will be done by
reducing MV0.Coef (Gas_Valve) from current value to 100. You will use Gas_Valve Faceplate to make the change. The
procedure is described in Phase 7.
There are two Key Performance Indicators (KPI), Over Limit Time (OLT) and Over Limit Area (OLA) that have to be kept as small
as possible.

47 of 87
69. Go to Control Organizer > Controller Tags and search for OLT and OLA tags.

48 of 87
Phase 6 – Monitoring MPC
The Lab setup for the monitoring phase is shown in the following figure. Both Logix Designer and MPC Builder will go on-line
with Logix.

70. Open your Oven.mpc project in MPC Builder if not already open.

71. Go to Communications > Who Active and select MPC Tag as TagName to connect to. Click Set Path.

49 of 87
72. Go to Communications > Go Online

73. Go to View > Trend to add Trend tab to the main window.

74. Monitor and interpret the trend plot of MVs and CVs including the prediction that cannot be monitored in Logix
Designer. There are constraints plotted along with process variables to show feasible range of values.

50 of 87
75. Monitor DVs by choosing the next trend page as follows.

76. Finally check and compare both options for trending, MPC Builder on the left and Logix Designer on the right.

PlantPAx MPC Builder Logix Designer Trends

51 of 87
Phase 7 – Tuning MPC from Faceplate

77. Open FT View SE Client window from your desktop clicking the icon , which opens HMI designed for
the Oven control problem shown below.

There are MPC Faceplates enabling a user to monitor the MPC, access and change MPC design parameters on-the-fly, track
MPC status and trace the faults. Access to features depends on security levels. An operator will use Home, Diagnostics and
Trend tabs for everyday tasks, higher security allows you to use Maintenance and Engineering tabs for changing MPC
parameters. The use of Faceplates is fairly intuitive. There is no need to open the MPCTag in Logix Designer or run MPC Builder
in most occasions.

78. Open Gas_Valve (MV0) Faceplate double clicking icon in the Curing Oven Overview

screen which will open Gas_Valve_Home panel for you. Choose Maintenance panel by clicking on and
open the third Maintenance panel tab .
The third tab allows you to view and change parameters associated with Objective Function for MV0-Gas_Valve variable.

52 of 87
MV Faceplate: Home panel Maintenance panel #1 Maintenance panel #3

79. Change Coef from 1000 to 100 and click Enter.

80. Go back to the MVsCVsDVs trend window in Logix Designer and give special attention to MV0-Gas valve and
CV0-Oven temperature trends when MV1-Hot air valve constraint limits the use of recuperated heat.
Gas valve opens more while keeping Oven Temperature closer to the setpoint as you are not forcing Gas_Valve to be at MV0
Target which is 0 by design.

53 of 87
Congratulations. You have completed the Lab.
For more information there is also an in-depth course on this product that can be scheduled via https://rockwell-
pavilion.custhelp.com/app/training_schedule.

54 of 87
Track 2 - Process Library Objects for MPC

The task is to enhance the existing oven control system originally designed with PIDs using MPC technology, and get familiar
with new AOIs and HMI available from PlantPAx Process Library designed in support of MPC. Three AOIs will be used for
completing the task effectively: P_MPC_MV_PID_OnOff, P_MPCQuality, and P_MPCStepTest.
Please note that at this time these instructions are beta. They will be released shortly, but some functions may
change slightly in the future. In particular at the time we generated this lab the Step Test instruction did not
automatically collect data for identification so we will need to turn trend logs on during step testing. This will not be
required on soon to be released versions.
P_MPC_MV_PID_OnOff (shortly MVOnOff) makes MPC integration with the existing regulatory control loops easy and error
prone. The MVOnOff AOI may be used in two configurations, (i) when MPC replaces PID(s) leaving PID in place as a backup, (ii)
MPC and PID(s) are cascaded. The following diagrams show PID and MPC arrangement including switches manipulated by the
MVOnOff AOI. SISO control loop is shown for demonstration purposes.

PIDE instruction provides switches while MVOnOff AOI is responsible for their manipulation according to configuration requested
by the user and MPC status. Bumpless switching between arrangements is assured automatically. When MPC Client AOI reports
an error (communication with MPC Module, MPC instruction configuration error, ….) the MVOnOff AOI reverts the scheme into
the backup arrangement automatically.
P_MPCQuality AOI calculates a long term average relative quality on each CV comparing the predicted versus measured CV
value each MPC step. Values are normalized so that a relative model capture of variable movement is represented as a real
number. There are two parameters of the AOI that need to be specified so the AOI is operational. The first parameter is a
reference to the set of CVs available from the MPC Tag (MPCTag.CV structure) and a reference to the MPCTag.Control
structure to get the value of the sampling frequency that will be shared between MPC and Quality instructions.

55 of 87
There is an HMI available as a faceplate which allows you to monitor model quality for each CV defined in the linked MPC and
setting thresholds on the quality values. When the threshold is exceeded a color indicator reminds you that the specific CV model
might need you attention. The higher the quality value the larger is the model-reality mismatch. You can change the default
threshold setting, as answers are dependent on how much noise is in your process. In a real system tune it so models that need
attention are identified and models that are good for the measurement noise appear good. Below is the instruction when you
select to make the results visible as tags that can be visualized in other systems. These are values filtered over a long-term
(~weekly) basis. The faceplate will also retain a high value along with the longer term filtered results. There is an operator
command reset of captured high value OCmd_ResetCV which clears the high sticking quality values when set.
P_MPCStepTest AOI is designed to test a plant before or after MPC is added as an instruction. Thus this AOI maps to the
same values used by your MPC, but do not generally map to the MPC Tag (in this case we can map to the MPC tag or the
original PIDE inputs and outputs).

Let’s assume the oven control scheme shown schematically on the following figure as our startup arrangement before enhancing
the control by MPC. The MPC will replace PIDs providing much better functionality than the original control design. PIDs will be
left in the scheme so the operator can go back when desired. MPC is also part of the startup project. The MPC is the result of the
Track 1 of the lab. The MVOnOff AOI is added to the control program so the bumpless transfer between PIDs and MPC is
functional.

Recuperated heat delivered via hot air flap valve is a preferred source of energy for heating. Once the flap valve reaches the limit
opening, which varies over time, gas burner is called helping to keep the oven temperature at the setpoint. The scheme doesn’t
maintain oven pressure.
While PIDs are only dealing with oven temperature, MPC will take care of both temperature and pressure at the same time.
As the goal of the lab is not to teach you programming in Logix the project has been pre-fabricated and made available for use

56 of 87
after completing just a few configuration steps to understand how the individual project components interact. This will be done in
Studio 5000 Logix Designer and FactoryTalk View SE Studio.
The project which you are supposed to start the lab with is shown below.

The project includes Oven process simulator providing oven temperature and oven pressure readings, disturbance variables
varying over time and two actuators, gas control valve and hot air flap valve. Air flap valve has limit opening which also comes
from the process simulator as a tag.
Valves are interfaced with control logic via control valve AOIs P_ValveC.
There are two PID controllers, Primary and Secondary which is called into action when the preferred actuator, the air valve,
saturates so the temperature is maintained at the setpoint as close as possible.
MPC is an alternative to the control logic based on PIDE instructions.
The two MVOnOff switches enable you to go from PID control to MPC control and back.
The P_MPCQuality AOI is interfaced to the MPC and allows monitoring the MPC model quality on the fly.
Note that all AOIs listed above have faceplates available from the PlantPAx Process Library which you are going to setup as part
of the HMI prepared at the startup.

57 of 87
Phase 1 – Installing and running oven control project

01. Close any running application.

02. Open the Work folder available as a shortcut on your desktop and double click on file to open
Studio 5000 project in Logix Designer.

03. Go to Controller Organizer > Tasks > OvenController > MainControl program and open the MPC_Call routine.
Inspect the ladder logic rungs.
Rungs in the MPC_Call routine guide you through all the functions the OvenController is capable of. Rung 1 provides timing for
I/O sampling and MPC step calculation execution. Rungs 2-6 provide inputs to MPC. There is a MVOnOff switch enabling you to
select either MPC or PID (PID_Temp_Secondary) to manipulate with gas control valve in Rung 7 and a MVOnOff switch to select
either MPC or PID (PID_Temp_Primary) to manipulate with hot air flap valve in Rung 8. Rung 10 calls MPC Client AOI. Rung 12
calls PIDs on condition the EnableStep bit is false. You can either operate the oven in closed loop (EnableStep=0) when PIDs or
MPC drive actuators using feedback from process readings or in open loop (EnableStep=1) when the process is excited by
bumps, process response is logged and the record is used for building a model of the process for MPC. Rung 13 executes the
StepTest subroutine for EnableStep=1. Rung 14 provides interface to HMI and final control elements, control valves and motors.
We take the advantage of having two Add-on Instructions and also faceplates available from PlantPAx Process Library that
makes the programming easy. Here we use P_MPC_MV_PIDE_OnOff in rung 7 and 8 and P_MPCStepTest in the soubroutine
called in rung 13. P_MPC_MV_PIDE_OnOff in rung 7.

04. Validate configuration of the P_MPC_MV_PIDE_OnOff in rung 7 while referring to the principal scheme from the
introductory part of Track2 of the Lab.

05. Validate configuration of the P_MPC_MV_PIDE_OnOff in rung 8.

AOIs in rung 7 and 8 allow bumpless switching between MPC and PID as shown in the principal diagram below. Note that
temperature setpoint is the same for MPC and PID.

58 of 87
06. Open the FBD routine PIDE_Call and get familiar with the particular PID control scheme. Again refer to the
principal scheme from the introductory part of Track2 of the Lab.

This control scheme is only capable of maintaining oven temperature. When the air flap valve opening is restricted and the
recuperated heat is not enough for keeping the oven temperature at the setpoint secondary PID is called into action activating
gas burner. Logic around PIDs will be even more complex in reality. PID tuning is yet another problem here.

59 of 87
07. Inspect the window with a PIDE_Call FBD to visualize the MPC Quality function block and verify the MC Quality
AOI links to the correct MPC Tag. MPCTag.CV and MPCTag.Control should be referenced.

08. Open the FBD routine StepTesting and get familiar with the interface of the P_MPCStepTest AOI instance used
in the project.
The lab allows us to manipulate with all disturbance variables affecting controlled variables. This gives us a chance of bumping
all process inputs, MVs and DVs and log the complete set of variables needed for model building. Step testing is always done in
conditions the controller will operate. The AOI tracks MVs and DVs so the bump is added to the value sampled when step testing
was started. You can set the parameters of the step test signal generator out of the instruction properties dialog but there is a
more friendly way offered by faceplates coming with the AOI and PlantPAx Process Library. The lab will introduce Steptest
faceplates later.

We do not assume Step Test is always mapped to a MPC_Tag because sometimes it will be installed before the MPC Client AOI
is in place. Thus P_MPCStepTest AOI does not use reference to the MPC_Tag as a parameter.

60 of 87
09. Download the project to the controller and Run it.
The project executes cycled scenario with pre-programmed temperature setpoint, hot air temperature, hot air pressure, ambient
temperature and combustion air suction flow profiles. Notice the default setting of MVOnOff switches and EnableStep flag. The
lab starts with oven in closed loop with PIDs on and MPC off. Step testing is not activated and MPC is just monitoring PIDs to be
ready for taking over the control.

10. Open the MVCVDV trend and check the control scheme performance in tracking the temperature setpoint, which
varies between 310 DegC and 340 DegC.
It would be good to remember how oven temperature varies with a setpoint, disturbances and air flap valve limit opening. MPC
should do better job here.

11. Open the FT View SE Client with the HMI ready for the application from your desktop icon and check the
control system operation.
The HMI includes access to faceplates of various components including MPC and control valves. You should be monitoring
Oven under PIDs. MPC is operational but does not affect actuators as both PIDs are on in Auto by default. Check the bar graph
with statistics of production quality in terms of tracking the recipe temperature.

Phase 2 – Integrating MPC Accelerator Toolkit into FT View SE Project


MPC Accelerator toolkit, P_MPC_MV_PIDE_OnOff, P_MPCQuality and P_MPCStepTest Add-on Instructions come with the
OvenPL project integrated and configured properly. Changing the configuration and parameter setting of these AOIs is however
only available from Studio 5000 Logix Designer. In addition to AOIs PlantPAx Process Library offers faceplates for those
instructions that make configuring and monitoring simple and user friendly. Let’s enhance the generic HMI adding faceplates
allowing you turning MPC on and off, monitoring MPC model quality and setting up and running step testing to get process
response useful for MPC model building.

12. Close the FT View SE Client with the Oven HMI.

13. Open your FactoryTalk View Studio (Local) project with the launcher icon on your desktop. This project is
a View Site Edition (Local Station) project called AF17_HOL_CuringOven.
Note that in this lab you do not need to add any FT View components like images, global graphical objects and displays. All you
need is already in the application you have opened. Your task is however to use graphical components associated with MPC
Accelerator Toolkit AOIs and configure them for the use with your Oven HMI.
All graphical objects needed for enhancing the lab HMI are available from (RA-MPC) Add-On Global Object.

14. Check the availability of Global Objects for the project. Right mouse click on Global Objects and look for (RA-
MPC) Add-On as you will have to use MPC Quality MPC Step Test, MPC OnOff Single MV and MPC OnOff
Multiple Display Elements available from here later.

61 of 87
15. Check the availability of all MPC Faceplates (Graphic Displays) needed in your project. Right mouse click on
Displays to open the list and look for Quality, MV on-off and StepTest displays. These displays will be used once
you add the related Global Objects to the main project display.

62 of 87
First we will add and configure the Faceplate that allows us to turn MVs on and off control. You can choose to implement two
individual switch faceplates for our two MVs or one for an entire MPC project (up to 10 MVs). Configuration is very similar.

16. Open the mpc_oven_fp display

17. Copy the MPC OnOff Multiple MV display element from (RA-MPC) Add-On Global Object that will be used to
control the MPC MV onto the mpc_oven_fp display.
A good location for this is to the left of the MPC Overview icon at the top of the display.

63 of 87
18. Open Global Object Parameter Values dialog out of the mpc_oven_fp display. Right mouse click on MPC MV
On-Off Control icon and select the item in the dialog.

64 of 87
19. Enter the global object parameter values for MPC MV On-Off Control display.
At minimum parameters #101, #102, #103, & #104 will need to be entered. This is usually done by browsing to the Tag in the
Logix.ACD file. Below is a sample of the values.

65 of 87
Note that the OnOff AOI parameters may be defined locally (under MainControl) or globally depending on where they were
defined by you while installing the AOI in Studio 5000 Designer. Also we need to remove the brackets { and } around the first
two broader UDT elements (MPCTag and MPCClient). Select OK. This is not required for #104 to #113.

20. Copy the MPC OnOff Single MV display element from (RA-MPC) Add-On global object, paste it onto the
mpc_oven_fp display and configure its parameters. The display will be used to control the MPC MV0 (gas valve).

21. Copy the MPC OnOff Single MV display element from (RA-MPC) Add-On global object, paste it onto the
mpc_oven_fp display and configure its parameters. The display will be used to control the MPC MV1 (air valve).

66 of 87
22. Copy the MPC Quality display element from (RA-MPC) Add-On global object, paste it onto the mpc_oven_fp
display and configure its parameters.

23. Copy the MPC Step Test display element from (RA-MPC) Add-On global object, paste it onto the mpc_oven_fp
display and configure MPC Step Test its parameters.

24. Place a button next to the Step Test icon and map it to our Global parameter (EnableStep). Increase its size so
it is a visible switch and add a text to identify the action if desired.

The arrangement of individual icons might result in the following design.

67 of 87
25. Save the project.

Phase 3 – Interacting with PlantPAx MPC Faceplates

26. Open the OvenPL project in Studio 5000 Logix Designer by double clicking on file in your
Work folder.

27. Download the project to the Controller using the default Path and go to Run Mode after download.

28. Double click on FT View SE Client launcher icon on your desktop to open the Oven HMI enhanced in the Phase
2 of the lab Track 2.

The Oven is under PID closed loop control when the OvenPL starts from default settings. There are several indicators proving
that oven temperature is under control, PIDs are on control and MPC is off control. We will check these settings in next setps.

29. Check the status of the application in Logix Designer.

MVOnOff switch should show MPC in parallel with PID. As the Sts_MPCOn is false only PID is on control.
PID might be off control when step test is enabled. Rung 12 shows EnableStep false. As this rung executes the routine with PIDs
the loop is closed and PID talks to the actuator.

30. Check the status of the application in HMI.

68 of 87
Monitoring the status is even easier in the HMI. Just take a look at the status of the gas control valve and the faceplate
associated with MPC MV0. The valve is under Program control and the MV0 faceplates shows as in Manual so the
MPC output is not talking to the actuator. MPC is off control while PID is on control. MVOnOff display for Gas_Valve also shows
this MV Off. This is the correct default setting.

PID job can be evaluated in trends. You can open MVsDVsCVs trend in Logix Designer and also have a look at trends in HMI.
The control system is trying to track a temperature setpoint which is changing two target levels periodically, 310 degC and 340
degC.

If your screen shows what you see above you are set and ready for the next steps and experiments.

31. Switch the MPC on either using ON radio button on the HMI or setting Cmd_MPCOn=1 command in MPCOnOff
AOI in the MPC_Call routine in the OvenPL project open in Logix Designer. Do it for both MVs, MV0 – gas valve
and MV1 – air flap valve.
Note that the On/Off command Cmd_MPCOn and Cmd_MPCOff is cleared automatically by the instruction when the command
is processed.

69 of 87
32. Check the control loop status. Both MVs should be on Auto as the MPC is now On.

70 of 87
33. Compare the MPC control system operation with the operation recorded in step 30 when PIDs were in charge of
control. Look at MVsCVsDVs trend in Logix Designer and give special attention to the red pen drawing oven
temperature.

Product quality monitoring in HMI also shows differences between PID and MPC.

34. Click on the Oven MPC overview display icon to open the MPC faceplate and check the MPC status.

The Home tab of the MPC faceplate opens by default. There are individual icons showing current configuration and mode setting
of the MPC. The MPC instruction is currently owned by the program , manipulated variable Gas_Valve has a target
, Oven_Temp is controlled to a setpoint and Oven_Press is kept in a zone .

71 of 87
From here you can access all MPC parameters by selecting desired variables in the MPC problem. There are also individual
faceplate icons that can be used to navigate directly to variables of interest.

35. Select the Manipulated Variable Air_Flap_Valve and change it to Manual Mode.

The Manual Mode will allow you to manipulate with the air flap valve target position directly from the MV faceplate. You will need
to change to ‘Operator’ mode and then select ‘Manual’. Click on and then to do so. Now the gas valve will take over on
temperature unless the operator is capable of operating the air flap valve manually. You can enter a value for valve opening.

The quality of production will most likely drop down as the manipulation with the air flap valve is no longer optimized when in
Manual.

72 of 87
36. Switch Air Flap Valve back to Auto and change the MPC to Program mode again.
Hit first and then to do so.

37. Open the faceplate from the Gas_Valve display icon . Check the Diagnostic tab of this MV.
There shouldn’t be any sign of a fault or warning provided by the MPC instruction and the MPC Client AOI.

‘Diagnostic’ is a useful tool to identify what faults are triggered if any. If the MPC AOI and any one of the MPC variables has a
fault or improper configuration the icons would show an error signal and this screen for that variable would show what fault is
occurring.
Let’s simulate incorrect setting of a model between Gas_Valve and Oven_Temp (MV0−>CV0).

73 of 87
38. Check the current setting of the model used between MV0 and CV0. Go to the Engineering tab and select C0
transfer function and inspect model parameter settings.

We will use negative value for Time constant T1 changing the original value of T1=5.305601 to the negative one T1=-5.305601.
Note that MPC faceplates do a good job of protecting a user from entering invalid values (e.g. less than low limits) that would
fault the MPC instruction so the fault will not be triggered. The assumed change cannot be done from the faceplate. You have to
go directly to MPC Tag in the Controller and make the change there.

39. Locate parameter T1 of the transfer function #0 (MV0->CV0) in MPC Tag. Go to Logix Designer > Controller
Organizer > Tasks > OvenController> MainControl > MPC_Call > Rung 10 and open MPC_Client Properties.

40. Navigate through the properties to MPC_TAG.TF[0].TimeConstant1.

Change the sign of the value and click Enter > Apply > OK. The change is not sent out to the MPC Instruction until you request
ChangeCore.

74 of 87
41. Request changing core parameters of the MPC. Navigate to MPC_Tag.Control.ChangeCoreReq parameter, type
1, click Enter, Apply and OK.

MPC Instruction reports a fault once the new parameter setting is processed. The model cannot be processed.

42. Check the error report in HMI. Gas_Valve display icon is red. Diagnostic tab of the faceplate indicates
Configuration Error and the Engineering tab shows where to look for a particular cause.

75 of 87
Note that the Oven doesn’t show weird behavior after the illegal change in the parameter is made. The MPC continues with the
last correct setting of parameters.

43. Clear the Configuration error on the MV0 (Gas_Valve). Do the change in the open faceplate for Transfer Function
0. Enter T1=5.305401, Enter, Apply, OK.

The request for core parameter change is done through the faceplate automatically.

Let us simulate any major fault that would prevent using MPC in the loop. A fault of this category is loss of communication
between the Controller, executing the application program with MPC Client AOI, and the MPC Module where the MPC
calculations are executed.

44. Unplug the MPC Module from the ControlLogix rack. Take care of taking the correct module!
There several indicators reminding the operator that something is happening. First look at the MPC overview display getting red.

76 of 87
45. Check actions taken automatically when MPC is faulted. Give attention to the status of MVOnOff switches for the
gas valve and air flap valve and also to the respective MV displays.
MVOnOff automatically disconnects MPC from actuators and PIDs are put on control as shown below.

Oven is not losing control as you should be able to see on the HMI trends b elow.

Let us investigate the reason why MPC faulted.

46. Open the MPC overview faceplate by clicking on the Oven MPC icon and go to Diagnostics tab.

Detailed fault info is available from here.

77 of 87
The fault symptoms clearly identify the problem. The problem is either hardware of the MPC module or communication with the
module.
Let’s put the Module back into the operation and see what happens with oven control.

47. Plug the MPC Module in the rack. Place get it there cautiously preventing any mechanical problem.

48. Check the status of the MVOnOff switch and MPC.


MV remains Off (PID is talking to the actuator) and the MPC goes to Operator mode when the communication with the Module is
restored. MPC

Module not responding is a major fault which requires an Operator to decide what to do with MPC next. As there is no error
reported you can now restore the original default mode settings of the project.

49. Restore the original default mode settings of the project.


Open the MVOnOff faceplate, select both MVs to be ON.

Put MPC back in Program. Open Oven MPC Faceplate and click .

78 of 87
Phase 4 – Interacting with MPC Accelerator Faceplates
The rest of the lab is up to you. You can turn MPC on and off. Check MPC Quality and see if we can confirm in this short time
the problems we made in the Oven Temperature (CV1) models in our first steps of the lab. Unfortunately both MV’s and all four
DV’s affect Oven Temperature. There are situations where either you could check historian data and see what was happening
(moving a lot) when model quality became worse. Alternatively you may know that model quality worsens and something in the
plant was happening related to specific model measurements (MV’s or DVs). Assuming we know you may want to use the Step
Test routine on variables Air Flap Valve (MV1) and Hot Air Pressure.

Model Quality

50. Open the model quality faceplate out of the MPC CV Quality display in the HMI.
Note that any problem with the model quality is reported by icon right in the quality display.

51. Inspect the Home tab of the Quality faceplate first.

The first value assigned to a CV shows current model quality, the second value is the maximum captured so far. The lower the
value the better the model copes with reality. Zero is the perfect fit. You can clear the captured max value by clicking .

52. Open the Engineering tab of the Quality faceplate and lower the model quality threshold for both CVs from the
default 50% to 1%.

79 of 87
53. Open the Air_Flap_Valve and faceplate clicking on the valve icon and take over
the manipulation with the valve from the engineering tab of the faceplate. The valve is locked for the
Operator in ‘Hand’ mode now.

54. Close the valve (Control Variable = 0).

55. Shut down the Gas Valve applying the above procedure starting now from opening .

56. Check the status of valves and MVs. You should get the following view with both MVs on isolated from valves.

You have disconnected both MPC and PID from valves. There is no feedback from the valve to the controller in the control
program so neither MPC nor PID is informed that the valve is in ‘Hand’ mode and whatever the controller calculates is ignored.
Note that in a real project such a feedback should be implemented and processed adequately. You made a significant change
that should be noticed in the model quality monitor as the CV prediction calculated by the model starts to differ. The CV Quality
monitor can be used for control system diagnostics.

80 of 87
57. Notice the CV Quality drop in MPC CV Quality faceplate.

58. Put the both valves back in Program selecting in valve faceplates. Faceplates return to the original state
shown below.

The control scheme recovers quickly and the oven gets back in MPC control.

StepTesting
You will take the advantage of StepTest AOI configured for the lab. The IOs of the StepTest AOI have been mapped to particular
process variables already. See the StepTesting routine for the particular mapping. What remains to be decided is how many
moves we want from each MV (and/or DV allowed to me manipulated), how long we want to wait on each step and what is an
acceptable and appropriate move size for each MV (one that shows a measurable response, but does not upset the process or
cause bad product). This can be easier on-line where changes can be made right before testing.
There are functions representing CV High and Low testing limits. These are available, but to be used with caution. In a test we
will assume that any change exceeding a limit is from the last move and the routine will reverse the last move immediately on
hitting a testing limit. This then shifts the moves back on step size from any hit testing limit. Like the other parameters they are
best set from a faceplate immediately prior to testing. By default they are never hit (max and minimum Float numbers.
You want to set Time to be a rounded up value of time to steady state (after a move is made, how long until all the change has
happened). You want to target move sizes such that the modelled control variables will show a move of at or more than five
times its background noise amount (observe noise and ask, how much do I need to move this controller to change that CV by
this (5x) amount).
If desired we can capture data and identify responses from various steps. Note that in reality we can only test our MV and rarely
DV, but as we see regular steps or disturbances in various DV’s we can capture data, pause our test assuming Hot Air Pressure
swings and capture that data as well.
First we need to configure our number of steps (pick 5 to 10), the duration of our steps (looking at the MPC horizon we can
assume 100 seconds is sufficient) and how much of a move should we make in Air Flap Valve (Observing the trends we see
temperature does not have much noise, and control action tends to be on the order of 5-10%, so let’s pick 5% to start or in a real
plant you could check with your operator, is a 5% step in Air Flap Valve acceptable now?).
Lab time doesn’t allow us to spend more time on step testing so go just with 2 steps, 60 seconds for the step duration and step
size Gas Valve (MV0) = 40%, Air Flap Valve (7%), Supply Air Temperature (DV0) = -100 degC, Supply Air Pressure (DV1) =
The StepTest AOI must be executed to do the rest of changes to the schedule.

81 of 87
59. Select the “Enable Step” button on the HMI.
The MPC StepTest routine in the Logix program executes and the MPC StepTest faceplate becomes active while PIDs do not
execute. This way the MPC disconnects from actuators as well.

60. Open up the Step Test Faceplate from MPC StepTest icon on the HMI .
Home tab page opens. Enter 60 seconds as a Step Time and limit number of steps to 2.

61. Go to the Engineering tab of the StepTest faceplate and enter the size of a bump that will be applied during step
testing as follows.

Remember the following assignment determined by P_MPCStepTest AOI interfacing particular variables in the StepTest routine:
MV0 - Gas Valve, MV1 – Air Flap Valve, MV2 – (DV0) Supply Air Temperature, MV3 – (DV1) Supply Air Pressure, MV4 – (DV2)

82 of 87
Ambient Air Temperature, MV5 – (DV3) Suction Flow. The deviation size entered is in engineering units.

62. Go back to the Home tab and open StepTest detail faceplate by clicking .

Here you can check the step test plan defined so far. The individual step changes will be executed from left to right and from top
to bottom. MV0 (Gas Valve) sequence is executed fist then MV1 (Air Valve) etc. Bumps do not overlap.

63. Change the formal names of variables and select the Expert mode which allows you to change
the default schedule.

You need to simulate stepping down with Air Temp DV. Only positive value can be entered as a step size but you can change
the direction of a step by a particular icon. Click on the arrow icon to change the step size and its direction arriving at . Step
down by 100 degC will be applied.

83 of 87
64. Prepare for data logging. Open the MVsDVsCVs trend in Controller Organizer. This trend has everything you
want to log.

65. Set this trend to ‘Run’.

You are ready to start step testing.

84 of 87
66. Start executing the step test sequence from MPC Step Test home tab or Step Test – Detail window hitting
You can monitor the sequence progressing in the MPC StepTest display in the HMI as well as in the home tab of the MPC
StepTest faceplate or in the StepTest detail page accessible from the home tab via icon. You can monitor what variable is
being serviced including the particular step of the sequence being executed, total number of steps planned for the particular
variable and the execution time remaining.

67. Once the last variable is serviced you can stop trend logging and save the log file to your working folder for later
processing by MPCBuilder.

85 of 87
68. As soon as your tests are complete and the log saved, do not forget to disable Step Test to re-enable PIDE with
MPC. Just unselect EnableStep button in the HMI.
The CSV file you exported from the MVsDVsCVs trend in Logix Designer can now be uploaded to MPCBuilder for processing
and updating your model. Track 1 of the MPC Lab will guide you how to proceed.

Congratulations you are done with this lab.

86 of 87
87 of 87

Você também pode gostar