Help for MPCNC Laser with Rambo 1.4

I’ve posted a few times before here, and people have been amazing. I feel like a jerk for not giving back, though, so once I make it through this laser setup I promise to write a comprehensive guide on how to do it with the context I have.

Background

I have been using my MPCNC for a few months, and getting great use out of it – however, I always wanted to get into laser engraving (and cutting thinner wood). I don’t have the room for two separate installations, so I tried to figure out a way to integrate the laser with the existing mount. I found a pretty good mount, and then added a panel to the one side. It’s not X/Y centered, but nothing I’m doing will heavily depend on that (and I think I can just setup offsets for “laser mode”, anyhow).

I’ve been researching and educating myself over the last few months, and then the last few weeks while parts came in. I ordered this laser: https://www.amazon.ca/Engraving-Adapter-Adjustable-Engraver-Cutting/dp/B09KGXGH4W/ It’s not the best, but it seems to work so far. If you have recommendations otherwise, please share them! I wanted one that would cut through 5mm wood and wasn’t $400. Its specs are : +12v 2.5A / 40W / 5W OOP. You can find more on that link if you are interested.

Setup

A few photos of my setup, so you have some visual context:




The laser is connected with a 3 pin wire (+12v / - / PWM 5V). I initially tried to wire as this other user has done:

Another user's example of their laser setup for Rambo 1.4

…but I could not get the power to turn on via the LCD Laser Control menu. I figure this is a matter of changing a pin in the firmware, which I can do, but I’ve read about 4 different ways to do that and am confused by which road to take. Some guides that seem would appeal to my setup are written in 2018, and don’t line up exactly with the current state of things. I decided to use my external power supply until I could figure that out. My external power supply allows 3-24.5v (2A). At the recommended 12v that the laser wants, it barely burns. Temporarily, I raised the voltage and eventually could see the laser burning wood. The Laser Control menu options, such as the power level and toggling the laser’s power don’t appear to do anything or change the appearance of the laser. I figure if the laser is being told “set power to 4”, that is a PWM thing and not to do with the +12v coming in. I’ve also seen a few people argue that powering the laser and gantry on the same board is not considered the “right way”, so I’m conflicted about how to power the laser.

In short, could you help me understand:

– Which power source should I use to power the laser? If it’s the fan connectors, what would I need to change in pins_RAMBO.h or Configuration_adv.h to make that happen?

– Is PIN 45 the right choice for PWM and my particular laser? I feel like me needing to hike the power up to get the laser to burn anything tells me I don’t have the PWM thing figured out, either.

– Does anyone use the Laser Control menu available? If so, is it possible to have the functionality in the menu work completely, or is that a “best case scenario” sort of situation? I am fine with having an external power supply and a button if that’s the “right way”, I just want to make sure I understand what’s considered normal.

Thank you kindly for any help that you can provide, and the hopes that it can help others, too. As I mentioned, I intend to give back and make this a more connected experience for others once I figure it out :slight_smile:

I can’t give you comprehensive answers, but I will say that the problem I see with trying to use the fan pins to power the laser is that, with most of the boards designed for running 3D printers, the mosfet that manages the fan speed is on the negative side of the circuit, as are the ones that run the heaters for the extruders and the bed. The fan and the heaters don’t care, as they don’t have any internal electronics, but the laser has other stuff going on that messing with the ground could interfere with.

I would get 12 V + and - from the input power connection, or from another “always on” source. On RAMPS there’s a connection commonly used for the extruder fan on all-metal hot ends that run a fan across the extruder (different from a parts-cooling fan). Then get the PWM signal from the appropriate pin (I believe 45 is the proper default, but I don’t use Rambo or Ramps on my laser, so I’m not going to put myself forward as an authority on this.)

If you’re using a separate power supply for the laser, from what I’ve seen on other postings, you’ll want the two power supplies to share their ground/negative/common connection, otherwise the PWM signal from the CNC control board may not be at the proper voltage relative to the laser’s.

@vicious1 posted very recently that the Marlin firmware (on which all the V1 variants are based) has made several updates to laser firing and timing. It might be worth looking for that post, and deciding if you want to update firmware.

3 Likes

Thanks for that. It put me in the right direction. Turns out, connecting +12v / - to FAN0 was the right thing to do. I must have not had a good connection the first time I did it. First I tried sharing ground - as you suggested - that worked, so then I put both +12v / - on FAN0 and it worked. My setup is now identical to the first photo I posted. Thank you so much everyone!

I’m not going to spend time doing a large writeup since it appears you have your laser working, but I do have concerns. If any hit a target, I, or someone else on the forum, can expand on the issue.

  • The fan pins (Fan0, Fan1, Fan2) on the Rambo board are ground side switching meaning the PWM is done on the ground pin, not on the 12V side. The result is that laser PWM using these pins either does not work, or works poorly for many laser modules.

  • If I understand correctly, you are using Fan0 to switch the 12V to your laser rather than using the PWM line of your laser. If so, I have concerns about using the laser module in this way.

  • The LDC menu with respect to running a laser is poorly worded. You have to set the menu to “Laser Off” in order to manually control your laser.

  • As Tom indicates, not sharing ground is a common reason that a laser will not turn on/off.

  • Using Fan g-commands (M106/M107) to control a laser often results in quality issues in your laser results.

  • Most (but not all) lasers these days can be driven by 5V PWM. If this is true for your laser module, then the ideal setup is to share a ground and use pin 45 to drive your laser. In this setup, inline laser commands work as well as M3/M4/M5 g-codes.

  • You want to run firmware version of 510 or later.

1 Like

Thanks. I will look into these suggestions.

As it turns out, there are still some issues. It appears that changing XY or Z turns the laser off for some reason. I realized this when trying to run Ryan’s laser focus script. M106 S255 will turn on the laser, but once XY or Z is changed, the laser is turned off.

I’m not sure how it works, but it does appear M106 S* commands do change the intensity of the laser, so I think PWM would need to be at play. Maybe I am wrong.

I still have a ways to go, it appears.

When you say “510 or later” do you mean Marlin? It appears to be version 2.1

V1 firmware version 510 or later. V1 firmware is based on Marlin but has customizations for the V1 stable of machines, including generally appropriate laser mode settings.

Thank you! I ended up figuring out the builds from the github repo.

Unfortunately, the Dual version of this build fails as soon as define LASER_FEATURE is uncommented. I can get V1CNC_Rambo-bugfix-2.1.x to compile and run perfectly fine, but V1CNC_Rambo_Dual-bugfix-2.1.x appears to fail with error:

Marlin/src/module/temperature.cpp:3264:56: error: 'gcode' was not declared in this scope
     if (cutter.last_power_applied && ELAPSED(millis(), gcode.previous_move_ms + (LASER_SAFETY_TIMEOUT_MS))) {
                                                        ^
Marlin/src/module/../inc/../core/../core/millis_t.h:32:43: note: in definition of macro 'PENDING'
 #define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0)
                                           ^~~~
Marlin/src/module/temperature.cpp:3264:38: note: in expansion of macro 'ELAPSED'
     if (cutter.last_power_applied && ELAPSED(millis(), gcode.previous_move_ms + (LASER_SAFETY_TIMEOUT_MS))) {
                                      ^~~~~~~
*** [.pio/build/rambo/src/src/module/temperature.cpp.o] Error 1
======================================================================== [FAILED] Took 14.86 seconds ========================================================================

Environment    Status    Duration
-------------  --------  ------------
rambo          FAILED    00:00:14.861

Tagging @vicious1 in case of interest. Both compile fine without LASER_FEATURE, but Dual fails with LASER_FEATURE.

I use grbl, so can’t be of any further help on the V1 firmware side. @vicious1 posted earlier this week that there had been laser changes in the Marlin repos. I wonder if there are wrinkles that need to be ironed out after those changes.

1 Like

Thank you. I will wait on that.

I feel like I am close, but there is still something that’s not right.

I made a video showing that the laser won’t stay on. If anyone can help steer me in the right direction, I would be eternally grateful. <3

Update for anyone who is in this situation:

So I should have listened more closely to @robertbu 's advice.

I have been using a combination of LightBurn and some gcode I’ve picked up along the way, M106/M107, etc. I didn’t really know what “inline commands” where until I looked into it a bit deeper.

Essentially, M106 and M107 are linear and run sequentially between gantry movements (G1, G0, etc). They work, but not as well as an inline command - where the PWM (0-255) is represented on the same line with the gantry movement (G1, G0, etc).

Sequential:

M106 S255 // Turn laser on
G1 X30 // Move X +30
M107 // Turn laser off
G1 X-30 // Move X -30

Inline:

G1 X30 I S255 // Laser on, move X +30
G1 X-30 I S0 // Laser off, move X -30

As you can see, inline sends the movement and power level of the laser at once, rather than waiting for the previous command to complete. As mentioned by Robert, this results in cleaner cuts or engraving. This fixed my issue and now I am engraving. Still learning, but it works as it should.

2 Likes

I appreciate this thread, as I am about to put a laser on my Rambo 1.4 Burly build.

If I follow this thread, it is possible/better to get power the laser direct from 12v source and make a common ground to the laser and the Rambo board. To control the laser use PWM via pin 45 NOT fans.

I will attempt this later today.

Using a separate power source for your laser is not required but works well if ground is shared. The main issue with using the power supply for your Rambo is that the power supply shipped by V1 and spec’ed in the parts list for the Burly/Primo does not have provide enough current to supply both the MPCNC and many/most laser modules. If separate power supplies are used, you are right that you need to share ground, though often the PWM cable is paired with a ground wire.

Pin 45 is a 5V PWM pin, so your laser PWM needs to support a 5V signal. If not, you will have extra work.

Thanks for this (speedy) reply!

Is this the Pin 45 in blue? Taken from Ryan’s blog, yet it was still ambiguous as to EXACTLY which pin was 45. I put the blue scribble for specificity.

Thanks Robert!

Edit: your post nailed it, here

@ntomkin I encountered the same Marlin bug as you:

It was a simple fix, so I submitted a pull request here:

1 Like