Laser turns off after following code is sent after M3


  • administrators

    No there is nothing inherent to heater 3, it's just the first PWM-capable output on the expansion connector.

    I'm wondering whether it would work to have M3 preset the laser power (without actually turning it on) in laser mode. Then the power you set with M3 would be used on subsequent G1 commands with no S parameter (but not on G0 commands). Do you think that would work for you?

    Meanwhile you could try using CNC mode (M453) which lets you map M3 to an output for spindle motor control in a similar way to M452. Note, in CNC mode, G0 commands ignore the feedrate and always use maximum speed as set by M203.



  • Hi. Im using LightBurn for generating gcode. Most of preset machine have persistent power so gcode have S power only on change. It will be good if M5 lock the output so none of G1 movements turn on laser. M3 without without Sxxx could unlock laser with previously setup power or with S to set new power. But Laser would only turn on with G1 movement. If S is included in G1 new power is set up. G0 cannot reset power.

    Now im using custom written program convert gcode. It reads line by line and if S power param is in this line i stor it, If G1 line without S i add S with stored power at the end.


  • administrators

    @bishop86 said in Laser turns off after following code is sent after M3:

    Hi. Im using LightBurn for generating gcode. Most of preset machine have persistent power so gcode have S power only on change. It will be good if M5 lock the output so none of G1 movements turn on laser. M3 without without Sxxx could unlock laser with previously setup power or with S to set new power. But Laser would only turn on with G1 movement. If S is included in G1 new power is set up. G0 cannot reset power.

    Are there any other firmwares that behave in this way?



  • @dc42 I've tired a lot of software (lightburn, laserweb4, lasergrbl) in the last few days that generate GCode using G1 Xnnn Ynnn Snnn to set the laser power. However, as @bishop86 mentioned, the S parameter is only included when the S is supposed to change, meaning G-Code will look like this:

    G1 X33.73 Y16.07 S255.00
    G1 X36.89 Y19.23
    G1 X36.94 Y19.30
    G1 X36.96 Y19.38
    

    This means that S is supposed to stick, and I doesn't do that currently. That's why @bishop86 wrote a script to append the S paramter to G1 lines that have it missing.

    In the meantime, would you be able to share the script you wrote @bishop86 ?


  • administrators

    Which firmware version are you running? The G1 S parameter is already sticky in 2.03beta2 (although I regard this as dangerous, and a very bad decision on the part of those who introduced the S parameter and made it sticky).



  • @dc42 Oh, I haven't tried the beta yet, still running 2.02. Will give it a try in the next days!


  • administrators

    Advance warning: in 2.03beta3 the G1/G2/G3 S parameter will only be sticky if you add parameter S1 to your M452 command.



  • Hi @bishop86 it's possible to send me your program please ?
    Thanks



  • Hi,
    Any progress on this?
    I ran in same situation with following code with Release 2.04 (Duet 2) and 1.25 (Duet 06/085).
    Tested also with 3.0beta12 (2019-11-02b1) using M452 C"exp.heater3" Q200.
    Config is in attached file.config.g
    Seems that heater3 output is turned off.
    gcode:
    ;Project bugbug
    ; *** START begin ***
    G90
    G21
    M84 S0
    G92 X0 Y0 Z0
    G00 X0.0000 Y0.0000 Z5.0000

    ;No. 2: Engraving 1
    G00 X25.7569 Y48.9645 Z5.0000
    G00 Z0.5000
    G01 Z0.0000 F1200
    M3 S255
    G01 X19.7518 Y30.6457 F750
    ;bug hits here. previus move is lasered ok, next 2 moves not.
    ;if run line by line (pasting one by one to console) all works ok.
    G01 X1.1829 Y30.6942
    G01 X16.1260 Y19.5851
    M5
    G00 Z5.0000
    G00 X0.0000 Y0.0000
    M05


  • administrators

    @morokolli, I'll test that when I get time.

    Are you able to configure your GCode generator to generate S parameters on the G1 commands instead of using M3? That's the modern way of doing laser engraving, and it benefits from velocity ramping in RRF3.



  • Tested with S parameter -> works like it should.
    I had to ask from CAM software developer is it possible. I'm using ESTLcam at moment.
    Waiting answer from there also.



  • I did more testing.
    While using attached G-Code error hits in even with S255 parameter.
    First square is burned ok, then on another part start and goes well until light turns off after couple moves (somewhere around line 30-32) and comes back after next move.
    Using Release 3.0beta12
    Sample G-code:
    [0_1573400684875_peukku.nc](Uploading 100%)


  • administrators

    Did you select sticky laser power in your M452 command?

    Your file upload to this forum doesn't appear to have worked. Please try again.



  • Reload of sample and config.g.
    config.g.txt
    peukku.nc.txt


  • administrators

    @morokolli said in Laser turns off after following code is sent after M3:

    Reload of sample and config.g.
    config.g.txt
    peukku.nc.txt

    M452 C"exp.heater5" Q200 ; laser uses heater3 pin, PWM frequency 100Hz

    You didn't select sticky laser power. https://duet3d.dozuki.com/Wiki/Gcode#Section_M452_Select_Laser_Printer_Mode



  • Still same thing while using:
    M452 C"exp.heater5" Q200 S1
    Here's video:
    https://www.youtube.com/watch?v=2FMmwe_Vmpk



  • More debug info:
    If F value in G1 F300 is more than F1015 All lines are done as they should. If i's lower, piece is missing. And if speed is added over F1200, next line starts to suffer. Hopefully picture explains better:
    error_finding.jpg


Log in to reply