Rambo W/ GRBL - Adding Laser Module


I’m currently running a Rambo board that I’ve flashed with GRBL firmware.

Would I need to swap over to Marlin for laser control?

Any specific laser I need to use? I’m assuming I can just use 12v pwm controlled via the Fan port still?

GRBL certainly should be able to do laser control, but I don’t know that we have enough people here who run GRBL on the RAMBo to give you good answers.

We can certainly do it with Marlin. We have better options as far as control. The fan port method seems to be somewhat less accurate, and the current V1 maintained Marlin uses a different PWM pin, though I don’t know which one it is offhand.

1 Like

Thank you. I’ll keep doing some digging.

This will be completely dedicated to laser only so I may just swap to Marlin.

I had issues with Marlin controlling spindle before so swapped to GRBL and it worked flawlessly.

Hopefully my second go round with Marlin is better.

1 Like

I’m using a CNC shield, not Rambo, to run my K40 laser engraver but it works just fine. Grbl basically remaps the PWM spindle speed parameter to control the laser’s intensity (duty cycle).

You’ll want to identify which pin controls spindle “speed” (looks like it might be pin 44 for the Rambo), and wire the laser’s PWM input to that pin, with power and ground connected appropriately.

Next, adjust the $30 parameter to set the available PWM range. With a spindle, you’d set this to the max spindle RPM, but with a laser you’re basically telling the controller what number you’ll use for full power. I believe grbl defaults to 255. Some articles show changing this to 1000 to get more granularity, which is fine, but you need to make sure your laser software (e.g. Lightburn) agrees with the $30 setting.

There’s also the $31 setting for minimum spindle speed, but I’ve never bothered to tune this in my laser’s config. For a mechanical spindle this lets you use the full range of duty settings, e.g. 255 “steps” between min and max RPM’s. Diode lasers are probably fine with a min of 0. Some tube lasers don’t fire below a certain current, so tweaking this setting can give you better control within the useful power band of the laser. Again, mine is at the default of 0.

Finally, use the $32=1 setting to enable laser mode. One benefit of this is that the laser will automatically turned off for all rapid (G0) moves. Another is that laser intensity is automatically ramped up and down with changes in speed so that, for example, corners don’t get burned when the laser has to slow down to make the turn.

M3 and M5 commands should then turn the laser on and off, and the S parameter on M3 or G1 moves will control intensity on whatever $30 scale you’ve chosen.

1 Like

Uggg…The problem with a Rambo board is it employs a mega2560. GRBL has a mega2560 version which will work with any Mega2560 based board but grbl kind of assumes you will be using an Arduino mega and a RAMPS board. Buried in the config.h you will find

// Chose the spindle pin output :
// SPINDLE_PWM_ON_D8 => 0-12v 16 bits PWM on RAMPS D8
// SPINDLE_PWM_ON_D6 => 0-5v 8bits PWM on RAMPS Servo 2 signal (Mega 2560 D6)
// Uncomment the line which correspond to your hardware
// #define SPINDLE_PWM_ON_D6

Problem is both ‘D6’ (which is uP pin PH3) and D8 (uP pin PH5) are connected to the Fan 0 and Fan 1 outputs on a Rambo board (although that may not be the case for every RAMBO board…I only looked at 1.1b)…which employ MosFets…so if you try to use one of those your PWM signal will be solid +ve and pwm’d ground. So…you will either need to find a spare, open PWM capable pin and configure GRBL to use that, run your PWM signal back through an inverter to get a ‘proper’ PWM +ve signal or (in my opinion a much better course of action and conforming to the KISS principle) do as Tom outlines and use vanilla grbl on an uno/cncshield whereby life is so much simpler… you don’t need all the added hardware and complications that both the mega2560 and Marlin involve just to run a laser.