MCA_CamInDirect (FB)

FUNCTION_BLOCK MCA_CamInDirect

This function block implements Camming-Functionality. A slave axis is coupled to a master axis by a position/position relation.

../../../../../../_images/plcopen.png
  • It is not required that the master is stationary.

  • If the actual master and slave positions do not correspond to the offset values when MC_CamIn is executed, either an error occurs or the system deals with the difference automatically.

  • The Cam is placed either absolute or relative to the current master and slave positions:

  • Absolute: The profile between master and slave is seen as an absolute relationship.

  • Relative: The relationship between master and slave is in a relative mode.

  • If a cam-table is to be used “relative”, the first position has to be zero.

  • This function block is not merged with the MC_CamTableSelect function block because this separation enables changes on the fly.

  • A mechanical analogy to a slave offset is a cam welded with additional constant layer thickness. Because of this the slave positions have a constant offset and the offset could be interpreted as axis offset of the master shaft, if linear guided slave tappets are assumed.

Note

The Slave axis is not ramped out, which means the curve should end with velocity = 0. The CAM could be interrupted with any other function block, according to the statemachine. It is not required to use MC_CamOut.

The function block behaves as follows:

  • If the master is inside the position range which is described in the cam-table data, synchronization starts right away, no matter if the master moves or is in standstill.

  • If the master is outside the position range which is described in the cam-table data, the slave position is not modifed.

  • The synchronization is limited by the given Velocity and Acceleration, achieved as fast as possible. The function block will show InSync when synchronization process is completed and the slave axes reference position matches the cam-table data for the current master position.

  • In a modulo-axis, it is possible to reach the synchronization point in different directions. The input parameter SyncDirection with its possible values: POSITIVE, NEGATIVE or SHORTEST can be used to set this direction. Inside the SyncWindow, automatically the direction SHORTEST will be used.

  • It is important to set a SyncWindow > 0 for a modulo axis, otherwise, slightest deviations could result in moving a complete modulo distance.

  • Inside SyncWindow, the slave axis will move SHORTEST to reach the SlaveSyncPosition

  • Outside SyncWindow, it will move the given SyncDirection, which can be POSITIVE or NEGATIVE

  • If a direction POSITIVE or NEGATIVE is used in a linear axis, the slave will wait until the master reaches position which allows the slave to move the required direction.

Note

The MCA_CamInDirect has parameters to scale the cam-table values (MasterScaling, SlaveScaling). It has to be considered that MasterOffset and SlaveOffset are scaled exactly like the corresponding cam-table values. The MasterSyncPosition and MasterStartDistance are not scaled at all, these positions are related to the actual master position whereas the MasterOffset and SlaveOffset are related to the camtable.

Note

New set of values at inputs MasterOffset, SlaveOffset, MasterScaling, SlaveScaling will be accepted only after the function block is aborted and fresh rising edge is provided at Execute input.

Note

The default behavior of this function block can be modified by the inputs in function MCA_Cam_Extra

Note

A negative MasterScaling requires backward master movement, when combined with MasterOffset. The MasterScaling also applies to the MasterOffset. Behaviour results from the requirement to have ascending master values in CamTable.

Note

User can utilize CAM editor in Automation builder to generate Cam table (MC_PProfile) automatically. For more details refer to Automation builder help.

InOut:

Scope

Name

Type

Initial

Comment

Input

Execute

BOOL

Starts the Function Block at rising edge

MasterOffset

LREAL

0

Offset of master table. Actual position - MasterOffset will be used to sample the CamTable

SlaveOffset

LREAL

0

Offset of slave table. Sharpened cam (i.e higher elevation and deeper depression). Use the result from CamTable + SlaveOffset as reference position

MasterScaling

LREAL

1

Scaling factor for master positions in CamTable. From the slave point of view the master overall profile is multiplied by this factor

SlaveScaling

LREAL

1

Scaling factor for slave positions from CamTable. The overall slave profile is multiplied by this factor

MasterValueSource

MC_Source

Defines the source for synchronization: mcSetValue - Synchronization on master set value. mcActualValue - Synchronization on master actual value

SyncDirection

MC_Direction

Moving direction for the slave to start the movement. Applicable: POSITIVE or NEGATIVE, use SHORTEST for any other value

SyncWindow

LREAL

[u], Used to determine the moving direction, combined with SyncDirection
  • When the slave is outside the SyncWindow, it will move the direction which is given in SyncDirection

  • When the slave is inside the SyncWindow, it will move SHORTEST to meet the SlaveSyncPosition

Velocity

LREAL

[u/s] Used for Synchronization. Range: >=0, max application velocity (Parameter9) used as default

The slave has to be able to move faster than the master axis, otherwise it is possible the SlaveSyncPosition is never reached when the master starts to move

Acceleration

LREAL

[u/s°°2] Used for Synchronization. Range: >0,If value = 0, Acceleration will be equal to parameter paraMaxVelocityAppl.If value > 0 and <= 1,Acceleration will be limited to 1.

BufferMode

MC_BufferMode

Not supported, default mcABORTING used

Output

InSync

BOOL

Slave is synchronized to CamTable

Done

BOOL

Shows the status of the function block. Done = TRUE if the execution is finished

Busy

BOOL

The function block is not finished

Active

BOOL

Indicates that the function block has control on the axis

CommandAborted

BOOL

Command is aborted by another command from other PLCopen function block

Error

BOOL

Signals that error has occurred within function block

ErrorID

ERROR_ID

Error identification. For error details refer to Enumeration ERROR_ID

EndOfProfile

BOOL

Pulsed output signaling the cyclic end of the CAM profile. It is displayed every time when the end of CAM profile is reached. In reverse direction, the ‘EndOfProfile’ is displayed also at the end of the cam profile (in this case the first point of the cam profile)

Inout

Master

Axis_Ref

Reference to master axis

Slave

Axis_Ref

Reference to slave axis

CamTableID

MC_Cam_Id

Prepared by MC_CamTableSelect. Identifier of CAM Table to be used in the MC_CamIn Function Block