MCFB_StepRefPulse

PLCopen motion icon

 Function Block - Homing to a zero angle reference.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

Request the homing step procedure at the rising edge.

AxisID

AXIS_REF

1 to 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

See AXIS_REF Structure.

Direction

BOOL

FALSE, TRUE

N/A

No default

Defines the axis homing direction.

  • 0 (zero) = Clockwise rotation.
  • 1 = Counterclockwise rotation.

SwitchMode

DINT

0 to 3

N/A

No default

Switch state to complete homing.

  • 0 (zero) = Switch is on.
  • 1 = Switch is off.
  • 2 = Rising edge of switch.
  • 3 = Falling edge of switch.

Velocity

LREAL

No range

User unit/sec

No default

Commanded velocity for the homing move.

Acceleration

LREAL

No range

User unit/sec2

No default

Commanded acceleration for the homing move.

Deceleration

LREAL

No range

User unit/sec2

No default

Commanded deceleration for the homing move.

Jerk

LREAL

No range

User unit/sec3

No default

Commanded jerk for the homing move.

If 0 (zero), trapezoidal acc/dec is used.

SetPosition

LREAL

No range

User units

No default

Value of the absolute position to be set when the homing move is done.

TorqueLimit

LREAL

No range

User units

No default

Maximum torque applied for the homing move.

  • Entered in thousandths of maximum torque.
  • Example: 250 is 250/1000, or 25%.

TimeLimit

TIME

No range

Sec

No default

Maximum time for homing move to complete.

  • If exceeded, the homing procedure errors out.
  • 0 (zero) = no time limit.

DistanceLimit

LREAL

No range

User units

No default

Maximum distance for homing move to complete.

  • If exceeded, the homing procedure errors out.
  • 0 (zero) = no distance limit.

BufferMode

SINT

0 to 5

N/A

No default

Define the homing move start action.

  • 0 = Abort.
  • 1 = Buffer.
  • 2 = Blend to active.
  • 3 = Blend to next.
  • 4 = Blend to low velocity.
  • 5 = Blend to high velocity.
  • See Buffer Modes for detailed information.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

Indicates the move completed successfully.
The Command Position has reached the endpoint.

Busy

BOOL

FALSE, TRUE

N/A

High from the moment the Execute input goes high until the time the move is ended.

Active

BOOL

FALSE, TRUE

N/A

Indicates this move is the Active move.

CommandAborted

BOOL

FALSE, TRUE

N/A

Indicates the move was aborted.

Error

BOOL

FALSE, TRUE

N/A

Indicates either:

  • An invalid input was specified.
  • The move was terminated due to an error.

ErrorID

INT

Enumerated

N/A

Indicates the error if the Error output is set to TRUE.

Error identifier:

ErrorID

Description

1

TimeLimit exceeded.

2

DistanceLimit exceeded.

3

TorqueLimit exceeded.

4

Axis error stop state.

5

Axis not enabled.

6

Invalid inputs for Velocity-Acceleration-Deceleration.

Remarks

  • This function modifies actual position and sets to the SetPosition input value at the end.
  • Performs homing by searching for Zero pulse in encoder.
    • Also called Marker or Reference Pulse.
  • The pulse appears once per encoder revolution.
  • The advantage in using Reference Pulse for homing is the higher accuracy and precision achieved compared to traditional optical, mechanical, or magnetic sensors.

This image shows the function or function block I/O.

Figure 1: MCFB_StepRefPulse

Usage

  • Home is commanded by the user in the designated homing direction at the selected or programmed Velocity.
  • First occurrence of the Reference Pulse, Homing is finished.
  • The Torque is limited.
  • Time and Distance Limits can cause an error if exceeded.

Figure 2: MCFB_StepRefPulse Usage 1

Figure 3: MCFB_StepRefPulse Usage 2

  • 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).

Figure 4: MCFB_StepRefPulse Usage 3

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

Structured Text

PositiveDirection :=0;
Velocity :=10000.0;
SetPosition :=0.0;
TorqueLimit :=50.0;
TimeLimit :=T#10s;
DistanceLimit :=10000.0;

Inst_MCFB_StepRefPulse( True, Axis1, PositiveDirection, Velocity, 1000, 1000, 0, SetPosition, TorqueLimit, TimeLimit, DistanceLimit, 0 );

HomeComplete :=Inst_MCFB_StepRefPulse.Done;
HomeBusy :=Inst_MCFB_StepRefPulse.Busy;
HomeActive :=Inst_MCFB_StepRefPulse.Active;
HomeAborted :=Inst_MCFB_StepRefPulse.CommandAborted;
HomeError :=Inst_MCFB_StepRefPulse.Error;
HomeErrorID :=Inst_MCFB_StepRefPulse.ErrorID;

See Also