Adding a tool loaded detection switch

Discussion in 'Tool heads & ToolChanger' started by dc42, Jan 14, 2020.

  1. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    450
    Likes Received:
    204
    Does anyone have a design (preferably printable) for mounting a tool loaded detection switch on the TC head? Greg tells me that the wiring for one is already present in the loom. I am testing RRF 3.1beta conditional GCode on the TC, and an indication of whether or not a tool is loaded would be useful to have. For example, it could be used to prompt the user to unload the tool manually if you start the machine with a tool loaded; and to check that tools have been loaded and unloaded successfully.
     
  2. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    165
    Likes Received:
    32
    I saw the cable but didnt yet find any information about that.
    I connected it to e0_stop, 3 places next to the z_stop at a duet-wifi.

    My first thought was to include a switch atop of the toolchanger into the part that holds the metal string and the cables.
    But then I dropped the construction because I did not find any clues within the firmware/config about the usage.
    My plan was to use the same switch greg used for the z-homing. I already saw your changelog about the
    "if, elif, else, while, break, continue, echo and abort"
    Very interesting.

    After I followed your hints at https://forum.e3d-online.com/threads/from-rrf2-to-rrf3-on-duet2-wifi.3500/#post-35270
    to finally migrate to RRF 3.x
    I will have a close look into that again.

    I then should have working tool docks as well. My tool docks which I ordered seperatly at 2019/12/13 are "still ariving". At least the parts now seem to be in germany :D

    Greetings
     
  3. schneik

    schneik Member

    Joined:
    Nov 3, 2019
    Messages:
    16
    Likes Received:
    7
    I was going to experiment with an IR probe (https://duet3d.dozuki.com/Wiki/IR_Probe) and position each toolheads trigger surface at a different offset. Assuming no coupling errors this should enable the IR sensor to detect a tool head and based off the value even which head is loaded.
    Another option that is interesting is an rfid tag...
     
    1013D likes this.
  4. Jai Stanley

    Jai Stanley Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    115
    Likes Received:
    60
    I would also consider having a sensor on each tool dock position for robustness. After all; in the event of a reset it's useful to know if a tool is already loaded; but if you do not know which, it's not as useful. If you could home with a tool attached, sense a tool is loaded and that all but one isn't: you can re-home and put said tool back. You can also check for tool presence in a while loop in case one falls off during operation, reverting to an exception condition.

    Just a thought.

    Jai
     
  5. John Meacham

    John Meacham Well-Known Member

    Joined:
    Dec 18, 2019
    Messages:
    48
    Likes Received:
    17
    You can't really home with a tool loaded unfortunately I discovered, the hemera fan bumps into the frame well before the x axis gets to its homing point.

    Relaxing the need to home Z before tool changes would be good, just move it 20mm down and assume that is good enough to not get in the way.
     
  6. Paul Meyer

    Paul Meyer Well-Known Member

    Joined:
    Dec 18, 2019
    Messages:
    49
    Likes Received:
    8
    Another possibility is for the duet/RRF to remember which tool is loaded during power-down, or to give the option to ask the user (easier on the PanelDue than the web interface, I suppose).

    The problem I’m trying to solve is the basic one I have now: the printer was powered off or emergency stopped during a print (experimental GCode gone wrong, bad print that needs to stop *now*, or driving into bed/frame for some reason). In this situation, I need to manually calibrate C while getting read to grab the soon-to-be-dropped tool and return it to it’s dock. It would be much cleaner if the printer could handle that on it’s own.

    Whenever a tool is loaded, that ‘state’ could be saved to flash or SD card. On powerup, that state could be checked. Wouldn’t be perfectly reliable, but better than the current where it just assumes no tool loaded and will drop the tool while homing c.

    All of this assumes there is a way to home enough to unload the tool and then continue full unloading. That means homing X/Y perfectly, and C enough to be able to fully release the tool once in the doc. Conveniently Z would not need to be homed. I don’t know enough about the c mechanics to know if “unlocked” is a position that can be achieved without careful homing.

    X/Y could be achieved one of two ways:
    A) extend the TC head such that it will always impact the left/front frames with any tool loaded
    B) add x/y limit switches in a position that will hit the TC head only without interference from the loaded tool

    A sensor on the TC and each doc is a much simpler way to achieve the same thing...
     
  7. smoki3

    smoki3 Active Member

    Joined:
    Aug 19, 2019
    Messages:
    41
    Likes Received:
    11
    I think the most useful cases are to prevent homing with a tool and check if the tool change is successful.

    Technically I would recommend to place a IR Sensor and LED on the Tool Changer to check if the tool plate is in front of the tool changer. Maybe a TCRT 5000
     
    #7 smoki3, Jan 16, 2020
    Last edited: Jan 16, 2020
  8. mhe

    mhe Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    279
    Likes Received:
    76
    Instead of putting something in the toolhead, wouldn't it be easier to check for tool presence by having a switch in each dock and check there? If all 4 tools are docked, there cannot be one on the toolhead. Should be kind of easy to check with the Duet, the logic might be pretty similar to those sensors who let you know when you've run out of filament?
     
  9. 1013D

    1013D Active Member

    Joined:
    Jan 17, 2020
    Messages:
    28
    Likes Received:
    3
    nice and simple, I like it. just need 4 micro switches and some wiring.
     
    schneik likes this.
  10. Beat

    Beat Active Member

    Joined:
    Apr 2, 2016
    Messages:
    31
    Likes Received:
    5
    I will switch to the paradigm outlined by @mhe but for the time being, I have the microswitches on the tools as described here. The system is now safe and a tool present after a reset can be unmounted properly. But there are still one or two things which do not works as elegantly as I would like them to.
     
  11. John Meacham

    John Meacham Well-Known Member

    Joined:
    Dec 18, 2019
    Messages:
    48
    Likes Received:
    17
    How do you handle homing with a tool attached? the tool hits the edge before the carriage does when doing X and Y homing for me so it ends up with different offsets when homing with tools attached. Also, it's probably not great for the tools to be rammed into the sides like that.
     
  12. Beat

    Beat Active Member

    Joined:
    Apr 2, 2016
    Messages:
    31
    Likes Received:
    5
    My standard bowden tools don't (when homing Y before X). If your tools do, you might want to have a little protrusion in the left front corner of the frame to make sure the carriage hits the side before the tool when homing X. That should be easy enough.
     
    #12 Beat, May 8, 2020
    Last edited: May 8, 2020
  13. W1EBR.Gene

    W1EBR.Gene Well-Known Member

    Joined:
    Apr 10, 2016
    Messages:
    257
    Likes Received:
    36
    Two wires from the tool head to the microcontroller make a simple switch easy, if all you want to know if whether a tool in mounted on the tool head. An "old school" way to use 2 wires to identify which tool is mounted and therefore make it possible to put it back after homing Y and X, is to use different resistance values for each tool. A thermistor input port could be used to read the resistance and software can determine what to do next. This could be implemented in hardware many different ways, for example, putting a resistor on each tool and 2 probes on the tool head or putting a spring loaded, variable resistance probe on the tool head and having it engage each tool in a unique way (different depth per tool, a set of holes that are filled or not filled, ...) Perhaps the simplest solution would be three micro switches wired such that two of them select a resistance based on whether they make contact or not, and the third one either passes along the sum of the resistances or a value ( maybe infinite or open) which indicates no tool is present. I am going to see what is available to make this work and I'll post what I find.
     
    Olle Wreede likes this.
  14. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    450
    Likes Received:
    204
  15. Rene

    Rene Active Member

    Joined:
    Sep 1, 2019
    Messages:
    29
    Likes Received:
    13
    all the homing-related problems: Simply put

    T-1

    before any of the homing scripts. Now, *IF* a tool is loaded, it will be put back automatically before the homing sequence.
    If you lost XYZ homeposition somehow (Powerloss or such), then start the "home all" process with the Coupler-Axis before all other axis, which will go to the "open" position at the end of its cycle. Now the tool is free to grab and you can put it back on its dock.
     
  16. W1EBR.Gene

    W1EBR.Gene Well-Known Member

    Joined:
    Apr 10, 2016
    Messages:
    257
    Likes Received:
    36
    Hi Rene,

    T-1 at the start of homing all (or maybe just homing Z) is a great idea.

    I'm not crazy about the "grab the tool" solution (which is what I currently do). Refusing to home when a tool is attached (after having done a board reset or even losing actual position due to a tool problem) would safeguard me against starting a print job that included homing. If I know which tool is mounted, I can home Y and then X, move the tool to the docking position, and then home the coupler and release the tool safely.

    Gene
     
  17. W1EBR.Gene

    W1EBR.Gene Well-Known Member

    Joined:
    Apr 10, 2016
    Messages:
    257
    Likes Received:
    36
    @dc42 or other duet firmware gurus, can pre version3.x firmware be used to detect and act on the state of a switch other than endstops and z-probes? If yes, how is it done or where is it documented?

    Thanks!
     
  18. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    450
    Likes Received:
    204
    You can use switches for triggers in RRF2, see the M581 command. But the conditional GCode feature in RRF3 offers a lot more possibilities.

    In case you didn't realise it, RRF is available for Duet 2 as well as Duet 3.
     

Share This Page