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

Eureka!!

Speed…this whole time it was speed.

I will keep testing to see what the limits are.

PS using heater2 for the enable pin/power is working perfectly.

3 Likes

I found that speed was messing me up too. I still haven’t figured out the speed thing but I’ll keep testing. the last burn I did was at 600mm/s and at 100%. I am using Light Burn and have a 7.5W Diode laser. I did 3 passes on brown paper foam board and it did not go all the way through. from what I have been reading that is still to fast ill work on slowing it down some more. I draws a clean line just doesn’t cut very deep.

Did you change the firmware? The regular firmware is capped at 50mm/s.

as far as I know I didn’t do anything to it. Just downloaded it from the github that you sent the link to me. and uploaded it to the board. I may be reading it wrong, it might be mm/min, I’ll have to double check it tonight.

1 Like

Mm/min is that standard for measuring laser speed (in lightburn and other similar programs)

1 Like

So I’m stuck again.

If I use Tuco’s firmware from the first post on this thread

I can make his changes and it compiles fine but when I load it onto my primo I get an all low error.

If I start with the firmware Jeff recommended

https://github.com/V1EngineeringInc/MarlinBuilder/releases/download/505/V1CNC_SkrPro_Dual_2209-2.0.6.1-src.zip

My primo with dual end stops functions correctly (no all low error) but after changing the lines from method three of Tuco’s instructions, Platformio won’t compile and throws these errors.

Building in release mode
Compiling .pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/HAL.cpp.o
Compiling .pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/HAL_SPI.cpp.o
Compiling .pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/MarlinSerial.cpp.o
Compiling .pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp.o
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:41,
from Marlin/src/HAL/STM32/HAL.cpp:28:
Marlin/src/HAL/STM32/…/…/inc/SanityCheck.h:417:4: error: #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
417 | #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:41,
from Marlin/src/HAL/STM32/HAL_SPI.cpp:25:
Marlin/src/HAL/STM32/…/…/inc/SanityCheck.h:417:4: error: #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
417 | #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:42,
from Marlin/src/HAL/STM32/HAL.cpp:28:
Marlin/src/HAL/STM32/…/…/inc/…/HAL/STM32/inc/SanityCheck.h:32:4: error: #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
32 | #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:41,
from Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp:23:
Marlin/src/HAL/STM32/…/…/inc/SanityCheck.h:417:4: error: #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
417 | #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:41,
from Marlin/src/HAL/STM32/MarlinSerial.cpp:22:
Marlin/src/HAL/STM32/…/…/inc/SanityCheck.h:417:4: error: #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
417 | #error “SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:42,
from Marlin/src/HAL/STM32/HAL_SPI.cpp:25:
Marlin/src/HAL/STM32/…/…/inc/…/HAL/STM32/inc/SanityCheck.h:32:4: error: #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
32 | #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:42,
from Marlin/src/HAL/STM32/MarlinSerial.cpp:22:
Marlin/src/HAL/STM32/…/…/inc/…/HAL/STM32/inc/SanityCheck.h:32:4: error: #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
32 | #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
| ^~~~~
In file included from Marlin/src/HAL/STM32/…/…/inc/MarlinConfig.h:42,
from Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp:23:
Marlin/src/HAL/STM32/…/…/inc/…/HAL/STM32/inc/SanityCheck.h:32:4: error: #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
32 | #error “Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32.”
| ^~~~~
*** [.pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/HAL_SPI.cpp.o] Error 1
*** [.pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/HAL.cpp.o] Error 1
*** [.pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp.o] Error 1
*** [.pio/build/BIGTREE_SKR_PRO/src/src/HAL/STM32/MarlinSerial.cpp.o] Error 1
============================== [FAILED] Took 7.40 seconds ==============================

Environment Status Duration


BIGTREE_SKR_PRO FAILED 00:00:07.397
======================== 1 failed, 0 succeeded in 00:00:07.397 ========================
The terminal process “pio ‘run’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.


I either need to fix the all low error on tucos firmware or fix the compile error on Jeff’s firmware (with Tuco laser mods).

Thanks in advance smart people!

“I just want to hit the open road and drive man…
But in whose car?” - Nellie from The Office / Andy’s Ancestry

Two options.

The skr firmware that you just stick the bin on the card and reboot is here…no need to actually compile or anything. Marlinbuilder releases

If you want to use the laser here is the new bin, https://github.com/V1EngineeringInc/MarlinBuilder/actions select the latest skrpro branch, it updates every night. The changes have all been made…just waiting for Marlin to bump the branch to have it work this smoothly.

5 Likes

Thanks Ryan, will the laser firmware work with the way tuco wired it up with the activate wire on pin PC9?

To clarify my question Ryan:

If I use your second option to download the latest skrpro branch.
Do I need to modify it further following Tuco’s instructions at the start of this thread to get the laser to work or is it ready to roll as is?

If it is ready to go as is, where to I connect the activate pin from the laser to the skrpro board?

The reason I ask is that this morning I downloaded the firmware and applied Tuco’s changes and I threw similar errors during compile as before.

Thanks

Yup as is.


Tuco picked a great spot.

If your current power supply can handle it (I bet it can). I have also enabled heater 2 to act as the enable pin, so on my laser power and ground go to heater 2 and the enable wire goes to that pin in the pic…super easy. If it is still plugged in I will take a pic…might be the rambo though.

1 Like

well poop, that is how I have it wired up. your marlin builder firmware loaded. the laser powered from the main power (not heater bed) spins the cooling fans on top of the laser extrusion and the laser driver board. I guess I don’t know what to do next.

In lightburn, I can move the primo gantry around fine but when I click test fire laser I get nothing. Is there another way to test it?

Just way to new at all of this.

Check in Lightburn Device settings to see what command it uses to fire the laser. It may be expecting to use M03/M05 by default. When connected to a repurposed fan pin I think you want M106/M107 selected.

(Take this with a grain of salt, working from memory and I don’t use RAMPS on my laser)

2 Likes

Thank you so much Tom!

It actually was the opposite of what you said but clicking the other option worked!

This picture shows where I ended up setting it.

I still barely know what I’m doing but now I have a laser that is firing so that can’t be good :slight_smile:

Thank you everyone so much for getting me to this point! I actually audibly let out a whoop when it finally fired for the first time!

3 Likes

Glad I was on the right track, even if I was facing the wrong direction.

3 Likes

I was watching the forum live notification letting me know you were replying and I knew help was on the way!

2 Likes

With the fan and that pin set to M3/M5, I would expect you to have to send M106 to turn on the laser at all, and then use M3/M5 in the gcode to burninate all the papers.

The way I use it with the heater port M3 does all the work, M5 is kinda broken at the moment no need for M106. There is a PR but it is not done. Actually you don’t even use M3 anymore, the Sxxx commands are inline with the G1 commands and that will enable (power up) and control the laser. Any G0 (or G28) will power it down. So you have to end your laser code with G0 anything. I use G0 X0 Y0.

3 Likes

Ah, that makes sense.

i thought you had switched it to the inline, that means that @droesch should switch his lightburn setting to the one marked “inline” so that it generates the proper Gcode.