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

    Run macro as part of homing move

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    3
    6
    286
    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.
    • nrivieraundefined
      nriviera
      last edited by

      There may well be a simpler way however I'm trying to setup my mishmash tool changer to unload the tool before doing a Z-home. I have a trigger on the 1LC board that when triggered stores the tool with each tool head having their own trigger. The idea being that if there is a tool on the head it is parked in it's holder prior to probing. The issue I'm having is that I currently have macros for each trigger and the triggers are enable when they're needed and disabled when they're not.

      The issue I have is that the trigger macros are not being run in sequence when the Home-Z button is pressed and run at the end of the probe move which means the tool remains on the head which causes a suboptimal head crash. I have tried both using pauses as well as making a separate homez macro that the homez.g refers to but it still runs in the same backward sequence. Running the macro seperately runs perfectly even before a first home.

      my homez.g

      m98 P"0:/macros/HomeZ"
      

      my HomeZ macro

      Setup unload before probe
      M581 P11 T11 R0
      M582 T11
      M581 P11 T11 R-1
      
      G4 S0
      
      G91              ; relative positioning
      G1 H2 Z5 F420   ; lift Z relative to current position
      G90              ; absolute positioning
      G1 X190 Y50 F6000 ; go to first probe point
      G30 X150 Y150    ; home Z by probing the bed
      
      G1 Z0
      

      I suspect that this could be done with a conditional gcode however I can't seem to find how to check if a trigger is depressed or not.

      1 Reply Last reply Reply Quote 0
      • A Former User?
        A Former User
        last edited by A Former User

        This post is deleted!
        nrivieraundefined 1 Reply Last reply Reply Quote 0
        • nrivieraundefined
          nriviera @A Former User
          last edited by

          @herve_smith Thanks for picking up my copy and paste error. Unfortunately running them manual still doesn't seem to make things any different. The best solution I've found is issuing a dwell of 5s after the trigger to give it time to run the unload command.

          nrivieraundefined 1 Reply Last reply Reply Quote 0
          • nrivieraundefined
            nriviera @nriviera
            last edited by

            I eventually managed to solve my issue by working out the conditional GCode (if sensors.gpIn[In].value = 1 with the macro in the file. Just would be nice to be able to keep this information centrally in a macro.

            1 Reply Last reply Reply Quote 0
            • DIY-O-Sphereundefined
              DIY-O-Sphere
              last edited by

              @nriviera said in Run macro as part of homing move:

              The issue I have is that the trigger macros are not being run in sequence

              You can achieve this by placing

              M400
              

              at the end of the sequence which must be fully completed

              (UTC+1)

              nrivieraundefined 1 Reply Last reply Reply Quote 0
              • nrivieraundefined
                nriviera @DIY-O-Sphere
                last edited by

                @diy-o-sphere unfortunately it doesn't seem (G4 S0 has the same function) to work with the home buttons.

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