Marlin laser set up/issues

image

I am having issues with my laser filling in text/images. To me it seems like the laser isnt turning on/off at the right times. I am using lightburn to program using m106/107 and my MPCNC is run with a mini rambo board. Any help with what I need to do to fix this would be appreciated

Try changing lightburn to use G1 commands. That was the only thing that worked somewhat reliably for me with Marlin. I switched to grbl, and so far have been having better success, but it is still early.

is that a setting in lightburn somewhere or do I have to replace my G0 with G1 in the code?

It is a light burn setting. I think under machine settings. There are three different options. I’ll try to get a screenshot when I’m at my computer.

It is under Edit / Device Settings. About the middle of the box on the right there is a box for Laser Control Commands. Try changing it to Inline. This uses the G1 commands to control the laser power.

The laser support is not enabled in the V1 firmware for the MiniRambo board, so unless Sam has modified the MiniRambo firmware to enable the laser support, G0 and G1 currently will not work for him.

I didn’t catch that part. I would suggest trying to load the mega grbl build with rambo support if you are serious about the laser.

I tried using the inline but it didnt fire the laser anymore?
can you tell me what things I need to change in the firmware to enable?
I use this machine mainly with a router so I would really like to not have it mess with my ability to use M106/107 as my spindle control

I don’t have a laser or a MiniRambo to test. But with that said, here is a post were I explore the differences between the Rambo firmware (which has the laser enabled) and the MiniRambo (which does not).

In thinking about it since that post, I think you can modify this line:

#define SPINDLE_LASER_PWM_PIN                  9  // Hardware PWM

So that the laser pin matches whatever fan pin you are using (6 or 8 or some other pin if you have redefined the fan pint to a 5V pin), and leave the fan pin alone.

I’ll have to try that. so if I change that pin to 8 will it mess with anything else? I dont know much about the firmware side of this so I dont want to accidentally mess up anything trying to make the laser work

There is always the risk of breaking something when making software/firmware changes. The “trick” is to be organized. Without version control, the easiest thing is to keep labeled and annotated versions of your firmware as you make changes, so you can always roll back to a place that works. In your case, you need to keep copies of configuration_Adv.h and pins_MINIRAMBO.h. Or you just download a new copy from the V1 github page to roll back to your starting version. Note that in order to get the laser support working, you have to make the changes that I highlight in the file comparison that is in the other topic as well as assign the laser to the correct pin.

I dont want to accidentally mess up anything trying to make the laser work

In my mind, the important questions is can I make changes that damage the hardware (laser in this case). I’m not an expert, but I cannot see how any of these firmware changes can damage the laser. In the few cases I’ve read about where a laser is damaged, it is someone using a 12V fan pin to drive a 5V PWM input to the laser. In your case, since the laser is 12V compliant and you are using a 12V pin, I cannot see how you could damage anything.

So try it. If you cannot get it working, roll back to the version of the firmware you are using now.

P.S. If these changes do work to enable G0/G1 commands with the laser, I’d appreciate knowing since this is all theory to me at this point.

So just to confirm I only need to set the laser pin to pin 8(my fan pin)?
Are there other settings needed to make G0/G1 work?
It seems too easy so I feel like I’m missing something lol

There is a good chance that making these changes will get your laser to work with G0/G1, but it is not certain. I just compared the most obvious files from the Rambo and RamboMini to see the laser differences. The hard(er) work here was done by the person who made the Rambo changes (Ryan), and who understood all of these laser settings and their interactions. We are just following his recipe and hoping it will work. If it does not work, then there will be some deeper digging into the code to be done.


working on trying to compile this and I have an error. Changing the laser pwm to my fan pin conflicts. If I change the fan pin to something else wouldnt it take away the ability to control things with M106/107?
I still need to be able to switch my spindle on and off and that is the code I am currently using

I changed my fan pin to an unsed pin, Pin 23 and now I can run inline code off of lightburn. I do have to switch to M3/5 for my spindle control but it works!

2 Likes

Isn’t it a great feeling when it works? It’s it performing better?

Yes! Does exactly what I want it to do now. I need to adjust power levels and speeds but thats minimal