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

    Tool offset (for T3) not saving or loading

    Scheduled Pinned Locked Moved
    General Discussion
    4
    10
    475
    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.
    • EducatingSavvasundefined
      EducatingSavvas
      last edited by EducatingSavvas

      Hi - I'm writing a macro to work out the offset between 3 tools on my CNC machine. A laser (T0), a spindle router (T1) and a tang knife (T3) - T2 is a drawing implement which uses the same coordinates as the spindle but will disable the spindle.

      The spindle is my main tool. My problem is that I can't seem to save the G10 L1 P3 offset for tool 3.

      This is my workflow:

      G53 G1 Z-10
      M291 P"Tool offset workflow to commence - ensure spindle head is roughly in centre of wasteboard, remove any bits in the spindle collet and tang knife head, and arm laser." R"Step 1" S3 X1 Y1	; jog to wasteboard
      T0				; select tool 0 which also enabled laser mode
      G1 Z0			; move to z0
      G91				; relative movement
      G10 L1 P0 Z-3	; subtract sacrifical material thickness - change z value as necessary
      G1 X-5 H2		; move -5
      G1 X10 H2 S190		; mark x axis 
      G1 X-5 Y-5 H2		; move to start of second pass
      G1 Y10 H2 S190		; mark y axis
      G1 Y-5 H2 			; move laser head over centre of cross-mark
      G10 L1 P0 Z0	; subtract sacrifical material thickness
      G90				; absolute movement
      G53 G1 Z-10		; Move to save z
      M291 P"Remove laser head and place v-bit into spindle collet." R"Step 2" S3 ; jog to wasteboard
      G10 L2 P8 X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition}		; Set current spindle location to X0 Y0
      M291 P"Jog spindle collet so v-bit locates laser mark" R"Step 3" S3 X1 Y1 Z1 ; jog to wasteboard
      G10 L2 P9 X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition}		; Set current Laser location to X0 Y0
      G10 L1 P0 X{move.axes[0].workplaceOffsets[8]-move.axes[0].workplaceOffsets[7]} 
      G10 L1 P0 Y{move.axes[1].workplaceOffsets[8]-move.axes[1].workplaceOffsets[7]}
      M400		;
      M500 P10	; Save tool 0ffset
      G53 G1 Z-10
      M291 P"Remove V-bit from spindle collet and install v-bit in tang knif head" R"Step 3" S3 ; jog to wasteboard
      M291 P"Jog tan head with v-bit to locate laser mark" R"step 4" S3 X1 Y1 Z1 ; jog to wasteboard
      G10 L2 P6 X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition}		; Set current tang head location to X0 Y0
      T3		; Select tool 3
      G10 L1 P3 X{move.axes[0].workplaceOffsets[8]-move.axes[0].workplaceOffsets[5]} 
      G10 L1 P3 Y{move.axes[1].workplaceOffsets[8]-move.axes[1].workplaceOffsets[5]}
      M400		;
      M500 P10	; Save tool 0ffset
      

      I'm finding tool 0 offset is saved but I can't seem to recall the offset for tool 3. I can see it is correct from the status information when T3 is selected, but swapping off and back to the tool seems to remove the offset. I've tried adding this manually to the config-override.g file and saving with both M500 and M500 P10 but T3 offset is not applied after rebooting. Have I missed a step? Can more than one tool have a saved offset?

      EducatingSavvasundefined 1 Reply Last reply Reply Quote 0
      • EducatingSavvasundefined
        EducatingSavvas @EducatingSavvas
        last edited by

        Tool offset calibration for more than one tool not saving*

        1 Reply Last reply Reply Quote 0
        • Phaedruxundefined
          Phaedrux Moderator
          last edited by

          Just in case it's a syntax error in the macro, can you manually send G10 for tool 3 with actual numbers and see if it saves/loads?

          Z-Bot CoreXY Build | Thingiverse Profile

          EducatingSavvasundefined 1 Reply Last reply Reply Quote 0
          • EducatingSavvasundefined
            EducatingSavvas @Phaedrux
            last edited by

            @phaedrux Hiya - I think I've worked it out. I had to add M501 to all the tpre#.g and that has allowed me to swap between the tools and to keep the offset. I also added M500 P10 to all the tfree#.g but I'm not sure I need that as I'll rely on the workflow to set those. It's a bit confusing because I do have M501 at the end of my config file and I could see the offsets were in the config-override.g file.

            I'll test my macro again this weekend to make sure everything works properly but I think it was a simple one this time. Many thanks.

            dc42undefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @EducatingSavvas
              last edited by

              @educatingsavvas said in Tool offset (for T3) not saving or loading:

              I think I've worked it out. I had to add M501 to all the tpre#.g and that has allowed me to swap between the tools and to keep the offset.

              That should not be necessary, unless you have another G10 command somewhere in your tool change files (or elsewhere) that alters the offset.

              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

              EducatingSavvasundefined 1 Reply Last reply Reply Quote 1
              • EducatingSavvasundefined
                EducatingSavvas @dc42
                last edited by

                @dc42 Yes I do - I use a different macros to set the Z zero which I save too and recall from other work coordinates when the tool is selected.

                I have the following in tfree0.g (although this should move to tpre1.g come to think of it)

                G10 L2 P2 Z{move.axes[2].workplaceOffsets[5]}		;
                

                and this in tpre0.g

                G10 L2 P2 Z{move.axes[2].workplaceOffsets[7]}		;
                

                and will possibly need a second and third for the drawing tool, and tang knife depending on how I manually set the tools zero on the waste-board.

                @phaedrux I think in a few more weeks I should be ready to share my system files as an example of using the duet for CNC. Is there is a good place and way to do that?

                jay_s_ukundefined Phaedruxundefined 2 Replies Last reply Reply Quote 0
                • jay_s_ukundefined
                  jay_s_uk @EducatingSavvas
                  last edited by

                  @educatingsavvas you can now use global variables to store values rather than using my hack to use workplace offsets

                  Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                  EducatingSavvasundefined 1 Reply Last reply Reply Quote 1
                  • Phaedruxundefined
                    Phaedrux Moderator @EducatingSavvas
                    last edited by

                    @educatingsavvas said in Tool offset (for T3) not saving or loading:

                    @phaedrux I think in a few more weeks I should be ready to share my system files as an example of using the duet for CNC. Is there is a good place and way to do that?

                    Indeed there is.

                    https://github.com/Duet3D/RRF-machine-config-files

                    Though a post in the CNC forum would likely get more direct visibility.

                    Z-Bot CoreXY Build | Thingiverse Profile

                    1 Reply Last reply Reply Quote 1
                    • EducatingSavvasundefined
                      EducatingSavvas @jay_s_uk
                      last edited by

                      @jay_s_uk Hi Jay! I still haven't had time to look into how global variable work. The WC hack has been a great though - thanks again for chiming in previously. I'm using a simpler method for probe to waste-board height but it has been great. It's amazing to get the functionality of an industrial standard CNC machines with a open source platform.

                      jay_s_ukundefined 1 Reply Last reply Reply Quote 1
                      • jay_s_ukundefined
                        jay_s_uk @EducatingSavvas
                        last edited by

                        @educatingsavvas I've not had chance to try them yet either as my CNC is in bits. Hopefully soon I'll be back to tweaking my settings

                        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

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