Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements 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 under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

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

Patent Pending

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

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others 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 a patent, utility model or design.


Overview

In many plants workpieces undergo machining operations while being transported. For this purpose it is necessary to synchronise the position and the speed of tool and workpiece, so that the tool can then be applied as if to a stationary workpiece. One example of such an application is a saw that during the transport process cuts through the material that is being transported (flying saw). In order to implement this kind of application, TwinCAT provides the flying saw.

The TwinCAT PLC library TcNcFlyingSaw.lib, available as an additional product, provides easy management of the flying saw. An example program using the flying saw makes use of this library.


MC_GearInPos

MC_GearInPos couples a slave axis to a master axis as a flying saw. The synchronisation velocity is achieved exactly at the synchronous position of the master and slave.

The interface to and function of this block is specified by the PLCopen. The block can therefore be seen as a supplement to the PLCopen Motion Control Library.

VAR_INPUT

VAR_INPUT
        Execute                  : BOOL;
        RatioNumerator   : LREAL  := 1;
        RatioDenominator   : UINT   := 1;
        MasterSyncPosition : LREAL;     (* absolute master synchronous position *)
        SlaveSyncPosition  : LREAL;     (* absolute slave synchronous position *)
        SyncMode           : ST_SyncMode;
        Velocity           : LREAL := 0;
        Acceleration       : LREAL;     (* 0 : use default value *)
        Deceleration       : LREAL;     (* 0 : use default value *)
        Jerk               : LREAL;     (* 0 : use default value *)
END_VAR

Execute : | Synchronisation begins with a rising edge.
RatioNumerator : | Numerator for the gearing factor (see note)
RatioDenominator : | Denominator for the gearing factor (see note)
MasterSyncPosition : | The master's synchronous position.
SlaveSyncPosition : | The slave's synchronous position.
SyncMode : | The boundary conditions for the synchronisation are specified in the SyncMode variables.
Velocity : | Maximum slave velocity in the synchronisation phase. If a velocity is not specified, the maximum velocity of the axis from the system manager data is used. Warning: The velocity given here is only checked if this checking is activated through the SyncMode variable (GearInSync_CheckMask_MaxVelo=TRUE).
Acceleration : | Maximum slave acceleration in the synchronisation phase. If an acceleration is not specified, the maximum acceleration of the axis from the system manager data is used. Warning: The acceleration given here is only checked if this checking is activated through the SyncMode variable (GearInSync_CheckMask_MaxAcc=TRUE).
Deceleration : | Maximum slave deceleration in the synchronisation phase. If a deceleration is not specified, the maximum deceleration of the axis from the system manager data is used. Warning: The deceleration given here is only checked if this checking is activated through the SyncMode variable (GearInSync_CheckMask_MaxDec=TRUE).
Jerk : | Maximum slave jerk in the synchronisation phase. If a jerk is not specified, the maximum jerk of the axis from the system manager data is used. Warning: The jerk given here is only checked if this checking is activated through the SyncMode variable (GearInSync_CheckMask_MaxJerk=TRUE).

Note:

If a gearing factor of 1:3 is wanted, the numerator is set to 1 and the denominator to 3. The numerator can also be assigned negative values.

The slave axis can be decoupled using the MC_GearOut function block from the TcMC Motion Control Library. If the slave is decoupled while it is moving, then it retains its velocity and can be halted using MC_Stop.

VAR_OUTPUT

VAR_OUTPUT
        StartSync       : BOOL;
        InSync          : BOOL;
        CommandAborted  : BOOL;
        Error           : BOOL;
        ErrorId                 : UDINT;
END_VAR

StartSync : | Becomes TRUE as soon as synchronisation starts.
InSync : | Becomes TRUE as soon as the slave has synchronised with the master.
CommandAborted : | Becomes TRUE, if the coupling could not be carried out.
Error : | Becomes TRUE, as soon as an error occurs.
ErrorID : | Supplies the error number when the ERR output is set

VAR_IN_OUT

VAR_IN_OUT
        Master  : NCTOPLC_AXLESTRUCT;
        Slave   : NCTOPLC_AXLESTRUCT;
END_VAR

Master : | Axis structure of the master.
Slave : | Axis structure of the slave.

Development environment | Target system type | PLC libraries to be linked
TwinCAT v2.9 | PC (i386) | TcNcFlyingSaw.Lib


MC_GearInVelo

MC_GearInVelo couples a slave axis to a master axis as a flying saw.

The interface to and function of this block is specified by the PLCopen. The block can therefore be seen as a supplement to the PLCopen Motion Control Library.

VAR_INPUT

VAR_INPUT
        Execute                 : BOOL;
        RatioNumerator  : LREAL                 := 1;
        RatioDenominator        : UINT          := 1;
        SyncMode                : ST_SyncMode;
        Velocity                : LREAL                 := 0;
        Acceleration    : LREAL;                        (* 0 : use default value *)
        Deceleration    : LREAL;                        (* 0 : use default value *)
        Jerk            : LREAL;                        (* 0 : use default value *)
END_VAR

Execute: | The rising edge starts the master-slave coupling as a flying saw.
RatioNumerator : | Numerator for the gearing factor. (See note)
RatioDenominato : | Denominator for the gearing factor. (See note)
SyncMode : | The boundary conditions for the synchronisation are specified in the SyncMode variables.
Velocity : | Maximum slave velocity in the synchronisation phase. If a velocity is not specified, the maximum velocity of the axis from the system manager data is used. Warning: The velocity given here is only checked if this checking is activated through the SyncMode variable.
Acceleration : | Maximum slave acceleration in the synchronisation phase. If an acceleration is not specified, the maximum acceleration of the axis from the system manager data is used. Warning: The acceleration given here is only checked if this checking is activated through the SyncMode variable.
Deceleration : | Maximum slave deceleration in the synchronisation phase. If a deceleration is not specified, the maximum deceleration of the axis from the system manager data is used. Warning: The deceleration given here is only checked if this checking is activated through the SyncMode variable.
Jerk : | Maximum slave jerk in the synchronisation phase. If a jerk is not specified, the maximum jerk of the axis from the system manager data is used. Warning: The jerk given here is only checked if this checking is activated through the SyncMode variable.

Note:

If a gearing factor of 1:3 is wanted, the numerator is set to 1 and the denominator to 3. The numerator can also be assigned negative values.

The slave axis can be decoupled using the MC_GearOut function block from the TcMC Motion Control Library. If the slave is decoupled while it is moving, then it retains its velocity and can be halted using MC_Stop.

VAR_OUTPUT

VAR_OUTPUT
        StartSync       : BOOL;
        InSync          : BOOL;
        CommandAborted  : BOOL;
        Error           : BOOL;
        ErrorId                 : UDINT;
END_VAR

StartSync : | Becomes TRUE as soon as synchronisation starts.
InSync : | Becomes TRUE as soon as the slave has synchronised with the master.
CommandAborted : | Becomes TRUE, if the coupling could not be carried out.
Error : | Becomes TRUE, as soon as an error occurs.
ErrorID : | Supplies the error number when the ERR output is set

VAR_IN_OUT

VAR_IN_OUT
        Master  : NCTOPLC_AXLESTRUCT;
        Slave   : NCTOPLC_AXLESTRUCT;
END_VAR

Master : | Axis structure of the master.
Slave : | Axis structure of the slave.

Development environment | Target system type | PLC libraries to be linked
TwinCAT v2.9 | PC (i386) | TcNcFlyingSaw.Lib


MC_ReadFlyingSawCharacteristics

The MC_ReadFlyingSawCharacteristics function allows the characteristic figures for the synchronisation phase of the Universal Flying Saw to be read.

VAR_INPUT

VAR_INPUT
        Execute : BOOL;
END_VAR
Execute: A rising edge initiates reading the characteristic values from the TwinCAT NC.

Note:

The data calculated is not available until the Universal Flying Saw starts.

VAR_OUTPUT

VAR_OUTPUT
        Done    : BOOL;
        Error   : BOOL;
        ErrorID : UDINT;
END_VAR

Done : | Is set to TRUE when the data record has been successfully read.
Error : | Becomes TRUE, as soon as an error occurs.
ErrorID : | Supplies the error number when the ERR output is set

VAR_IN_OUT

VAR_IN_OUT
        Slave                :  NCTOPLC_AXLESTRUCT;
        CamTableCharac: MC_FlyingSawCharacValues;
END_VAR

Slave : | Axis structure of the slave.
CamTableCharac: : | Structure containing the characteristic values.

Development environment | Target system type | PLC libraries to be linked
TwinCAT v2.9 | PC (i386) | TcNcFlyingSaw.Lib


The ST_SyncMode data structure

TYPE ST_SyncMode :
STRUCT
        (* mode *)
        GearInSyncMode : ST_GearInSyncMode;

        (* 32 bit check mask ... *)
        GearInSync_CheckMask_MinPos : BOOL;
        GearInSync_CheckMask_MaxPos : BOOL;
        GearInSync_CheckMask_MaxVelo : BOOL;
        GearInSync_CheckMask_MaxAcc : BOOL;
        GearInSync_CheckMask_MaxDec : BOOL;
        GearInSync_CheckMask_MaxJerk : BOOL;
        GearInSync_CheckMask_OvershootPos : BOOL;
        GearInSync_CheckMask_UndershootPos : BOOL;
        GearInSync_CheckMask_OvershootVelo : BOOL;
        GearInSync_CheckMask_UndershootVelo : BOOL;
        GearInSync_CheckMask_OvershootVeloZero : BOOL;
        GearInSync_CheckMask_UndershootVeloZero : BOOL;

        (* operation masks ... *)
        GearInSync_OpMask_RollbackLock : BOOL;
        GearInSync_OpMask_InstantStopOnRollback : BOOL;
        GearInSync_OpMask_PreferConstVelo : BOOL;
        GearInSync_OpMask_IgnoreMasterAcc : BOOL;
END_STRUCT
END_TYPE

TYPE ST_GearInSyncMode :
(
        GEARINSYNCMODE_POSITIONBASED,           (* synchronization based on the master position,
                                                   slave dynamics depend on master dynamics *)

        GEARINSYNCMODE_TIMEBASED                        (* synchronization based on a standalone slave PTP profile,
                                                   master independet slave dynamics *)
);
END_TYPE

Note : the time based synchronization profile (GEARINSYNCMODE_TIMEBASED) is actually only implemented in the MC_GearInVelo function block.

Operation of the individual bits.


FlyingSawCoupleOnPositon

FlyingSawCoupleOnPositon couples a slave axis to a master axis as a flying saw. The synchronisation speed is achieved precisely at the synchronisation point.

Interface

VAR_INPUT
    iAxisId        : UINT; (* Flying saw axis ID *)
    iMasterId      : UINT;
    fSyncPosMaster : LREAL; (* absolute master synchronous position *)
    fSyncPosSlave  : LREAL; (* absolute slave synchronous position *)
    fAngle         : LREAL; (* parallel = 90 degrees *)
    fGearRatio     : LREAL; (* 0.0 is invalid, then default is 1.0 *)
    bCoupleOn      : BOOL; (* couple *)
    bCoupleOff     : BOOL; (* decouple *)
    tTimeout       : TIME;
END_VAR
VAR_OUTPUT
    bBusy   : BOOL;
    bErr    : BOOL;
    iErrId  : UDINT;
END_VAR

iAxisId: Axis ID of the slave axis that is to be coupled as a flying saw

iMasterId: Axis ID of the master axis that is to be coupled to.

fSyncPosMaster : Synchronisation position of the master axis

fSyncPosSlave : Synchronisation position of the slave axis

fAngle : Angle of the flying saw (this is 90° for a parallel axis)

fGearRatio : Gearing factor. A gearing factor of 0 is invalid, and will be interpreted as 1

bCoupleOn: Edge-triggered signal for execution of the axis coupling.

bCoupleOff: Edge-triggered signal for uncoupling the axes.

tTimeout: ADS timeout (about 1 second).

bBusy: Becomes TRUE with a rising edge at bCoupleOn or bCoupleOff, and remains TRUE until the block has executed the command.

bErr: Becomes TRUE if an error occurs while executing the command.

bErrId: Error number (ADS or NC error number).


FlyingSawCoupleOnVelocity

FlyingSawCoupleOnVelocity couples a slave axis to a master axis as a flying saw. The synchronisation speed is reached as quickly as possible.

Interface

VAR_INPUT
    iAxisId     : UINT; (* Flying saw axis ID *)
    iMasterId   : UINT;
    fAngle      : LREAL; (* parallel = 90 degrees *)
    fGearRatio  : LREAL; (* 0.0 is invalid, then default is 1.0 *)
    bCoupleOn   : BOOL; (* couple *)
    bCoupleOff  : BOOL; (* decouple *)
    tTimeout    : TIME;
END_VAR
VAR_OUTPUT
    bBusy  : BOOL;
    bErr   : BOOL;
    iErrId : UDINT;
END_VAR

iAxisId: Axis ID of the slave axis that is to be coupled as a flying saw

iMasterId: Axis ID of the master axis that is to be coupled to.

fAngle : Angle of the flying saw (this is 90° for a parallel axis)

fGearRatio : Gearing factor. A gearing factor of 0 is invalid, and will be interpreted as 1

bCoupleOn: Edge-triggered signal for execution of the axis coupling.

bCoupleOff: Edge-triggered signal for uncoupling the axes.

tTimeout: ADS timeout (about 1 second).

bBusy: Becomes TRUE with a rising edge at bCoupleOn or bCoupleOff, and remains TRUE until the block has executed the command.

bErr: Becomes TRUE if an error occurs while executing the command.

bErrId: Error number (ADS or NC error number).


FlyingSawStop

FlyingSawStop stops a slave that has been coupled as a flying saw. The stop is carried out in the coupled state, so it can not therefore be initiated with the AXACT function block.

Interface

VAR_INPUT
    iAxisId   : UINT; (* Flying saw axis ID *)
    bExecute  : BOOL; (* Stop Flying Saw *)
    tTimeout  : TIME;
END_VAR
VAR_OUTPUT
    bBusy   : BOOL;
    bErr    : BOOL;
    iErrId  : UDINT;
END_VAR

iAxisId: Axis ID of the slave axis that is coupled as a flying saw

iMasterId: Axis ID of the master axis

bExecute: Edge-triggered signal for execution of the command.

tTimeout: ADS timeout (about 1 second).

bBusy: Becomes TRUE with a rising edge at bExecute, and remains TRUE until the block has executed the command.

bErr: Becomes TRUE if an error occurs while executing the command.

bErrId: Error number (ADS or NC error number).


Get_TcNcFlyingSaw_Version

Get_TcNcFlyingSaw_Version determines the version number of the PLC library TcNcFlyingSaw.lib. The function returns the version number in a string.

Interface

FUNCTION Get_TcNcFlyingSaw_Version: STRING(20)
VAR_INPUT
    bGet : BOOL;
END_VAR

bGet: Signal for execution of the command.