You are on page 1of 87

ASiM Multi-Axis Functions

TM441

Introduction

Requirements

Training modules:

TM440 ASiM Basic Fun ctions

Software:

Automation Studio Automation Runtime 2.80 ACP10_MC Library 1.17 0

Har dware:

None

TM441

AS iM Mu lti-Axis Func tions s

Introduction

Table of contents
1. INTRODUCTION 1.1 Training guide objectives 2. GENERAL INFORMATION ABOUT CONNECTING DRIVES 3. ELECTRONIC GEARS 3.1 Simple link 3.2 Dynamic phase shift 4. ELECTRONIC CAM PROFILES 4.1 Introduction 4.2 Creating cam profiles 4.3 Linking fun ctions 5. CAM PROFILE AUTOMAT 5.1 Introduction 5.2 Structure and functionality 5.3 Implementing the cam profile automat 5.4 Compensation gear 6. SUMMARY 7. APPENDIX 4 5 6 9 9 20 24 24 26 40 50 50 52 54 76 84 85

ASiM Multi-Axis Functions

TM441

Introduction

1.

INTRODUCTION The B&R drive solution (ACOPOS) provides flexible, high-performance tools for linking drives electronically. This ma kes it possible, for example, to create synchronous drives that are linked together for linear as well as for dynamic (non-linear) movements. In practice, there are many app lications for doing this such as synchronous cutting procedures, dynamic transfer pr ocesses and flexible length partitioning. Corresponding function blocks are provided in their usual form by the ACP10_MC library for comprehensive op eration of these fun ctions.

Fig. 1 ACP10_MC library

This training module deals with the use of different functions for configuring and controlling electronically linked movem en t sequences.

Fig. 2 Cartoning

We will first look at a brief overview to become familiar with the individual op tions. With the help of a few theoretical basics and ideas, we will then learn about how to use multi-axis fun ctions.

TM441

ASiM Multi-Axis Functions

Introduction

1.1

Training guide objectives Participants will becom e familiar with the po ssibilities for using the Motion Control multi-axis fun ctions (ACP10_MC). You will be able to use selected fun ctions to link drives tog ether and to implement specific seq ue nces while the drives are linked. You will learn the procedure for creating linear and non-linear cam profiles and will be able to apply this knowledge for linking drives together electronically.

Fig. 3 Overview

ASiM Multi-Axis Functions

TM441

General Information about Conne cting Drives

2.

GENERAL INFORMATION ABOUT CONNECTING DRIVES What does it mean to link drives electronically? Linking the drives electronically results in a predefined synchronized movement. Example: Drive A is linked to drive B via the po sition. This means that while the drives are actively linked, drive A must adjust its position in a specified ma nner according to the position of drive B. In this case, drive B is the master (specifies a reference po sition) and drive A the slave (po sition ba sed on the master po sition).

Fig. 4 Predefined drive link

A drive link requires a master signal, which provides the reference (po sition, target) and at least one slave drive, which must follow this reference value using a specific "rule". When doing this, the ma ster signal doe s not have to come from an actual drive, as discuss ed in the example. In principle, drives can also be linked to different suitable reference values (external encoder, time, etc.). Note: The mas ter remains unaffected by the linking pr ocedure. It is simply used as the basis for the desired linking signal. If for example, a drive's po sition value is use d as master signal, then this master axis can still be given a com mand even while the drive link is active. In this situation, the slave drive is completely depending on the master signal.

The shap e of the position link (i.e. "po sition rule" that the slave drive must use to follow the master signal) can be clearly displayed in a diagram with a comparison of the master and slave position.

TM441

ASiM Multi-Axis Functions

General Information about Conne cting Drives

This is shown in the image below for a linear relationship between the ma ster and slave position:

Fig. 5 Linear link

The position of the linked master is shown in the horizontal direction. The po sition of the linked slave can be seen in the vertical direction. When the master signal changes uniformly (e.g. a master axis mo vement at constant speed), the spe ed of the slave axis is also constan t (constant po sition change) acc ording to this specification. In this case, we are talking ab out an "electronic gear", a type of link which is use d quite often. The gea r ratio is re prese nted by the slope of the "linear curve":

Fig. 6 Gear ratio

Howe ver, the position relationship do es not have to be linear. In principle, electronic cam profiles can be created and used for any positioning pr ocesses necess ary.

Fig. 7 Non-linear positioning path

ASiM Multi-Axis Functions

TM441

General Information about Conne cting Drives

A single link for an electronic gear as well as a link via cam profiles can be quickly implemented for the ACOPOS. A cam profile editor is provided in Automation Studio for creating user-specific cam profiles. Fun ction blocks used to configure and control the drive links can be found in the ACP10_MC library. The cam profile automa t offers extensive settings for connecting multiple cam profiles to each other. Note: The multi-axis fun ctions for the ACP10_MC library are also ope rated the sam e way as the fun ction blocks that we are already familiar with. This means that the fun ctions are also integrated uniformly in the automatic se quen ce of an application program. Detailed information abo ut the individual fun ction blocks can be found in the Automation Studio online help.

TM441

ASiM Multi-Axis Functions

Electronic Gears

3.

ELECTRONIC GEARS As we know already, an electronic ge ar is used to establish a linear relationship from the slave position to the master signal with a specific factor ("gear ratio").

Fig. 8 Electronic gear

This fun ction is often app lied for simple conveyor belts. Imagine that a pro duct must be transferred from one conveyor to another. In ord er for the transfer to work, the spe ed of both belts must be synchronized. 3.1 Simple link The functions in the ACP10_MC library for controlling the electronic gear are quite easy to use. Note: Unlike the previous fun ction blocks, the fun ctions for linking axis ob jects require the axis reference for master and slave. Therefore, the ncaccess fun ction must now be use d to determine the reference of both axis ob jects. As usual, the NC objects defined in the axis mapp ing (real or virtual axis) can be accessed.

Fig. 9: NC objects in the axis mapping

You must go through the same familiar step s to pr epare the axes for movement.

ASiM Multi-Axis Functions

TM441

Electronic Gears

MC_GearIn function block This fun ction block is used to start a linear link.

Fig. 10: MC_GearIn fun ction block

MC_GearIn input parameters: Master: Specifies the ma ster axis reference. Slave: Specifies the slave axis reference. Execute: Start link with positive edg e on the Execute input. RatioNumerator/RatioDenominator Gear ratio of the link. For example: 3/1 Slave mo ves 3 times faster than the master . Acceleration/Deceleration: Slave limit values when linking and changing the gea r ratio. MasterParID: A ParID can be used as master signal instead of the ma ster set position. MasterParIDMaxVelocity: When using a MasterParID, this pa ram eter specifies the maximum speed of this ParID value, which has effect when entering the gear and when changing the gear ratio.

10

TM441

ASiM Multi-Axis Functions

Electronic Gears

Notes: The state of the master axis is not affected by the link. (Discrete Motion, Continuous Motion, etc.). Link param eters can not be changed if the master moves backwards in the active link. The link cannot be started if the master is moving backwards!

MC_GearOut function block This fun ction block is used to terminate a linear link.

Fig. 11: MC_Ge arOut function block

Note: The slave change s to the Synchronized Motion state when the link is started successfully. When the link is terminated using MC_GearOut the drive maintains its current speed and changes to the Continuous Motion state. Therefore, the MC_Stop fun ction block would also have to be use d to stop movement of the slave axis. (see diagram of states)

ASiM Multi-Axis Functions

TM441

11

Electronic Gears

Task: "Electronic gears" Using the fun ction blocks MC_GearIn and MC_GearOut to start or terminate the linear link. Preparations: Make sure that the ACP10_MC library is pre sent in the project. Depedning on availability, either real or virtual axes can be us ed for linking. It is a good idea to create a separate task for controlling the ma ster axis and one for controlling the slave axis. Tips for implementation Task for controlling the master axis: As discuss ed earlier, the master axis is not affected by the link. It merely provides the ma ster signal (the se t position by default). Therefore, the simple positioning routines can be used to control the master axis. The "basic" task from the ACP10_MC sample project is provided for this. This task contains all of the routines for preparing the drive, as well as the basic positioning commands. To sa ve so me time, you can implement this task in your project for controlling the master axis. Task for controlling the slave axis: In addition to the fun ctions for preparing the drive (& any po sitioning fun ctions, etc., as needed) the fun ction blocks are required her e for axis linking. The axis references for the linking blocks must be determined in the Init subprogram of the task - e.g.:
(* INIT Subprogram *) (* Determine master reference *) status_ma:= ncaccess(ncACP10MAN,ADR(Axis1),ADR(Axis1Obj)); (* Determine slave reference *) status_sl:= ncaccess(ncACP10MAN,ADR(Axis2),ADR(Axis2Obj)); ...

12

TM441

ASiM Multi-Axis Functions

Electronic Gears

All of the necessary functions for this tes t can be placed in the cyclic part of the task. The assignment of the axis reference can be done in the task using the usual pr ocedure e.g.:
(* Cyclic program section *) (* Function block calls *) (* Preparing drive *) MC_Power_0.Axis:= Axis2Obj; MC_Power_0(); (* Reference drive *) MC_Home_0.Axis:= Axis1Obj; MC_Home_0(); ... (* Gearing Functions *) MC_GearIn_0.Master:= Axis1Obj; MC_GearIn_0.Slave:= Axis2Obj; MC_GearIn_0(); MC_GearOut.Slave:= Axis2Obj; MC_GearOut();

Perform the prep arator y settings for controlling both axis objects and then download the project. Testing the functions: Op erate the tasks using the watch window. The axes must first be pr epare d for mo veme nt actions using the known steps: Switch on the controller Homing procedure The MC_ReadAxisError fun ction block can be used to acknowledge any axis errors that occur (e.g. due to faulty configuration). The linking function can now be tested. To do this, perform a mo vement using the master axis (e.g. a continuous mo vement or the "Jog" routine in the "basic" task). Set the input parameter for MC_GearIn and activate the fun ction block ("Execute"). Test different settings for MC_GearIn and the MC_GearOut fun ction block. Be sure to also observe the change in drive status!

ASiM Multi-Axis Functions

TM441

13

Electronic Gears

Notes: The master set pos ition is used by default (FB input: Master). Depending on the application, other master signals (e.g. actual encoder position, etc.) can also be specified on the FB input MasterParID.

These fun ction blocks used are integrated in a complete fun ction se quen ce in the "gear" task of the ACP10_MC sample project. This task can then be add ed to the project (using the known methods) for controlling an axis (virtual or real axis). Additional variables are provided in the struct ure ("gAxisSlave") for operating the linking fun ction.

14

TM441

ASiM Multi-Axis Functions

Electronic Gears

3.1.1 Drive link with po sition reference The MC_GearInPos function block adds functionality to the MC_GearIn fun ction block. Some applications require a defined position for the start of the drive link.

Fig. 12 Relay

MC_GearInPos is us ed to define both the master and the slave position for the start of the electronic gear. This makes it po ssible to achieve a defined "position" of the axes relative to each other for the start of the drive link. This function can be used as follows: A conveyor belt with product receptors, whereb y the distance between two receptor s is equal to one period, will acc elerate from standstill to the spee d of a se cond, preliminary belt supplying the pr oduct. In this case, the product must always be transferred at a defined po sition. When starting the proces s, MC_GearInPos mak es sure that the slave po sition and speed is in the correct reference to the master at the defined ma ster position.

Fig. 13 : Master and slave in undefined position to one another

Fig. 14 : Master and slave after linking at the defined position

ASiM Multi-Axis Functions

TM441

15

Electronic Gears

Note: As described already, values for the position period and factor can be entered for the PLCopen_ModPos="<Period>,<Factor>" entry in the axis mapping table to adjust the po sition value:

Fig. 15 : Advanced setting for position period and factor in the axis mapping

MC_GearInPos function block This fun ction block is used to start a linear link at a defined master and slave position.

Fig. 16: MC_GearInPos function block

Smooth entry into the link

The image at top right displays this pr oced ure for different starting situations (random position of the slave axis). The entry mo vem en t of the slave drive is started when MasterSyncPosition - MasterStartDistance has been reached. At this point, the entry mo vement smoothly enter s the correspo nding gear ratio.

16

TM441

ASiM Multi-Axis Functions

Electronic Gears

MC_GearInPos input parameters Master/Slave: Specifies the master axis reference and slave axis reference. Execute: Start link with positive edg e on the Execute input. RatioNumerator/RatioDenominator: Gear ratio of the link. For example: 3/1 Slave mo ves 3 times faster than the master . MasterSyncPosition/SlaveSyncPosition: Master and slave po sition at which the axes run in-sync. SyncMode: see Fig. 17, Fig. 19 and Fig. 20. MasterStartDistance: The distance within which the system has to perform a "smoo th" entry into the gear link ("compensation mo vement of the slave"). Velocity/Acceleration: Maximum spee d or acceleration for the slave when entering the link. MasterParID: A ParID can be used as master signal instead of the ma ster set position. MasterParIDMaxVelocity: When using a MasterParID, this pa ram eter specifies the maximum speed of this ParID value, which is valid when entering the gear and when changing the gear ratio.

Notes: An active link made by the MC_GearInPos fun ction block cannot be interrupted by an add itional function call for the sa me or another instance (i.e. the gear ratio cannot be cha nged either). The Slave must be in standstill when starting the link (MC_GearIn and MC_GearInPos)! The link cannot be started if the master is moving backwards! The master axis is not affected at all by these actions and can therefore execute basic mo veme nts as usual.

ASiM Multi-Axis Functions

TM441

17

Electronic Gears

Synchronization modes A mod e param eter can also be used to define the position period, in which the slave drive should move for entry into the gear. The point where the drives are linked is based on the mode and the current position of the slave axis (current, last or next period ). This allows e.g. a slave axis compensation moveme nt to the corresponding connection point to be performed one period before or one period after the current po sition period:

Fig. 17 CATCH_UP and SLOW_DOWN diagram

As shown in the image above, CATCH_UP always initiates a mo vement to the next drive linking point. SLOW_DOWN always initiates a mo vement to the preceding drive linking point. Depending on the current po sition of the slave, the CATCH_UP mod e might ma ke it neces sar y to chan ge to the next period (see abo ve). It is also possible to change to the preceding period for the SLOW_DOWN mod e. Ba sed on our conveyor belt example (see below), the slave would mo ve forward when linking in CATCH_UP mode and first backwards then forward in SLOW_DOWN mode.

Fig. 18: Conveyor belt example

Fig. 19 WITHIN_PERIOD diagram

The image above show s the behavior for the WITHIN_PERIOD mode for two different starting situations. In thes e case s, the slave always mo ves to the starting point within the current period.

18

TM441

ASiM Multi-Axis Functions

Electronic Gears

The slave would always move backwar ds when linking in the WITHIN_PERIOD mode because the SlaveSyncPosition is at the beginning of the period in our conveyor belt example.

Fig. 20 SHORTEST_WAY diagram

When in the SHORTEST_WAY mod e, the slave always moves to the next closest starting point. This is illustrated in the image abo ve for two different starting situations. Depending on the situation, it could be necessar y to change to the preceding (as shown abo ve) or the next period. What hap pens when the starting position for the master compensation has already been exceeded? When using period ic axes, this starting point also recurs in the next period. Otherwise, the function block returns an Error. Caution: The SyncMode input must be configured when using a periodic axis. With a non periodic axis, it is ignored.

Task: "Electronic gear with position reference" The MC_GearInPos function block can now be tested the same way as in the previous example. Integrate this function block and operate it using the Watch fun ction. Start the fun ction block while the slave axis is idle. Observe how the slave behaves.

ASiM Multi-Axis Functions

TM441

19

Electronic Gears

3.2

Dynamic phase shift When a link is active, MC_Phasing will create a phase shift betwe en the ma ster and slave axis. The master position sen t to the slave is shifted with re spect to its actual physical position. The phas e shift is only "seen" by the slave, the master doesn't notice. The phase shift remains in place until another phasing command changes it. MC_Phasing can be used if a link has already been started with the FBs MC_GearIn, MC_GearInPos or MC_CamIn. How is this done? The position for the slave is ba sed on the "po sition" of the linked master and the drive link relationship (linear or via a cam profile):

Fig. 21 Master/Slave drive link relationship

The MC_Phasing fun ction block now gen er ates a value for an add itive element or add itive ma ster axis. This element is adde d to the actual ma ster po sition. The resulting value is then applied to the master side of the drive link relationship.

20

TM441

ASiM Multi-Axis Functions

Electronic Gears

The specified final value for the add itive axis is created by a corresponding speed increase after the fun ction block is activated. This pre ven ts any po sition jumps from occ urring (for the slave) during the procedure. The ma ster is not affected by or doe s not "know about" this action at all.

Fig. 22 : Targeted phase shift caused by the MC_Phasing function block

This results in a changed po sition setting for the linked slave. This means that a specific phas e shift can be implemented. Generation of the value of the additive master axis is done smoothly. MC_Phasing can be set to implement product separation. After cutting the cardboard, the sheets are right next to each other on a conveyor belt. They are then transferred to a second conveyor belt. A phase shift can be executed for the second belt once it has been reache d by a sheet. This creates a gap between the products, which is required for further processing.

ASiM Multi-Axis Functions

TM441

21

Electronic Gears

MC_Phasing function block

Fig. 23: MC_Phasing function block

Master/Slave: Specifies the master axis reference and slave axis reference. Execute: Phase shift is star ted at a rising edge. PhaseShi ft: Phase shift [master's units]. Velocity/Acceleration: Maximum spee d / acceleration for achieving the phas e shift [units/sec]. Note: The resulting slave position is directly dependent on the link relationship. For example, the gear ratio for an electronic gear has the following effect on the result: Gear ratio = 1:5 (Master:Slave) Master-side shift: 2,000 units (additive master axis) Slave-side shift: 10,000 units

22

TM441

ASiM Multi-Axis Functions

Electronic Gears

Task: "Phase shift" Use the MC_Phasing fun ction block. Go through all of the steps up to the point of activating the link and perform the phase shift for different settings. Note: The phas e shift is additive to the curren t mo vement. The MC_Phasing fun ction block can also be tested while the linked axes are idle (idle master).

ASiM Multi-Axis Functions

TM441

23

Electronic Cam Profiles

4.

ELECTRONIC CAM PROFILES To implement dynamic, non-linear movem en ts, ACOPOS offers the option of using electronic cam profiles for axis linking. These cam profiles can be created by the user.

Fig. 24 Electronic cam profiles

Electronic cam profiles can be used in many different ways. Example: Cam profiles can be used quite effectively for spring winding machines. Sepa rate axes are used to control the feed, curvature and slope respectively. This makes it po ssible to create any shap e needed (slop es, cones, etc.) 4.1 Introduction As we saw in the previous section, the position relationship for drive links can be clearly illustrated in a diagram. In the cam diagram, we see the master position value in the horizontal direction and the slave po sition in the vertical direction. The cam profile now assigns a respective slave po sition value for each ma ster po sition value within a defined range (cam profile master period / cam master period). The slave drive must follow this profile while the drives are actively linked.

24

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Fig. 25 Cam profile as po sition relationship

The master position is converted to a corresponding slave po sition via the cam profile. This allows the ma ster to move in both directions. The slave drive is "connected" to the master via the cam profile. That means that the spe ed and acceleration values for the slave drive are also taken from the spee d and acceleration of the master in connection with the curve characteristic. Therefore, the entire course of the cam profile must be checked to make sure the slave drive can accept any occurring speed and acceleration values. Example: Let's assume the master signal changes at a constan t rate (e.g. uniform ma ster axis mo vem ent, time as master, etc.).

Critical ranges (with maximum values for slave speed and acc eleration) are re presen ted in the cam profile by maximum slop e (-> speed as first derivative of the position) and the maximum slope change (-> acc eleration/deceleration as second derivative of the position) due to the position comparison.

ASiM Multi-Axis Functions

TM441

25

Electronic Cam Profiles

4.2

Creating cam profiles Automation Studio supports the creation of cam profiles with a po werful cam profile editor. A cam profile can be edited in the cam profile editor after being inserted to the project. Cam profiles are created as NC software objects in Automation Studio. The corresponding object must first be inserted to the project before a new cam profile can be created.

Automation Studio 2.x

After sele ctin g the menu item "Insert New Object" an Advanced Object is selected in the subse quen t dialog box.

Fig. 26 Inserting an advanced object

After confirming this selection by pressing the Next button, the respective NC data object can then be selected in the next window. For our example, let's select the Type: NC Cam Profile from the Resource: ACP10: Cam Profile.

26

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

The cam profile name can be entered in the "Name" field:

Fig. 27 Inserting a cam profile

The new NC software object is created in the project after confirming the entry with the Finish button.

Fig. 28: Cam profile in the software tree

The cam profile editor is op ened automatically after completing the action and we can start modeling the cam profile right away. At any point in the future, the cam profile can be opened for editing by double-clicking on the respective icon in the software tree.

ASiM Multi-Axis Functions

TM441

27

Electronic Cam Profiles

Automation Studio 3

Fig. 25: Appending a new object

Select Motion from the Categories section of the dialog box that appear s after selecting Append Object from the Insert menu item. Add itionally, a new cam profile can be selected in the right half of the dialog bo x by selecting New NC Cam Profile from the templates.

Fig. 29: Selecting a new cam profile in the Motion area

After confirming your selection with the Next button, a new dialog box app ears in which the object name and a description can be en tered for the cam profile. The corresponding NC data object still has to be selected. In our cas e, we will select the Subtype: ACP10 Cam Profile.

Fig. 30: Entering the name , a description and selecting the ACP10 data object

28

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Fig. 28: Object ass ignment

We will ass ign the new cam profile to the active CPU by selecting "to active CPU". The cam profile is then add ed to the Logical View after confirming the selection with the Finish button.

Fig. 29: The inserted cam profile in the logical view

The cam profile can be opened at anytime in the Logical View and edited in the cam profile editor by double-clicking the corresponding icon.

ASiM Multi-Axis Functions

TM441

29

Electronic Cam Profiles

4.2.1 Editing a cam profile The cam profile editor in Automation Studio is a full-featured tool that helps us create and ada pt very clear and exact cam profiles for the respective linking requirements. A number of settings are available for doing this. The Automation Studio help system contains detailed user information about inserting the NC software object "cam profile" (as discussed in the section above), creating the cam profile as well as information about the individual cam profile formats.

Fig. 31: Automation Studio Online Help

The following sections will explain the step s for editing a cam profile.

30

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

An "empty" area in the editor is displayed for the cam profile after creating a new cam profile object. The editor window is divided into three areas:

Fig. 32 Cam profile editor

Display of the cam profile (1, top) as a fun ction of the slave po sition according to the master po sition. Two diagrams derived from the curve characteristic (spee d, acceleration, etc.) are displayed in the lower half of the windo w. A list (2, bottom left) for defining the fixed point of the curve characteristic A list (3, bottom right) for defining synchronous sections. It is recom mende d to adjust the diagram properties before inserting fixed points and synchronous sections. A detailed description of the po ssible properties and settings can be found in the Automa tion Studio help files.

ASiM Multi-Axis Functions

TM441

31

Electronic Cam Profiles

The settin gs include: General properties Color settings Extensions Display options Labels and formulas Characteristic values for curves Notations in the diagram We now have the possibility of defining fixed points on the curve as well as synchronous sec tions (linear sections on the curve characteristic) to create a cam profile. The connections for a complete cam profile are ma de automatically by the cam profile editor using interpolation curves:

Fig. 33 Construction of a cam profile

The figure abo ve show s an example of a cam profile. A total of four fixed points and one synchronous sectio n (with linear gradient) we re defined. These definitions are automatically connected by the cam profile editor to create a complete cam profile: When this happens, interpolation curves are also calculated and displayed. The user can also define the shap e of the interpolation curves as we will see later.

32

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Fixed points A fixed point is a point in the cam profile for which the position of the slave axis is determined by the user , at a specific position of the master axis. There are four wa ys to insert a fixed point: via the menu, by selecting Insert/Fixpoint via the shortcut menu in the diagram with Insert Fixpoint by selecting the Insert Fixpunkt button in the diagram in the fixed point table, wor kspace at the lower left (2)

Fig. 34: The table in the lower left are a of the workspac e contains the list of existing fixed points.

The following values are used in the individual table columns:


Column label No. s ma. s sl. s sl. s sl. Meaning (for mathematical notation1 ) Consecutive number of fixed points in the table Position of the fixed point on the master axis Position of the fixed point on the slave axis First derivative of the cam profile function on the fixed point ( cu rren t gear ratio) Sec ond derivative of the cam profile function on the fixed po int

ASiM Multi-Axis Functions

TM441

33

Electronic Cam Profiles

Note: The notation indicates whether po sition or time units should be use d in the diagrams on the abscissa (i.e. for the master axis). The use of po sition is labeled as "mathematic notation". The use of time is labeled as "physical notation" (comparable to constan t ma ster speed). Therefore, in physical notation the first derivative in the fixed point is equal to the speed and the second derivative in the fixed point is equal to the acceleration of the slave axis. The cam profile repres en ts the path-time diagram of the slave axis.

34

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Synchronous sections A synchronous section is a section in the cam profile, wh ere the user specifies a linear course of master and slave po sition A constan t master axis spee d within a synchronous section also results in a constant slave mo veme nt. In other wo rds, the cam profile is linear (comparable to an electronic gear). There are also four wa ys to insert a synchronous section: via the menu by selecting Insert/Synchronous Section via the shortcut menu in the diagram with Insert Synchronous Section by selecting the "Insert Synchronous Section" button in the diagram in the synchronous section table, in the wo rkspace at the lower right (3)

Fig. 35: Table in the lower left part of the list of existing synch rono us sections

The following values are used in the individual table columns:


Column label No. s ma. 1 Meaning (for mathematical notation1 ) Consecutive number of synchronous sections in the table Position of the synchron ous section starting point on the master axis Position of the synchron ous section starting point on the slave axis Position of the synchron ous section end point on the master axis Position of the synchron ous section end point on the slave axis Slope of the synchronou s section or gear ratio (produced from the above definitions)

s sl. 1

s ma. 2.

s sl. 2

Gradient

ASiM Multi-Axis Functions

TM441

35

Electronic Cam Profiles

Note: When using physical notation (master axis = time) the master po sition entries change accordingly to points in time. The gradient of the synchronous section is equal to the spee d of the slave axis in this range. ( time pa sses "evenly")

36

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Interpolation curves The function section of a cam profile calculated by the cam profile editor and located betwe en two definitions (fixed points, synchronous sections) is called an interpolation curve. After each new fixed point or synchronous section is en tered, interpolation curves are imm ediately created in betwe en, calculated and displayed. The cam profile editor makes sure that an interpolation curve lies exactly between two defined components. Likewise, an interpo lation curve is also deleted if a fixed point or a synchronous section is deleted. Note: The calculation ensures that the cam profile fun ction and its first derivative are constant at the transition po ints (e.g. the curves do not contain any jumps at the end points). Various curve types can be selected for the individual interpolation curves to more precisely design the curve characteristic between the defined ar eas (fixed points and synchronous sections). These provide different predefined shapes according to the type. Specific curve characteristics are suppo rted by type-specific settings (turning points, joining points, etc.). The corresponding dialog box is opened by right-clicking on the interpolation curve. The curve section can be edited after selecting Curve Properties.

ASiM Multi-Axis Functions

TM441

37

Electronic Cam Profiles

Fig. 36 Curve properties dialog bo x

Detailed information about the possible settings can be found in the Automation Studio Online Help files under Interpolation Curves.

38

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Task: "Creating cam profiles" Insert the NC software object cam profile to your project and edit it in the cam profile editor. To do this, use the option for definition of fixed points and synchronous sections. e.g. The image below shows a mo vem en t profile in which the slave axis reaches its maximum position in the right quarter of the profile.

When creating the cam profile, ma ke sure that the profile has the same slope at the start and end point. This characteristic is impo rtant for the following drive link app lications. Supplement: Transfer the project with the new cam profile to the controller and activate monitor mode. The cam profile should now appe ar in the project software tree as a data object on the controller. The necessary cam profiles for the coupling app lication must be transferred to the ACOPOS servo drive using the MC_CamTableSelect function block.

ASiM Multi-Axis Functions

TM441

39

Electronic Cam Profiles

4.3

Linking functions A cam profile must be transferred from the controller to the slave ACOPOS before it can be used. The following section will explain the corresponding routines and procedures nee ded to do this.

4.3.1 Preparing cam profiles The MC_CamTableSelect fun ction block is required for transferring a cam profile object to the linked slave. When this fun ction block is called, the corresponding cam profile (input parameter: CamTable) is transferred and an ID is returned for further use with the link fun ction. Add itionally, the pre-setting for processing the cam profile one time or cyclically is ma de on this fun ction block. Thus, it is po ssible to allow the cam profile to constantly re peat itself:

Fig. 37 Cyclic attac hment of cam profiles to eac h other

This results in a continuous positioning path for the slave.

40

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

MC_CamTableSelect function block This fun ction block is used for downloading and configuring a cam profile on the link slave.

Fig. 38: MC_CamTableSelect function block

Master: Specifies the ma ster axis reference. Slave: Specifies the slave axis reference. CamTable: Name of the desired cam profile. Execute: Activate fun ction block with po sitive edge on the Execute input. Periodic: Selection between one-time or cyclic processing of the cam profile.
mcNON_PERIODIC ... 0 mcPERIODIC ....... 1

Caution: Smooth entry must be guarantee d when starting a cam profile link. When connecting cam profiles consecutively, the beginning of the following cam profile is set seamlessly to the end of the preceding cam profile. You must first ensure that the speed and acceleration of the transition is constant (no bend in the positioning path). The following sections will provide som e examples of how to do this.

ASiM Multi-Axis Functions

TM441

41

Electronic Cam Profiles

4.3.2 Linking cam profiles A cam profile on the ACOPOS is linked using the MC_CamIn function block.

Fig. 39: MC_CamIN fun ction block

Master: Specifies the ma ster axis reference. Slave: Specifies the slave axis reference. Execute: Start link with positive edg e on the Execute input. MasterOffset: Offset on the ma ster side. SlaveOffset: Offset on the slave side. MasterScaling/SlaveScaling: Ma ster / slaveside scaling of the cam profile. StartMode: Start Mode base d on the offset. CamTableID: Cam profile ID of the desired cam profile. The MC_CamTableSelect fun ction block provides this after the cam profile has been successfully downloaded. MasterParID: A ParID can be used as master signal instead of the ma ster set position.

42

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Possi bilities for starting the link: Similar to the MC_GearInPos fun ction block, the exact start of the link can also be defined here in relation to the master and slave position. The two parameters Offset and StartMode are available for this definition. (Note: The master start po sition returns periodically (<period >)). There are three different variations (start modes) for defining the link start: Absolute from the zero point of the po sition period "Zero point of the position period + Offset" mcABSOLUTE

Fig. 40: Link start in the mcAbsolute mod e

The slave calculates its start position by add ing the slave offset to the start of the period. It moves to this position and waits the re until the master has reached its master offset, also started from the period beginning. The slave links with the master axis as soon as this has been reached. Relative to the current po sition "Current axis po sition + Offset"

mcRELATIVE

Fig. 41: Link start in the mcRelative mod e

ASiM Multi-Axis Functions

TM441

43

Electronic Cam Profiles

The principle is the sam e as the mcABSOLUTE start mod e, with the exception that the start po sitions for slave and master are calculated ba sed on their actual pos itions and take the respective offset into consideration. Directly from the current ma ster / slave position mcDIRECT

Fig. 42: Link start in the mcDirect mode

The cam profile is started right at the current master and slave position. The MasterOffset specifies whe re within the cam profile the link is started. The SlaveOffset is not used in this start mode. Note: The ma ster axis must be at standstill in the mcDIRECT start mod e to link the slave at the cor rect position!

Note: It is po ssible that the ma ster will pas s the start po sition for linking a few times because the slave requires a certain amount of time to reach its start position. Once the slave has reached its start po sition, the link is started after the next master start position has been reached.

44

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Scaling the cam profile A cam profile used for linking can be "stretched" on both the ma ster and slave side. The input par ameters for the multiplication factors are included in the MC_CamIn fun ction block. This expands the length of the master and slave cam profile by the corresponding factor. Example: Cam profile scaling Cam profiles are often created with a master-side dimension of one unit (cam profile ma ster period = 1) and a slave-side dimension also of one unit (cam profile slave period = 1). This mak es it rather eas y to "stretch" a cam profile to match the actual process:

For example, let's assume that the cam profile (master period =1, slave period =1) should be set in a way so that exactly one cut is made for each ma ster axis revolution. Therefore, the multiplication factor for the master-side must be set to the same numbe r of un its for a master revolution. When using a linear cam profile (comparable to electronic gear), the "gear ratio" can be determined using the multiplication factors.

The MC_CamOut function block can be used to terminate an active link again.

Fig. 43: MC_CamOu t fun ction block

ASiM Multi-Axis Functions

TM441

45

Electronic Cam Profiles

Task: Set up the link for the cam profile crea ted earlier using the know n method. The cam profile should be pr ocesse d cyclically. Preparations: Add the functions MC_CamTableSelect (for preparing and transferring the cam profile), and MC_CamIn (for starting the cam profile link) to the cyclic prog ram part for the slave drive. Make the necessary fixed settings for the fun ction blocks e.g.:
(* Cyclic program section *) (* Function block calls *) ... (* Camming functions *) MC_CamTableSelect_0.Master:= Axis1Obj; MC_CamTableSelect_0.Slave:= Axis2Obj; MC_CamTableSelect_0.Periodic:= mcPERIODIC; MC_CamTableSelect_0.CamTable:= profile; MC_CamTableSelect_0();

When the function is executed, the defined cam profile object is prepared for cyclic processing. The link can be started using MC_CamIn after successfully do wnloading the cam profile.
MC_CamIn_0.Master:= Axis1Obj; MC_CamIn_0.Slave:= Axis2Obj; MC_CamIn_0.StartMode:= mcRELATIVE; MC_CamIn_0.CamTableID:= MC_CamTableSelect_0.CamTableID; MC_CamIn_0(); MC_CamOut_0.Slave:= Axis2Obj; MC_CamOut_0();

The "Relative" start mod e is used. Therefore, the offset values can be used to determine the actual starting point of the current positions (master/slave). Use the MC_CamIn function block for linking in to the cam profile and MC_CamOut for linking out of the cam profile. Pay attention to the axis status! Try to also link the cam profiles using different offset values. Obs erve the effects the relationships can be seen clearly by ob serving the po sitions at a slower master speed. Op erate the fun ctions using the watch window.

46

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Caution: In the programming example abo ve, the cam profile ID return ed from MC_CamTableSelect is transferred directly to the MC_CamIn fun ction:
MC_CamIn.CamTableID:= MC_CamTableSelect_0.CamTableID;

For this reas on, you should leave the "Execute" input in the MC_CamTableSelect fun ction block se t to "TRUE" because otherwise this value is res et to zero. In an "independent" app lication task, you should of course make sure that the cam profile IDs are correctly filed whe n preparing multiple cam profiles. The correct ID must always be provided on the respective function block input when linking. The scaling values (master side and slave side scaling of the cam profile) must be set to at least the value 1 for the linking factors!

Note:

These fun ction blocks used are integrated in a complete fun ction se quen ce in the "cam" task of the ACP10_MC sample project. This task can be add ed to the project for controlling an axis (virtual or real axis). Add itional variables are provided in the structure ("gAxisSlave") for op erating the linking fun ction. The cam profile object is transferred after the command is given to start the cam profile link. The actual link is then ma de when the CamTableID is received.

ASiM Multi-Axis Functions

TM441

47

Electronic Cam Profiles

4.3.3 Changing cam profiles When a cam profile link is active, the cam profile can be changed by calling the MC_CamIn fun ction block again. The period of the active cam profile is en de d and the new cam profile is attached after defining a new CamTableID and a positive edge on the Execute input. The end point of the first cam profile is the start point of the second cam profile. Neither the master and slave offset nor the start mode have any effect on the cam profile change.

Fig. 44 Cam profile transition

Caution: You must also make sure in this case that the transition betwe en cam profiles is constant in orde r to avoid ben ds in the curve.

The required cam profiles can be attached to ea ch ot her in a convenient se quen ce after being transferred to the corresponding ACOPOS (one time or cyclically). The routines for changing the cam profile must be performed in the application progr am at the respective moments.

48

TM441

ASiM Multi-Axis Functions

Electronic Cam Profiles

Task: "Cam profile change" We can now tes t this fun ction without having to ma ke any additional preparations. Link the cam profile as in the previous example. Execute the MC_CamIn function again, but now cha nge the values for the cam profile scaling. In principle, this pr ocedure is carried out the sam e way as linking a new cam profile.

ASiM Multi-Axis Functions

TM441

49

Cam Profile Automat

5.

CAM PROFILE AUTOMAT The cam profile automat allows event-controlled linking of electronic cam profiles. The following example provides a step-by-step clarification of the cam profile automat functionality.

5.1

Introduction Let's first take a look at the following encapsulation machine:

Fig. 45: Encapsulation machine: Picture1: Slave starting point, Picture2: Encapsulation

The product transporter acts as master axis. The slave axis closes each plastic container with a crown cap. A high-spee d digital input (trigger) detects if a product is present. If no pro duct is pr esen t, then the slave remains in standstill. Otherwise the container is cappe d with a crown cap. Let's consider how this example could be implemented using the MC_CamIn fun ction block. First we will need 2 cam profiles: Cam profile 1, which keeps the slave in standstill wh en a container is not present.

Fig. 46 : Secon d cam profile for keeping the slave in standstill

50

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Cam profile 2 for the encapsulation procedure:

Fig. 47 : Secon d cam profile for encap sulating

First, the two cam profiles must be transferred to the ACOPOS. A control pro gram must then be use d to check if a trigger signal has been received. If so, the n the cam profile 2 must be linked using the MC_CamIn function block. If there is no trigger signal, then cam profile 1 should be linked via the MC_CamIn fun ction block (by changing the cam profile ID on the CamTableID input). A much mo re simple and efficient method would be if the ACOPOS could decide on its own which cam profile should be process ed, base d on the current process situation. This would simplify the control prog ram and enable much faster reaction times. The cam profile automat was created to meet thes e demands. It is initialized and the parameters are set on the corresponding ACOPOS slave drive where it can then be processe d independently. This keeps the CPU load comparably low, even when a large numb er of axes are in use. The running process results in minimal reaction times. There are also many wa ys to intervene in the running automats. In the following section, we will take a step-b y-step look at the struct ure and op eration of a cam profile autom at using the example show n earlier.

ASiM Multi-Axis Functions

TM441

51

Cam Profile Automat

5.2

Structure and functionality The example abo ve can be structured in the cam profile automat as follows.

Fig. 48: Cam profile automat structure for the encapsulation machine

Automa t states The two cam profiles are now each packed in a specific st ate. These are called automat states. These result in State1, in which the slave should not perform a movement because a product is not pres en t and State2, in which the encapsulation pr ocess should be executed. State0 is optional and can be use d as the initial state or standby state. No cam profile can be ass igned to this state. Change events: The change event is used to determine which event should cause a change of state (e.g. trigger even t ncTRIGGER, or reaching the end of the state ncST_END, etc). When the change should be applied must also be determined. For example, this can take place at the end of the state (ncST_END) or immediately (ncAT_ONCE) whe n the event occurs. The subse quent state that should follow is also defined. This provides a sequence of automat states. Two change events we re defined for ea ch of the two states in our example. Cam profile automa t sequen ce for the encapsulation machine: The encapsulation machine changes to the State1 after the eventcontrolled start (start at a specific ma ster po sition) in the State0. The slave doe s not perform any movements in the State1. Therefore, the first container must be excluded wh en starting the machine. If a trigger signal (ncTRIGGER) is detected during processing of State1, then the machine changes to State2 at the end of State1 (ncST_END), at which point the encapsulation process is then executed. A container is capped when State2 is executed. This state is rep eated if another trigger signal occurs in this state.

52

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

If a product is not pres en t or if the State2 runs completely to the end (ncST_END) without a trigger signal having occurred, then the machine must switch to State 1 so that the slave doe s not perform a movement. The automat remains in State1 until a new trigger signal is received. When a new trigger signal is received, the au tomat is switched back to State2 and the encapsulation proces s is continued.

Fig. 49: Encapsulation machine

This makes it po ssible to consecutively arrange a wide variety of cam profiles in a manner similar to the ste ps (states) of a step sequen cer. This further enables the implementation of flexible machine process es. Once the automat parameters have been set, the automat can then be started in any state and runs through the individual states according to the defined change even ts and subs equent states.

Fig. 50 : Sequence of au tomat states

ASiM Multi-Axis Functions

TM441

53

Cam Profile Automat

5.3

Implementing the cam profile automat The param eters for the cam profile automat can be set in two ways using corresponding function blocks in the ACP10_MC library for the cam profile automat. The individual fun ction blocks are handled exactly the same as the fun ction blocks which have been used up to now.

Fig. 51: B&R-specific fun ction blocks for cam profile automats

using the MC_AUTDATA_TYP data structure provided in the ACP10_MC library. This data structure contains all of the cam profile automat parameters in structured form. A variable with this type can be created in the application progra m and use d to configure the automat.

Fig. 52: MC_AUTDATA_TYP data structure

The following step s must be tak en to implement a cam profile automat:

54

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Define global parameters for the autom at (master or slave axis, initial state, etc.) via the data structure MC_AUTDATA_TYP>.<Parameter> or using the MC_BR_InitAutPar function block. Down load all of the cam profiles to the ACOPOS that are use d in the automat. The MC_BR_DownloadCamProfObj fun ction block can be used to do this. The automa t states must also be defined. A state can be defined using the MC_BR_InitAutState fun ction block or the <MC_AUTDATA_TYP>.State[x] data structure. Definition of the desired change event for each state. This can be done using the MC_BR_InitAutEvent function block or the <MC_AUTDATA_TYP>.State[x].Event[y]. data structure. After the step s mentioned above have been performed, the automat can then be star ted and op erated using the MC_BR_AutControl function block.

In the following section, we will take a special look at the automat pa ram eter settings. The Automa tion Studio Online Help files can assist us by providing additional information about this.

ASiM Multi-Axis Functions

TM441

55

Cam Profile Automat

5.3.1 Defining global parameters We use the term, "global parameters" to indicate that settings are principally valid for all au tomat states. The automat's global settings are mad e using the MC_BR_InitAutPar function block and the <MC_AUTDATA_TYP>.<Parameter> data structure. These are the basis parameters: The StartPosition, which allows changing from the basis state 0 to another state at the mom en t a specific master po sition is rea ched. To do this, a corresponding change event with the event type ncSTART must be defined for the basis state 0. Specification of the next parameter StartInterval is also of impo rtance. StartInterval: If the ma ster position is already located behind the StartPosition, the n the change event ncSTART is gen er ated at the next multiple of the StartInterval. These are the optional parameters: MaxMasterVelocity: The slave uses the maximum master speed to calculate its compensation gear and to check if its limits have been exceed ed. ( Warning from the ACOPOS) This parameter is only required when the compensation gear is being used. StartState enables the automat to be started in any state. The automat starts in the basis state 0 if this par ameter is not specified. StartMaRelPos can be use d to start in the initial state within the cam profile. StartMaRelPos specifies the ma ster distance from the beginning of the cam profile. Any compensation gears pre sen t in the initial state are ignored.

Fig. 53: Representation of a direct start

MasterParID: A ParID can be used as master signal instead of the ma ster axis set position.

56

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

AddMasterParID: The value of this ParID is adde d to the master po sition. AddSlaveParID: The value of this ParID is add ed to the slave po sition calculated by the automat.

Fig. 54 : Master drive link relationship additive element - slave

SalveFactorParID: The slave axis scaling is stretched by the value of this ParID. This factor applies to all states in the automat. EventParID: ParID specification, which ser ves as even t source in states where the event type ncPAR_ID is used. An even t is detected if the value of this ParID cha nges from 0 to a value != 0. SlaveLatchParID: The slave compensation distance begins at the latched value of this ParID in the compensation mode ncSL_LATCHPOS. The value of the ParID specified here (INT type) is latched when a trigger occurs (TRIGGER1, TRIGGER2).

ASiM Multi-Axis Functions

TM441

57

Cam Profile Automat

5.3.2 Cam profile download A cam profile must first be transferred to the ACOPOS (slave drive) via the MC_BR_DownloadCamProfObj fun ction block before it can be used in an automat state. These are the input parameters: The name of the cam profile is specified using DataObjectName. The cam profile is store d on the ACOPOS using a specified index. The cam profile for the corresponding au tomat state can the n be selected using this index. The Periodic param eter can be used to determine whether the cam profile should be executed one time or periodically. Specification of this param eter is only useful use d in combination with the FB MC_CamIn. How a cam profile is proces sed on the cam profile automat is determined only by the change events. mcNON_PERIODIC ... 0 mcPERIODIC ....... 1

Caution: A cam profile is selected for an au tomat state when defining the states. This cannot be done until a cam profile with the corresponding index is available on the ACOPOS.

58

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

5.3.3 Defining the states Up to 15 states can be defined (Index 014). One of the 15 states, the basis state (state 0), is an exception because there can not be any cam profile or compensation ge ar assigned to it. Only the desired change events have to be defined for the basis state. In a way, it serves as a waiting step. The following elements can be defined for the other autom at states: A cam profile, which must be transferred to the ACOPOS before it can be used. The cam profile can the n be used in any state. An optional compens atio n gear is available which is ess entially an automa tically calculated curve that compe nsates for position and speed differences and ensures a continuo us cam profile connection during state changes. There are various mo des for this (see 5.3 Compensation gears) Thus, the curve characteristic is defined within a state:

Fig. 55 : State with compensation and cam profile

Note: It is po ssible to deactivate the compensation ge ar. If this is do ne , then the state only contains the cam profile. If a compensation gea r is used in an autom at state, then it will always be processed before the corresponding cam profile in the state. The MC_BR_InitAutState fun ction block and <MC_AUTDATA_TYP>.State[x] data structure are used for configuring automat states. These are the basis pa ram eter s (not including compensation):

ASiM Multi-Axis Functions

TM441

59

Cam Profile Automat

The state being handled is specified by StateIndex (114). The CamprofileIndex input is used to select the cam profile for the state. MasterFactor and SlaveFactor define the master and slave-side cam profile scaling. Optional parameters when using the even t ncCOUNT: RepeatCounterInit is the initial value for the counter when using the ncCOUNT event type. The counter state is decre mented by one each time the end of the state has been reached. The event is ge nerated wh en the counter state zero is reached. RepeatCounterSet can be use d to change the current counter state on a running automat. Optional parameters when using the compensation gear: CompMode As mentioned already, a compensation gea r that com pensates for spe ed and position differences can be us ed before the cam profile. Different compensation mode s are available. The compensation ge ar can also be disabled. These are the compensation gears available:
ncOFF or leave input open ncONLYCOMP ncONLYCOMP_DIRECT ncWITH_CAM ncMA_LATCHPOS ncSL_LATCHPOS ncSL_ABS ncV_COMP_A_SL ncV_COMP_S_MA ncV_COMP_S_SL

MasterCompDistance is the configured master-side compensation distance. SlaveCompDistance is the configured slave-side compensation distance. The param eter ExtendedCompLimit is used to specify whether limit values are additionally defined for compensation. If the input is se t to ncOFF, then the limit values in the axis' Init data module are valid. ncOFF or input not set.
ncON

60

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

MinMasterCompDistance/MinSlaveCompDistance: These two parameters can be use d to specify a minimum effective compensation distance for ma ster and slave. MaxSlaveCompDistance can be used to define the maximum effective compensation distance for the slave. MinSlaveCompVelocity specifies the minimum slave spe ed for compensation. MaxSlaveCompVelocity specifies the maximum slave sp eed for compensation. MaxSlaveAccelComp1 offers the option to define a maximum slave acceleration value for the first half of the compensation. MaxSlaveAccelComp2 offers the option to define a maximum slave acceleration value for the second half of the compensation. SlaveCompJoltTime can be used to define the jolt time in the compensation. The following parameter can optionally be used as master signal: MasterParID: A ParID can be used as master signal instead of the ma ster axis set position.

ASiM Multi-Axis Functions

TM441

61

Cam Profile Automat

5.3.4 Defining change events A change event must be defined for a state to induce a state change. Up to 5 change events (04) are available for ea ch state. A change event has the following prop erties: Target state (NextState) Event type (Type) Event attribute (Attribute) Target state (NextState) The targ et state determines what state should be activated next. The current state can also be selected here for repetition. Event type (Type) The event type determines which event trigg ers a state change. This can be an "external" signal trigger or the end of the current cam profile, etc. The following even t type s can be used: The even t "Master start position" (ncS_START) can be used to switch to another state in synchronization with the master po sition. A start position for the master must be determined as well as a start interval for periodic repetition of this event. The event is generated when the ma ster pas ses the corresponding po sition (or the interval repetition). The "Count" event ncCOUNT can be use d to exit a cyclic repeating state. In principle, this means that a predefined value (RepeatCounterInit) is counted down each time the state is exited. If the coun ter reaches zero, the "count" event is trigg ered. This can be use d to change to another state.

Without this change even t, several states would be required and therefore "spent" for this so rt of fun ctionality.

62

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

The "Trigg er" event (ncTRIGGER1 or ncTRIGGER2) offers the pos sibility to rea ct to hardware signals from external sensors. An ACOPOS param eter ID can be evaluated for the "ParID" event ("ncPAR_ID1...ncPAID_ID4"). The change even t is generated for a value that is not equal to 0. The "Signal" event (ncSIGNAL14) can be used to generate a change from within the app lication program. The "State end" chan ge event ncST_END is triggered as so on as the end of the state is reached. The change even t "negative state end" ncST_END+ ncNEGATIVE is trigg ered as soon as the starting point of the cam profile is reached via negative movement of the master. In this case, the subse quent state cannot have a compensation gear! Furthermore, it is also possible to gen erate a change event from the logical "and" operation (ncAND_N2E) from two of the events mentioned abo ve. Event attribute (Attribute) The event attribute specifies the time at which the state chan ge (triggered by the corresponding event) occurs. (= action point) This means that the actual state change can be placed at the end of the cam profile when using a trigger as change event, which occurs according to circumstances in the cam profile characteristic. The following even t attributes are defined: ncAT_ONCE : The change into the next state is executed imm ediately or at the beginn ing of the next sampling cycle. ncST_END : The change into the next state is not executed before the end of the current state after compensation and cam profile.

ASiM Multi-Axis Functions

TM441

63

Cam Profile Automat

Example: "Applying change events"

Fig. 56: Action point for various events and attributes

The image above illustrates how an event attribute works in relation to a change event. A linear curve characteristic is shown which traver ses from left to right. Let's assume that a previously defined change event "Trigg er1" occurs within this state. The event attribute ncAT_ONCE is used to immediately change to a defined state (taking the sampling cycle into consideration). As a result, the system places the subsequent curve characteristic exactly on the po sition of the actual trigger event. (trigger signal determined in rega rd to hardware, with increased timing resolution between sampling cycles). Therefore, inaccuracies do not occur in the po sitioning sequen ce due to the sampling cycle. When the "state end" event attribute ncST_END is use d, this change is mad e at the end of the current cam profile.

64

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

The MC_BR_InitAutEvent function block and <MC_AUTDATA_TYP>.State[x].Event[y] structure comp onent are used to determine the cha nge even t for the au tomat states and the seq ue nce of the states. 5 change events can be defined for each of the 15 automat states (index 0 to 14). The correspo nding indices are specified on the fun ction block. These are the basis parameters: StateIndex: Specification of which state the event corresponds to. EventIndex specifies the index for this event. Type specifies which event type to react to. Attribute determines at which point in time the event should become active. ("action point") If the parameter Action is set to the value 1, then this event is also used for synchronized transfer of changed param eter s in the automat. See the input parameter ParLock from the fun ction block MC_BR_AutControl. The param eter NextState specifies which state to change to when the event occurs (target state).

ASiM Multi-Axis Functions

TM441

65

Cam Profile Automat

5.3.5 Starting and controlling the cam profile automat The function block MC_BR_AutControl is used to start and control the cam profile automat. If the automat is configured with the application struct ure, then this fun ction block also handles initialization of the au tomat.

The MC_BR_AutControl fun ction block is activated by an Enable input. Various commands for the cam profile au tomat can then be given via the controller inputs. Param eters can also be changed wh en an automat is running (online parameter change). The control input ParLock can be used to block imm ediate app lication of changed param eters in the automat. This enables synchronized application of changed pa ram eter s in an ACOPOS cycle. ParLock0: Lock disabled. In principle, changed para meters are app lied the next time this state is entered. ParLock1,2: Lock enabled. That means that the changed parameters have not yet been applied. ParLock1 0: The changed parameters are app lied in synchronization the next time a change event occ urs. ParLock2 0: The changed parameters are app lied in synchronization the next time a change event occ urs, which wa s configured with Action = 1. Signal14 triggers a cha nge even t defined with ncSIGNAL14. The event is always ge nerated on the signal14 - input at a po sitive edge. 1Set signal, 0Reset signal. The Start control input is used to start the cam profile automat. The function block must first have been enabled with the Enable input. The cam profile automat can be stoppe d by setting the Stop input. After this occurs, the slave is then released from the automat. Howe ver, the calculation of the slave po sition and the event-state handling continues in the automat, as long as the master is in motion. (."Stand-by" automat mode) This calculated po sition is crucial for the automat restart.

66

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

When stop ping the au tomat, the slave changes to standstill with the deceleration specified on the Deceleration input. If a value has not been specified her e, the n the limit value from the Init data module is used. The slave axis can be returned to automat operation after a failure using the restart comm and. The au tomat is resume d at the current ma ster and slave position. Take note that the current slave po sition does not have to match the current cam profile se t po sition!

Fig. 57: Restarting after slave axis failure

If the autom at is configured with the MC_AUTDATA_TYP data structure, then the initialization of the cam profile au tomat param eters defined in the app lication structure occurs via MC_BR_AutControl as follows: The address of the app lication data struct ure is attached to the AdrAutData. The param eter initialization is started with the control command InitAutData.

ASiM Multi-Axis Functions

TM441

67

Cam Profile Automat

Notes: Preset cam profiles: These are already provided on the drive and do not have to be transferred to the ACOPOS. CamProfileIndex = 0xFFFF This predefined linear cam profile has a ma ster and slave length of one unit and can be use d as CamProfileIndex for the configuration of the automat. This can be used with multiplication factors to produce any m:n straight line. CamProfileIndex = 0xFFFE This predefined point cam profile can be used as CamProfileIndex for the configuration of the automat. This 0-cam profile can only be use d in connection with compensation modes (i.e. not in states with CompMode = ncOFF. The master and slave interval length of this predefined minimum cam profile is zero. However, the slope of the curve is not zero, but can be set using the multiplication factors. This enables the use of applications, which only require one compensation procedure without cam profile. Online parameter change: As mentioned earlier, pa rameters of the cam profile automat can be changed during operation. The excep tions to this rule are the compensation mode (CompMode), event type (Type), event attribute (Attribute) and MasterParID. Other methods of stopp ing the automat: Automa t operation can be sto pped at any time with a slave movement stop (MC_Stop). A change to the state index 255 can be used to exit the automat.

68

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Task: "Setting the parameters for a cam profile automat" In this example, we will implement a simple task using the cam profile automat. Default: Products are carried pa st a cutter in specific intervals on a conveyor belt. When a product is detect ed by a trigger, the product should be cut in the next period at the corresponding position. If no trigger is received (no product present), then the cut procedure is not activated.

Fig. 59.1: The machine's initial situation

Fig. 59.2: Product is detected

machine must switch to state 2 in the next period

ASiM Multi-Axis Functions

TM441

69

Cam Profile Automat

Distribution on the conveyor belt corres ponds to the master period. (Master period example = 1000 units) Procedure: Sketch the autom at state diagram. The basis state 0 should be used for the automat start (see the event type ncS_START). Draw the required cam profiles in the cam profile editor and mak e sure that the distribution on the conveyor belt correspo nds to the ma ster period. Configure the cam profile automat using the app lication data structure and start it via the Watch fun ction.
(* Init Program *) (*general automat parameters*) AutData.Master := Axis1Obj; AutData.StartPosition := 0; AutData.StartInterval := 1000; (*Automat STATE 0 Basis State Event AutData.State[0].Event[0].Type AutData.State[0].Event[0].Attribute AutData.State[0].Event[0].NextState (*Automat STATE 1 standstill*) AutData.State[1].CamProfileIndex := 3; AutData.State[1].MasterFactor := 1; AutData.State[1].SlaveFactor := 1; (*Automat STATE 1 standstill Event 1*) AutData.State[1].Event[0].Type := ncTRIGGER1; AutData.State[1].Event[0].Attribute := ncST_END; AutData.State[1].Event[0].NextState := 2; . . . (* Cyclic program section *) . . . (* Automat START *) MC_BR_AutControl_0.AdrAutData := ADR(AutData); MC_BR_AutControl_0.Deceleration := 500; MC_BR_AutControl_0.InitAutData := 1; . . . MC_BR_AutControl_0(); 1*) := ncS_START; := ncAT_ONCE; := 1;

70

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Tips for implementation Prepare the linked axes for movement actions using the known method s. The jog routine from the "basic" task can be use d for constant mo vement of the master axis. Start the cam profile au tomat, which was configured earlier, using the respective comm and. Us e the trigger input 1 to signal the presen ce of a product. Be sure to also observe the drive status.

ASiM Multi-Axis Functions

TM441

71

Cam Profile Automat

Example: "Labeling machine" Requirements: In the following pr oces s, self-adhesive labels will be placed on bottles. The bo ttles that will be labeled are transported on a conveyor belt (master axis) from right to left. The carriers on the belt en sure equal spacing between the bottles. The self-adhesive labels are provided on a pap er belt (label belt), which is drawn from a roll (slave axis). Before the roll, the label band is looped around 180 on a metal edge. This frees the labels from the belt. The process is star ted with an em pty machine. A trigger signal is used to determine whether a bottle is presen t or not.

Fig. 60: Labeling machine

72

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Let's take a look at the cam profile status diagram for this labeling machine:

0 Basis

S_START

1 Stillst

TRIGG Z_ENDE

2 1/2Agl

TRIGG Z_ENDE

3 Zyk l

TRIGG Z_ENDE

4 Agl1/2

TRIGG Z_ENDE

Fig. 61: Cam profile status diagram for the lab eling machine

5 states are required: Ba sis state 0: For starting the process at a specific master position. State 1: Is pr ocessed if a bottle was not pr esent in the current and in the new cycle (no trigger signal). State 2: After one period with no bottle (or after starting the machine) this state is used to dispense the next label. State 3: This state, in which the labels are applied, runs constantly in normal op eration (without any missing bo ttles). State 4: This state is process ed if a label wa s applied in the preceding cycle and a bottle is not pres en t in the current cycle. Take note that the conveyor belt on this labeling machine cann ot contain a bottle whe n starting in the first period.

ASiM Multi-Axis Functions

TM441

73

Cam Profile Automat

The following image illustrates the po sition curve of the labeling machine. The linear seg ments re pre se nt the synchronous sections. One label is app lied within each of these seg ments. Master and slave must mo ve at the speed in these se gmen ts so that the label can be evenly applied to the bottle.

synchronous sections

compensation phases

slaveposition

compensation

compensation

compensation

masterposition
compensation

Fig. 62: Poss ible cam profile for the labeling machine

The bo ttles are distributed evenly from one another (master period ). One bottle should be labeled per master period. The labels are also distributed evenly on the belt (slave period ). The slave synchronizes itself to the next bottle (if present) in the compensation phases. To do this, the slave mus t accelerate from standstill to the master speed starting at a specific ma ster position. If a trigger does not occur (no bottle), the n only a half compensation mo vement is performed in state 4 and then transferred to standstill. When the next bottle is prese nt, a half compensation mo vem ent is mad e again in state 2 (slave accelerates to master speed) and the label is applied.

74

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Note:

The "automat" task from the ACP10_MC sample project shows the application of the function for setting par ameters and controlling the cam profile au tomat within the framework of a complete procedure. All routines for preparing the drive and handling error s (comparable to the "basic" task) are contained in the program sequen ce. The familiar control struct ure is provided for op erating the procedures. Starting the automat in the "automat" task creates the functionality of a "mini labeling machine" see Automation Studio Online Help Cam Profile Automat Examples.<<

ASiM Multi-Axis Functions

TM441

75

Cam Profile Automat

5.4

Compensation gear As mentioned already, a compensation gea r can be used for each state. The compensation gear is an automatically calculated curve which compensates for po sition differences during a state transition and maintains a continuous connection of the cam profiles. The neces sary pa ram eter s are provided in the MC_BR_InitAutState fun ction block and in the <MC_AUTDATA_TYP>.State[x] data structure. (see 5.2.4 Defining the states)

Fig. 63 Compensation gear

The figure abo ve show s a compensation between two consecutive states (cam profiles). If compensation is used in a state, then the compensation movement is always performed before the cam profile of the state. These are the basis pa ram eter s for defining the compensation: Compensation mod e (CompMode) Ma ster compensation distance (MasterCompDistance) Slave compensation distance (SlaveCompDistance) The different compensation gear modes provide po ssibilities for compensating path as well as speed differences.

76

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

5.4.1 Compensation mod es Defining the exit point: The exit point is always at the end of the cam profile when using the event attribute ncST_END and within the curve or within the compensation where the event occurs when using ncAT_ONCE. ncOFF Compensation gear disabled. ncONLYCOMP The compensation distances are valid from the end point of the preceding state to the starting point of the cam profile in the next state.

Fig. 64: Compensation mod e ncONLYCOMP with event attribute ncST_ END

The configured compensation distances (g2/h2) are valid from the curve end point of the preceding state to the starting point of the cam profile in the next state. The rest of the cam profile from the exit point (change event) to the end of the cam profile is added to the configured compensation distance.

Event

Fig. 65: Compensation mod e ncONLYCOMP with event attribute ncAT_ONCE

ASiM Multi-Axis Functions

TM441

77

Cam Profile Automat

ncONLYCOMP_DIRECT The configured compensation distances (g2/h2) are valid, unlike the ncONLYCOMP mod e, from the exit point (event occurs) to the starting point of the cam profile in the next state.

Fig. 66: Compensation mod e ncONLYCOMP_DIRECT with event attribute ncAT_ONCE

ncWITH_CAM The configured compensation distances are based on the section starting at the middle of the first cam profile to the middle of the se cond cam profile. This offers the advantage that the ma ster and slave period s are not changed when the cam profile is scaled. In this case, the effective compensation distances (a2/b2) are bas ed on the section from the end point of the curve of the preceding state to the starting point of the cam profile in the next state and are then respectively shorter if the cam profile is scaled.

Fig. 67: Compensation mod e ncWITH_CAM with event attribute ncST_ END

78

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

In this case, the configured compensation distances (g2/h2) are also valid from the middle of the first cam profile to the middle of the second cam profile. Compensation starts when the event occurs and caus es the effective compensation distances (a2/b2) to be expanded to include the re st of the cam profile from the exit point (change event) to the end of the cam profile.

Event

Fig. 68: Compensation mod e ncWITH_CAM with event attribute ncAT_ONCE

ncMA_LATCHPOS The configured master compensation distance (g2) runs from the latch po sition to the middle of the next curve. The slave compensation distance (h2) is defined from "middle to middle curve", the same as for ncWITH_CAM. ncTRIGGER1, ncTRIGGER2 and ncS_START are supported as latch events for the ma ster set po sition.

Fig. 69: Compensation mod e ncMA_LATCHPOS with event attribute ncST_ END

The use of this compensation is an event controlled process ("cut after trigger") with fixed slave intervals.

ASiM Multi-Axis Functions

TM441

79

Cam Profile Automat

Two states are shown in the image above. A change event ncTRIGGER1 + ncP_EDGE with the event attribute ncST_END and target state "state 2" is defined for the first state. If the trigger event occurs in state 1, then the ma ster position is latched and the effective compensation distance (a2) is calculated for state 2. ncSL_LATCHPOS The configured slave compensation distance (h2) runs from the latch po sition to the middle of the next curve. The master compensation distance (g2) is defined from "midd le to middle of curve", the sam e as for ncWITH_CAM. ncTRIGGER1 and ncTRIGGER2 are suppo rted as latch even ts for the slave set position. The slave ParID that is latched is determined via the input parameter SlaveLatchParID of the FB MC_BR_InitAutPar.

Fig. 70: ncSL_LATCHPOS with event attribute ncST_ END

ncSL_ABS An absolute slave position is to be reached by means of a compensation ge ar. The ma ster compensation distance is specified relatively, like in the compensation mode ncONLYCOMP.

80

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Fig. 71: ncSL_ABS with event attribute ncST_ END

Modes for compensation of speed differences The three following mod es are use d to comp ensa te for spee d differences. The goal of this mo de is to achieve the slop e (speed) of the subsequen t cam profile while staying within the slave limits.

Fig. 72: Compensation of speed differences

The three compensation mod es differ from one another bas ed on the following properties: ncV_COMP_A_SL The configured compen sation distances have no influence here because the effective compensation distances are pro duced solely by adhering to the slave limits. As a result, the entran ce point of the subse quent cam profile is achieved in the fastes t way possible. ncV_COMP_S_MA

ASiM Multi-Axis Functions

TM441

81

Cam Profile Automat

The configured master compensation distance is maintained, the effective slave compensation distance is produced solely by adhering to the slave limits, regardless of the configured slave compensation distance. ncV_COMP_S_SL The configured slave compensation distance is maintained, the effective master compensation distance is pr oduced solely by adhering to the slave limits, regardless of the configured master compensation distance.

82

TM441

ASiM Multi-Axis Functions

Cam Profile Automat

Table of abbreviations in the compensation graphics The following parameters are use d to calculate the compensation because the compensation always runs from the exit point of the cam profile of the preceding state (state1) to the en trance point of the cam profile of the next state (state2): State1:
Abbreviati on k1x k1y a1 b1 c1 d1 r1 s1 l1 q1 m1 n1 o1 p1 Description Master multiplication factor AUT_MA_FACTOR Slave multiplication factor AUT_SL_FACTOR "effective" master compensation distance "effective" slave compensation distance Master curve period * k1x Slave curve period * k1y Relative master position in the active curve Relative slave position in the active curve s1 = k1y * curve function(r1 / k1x) Master latch position (set position) at time of trigger Slave latch position at time of trigger (AUT_SL_LATCH_ID) Master position (at the current automat calculation cycle) Slave position (at the current automat calculation cycle) Master curve end position Slave curve end position

State2:
Abbreviation k2x k2y a2 b2 c2 d2 g2 h2 u2 Description Master multiplication factor AUT_MA_FACTOR Slave multiplication factor AUT_SL_FACTOR "effective" master compensation distance "effective" slave compensation distance Master curve period * k2x Slave curve period * k2y Master compensation distance parameter AUT_COMP_MA_S Slave compensation distance parameter AUT_COMP_SL_S Master entrance position in the cam profile AUT_MA_CAM_LEADIN

ASiM Multi-Axis Functions

TM441

83

Summary

6.

SUMMARY The ACP10_MC library provides numerous functions for linking axis ob jects. The individual fun ction blocks are designed ba sed on the PLCopen Motion Control standar d and feature a uniform design regarding functional usage. With the electronic gear it is possible to implement linear position links, even with a defined starting point for the axes, if necess ary. Corresponding function blocks are also provided for non-linear position links via electronic cam profiles. As a result, the linking of different cam profiles is controlled by the application task. The creation of cam profiles is suppo rted by a cam profile editor in Automation Studio. Many different settings ma ke it eas y to adjust a cam profile to the process.

Fig. 73 Cartoning

The ACOPOS cam profile automa t is an extremely powerful tool for effective linking of cam profiles. The neces sar y sequen ces are completely predefined. Initialization of the automat struct ure and control of the automat mo de can be handled using clear and organized functions. After the cam profile automat is started, the defined se quences are pr ocessed on the ACOPOS fully independent. This reduces the load on the app lication pro gram and allows a very fast, event-controlled positioning sequence. The ACP10_MC multi-axis functions are subject to the effects of the states in the Motion Control diagram of states. The user receives the neces sary information for planning the seque nce here. The ACP10_MC sample project contains sample tasks for the individual linking applications and can be used as a mod el for creating a complete po sitioning app lication.

84

TM441

ASiM Multi-Axis Functions

Appendix

7.

APPENDIX

Motion Control Basic Functions (ACP10_MC):


Drive preparation: MC_Power MC_Home MC_BR_BrakeOperation MC_BR_InitMod Pod MC_BR_LoadAxisPar MC_BR_SaveAxisPar MC_BR_InitAxisPar MC_BR_InitAxisSubjectPar Basis movements: MC_MoveAbsolute MC_MoveAdditive MC_MoveVelocity MC_BR_MoveAbsoluteTriggStop MC_BR_MoveAdditiveTriggStop MC_BR_MoveVelocityTriggStop MC_BR_EventMoveAbsolute MC_BR_EventMoveAdd itive MC_BR_EventMoveVelocity MC_Stop MC_Halt MC_SetOverride Determining the drive status MC_ReadStatus MC_ReadActualPosition MC_ReadActualVelocity MC_ReadActualTorque Determining and acknowledging drive errors MC_ReadAxisError MC_Reset Digital input/output signals MC_ReadDigitalInput

ASiM Multi-Axis Functions

TM441

85

Appendix

MC_ReadDigitalOutput MC_WriteDigitalOutput MC_DigitalCamSwitch Position measurem en t MC_TouchProbe MC_BR_TouchProb e MC_AbortTrigg er

Motion Control Multi-axis Functions (ACP10_MC):


Electronic gears: MC_GearIn MC_GearInPos MC_GearOut MC_Phasing MC_BR_Phasing MC_BR_Offset Cam profiles: MC_CamTableSelect MC_CamIn MC_CamOut Cam profile automat: MC_BR_DownloadCamProfileObj MC_BR_DownloadCamProfileData MC_BR_InitAutPar MC_BR_InitAutState MC_BR_InitAutEvent MC_BR_AutControl

86

TM441

ASiM Multi-Axis Functions

You might also like