by cncdrive » Mon May 28, 2018 3:50 pm
With the M3/M5 you can control the spindle relay output (on/off).
The M3/M5 is not a fast syncronous output, so when you switch the relay the motion always deccelerate first to a stop then the relay switches and then the motion continues, so using these codes is not ideal for laser control.
So, the M3/M5 control pin is the spindle relay output pin setting and not the laser pin setting. You have to configure that if you using the M3/M5 codes.
The M10/M11 gives motion syncronous output, so when you code M10 or M11 then the output switches without motion decceleration, it switches in syncron with the motion while the motion is ongoing, so these codes are good for laser control.
The M10 gives a PWM signal. You can vary the signal duty cycle with the Q parameter of the M10 command like M10 Q128, which gives an 50% duty cycle.
If the Q parameter is not programmed then the duty cycle is 100%, so it acts as a digital on/off switch similar to the M3/M5, but it is still motion syncronous.
The M10/M11 is on the laser output pin, you have to configure that port/pin if you using the M10/M11 codes.
One more important thing is that the M10 command requires the M3 to be active for the M10 to work. In other words the M3 acts as a safety enable signal for the M10.
So, code M3 once in the beginning of your g-code file or switch the spindle on with the spindle CW (M3) button on the screen if you will code M10 in your g-code file or via MDI.