GRBL LPC buad rate and other factors


Were having some issues with our laser machine bogging down on dark sections of dithered engravings. Trying to track down where the issues lie

Using an MKS Sbase with a custom compiled GRBL-LPC. The changes we needed were mostly to regarding the limit pins and having the stepper pins configured to open drain. This is connected to a dedicated rotary machine with a 100W Co2 laser. The steppers are an integrated driver style


I have played around with the microstepping settings with anywhere from 2.222 steps per deg to 150+ on the A axis. At the higher rates I seem to stall the motor but even at the lower steps the laser still slows down.

I suspect maybe in our Gcode that there is a high density of dots in the dark areas.

On the firmware or Sbase end, Can increasing the baudrate help improve performance? Lowering the laser PWM frequency?

At which feed do you get this effect?

There is a limitation of commands per second that can be processed by the controller. Each change in PWM needs a separate gcode command, so one pixel on, one pixel off is the worst case. The “Join Pixels” function tries to combine multiple pixels of the same darkness to one line instead of many pixels, but dithering works against this “compression”, because it tries to avoid clustering of pixels. A different rastering algorithm could eventually be better (but less quality).

On grbl (not LPC) slow down is mostly caused by the serial rx buffer running low (when the PC cannot deliver gcode fast enough), but on grbl-LPC I have increased the RX_BUFFER_SIZE to 8192 (byte), so that should not be the problem.

You could try to play with the buffer values, especially BLOCK_BUFFER_SIZE, SEGMENT_BUFFER_SIZE and RX_BUFFER_SIZE (all in config.h)