Advanced Function Blocks in PLCopen Motion Control

The PLCopen multi-axis synchronization function blocks are advanced function blocks defined in the PLCopen motion control standard, used to achieve coordinated motion between multiple axes, such as electronic cam, electronic gear, or complex path control. These function blocks are crucial in scenarios requiring precise synchronization (e.g., packaging machines, printing machines, robots), ensuring consistent motion relationships between the master and slave axes.

1. Overview of Multi-Axis Synchronization Function Blocks

The PLCopen multi-axis synchronization function blocks are mainly used in the following scenarios:

  • Master-Slave Synchronization: The slave axis follows the master axis’s motion, maintaining a specific position or speed relationship.

  • Coordinated Motion: Multiple axes work together according to predefined paths or relationships.

  • Dynamic Adjustment: Supports real-time changes to synchronization parameters, such as gear ratios or cam tables.

The core function blocks include:

  • MC_CamIn: Electronic cam synchronization.

  • MC_GearIn: Electronic gear synchronization.

  • MC_GearInPos: Electronic gear synchronization with position.

  • MC_PhasingAbsolute/MC_PhasingRelative: Phase adjustment for master and slave axes.

  • MC_CamOut: Release cam synchronization.

  • MC_GearOut: Release gear synchronization.

  • MC_GroupMoveLinearAbsolute/MC_GroupMoveLinearRelative: Multi-axis linear interpolation.

These function blocks are based on the PLCopen motion state machine, ensuring that the slave axis state is consistent with the master axis state, and entering ErrorStop or StandStill in case of errors or interruptions.

2. Detailed Explanation of Core Multi-Axis Synchronization Function Blocks

MC_CamIn

  • Function: Achieves electronic cam synchronization between the slave and master axes, controlling the slave axis position based on a predefined cam table.

  • Inputs:

    • Master: Master axis reference (AXIS_REF).

    • Slave: Slave axis reference (AXIS_REF).

    • Execute: Trigger cam synchronization (rising edge).

    • CamTableID: Cam table ID, defining the mapping relationship between master and slave positions.

    • MasterOffset: Master axis position offset.

    • SlaveOffset: Slave axis position offset.

    • MasterScaling: Master axis scaling factor.

    • SlaveScaling: Slave axis scaling factor.

    • StartMode: Synchronization start mode (e.g., immediate, progressive).

    • Acceleration, Deceleration: Acceleration/deceleration during synchronization.

  • Outputs:

    • InCam: Cam synchronization established.

    • Busy: During synchronization.

    • CommandAborted: Synchronization interrupted.

    • Error/ErrorID: Synchronization failure and error code.

  • State Transitions:

    • The slave axis transitions from StandStill to Synchronized Motion.

    • If there is an error with the master or slave axis, it enters ErrorStop.

    • Returns to StandStill after calling MC_CamOut or MC_Stop.

  • Usage Scenarios:

    • In packaging machines, the slave axis follows the master axis to complete complex trajectories (e.g., rotating cutting knives).

    • In printing machines, precise synchronization of multi-color overprinting.

  • Notes:

    • A cam table must be predefined (usually generated by software tools).

    • The master axis must be in motion (e.g., Discrete Motion or Continuous Motion).

    • Ensure the slave axis is enabled (MC_Power.Status=TRUE).

MC_GearIn

  • Function: Achieves electronic gear synchronization between the master and slave axes, with the slave axis following the master axis speed at a fixed gear ratio.

  • Inputs:

    • Master, Slave: Master and slave axis references.

    • Execute: Trigger gear synchronization.

    • RatioNumerator: Gear ratio numerator (slave axis).

    • RatioDenominator: Gear ratio denominator (master axis).

    • Acceleration, Deceleration: Synchronization acceleration/deceleration.

  • Outputs:

    • InGear: Achieved synchronization state.

    • Busy, CommandAborted, Error/ErrorID.

  • State Transitions:

    • The slave axis transitions from StandStill to Synchronized Motion.

    • Returns to StandStill after calling MC_GearOut or MC_Stop.

  • Usage Scenarios:

    • Speed synchronization between conveyor belts and robotic arms.

    • Multi-axis synchronous motion at constant speed.

  • Notes:

    • The gear ratio must be set reasonably to avoid overspeed of the slave axis.

    • The master axis must be in motion; otherwise, the slave axis will not respond.

MC_GearInPos

  • Function: Electronic gear synchronization with position, where the slave axis synchronizes with the master axis at a specified position.

  • Inputs:

    • Master, Slave: Master and slave axis references.

    • Execute: Trigger synchronization.

    • RatioNumerator, RatioDenominator: Gear ratio.

    • MasterSyncPosition: Master axis synchronization position.

    • SlaveSyncPosition: Slave axis synchronization position.

    • Acceleration, Deceleration: Acceleration/deceleration.

  • Outputs:

    • InSync: Position synchronization completed.

    • Busy, CommandAborted, Error/ErrorID.

  • State Transitions: Same as MC_GearIn, but the slave axis maintains the position relationship after synchronization.

  • Usage Scenarios:

    • Scenarios requiring alignment of master and slave axes at specific positions, such as assembly lines.

  • Notes:

    • Synchronization positions must be accurately calculated to avoid deviations.

    • The master axis must be in motion.

MC_PhasingAbsolute

  • Function: Adjusts the absolute phase difference between the master and slave axes, changing the offset of synchronized motion.

  • Inputs:

    • Master, Slave: Master and slave axis references.

    • Execute: Trigger phase adjustment.

    • PhaseShift: Absolute phase offset.

    • Acceleration, Deceleration: Adjustment acceleration/deceleration.

  • Outputs:

    • Done: Phase adjustment completed.

    • Busy, CommandAborted, Error/ErrorID.

  • State Transitions:

    • The slave axis maintains Synchronized Motion, only adjusting the phase.

  • Usage Scenarios:

    • Dynamic adjustment of cam or gear motion phases, such as registration adjustments in printing machines.

  • Notes:

    • Must be called after MC_CamIn or MC_GearIn is activated.

MC_PhasingRelative

  • Function: Performs relative phase adjustment based on the current phase.

  • Inputs:

    • Same as MC_PhasingAbsolute, but PhaseShift is a relative offset.

  • Outputs: Same as MC_PhasingAbsolute.

  • State Transitions: Same as MC_PhasingAbsolute.

  • Usage Scenarios: Fine-tuning synchronization relationships, such as optimizing robot paths.

  • Notes: Offset accumulation must be controlled to avoid exceeding limits.

MC_CamOut

  • Function: Releases the cam synchronization relationship of the slave axis.

  • Inputs:

    • Slave: Slave axis reference.

    • Execute: Trigger release.

  • Outputs:

    • Done: Release completed.

    • Busy, CommandAborted, Error/ErrorID.

  • State Transitions:

    • The slave axis returns from Synchronized Motion to StandStill.

  • Usage Scenarios: Switch the slave axis to independent motion mode.

  • Notes: After release, the slave axis stops and must call other function blocks again.

MC_GearOut

  • Function: Releases the gear synchronization relationship of the slave axis.

  • Inputs:

    • Slave: Slave axis reference.

    • Execute: Trigger release.

  • Outputs: Same as MC_CamOut.

  • State Transitions: Same as MC_CamOut.

  • Usage Scenarios: Stop synchronized motion and enter independent control.

  • Notes: Same as MC_CamOut.

MC_GroupMoveLinearAbsolute (Part 4)

  • Function: Multi-axis group executes absolute linear interpolation motion.

  • Inputs:

    • AxesGroup: Axis group reference (GROUP_REF).

    • Execute: Trigger motion.

    • Position: Target absolute position (multi-dimensional array).

    • Velocity, Acceleration, Deceleration: Motion parameters.

    • CoordSystem: Coordinate system (e.g., ACS, MCS).

  • Outputs:

    • Done: Reached target position.

    • Busy, CommandAborted, Error/ErrorID.

  • State Transitions:

    • The axis group transitions from StandStill to GroupMoving, returning to StandStill after completion.

  • Usage Scenarios:

    • Multi-axis linear interpolation for robots or CNC machines.

  • Notes:

    • Axis groups must be defined, and all axes must be enabled.

    • Ensure the path is unobstructed.

MC_GroupMoveLinearRelative (Part 4)

  • Function: Multi-axis group executes relative linear interpolation motion.

  • Inputs:

    • Same as MC_GroupMoveLinearAbsolute, but Position is a relative distance.

  • Outputs: Same as above.

  • State Transitions: Same as above.

  • Usage Scenarios: Multi-axis coordinated incremental movement.

  • Notes: Same as above.

3. Usage Considerations

  • Master Axis State: The master axis must be in motion (e.g., Continuous Motion or Discrete Motion), otherwise the slave axis cannot synchronize.

  • Slave Axis State: The slave axis must be in StandStill and powered on (MC_Power.Status=TRUE).

  • Cam Table: MC_CamIn requires a cam table generated by dedicated tools (e.g., TwinCAT Cam Editor) to ensure accurate master-slave relationships.

  • Gear Ratio: The gear ratios for MC_GearIn and MC_GearInPos must be set according to hardware capabilities to avoid overspeed or jitter.

  • Error Handling: In case of synchronization failure, check ErrorID (e.g., master axis lost, slave axis over limit) and recover using MC_Reset.

  • Real-Time Requirements: Multi-axis synchronization has high requirements for PLC scan cycles, necessitating optimization of programs and hardware configurations.

  • Axis Group Management: Part 4 function blocks require predefined axis groups (GROUP_REF), ensuring all axes have consistent states.

Leave a Comment