Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and...

39
Manual PLC Lib: Tc3_MC2_AdvancedHoming TwinCAT 3 1.2 2017-05-03 Version: Date:

Transcript of Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and...

Page 1: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Manual

PLC Lib: Tc3_MC2_AdvancedHoming

TwinCAT 3

1.22017-05-03

Version:Date:

Page 2: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in
Page 3: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Table of contents

PLC Lib: Tc3_MC2_AdvancedHoming 3Version: 1.2

Table of contents1 Foreword .................................................................................................................................................... 5

1.1 Notes on the documentation...........................................................................................................  51.2 Safety instructions ..........................................................................................................................  6

2 Overview..................................................................................................................................................... 72.1 Requirements .................................................................................................................................  72.2 Homing procedures ........................................................................................................................  82.3 Function blocks...............................................................................................................................  82.4 Structure of custom homing sequences .........................................................................................  8

3 Function blocks ......................................................................................................................................... 93.1 Parameter .......................................................................................................................................  93.2 Finalizing functions .........................................................................................................................  9

3.2.1 MC_FinishHoming.............................................................................................................. 93.2.2 MC_HomeDirect............................................................................................................... 103.2.3 MC_AbortHoming............................................................................................................. 11

3.3 Referencing functions ...................................................................................................................  123.3.1 MC_AbortPassiveHoming................................................................................................ 123.3.2 MC_StepReferenceFlyingRefPulse ................................................................................. 133.3.3 MC_StepReferenceFlyingSwitch ..................................................................................... 14

3.4 Step functions ...............................................................................................................................  153.4.1 MC_StepAbsoluteSwitch ................................................................................................. 153.4.2 MC_StepAbsoluteSwitchDetection .................................................................................. 173.4.3 MC_StepBlock ................................................................................................................. 193.4.4 MC_StepBlockDetection .................................................................................................. 213.4.5 MC_StepBlockLagBased ................................................................................................. 233.4.6 MC_StepBlockLagBasedDetection.................................................................................. 253.4.7 MC_StepLimitSwitch........................................................................................................ 273.4.8 MC_StepLimitSwitchDetection......................................................................................... 283.4.9 MC_StepReferencePulse ................................................................................................ 303.4.10 MC_StepReferencePulseDetection ................................................................................. 32

4 Data types ................................................................................................................................................ 344.1 General .........................................................................................................................................  34

4.1.1 E_HomingErrorCodes...................................................................................................... 344.1.2 MC_Home_Direction........................................................................................................ 344.1.3 MC_Ref_Signal_Ref ........................................................................................................ 354.1.4 MC_Switch_Mode............................................................................................................ 354.1.5 ST_Home_Options........................................................................................................... 364.1.6 ST_Home_Options2 ........................................................................................................ 364.1.7 ST_Home_Options3 ........................................................................................................ 364.1.8 ST_Home_Options4 ........................................................................................................ 36

4.2 Parameter .....................................................................................................................................  364.2.1 MC_HomingParameter .................................................................................................... 364.2.2 MC_HomingParameterCtrlMode...................................................................................... 374.2.3 MC_HomingParameterDrive............................................................................................ 374.2.4 MC_HomingParameterDriveGeneral ............................................................................... 374.2.5 MC_HomingParameterNc................................................................................................ 384.2.6 MC_HomingParameterNcGeneral ................................................................................... 38

5 Appendix .................................................................................................................................................. 395.1 Sample..........................................................................................................................................  39

Page 4: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Table of contents

PLC Lib: Tc3_MC2_AdvancedHoming4 Version: 1.2

Page 5: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Foreword

PLC Lib: Tc3_MC2_AdvancedHoming 5Version: 1.2

1 Foreword

1.1 Notes on the documentationThis description is only intended for the use of trained specialists in control and automation engineering whoare familiar with the applicable national standards.It is essential that the documentation and the following notes and explanations are followed when installingand commissioning the components. It is the duty of the technical personnel to use the documentation published at the respective time of eachinstallation and commissioning.

The responsible staff must ensure that the application or use of the products described satisfy all therequirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly underdevelopment.We reserve the right to revise and change the documentation at any time and without prior announcement.No claims for the modification of products that have already been supplied may be made on the basis of thedata, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC® and XTS® are registeredtrademarks of and licensed by Beckhoff Automation GmbH.Other designations used in this publication may be trademarks whose use by third parties for their ownpurposes could violate the rights of the owners.

Patent Pending

The EtherCAT Technology is covered, including but not limited to the following patent applications andpatents:EP1590927, EP1789857, DE102004044764, DE102007017835with corresponding applications or registrations in various other countries.

The TwinCAT Technology is covered, including but not limited to the following patent applications andpatents:EP0851348, US6167425 with corresponding applications or registrations in various other countries.

EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH,Germany

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.The reproduction, distribution and utilization of this document as well as the communication of its contents toothers without express authorization are prohibited.Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of apatent, utility model or design.

Page 6: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Foreword

PLC Lib: Tc3_MC2_AdvancedHoming6 Version: 1.2

1.2 Safety instructions

Safety regulations

Please note the following safety instructions and explanations!Product-specific safety instructions can be found on following pages or in the areas mounting, wiring,commissioning etc.

Exclusion of liability

All the components are supplied in particular hardware and software configurations appropriate for theapplication. Modifications to hardware or software configurations other than those described in thedocumentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.

Personnel qualification

This description is only intended for trained specialists in control, automation and drive engineering who arefamiliar with the applicable national standards.

Description of symbols

In this documentation the following symbols are used with an accompanying safety instruction or note. Thesafety instructions must be read carefully and followed without fail!

DANGER

Serious risk of injury!Failure to follow the safety instructions associated with this symbol directly endangers thelife and health of persons.

WARNING

Risk of injury!Failure to follow the safety instructions associated with this symbol endangers the life andhealth of persons.

CAUTION

Personal injuries!Failure to follow the safety instructions associated with this symbol can lead to injuries topersons.

Attention

Damage to the environment or devicesFailure to follow the instructions associated with this symbol can lead to damage to the en-vironment or equipment.

Note

Tip or pointerThis symbol indicates information that contributes to better understanding.

Page 7: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Overview

PLC Lib: Tc3_MC2_AdvancedHoming 7Version: 1.2

2 OverviewThe TwinCAT Motion Control PLC library Tc3_MC2_AdvancedHoming includes function blocks forprogramming machine applications. The Tc3_MC2_AdvancedHoming is based on the similarly revisedPLCopen specification for Motion Control function blocks V2.0. This library contains function blocks of Part 5– Homing Procedures (www.PLCopen.org).

TwinCAT Version

The Tc3_MC2_AdvancedHoming library can be used with TwinCAT version 3.1 Build 4020 or higher. Withremote programmed controllers care must be taken that an appropriate version is installed on both theprogrammer PC and the control PC. In the case of control systems with the operating system Windows CE,the version of the installed image is decisive.

2.1 RequirementsIn order to use referencing sequences that limit the torque or use the current torque as detection variable, itis necessary to ensure that the current torque is present and linked in the process image of the drivecontroller. In addition, in the dialog of the Nc drive on the parameter page under Torque and AccelerationScaling, the Input Scaling Factor (Actual Torque) must be > = 0.0 and set to the correct value (0.1 scalesthe value for the AX5000 in %):

Page 8: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Overview

PLC Lib: Tc3_MC2_AdvancedHoming8 Version: 1.2

2.2 Homing proceduresUntil now referencing procedures have been treated as separate sequences during the start phase of amachine or axis. The actual sequence was not visible to the user. In order to gain more control on thereferencing sequence itself, user-specific referencing procedures can now be programmed:

• HomeAbsoluteSwitch – homing to a sensor with movement range limit position sensors• HomeLimitSwitch – homing to a movement range limit position sensor• HomeBlock – homing to a mechanical fixed stop• HomeReferencePulse – homing to the zero track of an encoder• HomeDirect – static homing, position is set to the user position• HomeAbsolute - static homing, position is set to the position of a reference encoder

2.3 Function blocksIn order to give the user control over the various referencing procedures, a number of additional functionblocks (FBs) is defined. It is possible to describe complex referencing procedures by concatenating theseFBs.

"Step" function blocks

The following FBs are suitable for the homing procedures and are executed in the axis state "Homing" orplace the axis in this state. The axis state is not changed after completion, i.e. the axis remains in the"Homing" state afterwards.

• MC_StepAbsoluteSwitch / MC_StepAbsoluteSwitchDetection• MC_StepLimitSwitch / MC_StepLimitSwitchDetection• MC_StepBlock / MC_StepBlockDetection / MC_StepBlockLagBased /

MC_StepBlockLagBasedDetection• MC_StepReferencePulse / MC_StepReferencePulseDetection

Finalizing function blocks

These FBs lead to the final position and change the axis state from "Homing" to "Standstill".

• MC_HomeDirect• MC_HomeAbsolute• MC_FinishHoming• MC_AbortHoming

Function blocks for flying homing

In addition, FBs are required that can be executed while the machine is running. The axis state is not"Homing", nor is it changed to this state. These FBs therefore have no effect on the state diagram (cf.PLCopen). Like administrative FBs they can be called in any movement states.

• MC_StepReferenceFlyingSwitch• MC_StepReferenceFlyingRefPulse• MC_AbortPassiveHoming

2.4 Structure of custom homing sequencesUser-specific homing sequences can be created in a simple manner from the available function blocks. Notethat when doing so every sequence must always be ended by a finalizing FB so that, if necessary, modifiedparameters of the TwinCAT NC or the drive controller can be reconstructed and the "HomingState" is alsochanged correspondingly.

Page 9: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 9Version: 1.2

3 Function blocks

3.1 Parameter

3.2 Finalizing functions

3.2.1 MC_FinishHoming

Fig. 1:

To complete a homing sequence (not when using exclusively passive homing functions) it is necessary tocall a finalizing FB. The function block MC_FinishHoming completes a successful homing sequence andensures that modified parameters are reset to their original values. The axis leaves the homing state.

InputsVAR_INPUT    Execute      : BOOL;    Distance     : LREAL;    Velocity     : LREAL;    Acceleration : LREAL;    Deceleration : LREAL;    Jerk         : LREAL;    BufferMode   : MC_BufferMode;    Options      : ST_Home_Options2;END_VAR

Execute: The command is executed with a rising edge.

Distance: Distance by which the axis moves away from the current position.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0); if the value is 0, the default acceleration from the axis configuration for theXAE TwinCAT Engineering environment is used.

Deceleration: Deceleration (≥0). If the value is 0, the default deceleration from the axis configuration for theXAE TwinCAT Engineering environment is used.

Jerk: Jerk (≥0). If the value is 0, the default pressure from the axis configuration for the XAETwinCAT Engineering environment is used.

BufferMode: Currently not implemented

Options: DisableDriveAccess: Can be set to TRUE if not all required parameters are available on thehardware drive. NOTE! In this case it is the user's responsibility to ensure that the parametersrequired for the desired homing sequence are modified and reconstructed.

Page 10: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming10 Version: 1.2

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;     CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Also see about this2 MC_StepBlock [} 19]2 MC_AbortHoming [} 11]

3.2.2 MC_HomeDirect

To complete a homing sequence (not when using exclusively passive homing functions) it is necessary tocall a finalizing FB. The function block MC_HomeDirect completes a successful homing sequence, resets theaxis to a defined value and ensures that modified parameters are reset to their original values. The axisleaves the homing state.

InputsVAR_INPUT    Execute     : BOOL;    SetPosition : LREAL;    BufferMode  : MC_BufferMode;    Options     : ST_Home_Options2;END_VAR

Execute: The command is executed with a rising edge.

SetPosition: Position value to which the axis position is to be set.

BufferMode: Currently not implemented

Page 11: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 11Version: 1.2

Options: DisableDriveAccess: Can be set to TRUE if not all required parameters are available on thehardware drive. NOTE! In this case it is the user's responsibility to ensure that the parametersrequired for the desired homing sequence are modified and reconstructed.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.2.3 MC_AbortHoming

To complete a homing sequence (not when using exclusively passive homing functions) it is necessary tocall a finalizing FB. The function block MC_AbortHoming aborts a homing sequence and ensures thatmodified parameters are reset to their original values. The axis leaves the homing state.

InputsVAR_INPUT    Execute : BOOL;    Options : ST_Home_Options2;END_VAR

Execute: The command is executed with a rising edge.

Options: DisableDriveAccess: Can be set to TRUE if not all required parameters are available on thehardware drive. NOTE! In this case it is the user's responsibility to ensure that the parametersrequired for the desired homing sequence are modified and reconstructed.

Page 12: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming12 Version: 1.2

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;     CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.3 Referencing functions

3.3.1 MC_AbortPassiveHoming

InputsVAR_INPUT    Execute : BOOL;    Options : ST_Home_Options;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Options: Currently not used.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Page 13: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 13Version: 1.2

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis : AXIS_REF;END_VAR

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.3.2 MC_StepReferenceFlyingRefPulse

InputsVAR_INPUT    Execute         : BOOL;    ReferenceSignal : MC_Ref_Signal_Ref;    SetPosition     : LREAL;    TimeLimit       : TIME;    DistanceLimit   : LREAL;    BufferMode      : MC_BufferMode;    Options         : ST_Home_Options;END_VAR

Execute: The command is executed with a rising edge at input Execute.

ReferenceSignal: Configuration of the reference signal source

SetPosition: Position value to which the axis position is to be set

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

BufferMode: Currently not implemented

Options: Currently not used.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Page 14: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming14 Version: 1.2

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis : AXIS_REF;END_VAR

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.3.3 MC_StepReferenceFlyingSwitch

InputsVAR_INPUT    Execute         : BOOL;    ReferenceSignal : MC_Ref_Signal_Ref;    SetPosition     : LREAL;    TimeLimit       : TIME;    DistanceLimit   : LREAL;    BufferMode      : MC_BufferMode;    Options         : ST_Home_Options;END_VAR

Execute: The command is executed with a rising edge at input Execute.

ReferenceSignal: Configuration of the reference signal source

SetPosition: Position value to which the axis position is to be set

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

BufferMode: Currently not implemented

Options: Currently not used.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;

Page 15: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 15Version: 1.2

    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis : AXIS_REF;END_VAR

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.4 Step functions

3.4.1 MC_StepAbsoluteSwitch

InputsVAR_INPUT    Execute             : BOOL;    Direction           : MC_Home_Direction;    SwitchMode          : MC_Switch_Mode;    ReferenceSignal     : MC_Ref_Signal_Ref;    Velocity            : LREAL;    Acceleration        : LREAL;    Deceleration        : LREAL;    Jerk                : LREAL;    SetPosition         : LREAL;    TimeLimit           : TIME;    DistanceLimit       : LREAL;    TorqueLimit         : LREAL;    PositiveLimitSwitch : BOOL;    NegativeLimitSwitch : BOOL;

Page 16: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming16 Version: 1.2

    BufferMode          : MC_BufferMode;    Options             : ST_Home_Options4;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

SwitchMode: Enumeration that defines the final condition for the search procedure.

ReferenceSignal: This structure defines the source of the reference cam signal.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value in order to avoid mechanical damage.

PositiveLimitSwitch: Signal of the hardware limit switch in the logically positive movement direction(PositiveLimitSwitch = FALSE within the permissible movement range).

NegativeLimitSwitch: Signal of the hardware limit switch in the logically negative movement direction(NegativeLimitSwitch = FALSE within the permissible movement range).

BufferMode: Currently not implemented

Options:• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardware

drive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order toensure a smooth homing procedure. If it would be purposeful to keep the lag error monitoring active inan application, this can be achieved by setting this flag.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

Page 17: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 17Version: 1.2

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.4.2 MC_StepAbsoluteSwitchDetection

InputsVAR_INPUT    Execute             : BOOL;    Direction           : MC_Home_Direction;    SwitchMode          : MC_Switch_Mode;    ReferenceSignal     : MC_Ref_Signal_Ref;    Velocity            : LREAL;    Acceleration        : LREAL;    Deceleration        : LREAL;    Jerk                : LREAL;    TimeLimit           : TIME;    DistanceLimit       : LREAL;    TorqueLimit         : LREAL;    PositiveLimitSwitch : BOOL;    NegativeLimitSwitch : BOOL;    BufferMode          : MC_BufferMode;    Options             : ST_Home_Options4;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

SwitchMode: Enumeration that defines the final condition for the search procedure.

ReferenceSignal: This structure defines the source of the reference cam signal.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Page 18: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming18 Version: 1.2

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value in order to avoid mechanical damage.

PositiveLimitSwitch: Signal of the hardware limit switch in the logically positive movement direction(PositiveLimitSwitch = FALSE within the permissible movement range).

NegativeLimitSwitch: Signal of the hardware limit switch in the logically negative movement direction(NegativeLimitSwitch = FALSE within the permissible movement range).

BufferMode: Currently not implemented

Options• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardware

drive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order toensure a smooth homing procedure. If it would be purposeful to keep the lag error monitoring active inan application, this can be achieved by setting this flag.

OutputsVAR_OUTPUT    Done             : BOOL;    Busy             : BOOL;    Active           : BOOL;    CommandAborted   : BOOL;    Error            : BOOL;    ErrorID          : UDINT;    RecordedPosition : LREAL;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

RecordedPosition : Axis position at which the event was recorded.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 19: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 19Version: 1.2

3.4.3 MC_StepBlock

InputsVAR_INPUT    Execute                : BOOL;    Direction              : MC_Home_Direction;    Velocity               : LREAL;    Acceleration           : LREAL;    Deceleration           : LREAL;    Jerk                   : LREAL;    SetPosition            : LREAL;    DetectionVelocityLimit : LREAL;    DetectionVelocityTime  : TIME;    TimeLimit              : TIME;    DistanceLimit          : LREAL;    TorqueLimit            : LREAL;    TorqueTolerance        : LREAL;    BufferMode             : MC_BufferMode;    Options                : ST_Home_Options3;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

DetectionVelocityLimit: Velocity that must be fallen below for the time DetectionVelocityTime in order todetect driving against the fixed stop

DetectionVelocityTime: Time for detecting the velocity undershoot when driving against the fixed stop.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value, in relation to the weight counterbalance that ispossibly parameterized in the drive, in order to avoid mechanical damage.

TorqueTolerance: Tolerance related to the TorqueLimit within which driving against the fixed stop isdetected.

Page 20: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming20 Version: 1.2

BufferMode: Currently not implemented

Options:

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• InstantLagReduction: When homing to a mechanical fixed stop, the sudden stop produces a positionlag in the NC axis, which is dissipated with the parameterized dynamic values in the further course.This can lead to an assumed delay when observing the sequence, but it is purposeful in particular with"soft" fixed stops. The position lag is dissipated abruptly by setting this flag.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 21: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 21Version: 1.2

3.4.4 MC_StepBlockDetection

InputsVAR_INPUT    Execute                : BOOL;    Direction              : MC_Home_Direction;    Velocity               : LREAL;    Acceleration           : LREAL;    Deceleration           : LREAL;    Jerk                   : LREAL;    DetectionVelocityLimit : LREAL;    DetectionVelocityTime  : TIME;    TimeLimit              : TIME;    DistanceLimit          : LREAL;    TorqueLimit            : LREAL;    TorqueTolerance        : LREAL;    BufferMode             : MC_BufferMode;    Options                : ST_Home_Options3;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

DetectionVelocityLimit: Velocity that must be fallen below for the time DetectionVelocityTime in order todetect driving against the fixed stop

DetectionVelocityTime: Time for detecting the velocity undershoot when driving against the fixed stop.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value, in relation to the weight counterbalance that ispossibly parameterized in the drive, in order to avoid mechanical damage.

TorqueTolerance: Tolerance related to the TorqueLimit within which driving against the fixed stop isdetected.

BufferMode: Currently not implemented

Page 22: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming22 Version: 1.2

Options:

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• InstantLagReduction: When homing to a mechanical fixed stop, the sudden stop produces a positionlag in the NC axis, which is dissipated with the parameterized dynamic values in the further course.This can lead to an assumed delay when observing the sequence, but it is purposeful in particular with"soft" fixed stops. The position lag is dissipated abruptly by setting this flag.

OutputsVAR_OUTPUT    Done             : BOOL;    Busy             : BOOL;    Active           : BOOL;    CommandAborted   : BOOL;    Error            : BOOL;    ErrorID          : UDINT;    RecordedPosition : LREAL;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

RecordedPosition : Axis position at which the event was recorded.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 23: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 23Version: 1.2

3.4.5 MC_StepBlockLagBased

InputsVAR_INPUT    Execute                : BOOL;    Direction              : MC_Home_Direction;    Velocity               : LREAL;    Acceleration           : LREAL;    Deceleration           : LREAL;    Jerk                   : LREAL;    SetPosition            : LREAL;    DetectionVelocityLimit : LREAL;    DetectionVelocityTime  : TIME;    TimeLimit              : TIME;    DistanceLimit          : LREAL;    TorqueLimit            : LREAL;    LagLimit               : LREAL;    BufferMode             : MC_BufferMode;    Options                : ST_Home_Options3;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

DetectionVelocityLimit: Velocity that must be fallen below for the time DetectionVelocityTime in order todetect driving against the fixed stop

DetectionVelocityTime: Time for detecting the velocity undershoot when driving against the fixed stop.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value, in relation to the weight counterbalance that ispossibly parameterized in the drive, in order to avoid mechanical damage.

LagLimit: Position lag value which, if exceeded, leads to detection of driving against the fixed stop.

Page 24: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming24 Version: 1.2

BufferMode: Currently not implemented

Options:• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardware

drive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• InstantLagReduction: When homing to a mechanical fixed stop, the sudden stop produces a positionlag in the NC axis, which is dissipated with the parameterized dynamic values in the further course.This can lead to an assumed delay when observing the sequence, but it is purposeful in particular with"soft" fixed stops. The position lag is dissipated abruptly by setting this flag.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 25: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 25Version: 1.2

3.4.6 MC_StepBlockLagBasedDetection

InputsVAR_INPUT    Execute                : BOOL;    Direction              : MC_Home_Direction;    Velocity               : LREAL;    Acceleration           : LREAL;    Deceleration           : LREAL;    Jerk                   : LREAL;    SetPosition            : LREAL;    DetectionVelocityLimit : LREAL;    DetectionVelocityTime  : TIME;    TimeLimit              : TIME;    DistanceLimit          : LREAL;    TorqueLimit            : LREAL;    LagLimit               : LREAL;    BufferMode             : MC_BufferMode;    Options                : ST_Home_Options3;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

DetectionVelocityLimit: Velocity that must be fallen below for the time DetectionVelocityTime in order todetect driving against the fixed stop

DetectionVelocityTime: Time for detecting the velocity undershoot when driving against the fixed stop.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value, in relation to the weight counterbalance that ispossibly parameterized in the drive, in order to avoid mechanical damage.

LagLimit: Position lag value which, if exceeded, leads to detection of driving against the fixed stop.

BufferMode: Currently not implemented

Page 26: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming26 Version: 1.2

Options:

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• InstantLagReduction: When homing to a mechanical fixed stop, the sudden stop produces a positionlag in the NC axis, which is dissipated with the parameterized dynamic values in the further course.This can lead to an assumed delay when observing the sequence, but it is purposeful in particular with"soft" fixed stops. The position lag is dissipated abruptly by setting this flag.

OutputsVAR_OUTPUT    Done             : BOOL;    Busy             : BOOL;    Active           : BOOL;    CommandAborted   : BOOL;    Error            : BOOL;    ErrorID          : UDINT;    RecordedPosition : LREAL;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

RecordedPosition : Axis position at which the event was recorded.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 27: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 27Version: 1.2

3.4.7 MC_StepLimitSwitch

InputsVAR_INPUT    Execute           : BOOL;    Direction         : MC_Home_Direction;    LimitSwitchMode   : MC_Switch_Mode;    LimitSwitchSignal : MC_Ref_Signal_Ref;    Velocity          : LREAL;    Acceleration      : LREAL;    Deceleration      : LREAL;    Jerk              : LREAL;    SetPosition       : LREAL;    TimeLimit         : TIME;    DistanceLimit     : LREAL;    TorqueLimit       : LREAL;    BufferMode        : MC_BufferMode;    Options           : ST_Home_Options4;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

LimitSwitchMode: Enumeration that defines the final condition for the search procedure.

LimitSwitchSignal: This structure defines the source of the reference cam signal.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value in order to avoid mechanical damage.

BufferMode: Currently not implemented

Options:

Page 28: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming28 Version: 1.2

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order toensure a smooth homing procedure. If it would be purposeful to keep the lag error monitoring active inan application, this can be achieved by setting this flag.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.4.8 MC_StepLimitSwitchDetection

InputsVAR_INPUT    Execute           : BOOL;    Direction         : MC_Home_Direction;

Page 29: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 29Version: 1.2

    LimitSwitchMode   : MC_Switch_Mode;    LimitSwitchSignal : MC_Ref_Signal_Ref;    Velocity          : LREAL;    Acceleration      : LREAL;    Deceleration      : LREAL;    Jerk              : LREAL;    TimeLimit         : TIME;    DistanceLimit     : LREAL;    TorqueLimit       : LREAL;    BufferMode        : MC_BufferMode;    Options           : ST_Home_Options4;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

LimitSwitchMode: Enumeration that defines the final condition for the search procedure.

LimitSwitchSignal: This structure defines the source of the reference cam signal.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value in order to avoid mechanical damage.

BufferMode.Currently not implemented

Options:

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order toensure a smooth homing procedure. If it would be purposeful to keep the lag error monitoring active inan application, this can be achieved by setting this flag.

OutputsVAR_OUTPUT    Done             : BOOL;    Busy             : BOOL;    Active           : BOOL;    CommandAborted   : BOOL;    Error            : BOOL;    ErrorID          : UDINT;    RecordedPosition : LREAL;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

Page 30: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming30 Version: 1.2

ErrorID: If the error output is set, this parameter supplies the error number.

RecordedPosition : Axis position at which the event was recorded.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

3.4.9 MC_StepReferencePulse

InputsVAR_INPUT    Execute         : BOOL;    Direction       : MC_Home_Direction;    SwitchMode      : MC_Switch_Mode;    ReferenceSignal : MC_Ref_Signal_Ref;    Velocity        : LREAL;    Acceleration    : LREAL;    Deceleration    : LREAL;    Jerk            : LREAL;    SetPosition     : LREAL;    TimeLimit       : TIME;    DistanceLimit   : LREAL;    TorqueLimit     : LREAL;    BufferMode      : MC_BufferMode;    Options         : ST_Home_Options4;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

SwitchMode: Enumeration that defines the final condition for the search procedure.

ReferenceSignal: This structure defines the source of the reference cam signal.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Page 31: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 31Version: 1.2

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value in order to avoid mechanical damage.

BufferMode: Currently not implemented

Options:

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

• EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order toensure a smooth homing procedure. If it would be purposeful to keep the lag error monitoring active inan application, this can be achieved by setting this flag.

OutputsVAR_OUTPUT    Done           : BOOL;    Busy           : BOOL;    Active         : BOOL;    CommandAborted : BOOL;    Error          : BOOL;    ErrorID        : UDINT;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 32: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming32 Version: 1.2

3.4.10 MC_StepReferencePulseDetection

InputsVAR_INPUT    Execute         : BOOL;    Direction       : MC_Home_Direction;    SwitchMode      : MC_Switch_Mode;    ReferenceSignal : MC_Ref_Signal_Ref;    Velocity        : LREAL;    Acceleration    : LREAL;    Deceleration    : LREAL;    Jerk            : LREAL;    TimeLimit       : TIME;    DistanceLimit   : LREAL;    TorqueLimit     : LREAL;    BufferMode      : MC_BufferMode;    Options         : ST_Home_Options4;END_VAR

Execute: The command is executed with a rising edge at input Execute.

Direction: Enumeration that defines the initial direction of movement for the search procedure.

SwitchMode: Enumeration that defines the final condition for the search procedure.

ReferenceSignal: This structure defines the source of the reference cam signal.

Velocity: Maximum travel velocity (>0).

Acceleration: Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in theSystem Manager is used.

Deceleration: Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in theSystem Manager is used.

Jerk: Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

SetPosition: Position value to which the axis position is to be set.

TimeLimit: Exceeding this time leads to the search procedure being aborted.

DistanceLimit: Exceeding this distance in relation to the start position leads to the search procedure beingaborted.

TorqueLimit: The motor torque is limited to this value in order to avoid mechanical damage.

BufferMode: Currently not implemented

Options:

• DisableDriveAccess: Can be set to TRUE if not all required parameters are available on the hardwaredrive. NOTE! In this case it is the user's responsibility to ensure that the parameters requiredfor the desired homing sequence are modified and reconstructed.

Page 33: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Function blocks

PLC Lib: Tc3_MC2_AdvancedHoming 33Version: 1.2

• EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order toensure a smooth homing procedure. If it would be purposeful to keep the lag error monitoring active inan application, this can be achieved by setting this flag.

OutputsVAR_OUTPUT    Done             : BOOL;    Busy             : BOOL;    Active           : BOOL;    CommandAborted   : BOOL;    Error            : BOOL;    ErrorID          : UDINT;    RecordedPosition : LREAL;END_VAR

Done: Becomes TRUE, if the command was completed successfully.

Busy: The Busy output becomes TRUE when the command is started with Execute and remains TRUE aslong as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active: Indicates that the command is executed.

CommandAborted: Becomes TRUE, if the command could not be fully executed.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID: If the error output is set, this parameter supplies the error number.

RecordedPosition : Axis position at which the event was recorded.

Inputs/outputsVAR_IN_OUT    Axis      : AXIS_REF;    Parameter : MC_HomingParameter;END_VAR

Parameter: Data structure of the type MC_HomingParameter [} 36], which must be transferred fromfunction block to function block over the entire homing sequence.

Axis: Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Amongother parameters it contains the current axis status, including position, velocity or error status.

Page 34: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Data types

PLC Lib: Tc3_MC2_AdvancedHoming34 Version: 1.2

4 Data types

4.1 General

4.1.1 E_HomingErrorCodesTYPE MC_Switch_Mode :(    MC_HOMINGERROR_DRIVETYPE               := 16#4B90,    MC_HOMINGERROR_DIRECTION               := 16#4B91,    MC_HOMINGERROR_SWITCHMODE              := 16#4B92,    MC_HOMINGERROR_MODE                    := 16#4B93,    MC_HOMINGERROR_TORQUEPARAMETER         := 16#4B94,    MC_HOMINGERROR_LAGPARAMETER            := 16#4B95,    MC_HOMINGERROR_DISTANCELIMIT           := 16#4B96,    MC_HOMINGERROR_PARAMETER_ALREADYSTORED := 16#4B97,    MC_HOMINGERROR_PARAMETER_NOTSTORED     := 16#4B98) UDINT;END_TYPE

MC_HOMINGERROR_DRIVETYPE: The following drives are supported:

• AX5xxx-xxxx-02xx (FW>=2.05)• EL7201-0000 /-0001 / -0010 / 0011• AX8xxx-xxxx-xxxx (FW>=???)

MC_HOMINGERROR_DIRECTION: Parameterized direction is not permissible for this function block.

MC_HOMINGERROR_SWITCHMODE: Parameterized mode is not permissible for this function block.

MC_HOMINGERROR_MODE:

MC_HOMINGERROR_TORQUEPARAMETER: Parameterized torque presets are not permissible.

MC_HOMINGERROR_LAGPARAMETER: Parameterized position lag is not permissible (<0)

MC_HOMINGERROR_DISTANCELIMIT: Parameterized maximum distance is not permissible (<0)

MC_HOMINGERROR_PARAMETER_ALREADYSTORED: The MC_StepHomingParameter function blockhas been called again with the HOMINGPARAMETERCTRLMODE_READ mode, although parameters havealready been backed up.

MC_HOMINGERROR_PARAMETER_NOTSTORED: The MC_StepHomingParameter function block hasbeen called again with the HOMINGPARAMETERCTRLMODE_RESTORE mode, although no parametershave been backed up.

4.1.2 MC_Home_DirectionTYPE MC_Home_Direction :(    mcPositiveDirection := 1,    mcNegativeDirection := 3,    mcSwitchPositive    := 5,    mcSwitchNegative    := 7);END_TYPE

mcPositiveDirection: Movement always starts in the logically positive movement direction. The movementdirection can be reversed on reaching a movement range limit sensor or on reaching the precondition andwhen using mcRisingEdgeInverse or mcFallingEdgeInverse for the input of the type MC_Switch_Modeexisting in some function blocks.

Page 35: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Data types

PLC Lib: Tc3_MC2_AdvancedHoming 35Version: 1.2

mcNegativeDirection: Movement always starts in the logically negative movement direction. The movementdirection can be reversed on reaching a movement range limit sensor or on reaching the precondition andwhen using mcRisingEdgeInverse or mcFallingEdgeInverse for the input of the type MC_Switch_Modeexisting in some function blocks.

mcSwitchPositive: The direction of movement at the start depends on the current switching state of thesensor.

• If the switching state of the sensor is OFF, the movement starts in the logically positive direction ofmovement

• If the switching state of the sensor is ON, the movement starts in the logically negative direction.

The movement direction can be reversed on reaching a movement range limit sensor or when the sensorswitching state changes.

mcSwitchNegative: The direction of movement at the start depends on the current switching state of thesensor.

• If the switching state of the sensor is OFF, the movement starts in the logically negative direction ofmovement.

• If the switching state of the sensor is ON, the movement starts in the logically negative direction.

The movement direction can be reversed on reaching a movement range limit sensor or when the sensorswitching state changes.

4.1.3 MC_Ref_Signal_RefTYPE MC_Ref_Signal_Ref :STRUCT    SignalSource : E_SignalSource := SignalSource_Default;    TouchProbe   : E_TouchProbe   := PlcEvent;    Level        : BOOL;END_STRUCTEND_TYPE

SignalSource: Optionally defines the signal source, if it can be selected via the controller. In many cases thesignal source is permanently configured in the drive and should then be set to the default valueSignalSource_Default.

(cf. E_SignalSource Tc2_MC2 library documentation)

TouchProbe: Defines the latch unit (probe unit) within the encoder hardware used.

(cf. E_TouchProbe Tc2_MC2 library documentation)

Level: The current switching state of the sensor must be transferred here.

4.1.4 MC_Switch_ModeTYPE MC_Switch_Mode :(    mcOn                  := 1,    mcOff                 := 2,    mcRisingEdge          := 3,    mcFallingEdge         := 4,    mcEdgeSwitchPositive  := 5,    mcEdgeSwitchNegative  := 6,    mcRisingEdgeInverse   := 11,    mcFallingEdgeInverse  := 12) UDINT;END_TYPE

Page 36: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Data types

PLC Lib: Tc3_MC2_AdvancedHoming36 Version: 1.2

4.1.5 ST_Home_OptionsTYPE MC_Home_Options :STRUCT

END_STRUCTEND_TYPE

4.1.6 ST_Home_Options2TYPE MC_Home_Options2 :STRUCT    DisableDriveAccess : BOOL;END_STRUCTEND_TYPE

DisableDriveAccess: When setting this flag, no modifications are made to the parameters of the hardwarecontroller and the user is responsible for modifying them to an appropriate extent so that the actual homingprocedure is possible.

4.1.7 ST_Home_Options3TYPE MC_Home_Options3 :STRUCT    DisableDriveAccess  : BOOL;    InstantLagReduction : BOOL;END_STRUCTEND_TYPE

DisableDriveAccess: When setting this flag, no modifications are made to the parameters of the hardwarecontroller and the user is responsible for modifying them to an appropriate extent so that the actual homingprocedure is possible.

InstantLagReduction: When homing to a mechanical fixed stop, the sudden stop produces a position lag inthe NC axis, which is dissipated with the parameterized dynamic values in the further course. This can leadto an assumed delay when observing the sequence, but it is purposeful in particular with "soft" fixed stops.The position lag is dissipated abruptly by setting this flag.

4.1.8 ST_Home_Options4TYPE MC_Home_Options4 :STRUCT    DisableDriveAccess      : BOOL;    EnableLagErrorDetection : BOOL;END_STRUCTEND_TYPE

DisableDriveAccess: When setting this flag, no modifications are made to the parameters of the hardwarecontroller and the user is responsible for modifying them to an appropriate extent so that the actual homingprocedure is possible.

EnableLagErrorDetection: In the step functions the lag error monitoring is switched off in order to ensure asmooth homing procedure. If it would be purposeful to keep the lag error monitoring active in an application,this can be achieved by setting this flag.

4.2 Parameter

4.2.1 MC_HomingParameterTYPE MC_HomingParameter :STRUCT    Stored : BOOL;    Nc     : MC_HomingParameterNcGeneral;

Page 37: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Data types

PLC Lib: Tc3_MC2_AdvancedHoming 37Version: 1.2

    Drive  : MC_HomingParameterDriveGeneral;END_STRUCTEND_TYPE

Stored: This flag signals that the required parameters that are to be modified have been successfully readand are available for reconstruction at the end of the procedure.

Nc: Structure that contains the stored and modified parameter values of the NC axis

Drive: Structure that contains the stored and modified parameter values of the hardware axis controller.

This structure must be made available to and passed through all homing function blocks when programmingyour own homing sequence. Parameters are backed up in advance, modified by the function blocks andrestored upon completion of the procedure.

4.2.2 MC_HomingParameterCtrlModeTYPE MC_HomingParameterCtrlMode :(    HOMINGPARAMETERCTRLMODE_READ,    HOMINGPARAMETERCTRLMODE_PREPARE,    HOMINGPARAMETERCTRLMODE_RESTORE) UDINT;END_TYPE

HOMINGPARAMETERCTRLMODE_READ: This function block reads all relevant parameters of the NC axisand the hardware axis controller.

HOMINGPARAMETERCTRLMODE_PREPARE: This function block modifies all relevant parameters of theNC axis and the hardware axis controller.

The parameters to be modified must be written to the parameter structure beforehand.

HOMINGPARAMETERCTRLMODE_RESTORE: This function block restores the backed-up parameters ofthe NC axis and the hardware axis controller.

The requirement is that the parameters have been successfully read beforehand.

4.2.3 MC_HomingParameterDriveTYPE MC_HomingParameterDrive :STRUCT    TorqueMaxBipolar  : LREAL;    TorqueMaxPositive : LREAL;    TorqueMaxNegative : LREAL;END_STRUCTEND_TYPE

TorqueMaxBipolar: Bipolar torque limit value

TorqueMaxPositive: Torque limit value in the logically positive movement direction

TorqueMaxPositive: Torque limit value in the logically negative movement direction

4.2.4 MC_HomingParameterDriveGeneralSTRUCT    Stored : MC_HomingParameterDrive;    Actual : MC_HomingParameterDrive;END_STRUCTEND_TYPE

Stored: Stored parameters for the start of the homing procedure

Actual: Modified values that vary during the procedure

Page 38: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Data types

PLC Lib: Tc3_MC2_AdvancedHoming38 Version: 1.2

4.2.5 MC_HomingParameterNcTYPE MC_HomingParameterNc :STRUCT    EnableSoftEndMinControl : BOOL;    EnableSoftEndMaxControl : BOOL;    EnablePosDiffControl    : BOOL;    EnableVeloDiffControl   : BOOL;END_STRUCTEND_TYPE

EnableSoftEndMinControl: Activation of the software limit position monitoring in the logically positivedirection

EnableSoftEndMaxControl: Activation of the software limit position monitoring in the logically negativedirection

EnablePosDiffControl: Activation of the position lag monitoring

EnableVeloDiffControl: Activation of the movement monitoring

4.2.6 MC_HomingParameterNcGeneralSTRUCT    Stored : MC_HomingParameterNc;    Actual : MC_HomingParameterNc;END_STRUCTEND_TYPE

Stored: Stored NC parameters for the start of the homing procedure

Actual: Modified NC parameters that vary during the procedure

Page 39: Manual PLC Lib: Tc3 MC2 AdvancedHoming · Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in

Appendix

PLC Lib: Tc3_MC2_AdvancedHoming 39Version: 1.2

5 Appendix

5.1 SampleUnder preparation...