• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Weird G-Code needed on my duet maestro wifi!

Scheduled Pinned Locked Moved
CNC
3
6
274
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    perigonza
    last edited by perigonza 10 Jan 2020, 15:14 1 Oct 2020, 15:13

    Hi!

    Newbie here, upfront sorry if that is an easy one but I can't find any info in the forum or anywhere actually.

    Long story made sort. I have a workbee CNC with a duet maestro wifi board and a 5W diodelaser cutter on it from OptLasers (no other cutter on the machine, just the laser unit).

    After loads of problems to make it work we finally have it ready to cut but ... then there is a problem. When we send G-Code to the machine it works weirdly. The problem is with the codes G0 G1 G2 and G3. They accept as parameters S for the power of the tool (PWM 0-255) and F for speed (mm/min or whatever configured).

    Now, normally you have to write these two params on the first line of code and it is resilient until the next change happens, like:

    ;(Header)
    M5
    M307 H3 A-1 C-1 D-1 ; Disable Heater output on pin #8 HEATER3
    M452 P3 R255 F1000 ; Enable Laser mode, on output 3 (HEATER3), with max PWM value 255, and a PWM frequency 1000
    G0 X0 Y0
    G90 ; absolute positions
    G21 ; metric
    M3 S0
    ;(Header end)
    G0 X0.0000 Y17.5000 Z0.0000 F10000 S0 ;Used for the first time Laser ON Speed 10000
    G3 X35.0000 I17.5000 J0.0000 ;Resilient
    G3 X0.0000 I-17.5000 J0.0000 ;Resilient
    G0 Y0.0000 F10000 S0 ; used second time , Laser OFF
    ;(Footer)
    M5
    G90
    G0 X0 Y0
    ;(Footer end)

    As you can see only the first G0 command has the F and S parameters and the following just use whatever was stated. This is the G-code all the generators I've tried do generate.

    Now this is the code that works (just a simple circle, G1 and G2 act the same):

    ;(Header)
    M5
    M307 H3 A-1 C-1 D-1 ; Disable Heater output on pin #8 HEATER3
    M452 P3 R255 F1000 ; Enable Laser mode, on output 3 (HEATER3), with max PWM value 255, and a PWM frequency 1000
    G0 X0 Y0
    G90 ; absolute positions
    G21 ; metric
    M3 S0
    ;(Header end)
    G0 X0.0000 Y17.5000 Z0.0000 F10000 S0
    G3 X35.0000 I17.5000 J0.0000 F1000 S255 ; F & S on each and every line
    G3 X0.0000 I-17.5000 J0.0000 S255
    G0 Y0.0000 F10000 S0
    ;(Footer)
    M5
    G90
    G0 X0 Y0
    ;(Footer end)

    As you can see, here there is F and S parameter on most lines, I belive the relevant one is just the S but I'm not really sure of that.

    So my question is, is that the normal behavior to be expected from Duet? why does it need that strange (to me) G-Code? or maybe it is not due to the board but something else in which case, any ideas how to make it work as it should?

    Thanks for your attention, I hope to hear back soon from you guys.

    If you need any other information from my do not hesitate to ask!

    Pedro

    1 Reply Last reply Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by 1 Oct 2020, 17:30

      I'm not a laser guy, but have you reviewed these?

      https://duet3d.dozuki.com/Wiki/Gcode#Section_G0_G1_Move

      https://duet3d.dozuki.com/Wiki/Laser_PWM_control

      Z-Bot CoreXY Build | Thingiverse Profile

      undefined 1 Reply Last reply 2 Oct 2020, 07:39 Reply Quote 0
      • undefined
        jay_s_uk
        last edited by 1 Oct 2020, 17:35

        You can set the laser as "sticky" using M452. So the gcode you have will then work

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        undefined 1 Reply Last reply 2 Oct 2020, 07:44 Reply Quote 1
        • undefined
          perigonza @Phaedrux
          last edited by 2 Oct 2020, 07:39

          @Phaedrux Thanks mate, yeap, that was my first lecture but didn't help solve the problem, thanks for pointing
          Pedro

          undefined 1 Reply Last reply 2 Oct 2020, 19:11 Reply Quote 0
          • undefined
            perigonza @jay_s_uk
            last edited by 2 Oct 2020, 07:44

            @jay_s_uk Yes! it worked this way, thank you so much! That completely solved the issue. Just had to update the header and voila!

            Really, thank you mate,

            Pedro

            1 Reply Last reply Reply Quote 1
            • undefined
              Phaedrux Moderator @perigonza
              last edited by Phaedrux 10 Feb 2020, 19:12 2 Oct 2020, 19:11

              @perigonza said in Weird G-Code needed on my duet maestro wifi!:

              that was my first lecture but didn't help solve the problem

              That's odd, because I'm quite sure both mention using M452 for laser mode.

              https://duet3d.dozuki.com/Wiki/Gcode#Section_M452_Select_Laser_DeviceMode

              Z-Bot CoreXY Build | Thingiverse Profile

              1 Reply Last reply Reply Quote 0
              4 out of 6
              • First post
                4/6
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA