MC_Reference
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.
InputID INT Range = 0, 1
TrigidINT
|
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.
|
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:
|
ErrorID |
INT |
|
|
Indicates the error if Error output is high. |
Remarks
-
- This function block starts a motion-related action and stores data for calculations and error checking.
If using a dual-core controller, see Call Function Blocks Multiple Times in the Same Cycle.
-
-
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.
-
- There are a differences between how an AKD and an AKD2G are used with this function block.
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.
- See Buffer Modes for more information.
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.
- 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.
- 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.
- 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.
- 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.
- 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