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

button Tigger files

Scheduled Pinned Locked Moved
Third-party add-ons
3
6
306
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
    broncosis
    last edited by 3 Dec 2022, 05:57

    I have a few buttons attached to my Duet2wifi

    and I have a simple macro with a global variable to track weather filament is loaded or not

    I recently upgraded from 3.4.2 to 3.4.4 and I noticed a change in behavior

    my trigger3.g file

    ;load unload trigger macro
    if global.filamentload = 1
    M98 P/macros/unloadfilament.g
    M99
    elif global.filamentload = 0
    M98 P/macros/loadfilament.g
    M99

    before the upgrade this worked fine now it will load the filament and then right after it will unload the filament

    I have 2 theories one is I am getting bounce on the button or the way M99 or trigger files work has changed slightly

    here is my button config just in case

    ; Buttons
    M950 J1 C"!^e1stop" ; Input 1 uses e1Stop pin, inverted, pullup enabled (yellow)
    M950 J2 C"!^e0stop" ; Input 2 uses e0Stop pin, inverted, pullup enabled (white)
    M950 J3 C"!duex.e2stop" ; Input 3 uses panel due pin, inverted, pullup enabled (blue)
    M950 J4 C"!duex.e3stop" ; Input 4 uses panel due pin, inverted, pullup enabled (black)
    M950 J5 C"!duex.e4stop" ; Input 5 uses panel due pin, inverted, pullup enabled (green)
    M950 J6 C"!duex.e5stop" ; Input 6 uses panel due pin, inverted, pullup enabled (red)
    M581 T2 P1 S1 R2 ; power on and off button (yellow)
    M581 T3 P2 S1 R2 ; load unload filament while printer is not running (white)
    M581 T4 P3 S1 R0 ; pause / resume while print is running (blue)
    M581 T5 P4 S1 R2 ; lower bed 50mm (black) while the printer is not running (black not printing)
    M581 T6 P4 S1 R1 ; lower bed 50mm (black) while print is paused (black while printing)
    M581 T0 P6 S1 R0 ; estop (red)

    I am going to relocate everything from the trigger3 to a separate Macro as it is recommended the trigger files be one line and see if that helps

    if we had a "R" option for while print is paused that would be awesome would save some extra coding

    anyways thanks

    undefined 1 Reply Last reply 3 Dec 2022, 15:52 Reply Quote 0
    • undefined
      o_lampe
      last edited by 3 Dec 2022, 07:51

      I read this because I wanted to know what Winnie-Pooh files are 😉

      undefined 1 Reply Last reply 4 Dec 2022, 19:59 Reply Quote 2
      • undefined
        dc42 administrators @broncosis
        last edited by 3 Dec 2022, 15:52

        @broncosis said in button Tigger files:

        am going to relocate everything from the trigger3 to a separate Macro as it is recommended the trigger files be one line and see if that helps

        Where did you read that? It's only the power fail command string that has to be on one line.

        If the problem is bounce, that can normally be avoided by including a G4 delay command of e.g. 1 second at the end of the trigger macro, or in your case before each M99 command because it won't reach the end.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        undefined 1 Reply Last reply 4 Dec 2022, 19:57 Reply Quote 0
        • undefined
          broncosis @dc42
          last edited by 4 Dec 2022, 19:57

          @dc42
          well thats entirely possible I read that and misunderstood it or because I have read a ton
          lately I am just getting things confused

          thanks for clearing it up
          I have a bunch more print to get done in the next while so I will keep testing and let you know
          I am leaning more to it being bounce and the board is queuing multiple presses

          some times it will power on then power off or vise versa when I tap my power button too

          this is my trigger2.g file I use for power control

          ;powerbutton trigger macro
          if state.atxPower == true ;if on turn off
          M104 S0
          M140 S0
          M81
          elif state.atxPower == false ;else if off turn on
          M80
          G4 s1

          thanks Again for the reply

          undefined 1 Reply Last reply 4 Dec 2022, 21:18 Reply Quote 0
          • undefined
            broncosis @o_lampe
            last edited by 4 Dec 2022, 19:59

            @o_lampe LOL well I guess I caught a hefalump

            1 Reply Last reply Reply Quote 0
            • undefined
              broncosis @broncosis
              last edited by 4 Dec 2022, 21:18

              ok after a few tries I noticed that it seems to be a bounce I can't see what that board is Queuing but the power macro runs fast enough that I can see the results pretty easy and a quick push
              would lead to power on then off where a push and brief hold would result in the expected behavior

              I added a 0.1uf cap to each of my 6 buttons I have and it seems to reduced this effect to the point where I can not reproduce it. so here's hoping that is all it was

              thanks again @dc42 its amazing the amount of time and support you put in
              here

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