Function BlockMC_ReferencePLCopen motion icon

Description

This function block is used to execute a fast home to a switch. If the application selects to reference to the index mark of an encoder, or the null of a resolver (which is typical), the new position value is assigned to the position of the index of the encoder (or the null of the resolver) and not the position of the switch. The ECATWriteSDO function block is used to setup the trigger event and any desired preconditions. This function block utilizes the Position Capture Mode of the AKD.

MC_Reference

Figure 7-148: MC_Reference

Arguments

For more detail on how inputs and outputs work, refer to PLCopen Function Blocks - General Rules

Input

Execute Description Requests to queue the MC_Reference move and arms reference trigger events
  Data type BOOL
  Range 0, 1
  Unit N/A
  Default

Axis

Description

Name of a declared instance of the AXIS_REF library function. For more details,About Axis Name and Number)

  Data type

AXIS_REF

  Range

[1,256]

  Unit

N/A

  Default

TriggerInput

Description

TRIGGER_REF structure defines the trigger

InputID INT :

0 = Touch Probe 1 / Capture Engine 0

1 = Touch Probe 2 / Capture Engine 1

Range is [0,1]

Direction INT; 1 = rising edgeClosedA rising edge is the transition of a digital signal from low to high. It is also called positive edge of trigger, 2 = falling edge of trigger

Trigid INT; must be zero


  • TrigMode INT (TriggerInput.TrigMode) is not presently supported by this function. The TriggerInput.Mode may be supported in a future software version.
  Data type

TRIGGER_REF

  Range

See Description above

  Unit

N/A

  Default

Velocity

Description

Commanded velocity for the reference move

  Data type

LREAL

  Range

  Unit

User unit/sec

  Default

Acceleration Description Commanded acceleration for the reference move
  Data type LREAL
  Range
  Unit User unit/sec2
  Default
Deceleration Description Commanded deceleration for the reference move
  Data type LREAL
  Range
  Unit User unit/sec2
  Default
JerkClosedIn physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time Description Commanded jerkClosedIn physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time for the reference move (if zero, then trapezoidal acc/dec is used)
  Data type LREAL
  Range
  Unit User unit/sec3
  Default
Direction Description Commanded Direction of the reference
  Data type SINT
  Range [0,1]
  Unit N/A
  Default
Position Description The position the axis will be reset to when at the machine reference location
  Data type LREAL
  Range
  Unit User unit
  Default
Option Description

Option identifier for Resolvers/Modulo reference.

0 = Use latched position for reference

1 = use resolver position of nearest null for reference 2 pole resolver

2 = use resolver position of nearest null for reference 4 pole resolver

3 = use resolver position of nearest null for reference 6 pole resolver

4 = use resolver position of nearest null for reference 8 pole resolver

5 = use resolver position of nearest null for reference 10 pole resolver

15 = use resolver position of nearest null for reference 30 pole resolver

  Data type SINT
  Range [0,15]
  Unit N/A
  Default

Output

Done Description Indicates the reference move and position adjustment is complete
  Data type BOOL
Busy Description Indicates this function block is executing
  Data type BOOL
Active Description Indicates this move is the Active move
  Data type BOOL
CommandAborted Description Indicates the move was aborted
  Data type BOOL
Error Description Indicates an invalid input, or the move was terminated due to an error
  Data type BOOL
ErrorID Description

Indicates the error if the Error output is high

See table in PLCopen Function Block ErrorID Output

  Data type INT

Usage

The following lists the steps for homing a PLCopen axis, using the MC_Reference function block. Not all of the steps are necessary depending on the configuration and the homing cycle design.

The sequence of events of a PLCopen homing cycle consists of the following steps:

  • Ensure Axis is not on Reference switch.
    If a switch is used in the homing cycle for the event or precondition to the event, check to ensure the axis is not already tripping the switches that trigger the event and precondition. If it is, move the axis off the switches.
  • Configure AKD capture engine
    Configuration of the AKD capture engine is performed by writing drive CANClosed"Controller area network" CAN is a broadcast, differential serial bus standard developed for connecting electronic control units. Each node is able to send and receive messages, but not simultaneously objects via SDO. It is accomplished with the ECATWriteSdo function. The AKD Capture mode must be set to POSITION CAPTURE.
    The available configurations are discussed in AKD Capture Engine Configuration . Example AKD capture engine configurations and reference examples are discussed in PLCopen Homing Methods.
  • Call the MC_REFERENCE function to initiate optional homing motion and to arm the AKD capture engine
    The MC_Reference function block selects the trigger edge (rising or falling edge) and arm the capture. Then, it optionally moves the axis to the reference location as directed by inputs to this function. When the AKD indicates that the capture event has occurred, the coordinate system is shifted so that the reference position input to this function block is set to the reference location. Then, the reference motion is stopped.
  • Wait for the completion of the MC_Reference function block
    The application is notified by the completion, abort or error of the homing by the MC_Reference function block.
  • Upon completion of the MC_Reference function block, the axis can be moved to the home position with a MC_MoveAbsolute function block.

For more details, see "PLCopen Homing"


  • Once the MC_Reference block is queued, but before it is completed, the cycle can be aborted with a MC_Halt or MC_Stop function block or by queuing a new motion function block with the Abort selected for buffer mode.

Related Functions

ECATWriteSdo

MC_MoveAbsolute

Example

Structured Text

(* MC_Reference ST example *)
TriggerInput.InputID := 0; //configure the reference InputID
TriggerInput.DIRECTION := 1; //configure the reference direction
Inst_MC_Reference( RefReq, Axis1, TriggerInput, 20.0, 100.0, 100.0, 100.0, 0, 0.0, 0 );

Ladder Diagram

MC_Reference: LD example

Go back to the top of the page [Top]