RAMPS 1.6+ and SCULPFUN S9 LASER


Greetings!

I’m new with the MPCNC but I managed to get one almost done (… almost because wire management is the worst part for me… :smile: ).

25x2 mm steel tubing, Arduino 2560 clone, Ramps 1.6+ Bigtree, DRV8825 steppers.
For now, I’m using some CAT5 wiring for the motors.

The rig works as it should, it draws nice but I got a laser module ( Sculpfun S9)
and I can’t get it to work with Lightburn.

I enabled the laser feature in cfg_adv, i have the PWM signal wire connected to pin 6, the laser 12 - to GND and the laser 12V + to 12V + on the RAMPS.

The issue is that with Lightburn, the laser doesn’t power on when the program runs. I have movement, but no laser beam. When I try the laser from the MPCNC LCD, I can get it to start and control the power output in the Laser section.

Could you please give me some suggestions?

Thank you !

1 Like

How do you have your Laser Control Command setup in Lightburn? You should have it set to Inline:

image

If you have it set to Inline, I recommend checking to make sure that is what is getting generated. I ran into a weird bug with Lightburn after a recent update where I had it set to Inline, but it was generating M106/M107 codes. if you take a look at the top of a g-code file generated by Lightburn with any text editor, you should see something like this on the first G1 generated:

G1 X-0.006 Y34.25 F144 I S229.5

You should not see M106 and M107 commands in the file. The S parameter is the “inline” command for controlling the laser.

Hello! Thank you for the reply.

I use the Inline commands in Lightburn and a small gcode looks like the one attached.

; LightBurn 1.0.04
; Marlin device profile, current position
; Bounds: X0 Y0 to X59 Y52
G21
G91
; Cut @ 500 mm/min, 50% power
M9
M05
G0X0 Y0 F0
; Layer C00
G1 Y52 F500 I S127.5
G1X59
G1 Y-52
G1X-59
M9
M05 P1
; return to starting pos
G0 X0 Y0 F0

I’m wandering if my connections to the board are good.

Your g-code looks fine. I believe the built-in laser menu uses M03/M05 g-code commands to turn the laser on and off, so the next thing to try is changing Lightburn to use M03/M05 commands instead of inline. Verify the g-code ifile contains M03/M05 commands. If this works but inline does not, then you probably have a setting that needs to be changed in the firmware. In that case, I’d run a diff between your configuration.h and adv_configuration.h and the ones V1 maintains for the Rambo board.

I tried changing to M03/M05 and I have the following result: :frowning:

https://youtu.be/kRhVlzi7_d0

I don’t understand why it blinks just at the beginning.

Your video is private, so I cannot view it.

I’m sorry, should work now .

https://www.youtube.com/watch?v=kRhVlzi7_d0&ab_channel=Cristu

Below is the GCode:

; LightBurn 1.0.04
; Marlin device profile, current position
; Bounds: X0 Y0 to X45 Y37
G21
G91
; Cut @ 700 mm/min, 20% power
M9
M05 P1
G0X0 Y0 F0
; Layer C00
M03 P1 S51
G1 Y37 F700
G1X45
G1 Y-37
G1X-45
M9
M05 P1
; return to starting pos
G0 X0 Y0 F0

I want to make absolutely sure. You are using a 12864 LCD Display, and you can both turn the laser on and control the strength using the display?

With that assumption my best guess is that you have an issue with how you have set up the firmware. The ‘S’ parameter can be interpreted in different ways depending on your settings. Sometimes it defines a PWM value in the range of 0 to 255, sometimes it is spindle speed. I encourage you to get a copy of the Rambo firmware, and do a diff between the configuration.h and configuration_adv.h of the Rambo firmware and your firmware. I’m currently using Meld for my comparisons.

Another test you can run is to directly manipulate the PWM value of your pin 6 using a M42 g-code. If M42 works but the running file fails, then it points to a firmware configuration problem.

As for the brief flash, typically this occurs when the control board is turned on and is the result of a floating pin. The typical solution is to wire a 10K resistor between ground and the PWM pin. But, I think your flash is occurring at the beginning of your job, not when the control board is turned on, so I don’t know.

Thank you for taking the time to advise me.

Meanwhile I was reading on some forum a thing with the “I” ( i ) command between M3 and power so I tried it.

Below is the same gcode as above, with that " I " after the M3.
I edited the gcode from Lightburn and added the I.
Works with M03/M05 in Lightburn and I got some smoke, finally :slight_smile:

The Gcode from Lightburn puts in some M9 commands that I deleted because in Lightburn it was saying unknown command.

; LightBurn 1.0.04
; Marlin device profile, current position
; Bounds: X0 Y0 to X20 Y20
G21
G91
; Cut @ 700 mm/min, 100% power
M5 P1
G0X0 Y0 F0
; Layer C00
M3 I P1 S255
G1 Y20 F700
G1X20
G1 Y-20
G1X-20
M5 I P1
; return to starting pos
G0 X0 Y0 F0

So if I have these commands mixed up, how should I be able to use the inline ? or what would be a good workflow to work as they are? Should I edit every gcode generated with Lightburn?

Thank you in advance.

I just ran Meld between the two configuration_adv.h files. There are seven laser-related lines that are different between the Rambo (on the left) and the Ramps (on the right):

The third different line concerning active state would definitely account for the behaviors you are seeing and would also account for why you see a flash. My recommendation is to make sure all seven lines in your Ramps configuration_adv.h match the Rambo ones. Then change Lightburn back to using inline commands.

As for the M9 commands, ignore them. They just coolant commands. Coolant commands are not enabled in V1 maintained firmware. You could enable the M07 - M09 codes in the firmware in this section to get rid of the warnings:

/**
 * Coolant Control
 *
 * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off.
 *
 * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined.
 */
//#define COOLANT_CONTROL
#if ENABLED(COOLANT_CONTROL)
  #define COOLANT_MIST                // Enable if mist coolant is present
  #define COOLANT_FLOOD               // Enable if flood coolant is present
  #define COOLANT_MIST_INVERT  false  // Set "true" if the on/off function is reversed
  #define COOLANT_FLOOD_INVERT false  // Set "true" if the on/off function is reversed
#endif
2 Likes

Thank you, kind sir!

I did as you advised me above and everything worked great with Lightburn on Inline mode.

Now I will return to the cable management problem :slight_smile:

1 Like