L05 - Advanced PLC Topics For Micro800Ö Controllers With Motion Capabilities and CIP Messaging Functionality - Lab Manual

You might also like

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

Advanced PLC Topics for Micro800® Controllers with

Motion Capabilities and CIP Messaging Functionality

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.
Advanced PLC Topics for Micro800 Controllers with Motion Capabilities and
CIP Messaging Functionality

Contents

Before you begin ........................................................................................................................................... 5


About this lab .................................................................................................................................................................................... 5
Tools & prerequisites ........................................................................................................................................................................ 6
About the Connected Components Demo kit .................................................................................................................................... 7
About the drives settings................................................................................................................................................................... 7

Exploring the CCAT building block features ................................................................................................. 8


Load Demo program ......................................................................................................................................................................... 8
State Machine Operation- Manual mode ........................................................................................................................................ 15
State Machine Operation- Auto mode............................................................................................................................................. 24

Lab 1: Load the starting project ................................................................................................................. 27


Load the starting project ................................................................................................................................................................. 27
About the starting project ................................................................................................................................................................ 28

Lab 2: Program your ‘Abort Sequence’ ....................................................................................................... 30

Lab 3: Program your ‘Clear Sequence’ ....................................................................................................... 37

Lab 4: Program your ‘Reset Sequence’ ...................................................................................................... 45

Lab 5: Program your ‘Run Sequence’ ......................................................................................................... 53

Lab 6: Program your ‘Stop Sequence’ ........................................................................................................ 71

Lab 7: Assign checks for State Machine ..................................................................................................... 75

Lab 8: Validating your label machine sequence ......................................................................................... 76

Appendix A .................................................................................................................................................. 81
PowerFlex® 4 Drive configuration ................................................................................................................................................... 81
Kinetix® 3 Servo Drive Configuration .............................................................................................................................................. 82

Appendix B .................................................................................................................................................. 87
RA_PF4_MBUS_STS User-defined Function Block ....................................................................................................................... 87
RA_PF4_MBUS_CMD User-defined Function Block ...................................................................................................................... 90

Appendix C .................................................................................................................................................. 93
RA_Motion_Move_Cmd User-defined Function Block.................................................................................................................... 93
RA_K3_MBUS_STS User-defined Function Block ......................................................................................................................... 96
Before you begin

The following should have already been verified with your demo kit by the lab instructors prior to the lab:
1. Micro850® controller firmware at v7.011 (updated via ControlFLASH if necessary).
2. PanelView™ Component terminal firmware at v1.80 (updated via USB drive if necessary).
3. PVc file Demo_Labeling_Machine.cha loaded on PanelView C600 terminal (copied via USB drive if necessary).
4. Demo kit power cycled off and back on.

About this lab

In this lab, you are to make a simple labelling application with a Servo and an AC motor for your customer machine.
The picture above shows the parts you have in the machine and these parts correspond to what you have in the
demo kit: The conveyor belt is driven by the PowerFlex 4M AC drive and motor, the labeling head is driven by the
Kinetix 3 Servo drive and motor, and the label sensor is connected from the proximity sensor at the AC motor, to the
PLC input terminal 4.
The starting project consists of two building blocks from the Connected Components Accelerator Toolkit (CCAT).
This gives you a head start in your program development. You willl program your labelling application with the
‘PowerFlex 4 Speed’ and ‘PTO Motion’ building blocks in this lab session.
In this lab, you will
 Get to know how the template in the starting project gives you a head start
 Explore the ‘Application Sequences’ in your starting project
 Try the different device functions through their face plates
 Create your labeling application program with the template
 Operate and troubleshoot your machine in Auto mode
Tools & prerequisites
For this hands-on lab, we have provided you with the following materials that will allow you to complete the labs in
this workbook.
 Software: Connected Components Workbench™ software Version 7.00.00 – Standard or Developer Edition
 Hardware: Connected Components demo kit – DEMO-CCMICRO1
 Required CCW Project Files:
o Demo_Labeling_Machine_r7.zip (includes Demo_Labeling_Machine.cha)
o Starting_Labeling_Machine_r7.zip

Lab setup
About the Connected Components Demo kit

The image locates items on the demo and verifies the lab setup:
1. Verify the demo power switch selector is according to your area socket AC output
2. Connect the cable and switch on the power
3. Micro850 controller
4. PanelView C600 terminal
5. Kinetix 3 servo drive
6. PowerFlex 4M variable frequency drive
7. Digital and analog input panel
8. Servo motor with homing sensor
9. PowerFlex AC motor with proximity sensor

About the drives settings


Both drives have been pre-configured to work with this lab. The settings for each drive are listed in Appendix A.
Exploring the CCAT building block features

Every release 6 (and above) building block comes with a ‘State Machine Building Block’ and ‘Application Sequence’
template (e.g. Run, Stop, Abort sequence etc…). These sequences operate in state machine auto mode and are
isolated from the state machine manual mode operation. When the state machine is in manual mode, you can
operate each connected device separately through their face plate. The diagram below illustrates how the HMI, state
machine, application sequences and building block interact.

Load Demo program


You are going to load the demo program into the Micro850 controller to experiment with what you would expect at the
end of this session.
1. Ensure that the Micro850 is connected to your PC with a USB cable.

2. If it is not already open, run Connected Components Workbench by double clicking from the desktop.

3. Click from the task bar and browse to: C:\Lab Files\Micro800 Lab\Demo_Labeling_Machine _r7.

a. Select “Demo_Labeling_Machine_r7.ccwsln” and click Open.

4. Connect to the controller.

a. Scroll to the top of the Project Organizer window.

b. Double click the ‘Micro850’ icon.


c. Click the ‘Connect’ button in the top right hand corner of the configuration window.

d. The Connection Browser screen will appear.

e. You should see a ‘USB’ driver with a ‘+’ by it. (If not, ask for help.)

f. Click the ‘+’ to expand the USB driver.

You should see a connected Micro850 controller.

g. Select the controller and click OK.

It should show ‘Connected’ on the top right hand corner of the configuration window.
5. Build this project.

a. Right click the Micro850 controller icon.

b. Select Build.

c. The output window should show that the build is successful.


6. Download your project

a. Right click the ‘Micro850’ controller.

b. Select ‘Download’.

c. A ‘Download’ window may appear to ask for permission to change to Remote Program mode – if so,
click ‘Yes’.

d. The Download Confirmation window will appear. You will be prompted to overwrite the project in the
controller. The two choices are Download and Download with Project Values. The second choice is
a new feature in Release 7 of Connected Components Workbench. Now, when a project is uploaded
from the controller, a snapshot of the values of all of the user variables is uploaded and saved. These
values can be downloaded back into the controller along with the project by selecting Download with
Project Values. If you clicked the Help button, you would find that the following conditions must be
met in order for a Project Value to be downloaded to a variable:
i. Variables with both a Project Value and an Initial Value will be initialized with their Initial Value.
ii. Variables with an Attribute of "Read" or "Write" cannot be downloaded. Variables must have
an Attribute of "Read/Write".
iii. Variables with a Direction of "VarInput" cannot be downloaded.
iv. Complex variables (structures, arrays) that contain members with Initial Values cannot be
downloaded.
e. In this lab, we will download using the assigned initial values. Therefore, just click Download.

f. When download has completed, the ‘Download’ window may appear again to request permission to
change to Remote Run mode – if so, click ‘Yes’.
7. On the PanelView C600 terminal, select File Manager from the Main menu:

8. Press the up/down arrows to find and highlight Demo_Labeling_Machine and press Run.

9. Press Start Drive Config and follow the on-screen directions.


10. When screen indicates Drive configuration complete! press Go to Demo to continue with lab.
State Machine Operation- Manual mode
While the machine is in manual mode, you can control each connected device through its faceplate. There are two
device building blocks installed in this demo. Next you will explore their features in machine manual mode.

1. Ensure that you are at the ‘Machine Overview’ screen. If not, press X in the top right hand corner until you
arrive at the ‘Machine Overview’ screen.

2. Press ‘Machine Functions’ to see the available functions installed for you.

3. There should be two devices already installed for you, namely ‘PF4_01’ and ‘Axis_02’ to control your AC
and Servo motor respectively. Press ‘Manual’ to set machine to manual mode.

4. Press the ‘Device: PF4_01’ to explore what you can do with the PowerFlex4 Speed building block.
PowerFlex 4 Speed building block screen

1. Confirm that any motor connected to the drive is in a safe state to operate manually.

2. If there is any fault, press ‘Clear Fault’

3. Set a speed reference by pressing the blue box, then entering a value from 1 to 60 Hz.

4. Set the drive direction forward by pressing the ‘Fwd’ button.

5. Press ‘Start’, and verify the drive starts and ramps up to the speed reference specified.

You can verify the actual speed reference in the Speed Ref Actual numeric display.
6. Verify that the Ready, Active, Fwd, and At Ref indicators are green once the drive is up to speed.

7. Press Stop, and verify the drive stops and ramps down to a speed reference of 0.00 Hz.

The Active indicator will turn gray once the drive has completely stopped.

8. Test the Jog functionality by pressing and holding the Jog button.

The drive will jog at the drive’s preset jog speed of 10.0 Hz.
9. Press ‘X’ to go back to ‘Machine Functions’ screen.

10. Press the ‘Device: Axis_02’ to explore what you can do with the PTO Motion building block.
PTO Motion building block screen

1. Confirm that any motor connected to the drive is in a safe state to operate manually.

2. You are at the Command & Status screen for PTO motion. Press ‘Servo Enable’.

This energizes the motor, and it attempts to hold its present position.

3. Set ‘Deceleration’ to 100 mm/s2.

4. Set ‘Acceleration’ to 100 mm/s2.

5. Set ‘Jog Speed’ to 100 mm/s.

6. Press and hold ‘Jog Forward’.

The motor rotates forward.

7. Release ‘Jog Forward’.


The motor should stop.
8. Press and hold ‘Jog Reverse’.
The motor rotates in the reverse direction.

9. Release ‘Jog Reverse’.


The motor should stop.

10. Set ‘Home mode’ to ‘0’.

11. Press ‘Start Homing’.

The motor begins to home and the ‘Homed’ indicator turns green when axis is homed.

12. Press ‘Advanced move’ to explore what it can do further.


You will explore the different types of move commands supported by Micro800 motion.
13. Press ‘Select Move’ once to change ‘Move type’ to ‘Velocity’ for Velocity control.

14. Set ‘Direction’ to 1 for forward direction.

15. Press ‘Move’.


Motor accelerates and cruises at 100mm/s.

16. Press ‘Halt’.


Motor decelerates to a stop.
17. Press ‘Move type’ once more to select ‘Absolute’ to demonstrate absolute positioning.

18. Press ‘Start Homing’ to home the motor.


Motor will move to home position and reset current position to ‘0’.

19. Enter 500 for ‘Position’.


20. Press ‘Move’.
Motor will move to absolute position 500 and stop.

21. Press ‘Move type’ once more to ‘Relative’ to demonstrate relative positioning.

22. Enter 100 for ‘Position’.

23. Press ‘Move’.


Motor will move for an additional 100mm to position 600mm.

24. Press ‘Servo Disable’.


You have completed this demonstration. Return to the ‘Machine Overview’ screen to test the program for the labeling
application.
25. Press ‘X’ twice to return to ‘Machine Functions’ screen.

State Machine Operation- Auto mode


When the machine is in auto mode, it operates through a set of ‘Application Sequences’ programmed to handle
different tasks. In this demo program, the ‘Application Sequences’ have already been coded for the labeling machine.
You will explore how the labeling application works in this section.

1. Ensure that you are at the ‘Machine Functions’ screen - if you are not, press X on the top right hand corner
until you arrive at the ‘Machine Functions’ screen.

2. Press ‘State Diagram’ to look at the machine program flow.


You should see that the current state is ‘ABORTED’ and if you look at how the arrow flow, the next state is ‘CLEARING’.

3. Press ‘Clear Faults’.


The state changes to ‘CLEARING’ and then to ‘STOPPED’ quickly. You may not see the ‘CLEARING’ sequence turns green
as it might be over before you can see it. When the state is at ‘STOPPED’, you have cleared the machine fault successfully.
4. Press ‘Auto’ to set machine to ‘Auto’ mode.

Caution!
Expect motion when you press ‘Start’. Ensure that the Servo and AC motor is safe to operate.

5. Press ‘Start Machine’.


The state changes to ‘RESETTING’ and the servo motor begin to move to home position. When ‘Homed’, the state changes
to ‘IDLE’.

6. Press ‘Start Machine’ again to run the program.


The state changes to ‘RUNNING’.
About the program

The program simulates a labelling machine application. The AC motor drives a conveyor belt and the servo
motor drives a labeling head. When a product triggers the Label Sensor (simulated by triggering the sensor
with the metal tape on the ‘PowerFlex’ disc), servo motor index once to apply a label on the product and this
cycle continue until someone stop the machine.

7. Press ‘Stop Machine’ to stop.


Both motors come to a stop and the state changes to ‘STOPPED’.
You have completed this section of the lab. In the next section, you will load a starting project and learn how to program the
labeling sequence for yourself.
Lab 1: Load the starting project

In this section, you will load the starting project and understand more about the existing building blocks and application sequence
template in the starting project. The purpose of the lab is to show how to complete the integration of these exisitng building
blocks, along with the application sequence template, to create a functioning Labeling Machine.

Load the starting project

1. Click the “open” icon.

2. From the “Open” window, browse to: C:\Lab Files\Micro800 Lab\Starting_Labeling_Machine_r7.

3. Select “Starting_Labeling_Machine_r7.ccwsln” and click “Open”.

4. Build your project and verify there are no errors.

5. Download the project to your controller.


About the starting project
The starting project is loaded with the PowerFlex 4 Speed Control and Kinetix 3 PTO Motion CCAT Building Blocks, along with a
State Machine for machine control. These building blocks provide helpful variables for controlling and monitoring the status of
devices, as well as a structured flow of sequences during machine operation.
The diagram below shows you the name of each program in your starting project.
The State Machine building block handles the ‘Application Sequences’ according to the flow chart below:

[1-5]
In this lab session, you will be programming each of these application sequences for the labeling machine and operate it through
the demo kit.
Lab 2: Program your ‘Abort Sequence’

The program name of the ‘Abort Sequence’ is ‘App_Abort_Seq’. In this sequence, we will stop all motion.
1. Double click ‘App_Abort_Seq’ in Project Organizer.
2. Click anywhere on Rung 1, then toggle ‘Ctrl+R’ to activate ‘Manual-Input Enable’. This prevents the variable
selector window from popping up in a program when you insert a new instruction.

Note:
Alternatively you could enable this for the whole project by going to Tools > Option >IEC Languages >
Function Block Diagram, under Editor Settings, set ‘Automatically invoke Variable/Block’ to FALSE.
In this lab, we shall toggle ‘Ctrl+R’ in each program to enable the ‘Manual-Input Enable’.
3. Create a second branch parallel to the first branch.

a. Drag a from the Toolbox.

b. Drop it anywhere within the red boxed cell in your program

A second branch is added.

4. Insert a from the Toolbox in the first branch.

5. Assign variable ‘PF4_01_Cmd_Stop_Auto’ to the Set coil.

a. Hover your mouse above the coil and a light blue box appears.
b. Click the light blue box, type in variable name ‘PF4_01_Cmd_Stop_Auto’ and hit Enter.

This command stops the AC motor.

6. Insert a from the Toolbox in the second branch.


7. Assign variable ‘Axis_02_Cmd_Stop_Auto’ to the direct coil.
a. Hover your mouse above the coil where the light blue box appears.
b. Click the light blue box, type in variable name ‘Axis_02_Cmd_Stop_Auto’ and hit Enter.

This command stops the Servo motor.

8. Insert two contacts in series in the third branch to the left of the ‘MOV’ instruction.

9. Assign variables ‘PF4_01_Sts_Active’ and ‘Axis_02_Sts_InMotion’ to the first and second contacts
respectively.

These contacts verify that both motors have stopped.


Note
Always end the ‘Abort’ sequence with ‘App_Cfg_Abort_Seq’ equal to 999. This allows the State Machine to
move to the next application sequence

10. Build your project and verify there are no errors.


Lab 3: Program your ‘Clear Sequence’

The program name of the ‘Clear Sequence’ is ‘App_Clear_Seq’. In this sequence, we will trigger the clear fault
variable in the building blocks.
1. Double click ‘App_Clear_Seq’ in Project Organizer.

2. Click anywhere on Rung 1, then toggle ‘Ctrl+R’ to activate ‘Manual-Input Enable’.

3. Right click to copy and paste Rung 1 to the empty space below it.
You now have 2 identical rungs.

4. Insert two to the area within the red boxed cell of rung 1.
You should have 4 branches altogether.

5. Insert a in the first branch and assign variable ‘Axis_02_Cmd_Reset_Auto’ to it.

This command resets the PTO motion building block.


6. Insert a in the second branch and assign variable ‘Axis_02_Cmd_RsetDrv_Auto’ to it.

This command resets the Servo drive.

7. Insert a in the third branch and assign variable ‘PF4_01_Cmd_ClrFlt_Auto’ to it.

This command resets the Powerflex 4 Speed building block and AC drive.
8. Insert two in the fourth branch and assign variables ‘PF4_01_Sts_DriveFault’ and
‘Axis_02_Sts_AxisErr’ to the first and second contacts respectively.

These contacts verify that any faults have been cleared.

9. Assign ‘10’ to ‘i1’ of the ‘MOV’ instruction.


When completed, your Rung 1 of ‘App_Clear_Seq’ program should look like this.
10. In Rung 2, you can delete the rung comment copied from rung 1.

11. Assign ‘10’ to ‘i2’ of ‘=’ instruction.

This rung is where we program for step 10.

12. Insert a in the first branch and assign variable ‘Axis_02_Cmd_Enable_Auto’ to it.

This command switches off the servo motor.


When completed, your program should look like this.

Note
Always end the ‘Clear Sequence’ with ‘App_Cfg_Clear_Seq’ equal to 999. This allows the State Machine to
move to the next application sequence

13. Build your project and verify there are no errors.


Lab 4: Program your ‘Reset Sequence’

The program name of the ‘Reset Sequence’ is ‘App_Reset_Seq’. In this sequence, we will configure some motion
parameters and move the servo to its initial position.
1. Open the ‘App_Reset_Seq’ program.

2. Click anywhere on Rung 1, then toggle ‘Ctrl+R’ to activate ‘Manual-Input Enable’.

3. Right click rung 1 to copy and paste to Rung 2 and 3.

You now have 3 identical rungs.


4. Insert two to the area within the red boxed cell.

You should have 4 branches altogether in rung 1.

5. Insert a in the first branch and assign variable ‘Axis_02_Cfg_EnNegative_Auto’ to it.


6. Insert a in the second branch and assign variable ‘Axis_02_Cfg_EnPositive_Auto’ to it.

These commands enable the PTO motion axis to move in the positive and negative direction.

7. Insert a in the third branch and assign variable ‘PF4_01_Cmd_Stop_Auto’ to it.

This resets the stop command issued to the Powerflex 4 Speed building block in all previous ‘Application
Sequences’.
8. Assign ‘10’ to the input of ‘MOV’ instruction on the fourth branch of Rung 1.
This instruction brings the ‘Reset Sequence’ to the next step (step 10). Your rung 1 should look like this.

9. In Rung 2, you can delete the comment copied from Rung 1.

10. Assign ‘10’ to ‘i2’ of ‘=’ instruction in Rung 2.

11. Insert a in the first branch and assign variable ‘Axis_02_Sts_AxisEn’ to it.
12. Insert a to the right of the reverse contact and assign variable ‘Axis_02_Cmd_Enable_Auto’
to it.

13. Insert a in the second branch and assign variable ‘Axis_02_Sts_AxisEn’ to it.

14. Assign ‘11’ to the input of the ‘MOV’ instruction.

15. In Rung 3, you can delete the comment copied from Rung 1.
16. Assign ‘11’ to ‘i2’ of the instruction.

17. Insert a in the first branch and assign variable ‘Axis_02_Cmd_Home_Auto’ to it.

This command requests the servo motor to move to home position.

18. Insert a in the second branch and assign variable ‘Axis_02_Sts_AxisHomed’ to it.

This verifies that the servo motor is homed.

Note
Always ends the ‘Reset Sequence’ with ‘App_Cfg_Reset_Seq’ equal to 999. This allows the State Machine
to move to the next application sequence.
When completed, your program should look like this.

19. Build your project and verify there are no errors.


Lab 5: Program your ‘Run Sequence’

The program name of the ‘Run Sequence’ is ‘App_Run_Seq’. In this sequence, we set the dynamic parameters and program a
continuous labeling sequence.
1. Open the ‘App_Run_Seq’ program.

2. Click anywhere on Rung 1, then toggle ‘Ctrl+R’ to activate ‘Manual-Input Enable’.

3. Right click rung 1 to copy and paste to Rung 2, 3 and 4.

You should have 4 identical rungs.


4. In rung 1, set the dynamic parameters for the conveyor belt, which is controlled by the AC motor.

a. Insert a parallel to the first branch.

Your branches should look like this.

b. Insert a ‘MOV’ instruction in the first branch by clicking on the existing ‘MOV’ instruction, right click
and ‘Copy’, click on the first branch, right click and ‘Paste’.

c. Assign ‘1.0’ to the input of the ‘MOV’ instruction.

d. Assign variable ‘PF4_01_Cmd_SpeedRef_Auto’ to the output of the ‘MOV’ instruction.

This sets the speed reference for the PowerFlex 4 Speed building block to 1Hz. For more information about the
UDFB used in the PowerFlex 4 Speed building block, you can refer to Appendix B.
e. Insert a in the second branch.

f. Assign variable ‘PF4_01_Cmd_SetFwd_Auto’ to it.


This sets the PowerFlex 4 Speed building block in forward direction. When completed, your rung 1 should look
like this.

5. In rung 2, set the dynamic parameters for the labeling head which is controlled by the Servo motor.

a. Assign ‘10’ to ‘i2’ of ‘=’ instruction.


This rung is step 10 of the ‘Run Sequence’.
b. Insert four more parallel to the right of the ‘=’ instruction.
Your program should look like this.
c. Insert a ‘MOV’ instruction in the first branch.

i. Drag and drop an ‘Instruction Block’ from the Toolbox onto the first branch.

ii. Double click this ‘Instruction Block’.


iii. A Block Selector window appears - type ‘MOV’ in the search field.

iv. ‘MOV’ instruction appears – click it and then click OK.


d. Assign ‘3’ to the input of the ‘MOV’ instruction.

e. Assign variable ‘Axis_02_Cfg_MoveMode_Auto’ to the output of the ‘MOV’ instruction.

This sets the PTO motion building block to ‘Relative move mode’. If you want to know what sets the PTO motion
building block to the mode it is in, you can refer to Appendix C.
f. Insert a ‘MOV’ instruction in the second branch.

g. Assign ‘2.5’ to the input of the ‘MOV’ instruction.

h. Assign variable ‘Axis_02_Par_PositionData_Auto’ to the output of the ‘MOV’ instruction.

This sets the relative position reference for the PTO motion building block.
i. Insert a ‘MOV’ instruction in the third branch.

j. Assign ‘100.0’ to the input of the ‘MOV’ instruction.

k. Assign variable ‘Axis_02_Par_AccData_Auto’ to the output of the ‘MOV’ instruction.

This sets the acceleration reference for the PTO motion building block.
l. Insert a ‘MOV’ instruction in the fourth branch.

m. Assign ‘100.0’ to the input of the ‘MOV’ instruction.

n. Assign variable ‘Axis_02_Par_DecData_Auto’ to the output of the ‘MOV’ instruction.

This sets the deceleration reference for the PTO motion building block.
o. Insert a ‘MOV’ instruction in the fifth branch.

p. Assign ‘20.0’ to the input of the ‘MOV’ instruction.

q. Assign variable ‘Axis_02_Par_VelocityData_Auto’ to the output of the ‘MOV’ instruction.

This sets the speed reference for the PTO motion building block.
r. On the sixth branch, assign ‘11’ to the input of the ‘MOV’ instruction.

This branch configures the dynamic parameters for the servo and brings the ‘Run Sequence’ to step 11.
6. In rung 3, initiate the conveyor belt to move.

a. Assign ‘11’ to ‘i2’ of ‘=’ instruction.

This rung is step 11 of ‘Run Sequence’.

b. Insert a in the first branch.

c. Assign variable ‘PF4_01_Cmd_Start_Auto’ to the ‘Direct Coil’ in the first branch.

This command starts the AC motor.


d. Insert a in the second branch.

e. Assign variable ‘PF4_01_Sts_Active’ to the contact.

This command verifies that the motor has started.

f. Assign ‘12’ to the input of the ‘MOV’ instruction.


This brings the ‘Run Sequence’ to step 12 and your rung 3 should look like this.

7. In rung 4, the servo motor indexes once when the sensor senses a product.

a. Assign ‘12’ to ‘i2’ of ‘=’ instruction.


This rung is step 12 of ‘Run Sequence’ and your rung 4 should look like this.
b. Insert a to the right of the ‘=’ instruction.

c. Assign variable ‘_IO_EM_DI_04’ to the contact.

‘_IO_EM_DI_04’ is the controller input terminal that connects to the sensor.

d. Insert a to the right side of the rung.

e. Assign variable ‘Axis_02_Cmd_Move_Auto’ to the coil.

This commands the servo motor to index whenever the sensor detects a product.
f. Delete the ‘MOV’ instruction and the second branch.
When completed, your 4 rungs program should look like this.
8. Build your project and verify there are no errors.
Lab 6: Program your ‘Stop Sequence’

The program name of the ‘Stop Sequence’ is ‘App_Stop_Seq’. In this sequence, we halt all motion. The program is very similar
to ‘Abort Sequence’ thus we can copy the program from ‘App_Abort_Seq’.
1. Copy program from ‘App_Abort_Seq’.

a. Double click ‘App_Abort_Seq’.

b. Select the first rung (only rung).

c. Ensure that the rung is highlighted with green borders.

d. Right click and select ‘Copy’.

2. Paste program to ‘App_Stop_Seq’.

a. Double click ‘App_Stop_Seq’.

b. Right click the first rung and select ‘Paste’.


The program is inserted in Rung 1.

3. Update the variables for ‘App_Stop_Seq’.

a. Assign ‘App_Cfg_Stop_Seq’ to the input of ‘=’ instruction in Rung 1.

b. Assign ‘App_Cfg_Stop_Seq’ to the output of ‘MOV’ instruction in the third branch of Rung 1.

c. Assign ‘Axis_02_Cmd_Halt_Auto’ to the ‘Direct Coil’ in the second branch of Rung 1.


4. Edit the rung comment to ‘Stop Sequence’.

5. Delete Rung 2.
When completed, your program should look like this.

6. Build your project and verify there are no errors.


Lab 7: Assign checks for State Machine

The State Machine checks for conditions to make sure that the connected devices are operationally ready. If any of
the devices is not ready, the application sequence will be set to “Abort’. For example, if there is a critical alarm in the
connected device while the machine is running, the state machine will detect it and execute the ‘App_Abort_Seq’
program to stop the machine.

1. Double click ‘App_Main’.

2. Insert two in series on Rung 10.

3. From the User Global Variables tab, assign ‘PF4_01_Sts_DriveCommLoss’ to the first contact.

4. From the User Global Variables tab, assign ‘Axis_02_Sts_DrvComm’ to the second contact.
This rung detects communication loss for connected device. Your rung 10 should look like this.

5. Insert two in series on Rung 14.

6. Assign variable ‘PF4_01_Sts_DriveFault’ to the first contact.

7. Assign variable ‘Axis_02_Sts_AxisErr’ to the second contact.


This rung detects faults generated by the building blocks. When completed, your rung 14 should look like this.

8. Build your project and verify there are no errors.

9. Download your project.


Lab 8: Validating your label machine sequence

1. Ensure that you are at the ‘Machine Overview’ screen. If not, press X in the top right hand corner until you
arrive at the ‘Machine Overview’ screen.

2. When you are at the ‘Machine Overview’ screen, it should be ‘Aborted’ with ‘First Scan’ indicating the
reason that it last aborted.

3. Press ‘Clear Faults’.

4. Machine State should change to ‘STOPPED’ - now you can press ‘Start Machine’.

Caution!
Expect motion when you press ‘Start Machine’. Ensure that the Servo and AC motor are safe to operate.
5. Machine State should change to ‘IDLE’ - you can press ‘Start Machine’ again to begin the labeling
application.

6. Machine State should change to ‘RUNNING’ and both motors should be operating according to what you
have programmed.
7. Next let’s assume that the label head has reached its limit and that the operator has to replace the film.
Trigger ‘DI1’ on the demo kit to simulate this limit.

8. The Machine State changes to ‘ABORTED’. To know what caused the abort, we look at the device face
plate. Press ‘Machine Functions’.

9. The Servo face plate has a red box over it. This indicates that there was an error event. Press the ‘Device:
Axis_02’ button.
10. This brings you to the PTO motion face plate. You can see that there is an axis error, code ‘E11’. Press
‘Fault Help’ for more details about the error.

11. This brings you to the ‘Fault Help’ screen of the PTO motion face plate for more information about the fault.
12. Press ‘X’ in the top right hand corner three times to return to the ‘Machine Overview’ screen.

13. Press ‘Clear Fault’ to reset the error.

14. Once the error has cleared, you can press ‘Start Machine’ to home your servo motor.

15. Once your servo motor is homed, you can press ‘Start Machine’ again to run the labeling application.

16. To stop the machine, press ‘Stop Machine’.

Congratulations! You have completed this lab.


Appendix A

PowerFlex 4 Drive configuration


The configuration listed here are the non-default value settings.
# Name Value Units Internal Default Min Max
Value
2 Commanded 1.0 Hz 10 0.0 0.0 999.9
Freq
5 DCBusVoltage 354 V 354 0 0 1200
6 Drive Status 00000000 2 00000000 0 15
00000010 00000000
7 Fault 1 Code 4 4 0 0 9999
8 Fault 2 Code 81 81 0 0 9999
9 Fault 3 Code 4 4 0 0 9999
12 Control 55 55 0 0 255
Source
13 Contrl In 00000000 4 00000000 0 15
Status 00000100 00000000
15 Comm Status 00000000 5 00000000 0 15
00000101 00000000
16 Control SW 2.01 201 0.00 0.00 99.99
Ver
17 Drive Type 2102 2102 0 0 6000
18 Elapsed Run 1 x10h 1 0 0 9999
Time
19 Testpoint 01110000 28777 00000000 0 65535
Data 01101001 00000000
21 Analog In 0.1 % 1 0.0 0.0 999.9
4-20mA
22 Drive Temp 29 C 29 0 0 120
106 Start Source Comm 5 Keypad 0 5
Port
108 Speed Comm 5 Drive Pot 0 5
Reference Port
109 Accel Time 1 3.0 Sec 30 10.0 0.0 600.0
110 Decel Time 1 3.0 Sec 30 10.0 0.1 600.0
302 Comm Data 19.2K 4 9600 0 5
Rate
305 Comm Loss 35.0 Sec 350 5.0 0.1 60.0
Time
Kinetix 3 Servo Drive Configuration
The following drive functions are not used thus configuration details are not included in the document
 Index
 Homing
 Analog output control
 Preset speed
 Tuning parameter. (For optimal result, users need to auto tune their servo motor).
Description Value
Drive
Name Drive
AC Line Loss Check Enable
Auto Motor Iden Enabled
Motor Model TL-A110P-RXX2
Command Polarity Normal
Displayed Units Metric
Operation Modes (Main/Override) Follower/None
Initial Current Bias 0 % rated motor current
Velocity Limits
Velocity Limit Mode Disabled
Manual Velocity limit 5000 RPM
Acceleration Limits
Acceleration Limits Active
Acceleration 416.67 Revs/s^2
Acceleration Time to Max Speed 200 ms
Deceleration 416.67 Revs/s^2
Deceleration Time to Max Speed 200 ms
S-Curve Time 0 ms
Communications
Drive Address 1
Baud rate 57600 bps
Frame Format 8 Data, No Parity, 1 Stop bit
Protocol ASCII
Communication Method RS232
MODBUS Run Function Control Disable
MODBUS Input Function Control Disable
Current Limits
Positive Internal 300 % rated motor current
Negative Internal 300 % rated motor current
Positive External 100 % rated motor current
Negative External 100 % rated motor current
Position Limits
Enable Software Limits off
Positive Software Limit 2147483647 Counts
Negative Software Limit -2147483647 Counts
Positive Decel Distance 0 Counts
Negative Decel Distance 0 Counts
Speed Functions
Speed Window 10 RPM
Up to Speed 20 RPM
Zero Clamp 0 RPM
Position Functions
In Position Size 10 Counts
Near Position Size 20 Counts
Motor Encoder Units
Position Label Counts
Position Scale 1 Counts per User Units
Velocity Label RPM
Velocity Scale 1 RPM per User Units
Acceleration Label Revs/s/s
Acceleration Scale 1 Revs/s^2 per User Units
Stopping Functions
Over Travel Stop Method Current Control
Maximum Stopping Current 300 % rated motor current
Fault and Disable Braking Brake and hold
Disable Delay 0 ms
Braking Application Speed 100 RPM
Auxiliary Function Selection 1
Velocity Observer Disable
Emergency Stop Input Disable

Mode Configuration
Analog
Velocity Scale 500.0 RPM/Volt
Current Scale 33.3 % motor rated cont. current/Volt
Velocity Command Offset 13.2 mV
Current Command Offset 34.2 mV

Follower
Command Type Step/Direction. Positive Logic
Controller Output Type Open Collector Input
1st Gear Ratio Change Always Enable
1st Gear Ratio 1:128 Master Counts:Follower Counts
2nd Gear Ratio 1:4 Master Counts:Follower Counts
Digital Filter Cut-off Frequency
Line Driver Input 1.750 MHz
Open Collector Input 0.625 MHz
High frequency Line Driver Input 3.000 MHz

Motor
Auto Motor Iden Enabled
Motor Model TL-A110P-RXX2
Inertia Ratio 0.00 Load / Motor
General
Motor Flag Standard
Motor Type Rotary
Torque Constant 0.2310 N-m/A
Inertia 0.010 Kg-cm^2
Poles/Revolution 8
Integral Limits No
Electrical
Rated Voltage 230 Volts
Resistance 90.000 Ohms
Inductance 93.000 mH
Ratings
Maximum Speed 5000 RPM
Intermittent Current 1.49 Amps
Continuous Current 0.55 Amps
Feedback
Encoder SA35
Commutation Sinusoidal
Sinusoidal Startup Serial
Hall Input Offset 0 degrees
Lines/Revolution 32768
Thermal
Integral Thermostat No
Software Protection Yes
Rth(w-e) 32.77 C/W
Cth(w-e) 1.00 W-s/C
Rth(w-a) 2.10 C/W
Cth(w-a) 137.00 W-s/C

Autotuning
Autotuning Speed 700 RPM
Off-Line Tuning Mode Inertia Moment Estimation and Resonant Frequency Detection
On-Line Vibration Suppression Mode Disable
On-Line Vibration Suppression Gain Low
Velocity Regulator Configuration
Velocity Command Filter on Follower Disable
Gain Switching
Gain Change Enable Disable
Mode of Gain Switching 1st Gain Fix
Delay Time of Gain Switching 0 .2ms
Level of Gain Switching 0
Hysteresis of Gain Switching 0
Position Gain Switching Time 0 .2ms
2nd Regulator Gains
P 60
Integrator Gain 26
Low Pass Filter Bandwidth (VReg) 1000 Hz
Kp 20 Hz
Low Pass Filter Bandwidth (IReg) 300 Hz
3rd Regulator Gains
P 60
Integrator Gain 26
Low Pass Filter Bandwidth (VReg) 1000 Hz
Kp 20 Hz
Low Pass Filter Bandwidth (IReg) 300 Hz
4th Regulator Gains
P 60
Integrator Gain 26
Low Pass Filter Bandwidth (VReg) 1000 Hz
Kp 20 Hz
Low Pass Filter Bandwidth (IReg) 300 Hz

Encoder
Encoder Output Forward Direction A Leads B
Output Ratio 1:128 Output Counts:Motor Counts
Encoder Backup Battery Not Installed
Incremental Feedback Loss Monitored

Digital Inputs
Input 1 Drive Enable
Input 2 Fault Reset
Input 3 Moving Enable
Input 4 Integrator Inhibit
Input 5 Unassigned
Input 6 Unassigned
Input 7 Unassigned
Input 8 Unassigned
Input 9 Unassigned
Input 10 Unassigned

Digital Outputs
Output 1 Ready
Output 2 Up to Speed
Output 3 Brake
Output 4 Unassigned
Output 5 Unassigned
Output 6 Unassigned
Brake Inactive Delay 0 ms
Brake Active Delay 500 ms

Faults:
AC Line Loss Fault Delay 20 ms
Following Error Limit 99999 Counts
Channel A Velocity Feedback
Channel B Current Command
Channel C Bus Voltage
Channel D U Phase Current
Appendix B

This appendix shows the UDFBs used to control and monitor the PowerFlex 4 drive

RA_PF4_MBUS_STS User-defined Function Block


Copied from CC-QS026 page 67 - 69
RA_PF4_MBUS_CMD User-defined Function Block
Copied from CC-QS026 page 70 - 72
Appendix C

This appendix shows the UDFBs used to control and monitor the Kinetix 3 Servo drive

RA_Motion_Move_Cmd User-defined Function Block

[5-1-1]
RA_Motion_Move_Cmd Inputs
Variable Data type Description Range
FBEN BOOL Set this bit TRUE to enable the function block. 0,1
AxisIn Axis_Ref Assign this to the motion axis created via the configurator
MoveMode INT 0: Maintenance mode (Jogging is permited) 0..3
1: Velocity control (Motion is in velocity move mode)
2: Absolute control (Motion is in absolute position move
mode)
3: Relative control (Motion is in relative position move
mode)
PositionData Real Only valid in Mode 2 and 3 -3.40282347E+38..
2: Absolute position 3.40282347E+38
3: Relative position
VelocityData Real This value set the speed of the motor -3.40282347E+38..
3.40282347E+38
AccData Real This value set the acceleration of the motor -3.40282347E+38..
3.40282347E+38
DecData Real This value set the deceleration of the motor -3.40282347E+38..
3.40282347E+38
JerkData Real This value set the jerk of the motor -3.40282347E+38..
3.40282347E+38
DirData SINT Only valid in velocity control mode. This value set the -128..127
rotating direction of the motor
Execute BOOL Set this bit TRUE to execute motion 0,1
Halt BOOL Set this bit TRUE to stop motion 0,1
Jog_Positive BOOL Set this bit TRUE to execute jog in the positive direction. 0,1
Set this bit FALSE stops jog
Jog_Negative BOOL Set this bit TRUE to execute jog in the negative direction. 0,1
Set this bit FALSE stops jog

RA_Motion_Move_Cmd Outputs
Variable Data type Description Range
FBENO BOOL This variable reflects the state of FBEN. 0,1
AxisState USINT This value returns the status of the axis with respect to 0.. 7
the motion currently in progress.
CurrentMoveMode INT This value returns the current move mode 0..3
MoveDone BOOL When move mode is 0,1
0 or 1: This bit is TRUE when the motor has reached the
set velocity
2 or 3: This bit is TRUE when the motion is complete
MoveBusy BOOL This bit is TRUE when the motion axis is busy 0,1
MoveActive BOOL This bit is TRUE when the function block is in control of 0,1
the axis
MoveAborted BOOL This bit is TRUE when the command was aborted by 0,1
another command
Error BOOL This bit is TRUE when an error was detected 0,1
ErrorID UINT This value returns the motion error code
ErrorMsg String This value returns which command causes the error
RA_Motion_Move_Cmd Function Block Flowchart
RA_K3_MBUS_STS User-defined Function Block

Refer to CC-QS025B-EN-P page 71 - 73


Allen-Bradley, Connected Components Workbench, FactoryTalk, Kinetix, LISTEN. THINK. SOLVE., Micro800, Micro850,
PowerFlex, PanelView, Rockwell Software, are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.

Publication CE-DM262C-EN-P — October 2014 Copyright© 2014 Rockwell Automation, Inc. All rights reserved.
Supersedes Publication

You might also like