3.6.10 MC_Phasing

Last modified by xingzhi lin on 2025/12/26 17:20

Specify the phase deviation between master and slave axis.

Instruction format

InstructionMC_Phasing(FB)
NameMain-slave axis phase shift
Graphical performanceST performance

1764850919912-168.png

MC_Phasing(

Master: =,

Slave: =,

Execute: =,

PhaseShift: =,

Velocity: =,

Acceleration: =,

Deceleration: =,

Jerk: =,

Done=>,

Busy=>,

CommandAborted=>,

Error=>,

ErrorID=>);

Related variables

Input and output variablesNameData typeEffective rangeInitial valueDescription
MasterMaster axisAXIS_REF_SM3--Map to an axis, i.e. an instance of AXIS_REF_SM3
SlaveSlave axisAXIS_REF_SM3--Map to an axis, i.e. an instance of AXIS_REF_SM3
Input variablesNameData typeEffective rangeInitial valueDescription
ExecuteInstruction executionBOOL[FALSE, TRUE]FALSERising edge, start executing instruction
PhaseShiftPhase deviation of master-slave axisLREAL-0The master-slave axis phase deviation value, and the positive number represents the slave axis lag.
VelocityVelocityLREAL-0Maximum speed value when performing phase shift
AccelerationAccelerationLREAL-0Maximum acceleration value when performing phase shift
DecelerationDecelerationLREAL-0Maximum deceleration value when performing phase shift
JerkSecond derivative of velocityLREAL-0Maximum Jerk value when performing phase shift
Output variablesNameData typeEffective rangeInitial valueDescription
DoneCompletedBOOL[FALSE, TRUE]FALSETRUE if the phase shift is complete
BusyExecution flagBOOL[FALSE, TRUE]FALSETRUE, instruction is being processed
CommandAbortedInstruction abortBOOL[FALSE, TRUE]FALSEInterrupted by other control instructions
ErrorErrorBOOL[FALSE, TRUE]FALSEWhen an error occurs, set to TRUE
ErrorIDError IDSMC_ERRORRefer to SMC_ERROR0When 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.

1764851002474-357.png

1764851014818-602.png

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.

1764851035144-407.png

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.

Information

Note: Please refer to [3.8 Error ID description] to know the relevant error ID description.