The brains of laser cutters and CNC machines, G-code controllers, include settings covering speed, physical limits, directions and intensity (of a laser beam, or rotational speed of a spinning endmill). Even if you’ve bought a pre-made laser or CNC machine, you’re still likely to benefit from fine-tuning the settings for your materials or needs. And if you’re building your own laser or CNC, you’ll need to know all about controller settings.

The best case scenario is that you can adjust the settings you need in a nice user interface, without learning manual configuration via a G-code sender. An example is shown in the image below, from Lightburn software, where the Laser mode enable can be set by clicking a checkbox. Checking the box actually sends settings to your controller in the background, user friendly right ?

GUI image
Some of the easy to use interface for laser control in Lightburn software

So why don’t all machine settings just get shown in a nice user interface ? Well, there’s quite a few settings, and not all of them are relevant to each application and every user, so designers only make interfaces for the minimum. If you need to change a setting that’s not in the user interface, you’ll need to use the command line to send $ settings to your controller.

G-code controllers normally just receive movement directions, such as go to x position 150 at full speed is G0 X150 (note there is no F or feed rate parm, it assumes the fastest feed rate e.g. the $110 value. Reduce $110 if this is too fast). So the $ symbol indicates to the controller that the instructions relate to settings, and are not an instruction to move, burn or cut anything. The command line is circled and highlighted in the image below. It’s where you can click in the space and type in settings (or even directions such as G0 X150 directly).

The command-line is available in any G-code sender software.

Here's where we make complex settings
The Lightburn interface showing command line

Useful $ settings

The $$ command reads all your machine’s current settings. It’s a great idea to get started by typing $$ and copying and pasting the results to a backup document, so you can always go back to your existing configuration if you need to. Now you’re ready to make changes !

Our experience with K40 laser is that $100=157 and $101=157 are sweet spots for K40 laser x and y step distance. Why not try these out ? Try to cut or engrave a 100 x 100 mm square and measure it’s dimensions.

Another good K40 setting is to increase maximum speed. Experiment around with $110=12000 for x axis $111=5000 or higher for Y axis. 5000 in this case means 5000mm/minute, which is equivalent to 0.08 metres per second. At some point the machine can’t keep up with the signals it receives from the controller, and it’ll skip steps if you go too high. But a higher value that doesn’t skip steps means you’ll get more speed from your machine. Note: x axis rate is higher than y axis rate because of the k40 gantry design.

If you’re building your own DIY machine, must-have $ settings are the steps/mm ($100 for X axis,101 for Y axis), the travelling direction $3 (inverts the direction: 1 is for X, 2 is for only Y and 3 is for both X and Y) and the acceleration $120 and $121 for x and y axis. Safe acceleration settings are around 3000 and 5000 mark.

Back to lasering – another import setting is $30, which is the power range of the laser. When your laser engraves too darkly, increase the $30 from 1000 to a higher number like 1200 etc. Trial and error probably gives you the best setting. When your engraving is too light then simply reduce your $30 setting.

Once again, if you have user-friendly software like Lightburn, many of these settings are in the user interface. It’s just good to know that you can access all settings manually in any G-code sender software if you want to.

$ settingDefault valueDescription (for laser purposes)
$010Step pulse time, microseconds
$1255Step idle delay, milliseconds
$20Step pulse invert, mask
$3MG2=1, MG3=2Step direction invert, mask
$4MG2=0, MG3=1Invert step enable pin, boolean
$51Invert limit pins, boolean
$60Invert probe pin, boolean
$70N/A to lasers
$8100N/A to lasers
$9100N/A to lasers
$101Status report options, mask
$110.010Junction deviation, millimeters
$120.002Arc tolerance, millimeters
$130Report in inches, boolean
$190N/A to lasers
$200Soft limits enable, boolean
$210Hard limits enable, boolean
$221Homing cycle enable, boolean
$233Homing direction invert, mask
$242000Homing locate feed rate, mm/min
$25600Homing search seek rate, mm/min (default travel)
$26250Homing switch debouce delay, milliseconds
$27MG2=4.0, MG3=4.5Homing switch pull-off distance (millimeters). Use
4.0 for mechanical, or
2.5 for optical limit switches
$285Laser PWM frequency. (1 till 15)
5 sets to 1.5kHz see https://awesome.tech/mg3-pwm-configuration-instructions/ for more details
$301000Maximum laser strength (must correspond with the laser application setting S=1000). Higher numbers gives larger range. If engraving too light, reduce this number and S application setting. See https://awesome.tech/lightburn-and-mini-gerbil-tips/
$311Minimum laser strength, increase for high threshold tubes (delay)
$321Controller set to laser mode, Boolean. 1=enable (adjusts the laser strength on corners), 0 = disable (CNC mode)
$940Reset input pin: enable=1, disable=0, see for details here https://awesome.tech…/
$950Air assist configuration (output pin): invert=1, non-invert=0
$961Pause air assist when system paused: enable =1, disable=0. This function pauses the air assist during job pausing, and resumes when the job resumes
$971Safety door feature (input pin): enable=1, disable=0, see for details https://awesome.tech/mg3-debugging-safety-door/
$98MG2=0,
MG3=1
PWM output signal: invert=1, non-invert=0, see for details https://awesome.tech/mg3-pwm-configuration-instructions/
$991Laser On (LO) output signal: invert=1, non-invert=0
K40 laser fires when LO is pulled to ground. Marked as TTL on diode lasers (non-invert = 0)
$100157.000X axis travel resolution, steps/mm
$101157.000Y axis travel resolution, steps/mm
$102160.000Z axis travel resolution, steps/mm. N/A to 2 axis MiniGerbil controllers
$103160.000A axis travel resolution, steps/mm.
$104160.000B axis travel resolution, steps/mm.
$110MG2=12000.000
MG3=24000.000
X axis maximum feed rate, mm/min. 12000=200mm/sec. Reduce this setting if default travel ($25) or G0 X0 Y0 is too fast
$111MG2=5000.000 MG3=8000.000Y axis maximum feed rate, mm/min.
$1125000.000 Z axis maximum feed rate, mm/min. N/A on 2 axis Mini Gerbil controllers
$1135000.000A axis maximum travel rate, mm/min. N/A on 2 axis Mini Gerbil controllers
$1145000.000B axis maximum travel rate, mm/min. N/A on 2 axis Mini Gerbil controllers
$1208000.000X axis acceleration rate, mm/sec^2
$1213000.000Y axis acceleration rate, mm/sec^2
$1223000.000Z axis acceleration, mm/sec^2. N/A on 2 axis Mini Gerbil controllers
$1233000.000A axis acceleration, mm/sec^2. N/A on 2 axis Mini Gerbil controllers
$1243000.000B axis acceleration, mm/sec^2. N/A on 2 axis Mini Gerbil controllers
$130320.000X axis maximum travel distance, millimeters
$131230.000Y axis maximum travel distance, millimeters
$132200.000Z axis maximum travel distance, millimeters. N/A on 2 axis Mini Gerbil controllers
$133200.000A axis maximum travel distance, millimeters. N/A on 2 axis Mini Gerbil controllers
$134200.000 B axis maximum travel distance, millimeters. N/A on 2 axis Mini Gerbil controllers

You can look up G-code reference websites to see settings for potential tweaking.

Electronic limits do work with smaller pull off distances (between 0.5 and 2.5mm)

If X axis (MG2 – 200mm/sec and MG3 – 400) is too slow you can tweak the speed to higher values. Y axis is usually way slower than the X axis due to the gantry design. Engraving happens across the high speed X axis while the Y axis just do small step increments per engraved line. So tweaking the Y axis does little to increase the engraving process. The default X and Y axis feed rates ($110 and 111) are very conservative values to cater for a big audience of users. Tweaking involves tuning the belt tension as well!

NOTE: $10 needs to be set to 1 (default used to be 31 but it seems not to be supported in LightBurn anymore)

Enjoy experimenting, and if you have not used LightBurn why not download a trial version to use with your Mini Gerbil G-code controller for lasers. You don’t have a Mini Gerbil? Okay head over to our purchase page…

13 thoughts on “What are $ Settings ?”

  1. I’ve just purchase the Sainsmart 3018-pro CNC Router. I’m relatively new to CNC controlling. My machine is set up but not working as it should. My ‘Y’ travel is non-existent, the motor just grunts and I’m having difficulty finding out how to change the font size. Can anyone help me solve the problems?

    1. Hi Mike,
      Check for mechanical obstructions on Y travel. Can you move it by hand? If so, move it to half way along its travel and then attempt to move it by control.
      Which software are you using where you want to change the font size? The software provider is the best person to answer that.
      Cheers
      Dan

    2. Hi Mike.
      This isn’t an answer to your question, but I too just purchased a Sainsmart 3018-pro CNC. I too need help from the manufacturer, but perhaps one of the two responders to you might be able to help or direct me.

      I’ve spent hours trying to find a CS email or phone number for Sainsmart. No luck.

      My immediate need is for a manual/instructions for their Offline Controller Module for Genmitsu CNC Router — SKU: 101-60-283. Their Learn section of their website has a multitude of manuals/videos, but they do not have the one that I need.

      Any chance someone can give me their email/phone number?

      1. talk to lynn at support at sainsmart, she is very good and tell her neil scott suggested that i speak to you as i am having problems, her email is web@sainsmart.com will gt you to support. Be Nice I find you get a lot more done that way OK!!

  2. It’s hard to see any details on the controller and stepper drivers. It can be a defect stepper driver or bad connection or connector. Are you able to get some help from a tech savvy friend?

    Since you just bought it, I could ask them for support or send it back to the seller and ask them for a refund. Hope this helps.

  3. Could you expand on how the PWM frequency parameter $28 works?
    It looks like it is an integer value range 0 to 15, with each value equaling a specific PMW frequency.
    It this correct?
    What are the frequencies for each value?

    1. The PWM Spindle frequency can be set via $28 in the firmware
      (up to 80kHz for example… 80kHz is configured by issuing a $28=15 command via a G-code sender or in the LB console)

      0 = 60 Hz
      1 = 120 Hz
      2 = 250 Hz
      3 = 500 Hz
      4 = 1 kHz
      5 = 1.5 kHz (configured as default)
      6 = 3 kHz
      7 = 4.5 kHz
      8 = 6 kHz
      9 = 8 kHz
      10 = 10 kHz
      11 = 15 kHz
      12 = 30 kHz
      13 = 45 kHz
      14 = 60 kHz
      15 = 80 kHz

        1. Not every configuration option has a clear purpose for user application in the final product. Sometimes the configuration options are just to provide technical flexibility during the design process. This is the case with the PWM frequency. We do not recommend changing it, and if we ever find out a good reason to change it, we will blog about it.

  4. Hi guys,

    i have a speed problem, when i engrave with more then 150mm/s the start and endpoint is missing “burnmarks” so nothing engraves…it seems that the laser is to slow with on off in that moment… is there a “laser speed” setting?
    cheers from germany…

    PS: miniGerbil…

    1. Hi Einar,

      that’s an interesting problem! A photo would be great to ensure we understand the issue.

      Paul has an interesting analysis – the problem could indicate an old laser tube, because the ignition threshold of the tube has increased to the point that the initial power level is not enough to activate it. Lightburn and many laser software decrease power at corners because the movement is slower, so this seems to make sense. To overcome this (until your tube needs complete replacement), try:
      a) increasing power level in Lightburn, and/or,
      b) change the power range using the $30 setting. Note you need to decrease the range of power (ie. ensure power is more consistently high), so please decrease $30 (power range) from 1000 to 500 and retest. The $30 setting can also be changed through the Lightburn interface, where it is on the Device Settings screen and labelled ‘S-value max’.

      Regards,
      Dan

      1. thanks for your reply, but the tube is not that old or used…
        i can try to make a photo of that problem… maybe i messed up some gerbil settings…
        start and end is around 0.5 mm missing… its just in the engraving mode… using the latest lightburn version…
        and if you make a tableau over 300mm x 200mm a speed of 150mm is not that fast as 100mm on a piece of 20mm x 20mm, and that works… so the turnover theorie which i had in mind, will not be the problem… i think…

Leave a Reply