SPINDLE_LASER_ENABLE anyone used this feature in marlin

i am going through the pdf on adding a laser to my mpcnc and found this “feature” in marlin (SPINDLE_LASER_ENABLE) has anyone else enabled it or used it i cant find mention in the forum or facebook but it seems like something that would be enabled on a cnc! am now doing a bit of research but wanted to know if others have used it or if its not worth using for some reason.

thanks

bill

I don’t believe it is an option on my currently suggested firmware, but it is in the newer versions. It just makes choosing the output pin easier. Have a look at the marlin site for more details. I will have updated firmware when it is more stable with these things detailed out a little better.

1 Like

You will also have to use different commands in your laser gcode that what is used in the tutorials.

thanks yeah im using your duel endstops version i guessed its different gcodes hence i thought i would ask if others have used it do you think its worth investigating further /something usefull for the mpcnc?

found this re gcode

Usage

M3 S(power)
Argument Description
S(power) Spindle speed or laser power

Examples

Set spindle rotation clockwise at 50%
M3 S128
Turn on the laser at full power
M3

right i think im nearly ready to enable it but just want a bit of advice regarding the following settings…

The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power
*
* SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT
* where PWM duty cycle varies from 0 to 255
*
* set the following for your controller (ALL MUST BE SET)
*/

#define SPEED_POWER_SLOPE 118.4
#define SPEED_POWER_INTERCEPT 0
#define SPEED_POWER_MIN 5000
#define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM

//#define SPEED_POWER_SLOPE 0.3922
//#define SPEED_POWER_INTERCEPT 0
//#define SPEED_POWER_MIN 10
//#define SPEED_POWER_MAX 100 // 0-100%

im presuming i need to use the bit thats commented out instead for the laser otherwise 128 wouldn’t be 50%?!? do i understand that correctly?

just clicked its for the m3 command so you can type the rpm of the motor instead of 1-255 so yeah i will uncomment bottom bit…

That code translates from the GCode to PWM, so if you want:

M3 S0 ; off
M3 S128 ; 50%
M3 S255; 100%

Then you want:

#define SPEED_POWER_SLOPE 1.0
#define SPEED_POWER_INTERCEPT 0
#define SPEED_POWER_MIN 1 // Or maybe 0? I’m not sure if 1 is needed to actually turn it off, or if 1 will mean you can never turn it off…
#define SPEED_POWER_MAX 255

The bottoms one will give you this:
M3 S0 ; off
M3 S50 ; 50%
M3 S100 ; 100%
M3 S10 ; min
M3 S5 ; Off still, I think. Otherwise 10%…

1 Like

yeah cheers not had time to do any testing yet but hoping this will be the way to go instead of the fan speed method…