3.6.10 MC_Phasing
Specify the phase deviation between master and slave axis.
Instruction format
| Instruction | MC_Phasing(FB) | |
| Name | Main-slave axis phase shift | |
| Graphical performance | ST performance | |
| MC_Phasing( Master: =, Slave: =, Execute: =, PhaseShift: =, Velocity: =, Acceleration: =, Deceleration: =, Jerk: =, Done=>, Busy=>, CommandAborted=>, Error=>, ErrorID=>); | |
Related variables
| Input and output variables | Name | Data type | Effective range | Initial value | Description |
| Master | Master axis | AXIS_REF_SM3 | - | - | Map to an axis, i.e. an instance of AXIS_REF_SM3 |
| Slave | Slave axis | AXIS_REF_SM3 | - | - | Map to an axis, i.e. an instance of AXIS_REF_SM3 |
| Input variables | Name | Data type | Effective range | Initial value | Description |
| Execute | Instruction execution | BOOL | [FALSE, TRUE] | FALSE | Rising edge, start executing instruction |
| PhaseShift | Phase deviation of master-slave axis | LREAL | - | 0 | The master-slave axis phase deviation value, and the positive number represents the slave axis lag. |
| Velocity | Velocity | LREAL | - | 0 | Maximum speed value when performing phase shift |
| Acceleration | Acceleration | LREAL | - | 0 | Maximum acceleration value when performing phase shift |
| Deceleration | Deceleration | LREAL | - | 0 | Maximum deceleration value when performing phase shift |
| Jerk | Second derivative of velocity | LREAL | - | 0 | Maximum Jerk value when performing phase shift |
| Output variables | Name | Data type | Effective range | Initial value | Description |
| Done | Completed | BOOL | [FALSE, TRUE] | FALSE | TRUE if the phase shift is complete |
| Busy | Execution flag | BOOL | [FALSE, TRUE] | FALSE | TRUE, instruction is being processed |
| CommandAborted | Instruction abort | BOOL | [FALSE, TRUE] | FALSE | Interrupted by other control instructions |
| Error | Error | BOOL | [FALSE, TRUE] | FALSE | When an error occurs, set to TRUE |
| ErrorID | Error ID | SMC_ERROR | Refer to SMC_ERROR | 0 | When an error occurs, the error ID is output. |
Function description
(1) Execute performs phase shift on the rising edge, and the slave axis automatically calculates a smooth curve to complete the phase shift from the slave axis to the main axis. The phase difference between the master and slave axes is PhaseShift value of the input signal, and the positive value is that the slave axis lags behind the main axis;
(2) After the shift is completed, Done signal output is TRUE;
(3) Compensate the master-slave axis phase difference according to the set PhaseShift, Velocity, Acceleration, and Deceleration;
(4) When the phase difference between the master and slave axes reaches PhaseShift, the Done signal is output;
(5) When executing the instruction, the master axis instruction position and feedback position remain unchanged, and the slave axis is adjusted. After completion, the phase difference between the slave axis and the main is PhaseShift;
(6) The final result of this instruction is the phase offset between the given values of the axis, so the actual feedback value of the real axis may not be consistent with the final offset;
(7) This instruction works with MC_GearIn instruction as follows: The master axis is Virtual_x and the slave axis is Virtual_y, and the rising edge of EX12 performs master axis speed control and master-slave axis electronic gear operation, and then performs phase shift. In addition, it can be used in conjunction with the electronic cam. In addition, the slave axis is used as the "electronic cam master axis" to achieve the effect of phase offset of the electronic cam master axis.


Sequence diagram
Both the master and slave axes move in 360 cycles, and the rising edge of the Execute signal is adjusted. After the adjustment is completed, the phase deviation between the slave axis and the master axis is the value set by PhaseShift.

Error description
When the instruction is started, Error output is TRUE, and error occurs. View ErrorID and refer to SMC_ERROR determination alarm information in the help.
