Laser will not fire


(shane) #1

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.

start
echo:Marlin bugfix-2.0.x
echo: Last Updated: 2018-01-20 | Author: (V1 Engineering, Ryan, 302)
echo:Compiled: Jun 26 2019
echo: Free Memory: 3688 PlannerBufferBytes: 1456
echo:Hardcoded Default Settings Loaded
echo: G21 ; Units in mm (mm)
echo: M149 C ; Units in Celsius
echo:Filament settings: Disabled
echo: M200 D3.00
echo: M200 D0
echo:Steps per unit:
echo: M92 X200.00 Y200.00 Z800.00 E200.00
echo:Maximum feedrates (units/s):
echo: M203 X120.00 Y120.00 Z30.00 E25.00
echo:Maximum Acceleration (units/s2):
echo: M201 X400.00 Y400.00 Z200.00 E2000.00
echo:Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo: M204 P400.00 R3000.00 T400.00
echo:Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
echo: M205 B20000.00 S0.00 T0.00 J0.00
echo:Home offset:
echo: M206 X0.00 Y0.00 Z0.00
echo:Material heatup parameters:
echo: M145 S0 H196 B92 F0
echo: M145 S1 H240 B110 F0
echo:PID settings:
echo: M301 P17.98 I0.98 D83.62
echo:SD card ok


(Oz) #2

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.


(shane) #3

Thanks for getting back to me! The version of Marlin i’m using if from this website, preconfigured for CNC machines: https://www.v1engineering.com/marlin-firmware/

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.


(Oz) #4

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.


(shane) #5

Fair enough- thanks for the help!


(shane) #6

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?


(Ray Kholodovsky) #7

Check your tool index in device settings.


(shane) #8

That was it! Working now! Thanks!