Phase Compensation with MC_Phasing
MC_Phasing performs a master position phase shift for the slave axis. The slave axis will be in Synchronous Control state. Phase correction can be executed again during a previously running phase correction command.
MC_Phasing provides a way to smoothly apply a master offset to a slave axis without directly modifying the master axis. MC_Phasing is commonly used along with MC_TouchProbe for performing position corrections on the slave axis in a registration application. LS_Connect and MC_Power/MC_PowerAll must be executed before these function blocks can be used.
The examples in this topic can be found in the XMC_MultiAxis_FBs.zip downloadable from Example Applications.
Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Master | Input/Output | Select the master axis for the phase correction. This must be a UINT variable with a value of the master axis number. |
Slave | Input/Output | Select the slave axis for the phase correction. This must be a UINT variable with a value of the slave axis number. |
Phase Shift | Input | Specify the phase compensation distance. |
Velocity | Input | Specify the operation speed. |
Acceleration | Input | Specify the acceleration. |
Deceleration | Input | Specify the deceleration. |
Jerk | Input | Specify the change rate of acceleration/deceleration. |
Done | Output | Indicates the phase compensation distance was reached. |
Busy | Output | Indicates the execution of the function block. |
Active | Output | Indicates the function block is controlling the relevant axis. |
CommandAborted | Output | Indicates the function block command was aborted. |
Error | Output | Indicates an error occurred during the execution of the function block. |
ErrorID | Output | Error Identification value. |
CoveredPhaseShift | Output | Continuously outputs the compensation amount while the phase compensation is being executed. |

//Check that all axes are ready
IF (_AX01_RDY) AND (_AX02_RDY) THEN
All_Axes_Ready := TRUE;
ELSE
All_Axes_Ready := FALSE;
END_IF;
//Check that all axes are powered on
IF (_AX01_SV_ON) AND (_AX02_SV_ON) THEN
All_Axes_Pwr_On := TRUE;
ELSE
All_Axes_Pwr_On := FALSE;
END_IF;
//Set MasterAxis and SlaveAxis variables
Master_Axis := 2;
Slave_Axis := 1;
IF (All_Axes_Pwr_On) AND (All_Axes_Ready) THEN
//Example of MC_Phasing fb
Slave_PHASING(Execute:=Execute_Phasing, Master:=Master_Axis, Slave:=Slave_Axis, PhaseShift:=Slave_PHASING.PhaseShift, Velocity:=Slave_PHASING.Velocity, Acceleration:=Slave_PHASING.Acceleration, Deceleration:=Slave_PHASING.Deceleration, Jerk:=Slave_PHASING.Jerk, ErrorID=>Slave_PHASING.ErrorID);
END_IF;
LM607