Using G-code on makeblock laserbox pro


#1

Hi everyone,

I’m trying to use G-code to directly upload cutting instructions to my Makeblock Laserbox Pro.

I don’t have extensive prior experience, but I’ve managed to successfully send basic G-code commands (…using ChatGPT-generated G-code) and get the laser cutter to move and “cut” a rectangle shape.

However, I’ve encountered a significant issue: after finishing the rectangle, the laser stays on. This prevents me from safely sending another file for cutting, and it obviously poses a safety hazard.

Currently, I’m using xTool Creative Space, as I understood it’s the only compatible software for the Makeblock Laserbox Pro. I’m wondering if there might be alternative software options, like Lightburn, that could also work.

I assume there must be a specific command or setting to turn off the laser at the end of the operation, as manually shutting down after each job isn’t practical or safe.

Does anyone here have experience using G-code directly with the Laserbox Pro, or know of alternative compatible software that can offer better control?

Any help or pointers would be greatly appreciated!

Thanks in advance


#2

@Makeblock_Question
I do not have experience using a Gcode directly with Laserbox. Is there a reason you need to modify the Gcode directly?
I would recommend trying Lightburn or similar software to generate Gcode files for the Laserbox.


#3

Hey,
In general I’m trying to conduct an unusual experiment, and i want to sort of automate the process of using the laser and a certain location, getting a new location and using it there etc, untill a certain condition has been met.
From what i’ve tried it seems like doing it is quite hard, and there still needs to be a ‘middle-man’ to handle the process of using the new XY location and sending the commands


#4

This is an automated AI response. Check important information. It may be inaccurate or misleading.


@Makeblock_Question

G-code Commands to Turn Off the Laser

The Laserbox Pro uses a GRBL‐based controller, so standard GRBL G-code commands apply. In GRBL, M5 is the spindle/laser‐off command. Adding M5 at the end of your job will disable the laser beam. For example:

… (your final cut commands)
M5      ; Turn off laser (stop spindle)
M2      ; Program end – also turns off laser

The command M2 (or M30) is a program-end command that also stops the laser and ends the job (
Grbl V1.1 Quick Reference
– SainSmart.com
) (
Grbl V1.1 Quick Reference – SainSmart.com
). In practice, using either M5 alone or M5 followed by M2 works. Additionally, sending the laser power to zero will instantly disable the beam: for example, a move with S0 (zero power) turns the laser off immediately (Grbl v1.1 Laser Mode · gnea/grbl Wiki · GitHub). In other words, a command like G1 S0 F1000 will move with power=0 (laser off) (Grbl v1.1 Laser Mode · gnea/grbl Wiki · GitHub).

In summary, to safely shut off the beam at job end, include:

For example, many users put at the end of their G-code file:

G0 X0 Y0    ; (optional rapid move home)
M5          ; laser off
M2          ; end program

This ensures the laser is turned off and the machine returns to idle. A short dwell (G4 P0.1, etc.) before or after can ensure the command is processed, but the key commands are M5 and/or M2.

Alternative Software (no firmware mods)

Besides xTool/Laserbox Creative Space, the Laserbox Pro can be driven by other GRBL-compatible software. Notably:

  • LightBurn – A popular commercial laser CAD/CAM. Makeblock/xTool provides a Laserbox device profile (the “xTool-laserbox.lbdev” file) so LightBurn can generate correct G-code for the Laserbox (How to Use LightBurn with Laserbox Machines? - xTool Support Center). (In practice, you export G-code from LightBurn, then import it into XTool Creative Space to run it.) Pros: advanced editing (layers, tracing, camera support), mature UI. Cons: paid software (about $60), and even with LightBurn you still use XCS to send jobs. Official support: the xTool support center explains how to install the Laserbox profile and export G-code (How to Use LightBurn with Laserbox Machines? - xTool Support Center).

  • LaserGRBL – A free Windows program designed for GRBL CO₂ lasers (LaserGRBL – Free Laser Engraving). It supports any GRBL 1.x engraver, so it can drive the Laserbox over USB (no firmware change needed) (LaserGRBL – Free Laser Engraving). Pros: free and easy to use for image engraving (loading bitmaps, dithering, etc.). Cons: Primarily focused on raster (image) engraving; limited or no vector/CAD tools. (LaserGRBL’s site confirms it “is compatible with any engraver based on Grbl v0.9 and v1.1” (LaserGRBL – Free Laser Engraving).)

  • LaserWeb / CNCWeb (LaserWeb4) – An open-source, browser-based CAM + sender for lasers and CNCs (Home - LaserWeb / CNCWeb). It runs on Windows/Mac/Linux (even Raspberry Pi) (Home - LaserWeb / CNCWeb) and supports GRBL 1.1 machines (LaserWeb’s docs list GRBL (>=1.1f) as supported (Supported firmwares - LaserWeb / CNCWeb)). Pros: Free and cross-platform; can generate G-code from SVG/PNG/etc and send it over USB or network. Cons: More complex to set up (it uses a local webserver/Electron app), and the UI has a learning curve.

  • Universal G-code Sender (UGS) – A free, open-source Java sender for GRBL. It provides a simple GUI to manually jog axes and send G-code. Pros: Platform-independent, no cost, widely used with GRBL. Cons: No built-in laser-specific features (just sends G-code), no image tracing or camera; purely a gcode sender.

  • OpenBuilds CONTROL – A free Windows GRBL sender from the OpenBuilds community (it can control laser machines too (M3 S0 vs M5 for lasers? | OpenBuilds)). Pros: Simple interface with On/Off laser controls; free. Cons: Limited advanced features (it’s essentially a sender, not a CAM program).

Each of these works “out of the box” with a stock Laserbox Pro (assuming it’s connected via USB or network and using its standard GRBL firmware). They do not require any firmware flashing. In general, these programs give you more low-level control than xTool Creative Space, but note that only LightBurn and LaserWeb have full-featured laser CAM (vector editing, power-table, etc.); simpler senders like UGS or LaserGRBL are mainly useful for straightforward G-code streaming. Always ensure the “turn-off” commands (M5, etc.) are included so the laser beam does not stay on after a job.

Sources: Makeblock/xTool’s LightBurn guide (How to Use LightBurn with Laserbox Machines? - xTool Support Center); GRBL documentation (Grbl v1.1 Laser Mode · gnea/grbl Wiki · GitHub) (
Grbl V1.1 Quick Reference
– SainSmart.com
); LaserGRBL official site (LaserGRBL – Free Laser Engraving); LaserWeb docs (Home - LaserWeb / CNCWeb) (Supported firmwares - LaserWeb / CNCWeb). The above advice follows standard GRBL laser-mode behavior (e.g. “M5 at end of job” and zeroing power) (M3 S0 vs M5 for lasers? | OpenBuilds) (Grbl v1.1 Laser Mode · gnea/grbl Wiki · GitHub).