Programming GuidelinesΒΆ

To achieve the best results for Motion Control the actual position has to be transferred in best possible quality (with minimal jitter) to the PLC. The position feedback is expected to be in increments as the data type is a DINT.

The kernel Function Block (CMC_Motion_Kernel_REAL or CMC_Motion_Kernel_INT) has to be called every cycle and its task requires a fixed cycle time.

A variable of type AXIS_REF is used to connect to the PLCopen Function Blocks and their kernel Function Block.

The Function Block CMC_AXIS_CONTROL_PARAMETER_REAL or CMC_AXIS_CONTROL_PARAMETER_INT has be used for the axis configuration. Central Motion Control (PLC-Based)

The signal of the limits switches and the absolute switch should be connected to the elements of the data type CMC_AXIS_IO. The signal of the absolute switch must be TRUE in case the axis hits the sensor. The signal of a corrsponding limit switch has to be true when the axis leaves the area surrounded by the limit switches. If needed the signal has to be inverted before it is connected to the elements of the data type.

Task Configuration

The kernel Function Block and the transfer of axis IO data should be processed in a cyclic task. This task should be as short and real-time as possible to achieve the best motion control performance. It might be usefull to set the task priority to 10 and the priority of all all other task will be set to 11 or higher.

In order to save PLC processing time the most PLCopen function blocks as well as the application logic can also be processed in a task which runs on a lower priority than the real-time task with the axis implementation as shown in the figure below.

../_images/66cea3df7bbd26a60a331390004ab98f

All PLCopen Function Blocks which must be called in the same task than the kernel Function Block:

  • MC_CombineAxes
  • MCA_MoveByExternalReference
  • MCA_SetCoordinateTransformation
  • MCA_SetDynamicFollower
  • MCA_SyncInfeedToPath
  • MCA_SyncCamToPath
  • MC_SetCoordinateTransform
  • MC_SetCartesianTransform (only if the transformation will be changed during runtime)
  • MC_SyncAxisToGroup

In case the position reference is transferred to the drive the task of the axis implementation should be synchronized to the fieldbus cycle. The following pictures show an example for ETHERCAT:

../_images/d4817d9e7c2a0be50a33139001b844df

Task of axis layer

../_images/91470e987c2a10680a331390002975c0

Task of application implementation