We have a bunch of wooden swords used for kata (preset patterns of attack and reaponse) in kendo. Most people have their own, but for beginners we keep a club supply. People are pretty good about returning them when they borrow one, but we figured we should have the club ones labelled.
We could have just labelled them with a sharpie… but I decided to offer a quick pass under the laser module.
V1 maintained firmware in the Marlinbuilder Releases page should have a PWM pin defined for the laser. Which pin depends on the board. In my case, I’m running a Duet on separate firmware, and I needed a circuit to invert a pin, since my board doesn’t have any pins that output a positive voltage on a PWM frequency.
Other than that, you need a laser module, power wiring for it, and wiring to get the PWM signal from the control board to the laser.
I can’t really help you with a K40, but it’s an entirely different type of machine.You’re also probably better off trying to replace the tube. A Chinese CO2 tube isn’t too different in cost compared to a good diode laser module, and the modification will go a lot more smoothly to use it. You’ll probably also be much happier with the results.
A CO2 laser can use clear acrylic as a shield, because the clear acrylic is opaque to the IR wavelength that the laser puts out. A diode laser is (typically) about 440nm which is blue. Clear acrylic is transparent to blue, so you will now need good eye protection everywhere in the room, and you won’t be able to cut many things that it currently can, because the power output is considerably lower, plus the transparent issues with acrylic.