Hello! I’m new to lasering, and am also having issues with the laser not firing. I’ve read through a couple of similar posts on here, but it doesn’t seem like they were resolved.
I’m using a recently built MPCNC with a LA03-3500 3.5W blue laser from Banggood.
Controller is RAMPs 1.4 running Marlin 2.0 (downloaded from the V1 Engineering website).
I modified the FW to remap pin 9 (12v) to pin 44 (5v) to control the laser via TTL. I also changed the polarity on the TTL cable as they seem to have shipped backwards. I can control the laser just fine via the fan speed setting on the LCD, and it also works from a gcode file saved to the SD card.
I can move the laser fine, but i get echo:Unknown command: "G21 G54 in the console window whenever i move it. I also get an “unknown command” response when sending “$$”
Any ideas what else I can try? I’m really anxious to get this working!
Console output from when LightBurn first connects:
Port opened, waiting for response.
The “unknown command” G21 G54 is strange - you likely have a non CNC build of Marlin.
From Google, #define CNC_COORDINATE_SYSTEMS is located in Configuration_adv.h and must be uncommented to use multiple coordinate systems. Having said that, the G54 command in LightBurn can be ignored - it’s just setting coordinate bank zero, and can usually be ignored.
I don’t know Marlin well enough to know what “pin 9” maps to normally. There are two ways to tell Marlin to fire. The most common is by connecting the laser to one of the PWM fan outputs, and using M106 / M107 to control it. The other way is using M03 / M05 with Spindle speed commands. You can choose which flavor you want in the device settings, and optionally which tool index you’re using if you aren’t using tool / fan 0.
I checked #define CNC_COORDINATE_SYSTEMS in Configuration_adv.h and sure enough, it is uncommented.
Pin 9 is one of the 12v PMW fan outputs on the RAMPs board, normally used for laser output as you mentioned. However, since the TTL input is only 5v for my laser, it is remapped to pin 44, which is 5v output.
Well then I’m out of ideas. As I mentioned, I know very little about Marlin. I would look at what GCode is required to engage the pin you have mapped, and then look at the GCode emitted by LightBurn.
If you know what code you need to turn on the laser we can figure out how to get LightBurn to emit it, but I’m going to be mostly useless at helping you configure or debug Marlin itself.
OK- I think I might have figures something out. I examined the gcode output from from LightBurn, and the laser on/off commands has a P2 code in it (M106 P2 S255). I went through and deleted all the P2 codes, saved the file to an SD card, and it worked perfectly. So can anyone tell me what the P2 code is for, and how I can prevent LightBurn for putting it in my code?