The brains of laser cutters and CNC machines, G-code controllers, have a host of 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 be all over 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 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.

Defaults for the Mini Gerbil

Default factory settings
Grbl 1.1f [‘$’ for help]
client> $$
$0=10 (Step pulse time, microseconds)
$1=255 (Step idle delay, milliseconds)
$2=0 (Step pulse invert, mask)
$3=1 (Step direction invert, mask)
$4=0 (Invert step enable pin, Boolean)
$5=1 (Invert limit pins, Boolean)
$6=0 (Invert probe pin, Boolean)
$7=0 (ATC M6, pulse/ff , just for CNC )
$8=100 (ATC Tool Td, milliseconds just for CNC )
$9=100 (ATC M6 Td, milliseconds, just for CNC)
$10=1 (Status report options, mask, used to be 31 to show all info but Lightburn is not happy with other values)
$11=0.010 (Junction deviation, millimeters)
$12=0.002 (Arc tolerance, millimeters)
$13=0 (Report in inches, Boolean)
$19=0 (Softstart, milliseconds, just for CNC spindles)
$20=0 (Soft limits enable, Boolean)
$21=0 (Hard limits enable, Boolean)
$22=1 (Homing cycle enable, Boolean)
$23=3 (Homing direction invert, mask)
$24=2000.000 (Homing locate feed rate, mm/min)
$25=600.000 (Homing search seek rate, mm/min)
$26=250 (Homing switch debounce delay, milliseconds)
$27=4.0 for mechanical or 2.500 for electronic switches (Homing switch pull-off distance, millimeters)
$28=5 (Spindle freq. 0 to 15) – 5 = 1.5kHz
$30=1000 (Maximum spindle speed, RPM)
$31=1 (Minimum spindle speed, RPM)
$32=1 (Laser-mode enable, boolean)
$100=157.000 (X-axis travel resolution, step/mm)
$101=157.000 (Y-axis travel resolution, step/mm)
$102=160.000 (Z-axis travel resolution, step/mm)
$103=160.000 (a:stp/mm)
$104=160.000 (b:stp/mm)
$110=12000.000 (X-axis maximum rate, mm/min equals 200mm/sec)
(x:mm/min) (reduce this if default travel or G0 X0 Y0 is too fast)
$111=5000.000 (Y-axis maximum rate, mm/min)
$112=5000.000 (Z-axis maximum rate, mm/min)
$113=5000.000 (a:mm/min)
$114=5000.000 (b:mm/min)
$120=8000.000 (X-axis acceleration, mm/sec^2)
$121=3000.000 (Y-axis acceleration, mm/sec^2)
$122=3000.000 (Z-axis acceleration, mm/sec^2)
$123=3000.000 (a:mm/s^2)
$124=3000.000 (b:mm/s^2)
$130=320.000 (X-axis maximum travel, millimeters)
(x:mm max)
$131=230.000 (Y-axis maximum travel, millimeters)
(y:mm max)
$132=200.000 (Z-axis maximum travel, millimeters)
(z:mm max)
$133=200.000 (a:mm max)
$134=200.000 (b:mm max)

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

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

If X axis 200mm/sec 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.

    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 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’.


      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