GCODE Marlin!? M2000 (Generatetd by Luban)

Dear community,

I am trying to understand gcode (laser, luban). I guess it seems that marlin is used here. I now but the command M2000 nowhere find and therefore do not know what it does exactly.

;Header Start
;header_type: laser
;tool_head: levelTwoLaserToolheadForSM2
;machine: A400
;gcode_flavor: marlin
;renderMethod: line
;max_power: 255
;file_total_lines: 111
;estimated_time(s): 21.234
;is_rotate: false
;diameter: 0
;max_x(mm): 10
;max_y(mm): 10
;max_z(mm): 0
;max_b(mm): 0
;min_x(mm): -10
;min_y(mm): -10
;min_b(mm): 0
;min_z(mm): 0
;work_speed(mm/minute): 180
;jog_speed(mm/minute): 6000
;power(%): 100
;work_size_x: 400
;work_size_y: 400
;origin: center
;thumbnail: data:image/png;base64 ***
;Header End
; Laser multi-pass, pass 1 with Z = 0
; G-code for laser engraving
; Generated by Snapmaker Luban
; G-code START <<<

M3 S0
M2000 L23 P1
Simple Circle
G0 X0.00
M5 S0
; G-code END <<<
G0 Z0 F150

Can someone tell me what this sequence
M2000 L23 P1 means?

Thank you very much for your kind support.

M2000 is one of snapmaker’s custom commands, and not part of the mainline marlin commands.

Snapmaker’s incomplete and outdated reference can be found here;

Marlin’s can be found here;

Also you can type in the M2000 L23 P1 into the forum search and you will find other references of others asking the same or very similar questions related to this Here for Example

Thank you very much,

that is very interesting. I have now been able to learn a few things. It’s a pity that Snapmaker offers so little clean support. Am I in danger of making a mistake if I use Lightburn?

Kind regards

SM uses Marlin, but it’s forked and modified. The source is available at GitHub - Snapmaker/Snapmaker2-Controller: Snapmaker2-Controller is the firmware for Snapmaker 2.0 3-in-1 3D Printers. , and the source for M2000 at https://github.com/Snapmaker/Snapmaker2-Controller/blob/main/snapmaker/src/gcode/M2000.cpp . Although it’s not well documented. It would take me some time to read through the code to understand it.

There are many people using Lightburn for Lasering. There are quite a few posts in the forum. I recall seeing several “getting started with lightburn” posts.

Thanks a lot for your info,

that is the absolute royal road to understand the connections, in which one looks at the source code. Wow!

If Lightburn works, but this command (M2000 L23 P1) seems to be relevant, because Lightburn does not know this.

M2000 L23 P1 switches on both laser diodes (10 W module) according to my understanding.

Thank you very much, it was very pleasant to exchange experiences with you.

LG Sakura

Keep in mind, the source code is for the 2.0, not the Artisan. They haven’t uploaded the source for the Artisan as of yet, but if I recall (can’t remember where the post was) they were going to begin updating the gcode reference again soon. We’ll see.

As far as activating the second diode in the 10W, I’ve had no problems with the 10W on my 2.0 and have used Lightburn exclusively. I wonder if they set it up to turn off one laser if under 50% or something, which wouldn’t make sense as that would create an uneven wear between the diodes.

EDIT: Generated the same file with 100% power and 1% power, no difference. Also, swapped Luban to the 1.6W aaaand… the line is still present. Digging a little further; it’s apparently for the 40W only. Swapping the machine settings to the 40W enables this option;
Screenshot 2023-10-15 103415

Which changes the line to M2000 L23 P0 at the beginning, then P1 again at the end. I’m more wondering what the M2003 and M2004 are. I’m going to do a few more tests real fast. :slight_smile:

EDIT2: Did a quick test and it seems to not do anything, at least on a 2.0 with 10W. Quickly did up a test using grayscale (which would show the power reduction quite obviously) 0-100% power. One has P1 set, the other has P0 set, so one should be half the power of the other (one diode vs both) and…?

(sorry for running into a previous test under it, also I have the interval wide as not to overburn and ruin the test)
Exactly the same. So it seems it likely ONLY works with the 40W. My guess is the diodes in the 10W are in series together, meaning if one is on, the other is on. Whereas the 40W likely has 4 diodes in series on one board, and the other 4 on a separate board so it can turn half of them off. This will give you a tighter spot (similar to the 20W I assume) but again, it also puts more wear on the set of 4 that are always used, despite the setting.

G1 [S<power>] (inline mode)
M7-9 (air assist)
M2000 L23 (40w laser half dioad) - artisan and ray only.
For 2.0 it’s M1010 instead of M2000 W

I know… No ties with marlin, no ties with other snapmaker machines. Neat development process.

Might want to tell Luban that. :wink: It inputs M2000 L23 P1 with the machine selected as 2.0, not M1010.

Well :speak_no_evil:
I’m assuming it’s on 4.9.1?
People don’t communicate with support about the issues in 4.9.1 and this hurts everyone.

Answering to myself, it does it with 4.9.1… Another one bites the dust.

Very interesting, thanks for your tests and the info.