Marlin + MKS GEN v1.4 + LightBurn: Laser Turns On but Doesn't Move the head correctly

Hello everyone!

I’ve searched through the entire internet and specifically this forum, but I still haven’t found a solution to my problem.

Initial data:

Laptop running Windows 11 Pro.
DIY 3D printer with MKS Gen v1.4 board and Marlin 2.1.3-b2 firmware (I’ve also tested Marlin 2.0 and Marlin 1.0).
LightBurn software (it was the latest free version, but now the trial period is expired).
LaserGRBL software.

Idea implementation:

At first, I bought a 10W laser module (with 12v and 3 pin connection) and printed a small CNC frame to test how everything works. I disassembled two DVD-RW drives, extracted the stepper motors, and installed them in the frame.
Then, I connected the frame to Arduino UNO with a CNC Shield, installed LaserGRBL on it, and set up the software on my laptop.
And — oh, miracle! — it worked! The engraving turned out great, with beautiful shading and very precise detailing.

But! Due to the miniature size of the CNC frame, the maximum engraving area was 5x5 cm.
That wasn’t enough for me, so I decided to convert my DIY 3D printer into a 2-in-1 device: printer + engraver.
At that time, my 3D printer was running on Marlin 1.0, which didn’t have preconfigured laser control, so I decided to go the simplest route first.
The first attempt was the most basic — I disconnected the stepper motors from the 3D printer’s motherboard and connected them to the Arduino.
I reconfigured LaserGRBL for different dimensions and steps, launched the engraving, and — another miracle! — it worked again, producing a beautiful engraved image.

But once again, it wasn’t enough for me!
It was very inconvenient to constantly switch the 3D printer’s stepper motors to another controller, move the printer back and forth, and deal with LaserGRBL’s inconvenient (for me personally) limit switch management…
So I installed LightBurn, downloaded Marlin 2.1.3-b2, configured it for additional laser control, and flashed my 3D printer with the new firmware.

For some unknown reason, the D9 MOSFET output (which is recommended in all manuals for connecting the laser to the fan control output) did not regulate voltage and stays always on 12v (I still don’t understand why it doesn’t work).
So, I connected the laser control to the servo control pins instead.
A new “Laser Control” menu appeared in the printer’s settings, which allowed me to turn the laser on and off.
I configured LightBurn and immediately it detected my printer and successfully homed it.
Everything seemed fine…

And here comes the problem:

To control the laser connected to the servo output, I switched LightBurn to M03/M05 command mode.
I loaded an image, homed the 3D printer, started engraving, and… disaster!

The laser turns on, but the printhead only moves in tiny steps in one direction, simply burning a straight line instead of engraving the image (with noticeable on/off pulses of the laser).

Then, I switched LightBurn to M106/M107 command mode and ran the same engraving job:
Now, the printhead moves correctly along the intended path, but the laser does not turn on, since it’s connected to the servo pins, not to fan pins.

Thinking the issue was in Marlin, I downgraded from 2.1.3 to 2.0, but nothing changed, even though I tried different firmware configuration files.

To verify further, I saved both G-code files (one with M03/M05, the other with M106/M107) and compared them —
the only difference was the laser control commands.

I also compared my Configuration_adv and Configuration files with those shared by other users —
there are no differences in laser control settings.

So my questions are:

  • Why does the M03 command adjustments allow the laser to turn on, but prevents the printhead from moving correctly?
  • Why does the M106 command adjustments allow correct movement, but LightBurn cannot control the servo output the same way it does the fan output?

I really need your help!
Has anyone encountered a similar issue?

Give @misken a chance to find us, he’s pretty up on these many of these boards. I’ve never run Marlin and I don’t really use grbl much. I have a fiber and a co2.

:smiley_cat:

I guess it’s because the standard mode uses synchronized commands, so changing the power might interrupt the movement.

It’s not LightBurn, it’s the firmware. LB is just a sender, it’s your Marlin that is acting differently then.
Regarding the command reference, I suggest changing the pin in the board configuration to the pin the laser is connected to maybe.
(Laser/Spindle Configuration (2.0.9.x) | Marlin Firmware)
There seem to be configuration options like LASER_POWER_INLINE and LASER_MOVE_POWER.

In general, Marlin is not really a laser firmware and as usual with open source projects, support is only partly available. LB implemented one/a few dialects but can’t provide full and reliable control unless there is a commercial force behind it. So consider Marlin support to be beta stage in general.

Another thing you can try is to add the machine as custom gcode machine, which gives you fine-grained control of the commands. But, you need to identify the commands your firmware needs, LB won’t.

Maybe provide your Marlin configuration as well. I used Marlin quite a lot in older days, but it has been completely replaced by Klipper and grbl in my use cases, so I’m not really up to date anymore.

1 Like

Thanks!
P.S. CO2 that’s a cool thing, i like it! But it takes too much space as for home hobby)))

Make sense. I will try somehow to check…

Yes, i’m not saying that it’s LB, only that i can’t understand why is it so and want to solve it.

I tried to change it in pins_MKS_GEN_13.h, to use other pinout for the second extruder, but after changing - nothing happen, i dont understand why…

I think, it’s work with the exact “laser” pins on board (am i right?), but my board don’t have such.

Maybe you can advice me how to properly change the laser pins?
Or maybe you have a full set of the Marlin software files that definitely working (already tested) with laser?

The bad thing - that i’m not sure that my fan mosfet (D9) is not dead…

There’s my Marlin config files below
Configuration.txt (137.3 КБ)
Configuration_adv.txt (193.1 КБ)