L05 - Advanced PLC Topics For Micro800Ö Controllers With Motion Capabilities and CIP Messaging Functionality - Lab Manual
L05 - Advanced PLC Topics For Micro800Ö Controllers With Motion Capabilities and CIP Messaging Functionality - Lab Manual
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 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
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.
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
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.
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.
e. You should see a ‘USB’ driver with a ‘+’ by it. (If not, ask for help.)
It should show ‘Connected’ on the top right hand corner of the configuration window.
5. Build this project.
b. Select Build.
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.
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.
3. Set a speed reference by pressing the blue box, then entering a value from 1 to 60 Hz.
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.
The motor begins to home and the ‘Homed’ indicator turns green when axis is homed.
21. Press ‘Move type’ once more to ‘Relative’ to demonstrate relative positioning.
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.
Caution!
Expect motion when you press ‘Start’. Ensure that the Servo and AC motor is safe to operate.
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.
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.
[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. 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.
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.
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.
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.
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.
12. Insert a in the first branch and assign variable ‘Axis_02_Cmd_Enable_Auto’ to it.
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
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.
These commands enable the PTO motion axis to move in the positive and negative direction.
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.
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.
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.
18. Insert a in the second branch and assign variable ‘Axis_02_Sts_AxisHomed’ to it.
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.
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.
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’.
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.
5. In rung 2, set the dynamic parameters for the labeling head which is controlled by the Servo motor.
i. Drag and drop an ‘Instruction Block’ from the Toolbox onto the first branch.
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.
This sets the relative position reference for the PTO motion building block.
i. Insert a ‘MOV’ instruction in the third branch.
This sets the acceleration reference for the PTO motion building block.
l. Insert a ‘MOV’ instruction in the fourth branch.
This sets the deceleration reference for the PTO motion building block.
o. Insert a ‘MOV’ instruction in the fifth branch.
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.
7. In rung 4, the servo motor indexes once when the sensor senses a product.
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’.
b. Assign ‘App_Cfg_Stop_Seq’ to the output of ‘MOV’ instruction in the third branch of Rung 1.
5. Delete Rung 2.
When completed, your program should look like this.
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.
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.
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.
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.
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.
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
This appendix shows the UDFBs used to control and monitor the Kinetix 3 Servo drive
[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
Publication CE-DM262C-EN-P — October 2014 Copyright© 2014 Rockwell Automation, Inc. All rights reserved.
Supersedes Publication