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

    Tool (un)loading checks AFTER tfree#.g / tpre#.g

    Scheduled Pinned Locked Moved
    CNC
    2
    4
    184
    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.
    • punktphilundefined
      punktphil
      last edited by

      Hey,
      I have a toolchanger on my Duet CNC (single spindle, pneumatic clamp for tools).
      Toolchanging works as intended. Recently I included a magnetic sensor which checks for the tool in the spindle.
      I would like the tfree#.g and tpre#.g to check, if the (un)loading was successful.
      My approach is:

      ...
      if sensors.gpIn[4].value = 0
          echo "loading tool failed!"
          T-1 P0
          echo >"persistence/last_tool.g" ""
          abort "loading tool failed!"
      else
          echo "loading tool successful!"
          echo >"persistence/last_tool.g" "T"^{param.S}^" P0"
          G100 P{param.S}
      

      (G100 is a macro to Z0 the tip of the tool with a micro switch, param.S is tool index)
      Problem:

      T-1 P0
      

      won't do the trick since RepRapFirmware will mark the tool as "selected" AFTER the tpre#.g (in this case) runs.
      Is there a way to tell RRF that loading was unsuccessful?

      Thanks,
      phil

      oliofundefined 1 Reply Last reply Reply Quote 0
      • oliofundefined
        oliof @punktphil
        last edited by oliof

        @punktphil P0 parameter will skip the toolchange macros. Soes it work if you leave that out?

        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

        punktphilundefined 1 Reply Last reply Reply Quote 0
        • punktphilundefined
          punktphil @oliof
          last edited by

          @oliof the code i posted is in one of the tool change macros. Calling another macro (T# without the P0) won't help me. In fact, T-1 P0 unselects the current tool without running any macros. Which is what i want, but the tool gets reselected after my code by RRF.

          oliofundefined 1 Reply Last reply Reply Quote 0
          • oliofundefined
            oliof @punktphil
            last edited by

            @punktphil got you now. I would have expected abort to do the trick as well. Maybe try M99 instead.

            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

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