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

    Setting tool offset using USB microscope

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    7
    63
    4.2k
    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.
    • TCundefined
      TC
      last edited by

      I hope it can be automized somehow but for now I would do it hand using the DWC. But that would be the only manual task.

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by Danal

        Got it.

        I was hoping you had a Pi (or similar) and machine vision. Then the Pi could do the math and issue the commands. (via either 5V serial TTL to the same port the PanelDue uses, or via Telnet over the local network).

        WIthout a Pi, I'd do something like this:

        1. Use precision limit switches. Either mechanical capable of 0.03 or optical or inductive.

        2. Position those limit switches at X-10,Y-10 or even larger "minus" as possible.

        3. Position the camera as near 0,0 as practical, lets say 15,15

        4. Home machine.

        For each tool:

        1. Select the tool; use a macro; have the macro select, then G0 the tool to roughly the camera position.

        2. Manual Align.

        3. Another macro containing: M585 X-25 (or similar), then same for Y. This will hit the precision switch and then do the math for you. Then move near where tools will be put away, to make the 'next' step 5 run faster.

        Repeat 5,6,7 for each tool.

        I know you don't want to change limit switches, but, the only way (at present) to get the Duet to do the math depends on limit switches... so, it is "better switches" or "external automation" (like the Pi)

        Delta / Kossel printer fanatic

        TCundefined tekstyleundefined 2 Replies Last reply Reply Quote 0
        • TCundefined
          TC @Danal
          last edited by

          @Danal That it how I do it at the moment. Had to trick the printer by inverting the motor direction because it hits the endstop with the Carriage and not the Nozzle (ealier hit when nozzle is further away). But basicly thats the way.

          It would be really great if there where a parameter in the M585 or G10 that allows to tell the printer: This is the position which is supposed to be X100,Y100 for the tool. Set the offset to make that right.

          Do I have to put that on the wishlist?

          wilrikerundefined Danalundefined 2 Replies Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators
            last edited by

            This Hackaday.io project uses an upward facing camera. I don't think he used Duet, though, but might be useful for ideas.

            Ian

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            1 Reply Last reply Reply Quote 1
            • wilrikerundefined
              wilriker @TC
              last edited by wilriker

              @TC said in Setting tool offset using USB microscope:

              It would be really great if there where a parameter in the M585 or G10 that allows to tell the printer: This is the position which is supposed to be X100,Y100 for the tool. Set the offset to make that right.

              There is. Use G10 Px L20 Xnn Ynn. The L20 will use the current position as a relative "anchor". So if you e.g. use G10 P1 L20 X0 Y0 this would tell RRF that tool 1 is at X0, Y0 where it is right now. I think to tell it that it's at X100, Y100 you would simply use G10 P1 L20 X100 Y100 but it might be necessary to invert the values of X and Y. But that should be easy to test.

              Manuel
              Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
              with probably always latest firmware/DWC (incl. betas or self-compiled)
              My Tool Collection

              TCundefined 1 Reply Last reply Reply Quote 0
              • Danalundefined
                Danal @TC
                last edited by

                @TC said in Setting tool offset using USB microscope:

                @Danal That it how I do it at the moment. Had to trick the printer by inverting the motor direction because it hits the endstop with the Carriage and not the Nozzle (ealier hit when nozzle is further away). But basicly thats the way.

                It would be really great if there where a parameter in the M585 or G10 that allows to tell the printer: This is the position which is supposed to be X100,Y100 for the tool. Set the offset to make that right.

                Do I have to put that on the wishlist?

                1. Endstop hit by some other part than nozzle: The distance from the part that hits to the nozzle should be added/subtracted from the number in M585. Yes? No?

                2. "This is XnnnYnnnZnnn for the tool". That's accomplished by either G92 (temporary, and offsets specified in the command are calculated from current tool position) and/or work coordinate systems, G54, G55, etc. (more persistent, and offsets are from machine 0,0, generally intended for fixtures).

                Delta / Kossel printer fanatic

                1 Reply Last reply Reply Quote 0
                • TCundefined
                  TC @wilriker
                  last edited by

                  @wilriker Interesting! But does this define the normal tool offset, which is automaticly applied when the tool is selected? Or does it create a new coordinate system, which has to be activated in the tool change macros?

                  wilrikerundefined 1 Reply Last reply Reply Quote 0
                  • wilrikerundefined
                    wilriker @TC
                    last edited by

                    @TC said in Setting tool offset using USB microscope:

                    @wilriker Interesting! But does this define the normal tool offset, which is automaticly applied when the tool is selected? Or does it create a new coordinate system, which has to be activated in the tool change macros?

                    The former.

                    Manuel
                    Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                    with probably always latest firmware/DWC (incl. betas or self-compiled)
                    My Tool Collection

                    TCundefined 1 Reply Last reply Reply Quote 0
                    • Danalundefined
                      Danal
                      last edited by Danal

                      @wilriker has another good way. G10 offsets the tool. And, to @TC's question, G10 Ptool (with no L parameter) becomes "part of the tool" until it is changed. Auto activated when tool is selected, auto-deactivated when different tool is selected.

                      G92 is not associated with a specific tool. It is temporary (persists to end of current program) and can be turned off via G92 X0Y0Z0.

                      G54, 55, ... The coordinate settings are persistent across programs, and persistent across power cycles of the machine. The offsets currently in used can be turned on by specifying G54 (or 55 or...) with no arguments.

                      Note that work coordinate systems CANNOT be "turned off", the machine is ALWAYS in a given work coordinate system (G54 by default). Most people do not realize this, because they are in G54 (default) and G54 has zero offset from machine coordinates. Therefore, they are totally unaware that work coordinate systems even exist.

                      The one sort-of-exception is G53, which is machine coordinates. However, G53 is not modal; it applies only to the line on which it appears. So, next line, the machine is back in one of the Work Coordinate Systems, which may or may not be offset from machine.

                      Summary:

                      • G10 for offsetting the tool. Auto activate/deactivate as tools are changed.

                      • G92, Coordinate offsets are temporary. Often used in combination with gcode subroutines for repetitive parts, like machining a complex pocket in multiple locations on the same part.

                      • G54, 55, ... Coordinate offsets are permanent, and activated by G5x with no arguments. Normally for fixtures or jigs.

                      All three have their uses.

                      Delta / Kossel printer fanatic

                      1 Reply Last reply Reply Quote 0
                      • TCundefined
                        TC @wilriker
                        last edited by

                        @wilriker Maybe I have understanding problems but as far as I understood the G10 in combination with a L2 or L20 does not relate to a tool.

                        "Pnnn Tool number if L=1, coordinate system number if L=2 or L=20"

                        How does it know which tool is meant?

                        dc42undefined wilrikerundefined 2 Replies Last reply Reply Quote 0
                        • dc42undefined
                          dc42 administrators @TC
                          last edited by

                          @TC said in Setting tool offset using USB microscope:

                          @wilriker Maybe I have understanding problems but as far as I understood the G10 in combination with a L2 or L20 does not relate to a tool.

                          "Pnnn Tool number if L=1, coordinate system number if L=2 or L=20"

                          How does it know which tool is meant?

                          Correct, G10 with L2 or L20 is for setting workplace coordinates systems, and nothing to do with tool offsets. It's unfortunate that G10 is used for so many functions.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          1 Reply Last reply Reply Quote 0
                          • wilrikerundefined
                            wilriker @TC
                            last edited by

                            @TC I'm sorry I mixed it up. 🤦

                            @dc42 Would a G10 L10 to set tool offsets relative to current position desirable (making G10 even more complex OTOH)?

                            Manuel
                            Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                            with probably always latest firmware/DWC (incl. betas or self-compiled)
                            My Tool Collection

                            dc42undefined 1 Reply Last reply Reply Quote 0
                            • Danalundefined
                              Danal
                              last edited by Danal

                              The NIST standard defines only L2. Any other L values are "proprietary" extensions of one firmware or another. Including Duet/RepRap's use of "No L parameter at all, with Ptool" to offset a tool.

                              So... L10 could certainly be used... but... would make Duet/Reprap even further from the NIST standard. Given that G92 accomplishes the exact same thing in an NIST standard way... (and can become "part of the tool" by putting G92 in the pre/post files)... well... you asked DC42 and not me... but you can tell where I'm going with this: I'd say just use G92.

                              Extract from NIST standard:

                              3.5.5 Set Coordinate System Data — G10

                              The RS274/NGC language view of coordinate systems is described in Section 3.2.2.

                              To set the coordinate values for the origin of a coordinate system, program G10 L2 P … X… Y… Z… A… B… C…, where the P number must evaluate to an integer in the range 1 to 9 (corresponding to G54 to G59.3) and all axis words are optional. The coordinates of the origin of the coordinate system specified by the P number are reset to the coordinate values given (in terms of the absolute coordinate system). Only those coordinates for which an axis word is included on the line will be reset.

                              It is an error if:
                              • the P number does not evaluate to an integer in the range 1 to 9.

                              If origin offsets (made by G92 or G92.3) were in effect before G10 is used, they will continue to be in effect afterwards.

                              The coordinate system whose origin is set by a G10 command may be active or inactive at the time the G10 is executed.

                              Example: G10 L2 P1 x 3.5 y 17.2 sets the origin of the first coordinate system (the one selected by G54) to a point where X is 3.5 and Y is 17.2 (in absolute coordinates). The Z coordinate of the origin (and the coordinates for any rotational axes) are whatever those coordinates of the origin were before the line was executed.

                              Delta / Kossel printer fanatic

                              1 Reply Last reply Reply Quote 0
                              • tekstyleundefined
                                tekstyle @Danal
                                last edited by tekstyle

                                @Danal
                                Tool offset with limit switches would be great. I was thinking of using a camera and manually doing it, but maybe making a rig with a piezo sensor in X and another piezo sensor in Y both feed into the same module might be a better more automated solution. But is it possible to assign the result to different axis or do you have to get a module for each axis?

                                Let's say I have 1 module with 3 piezo disc. 1 for Z that's used for homing Z. 1 for X and 1 for Y that's not part of the homing process. It's off in the corner away from the bed. I want T0 as referral point so I tell firmware to go to the corner for tool offset calibration to define 0,0 offset for t0. It goes to home Z for the Z offset. Then it proceeds with T1 picks it up, go to the same corner, it should show a different value for x,y that's the difference between it and T0. Then go to homeZ for z offset and does the math as well. Is this possible?

                                For this to work, the side of the nozzle would have to be the trigger. If there is gunk on it, it would throw it off for obvious reasons.

                                1 Reply Last reply Reply Quote 0
                                • Danalundefined
                                  Danal
                                  last edited by

                                  Couple of things:

                                  1) My goal is complete automation. Click one button, no touch, align all tools. I do have camera scripts that involve the human for now... but I intend to make this all work with machine vision. I have samples of that as well. See:
                                  https://github.com/DanalEstes/DuetPython for both human and automated scripts.

                                  2) Piezo is one way, but I really don't believe it adds anything that can't be also be done with a simple touchplate. See the scripts https://github.com/DanalEstes/PythonDSF and the touchplate looks like the photo below. Touch the open flat area first to get Z, then put the nozzle 1.5mm down in the hole and touch (several times) to find exact center. As you say, repeat with each tool. Then do the math and set G10 offsets. See: https://github.com/DanalEstes/PythonDSF for examples.

                                  Note this plate is in the corner of the bed... that was a hack just to experiment... final would be off the edge of the bed.

                                  As you mention, plastic is an issue. Nozzle must be heated and wiped.

                                  Touchplate.jpeg

                                  Delta / Kossel printer fanatic

                                  tekstyleundefined TCundefined 2 Replies Last reply Reply Quote 1
                                  • tekstyleundefined
                                    tekstyle @Danal
                                    last edited by

                                    @Danal that is brilliant! Didnt think of using the z piezo probe to do x and y offset. I will look to impliment something like this.

                                    Danalundefined 1 Reply Last reply Reply Quote 0
                                    • TCundefined
                                      TC @Danal
                                      last edited by

                                      @Danal Are you sure you can get the X/Y offset that precise. I am asking because it really depends on where you hit such a nozzle tip.

                                      Danalundefined 1 Reply Last reply Reply Quote 0
                                      • Danalundefined
                                        Danal @tekstyle
                                        last edited by

                                        @tekstyle said in Setting tool offset using USB microscope:

                                        @Danal that is brilliant! Didnt think of using the z piezo probe to do x and y offset. I will look to impliment something like this.

                                        There is no piezo involved. It is simple make/break a circuit between the brass nozzle and the touchplate.

                                        Delta / Kossel printer fanatic

                                        1 Reply Last reply Reply Quote 0
                                        • Danalundefined
                                          Danal @TC
                                          last edited by

                                          @TC said in Setting tool offset using USB microscope:

                                          @Danal Are you sure you can get the X/Y offset that precise. I am asking because it really depends on where you hit such a nozzle tip.

                                          XY hits the conical side of the nozzle, not the tip. The exact taper doesn't matter, because the algorithm touches both sides. It only needs to be symmetric with itself. It does not need to be the same as the "next" or "prior" tool.

                                          Delta / Kossel printer fanatic

                                          TCundefined 1 Reply Last reply Reply Quote 0
                                          • TCundefined
                                            TC @Danal
                                            last edited by

                                            @Danal interesting but that requires the nozzle to be perfectly perpendicular, because otherwise you get an additional offset you dont detect, right?

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