Controlling laser power

(background reading: If $ settings are unfamiliar to you, please check

Laser software such as Lightburn sends a gcode instruction Sxxx to laser controllers to direct the laser strength, where xxx is a number.  The higher the xxx value, the higher the laser power.

The Mini Gerbil has setting $31 which specifies the minimum laser power (the bottom of the laser power scale).  Sending an S value below the value stored in $31 will not turn the laser on. By default the Mini Gerbil is configured with $31=1

The Mini Gerbil also has setting $30 which specifies the maximum laser power (the top of the laser power scale).  Sending an S value above that value will simply ‘max out’ the laser strength at whatever the $30 value is. By default we configure $30=1000

So sending a value of 500 to the default Mini Gerbil configuration will produce 50% laser, and sending 1000 will produce 100% laser. Sending 1100 will also produce a 100% laser.

Lightburn’s Device settings has an ‘S-value max field’.  That tells Lightburn what the top of the controller’s range is, and  typically this would be configured to match the $30 top of range value of the Mini Gerbil, ie. 1000. Then, in Lightburn’s ‘cuts’ menu options, if you set 20% power max, Lightburn would send a maximum value of S200.

Non-gcode systems (like the original Nano controller in the K40) don’t use the Sxxx system, so a mA current meter was included in the analogue version of the K40 laser.  20mA was considered 100% full scale laser power and so users could monitor the laser power manually.  With the Mini Gerbil, such a current meter is not required. Of course, it can still be used, but is redundant.

Running your laser tube conservatively to maximise tube life
To avoid running the tube over a nominated top value, you could achieve a buffer by EITHER:
* changing the S-value max field in Lightburn to (say) 600.  That means that even when you selected ‘100%’ output power in LB, you would only be outputting 60% power relative to what the Mini Gerbil could drive the laser.  OR
* changing the $30 value to (say) 1400 (note: Lightburn S-value max should remain at 1000). Thus when you selected ‘100%’ output power in LB, you would only be outputting 1000/1400 = 71% power relative to Mini Gerbil’s maximum laser power.  To make this change you would simply enter $30=1400 in the console field in LB.

By adjusting the numbers above you can achieve any laser power buffer you want. Here are two typical laser power buffers that people may set their parameters to:
16mA: either set S-value max to 800 (and keep $30=1000). OR, set $30=1250 and keep S-value max to 1000
18mA: either set S-value max to 900 (and keep $30=1000). OR, set $30=1111 and keep S-value max to 1000

Please also note
* laser tubes have a threshhold level, so regardless of the explanation further above, sending a power level of 1% to the laser won’t produce a beam.  For my newish laser, the lasing action only occurs from 9%.
* tubes age with laser power and time, but aging also changes laser power.  So you may like to recalibrate power levels to what you need them to be from time to time.

6 thoughts on “Controlling laser power”

  1. Hi,

    This is a very nice setup. Unfortunatly I have different users of the machine and I want to be sure that the maximum power levels are enforced by hardware.
    I can store these settings in the gerbil, but a ‘smart’ user can overwrite them very easily.
    Is there still the possibilty to limit the maximum load with for example a pot on the pwm connection?

    grt. Erik

    1. Hi Erik,
      I guess you’re in a school or a maker space?
      Sorry I haven’t seen that requirement before, and I can’t think of an elegant solution.
      Joining a pot to the controller’s existing PWM output at the K40 power supply isn’t a great idea – as well as being out of design for an MG, it would introduce awkward non-linearities in the laser response.
      If you can stand by for a day or two I’ll get Paul’s input on this…

      1. We’re thinking you should try putting a small fixed resistance in series with the PWM output (ie. between the controller and the K40 power supply), but you’d need to experiment with some values to determine the impact. Start small with 10 Ohms and gradually increase the resistance values… goodluck

        1. I had doubts about a pot as well.
          The resistor is probably a better option, but true, it will need some experiments.

          The main problem is when there is nobody to monitor the situation.
          I can add a switch inside the machine to select the normal signal for controlled use and a second one with a resistor.

          Monitoring the gcode send to the machine is another way, filtering specific unwanted commands…

          In the end ……
          Maybe locking the machine when nobody can monitor the situation is easier 🙂

Leave a Reply