Pin laser on ramps 1.4 in combi with lightburn

Hello,

After making a couple of drawings with the pen strapped to my MPCNC (the crown), it’s time to hook up my 15W Oxlaser on my MPCNC.

I am using the standard Ramps Marlin FW with the dual end stops.
My laser and the laser fan is powered with a seperate 12VDC.
The ppm signal (with a 2k parallel resistor) was wired to pin D44 according MPCNC data but the laser did not function then using the Laser menu via the TFT screen (and the -PWM to GND)

After some research on google, i found a possible answer that it had to be pin D6 on the ramps 1.4 board instead of pin D44 but that also did not function.

I did some pin testing with my single dupont connector/wire and found a pin where my laser menu did function from the Marlin laser menu (with the standard V1-eng Marlin build for dual end stops).
Only when I connected the PWM + signal to pin D4, I could use the build in laser menu in the marlin build to test fire the laser and switch it on and off

In lightburn, there’s a build in test for making interval- and material test samples.
When I save the generated GCode to a SD card and run the Gcode program on my ramps board on my MPCNC, the laser does not function. (but the X and Y movements do function on my MPCNC). I have tried the 3 possible M-commands options to command the laser. (see attached picture)
Why does the lightburn Gcode doesn’t switch on my laser?

ps. i have tried with Gcode using the 3 possible ways in the machine settings of lightburn

What am I missing here?

regards, Joeri

1 Like

Hello,

Pin D4 is also not the solution of my problem. When enabling the laser ‘on’ in the laser menu, Pin D4 goes to 4.2Volt, no matter how high or low the power is set of the laser in the laser menu ( from 0 to 255). This pin switches on to 4.2VDC whenever i switch on the laser.

I have measured all available pin’s on the Ramps board with the power in the laser menu set from 255 to 128 and to 0 and there’s not a single pin were i can see a voltage from 5VDC to 2.5 or 0 VDC.

Maybe a broken ramps board?

Regards, Joeri

Do you have an M3 I at the top of your g-code file? You want Inline in the Lightburn settings, but you must have an M3 I or an M03 I at the top of the gcode file. In Lightburn you can add it to the Device Settings/GCode/Start Code section.

Note that, unless V1 has upgraded the version of Marlin they use, there is an issue with getting the laser menu to work. It is an issue associated with the laser safety timeout. You can get around the issue by setting the laser pin directly using an M42.

Note in Lightburn Settings, M03/M05 will work, but the quality of the resulting burns will be much lower than using Inline commands.

P.S. I have a Rambo board, which has the same microprocessor as the Ramps board, and a similar laser to the one you list. I’ve used my laser extensively and love it. It can be slow at times, but enjoy the finished projects.

P.P.S. Just read your second post. I cannot remember which of D4 or D6 is the correct pin, and the Ramps pin file is a bit confusing. Assuming it is not defined elsewhere my best guess is pin 6, I suggest you try your voltage readings using M42 and various S values in the 0 to 255 range.

From the Ramps_pins.h file:

#define SPINDLE_LASER_PWM_PIN            6  // Hardware PWM
1 Like

Thanks for the info Robert.

I switched to a SKR 1.2 pro board and I am still having to the same issue of not getting any voltage from the marlin config assigned PWM pin (which is pin PC9 on the SKR board). The GND and PC9 pin are directly wired to a Fluke multimeter and using the laser menu or with a M42 command there’s never any voltage to be measured on this PC9 pin.

Regards, J

Strange. I’d start by verifying the M42 syntax with other pins on your SKR Pro. Few pins on the board are PWM, but you can turn others on and off. You can also post what M42 command you are using, and get feedback from other forum members. I have the Rambo board on my machine, so I cannot test the M42 syntax for the SKR Pro.

I don’t know what kind of protection is on the SKR Pro pins. I know from personal experience that it is pretty easy to burn out pins on some boards. A quick short to ground and the pin is dead. Not saying that is the problem here, but this is a reason to verify the setup with other pins.

Hey Robert,

Yesterday evening, after reading your post I used my fluke multimeter again to test the pins on the SKR 1.2 Pro board and somehow, I managed to destroy some pins on the board AGAIN…(as the 3.5 TFT screen suddenly didn’t not work anymore)
This is already the second SKR board i managed to get the magic smoke out on testing the pwm pin for using a laser and it’s starting to get very frustrating.

My syntax for the PWM testing was: M42 PPC9 S255 for full power and M42 PPC9 s128 for 50% power.
Does it make a difference in the execution of the syntax if i leave a space after the M, S and P?

After failing on pin PC9, I used VSC to modify the laser PWM pin (the 2nd and 3rd line of the code in the configuration.h) to some other available pins and each time after flashing the board I could not find nor test a single pin were i could get 5VDC out when enabling the laser via the laser menu with 255 power setting nor with the M42 command.

Is there anyone who knows how the standard laser menu in the V1 Marlin version works?

I would ‘think’ that in the laser menu, I have to preset the laser power setting (I think this means PWM) to a specific power value (i can set it to 0 but the minimum is 38 in the setting) and then switch the ‘laser power’ menu to ‘on’ via the menu in order to get the laser to work via the pwm signal.

The 12VDC supply for the laser and laser-fan comes from another 12VDC power outlet line from a computer server power supply.
2 Power outlet lines from this server power supply are used to power the ramps (or the SKR board if it still works :slight_smile: ) and the 3rd power outlet (the classic yellow-black wires are 12VDC on PC power supplies) is used to power the laser.

I am wiring my good old Ramps board on again (plenty of ramps in my private stock :slight_smile: ) while waiting again for an new SKR board but this laser function with PWM is getting quite annoying.

My plan to implement the laser function before the Makita milling function will have to be modified.

Regards, Joeri

It is usually not this hard to get a laser working. For most lasers, getting things to work is plug-n-play.

For the M42, you may have one too many ‘P’ for the pin. Try M42 PC9 S255 and see what happens. I don’t use an SKR Pro board, so I cannot test the syntax, but in other posts, I think there was only one ‘P’. No space after the ‘M’, ‘P’ and ‘S’ is what I use, and it works fine, so I would not add spaces. Use upper case letters.

Is there anyone who knows how the standard laser menu in the V1 Marlin version works?

I stopped using the laser menu when V1 upgraded the version of Marlin to one that had a safety timeout. There is a bug related to using the laser menu and the timeout in the version of Marlin that V1 uses. Beyond M42, the easiest way to trigger the pin would be to author a laser job. As long as the laser is moving (even a little) the laser pin will be active. If you don’t want the laser flying round while you are testing pins, use a very slow feedrate/speed for the cut or engrave.

Before giving up on your SKR Pro board, you might try restoring the firmware to default and retesting.

SKR boards have some of the IO laid out in banks of 3, with voltage, ground, and signal. If you even for the shortest moment of time short voltage and ground together, you’ll pretty much instantly kill that GPIO on an SKR.

I make pigtails for probing them, it’s too easy to accidentally short things with a DMM or scope return.

I recommend this as well.
Even easier than blowing up a GPIO on the SKR is messing up the Marlin config and building lemon firmware. (I’ve done this myself a time or two)

I agree, revert and be methodical.

Hello Gents,

After throwing away another SKR board which suffered from some magic smoke earlier this morning, i hooked up a ramps 1.4 to the MPCNC (again :slight_smile: ) and made a custom boot screen and modified the V1 engineering Ramps Marlin for Laser PWM on pin 44…

With the marlin laser menu it didn’t work (again) but Robert warned me for that already so I swichted to Pronterface and did send a M42 P44 S255 and,
it worked. :heart_eyes:
The max PWM output on pin 44 is not 5VDC but gets to +/- 4.4VDC even if I supply the Ramps board with a slightly higher power supply voltage. (went to 13.5VDC on the ramps with no change on the pin 44 PWM output).

Should I keep it on the ramps or should Iupgrade it once more to a SKR1.2 board which is a 32bit board and much faster? (but is this speed really needed??)

Thank for all the help and advice (especially Robert)

Regards, Joeri

Forgot to mention. If you author a laser job and want inline commands, you need to put an M3 I at the top of the file.

For most modern laser modules, the voltage is not important. It is a good debugging tool to test pins, but the module itself is driven by the PWM signal. Being driven by the PWM allows the modules to work with a variety of voltages. Typically newer modules will accept PWM signals in the 3.0V to 12V range. Older laser modules were analog, and for those, voltage was important.

At this point, I wouldn’t upgrade to a SKR Pro 1.2 board. The SKR does buy you a bit faster engraving speed. You won’t see any improvement in laser cutting by using the SKR Pro board. I do a lot of laser cutting, and my machine uses a Rambo board (same microprocessor as your Ramps board).

As for my last post, the M3 I can automatically be added to the top of your g-code file in Lightburn.

Hello Robert,

Thanks for al the (correct) answers on my previous posts.

I will stick to the Ramps+arduino Mega board then and ‘avoid’ the SKR board. :slight_smile:

The laser engraving works fine now.
I’ve been running some tests for laser speed and power.
The M3 I command is in my start Gcode in lightburn and using the inline commands. (as you told me in your first answer)

Next stop will be hooking the Makita router to the MPCNC and carve some stuff.

Thanks, Joeri

3 Likes