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

    Auto Tool Height Measurement

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    5
    35
    1.7k
    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.
    • Terryundefined
      Terry
      last edited by

      I am trying to add tool height measurement to the E3D Toolchanger using a touch-off switch on the wiper gantry.

      FCA6A53E-9E88-45AB-9333-7CEAB26B8A3A_1_105_c.jpeg

      The idea was that the gantry (on axis V) would home to a known absolute position using the microswitch at the bottom of travel (just visible on top of the motor, by the rail).

      The tool tip would be centred using a camera and then positioned in XY over the touch switch. I was planning to use G1 V1 H4 F1000 to move the gantry in the upward direction until the switch contacted the tool, then calculate the difference between the absolute position and the calibrated Z0 to get the new tool offset.

      Unfortunately, setting a second end stop on the V axis seems to overwrite the first? Any suggestions as to how I could work around this bug, please?

      fcwiltundefined 1 Reply Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt @Terry
        last edited by

        @Terry

        You can set the end stop settings as needed for each phase of the operation.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        1 Reply Last reply Reply Quote 0
        • Vetiundefined
          Veti
          last edited by

          interesting concept. how is the repeatability of the button?

          Terryundefined 1 Reply Last reply Reply Quote 0
          • Terryundefined
            Terry
            last edited by

            Ok, setting and resetting the endstops in the macro allows me to sense the button press but unfortunately G1 H4 doesn't do what I expected. It seems that what it does is travel until the switch is triggered and then sets the user position to the value of the move that was commanded.

            This means that I lose my original calibration and thus can't calculate a position.

            I need a way to move until a switch is triggered without any side effects?

            fcwiltundefined 2 Replies Last reply Reply Quote 0
            • Terryundefined
              Terry @Veti
              last edited by

              @Veti Not able to test yet for this specific manufacturer, but there are commercial machines that use these switches for this purpose, so I expect it to be as repeatable as a microswitch.

              1 Reply Last reply Reply Quote 0
              • fcwiltundefined
                fcwilt @Terry
                last edited by

                @Terry said in Auto Tool Height Measurement:

                Ok, setting and resetting the endstops in the macro allows me to sense the button press but unfortunately G1 H4 doesn't do what I expected. It seems that what it does is travel until the switch is triggered and then sets the user position to the value of the move that was commanded.

                This means that I lose my original calibration and thus can't calculate a position.

                I need a way to move until a switch is triggered without any side effects?

                How about:

                H3 terminate the move when the endstop switch is triggered and set the axis limit to the current position, overriding the value that was set by M208.

                Then you can use M208 to put things back as they should be.

                Frederick

                Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                1 Reply Last reply Reply Quote 0
                • Terryundefined
                  Terry
                  last edited by

                  H3 appears to do the same as H4, but also changes the min travel extent value.

                  I think this maybe a bug as that isn't the expected behaviour.

                  fcwiltundefined 1 Reply Last reply Reply Quote 0
                  • fcwiltundefined
                    fcwilt @Terry
                    last edited by fcwilt

                    @Terry said in Auto Tool Height Measurement:

                    H3 appears to do the same as H4, but also changes the min travel extent value.

                    I think this maybe a bug as that isn't the expected behaviour.

                    If it does that it would seem to be a bug - nothing in the docs suggests it should do that.

                    What firmware version are you using?

                    I have 3.2.2 and can test that.

                    Frederick

                    Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                    1 Reply Last reply Reply Quote 0
                    • Terryundefined
                      Terry
                      last edited by

                      Thanks. I am on 3.2.0 currently and this axis and switches are on a Duet 3 Expansion 3HC board.

                      fcwiltundefined 1 Reply Last reply Reply Quote 0
                      • Terryundefined
                        Terry
                        last edited by

                        On a typical CNC platform, I would expect at least 3 triggers per axis.

                        Endstops would be min and max travel indicators and would be continuously active unless explicitly disabled so they could stop motion before a physical collision (the machine may also include emergency stop cutouts at the physical limits to cut power in a runaway controller scenario). It should be possible to detect unexpected over-travel as a result of lost steps and recover by re-homing.

                        One or more reference triggers should also exist, for accurate and efficient homing. These should be inboard of the travel limits to avoid harm to the machine during homing operations and may sit in the middle of the travel range to enable efficient re-calibration during long operations. Typically they would only be active during reference operations.

                        Endstops need to be active during homing in case the assumed start position or travel direction is wrong.

                        Single active endstop-as-home-reference is a cost-saving hack that is acceptable for a $500 3D printer but can result in injury or physical damage to the machine in larger and more powerful setups, so it would be nice if we could support best practice in the future?

                        fcwiltundefined 1 Reply Last reply Reply Quote 0
                        • fcwiltundefined
                          fcwilt @Terry
                          last edited by

                          @Terry said in Auto Tool Height Measurement:

                          Thanks. I am on 3.2.0 currently and this axis and switches are on a Duet 3 Expansion 3HC board.

                          Could you use G60 along with G1 moves with the R parameter to obtain the desired result?

                          Frederick

                          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                          Terryundefined 1 Reply Last reply Reply Quote 0
                          • fcwiltundefined
                            fcwilt @Terry
                            last edited by

                            @Terry said in Auto Tool Height Measurement:

                            Endstops would be min and max travel indicators and would be continuously active unless explicitly disabled so they could stop motion before a physical collision

                            You can do that with triggers. From one of my printers:

                            ; ****************************************************************************************************
                            ; external buttons (P = pin #, T = trigger #, R = when to trigger (0 = always, 1 = printing), S = what edge (I->A = 1, A->I = 0, -1 = ignored)
                            ; --- T0 does emergency stop
                            ; --- T1 does pause (see M25)
                            ; --- T# runs macro trigger#.g
                            ; ****************************************************************************************************
                            
                            M950 J2 C"!^duex.e6stop"
                            M581 P2 T0 R0 S0			; does emergency stop
                            
                            M950 J1 C"^e0stop"
                            M581 P1 T2 R0 S0			; runs trigger2 which does M999 (board reset)
                            

                            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                            Terryundefined 1 Reply Last reply Reply Quote 0
                            • fcwiltundefined
                              fcwilt @Terry
                              last edited by

                              @Terry said in Auto Tool Height Measurement:

                              Ok, setting and resetting the endstops in the macro allows me to sense the button press but unfortunately G1 H4 doesn't do what I expected. It seems that what it does is travel until the switch is triggered and then sets the user position to the value of the move that was commanded.

                              I think I did not understand what you were saying.

                              With G1 H4 and G1 H3 the axis is at some position when the end stop is triggered - this position should be what appears in the DWC.

                              Does that not happen?

                              Frederick

                              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                              1 Reply Last reply Reply Quote 0
                              • Terryundefined
                                Terry
                                last edited by Terry

                                With both G1 H3 and G1 H4, the machine and user positions are overwritten as soon as the switch is triggered. In absolute mode, the axis value is set equal to the destination value that was commanded in the move. In relative mode, the axis position value is set to 1.

                                So, for example, starting at machine coordinate V=50 and commanding G1 H4 V2, the axis will move towards V=2 but if the switch is pressed before it gets there, motion will stop and the current position of V will be declared to be V=2, changing the calibration.

                                1 Reply Last reply Reply Quote 0
                                • Terryundefined
                                  Terry @fcwilt
                                  last edited by

                                  @fcwilt G60 wouldn't work because calibration is lost.

                                  fcwiltundefined 1 Reply Last reply Reply Quote 0
                                  • Terryundefined
                                    Terry @fcwilt
                                    last edited by

                                    @fcwilt Triggers can't stop motion in a controlled manner, so at best you can call an emergency stop and lose system calibration. This is why endstop circuitry needs to exist inside the motion control loop - the endstop triggers need to be interrupts that can cancel motion at very low latency without losing position.

                                    1 Reply Last reply Reply Quote 1
                                    • fcwiltundefined
                                      fcwilt @Terry
                                      last edited by

                                      @Terry said in Auto Tool Height Measurement:

                                      @fcwilt G60 wouldn't work because calibration is lost.

                                      How so?

                                      If you save the current position and then return to it how does that affect calibration?

                                      Frederick

                                      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                      1 Reply Last reply Reply Quote 0
                                      • Terryundefined
                                        Terry
                                        last edited by

                                        G60 would store a position relative to the calibration referenced against the fixed endstop. Any move detecting the mobile endstop will cause the axis to re-reference against that position. Any subsequent G2 R would return to a saved position relative to the new calibration, so not the original absolute position in the machine framework.

                                        fcwiltundefined 1 Reply Last reply Reply Quote 0
                                        • fcwiltundefined
                                          fcwilt @Terry
                                          last edited by

                                          @Terry said in Auto Tool Height Measurement:

                                          G60 would store a position relative to the calibration referenced against the fixed endstop. Any move detecting the mobile endstop will cause the axis to re-reference against that position. Any subsequent G2 R would return to a saved position relative to the new calibration, so not the original absolute position in the machine framework.

                                          Under firmware 3.2.2 I did a H3 move.

                                          When the end stop was triggered the movement stopped and the M208 setting for Z min was updated using the Z position at the moment the end stop was triggered.

                                          How does that cause the reference for the axis to change?

                                          Frederick

                                          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                          1 Reply Last reply Reply Quote 0
                                          • Terryundefined
                                            Terry
                                            last edited by

                                            But did your machine and user position for that axis also change?

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