If you want to use PWM control, do the following:
Using Spindle PWM to Control Laser
This is from
http://buildlog.net/cnc_laser/mach_laser_power.html
The theory is that you want a specific frequency to run the laser at and then you can adjust the duty cycle to increase or decrease the power of the
laser. It would be nice to adjust the power of the laser in easy 1% increments, so we will set it up that way.
We are first going to change the kernal frequency and the Spindle frequency.
In the “Port Setup and Axis Selection” click the Kernal speed to 25000Hz.
In the “Spindle Setup” tab, check Use “Spindle Motor Output” and “PWM Control”. Also set the base Freq. to “250” and the Minimum PWM to “0”. In the
“General Parameters”, make sure all of the delays are set to Zero.
In the “Motor Outputs” tab, map the pins for the spindle to 1 and 0. Remember, this number is specific to your set-up and may require a different pin
out. Just check in your instructions on which one it is.
Quick Notes Page 3