0% found this document useful (0 votes)
449 views32 pages

Learn How To Work With Micro800 PID Control in Connected Components Workbench v21 Software

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
449 views32 pages

Learn How To Work With Micro800 PID Control in Connected Components Workbench v21 Software

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Learn how to work with Micro800™ PID control in

Connected Components Workbench™ v21 software

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.
Learn how to work with Micro800™ PID control in Connected Components
Workbench™ v21 software

Contents
Before you begin ........................................................................................................................................... 4
About this lab .................................................................................................................................................................................... 4
Tools and prerequisites..................................................................................................................................................................... 4

Exercise 1: Add a Micro800 Simulator to the project .................................................................................... 5

Exercise 2: Configure your Micro800 Simulator............................................................................................ 6

Exercise 3: Download your program into your Micro800 Simulator ............................................................ 11

Exercise 4: Develop your basic PID program ............................................................................................. 14

Exercise 5: Validate your PID and simulator program ................................................................................ 21

Exercise 6: Configure trend to monitor process .......................................................................................... 23

Exercise 7: Autotune your process ............................................................................................................. 27

3 of 32
Before you begin

About this lab


Connected Components Workbench software is the integrated design environment package that is used to program, design and
configure your Rockwell Automation® Micro Control devices – such as Micro800 programmable logic controllers, PowerFlex®
variable-frequency drives, Kinetix® 3 servo drives, SMC™ soft starters, Guardmaster® software configurable safety relays and
PanelView™ 800 operator interface terminals.
The following exercises will guide you on how to develop a PID application to control a simulated process. You will learn how to
develop the program, tune the PID loop, control and trend the process through a simulator, all with Connected Components
Workbench software.

Tools and prerequisites


▪ Software: Connected Components Workbench software version 21.00 – Developer Edition
▪ Files required: BaseProgram.7z

4 of 32
Exercise 1: Add a Micro800 Simulator to the project

In this exercise, you will be creating a project with a Micro800 Simulator.

1. Double-click the Connected Components Workbench software icon on the desktop to launch the program.

2. Create a project and name it ‘My First PID Project’.


From the Start Page, click New… and rename the project in the Name field. Verify that the Add Device on
Create checkbox is selected and click Create.

3. Add the Micro850® Simulator controller to your project.


Under Catalog, expand the Controllers folder. Expand the Micro850 and LC50 folders, click catalog
number 2080-LC50-48QWB-SIM, click Select, and then click Add To Project. The Simulator controller is
added to your project.

5 of 32
Exercise 2: Configure your Micro800 Simulator

In this exercise, you will configure your simulator and get to know how to start it up.

1. In the Project Organizer, double-click the Micro850 controller.

The controller configuration interface opens in the workspace.

2. Right click on slot 2 and slot 3 of your controller to add the following plug-in modules.
• Slot 2 – 2080-IF4
• Slot 3 – 2080-OF2

6 of 32
3. Both channels on the 2080-OF2 in slot 3 are disabled by default. Enable both channels in the plug-in
module configuration.

The program is now ready to download to the Micro800 Simulator but we have to configure the Simulator first.

4. Click the Start Simulator icon from the toolbar to launch the Micro800 Simulator.

7 of 32
5. Select the localhost or loopback IP Address 127.0.0.1.

6. Click the Synchronize the module configuration icon on the toolbar to synchronize the simulator module
configuration with your project.

Click Yes when the software prompts you that the configuration in the Micro800 Simulator will be replaced.

8 of 32
7. After you replace your Micro800 Simulator module configuration, the simulator is most likely hidden behind
your Connected Components Workbench software. You can select the simulator program from your toolbar
to bring it up again.

Notice that the simulator plug-in module configuration is now synced with the project Micro800 configuration.

9 of 32
8. Click the Power on icon to power on the Micro800 Simulator.

The Power status indicator on the Simulator lights up green to indicate that the Simulator is active.

10 of 32
Exercise 3: Download your program into your Micro800 Simulator

1. You can now download your Connected Components Workbench project to the Micro800 Simulator.

a. Click the Download icon from the controller configuration page.

b. When the Connection Browser opens, expand the AB_ETH-1 driver, highlight the Micro850 and
click OK.

11 of 32
c. Select the Download option.

2. When the controller is in Run Mode, you can manipulate the digital inputs by clicking them, or entering a
value for analog inputs. Outputs are controlled by the program and therefore cannot be manipulated.

12 of 32
3. To stop the Simulator, click the Exit Micro800 Simulator icon.

4. If, at any time, the Micro800 Simulator becomes faulted as shown below, you should be able to clear the
fault by clicking the radio buttons in the lower left corner of the Micro800 Simulator in the following
sequence: PRG, RUN, PRG, RUN, REM.

13 of 32
Exercise 4: Develop your basic PID program

You can use the oven simulator to evaluate your PID program. The oven simulator is controlled by pulse-width
modulation (PWM) and requires a PWM function. To simplify the work, we have created a basic program that
consists of a PWM function and the oven simulator program for you to import into your project.

1. In the Project Organizer, right-click Micro850 and select Import > Import Exchange File.

2. Browse to C:\Lab Files and select the file ‘BaseProgram.7z’.

3. Expand the file ‘BaseProgram’, verify that all checkboxes are selected and click Import.

14 of 32
4. Double-click ‘BaseProgram’ to review what is imported.
The file contains a base program and three user-defined function blocks (UDFBs). Here is a brief description of
the contents:
BaseProgram – This ladder diagram contains instances of the UDFBs. Use this ladder diagram as the base to
develop your PID application.
The first rung is an emergency stop button to stop the PWM signal.

The second rung is the autotune function that you use to tune the process.

The third rung is the PWM function and oven simulator

RA_PWM – This function block helps to generate pulse-width modulation for your oven simulator function block.
RA_PID_AUTOTUNE – This function block uses the relay method algorithm to autotune your process. It differs
from the autotune algorithm that is used in the IPIDCONTROLLER instruction.
RA_OVEN_SIMULATOR – This is the simulator function block. It has a formula that helps to simulate a self-
regulating process with a PWM signal.

15 of 32
5. Rename ‘BaseProgram’ to ‘TC1_PIDLoop’.

6. Drag-and-drop a rung between rungs 1 and 2.

7. Drag-and-drop an instruction block onto your new rung 2.

8. Search for the PID instruction, select it, and click OK to insert it.
This inserts the PID instruction onto rung 2.

16 of 32
Your PID instruction should look like the following image. If your instruction appears different, you may have
selected an incorrect instruction. Delete it and search for the PID instruction again.

9. Declare and assign the following variable as a local variable for your PID instruction.

17 of 32
10. Configure your PID instruction with initial parameters.

a. In the Project Organizer, double-click Local Variables under TC1_PIDLoop to access the local
variable list.

b. Enter the following initial value for the respective variables.

11. On rung 4 of the ladder diagram, assign ‘TC1_CV’ to DutyCycle in the RA_PWM instruction. This variable
controls the PWM that generates heat in the simulator.

18 of 32
12. On the same rung, assign ‘TC1_PV’ to Oven_Temp in the RA_OVEN_SIMULATOR instruction. This
variable is the temperature of the simulator.

13. Configure ‘TC1_PIDLoop’ to run on a periodic interval.

a. In the Project Organizer, double-click Micro850 to open the controller configuration interface in
the workspace

b. Under the Controller tree, select Interrupts.

19 of 32
c. Click Add to add an interrupt.

d. Configure the ‘TC1_PIDLoop’ program as a Selected Timed Interrupt (STI) with a 50 ms interval.

Verify the ‘Auto Start’ checkbox is selected. If the checkbox is not selected, you have to start the
STI in your program manually.

e. The ladder icon for ‘TC1_PIDLoop’ changes once it is configured for an interrupt. The details of the
interrupt also appear in the Controller - Interrupts overview.

20 of 32
Exercise 5: Validate your PID and simulator program

1. Download your program to your simulator controller.

2. When download is completed, switch the controller to Remote Run Mode.

3. Your ‘TC1_PV’ value should be around 30 at the current state. This indicates that the temperature of the
simulation is about 30.

4. Your PID instruction should be active and there should be no errors.


If there are any errors in your PID instruction, revisit Exercise 4, step 11. Check if you missed some steps to
initialize the PID parameters.

5. The PID is now in manual mode because ‘TC1_Mode’ is FALSE by default.

6. When the PID is in manual mode, you can control the output by manipulating ‘TC1_MV’. For example, if you
set ‘TC1_MV’ to 80, ‘TC1_PV’ will rise and saturate at about 900 eventually. You can proceed to the next
step without waiting for the value to rise.

21 of 32
7. The oven simulator has a predefined temperature range from 30 to 1000. If your ‘TC1_PV’ responded when
you made changes to ‘TC1_MV’, it shows that your process is properly connected.

8. Set ‘TC1_Mode’ to TRUE to put the PID into auto mode. You can now enter a setpoint in ‘TC1_SP’ (for
example 800.0) and observe your process. To help you better visualize how your process behaves, you can
configure a trend to monitor your ‘TC1_PV’, ‘TC1_SP’ and ‘TC1_CV’ tags. The steps to do so are described
in the next exercise.

22 of 32
Exercise 6: Configure trend to monitor process

To help you better visualize your process, Connected Component Workbench software Version 12 allows you to
trend variables in your controller in real time. You can also save the trend data as a CSV file for analysis later.

1. In the Project Organizer, click the Trends tab.

You can do this while you are connected or disconnected from the controller.

2. Click the Add Trend icon

3. This opens the Properties window for Trend. Under TRACES, click the ‘+’ to add traces for variables.

4. You can add traces for both global and local variables. Simply browse to the program where the tags are
located and select the tags you want to trace. For this exercise, select ‘TC1_PV’, ‘TC1_SP’ and ‘TC1_CV’.

23 of 32
5. Expand each trace to show the configuration. Configure the minimum and maximum axis value for each
trace.

6. Click OK to complete the configuration. The three traces are added to the chart.

7. Click the Play icon to start the Trend.

24 of 32
8. The traces are separated by default. To see the three axes on one chart, click the Setting icon and
set Y-axis to ‘Overlaid’, and Scaling to ‘Manual’.

9. The chart shows only the latest trend by default. To see the entire trend, click VIEW ALL.

10. If you change the setpoint ‘TC1_SP’, you can observe all process behaviors in one view.

Since the process is not tuned, the response is not optimized. If you are using the initialized PID parameter,
observe that ‘TC1_CV’ moves slowly when you change the setpoint.
You can drop a pin at any point on the trend to check the value. Click the Unpin icon to remove the pin from
the trend.

25 of 32
11. You can change the PID parameters and observe how it affects the PID response. The PID parameters are
configured at ‘TC1_inGain’, which is in the Local Variables of ‘TC1_PIDLoop’ under the Devices tab.

26 of 32
Exercise 7: Autotune your process

1. In the previous exercise, you validated your PID instruction and simulator program. In the Project
Organizer, click the Devices tab to return to your device and program.

2. Click Run Mode Change from the toolbar to edit your program.

3. Rung 3 is the autotune instruction that was part of the imported ‘BaseProgram’. This is a user-defined
function block (UDFB) that is available for download from the Rockwell Automation Sample Code Library.
Declare new variables and assign existing local variables as follows:

4. Click the Test Changes icon from the toolbar.

5. When the compiler is completed, you will be in debug mode again. Click the Accept Change icon

27 of 32
6. Program the autotune to work with PID manual mode as the autotune output is assigned to ‘TC1_MV’. Thus,
you must set PID to manual mode by setting ‘TC1_mode’ to FALSE.

7. Set the target temperature ‘TC1_SP’ to 800 for your autotune.


As you are autotuning the process at 800, confirm that ‘TC1_PV’ has dropped below 700 before proceeding
to the next step.

8. When ‘TC1_PV’ is below 700, toggle ‘TC1_AutoTune’ to start the autotune procedure.

28 of 32
9. During the autotune procedure, notice that the temperature rises above and drops below your target
temperature a couple of times. Autotune is completed when ‘AT_ID’ is at 99. You can get your process
direction and tuning result from ‘TC1_outDir’ and ‘TC1_outGain’ respectively.

29 of 32
10. Copy the tuned parameters to your PID input parameters. You can copy-and-paste the value manually in
the Variable Monitoring window.

30 of 32
11. Scroll to your PID instruction in rung 2. The temperature should drop to around 30. The setpoint was set
previously at 800. Since you have copied the tuned gain parameters to the input parameters, you can set
the PID to auto mode by setting ‘TC1_Mode’ to TRUE.

Notice that the PID is taking care of the process now. You can change the setpoint ‘TC1_SP’ to any value
from 30 to 1000 and the PID instruction should be able to control the temperature.

12. You can open your previous Trend and observe the new PID behavior.

31 of 32
Allen-Bradley, Connected Components Workbench, FactoryTalk, Guardmaster, Kinetix, Micro800, Micro850, PanelView, PowerFlex, Rockwell Automation, Rockwell Software, RSLinx, SMC and
TechConnect are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.

Copyright© 2019 Rockwell Automation, Inc. All Rights Reserved.

32 of 32

You might also like