Gcode power level

The gcode for a cut produced by Lightburn seems to use a power setting of three digits, ie: 100% is 1000, 90% is 900.

G1 Y47.992S1000F1020

Just curious as to why?

Has to do a bit with the legacy and history of Gcode
It was meant to control home made, CNC machines

Svalue would control Spindle value In fact if you visit GRBL pages for configuration

you will notice that all values related to power refer to Spindle:

$30 - Max spindle speed, RPM

This sets the spindle speed for the maximum 5V PWM pin output. Higher programmed spindle RPMs are accepted by Grbl but the PWM output will not exceed the max 5V. By default, Grbl linearly relates the max-min RPMs to 5V-0.02V PWM pin output in 255 increments. When the PWM pin reads 0V, this indicates spindle disabled. Note that there are additional configuration options are available in config.h to tweak how this operates.

$31 - Min spindle speed, RPM

This sets the spindle speed for the minimum 0.02V PWM pin output (0V is disabled). Lower RPM values are accepted by Grbl but the PWM output will not go below 0.02V, except when RPM is zero. If zero, the spindle is disabled and PWM output is 0V.

$32 - Laser mode, boolean

When enabled, Grbl will move continuously through consecutive G1, G2, or G3 motion commands when programmed with a S spindle speed (laser power). The spindle PWM pin will be updated instantaneously through each motion without stopping. Please read the Grbl laser documentation and your laser device documentation prior to using this mode. Lasers are very dangerous. They can instantly damage your vision permanantly and cause fires. Grbl does not assume any responsibility for any issues the firmware may cause, as defined by its GPL license.

When disabled, Grbl will operate as it always has, stopping motion with every S spindle speed command. This is the default operation of a milling machine to allow a pause to let the spindle change speeds.

It just stayled like that
Also before controllers were 8bit, so values were from 0 to 255
Again from legacy they just remained the same and 0 to 1000 on more recent controllers

% is a conversion from the Smin and Smax

Thanks. yes, I’ve looked at g-code definition and saw that it’s all based around CNC stuff so that makes sense.


1 Like

Do I read that right? It’s 255 steps regardless of Smin/ax values? If so, I don’t understand the value in the move to 1000 other than aid in determining percent output to a human reading raw code. Not that that isn’t a valid reason to change. It just seems to this lay person as a lot of work for little value. But, I never “got” coding.

With a 1000 max and 255 steps, each step is a bit less than 4, so 99% is streamed as S996 or so?

Is it possible to produce partial steps?

Smax 255 vs Smax 1000 came about when controllers went from 8 bit to 32bit(?)
I am not tech savy enough to give you the exactness but with 8 bits you only have 255 levels of power resolution

With current controllers you have 1000 so 4x more

This is of significance when working with grayscale really.

The human readability is always - from the coding point of view - last priority :rofl:
… engineers ya know!

Maybe someone with a bigger nerd brain than mine can explain the EXACTness of the 8bit vs current controllers thing.

As far as i am aware Svalue is a Positive Integer. So no S200.47
I can be corrected here

Working in photography with the ability to make an infinite range of gray on a print …

I have to say that I’ve never seen anything close an 8 bit grayscale (256 steps) range done on a laser.

I can’t even imagine that these could ever produce a legitimate 65,535 step grayscale…

Printing presses are similar, that’s why we dither images.

So I’m thinking this is a rather moot argument… ?


Geeks talk rather than a “issue” i think

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.