How-To: Modify Marlin to control a laser with an SKR Pro

That’s their new 20W, quad beam module. I’d love to hear how it works when you have it set up.

According to the link I found, it came with a power supply, so I assume you will be using their power supply. If so, the power supply plugs into the female barrel connector on this board. To connect to the SKR Pro, you can use Input B from this board. The TTL line goes PC9 on the SKR Pro, which is in the Extension 1 block. You can find a pinout diagram for the SKR Pro here. You will also need to connect the ground pin on the laser board to any ground on your SKR Pro, including the one adjacent to PC9.

If you want to power your laser from the same power supply as your MPCNC, the MPCNC power supply needs to be big enough to support both the MPCNC and the laser. As for connection, it is best to connect that power directly from where it enters your SKR Pro board to the screw terminals on the laser board.

2 Likes

I tried connecting through “input B”, and PC9, but i cant make it fire. Am i missing something in the firmware maybe? I thought the laser was enabled, based on the previous posts, but i dont know enough on this stuff to be able to identify if something is missing. Intried using the g1 codes and the m codes and nothing

Laser is enabled in the SKR Pro firmware. The laser stuff was overhauled in the latest version of Marlin. In order for inline codes in G0 and G1 to work, you must first send:

M3 I  

But straight M3/M5 g-codes work without needing this initial g-code string. As a start, I recommend carefully hooking up a multi-meter to PC9 and ground. Then you can send an M3 or an inline G0/G1 command and see if the voltage of the pin goes up. Note there is also a new feature in the latest version of the firmware where the laser pin will turn off if Marlin has not received a move command in 1s. These new features are in version 515. Things are simpler in 514 and below, but you don’t get the new laser code.

Anyway, if the pin voltage goes up, the issue will be in your laser hookup.

Edit: I also noticed that Input has two 2-pin connectors. To be on the safe side, use the pin closest to the TTL label for your PWM wire.

3 Likes

That thing is a beast!

Lots of inputs there, do you have a link to the manual or anything?

1 Like

Ok- quick Q for people already using a laser

Assuming everything is hooked up correctly to the skr pro1.2 (pin9 and ground, independent laser Power supply) and I’m using the latest updated software

And I have M03 l at the start

Is it really as simple as assigning an inline S## value to control the laser pwm?

Assume pwm range is 0-255, then 50% power would be S127

G01 x50 y150 f240 s127
G01 x100 y150 f240 s127

Will etch a 50mm line in X direction at 240mm/min at 50% power.

Is that really all there is?

That should do it. Make sure to drop an M5 as the last line just to be safe. I don’t think that is needed unless you have an enable pin, but I am not really sure, that is a guess.

cheers ryan

you and the other ‘forum leaders’ and users have done a stellar job on making everything work together so seamlessly. i cant believe i can run 4 wires and add a couple parts of gcode and have a 5x3 laser cutter.

2 Likes

Junkies??

Pushers/Dealers…

1 Like

I would also love to see that particular laser in action as I’m looking at it as well. Did you get it working?

ok, i was able to get it up and running. I think there was a wiring issue as the PC9 pin did end up working out. I was able to get it connected to Lighburn and do a test fire at different power settings, but other than that, I have no clue what I am doing…lol. I am just continuing to research calibration techniques and I don’t know much about focal length, focus, speed, power, etc.

Thank you very much for your help.

2 Likes

nope, I can’t find anything online. Just the manual it came with, which only gives information on the initial setup. Very basic and not useful.

But you all got me there. Now I just need to learn how to use it. any resources you all have for calibrating, determining speed, power, etc. would be beneficial.

Thanks again.

1 Like

crazy that for the price of that thing, there’s essentially zero info or support.

Good luck figuring it out.

2 Likes

right, i sent them a message for more info. Hopefully, they have something. However, I will say it is kinda my fault for jumping into the deep end, and I don’t even know how to swim. lol

1 Like

Nah, while it’s a higher end and new model- it’s still consumer grade and should have supporting information.

I assume you’ve seen this-

Yes, that is the manual that came with it. I had not seen it online before so thanks.

@vicious1 do either of you know how to keep the laser on when using M3? . i know you said in the newer firmware it changed, but im am having an impossible time trying ro center the laser.

Your help is so appreciated

There is a new safety feature in Marlin that turns the laser off if a move command is not received in a specific period of time (one second by default). There are three methods I know of to get around this.

The first is to use an M42 to directly turn the laser pin on and off. I verified this works for the Rambo board, so it should work on the SKR Pro.

The second method is to use bit of g-code that does a small relative move every 0.9 seconds or so.

The third is to change the value of the safety timeout. This works but makes your machine less safe, and it does involve compiling and re-flashing the firmware.

For solutions 1 and 2, you will have to figure out how to execute that code. Assuming an SKR Pro with the TTF display:

  • Type the commands into the terminal
  • In Marlin mode, you can add the commands to the V1 custom menu (reflashing the board required)
  • They can be run off a file on the SD card.
  • If send your g-code via USB, then the g-code sender often has custom buttons that can be programmed, and a terminal to type in commands.
1 Like

Here is what I do- it’s Robert’s ‘option 2’ above

I fire the laser at 1% and have it move to X+1 at a ridiculously slow speed, then have it return back to X0 a bit faster. This turns the laser on for around 20 seconds and moves it such a small amount it’s negligible

I control my lr3 over wifi and I have it as a macro in ESP3D

3 Likes