MC_Reference

PLCopen motion icon

 Function Block - Used to execute a fast home to a switch.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

On the rising edge, request to queue the move and arms reference trigger events.

Axis

AXIS_REF

1 to 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

TriggerInput

TRIGGER_REF

See Description.

N/A

No default

TRIGGER_REF structure defines the trigger.

DirectionINT

Range = 1, 2.

  • 1 = Rising edge.
  • 2 = Falling edge.

InputID INT

Range = 0, 1

  • 0 = Touch Probe 1 / Capture Engine 0
  • 1 = Touch Probe 2 / Capture Engine 1

TrigidINT

  • Must be 0 (zero).

  • TrigMode INT (TriggerInput.TrigMode) is not presently supported by this function.

Velocity

LREAL

No range

User unit/sec

No default

Commanded velocity for the reference move.

Acceleration

LREAL

no r

User unit/sec2

No default

Commanded acceleration for the reference move.

Deceleration

LREAL

no r

User unit/sec2

No default

Commanded deceleration for the reference move.

Jerk

LREAL

No range

User unit/sec3

No default

Commanded jerk for the reference move.

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

Direction

SINT

0, 1

N/A

No default

Commanded direction of the reference.

Position

LREAL

No range

User units

No default

The position the axis is reset to when at the machine reference location.

Option

SINT

0, 15

N/A

No default

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.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

 

 

Indicates the reference move and position adjustment is complete.

Busy

BOOL

 

 

Indicates this function block is executing.

Active

BOOL

 

 

Indicates this move is the Active move.

CommandAborted

BOOL

 

 

Indicates the move was aborted.

Error

BOOL

 

 

Indicates either:

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

ErrorID

INT

 

 

Indicates the error if Error output is high.

See PLCopen Function Block ErrorIDs.

Remarks


  • At this time, position capture is not available for PLCopen axes assigned to the secondary feedback input (digitizing axes).
    MC_Reference cannot be used to home digitizing axes.

  • See Function Blocks - General Rules about how inputs and outputs work.
  • See PLCopen Homing for more information.
  • 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.

Usage


  • Once the MC_Reference block is queued, but before it is completed, the cycle can be aborted by either:

    • Using a MC_Halt or MC_Stop function block.
    • By queuing a new motion function block with the Abort selected for buffer mode.

These are 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.

  1. Verify the Axis is not on Reference switch.
    • If a switch is used in the homing cycle for the event or precondition to the event, verify the axis is not already tripping the switches that trigger the event and precondition.
    • If it is, move the axis off the switches.
  2. Configure the AKD capture engine.
    • Configuration of the AKD capture engine is performed by writing drive CAN objects via SDO.
    • Use the ECATWriteSdo function for this action.
      • The AKD Capture mode must be set to POSITION CAPTURE.
    • See AKD Capture Engine Configuration for information about the available configurations.
    • See PLCopen Homing Methods for example AKD capture engine configurations and references.
  3. Call the MC_Reference function to initiate optional homing motion and to arm the AKD capture engine.
    • MC_Reference selects the trigger edge (rising or falling edge) and arms the capture.
    • Then, it optionally moves the axis to the reference location as directed by inputs to this function.
    • When the AKD indicates the capture event has occurred, the coordinate system is shifted so the reference position input to this function block is set to the reference location and the reference motion is stopped.
  4. 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.
  5. When the MC_Reference function block is completed, the axis can be moved to the home position with a MC_MoveAbsolute function block.

Figure 1: MC_Reference

FBD Language Example

Not available.

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* 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 );

See Also