Hey everyone-
I’m so close at finally getting this all working (I think). Hopefully you know what I’ve done wrong at this point.
I’m currently using the 515 version dual endstop firmware with a RAMPS 1.4 board. I got my laser wired up to PIN44 and have tested it with M42 P44 S128. The laser turns on and burns a small scorch in the test piece of wood I have below it. Different values for S*** vary the laser power as expected, so all of this should be working.
After the successful test I installed a trial of lightburn. Configured it to use Marlin FW, set the commands to Inline, added M3 I to the start GCODE (and M5 to the end). Connected it to the MPCNC and verified it connects. I drew a small circle on the screen and hit the Start button. The MPCNC moves in a circle as expected. Basically everything seems to work, except the laser doesn’t turn on.
I’m not sure what I’m missing at this point. Admittedly I’ve never used Lightburn before, so maybe there’s an option I need to set yet?
Your Lightburn settings look correct. And as far as I know, there are no other settings you are missing. My next step would be to change laser mode commands to M03/M05 and see if that makes a difference. And to not overlook the obvious, did you set the power level for the cut when you authored your circle? Another test is to save the g-code to a file and verify the M3 I is at the top of the file and that you are getting inline (assuming the setting is inline) commands.
Should sending M3 I cause the laser to turn on at all? I know there’s a 1000ms timeout that will turn it off, but should sending that command at least have it turn on momentarily? If so, then there appears to be a FW problem because when I send M3 I I get an “OK” response, but the laser does not turn on.
Here’s the output from the LB console. There are some errors about “M9”. Not sure what that is. You can see M3 I at the top and M5 at the bottom. Also you can see it sets the value as 255 which is 100%. I likely don’t need that much power to it but I set it to 100% for testing.
Your file looks fine. M9 turns the coolant off. I’ve never seen this in my Lightburn files, so it is likely it is being inserted by your g-code sender, and there is probably a setting you can use so that coolant commands are not sent. But this is not the root of your issue.
Did you try changing to using M03/M05 commands in Lightburn.
This is the top of a file I cut this morning. There are some extra things in the file, but as you can see, it is similar to your captured text.
The one piece of this puzzle you have not tested is the connection between pin 44 and Marlin’s laser commands. The issue you are facing are not necessarily a Lightburn issue.
Yeah I tried all 3 settings and nothing turns the laser on. I’m convinced it has to be a firmware problem, but I haven’t changed anything in the firmware. The only thing I could think is if there’s something different in the dual endstop firmware?
Also does anyone know if sending M3 I should at least turn the laser on momentarily?
I keep asking about the M3 I command because it looks like at the beginning of the gcode an M5 is sent, I presume to turn it off. Since M3 I gets sent at the beginning followed almost immediately by an M5, I assume it should at least flicker (which doesn’t happen). I keep thinking if I just send M3 I from the console it should turn the laser on for 1 second then turn off with the safety features since nothing is moving. As mentioned sending M3 I just returns an “ok” message on the console but the laser doesn’t turn on.
Also, I did just figure out the weird M9 command. I had the air assist slider turned off (I don’t have any air assist hooked up yet). For some reason when that’s turned to off, the M9 command gets inserted.
For simplicity, I changed the design to a square and below is the gcode. It looks pretty much exactly like yours.
; LightBurn 1.3.01
; Marlin device profile, current position
; Bounds: X0 Y0 to X10 Y10
Again, this is leading me to think there’s something not right in the firmware. As mentioned before, setting the value of pin 44 manually turns the laser on so I assume the firmware isn’t actually responding to M3 laser commands. My understanding is that the 515 RAMPS firmware should have the laser enabled. How can I verify this?
M3 I does not turn the laser on momentarily. It enables Marlin for inline laser commands.
If you did not put this line in the file, then lines like this that have inline ‘S’ commands…
G1 X10.307 Y9.281 F6000 I S255
…would not turn the laser on.
On the other hand, M3 S255 should turn the laser on briefly at full power…until the safety timeout cuts the laser. Or you might try something less powerful like M3 S5.
I spent a bit of time crawling through the code to see if I could spot a problem. I didn’t find anything. Note that I’m not aware of anyone who has laser working with a Ramps board on version 515. There may be lots of people, but I just haven’t seen anything on the forum that confirms the laser is working correctly in version 515 on Ramps. As a total shot in the dark, you might try putting the following two lines in the top of configuration.h and reflashing your board.
//
// M3/M4/M5 - Spindle/Laser Control
//
#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN)
#if NUM_SERVOS < 2 // Use servo connector if possible
#define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown!
#ifndef SPINDLE_LASER_PWM_PIN
#define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM
#endif
#define SPINDLE_DIR_PIN 5
#elif HAS_FREE_AUX2_PINS
#define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown!
#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
#define SPINDLE_DIR_PIN 65
#else
#error "No auto-assignable Spindle/Laser pins available."
#endif
#endif
Could the issue be that I need to have the PWM pin plugged into pin 6, rather than pin 44 (I haven’t tested this yet)? I don’t know enough about what the if/else statements are doing. For the record I have a Dewalt 660 not a dedicated spindle, making me wonder if that could be what’s going on here.
SUCCESS!! That was it. I switched the PWM wire over to pin 6 instead of pin 44 and ran lightburn again. The laser fired! I still need to figure out feed rates, power, etc. and get my air assist hooked up but as of now it all works!
I’m sorta going on the assumption that if you have a dedicated spindle, that would normally be hooked up to pin 6? I saw a bunch of posts stating to hook the laser up to 44 but maybe they all had dedicated spindles?
Thank you again, Robert! Your posts lead me to start digging through the firmware code to figure this out. FWIW you now have confirmation that 515 ramps does indeed work with a laser. Thank you again!