Use of laser_power_inline

Hi, I would like to use Laserweb 4 to replace Lightburn to power my laser on my homemade MPCNC with the marlin firmware v2.0.9 and I enabled the laser_power_inline function to drive the laser smoothly as the normal mode was jerky. The Lightburn generated code looks like this :

; LightBurn 1.0.02
; Marlin device profile, absolute coords
; Bounds: X17.96 Y185.18 to X70.11 Y222.21
G21
G90
; Scan+Cut @ 50 mm/sec, 100% power
M9
M05
G0X50.536 Y185.245 F6000
G0 Z0
; Layer C03
G91
G1X1.25 F3000 I S0
G1X0.248 I S255
G1X6.713 I S0 F6000
G1X0.498 F3000 I S255
G1X7.341 I S0 F6000
G1X0.195 F3000 I S255
G1X1.25 I S0 F6000

I had a parameter in lightburn to choose between M106, M03 and Inline mode and I choosed the last one.
It seems that the M03 command has been replaced by the I letter.
Can you please tell me if there is a way to generate this type of code with Laserweb ?
I didnā€™t knew what to search on the forum to find an answer.

Thank you for your help.

David Mussard

Hi David,

[SEE MY UPDATED REPLY BELOW]

Unfortunately Laserweb doesnā€™t have a direct equivalent for the Inline mode you are using. Itā€™s a relatively recent Marlin innovation and LaserWebā€™s (current) generator has no way of supporting it.

I hope to be able to add this soon to the work I am doing, I see a way to do it. But for now Iā€™m afraid the only good advice I can give is to re-compile Marlin without this option and use the conventional Marlin2 laserweb config for this.

If any other Marlin users have any thoughtā€™s Iā€™d be interested to hear them :wink:

1 Like

OK; On reading this I think you can use LW:

You will need to set the power mode to ā€˜inlineā€™ in your start commands by adding (at the end):

M3 I

If I read the above document correctly, all subsequent G1 commands with a Sxxx parameter will apply the set power. You do not need the I parameter in the lineā€¦

You could also try the experimental dynamic mode (M4 I) if feeling brave.

Thanks for your help. I will try your suggestions as soon as Iā€™ll be back home monday.

Adding ā€˜M3 Iā€™ at the end of the header switches on the laser immediately so itā€™s not what we want. I replaced the ā€˜Sā€™ command by ā€˜I Sā€™ in parameters. It now works but I have to specify that it must add ā€˜M05ā€™ after each ā€œlaser onā€ command to switch off the laser on travelling mode. Moreover I have to tell the laser to move to X0 Y0 in the end in order to make the laser switch off because the laser state only change when the head is moving.
I guess this will need to be talked in another topic but it seems like the decimals of the power given by Laserweb is to big for Marlin (maybe) because at some random points it just keep going straight forward infinitely and I have to stop it manually to avoid the collision with the end of my CNC. So Iā€™m wondering if there is a way to limit the decimals.

Apologies.

I was confusing laser_power_inline with the real Laser feature of marlin 2.0.9, as documented here and enabled by setting LASER_FEATURE in the Marlin configuration. I didnt realise they are different.

I tried to do some research, but laser_power_inline appears to be pretty much undocumented, the only matches I get are to the Marlin M3 page, which says ā€˜dont use with laser_power_inlineā€™, and this bug, which doesnā€™t look promising.

And, I can confirm that LaserWeb does not produce code with the necessary G1 Xxxx Yyyy I Sxxx power setting lines used by laser_power_inline, and is unlikely to do so just to support this feature.

Since you already have Marlin 2.0.9 I would strongly advise you to not use this feature, disable it and instead turn on LASER_FEATURE in the configuration and re-flash the controller.

  • I know that is a painful thing to do, but it is the correct way to go.
  • LASER_FEATURE is documented, better supported, and brings compatibility with all common Gcode generators, including Lightburn and LaserWeb

Alright. Thank you for the help anyway Iā€™d like to flash back Marlin to normal mode but its too jerky when I want to raster images with grayscales. I guess Iā€™m stuck with Lightburn for the moment.

With LASER_FEATURE and "M4 I"moves should be smooth not jerky, because laser power can change WHILE moving. In this mode there are no laser on / off commands needed for each move, because the laser will only be active on G1, G2 or G3 commands while moving.