I'm hoping to look into pulsed laser control soon and wanted to gather some opinion on this before I start. The key things I'm after is to know what people would like and how they'd like it to be controlled.
First, some background. Everything I'm talking about here applies to the most common type of glass tube CO2 laser and its associated power supply. My laser is one of the blue box DC-K40 ones from eBay but I believe other hobby-level ones are similar. This doesn't apply to laser diodes. It probably doesn't apply to more expensive commercial machines, but you're probably not going to be adding a Smoothieboard to one of those anyway.
Controlling the power of a CO2 laser tends to be done in two ways.
- You can adjust the current that flows through the laser. The Smothieboard does an excellent job of this with PWM control. It's analagous to turning the current adjustment pot on the front of the machine. You see this reflected directly in the ammeter on the panel. PWM is managed using the S code (spindle speed) ranging from 0 to 1.
- You can also use the TTL control on the laser to rapidly switch the laser on or off. Think of this as being able to cut a finely dotted line. The usual way to control this is to use a fixed time pulse (e.g. 3ms) and specify the number of pulses per inch or PPI. Obviously PPMM might suit the metric sensibilities of the Smoothieboard, but you'll normally find it referred to as PPI. The number of pulses is high enough that the dots overlap and you don't see a dotted line but apparently reduced power.
Why do this? There are good reasons for wanting pulsed control.
- It's needed for the low end of the power scale, whether cutting or engraving. On my laser, at anything below 4mA it doesn't fire at all. It's a bit all-or-nothing. Wood is definitely cut rather than just darkened. Thin mylar sheet (ideal for solder paste stencils) melts at the edges. Paper catches fire unless you've got good air assist. To reduce the power going into the material you have to start cranking up the speed. For solder stencils I find that I can't cut a tiny square at 4000mm/min. It starts looking not very square -and it's still melted.
- Apparently you can get better cuts and effectively higher power from the laser. Not sure about this, but that's what I've heard.
- A fixed number of pulses per inch, means you have decoupled the power from the speed. 100 x 3ms pulses across the same bit of material is the same done at any speed. The existing PWM adjustment control does too, but this is another way.
- Commercial DSPs use PPI. We can do it too.
So, that was a quite a bit of background waffle. What am I after? I'd like to know what other people want. I'm happy developing features for my own use, but I'd prefer working towards something that others would make use of it too.
I'd also like some opinions on how this should be controlled via g code. We've effectively got two distinct ways to vary the power. The current S (spindle speed) code is linked to current.
- Would a new M code be best?
- A custom S code? Something like Sxxx.yyy - e.g. S0.5,200 could represent 50% power at 200 ppmm. S0.5 could be 50% power with no pulsing. (I was tempted to say S50.200, but the current S range is fixed at 0 to 1.)
- Is there anything we would be wise to be compatible with? I quick google showed that Lasersaur seems to use Sxxx alone to set power and M3 Syyy to set PPI.
- It would be possible to use one S settings and mix the PWM/TTL implementation behind the scenes. Perhaps this would work on a single piece of hardware, but it sounds problematic for a broad implementation like Smoothie.
- It could be an either/or for PWM or TTL. This doesn't seem ideal.
Obviously any option would need to be backwards compatible with the current Smoothieware solution. I'd like to make it versatile without making it confusing.
Still here? Sorry for the long post and thanks for reading. All opinions appreciated.