CL05 - Reducing Waste With FactoryTalk Analytics LogixAI Embedded Analytics - Version 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

CL05 – Reducing Waste with

FactoryTalk ® Analytics™LogixAI™
Embedded Analytics

c
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.
FactoryTalk® AnalyticsTM: Reducing Waste with LogixAITM

Module 1 Contents
Before you begin ........................................................................................................................................... 4
About this module ............................................................................................................................................................................. 4
Tools & Prerequisites ........................................................................................................................................................................ 4
Project files ....................................................................................................................................................................................... 4
Hardware .......................................................................................................................................................................................... 5
Introduction to FactoryTalk Analytics LogixAI Embedded Analytics Module .................................................................................... 6

Lab 1: Explore Prediction Modeling with FactoryTalk Analytics LogixAI ...................................................... 7


Objectives ......................................................................................................................................................................................... 7
Initialization ....................................................................................................................................................................................... 7
Creating a New Prediction Model ..................................................................................................................................................... 9
Importing the Model into the Controller ........................................................................................................................................... 18
Train the Module Under Normal Operating Conditions ................................................................................................................... 26
Command the Module to Calculate Predicted Values .................................................................................................................... 29
The Module’s Response to Input Variations ................................................................................................................................... 30
Lab 1 Summary............................................................................................................................................................................... 32

Lab 2: Explore Value Estimation with FactoryTalk Analytics LogixAI ......................................................... 33


Objectives ....................................................................................................................................................................................... 33
Background ..................................................................................................................................................................................... 33
It’s all about the data! ...................................................................................................................................................................... 33
Creating a Value Estimating (Soft Sensing) Model ......................................................................................................................... 34
Importing the Model into the Controller ........................................................................................................................................... 40
Training the CQI_Sensor Model ..................................................................................................................................................... 47
Using the CQI_Sensor Model to Calculate the CQI Value.............................................................................................................. 51
Lab 2 Summary............................................................................................................................................................................... 54

3 of 56
Before you begin

About this module


Welcome to the FactoryTalk® AnalyticsTM LogixAITM Hands-On Lab! This interactive module focusing FactoryTalk® AnalyticsTM
LogixAITM has two main sections:
 Explore prediction modeling with FactoryTalk Analytics LogixAI
 Explore value estimation with FactoryTalk Analytics LogixAI

Tools & Prerequisites


This Hands-On Lab uses the following software:
 Microsoft Windows 10 Enterprise
 Google Chrome Web Browser
 FactoryTalk View SE v11.00
 Studio 5000 Logix Designer v32

Project files
This Hands-On module uses the following files:
 L85E_Slot0.acd
 CookieDemo.cli

4 of 56
Hardware
This Hands-On module uses the following hardware:
 L8 Performance demo set (DEMO-L8PERF1)

L8 High Performance Demo Box

K5700 Demo Box

Tuning Kit

5 of 56
Introduction to FactoryTalk Analytics LogixAI Embedded Analytics Module

FactoryTalk Analytics LogixAI is Artificial Intelligence (AI) in a 1756 module for ControlLogix. Its initial purpose is to learn, or
model, the data in a ControlLogix application, and predict when things are changing in unexpected ways (e.g.: an anomaly, or
anticipated poor product quality) so that a human can investigate or intervene as necessary.

With subsequent releases and updates, we may add other capabilities based on prediction, but we will always be focused on
simple-to-use, easy-to-adopt applications: data modelling for the person who knows their process but is not a data science
expert. A separate Rockwell product, MPC (Model Predictive Control) remains the best tool for experts.

FactoryTalk Analytics LogixAI’s physics-based approach makes it particularly well-suited to industrial applications, which (as a
general rule) obey the laws of physics. It’s not well-suited to stochastic (or random) data like search results or sentiment analysis.

The initial release will have only prediction capabilities, with a user interface (UI) focused on simpler use-cases. It is initially
available as a ControlLogix 1756 module, and the configuration experience is web browser-based (like FactoryTalk Analytics for
Devices, also known as Shelby).

6 of 56
Lab 1: Explore Prediction Modeling with FactoryTalk Analytics LogixAI

This section of the lab will highlight the prediction modeling functionality of the Embedded Analytics Module.

Objectives
a. Create a new prediction model
b. Import model components into Logix Designer
c. Train the module under normal operating conditions
d. Command the module to calculate predicted values under normal conditions
e. Simulate abnormal machine behavior and observe the modules response.

Initialization
Before we get started, let’s make sure the LogixAI module is reset to a known state.

1. From the computer desktop, double-click the Lab Files – Shortcut folder.

2. Double-click the ACD folder. Open L85E_Slot0.ACD.

3. Download the L85E_Slot0.ACD file to the L85E controller in slot 0. The IP address is 192.168.1.20.

7 of 56
4. When prompted, select download. After the download is complete, put the controller into RUN mode.

5. Minimize Logix Designer.

6. Open Google Chrome.

7. Chrome should open to the LogixAI main screen. Delete all models by pressing the “Delete” button.
NOTE: The IP address of the LogixAI module is 192.168.1.125. Enter the IP address in the search bar at the top if the
LogixAI main screen doesn’t appear automatically. The screen shot below shows two models.

8. In the example below, you would delete the CQI_Sensor and Mixer_01_Power models.
NOTE: We are removing models from the previous sessions. It’s the easiest way to start from scratch.

8 of 56
Creating a New Prediction Model
For the sake of this lab, let’s assume that we are trying to improve the quality of our cookies by ensuring that the viscosity of the
dough is within specification. We have determined that we might be able to ensure proper dough consistency and viscosity
through parameters that are available from the drive that controls the Mixer motor. We will start off by creating a new prediction
model that will predict power consumption in kilowatt hours for the motor that runs Mixer 01 in our cookie line.

1. If the Google Chrome web browser is not already open, open it using the icon on the desktop.

2. The Embedded Analytics Module webpage will be launched.

Create New Prediction → Allows users to quickly create new predictions

Import Model → Allows users to import existing models

Prediction Archive → Contains all existing predications in the module. The options available for each
prediction will be covered later in the lab.

9 of 56
3. Click the Create New Prediction button

4. Select the Create New Prediction option

5. Enter the model name “Mixer_01_Power”. See the image below for an example.

NOTE: If the Model Name title turns red, ensure that you only have alphanumeric characters in the name (including “_”).

Model → A model contains all the data needed to identify and calculate the relationship between the inputs
and the output.
Prediction → A prediction is a configuration of the model to predict a certain variable.

6. Press the drop down arrow for Controller Slot. Select slot 0.

7. Take a moment and select each of the “tutorial” options.

10 of 56
Tutorials → You will notice multiple options besides Manual. These options include Pump, Boiler, and
Generator. These “tutorials” help users understand the concepts of creating a specific predefined prediction.

8. Since there is no tutorial available for mixers we have to create a new model by selecting the Manual button.

9. Under Select Prediction Type, select Operation Monitoring.

10. In the Prediction Name field, type “Power_Prediction”.

NOTE: If the Model Name title turns red, ensure that you only have alphanumeric characters in the name (including “_”).

11. Press the Continue to Assign Tags button at the bottom of the screen.

Now it’s time to select the tags that we think the module needs to analyze in order to build an accurate prediction for the
power consumption of our mixer motor. Since we are bound by time for this lab, the tags selected will be simple and not
representative of all of the potential parameters in a real system. In a real system, the tags should be selected by someone
who knows the system very well.

11 of 56
Output Variable → This value is often called the “variable of interest”. Essentially, it’s the value you want
the module to predict. You will have the option to select any controller / program scope tag and drag / drop it
to the output variable window. Only one tag can be assigned as an Output Variable. IMPORTANT: When
selecting a variable of interest, make sure there is at least +/- 3% variation of the variable during normal
operation. If the variation is less than 3%, it may not be a good fit for the LogixAI module.
Input Variable → These are the values you think might be necessary to predict the output. Essentially, you
can drag any tag values to the input window if you believe that it influences the output. There is a limit of 20
inputs per prediction.
State Variable → These are values that represent states or modes of operation. For example, if our
machine made 3 different types of products (X, Y and Z), it could be the variable that tells the module that we
are making product “Z”.

12. Make sure the tag scope is Controller and type ‘Power’ in the search.

13. Drag and drop “MIXER_01.Val_Power” to the Output Variable window.

12 of 56
14. Add the following bounds to the tag, Lower = 8 and Upper =20.

NOTE: The bound values tell the module what the operational limits are for each parameter. When module is in training
mode, it will cap the input / ouput values to these bounds. A fault will be annunciated on the LogixAI module webpage and
in the model specific tag in the controller when this occurs.

Bounds – When choosing bound limits, a good rule of thumb is to start with values that are 10% above and
below the expected min and max operating values. For example, if we know a variable will fluctuate between
100 and 200 during normal operation, start with 90 and 220 as the lower and upper bounds.

15. Make sure the tag scope is Controller and type ‘Torque’ in the search.

13 of 56
16. Drag and drop “MIXER_01.Val_Torque” to the Input Variable window.

17. Add the following bounds to the tag, Lower = 45 and Upper = 58.

18. Make sure the tag scope is Controller and type ‘Speed’ in the search.

14 of 56
19. Drag and drop “MIXER_01.Val_Speed” to the Input Variable window.

20. Add the following bounds to the tag, Lower = 1850 and Upper =2200.

15 of 56
21. Verify that your configuration matches the configuration below.

22. Click the Continue to Review button.

16 of 56
23. Verify that your configuration matches the configuration below.

24. Use the Back button if you need to make any changes. Otherwise, press Finish.

NOTE: You should be redirected to the home screen and you should now see your newly created prediction in the
Prediction Archive.

Notice the “Import UDT to Controller”. The LogixAI module requires a UDT and controller scope tag to be created in the
controller that will be communicating with the LogixAI module. The next section of the lab will walk you through the process
of importing these components into a controller. Clicking on the blue link will open online help and provide additional details
for each step.

17 of 56
Importing the Model into the Controller

In this section of the lab, the model that was just created will be imported into the controller program.

1. Open L85E_Slot0.ACD if it’s not already open.

NOTE: It’s located at C:\Lab Files\ACD. Use the Lab Files shortcut on the desktop.

2. If the file is open and online, go offline.

3. Open Google Chrome and navigate to 192.168.1.125.

4. In the prediction archive, select Save L5X.

5. In the bottom left corner of the screen, click the drop down arrow and select Show in folder.

18 of 56
6. When the folder opens, right-click and copy the Mixer_01_Power_UDT.L5X file.

7. Paste the L5X file to the desktop.

19 of 56
8. Switch focus to Logix Designer (L85E_Slot0.ACD).

9. In the Controller Organizer, navigate to the User Defined Data type folder.

NOTE: It’s located within the Assets Folder.

10. Right-Click on User-Defined and select Import Data Type.

20 of 56
11. Navigate to the desktop and select Mixer_01_Power_UDT.L5X and click Open.

12. The import configuration window will open. Select “Overwrite” in the Operation dropdown and Click OK.

NOTE: If the Operation says “use existing” change it to “Overwrite”

21 of 56
13. Verify that a UDT exists with the name Mixer_01_Power

NOTE: The Mixer_01_Power UDT contains two nested UDTs (LogixAI_Calculations and LogixAI_Training). These will also
be created during the import.

14. Double-Click the Controller Tags and verify that a tag was created named Mixer_01_Power

NOTE: The tag Mixer_01_Power should be of data type Mixer_01_Power. This is the UDT tag that the LogixAI module will
use to read and write data.

15. Expand the “Mixer_01_Power” tag.

22 of 56
The module will communicate directly with these tags. You do NOT need to add the module to the I/O
Configuration. We will only be using several of these tags in our lab. They are highlighted below.
Train – Setting this tag value to a 1 will command the module to perform ONE training cycle. The module
will reset this tag to a 0 when that cycle is complete. You should perform at least 100 training cycles during
normal operation to ensure the confidence level is high.
Calculate – Setting this tag value to a 1 will command the module to perform ONE calculation. The module
will analyze the configured inputs and calculate the predicted value of the “output” tag based on the input
values.
Predicted Value – The predicted output value. In this case, it will be predicted power of the motor.
Relative Error – The error that is calculated when comparing the predicted output value to the actual output
value.
Confidence – This is a level of confidence that the module can predict an accurate output value.

16. That’s it! Only one more thing to do in this example and its ready to go.

NOTE: Controller Logic already exists in this example to manage the prediction model. The logic resides in program
P02_Mixer_Analysis. The only thing that must be done is to sync this logic to the prediction we just created.

17. Expand the P02_Mixer_Analysis program.

18. Double-click the R01_Analysis routine.

23 of 56
19. Add a rung to R01_Analysis.

NOTE: This routine should be empty.

20. Click on the Add-On tab in the instruction toolbar.

NOTE: We are going to add the Mixer_Power AOI. If you hover over the Mixer_Power icon with the mouse, a tool tip will
display the AOI graphic.

21. Drag-and-drop the Mixer_Power AOI to the rung that was just created.

NOTE: The Mixer_Power AOI was created for the purpose for this lab. It is NOT formally associated with the LogixAI
module. It is the user’s responsibility to create any logic associated with a prediction. In this case, an AOI was used to
encapsulate the logic.

22. Type Mixer_Power for the AOI backing tag. It should already be created.

24 of 56
23. In the Model_Tags drop-down, select the Mixer_01_Power tag that was imported with the LogixAI import.

NOTE: Remember, this AOI was created specifically for this lab.

24. Make sure the rung verifies (the rung should NOT be red). Confirm that the final AOI instance looks like the
following picture.

25. Save the project.

That’s it! It’s time to test it out.

25 of 56
Train the Module Under Normal Operating Conditions
Now it’s time to see the module in action! During the training cycle, the module will take a snap shot of the input and output
parameters and use its algorithm to identify and calculate relationships between each parameter. As the module trains, it will
display the level of confidence that it can accurately predict the output in the Confidence tag. It is recommended that at least 100
training cycles be completed, regardless of the modules level of confidence. It requires a minimum of 10 training cycles before it
will begin populating the Confidence tag. 300 training cycles is recommended.

1. Download the L85E_Slot0.ACD file to the L85E controller in slot 0. The IP address is 192.168.1.20.

2. When prompted, select download. After the download is complete, put the controller into RUN mode.

3. Navigate to the controller tags and make sure the Monitor Tags tab is selected.

4. Expand “Mixer_01_Power”

5. Expand Mixer_01_Power.Calculations.

6. Expand Mixer_01_Power.Training.

7. Open the Module Webpage (in Chrome).

NOTE: If you closed the webpage, just open Chrome and enter 192.168.1.125 in the search bar.

26 of 56
Note: The controller in slot 0 now contains the UDTs and “2. Train Model” indicates the prediction is active. Let’s walk
through the training process.

8. If needed, use ALT-TAB to navigate to Logix Designer.

9. Manually set the Mixer_01_Power.Train tag to a 1 and press enter.

NOTE: The module will set the tag back to a 0 when it completes a training cycle. This may take a few seconds (30
seconds for this lab), especially if it’s the first train command issued for a new prediction. Remember, it is recommended
that at least 100 train cycles be completed even if the confidence level is high (300 samples is preferred). Let’s take a look
at how an auto train cycle may work. Wait for the module to set the .Train value back to a 0.

10. Navigate to the Desktop and open the “CookieDemo” Client File.

11. Once the HMI is open, navigate to the Mixer Overview screen.

12. From the Mixer Overview screen, press the LogixAI Detail button.

27 of 56
13. Once the HMI application opens and is running, press the “Step 1 – Start Auto Train” button.

14. Wait for the Auto Train cycle to complete.

NOTE: Logic will command the module to train 100 cycles. You can navigate back to Logix Designer (using ALT-TAB) and
watch the training tags if you would like. The controller will set the Train tag to 1 and wait for the module to set it back to 0.
The controller will repeat this process for 100 cycles. After the auto cycle is complete, the HMI will show text indication.

NOTE: The modules confidence should be above 95% after 100 training cycles (each lab station will vary). This is great! It
may take more training cycles for other applications. If the confidence is below 95% for your lab, run the auto train cycle
again.

28 of 56
Command the Module to Calculate Predicted Values
Once the module has finished training and is confident that it can predict accurate values for the output parameter (Mixer Power),
it’s time to command it to perform a Calculation. This will command the module to analyze the input parameters and calculate
the predicted value of the output at a given point in time.

1. On the HMI, press the “Step 2 – Start Prediction Engine”.

NOTE: Logic will command the module to continuously calculate the predicted value while the Prediction Engine is running.
It works just like the Train cycle. The Controller will set the Calculate tag to a 1 and the module will perform the prediction
and set Calculate back to 0.

2. Monitor the graph. Verify that it looks like the image below.

NOTE: The blue line represents the actual power consumption of the mixer motor. The red line represents the predicted
power consumption of the mixer motor. The Relative Error is also visible on the HMI. This indicates the error between the
actual and predicted value.

3. Observe the Relative Error. It should be fluctuating between 0 and 2%.

29 of 56
The Module’s Response to Input Variations

In this section of the lab, prediction input tag data will be changed simulating a variation in the mixer motor.

1. If the Prediction Engine is not running, press the “Step 2 – Start Prediction Engine” button.

2. On the HMI. Press the “Abnormal Operation” button.

NOTE: For this example, a mixer cycle is 60 seconds in duration. In the Abnormal Operation mode, small deviations are
introduced to the motor torque and speed during a 20 second window of the mixer cycle. The deviations increase the
torque in an effort to simulate a thicker viscosity. Theoretically, the motor is working harder because the dough is thicker
than normal. This causes an increase in current to drive the motor at the same speed.

3. Watch the graph and the Relative Error. Note how the predicted value begins to increase slowly as it senses a
variation in the torque. If the Relative Error is large enough (greater than 10%), the .AnomalyDetected bit will
be set to 1.

NOTE: Remember, this is a simple simulation. In many cases, the variation to input parameters will be gradual and spread
out over time.

At this point, the predicted value begins


to increase. The control system should
alert the user that the module is
reporting a value that is not expected.

4. On the HMI. Press the Normal Operation button.

NOTE: Wait for the power values to return to their normal running state.

30 of 56
5. Press the Stop Predictions button.

6. Minimize the HMI by clicking the “Rockwell Automation” icon in the top left corner of the HMI banner.

Congratulations! You have completed lab 1!

31 of 56
Lab 1 Summary

The intent of lab 1 is to demonstrate the basic principle of Operation Monitoring. We were able to use the LogixAI module to
predict the power consumption of the Mixer. This allows the user to take action if the predicted power begins to deviate from the
real time power consumption baseline.

Key Takeaways:
• Operation Monitoring Prediction Type is used to predict anomalies against a baseline
• The model is only as good as the data it has available
• Train often when the system is running normal
• Input / Output / State Variables all require high and low limits. Keep them narrow (+/- 10% of normal operational
values) to improve model confidence
• An Operation Monitoring model can increase efficiency while reducing waste by indicating problems before the process
is majorly affected

The module’s purpose in its initial release is to learn, or model, the data in a ControlLogix application, and predict when things
are changing in unexpected ways (e.g. Anomaly or anticipated poor product quality). This allows the control system to notify
users, so a human can investigate or intervene as necessary to correct the issue.
With subsequent releases and updates, we may add other capabilities based on prediction, but we will always be focused on
simple-to-use, easy-to-adopt applications: data modelling for the average non-expert.

32 of 56
Lab 2: Explore Value Estimation with FactoryTalk Analytics LogixAI

Objectives
a. Create a new value estimation model
b. Import model components into Logix Designer
c. Train the module using simulated production data
d. Calculate a “soft sensor” value
e. Make subtle changes to the inputs to see how the output value is impacted.

Background
In this lab we will be utilizing a Value Estimation model in a soft sensing application to calculate a value that can be used to
determine the quality of a cookie as it exits the final cooling tunnel. Currently, the lab techs have to grab one cookie per case for
analyses to verify that case is ready for the palletizer. After a series of tests, the lab tech will report an overall Cookie Quality
Index (CQI). This is a number based on many parameters that are gathered during the destructive testing process. In an effort
to reduce material waste and laboratory resources, let’s see if the LogixAI module can help us solve this problem.

It’s all about the data!


In this example, we have CQI data on thousands of cookie samples. This historical data can absolutely be used in training the
LogixAI module. The only thing we have to do is get this data into the controller. One example would be buffering the real time
input values into an intermediate tag value. This allows the user to add logic to “turn off” the real time data. Now we can enter
our historical data and command the LogixAI module to train. Once training is complete, we can “turn on” the real time data so
the module can continue calculating on real time inputs. Lab 2 uses a similar approach for the initial training process.

33 of 56
Creating a Value Estimating (Soft Sensing) Model

In this section of the lab, a new value estimation model will be created to assist with calculating the Cookie Quality Index Value

1. In Logix Designer, go offline with the controller.

2. Using Google Chrome, navigate to 192.168.1.125.

3. Once the LogixAI webpage is open, select Create new Prediction.

4. Select the Create New Prediction icon.

5. Enter “CQI_Sensor” for the Model Name.

6. Select “0” for Controller Slot.

34 of 56
7. Select “Manual”

8. Select “Value Estimation” under Prediction Type.

9. Enter a prediction name and description

10. Select Continue to Assign Tags.

11. Type “Cookie” into the search box.

35 of 56
12. Drag-and-drop Cookie_QualityIndex to the Output box.

13. Assign the bounds per the image below (Lower: 90; Upper: 110).

NOTE: Based on the lab results from each destructive test, we know that a CQI between 92 and 108 is optimal. We
expanded the bounds slightly to ensure training continues to calculate values close to the optimal index ranges.

36 of 56
14. Drag-and-drop Cookie_Diameter to the Input box.

15. Assign the bounds per the image below (Lower: 40; Upper: 70).

NOTE: The optimal cookie diameter is 55mm.

16. Drag-and-drop Cookie_Height to the Input box.

17. Assign the bounds per the image below (Lower: 10; Upper: 15).

NOTE: The optimal cookie height is 11.5mm.

37 of 56
18. Finally, Drag-and-drop Cookie_ExitTemperature to the Input box.

19. Assign the bounds per the image below (Lower: 12; Upper: 22)

NOTE: The optimal cookie cooling tunnel exit temperature is 17.5 Degrees Celsius.

20. Select the Continue to Review button

21. Verify that the configuration looks like the image below.

NOTE: It’s important that the numbers below match the model you just created. If they don’t, results may differ.

38 of 56
22. Click Finish.

23. It should return to the main webpage. Verify that the model looks like the picture below.

39 of 56
Importing the Model into the Controller

In this section of the lab, the model that was just created will be imported into the controller program.

1. Open L85E_Slot0.ACD if it’s not already open.

NOTE: It’s located at C:\Lab Files\ACD. Use the Lab Files shortcut on the desktop.

2. If the file is open and online, go offline.

3. Open Google Chrome and navigate to 192.168.1.125.

4. In the prediction archive, select Save L5X.

5. In the bottom left corner of the screen, click the drop down arrow and select Show in folder.

40 of 56
6. When the folder opens, right-click and copy the CQI_Sensor_UDT.L5X file.

7. Paste the L5X file to the desktop.

41 of 56
8. Switch focus to Logix Designer (L85E_Slot0.ACD).

9. In the Controller Organizer, navigate to the User Defined Data type folder.

NOTE: It’s located within the Assets Folder.

10. Right-Click on User-Defined and select Import Data Type.

42 of 56
11. Navigate to the desktop and select CQI_Sensor.L5X and click Open.

12. The import configuration window will open. Change the Operation drop-down to “Overwrite” and Click OK.

NOTE: If the Operation says “use existing” change it to “Overwrite”

43 of 56
13. Verify that a UDT exists with the name CQI_Sensor.

14. Verify that a Controller scope tag was created named CQI_Sensor.

NOTE: The tag CQI_Sensor should be of data type CQI_Sensor. This is the UDT tag that the LogixAI module will use to
read and write data. You may have to scroll to the bottom of the Controller Tags to see a newly added tag.

15. That’s it! Only one more thing to do in this example and its ready to go.

NOTE: Controller Logic already exists in this example to manage the prediction model. The logic resides in program
P01_Cookie_Analysis. The only thing that must be done is to sync this logic to the prediction we just created.

16. Expand the P01_Cookie_Analysis program.

17. Double-click the R01_Analysis routine.

44 of 56
18. Add a rung to R01_Analysis.

NOTE: This routine should empty.

19. Click on the Add-On tab in the instruction toolbar.

20. Drag-and-drop the CQI_Calc AOI to the rung that was just created.

NOTE: The CQI_Calc AOI was created for the purpose for this lab. It is NOT formally associated with the LogixAI module.

21. Type CQI_Calc for the AOI backing tag. It should already be created.

45 of 56
22. In the Model_Tags drop-down, select the CQI_Sensor tag that was imported with the LogixAI import.

NOTE: Remember, this AOI was created specifically for this lab.

23. Make sure the rung verifies. Confirm that the final AOI instance looks like the following picture.

24. Save the project.

That’s it! It’s time to test it out.

46 of 56
Training the CQI_Sensor Model

In this section of the lab, we train and test the CQI Sensor Soft Sensing Model.

1. Download the L85E_Slot0.ACD file to the controller in slot 0.

NOTE: The IP address of the L85E in slot 0 is 192.168.1.20.

2. When prompted, place the controller into RUN mode.

3. If the HMI client is not already running, open it by double-clicking the CookieDemo.cli icon on the desktop.

NOTE: It may take a minute to open the HMI application.

47 of 56
4. At the right side of the navigation header at the top of the HMI screen select Quality.

5. The Cookie Quality screen appears. All of the values will initially be 0. We need to train the LogixAI module
before we can utilize the CQI_Sensor Soft Sensing Model. DO NOT ENABLE PRODUCTION MODE YET.

6. Click on the Training Detail button to open the training detail screen.

48 of 56
7. Again, all zeroes. This screen will allow us to simulate training.

NOTE: In this example we will train 100 times using “real” data from our hypothetical cookie line. Equipment exists on the
line that measures the cookie dimensions and temperature as it exits the final cooling tunnel. We know from our original
problem statement that each case requires one cookie to be destroyed for the lab to test the overall quality of the cookie.
The lab technician will input each cookie’s quality index into the controller as it’s collected. At this time, the LogixAI module
will be commanded to train on a single sample with the newly entered data. For the sake of time, this entire process has
been automated. It will only take a minute in the lab but in reality, it could take longer to train the LogixAI module with
manually collected data.

8. Press the Initial Training 100 Samples button.

NOTE: It may take a few seconds for the cycle to begin. The first training cycle may take up to 60 seconds to complete.

NOTE: As the LogixAI module is commanded to train, you will see the real time data being displayed in the table. From the
note on the previous step, the dimensions and temperature are captured automatically by the controller. The CQI value is
generated from technicians in the lab.

49 of 56
9. It will take a minute or two for the training to complete. Once completed, the details screen will look something
like the following image.

10. To simulate a single manual training cycle, click the Single Training 1 Sample button.

NOTE: In this case, the Lab Tech could enter the cookie parameters from each quality test and click “train”.

11. Close the Training Detail screen.

50 of 56
Using the CQI_Sensor Model to Calculate the CQI Value

In this section of the lab, we will use the CQI Sensor model to calculate real CQI values that we can use to reduce overall
destructive samples.

1. From the Cookie Quality screen, click on the Enable Production Mode button.

2. Wait a few minutes.

The upper and lower acceptable CQI value is indicated with the solid red lines. During normal operation, each case’s CQI is
calculated based on the measured cookie dimensions and temperature. One cookie is manually analyzed in the lab every
pallet (20 cases). Essentially, we will perform 20 calculations for every one training cycle. Notice how the confidence
changes after the 20th calculation. The quality of each case on the pallet is indicated on the grid to the left. Green is good,
red is bad, and gray means we are awaiting data.

3. Let’s simulate a deviation in one of our input values (Exit Temperature). Click the Simulate Temp Variation
button.

NOTE: This button will decrease the cookie exit temperature variable offset by 0.5 degrees.

51 of 56
4. Watch the Graph and the Pallet Quality Grid.

NOTE: Several samples will start failing per pallet (highlighted in red). Training will continue as long as the input and output
variables that were defined in prediction builder are within the upper and lower limits.

5. Click the Normal Operation button to bring the inputs back within tolerance.

6. Feel free to spend more time with the Quality screens before moving on.

7. Navigate to the controller program in Logix Designer.

NOTE: Pressing the icon below in the top left corner of the HMI screen will minimize the client application.

8. Open the Controller Tags

52 of 56
9. Locate and expand the tag CQI_Sensor. Expand Calculations.

NOTE: In Lab 1 we monitored the relative error and anomaly detected tags. In this use case (soft sensing) these
tags can be ignored.

That’s it!

53 of 56
Lab 2 Summary
The intent of lab 2 is to demonstrate the basic principle of Value Estimation. We were able to use the LogixAI module to
calculate the Cookie Quality Index value in real time as the cookies were exiting the cooling tunnel. This process was normally
handled by lab technicians, with no insight into the quality between testing. Additionally, the LogixAI module allows us to get
near real time CQI values. This results in getting cookies to packaging more quickly with higher quality. The lab technicians still
need to take a sample to ensure quality, but now one sample can be taken per pallet instead of one per case. Overall, there is
significantly less waste in lab resources and finished product when using the LogixAI module in this system.

Key Takeaways:
• Value Estimation can be used in soft sensor applications
• Historical data is not only usable, but it may be critical during training to reach an acceptable confidence
• Train on a regular schedule with GOOD data
• Data that can take time to manually produce can be calculated near real time with LogixAI

54 of 56
Notes

55 of 56
Notes

Publication XXXX-XX###X-EN-P — Month Year Copyright© 2019 Rockwell Automation, Inc. All rights reserved.
Supersedes Publication XXXX-XX###X-EN-P — Month Year

56 of 56

You might also like