InfoPLC Net L06 Introduction To Micro800 Motion

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

Introduction to Micro800 Motion

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.
Introduction to Micro800 Motion

Contents
Before you begin ........................................................................................................................................... 5
About this lab .................................................................................................................................................................................... 5
Tools & prerequisites ........................................................................................................................................................................ 5
About the Connected Components Demo kit .................................................................................................................................... 7
About the Motion faceplate ............................................................................................................................................................... 8
About Kinetix 3 drive settings (for information only) ........................................................................................................................ 10

Motion Demonstration ................................................................................................................................. 11


Demonstration concept: .................................................................................................................................................................. 11
Load Demo program ....................................................................................................................................................................... 12
Demonstration................................................................................................................................................................................. 14

Lab 1: Basic Configuration for a Micro800 Motion System ........................................................................ 24


Open the starting project file ........................................................................................................................................................... 25
What has been done for you? ......................................................................................................................................................... 26

Lab 2: Program a Homing Motion Function Block ...................................................................................... 33


Add and configure MC_Home function block .................................................................................................................................. 33
Demonstrate Homing Using the PanelView Component Application .............................................................................................. 40
Lab 2: What have you done? .......................................................................................................................................................... 41

Lab 3: Program a Relative Move Motion Function Block ............................................................................ 43


Add and configure a Move Relative and a Motion Stop command ................................................................................................. 43
Demonstrate Move Relative with the PanelView Component Application ...................................................................................... 49
Lab 3: What have you done? .......................................................................................................................................................... 49

Lab 4: Program an Absolute Move Motion Function Block ......................................................................... 51


Add and configure Move absolute command.................................................................................................................................. 51
Demonstrate Move Absolute with the PanelView Component Application ..................................................................................... 56
Lab 4: What have you done? .......................................................................................................................................................... 57

3 of 84
Lab 5: Program the Touch Probe Motion Function Block ........................................................................... 58
Add and configure MC_TouchProbe command .............................................................................................................................. 58
Demonstrate Touch Probe with the PanelView Component Application and DI3 ........................................................................... 64
Lab 5: What have you done? .......................................................................................................................................................... 65

Lab 6: Advanced (OPTIONAL): Create your own Motion Function Block .................................................. 66
Create a new UDFB ........................................................................................................................................................................ 66
Use your own UDFB ....................................................................................................................................................................... 75
Demonstrate Jog with the PanelView Component Application ....................................................................................................... 78
Lab 6: What have you done? .......................................................................................................................................................... 79

Appendix A- Motion configuration for Micro850 .......................................................................................... 80

4 of 84
Before you begin

Attendees for the lab are expected to have basic knowledge and understanding of the operating environment of Connected
Components Workbench. You will need to know how to declare, assign and enter variables/values into ladder instructions. You
will be using the motion faceplate (HMI screens) provided to operate the Micro850 controller.
The tags from the HMI have already been mapped to a list of global variables in a project file. You will be provided with this
project file and you will have to assign these variables in the ladder programs which you will create as you run through the lab.
You do not have to define your own variables unless being told to do so in the lab manual.

About this lab


In this lab, you will be introduced to Connected Component Workbench Release 2 as the software to program and configure
connected component devices such as Micro800 PLCs, PanelView Component HMIs and PowerFlex drives.
In this motion lab exercise, you will:
 Try out the motion faceplate
 Review preconfigured motion axis
 Create ladder programs to control the axis
 Use Motion Function Blocks to perform
 Homing
 Move Relative
 Move Absolute
 Touch probe
 Optionally, create your own Motion Function Block for Jogging

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 Component Workbench Release 2
 RSLinx Classic v2.59
 Hardware:
 Computer with Windows XP or Windows 7 operating system
 Connected Components demo kit
 USB cable
 Required Files:
 MotionDemo_T6T_M850_ENETIP_r2.cha
 Intro to Micro800 Motion- Starting Project.ccwsln

5 of 84
Lab setup:

6 of 84
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 (FW: 2.011)
4. PanelView C600 (FW: 1.70)
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

7 of 84
About the Motion faceplate
Screen overview

Home screen

8 of 84
Move Relative screen

Move Absolute screen

Jog screen

9 of 84
About Kinetix 3 drive settings (for information only)
 The Kinetix 3 servo drive in the demo kit has been configured to work with this lab. In the event if you are working with a
brand new setup (for example with default configuration for your Kinetix 3), you can configure [Pr – 0.09] to 1102 and
run the demo kit configuration ladder program ―MotionDemoConfig_M850_K3_Modbus_r2.ccwsln‖ in conjunction with
PVC program ―MotionDemoConfig_T6T_M850_Modbus_r2.cha‖ to setup the rest of the parameter. The project file for
the configuration programs are located in:
C:\Lab Files\Intro to Micro800 Motion\Backup\micro850_Motion_config\MotionDemoConfig_M850_K3_Modbus_r2
In the event if you want to configure K3 manually, change the following parameters from K3 default setting.

Parameter number Description Default value New value

[Pr - 0.05] Auxiliary Function Selection 1 0000 0001  After you set, power
cycle drive

[Pr - 0.09] Serial Port Configuration 0005 1102

[Pr - 0.10] Allocation of Input Signals 1 4bb1 0bb1

[Pr - 0.11] Allocation of Input Signals 2 0765 4002

[Pr - 0.12] Allocation of Input Signals 3 0000 7650

[Pr - 0.14] Allocation of Input Signals 5 0000 0030

[Pr - 0.22] Allocation of Output Signals 1 0321 0230

[Pr - 0.24] Allocation of Output Signals 3 0000 0010

[Pr - 1.01] System Gain 50 161

[Pr - 1.02] Velocity Regulator P Gain 60 876

[Pr - 1.03] Velocity Regulator I Gain 26 2032

[Pr - 3.00] Follower 0000 1012

[Pr - 3.01] 1st Gear Ratio, Follower Counts 4 200

During the test and configuration sequence of ―componentMotionLab_config_V1‖, auto tune is performed, the following
parameters, namely [Pr - 1.01], [Pr - 1.02] and [Pr - 1.03] are the product of auto tune. Please note that the tuned values above
are reference for the connected component demo kit (10PO71C1-2503).

10 of 84
Motion Demonstration

Before starting the lab, let’s begin with a brief explanation of the demo concept and demonstration showing the end result of the
lab. During the demonstration, you will be able to control an axis from the PanelView Component operator interface terminal.
The motion axis is the Kinetix 3 servo drive in the demo kit; its circular path corresponds to the linear slide in the HMI. When you
control the axis, the motor synchronizes its movement with the linear slide. The total travelling distance on the axis is between 0
– 999. The demonstration concept opens up a circular path and makes it into a linear path.

Demonstration concept:
The demo kit has a rotary motor that is coupled to a disk with a reference point. Based on the motion configuration, it takes 1,000
pulses for the reference point to rotate one time around.

To visualise this rotary axis into a linear axis, we have to ―cut‖ the circular path of the reference point and make it linear.

When the circular path is fully opened, it becomes a linear path, which is what is simulated in the PanelView Component
application.

11 of 84
On the linear slide, we have additional Left limit (L.L), Right limit (R.L) and home sensor to simulate other motion functions.

The above illustrates the concept on how the lab will be conducted. It assumes a 1:1 ratio between motor pulse and travel per
pulse. For example, 1 servo pulse = 1 linear step (usually in mm). The 2 parameters that determine motor travel are pulses per
motor revolution and travel per revolution. These will be explored further in lab 1.

Load Demo program


You are going to load a demo program into the Micr 850 controller for the demonstration.

12 of 84
1. Ensure that the Micro850 is connected to your PC with a USB cable.

1. Execute Connected Components Workbench by double clicking from the desktop.

2. To ensure that the software is version 2.0, click Help from the taskbar and select About Connected
Components Workbench.

3. After About Connected Components Workbench pops up, check Version history to ensure version and
click OK.

13 of 84
4. Click from the task bar and browse to the demo folder located at C:\Lab Files\Intro to Micro800
Motion\Intro to Micro800 Motion- Demo

5. Select ―Intro to Micro800 Motion- Demo.ccwsln‖ and click Open

6. Build and download this project. You can demonstrate the motion functionality with the HMI now.

Demonstration

Note
From the HMI, the axis will not move any further beyond 0 – 999 (even though the position value will
continue to increase or decrease), however, if you are using the demo kit, the motor will continue to rotate
until you switch on the appropriate hard limit (DI0 or DI1). The appropriate hard limit is defined by the
direction of travel. For example, when the left limit (L.L) is triggered when motion is travelling left, motion will
stop but right travel is possible. On the other hand, when the right limit (R.L) is triggered when motion is
travelling right, motion will stop but left travel is possible.
L.L is triggered by DI0
R.L is triggered by DI1

14 of 84
1. Demonstrate a Homing motion command when the axis is at the Left Limit

a. Enable the Left Limit sensor by turning the DI0 switch (you will need to turn and hold the switch
because it is a momentary switch). The Left Limit indicator (L.L) will light up red. If there is an error,
press ―Reset‖.

b. Continue to hold the DI0 switch, and press the ―ServoOFF‖ push button. The Axis State will switch
to ―Stand Still‖.

15 of 84
c. Continue to hold the DI0 switch, and press the ―Home‖ push button. The axis will start to home
towards the right. Once the axis starts to move right, release the DI0 switch.

d. The axis will be homed once the homing sensor is triggered and the motor comes to a stop.

e. This exercise demonstrated issuing a Homing motion command when the axis is between the Left
Limit and Home sensor. This same concept can be used when the axis is located between the
Right Limit sensor and the Home sensor, except the axis will travel left instead.

Note:
If you are not using demo kit, you have to trigger DI2 to simulate home sensor trigger.

16 of 84
2. Demonstrate the Move Relative motion command.

a. Switch to the ―Move Relative‖ screen by pressing Move Relative under the menu

b. With the existing parameters, press the ―REL Move‖ push button.

17 of 84
c. Notice the linear axis moved 100 steps in the right direction (motor moves 10 rounds clockwise)
and stops at position 230 (The original current position was 130). Change the ―Distance‖ to 88 and
press the ―REL Move‖ push button again

d. Notice the linear axis moved another 88 steps in the right direction (motor moves another 8.8
revolutions clockwise) and stops at position 318.

e. These are relative movements. The motor moves according to the distance you enter. A positive
distance value means the axis will move right (motor rotates clockwise) and a negative distance
value means the axis will move left (motor rotates counter-clockwise).

3. Demonstrate the Move Absolute motion command.

a. Switch to the ―Move Absolute‖ screen.

18 of 84
b. Execute ―HOMED‖ again. The linear axis will move in the left direction (motor moves counter
clockwise) until the home sensor is triggered, motor reverses direction and decelerates to a stop.

c. With the existing parameters, press ―ABS Move‖. The linear axis moves -30 steps (motor moves 3
revolutions counter clockwise) and stops at position 100.

Note:
The position data is the same as the value you input for ―Move Relative‖, but the result is different. During
move relative, the motor moves 10 revolutions clockwise. In the case of move absolute, the motor moves 3
revolutions counter-clockwise. You can compare the position of the axis on HMI.

19 of 84
d. Execute ―ABS Move‖ again. Nothing will happen. This is normal as axis is already at position
―100‖.

e. Pulses are generated based on the initial position (130) and final position (100). During step c, the
controller generated 30 pulses in the negative direction so the linear axis moves in the left direction
and motor rotates 3 revolutions counter-clockwise. At step d, the final position and initial position is
the same, thus the controller did not generate any pulses.

Notes
You should always home an axis before executing an absolute move. This is because an absolute move
requires an initial position to calculate the number of pulse from the final position.

20 of 84
4. Demonstrate Touch probe

a. Remain on the ―Move Absolute‖ screen, and execute ―HOMED‖ again.

b. Change the ―Speed‖ and ―Position‖ to 60 and 999 respectively, then execute ―ABS Move‖. As the
axis travels towards the right, trigger “touch probe” by switching on DI3.

21 of 84
c. Once you trigger DI3, a position value will be recorded in ―T.P Position‖.

d. After the axis stops, press ―HOMED‖ to return the axis to the home position.

e. The Touch Probe motion command acquires position data using a high speed input trigger. This
function is the fastest position acqusition method in the Micro800. You can use this function to
register position accurately in machine applications.

5. Demonstrate the Jogging motion command

a. Switch to the Jog screen by pressing ―Jog‖ under the menu

22 of 84
b. Set the direction to ―Right‖, and then press and hold the ―Jog‖ pushbutton. The linear axis will move
in the right direction (the motor will rotate clockwise).

c. Release the ―Jog‖ button. The axis will stop moving

d. Set the direction to ―Left‖, and then press and hold the ―Jog‖ pushbutton. The linear axis will move
in the left direction (the motor will rotate counter-clockwise).

e. Release the ―Jog‖ pushbutton to stop axis.

f. You can make changes to the speed, acceleration, and deceleration parameters, and execute the
Jog command again. Observe the differences.

You have completed the demonstration guide. You will move into the formal lab, where you will learn how to construct ladder
instruction through step-by-step directions. Along the way, the lab will have additional notes, information and tips on Connected
Component Workbench. Let’s begin…

23 of 84
Lab 1: Basic Configuration for a Micro800 Motion System

This section of the lab will explain some of the programming and configuration that has already been done for you.

24 of 84
Open the starting project file

1. Click the ―open‖ icon.

2. From the ―Open‖ window, browse to: C:\Lab Files\Intro to Micro800 Motion\Intro to Micro800 Motion-
Starting Project

3. Select ―Intro to Micro800 Motion- Starting Project.ccwsln‖ and click ―Open‖

4. You will see that this project consists of the pre-work for this lab session. The detail of the pre-work is
described in the next section.

25 of 84
What has been done for you?
To make this lab more efficient for you, the initial setup has been completed for you. This will give you more time to demonstrate
your program and the Micro850 motion capability. This section will tell what has been done for you and explain the purpose of
the administrative motion function. The areas of pre-work done are:
1) Motion axis configuration
2) Pre-defined global variables
3) ―Administrative‖ motion function

1. Motion configuration for Micro850


The name of the axis is ―X‖ and the configuration for each sub motion category has been done for you. A summary of the
configuration is provided in the following table while the details of the configuration are illustrated in Appendix A.

Additional information
Only Micro800 controllers with transistor type outputs are able to perform motion functions. The following
24pt Micro850 catalogs illustrate the differences between each output type.
2080-L50-24QBB: Transistor source output type  Able to do motion
2080-L50-24QVB: Transistor sink output type  Able to do motion
2080-L50-24QWB: Relay output type  Not able to do motion
2080-L50-24AWB: Relay output type  Not able to do motion
Motion capability is only availble in Micro830 and Micro850 transistor output type controller.

26 of 84
A summary of the Motion Axis configuration
The name of the motion axis is ―X‖. Here’s the list of parameters that are configure for ―X‖. For detail configuration, please refer
to Appendix A.

Axis setting for X:

Sub Motion Category Description Configuration Remark

General PTO Channel EM_0 Pulse Output: IO_EM_DO_00


Direction Output: IO_EM_DO_03

General Drive Enable Output IO_EM_DO_02/ Active High Enable servo drive bit

General Touch Probe Input IO_EM_DI_03/ Active High Capture position input

Motor and Load Pulses per Revolution 655.36 Secondary (Output)

Motor and Load Travel per Revolution 10.0 Primary (Input)

Limits Lower limit IO_EM_DI_00/ Active High Left limit switch

Limits Higher limit IO_EM_DI_01/ Active High Right limit switch

Dynamics Start/Stop Velocity 0.5 mm/sec

Dynamics Max Velocity 1500.0 mm/sec

Dynamics Max Acceleration 150,000.0 mm/sec2

Dynamics Max Deceleration 150,000.0 mm/sec2

Dynamics Max Jerk 150,000.0 mm/sec3

Homing Homing Velocity 5.0 mm/sec

Homing Creep Velocity 1.0 mm/sec

Homing Home switch input IO_EM_DO_02/ Active High Home sensor

27 of 84
2. Pre defined global variables.
These variables has been pre-mapped to HMI tags. In Lab 2, you will assign these variables to specific motion function
blocks.

28 of 84
3. “Administration” motion function.
There are a few ―administrative‖ motion functions we need for running the lab. These ―administrative‖ functions are
MC_Power, MC_Reset and MC_ReadParameter. They are used for
1) Enabling the servo drive
2) Recovering a motion axis from fault
3) Reading axis information such as command position and command velocity.
There are 5 ladder rungs for administrative motion function. These rung uses administrative motion function block to
perform the 3 tasks above. The purpose of each rung is described below:

Rung 1: MC_Power is used to enable the servo drive and enable positive/negative movement.
When ―servoON‖ is triggered, the controller will enable DO2 which will enable the Kinetix 3 servo drive.

Note
The left side of the function block consist all the input settings. Since ―X‖ is allocated to ―AxisIn‖, it means that
this function block is meant for ―X‖ only.
The output of the function block are allocated to variables that provide status and information about ―X‖.
Allocating variables to these outputs are optional in practice but it has been done for you in the pre-work.

29 of 84
Rung 2: MC_Reset is used to reset any motion error. When ―reset‖ is triggered (set to TRUE), it resets any
motion error.

Rung 3: When ―reset‖ is triggered, it will trigger DO1 which resets the Kinetix 3 servo drive.

Note
Whenever there is an illegal situation (usually when motion moves out of range), the motion axis will go into
an error state. This means that the controller and servo drive are not able to function. In order to recover the
motion axis, you have to perform a motion reset. MC_Reset is used to perform this function; it will reset
existing motion errors for the controller and servo drive, and bring it back to normal so that motion axis can
function normally with new motion command.

30 of 84
Rung 4: MC_ReadParameter reads axis parameter.
According to the Parameter IDs 1 and 11 (assigned to the function blocks), these 2 function blocks are
reading command position and velocity respectively. You can find IDs corresponding to other paramters in
the Parameter IDs Table on the next page.

Parameter IDs Table

PN (ID) Name Datatype B/E R/W Comments

1 CommandedPosition REAL B R Commanded position

2 SWLimitPos REAL E R/W Positive Software limit switch position

3 SWLimitNeg REAL E R/W Negative Software limit switch position

4 EnableLimitPos BOOL E R/W Enable positive software limit switch

5 EnableLimitNeg BOOL E R/W Enable negative software limit switch

6 Reserved NA NA NA Reserved for future release

7 Reserved NA NA NA Reserved for future release

8 MaxVelocitySystem REAL E R Maximal allowed velocity of the axis in the


motion system

9 MaxVelocityAppl REAL B R/W Maximal allowed velocity of the axis in the


application

10 Reserved NA NA NA Reserved for future release

11 CommandedVelocity REAL B R Commanded velocity

12 MaxAccelerationSystem REAL E R Maximal allowed acceleration of the axis in the


motion system

13 MaxAccelerationAppl REAL E R/W Maximal allowed acceleration of the axis in the


application

31 of 84
PN (ID) Name Datatype B/E R/W Comments

14 MaxDecelerationSystem REAL E R Maximal allowed deceleration of the axis

15 MaxDecelerationAppl REAL E R/W Maximal allowed deceleration of the axis

16 MaxJerk REAL E R/W Maximal allowed jerk of the axis

Rung 5: Mapping 2 internal variable to HMI tags so that these value can be seen from the HMI screen.

Tips
You have been shown two ways to read axis parameters. The first way is to use the ―MC_ReadParameter‖;
by assigning a parameter ID to the function block, you can read the parameter by executing the function
block. The other way is to map the specific object instance to a variable with the ―1 gain‖ command.
The advantage of using ―MC_ReadParameter‖ is it provides feedback to the user on the status of execution.
It lets the user know if the function has been executed or whether there is any error during execution.
The advantage of using a ―1 gain‖ is its simplicity. Program size will be smaller and there are not as many
parameters to configure.

32 of 84
Lab 2: Program a Homing Motion Function Block

You will start to program from here. You will use different Motion Function Blocks to move the motor and make the axis move.
Most of your work will involve inserting the motion function block and assigning variables.

Add and configure MC_Home function block

1. Add a new ladder diagram

2. Right click the newly added ladder diagram and rename it to ―Homing‖. Double click it and you will have a
ladder diagram in your workspace.

33 of 84
3. Drag and drop a ―block‖ from toolbox (located at the bottom right corner) to your workspace.

4. An instruction block selector appers.

a. Type in ―mc_home‖ to find the instruction

b. Double click ―MC_Home‖ to select the instruction.

34 of 84
5. The MC_Home function block will be added to your rung.

35 of 84
6. Assign pre-defined global variables and constant values to the MC_Home function block as shown below.

7. Optional steps: comment the following in the rung description ―Motion home sequence will occur when
mov_hm is triggered. When motion is homed, it recognize its current position as 130.0‖

36 of 84
8. Drag and drop a from the toolbox (located at the bottom right corner) to your workspace.

Note
You can also add a new rung with shortcut key, Ctrl+0.

9. Insert a ―1 gain‖ instruction block.

37 of 84
10. Double click lower half of the parameter box to launch Variable Selector Box and scroll down to find object
―X‖

38 of 84
11. Assign ―X.AxisHomed‖ from object ―X‖ to the input of the ―1 gain‖ instruction.

a. Expand object ―X‖.

b. Select ―X.AxisHomed‖

c. Click ―OK‖

12. Assign ―X_homed‖ into the output of ―1 gain‖ command and comment the following in rung description
―This rung maps the home status to HMI tag. When axis is homed, it will be shown on the HMI screen.‖

13. Build and download your project. Save your work.

39 of 84
Demonstrate Homing Using the PanelView Component Application

1. In the ―Home” screen

a. Press ServoOFF to enable the servo. The button will change to servo ON after pressed.

b. Press ―Home” and you will see the axis begin to home.

2. When the axis is homed, you will notice the ―Home‖ pushbutton changes to ―HOMED‖.

3. Notice the disk rotates and comes to a stop after the white strip passes by the sensor.

4. Once the axis is homed, it will be at position ―130.0‖ and the home button will show ―HOMED‖.

Notes:
During homing, you may notice from the HMI that the axis ―jumps‖ right to position 130.0 when the axis is
homed. The axis is programmed to assume position 130.0 when it is homed (DI02 triggered).

40 of 84
In an actual application, the ―jump‖ effect will not occur because the home sensor will be triggered by a linear
axis unlike in this lab where the home sensor is triggered by a rotary axis in the demo kit.

Lab 2: What have you done?


In this lab, you used the MC_Home function block. This function block is used to perform the homing sequence illustrated below.
The speed parameter for homing has been pre-defined.

In the MC_Home function block, you defined two other important parameters.
Position: When the axis is homed, it needs to assume an absolute position value. In this lab, position 130.0 is assumed
Homing_Mode: The following table illustrate the value corresponding to dfferent homing method. Method ―0‖ is used in this lab.

Value Name Description

0x00 MC_HOME_ABS_SWITCH Homing process by searching Home Absolute switch

0x01 MC_HOME_LIMIT_SWITCH Homing process by searching limit switch

0x02 MC_HOME_REF_WITH_ABS Homing process by searching Home Absolute switch plus


using encoder reference pulse

0x03 MC_HOME_REF_PULSE Homing process by searching limit switch plus using


encoder reference pulse

41 of 84
0x04 MC_HOME_DIRECT Static homing process with direct forcing a home position
from user reference. The function block will set current
position the mechanism is in as home position, with its
position determined by the input parameter, ―Position‖

42 of 84
Lab 3: Program a Relative Move Motion Function Block

Add and configure a Move Relative and a Motion Stop command


To simplify the program, we will create a new ladder diagram for each motion instruction

1. Add a new ladder diagram.

2. Name the ladder diagram ―moveRelative‖, double click it and you will have a ladder diagram within your
workspace.

43 of 84
3. Drag and drop a ―block‖ from toolbox (locate at the bottom right corner) to your workspace.

4. An instruction block selector appears.

a. Type in ―mc_moverelative‖ to find the instruction

b. Double click ―MC_MoveRelative‖ to select the instruction.

44 of 84
5. The MC_MoveRelative function block will be added to your rung.

45 of 84
6. Assign the following pre-defined global variables to MC_MoveRelative function block as shown below.

7. Comment the following in the rung description ―When r_mov is triggered, Pulse Train Output (PTO) will be
generated based on r_distance, r_velocity, r_acc, r_dec and r_jerk.‖

46 of 84
8. Since you have a move instruction, you will need to have a stop instruction. Drag and drop a new
and insert a ―block‖

9. An instruction block selector appears.

a. Type in ―mc_halt‖ to find the instruction

b. Double click ―MC_Halt‖ to select the instruction

47 of 84
10. An ―MC_Halt‖ function block will be added to your rung. This stop command is mapped to the stop button on
the HMI.

11. Assign the pre-defined global variables to the MC_Halt function block as shown below.

12. Build and download your project. Save your work.

48 of 84
Demonstrate Move Relative with the PanelView Component Application

1. Move Relative

a. Switch to ―Move Relative‖ screen by pressing Move Relative under the menu and press
―servoOFF‖ to enable servo motor.

b. Change ―Speed‖ and ―Distance‖ to 5 and 10 respectively. Then press ―REL Move‖.

Take note that the motor disk will rotate exactly one revolution. This is because in our motion configuration,
we have set 10.0mm : 655.36 pulses. So if you enter the ―Distance‖ as 100, the motor will rotate 10
revolutions.

c. You can operate the demo with different parameters and observe the differences and press ―Stop‖
to stop motion.

Lab 3: What have you done?


In this lab, you used the MC_MoveRelative Motion Function Block to generate pulses based on its input parameters and
MC_Halt Motion Function Block to stop motion. Here are the explanations for MC_MoveRelative input parameters:

49 of 84
Distance: Specify the distance. Motion configuration converts this distance into pulses according to settings
Velocity: Specify the rate of pulse output
Acceleration: Specify the rate of velocity increase
Deceleration: Specify the rate of velocity decrease
Jerk: When jerk is ―0‖, it means that speed/time profile is trapezoidal. If otherwise, speed/time profile will be S-curve

50 of 84
Lab 4: Program an Absolute Move Motion Function Block

Add and configure Move absolute command


We will add another ladder diagram for this instruction.

1. Add new ladder diagram.

2. Right click the newly added ladder diagram and rename it to ―moveAbsolute‖. Double click it and you will
have a ladder diagram in your workspace.

51 of 84
3. Drag and drop a ―block‖ from toolbox (located at the bottom right corner) to your workspace

4. An instruction block selector appers.

a. Type in ―mc_moveabsolute‖ to find the instruction

b. Double click ―MC_MoveAbsolute‖ to select the instruction.

52 of 84
5. The MC_MoveAbsolute function block will be added to your rung.

53 of 84
6. Assign the following pre-defined global variables to MC_TouchProbe function block as shown below.

54 of 84
7. Comment the following in rung description ―When a_mov is triggered, Pulse Train Output (PTO) will be
generated based on a_position, a_velocity, a_acc, a_dec and a_jerk‖

8. Build and download your project. Save your work.

55 of 84
Demonstrate Move Absolute with the PanelView Component Application

1. Move Absolute

a. Switch to the ―Move Absolute‖ screen and press ―servoOFF‖ to enable servo motor.

b. Press ―HOME‖. When home sensor is triggered, the axis will decelerate and stop.

56 of 84
c. Once the axis is homed, change ―Position‖ to 999, and press ―ABS Move‖.

Observation
When axis is homed, home button will display ―HOMED‖. After you trigger ―ABS Move‖, the motor will rotate
and axis will move in the right direction and stop before the R.L

d. You can operate the demo with different parameters and observe the differences.

Lab 4: What have you done?


In this lab, you used the MC_MoveAbsolute Motion Function Block to generate pulses based on its input parameters. These
pulses are generated based on the final and initial position. Thus it is always necessary to home the axis before you execute any
absolute move.
Here are the explanations for the input parameters:
Position: Specify the final position
Velocity: Specify the rate of pulse output
Acceleration: Specify the rate of velocity increase
Deceleration: Specify the rate of velocity decrease
Jerk: When jerk is ―0‖, it means that speed/time profile is trapezoidal. If otherwise, speed/time profile will be S-curve

57 of 84
Lab 5: Program the Touch Probe Motion Function Block

What is touch probe?


Touch probe is a function that records an axis position upon an event trigger. In this lab, you will write a simple instruction to
record position when DI3 is triggered.

Add and configure MC_TouchProbe command

1. Add another new ladder diagram

58 of 84
2. Right click the newly added ladder diagram and rename it to ―touchProbe‖. Double click it and you will have
a ladder diagram in your workspace.

3. Drag and drop a from toolbox (located at the bottom right corner) to your workspace

59 of 84
4. An instruction block selector appers.

a. Type in ―mc_touchprobe‖ to find the instruction

b. Double click ―MC_TouchProbe‖ to select the instruction.

5. The MC_TouchProbe function block will be added to your rung.

60 of 84
6. Assign the following pre-defined global variables to the MC_Home function block as shown below.

61 of 84
7. Comment the following in rung description ―When DI03 is triggered, this function block is executed. A
position will be recorded in TP_recordedPosition.‖

8. Drag and drop a from the toolbox (located at the bottom right corner) to your workspace.

62 of 84
9. Insert a and assign it to DI03

10. Insert a ―1 gain‖ instruction block next to the contact and allocate its input with ―TP_recordedPosition‖ and
output with ―TP_Position‖.

11. Optional. Comment ―When DI3 is triggered, move ―TP_recordedPosition‖ to ―TP_Positon‖.

12. Build and download your project. Save your work.

63 of 84
Demonstrate Touch Probe with the PanelView Component Application and DI3

1. Touch probe

a. Switch to ―Move Absolute‖ screen, press ―servoOff‖ and home the axis. When the homing sensor
is triggered, the axis will decelerate and stop.

b. Change ―Speed‖ and ―Position‖ to 50 and 999 respectively, and then press ―ABS Move‖. As the
axis travels towards the right, trigger “touch probe” by switching on DI3.

64 of 84
c. Once you trigger DI3, a position value will be recorded in ―T.P Position‖.

Lab 5: What have you done?


In this lab, you used the MC_TouchProbe motion function block. It basically records a command position of an axis upon when
DI03 is triggered. This command position is acquired almost instantaneously when DI3 is triggered.

65 of 84
Lab 6: Advanced (OPTIONAL): Create your own Motion Function Block

In this section, you will create your own motion function block with a User Defined Function Block (UDFB) for ―Jogging‖. This is a
simple function that triggers motion when its execution bit is true and stop motion when its execution bit is false. If the execution
bit is mapped to a button, then the axis will move when we push and hold the button, and stop when we release.

Create a new UDFB

1. Right click on ―User-Defined Function Blocks‖ and add a ―New ladder diagram‖

66 of 84
2. Name the UDFB ―Jogging_UDFB‖

67 of 84
3. Define your local variables under ―Jogging_UDFB‖

a. Double click ―Local variables‖ under ―Jogging_UDFB‖

b. Declare the following list of variables. There are 7 variable inputs, 1 variable output and 2 internal
variables.

68 of 84
4. Double click ―Jogging_UDFB‖ and you will have a ladder diagram within your workspace. Drag and drop a
Block from toolbox (located at the bottom right corner) to your workspace.

5. An instruction block selector appears.

a. Type in ―mc_movevelocity‖ to find the instruction

b. Double click ―MC_MoveVelocity‖ to select the instruction.

69 of 84
6. The MC_MoveVelocity function block will be added to your rung.

7. Assign the following pre-defined local variables to the MC_MoveVelocity function block as shown below.

70 of 84
8. Add a new rung and insert another block

9. An instruction block selector appears.

a. Type in ―mc_halt‖ to find the instruction

b. Double click ―MC_Halt‖ to select the instruction.

71 of 84
10. The MC_halt function block will be added to your rung.

11. Assign the following pre-defined local variables to the MC_Halt function block as shown below.

72 of 84
12. Add another new rung

13. Drag and drop a onto rung 3, a variable selector box appear.

a. Ensure that you are in the ―Jogging_UDFB‖ tab

b. Double click ―Execute‖

73 of 84
14. Drag and drop a onto rung 3, a variable selector box appear.

15. Rung 3 should look like this.

16. Add another new rung.

17. Program rung 4 according to the ladder diagram below

18. These 4 rungs of program will be your ―Jogging‖ UDFB. Build and save your work.

74 of 84
Use your own UDFB
You have successfully completed a ―Jogging‖ UDFB. In this section, you will use it in your program. The steps are the same as
inserting any motion function block.

1. You insert another new ladder diagram

2. Right click the newly added ladder diagram and rename it to ―Jogging‖. Double click it and you will have a
ladder diagram in your workspace.

75 of 84
3. Drag and drop a ―block‖ from toolbox (located at the bottom right corner) to your workspace

4. An instruction block selector appers.

a. Type in ―jogging_udfb‖ to find the instruction

b. Select ―Jogging_UDFB‖.

c. Check ―EN/ENO‖ box. This provide an input to control the function block and an output to
trigger when the function block is active.

d. Click ―OK‖

76 of 84
5. This is your own ―Jogging‖ function block. It is ready for you to input parameters.

6. Assign the following pre-defined global variables to your ―Jogging‖ function block as shown below.

7. Build and download your project. Save your work.

77 of 84
Demonstrate Jog with the PanelView Component Application

1. Jogging

a. Switch to the Jog screen by pressing ―Jog‖ under the menu. Press ―servoOff‖ to enable motor.

b. Set ―Direction‖ to right, and press and hold ―Jog‖.

c. Release the ―Jog‖ button and the axis will stop moving

78 of 84
d. Set ―Direction‖ to left, press and hold ―Jog‖.

e. The axis will move in the reverse direction. Release the ―Jog‖ button to stop the axis.

f. You can make changes to the speed, accelearation deceleration parameter and trigger jog again.
Observe the differences.

Lab 6: What have you done?


In this lab, you created your own ―Jogging Motion Function Block‖. In a more appropriate term, its call a User-defined function
block (UDFB). The UDFB is created by combining 2 ―Motion Function Block‖, namely, MC_MoveVelocity and MC_Halt. The
purpose of these function blocks is:
1. MC_MoveVelocity: This function block commands a never ending controlled motion at a specified velocity
2. MC_Halt: This function block commands a controlled motion stop.
You created the ladder logics to combine these 2 Motion Function Blocks to make it into a motion jog function; You have also
define the necessary input and output for your UDFB. Now, you can insert your ―Jogging UDFB‖ to control different axis.

79 of 84
Appendix A- Motion configuration for Micro850

1. Motion configuration for Micro850


The name of the axis is ―X‖ and the configuration for each sub motion category has been done for you. The details step by
step configurations are illustrated here:

80 of 84
a. DO2 is configured as ―Drive enable output‖.

b. ―Drive ready input‖ is disabled for this lab

c. ―Touch probe input‖ is enabled and automatically configured to DI03.

d. Changed ―Pulse per revolution‖ to 655.36

e. Changed ―Travel per re revolution‖ to 10.0

81 of 84
f. Changed the active level of the Lower and Upper Limit sensors to ―High‖.

g. Changed ―Start/Stop Velocity‖ to 0.5

h. Changed ―Max Velocity‖ to 1500.0

i. Changed ―Max Acceleration‖, ―Max Deceleration‖ and Max Jerk‖ to 15000.0

82 of 84
j. Changed ―Homing Velocity‖ to 5.0

k. Changed ―Creep Velocity‖ to 1.0

83 of 84
Publication CE-DM241A-EN-P — September 2012 Copyright© 2012 Rockwell Automation, Inc. All rights reserved.
Supersedes Publication 84 of 84

You might also like