Max Laser Power

I’m running a cheap Chinese 5.5w Laser which “looks” the same as the Eleksmaker without the branding.
I’m just a little confused about the max Power (S). Seems everyone uses 255 whereas mine will dial up to 1000.
As an example with 255 max, if a 2.5w user sets their job at 50% and I set my 5.5w at 50% will mine have double the power output?
What happens if I set mine to 1000 max? Does it just mean that my power is controlled with a greater/finer range of adjustment? Conversely, if I set max power at 10, does it mean I achieve full laser power at 10 with only 10 steps of adjustment?
I think my brain is missing something.

The S parameter is normally used to control spindles on CNC machines. In GRBL, you can set values for the Min and Max values to use, and GRBL internally maps these to the 0% to 100% PWM rate. This is intended to allow you to set them the min and max RPM values that your spindle produces so your GCode can use actual RPM numbers.

For example, if I had a spindle that didn’t go lower than 5000 RPM, and maxed out at 15000, I would set the $30 parameter to 15000 and the $31 parameter to 5000, and then my GCode could use S7500 if I wanted 7500 RPM.

With lasers, there is no spindle, and there’s no RPM - the laser uses the PWM output to control the percentage of power output from the laser driver, so the min and max RPM numbers are arbitrary and meaningless.

That said, lots of GRBL implementations don’t deal with decimal points for the S value, so you’re right - if you set it to ‘10’, you’d have exactly 10 steps of precision for your power, which isn’t nearly enough. Lots of GRBL software assumes the range of 0 to 255 because it means converting a grayscale bitmap is trivial - you read the pixel brightness and output it exactly as is. This would be great if bitmaps were stored assuming linear power output (they aren’t) so it ends up being inaccurate.

Recent versions of GRBL use 1000 as the max because it’s a nice compromise - it’s easy to convert from a percentage, and it’s roughly a full 10 bit range - it gives decent precision, and most 8-bit hardware can only do 10 bit PWM output anyway. 32 bit boards will do more, and DSP controllers are better still.

Thanks oz,

That explains a lot.
Therefore the more meaningful reference is % as the software defaults.
This means it will be a % of full power which will be relative to the wattage.
So if I’m wanting to copy a project done with 25% on a 2.5w machine I’d need to set mine (5.5w) to about 12%.

Yes, exactly. Diode lasers are nice in that their power response is pretty linear. With glass-tube CO2 systems it’s harder to match levels between machines.