• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    punktphil
    last edited by 9 May 2023, 09:24

    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

    undefined 1 Reply Last reply 9 May 2023, 09:39 Reply Quote 0
    • undefined
      oliof @punktphil
      last edited by oliof 5 Sept 2023, 09:40 9 May 2023, 09:39

      @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<>

      undefined 1 Reply Last reply 9 May 2023, 10:09 Reply Quote 0
      • undefined
        punktphil @oliof
        last edited by 9 May 2023, 10:09

        @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.

        undefined 1 Reply Last reply 10 May 2023, 06:51 Reply Quote 0
        • undefined
          oliof @punktphil
          last edited by 10 May 2023, 06:51

          @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
          4 out of 4
          • First post
            4/4
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA