Laserbot: updated firmware to Marlin 1.1.0-RC8+


I am still trying to make my Laserbot work in a reasonable way. Having tried a number of open-source gcode interfaces that all got stuck on the originial firmware, I decided to do an upgrade to a current codebase. I rolled back to the closest Firmware revision I could find and looked at the differences and moved them to a clone of the Marlin master branch by adding a new board definition for the MegaPi.

The pin definitions for the MegaPi board are in pins_MB_LaserBot.h - the first two axes work, I copied the pin definitions for the other ones from the schematics, so you might need to check if they work ok.

Marlin has a relevant pull-request for spindle control that I have integrated and modified slightly for laser control, you can find the original discussion here:

You can find my code on github as well, under

Have a look at the SPINDLE_* constants in Configuration_adv.h to control timing - esp. the laser diode power-up delay needs some more tweaking. N.B. that the delays are in milliseconds, not in seconds as in the original PR.

Furthermore, you can find a branch ( ‘flipped_axes’) where I changed the X and Y axes to have the coordinate origin in the lower left corner, both axes with positive coordinates, the setup looks like this:

I did not try this with MLaser yet, but it should work as I added support for the ‘P’ argument in the M4 command as well.



F the megapi… I’m dumping the megapi and im going to do a ramps 1.4 with marlin… Mlaser is garbage.


well, I’m using an Inkscape gcode plugin + pronsole with this.
The MegaPi is more or less a RAMPS 1.3 clone as far as I can see.

What really bothers me is Laser control - does anyone have the circuit of the laser driver? I’d like to constantly power-supply it and PWM the laser frontend only to get rid of power-up timing issues.


@tec_support - is the laser circuit available somewhere? thanks :slight_smile:


@tec_support … how about a LaserBot category, or is the xy-plotter ok?


Would you care to make a video about the software you are using and cutting process?
MLaser software is really frustrating. it only prints a vertical and diagonal line in spite of the test square.



@koray and others on this thread,

Hello, my name is Ralph Freshour and I’m the developer of a CAM software application called BenCutLaser (BCL), BCL was designed specifically for these low power laser machines to cut out parts on 3mm plywood and 3mm acrylic.

makeBlock was kind enough to send me their laserBot kit to try and get my BCL software working with it but I am having some problems as I make modifications to BCL in an attempt to get it working.

I am the Admin for a US-based community support forum here: laserBot is just now starting to get some focus and attention there, if anyone is interested.

I’m about 75% complete on the modifications to make BCL work with laserBot but have the following blockers remaining:

  1. In mLaser I did a firmware update but it updated only to 1.0.2 and that has no Arc/Circle support (G2/G3). BCL is Vectors-based so in order to make Arcs and Circles I need G2/G3 Marlin support. I understand Marlin 1.1.0 RC-8 supports those g-code commands?

  2. I would REALLY like the ‘flipped axis’ branch of Marlin as BCL expects 0,0 to be in the lower left corner.

  3. What’s the preferred way to flash new firmware into the MegaPi? mLaser doesn’t give us a choice when updating.

Thank you for any advice and help.

If you’re interested in what BCL can do with a laser machine, you can look at this one specific Youtube video:


Hi @rfresh737,

as for the Marlin code:

Have not tested, but arcs are supported, if ARC_SUPPORT is enabled (-> cf. Configuration_adv.h around line 591; you could also enable Bezier support / G5 there… )

  1. Yes, positioning is kind of funny as it was.

Flashing: This is a standard Arduino project, so you can simply open Marlin.ino with your Arduino IDE, set the board and type:

Will give BCL a try the next days!


Thanks for that info Simon. You’re most welcome to try BCL but it won’t work yet on the laserBot :frowning:

So you’re taking about me using Marlin 1.1.o RC-8 right? Or should I look for the ‘flipped axis’ branch and use that one? I’d really like the 0,0 in the lower left corner. Can you please give me a link to download that Marlin branch? I can’t find it on gitHub.

Hopefully with help here, I can get BCL working!


give that a try:

haven’t checked out on an indepdendent machine yet, if there are issues drop me a line


Thank you for that link.

In Configuration_adv.h line 112
#define INVERT_DIRECTION false

I would set to change to


to flip the axis? Is that the right line?


you should not need to change anything, already is set up in this branch for the alignment that I sketched in the picture above.
The relevant portions are:

  • in Configuration.h, ~line 699 – INVERT_X_DIR and Y is set
  • in the pins_MB_LaserBot.h file, I switched the pin definitions of the X and Y stepper drivers.

If you flashed the new firmware, (cf. alignment as in the snapshot above…)
try to issue gcode :
G1 X10 Y0 – the carriage should move to the right away from the MegaPi board

G1 X0 Y10 – the carriage should move upwards away from the MegaPi board

G28 should home the laser


I built the .hex file and used the bootloader version of it. XLoader was able to load it successfully and BCL was able to connect and display the 1.1.0 RC-8 welcome message.

G28 homes the laser but the data coming back from the MegaPi is this string:
X:0.00 Y:0.00 Z:5.00 E:0.00 Count X: 0 Y:0 Z:4180

Z should be 0.00 shouldn’t it? And I don’t know what Count part is telling me?

These two lines above do nothing:
G01 X0010.0000 Y0000.0000

The G20 must not be working as moving X5 does not move 5 inches.

This line works fine (moves laser right in new flipped axis): G01 X0010.0000 Y0000.0000
as does it’s reverse direction: G01 X-0010.0000 Y0000.0000

G1 X0 Y10 works fine (moves laser up in new flipped axis).
G1 X0 Y-10 works fine (moves laser down in new flipped axis).

G2/G3 try to work but the Arcs are not correct. My g-code for Arcs and Circles work fine for Grbl 0.9i and 0.9j and 1.1e.


This block of g-code doesn’t get a response from the MegaPi at all…nothing happens:
G01 X0000.0000 Y0010.0000 Z0000.0000 F800

This block works:
G01 X0000.0000 Y0010.0000 Z0000.0000 F800

So, having the G91 and/or the G21 in the block of g-code isn’t working for some reason.


BTW here is the g-code that will make a circle using 4 Arcs:

G01 X0000.0000 Y0005.0000 Z0000.0000 F3400
M4 P128
G02 X0005.0000 Y0005.0000 I0005.0000 J0000.0000 F850
G02 X0005.0000 Y-0005.0000 I0000.0000 J-0005.0000 F850
G02 X-0005.0000 Y-0005.0000 I-0005.0000 J0000.0000 F850
G02 X-0005.0000 Y0005.0000 I0000.0000 J0005.0000 F850 ( pass 1 )
M4 P0
G01 X0012.0000 Y-0005.0000 Z0000.0000 F3400

But it won’t do anything when sent to the MegaPi.


Hi @koray,
I am using the gcodetools inkscape plugin, I can do a short video but this will take me a little - I’ll keep you posted!


The big problem I’m having now is that sending multiple lines of g-code to the MegaPi only executes the first line and none of the following lines in the block of g-code.

For example, here is block of g-code I’m sending but only the first G01 line responds. All ends end with an \n char.

G01 X0000.0000 Y0005.0000 Z0000.0000 F3400
M4 P128
G02 X0005.0000 Y0005.0000 I0005.0000 J0000.0000 F850
G02 X0005.0000 Y-0005.0000 I0000.0000 J-0005.0000 F850
G02 X-0005.0000 Y-0005.0000 I-0005.0000 J0000.0000 F850
G02 X-0005.0000 Y0005.0000 I0000.0000 J0005.0000 F850 ( pass 1 )
M4 P0
G01 X0012.0000 Y-0005.0000 Z0000.0000 F3400


hi @svogl
thanks for the reply.
i have managed to compile and upload your fork/flipped_axes branch firmware.
sending G codes from the terminal seems to work fine.

G91 (which is relative positioning) and G21 (mm units) gets “ok” as a result for me with the @svogl firmware.


G91 and G20/G20 seem to be working fine but I don’t get an OK return. I’ll jump into my debugger of my Visual Studio for my BenCutLAser software and see what’s coming back. It’s probably I’m looking for ‘ok’ but a different string is coming back so I will check on that.


I’m blocking the ‘ok’ string from displaying in my BCL window from these commands. I remember I did this because I was seeing too many ‘ok’ strings during a job when I was developing for Grbl. So, as I said, G91 and G20/G21 I’ve verified are working OK on my laserBot machine.