MC_StepRefPulse (FB)

FUNCTION_BLOCK MC_StepRefPulse

This function block performs homing by searching for Zero pulse (also called Marker or reference pulse) in encoder.

../../../../../../_images/plcopen.png

The reference pulse appears once per encoder revolution. The advantage in using Reference Pulse for homing is the higher accuracy and precision that can be achieved compared to traditional optical, mechanical or magnetic sensors.

Example

../../../../../../_images/MC_StepRefPulse_Ex1.png

The axis state is changed to Homing if not already in.

  • Home is commanded by user in the desired homing direction at the programmed velocity.

  • First occurrence of the Reference Pulse, Homing is finished.

  • This function block modifies actual position and sets to the “SetPosition” input value at the end

  • This function block clears the Homing State when Done.

It is common that a first approach is performed against a mechanical sensor at higher velocity, and after a Reference Pulse, at a lower velocity. This is a traditional 2-Step homing (Coarse by external Switch in reverse and Fine by Reference Pulse in forward). For ease of use both functions could be grouped together in single function block. Advantage having the function blocks separate is that any combination is possible (MC_Block and after MC_RefPulse, etc.), stating different velocity and conditions for each Step (higly flexible), without increasing homing function block complexity too much.

../../../../../../_images/MC_StepRefPulse_Ex2.png ../../../../../../_images/MC_StepRefPulse_Ex3.png

Note

This Function Block should be used when encoder feedback is connected directly to PLC ( Ex: CD522 / eCo Onboard IO)

InOut:

Scope

Name

Type

Comment

Input

Execute

BOOL

Starts the function block at rising edge

Direction

MC_Homing_Direction

Specifies the direction to start the motion, just MC_Positive and MC_Negative are possible to use:
  • MC_Positive = Starts in positive direction always

  • MC_Negative = Starts in negative direction always

Velocity

LREAL

[u/s] Value of the maximum velocity (not necessarily reached). Range: >0

Acceleration

LREAL

[u/s°°2] Value of the acceleration (increasing energy of the motor). Range: >0.If value = 0, Acceleration will be equal to parameter paraMaxAccelerationAppl.If value > 0 and <= 1,Acceleration will be limited to 1.

Deceleration

LREAL

[u/s°°2] Value of the deceleration (decreasing energy of the motor). Range: >0.If value = 0, Deceleration will be equal to parameter paraMaxDecelerationAppl.If value > 0 and <= 1,Deceleration will be limited to 1.

SetPosition

LREAL

[u] Value of the absolute position to be set when homing is doneRange:
  • Linear Axis: Maximum range is 16#7FFFFFFF in increments, if configured in units, range will be limited to equivalent of 16#7FFFFFFF increments

  • Modulo Axis: Range will be limited by Modulo range defined

TorqueLimit

LREAL

Not supported

TimeLimit

LREAL

[s] If the function block condition is not met in the TimeLimit, an error is issued. 0 = No time limit

DistanceLimit

LREAL

[u] If the funciton block condition is not met within a DistanceLimit travel, an error is issued. 0 = No distance limit

BufferMode

MC_BufferMode

Not supported, default mcABORTING used

Output

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

Specific Error numbers: + MC_TimeLimitExceeded + MC_DistanceLimitExceeded + MC_TorqueLimitExceeded

Inout

Axis

Axis_Ref

Reference to axis

Structure: