Ender 3 - Marlin and Lightburn

Hello all. I have Lightburn setup on an Ender 3 with a 5.5w diode laser. It is working well enough except for a couple of things. The Ender 3 is a 3d printer and therefor the Marlin firmware when setup properly for an Ender 3 doesn’t support the G21 command. Right now this is causing the laser cutting to freeze when it hits a G21. If I save out the gcode and remove any G21’s everything works and the job finishes. However, it means I have to save it out to gcode, hand edit the gcode, and then run it in Lighburn. It would be awesome if there were configuration files with the initialization and homing commands for each platform you support that can be customized. It would eliminate issues like the above, because I could just customize my initialization to remove the G21 command. Is there anything like this for Lightburn?

Second issue is that my particular laser has a spin up time any time it goes from completely off to on (it’s about 500ms) after some period of being off. Seems like laser control circuit is waiting for the laser fan to spin up to a certain RPM before kicking on the laser. Is there any way for me to set a move start delay after laser power up of X milliseconds after being off for Y milliseconds? If there isn’t something like that it would be cool to add it.

It looks like there is something similar to that for non-Marlin firmware(s) but not for Marlin. Btw, the delay command on Marlin is M4 Pzzz (where zzz is delay in ms) if you wonderful folks at Lightburn want to add it for Marlin. :slight_smile:

Thanks in advance for any advice anyone has, besides: “Buy a real laser cutter”. Lol.
Jeremy

1 Like

You’re going to have to switch Marlin over to use the spindle feature, or parts of it. There is a laser-wait in there as well but it depends on the version of Marlin you have. :frowning: I have not tried to turn laser features on and retain 3D print abilities.

These two will work for you, but again depends on your version of Marlin too:
#define SPINDLE_LASER_POWERUP_DELAY 1 // (ms) Delay to allow the spindle/laser to come up to speed/power
#define SPINDLE_LASER_POWERDOWN_DELAY 1 // (ms) Delay to allow the spindle to stop

That is a fantastic idea but as mentioned, you’ll want a version of Marlin which also has spindle support enabled. I don’t know if that’s and “AND” thing in the Marlin setup or and “OR” thing. If it can be enabled along with keeping all your 3D printer setup enabled(Hot ends, temperature sensing, etc) then you don’t have to worry about delays, just set the minimum Laser power(Spindle RPM) to that which just turns the laser on but not burning. This way when burning it won’t turn off on moves and won’t require fan spin-up deltays.

As for G21, that is what tells the firmware what measurement units the gcode is in(metric or imperial) so it surprises me that is invalid.

It would be a very cool hack to remove the Ender 3 hotend from the carriage, add a tool change plate and easily switch from laser cutting/etching to 3D printing. You get Z axis focus adjustment with it. I’m VERY interested in how this goes for you as I have a couple of lasers I can use and the Ender 3…

I’ve read that updating Marlin requires access to the controller board, uploading the Arduino bootloader and from there all updates can all be done through USB. This hack would be worth the effort.

Look what I found! https://www.thingiverse.com/thing:3369444

Even a delay of 1ms is too high - That would be a full pixel when using 0.1mm dots at 100mm/sec, which is relatively slow in the laser world.

We don’t have editable pre / post sections, mostly because people will change them and then I’ll be required to debug that too when something goes wrong. :slight_smile:

Regarding the G21, apparently Marlin doesn’t have Inch support by default - https://reprap.org/forum/read.php?415,839783

I can’t take that command out - If you run LightBurn in Inch mode, all the output goes to the controller in inches too, and without the G20 / G21 command there to choose, the scale would obviously be wrong.

@jmappus regarding that delay: see if the fan has 3 wires which would mean RPM encoder feedback. If it does, you could try wiring the fan to be full speed so the encoder feedback is always there and the laser is always cooling and maybe there won’t be an on/off/on delay.

I will try to see if I can enable spindle/laser mode and keep all the 3D printer features this weekend along with enabling the #define for INCH_MODE_SUPPORT. If I can’t have spindle mode and 3D printer mode enabled at the same time then that is pretty much a non-starter on using the Ender 3 as decent laser engraver solution. Luckily if that doesn’t work I can just move it to my CNC machine instead. :wink:

On the delay, I am not talking about a per step or movement delay. I just mean supporting a delay of movement anytime the laser is going from full off setting to any other setting and it has been longer than x milliseconds since it last had a setting of anything other than 0.

How would I know how long it has been since the laser last fired? If I’m emitting dashed lines, for example, your programmed speed and acceleration could mean the difference between requiring a pause or not. It’s not practical to try to make the software compensate for something that’s just wrong in the firmware, when it’s reasonably easy to change the config to remove the delay on the firmware side.

It’s not a firmware issue it’s a hardware issue. The laser control board is waiting some amount of time before activating the laser. All of the speeds are part of the configuration in the Lightburn software so you should be able to calculate the necessary information. It was a suggestion meant to improve your software so it could be used on more hardware out in the wild. If you don’t want to add that sort of functionality, don’t.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.