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

    CNC Tool Offsets Confusion

    Scheduled Pinned Locked Moved
    CNC
    2
    5
    712
    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.
    • CthulhuLabsundefined
      CthulhuLabs
      last edited by CthulhuLabs

      I am having trouble wrapping my head around how tool offsets generally work in RRF and more specifically how to change tools in the middle of a CNC job, probe the tools new offset, and get back to CNCing. This is the general workflow I am used to:

      1. Load an Endmill into my CNC
      2. Probe the initial endmill's offset with a BitSetter (https://shop.carbide3d.com/collections/accessories/products/bitsetter?variant=39303096860733)
        which is bolted to the machine and a known X / Y position.
      3. Set my work offset with a BitZeroV2 (https://shop.carbide3d.com/collections/accessories/products/bitzero-v2?variant=32936948236349)
      4. Load the CNC job which runs for a bit then prompts me to change endmills
      5. Load the new endmill and hit resume on the job
      6. It automatically probes the new endmill's offset and continues on.

      I have the BitZero Macro working perfectly. The issue is the getting the BitSetter working. From what I can tell I am supposed to use the M585 Gcode for setting the EndMill's offset, but it seems that is just changing the Z's Machine 0 position. Am I missing something?

      EDIT: I am running RRF 3.3rc3

      CthulhuLabsundefined 1 Reply Last reply Reply Quote 1
      • CthulhuLabsundefined
        CthulhuLabs @CthulhuLabs
        last edited by

        So I am still having issues with this. My Z axis homes up to the endstop and that is considered 0. Everything below that is negative. My BitSetter tool length probe is located at -1X -377Y and with no End Mill in my spindle the trigger point for Z is at -113. This is my config.g (note the global variables at the bottom:

        ; Configuration file for Duet 3 (firmware version 3)
        ; executed by the firmware on start-up
        ;
        ; General preferences
        G90                                         ; send absolute coordinates...
        M83                                         ; ...but relative extruder moves
        M550 P"Duetoko"                             ; set printer name
         
        ; Dual Y
        M584 X0.0 Y0.1:0.2 Z0.3
         
        ; Drives
        M569 P0.0 S1                                ; X  physical drive 0.0 direction (0 = backwards, 1 = forwards (default 1))
        M569 P0.1 S1                                ; Y1 physical drive 0.1 direction (0 = backwards, 1 = forwards (default 1))
        M569 P0.2 S0                                ; Y2 physical drive 0.2 direction (0 = backwards, 1 = forwards (default 1))
        M569 P0.3 S1                                ; Z  physical drive 0.3 direction (0 = backwards, 1 = forwards (default 1))
         
        M350 X8 Y8 Z8								; configure microstepping with interpolation
        M92 X40.19 Y39.8 Z320.00                   ; set steps per mm
        M566 X900.00 Y900.00 Z100.00                ; set maximum instantaneous speed changes (mm/min)
        M203 X10000.00 Y10000.00 Z800.00			; set maximum speeds (mm/min)
        M201 X500.00 Y500.00 Z100.00                ; set accelerations (mm/s^2)
        M906 X1900 Y1900 Z1900 I40                  ; set motor currents (mA) and motor idle factor in per cent
        M84 S30                                     ; set idle timeout
         
        ; Axis Limits
        M208 X-467 Y-441 Z-140 S1                   ; set axis minima ( 0 = set axis maximum (default), 1 = set axis minimum)
        M208 X0 Y0 Z0 S0                    		; set axis maxima ( 0 = set axis maximum (default), 1 = set axis minimum)
         
        ; Endstops
        M574 X2 S1 P"!io0.in"                       ; configure active-high endstop for low  end on X via pin io0.in
        M574 Y2 S1 P"!io1.in"                       ; configure active-high endstop for low  end on Y via pin io1.in
        M574 Z2 S1 P"!io2.in"                       ; configure active-high endstop for high end on Z via pin io2.in
         
        ; OUT
        M950 F0 C"!out6+out6.tach"                  ; create fan 0 on pin out6 
        M106 P0 S255                                ; set fan 0 to 190 speed (max 255)
         
        ; Tools
        M950 R0 C"io6.out" L40000 Q50               ; Spindle acts like a 3.3V RC Servo on io6.out
        M563 P0 R0 F0 S"Spindle"                    ; define tool 0 as controllable spindle
        G10 P0 X0 Y0 Z0                             ; set tool 0 axis offsets
        T0                                          ; select tool 0
        
        ; XYZ Probe Plus
        M558 K0 P8 C"!io3.in" H20 F120 T300        ; Z probe number - Z probe switch type - probe recovery 1s probe speed and travel speed
        G31 K0 P500 X0 Y0 Z10                      ; Set trigger value - set offset and trigger height - Z probe number
         
        ; General
        G54                                         ; Use Workspace coordinate system
        M453                                        ; CNC Mode
        M564 S0 H0                                  ; Allow movement without homing (without axis maxima)
        
        
        ; BitSetter Location Variables
        ; Used in the BitSetter Macro
        global BtStrXLoc = -1						; X location where the BitSetter button is
        global BtStrYLoc = -377						; Y location where the BitSetter button is
        global BtStrZTrig = -113					; Z height where spindle with no tool loaded triggers the BitSetter
        

        and this is the Macro I have for my BitSetter:

        ; If the printer hasn't been homed, home it
        if !move.axes[0].homed || !move.axes[1].homed
        	G28
        else
        	G28 Z	
        
        G0 X{global.BtStrXLoc} Y{global.BtStrYLoc}    
        M585 Z{global.BtStrZTrig} F600 P0 S1
        

        My assumption was that after running the Macro with a tool in the Z value would show as -113. Basically remapping the Z offset to account for the tool. Instead After running the Macro with an End Mill in the spindle M114 is showing this:

        M114
        X:-0.995 Y:-377.010 Z:-91.328 E:0.000 Count -40 -15005 -29225 Machine -0.995 -377.010 -69.656 Bed comp 0.000
        

        which is not what I was expecting. I am also not sure how to get from that to -113. What is even worse is that when I try to job Z up after probing like this the machine wants to go down further. It is like the entire Z axis orientation flipped.

        CthulhuLabsundefined 1 Reply Last reply Reply Quote 0
        • CthulhuLabsundefined
          CthulhuLabs @CthulhuLabs
          last edited by

          Okay I feel like I am much closer. I switched from use M585 to using G38.2 to probe in Z. This is my current Macro:

          ; If the printer hasn't been homed, home it
          if !move.axes[0].homed || !move.axes[1].homed
          	G28
          else
          	G28 Z	
          
          ; Clear the tool Z offset
          G10 P0 L1 Z0
          
          G53 G0 X{global.BtStrXLoc} Y{global.BtStrYLoc}						; Move to BitSetter location
          G91																; relative positioning
          
          ; Adjust probe for high speed probing
          M558 K0 P8 C"!io3.in" H20 F600 T300        ; Z probe number - Z probe switch type - probe recovery 1s probe speed and travel speed
          G31 K0 P500 X0 Y0 Z10                      ; Set trigger value - set offset and trigger height - Z probe number
          
          ; Seak down rapidly till we contact the probe
          G38.2 Z{move.axes[2].userPosition + global.BtStrZTrig}
          
          ; Move up 5mm
          G0 Z5
          
          ; Adjust probe for low speed probing
          M558 K0 P8 C"!io3.in" H20 F120 T300        ; Z probe number - Z probe switch type - probe recovery 1s probe speed and travel speed
          G31 K0 P500 X0 Y0 Z10                      ; Set trigger value - set offset and trigger height - Z probe number
          
          ; Seak down slowly till we contact the probe
          G38.2 Z{move.axes[2].userPosition - 6}
          
          M291 P{move.axes[2].userPosition} R"Probing" S1
          
          
          ; set the tool offset
          G10 P0 L1 Z{-1 * (global.BtStrZTrig + move.axes[2].userPosition)}
          
          G0 Z5															; rapid move Z axis 5 mm
          

          The issue I am currently having is that move.axes[2].userPosition seems to be getting more and more negative as I probe with my BitSetter and my BitZero and I am not really sure what I should have in the G10 command for setting the tool offset.

          CthulhuLabsundefined 1 Reply Last reply Reply Quote 0
          • CthulhuLabsundefined
            CthulhuLabs @CthulhuLabs
            last edited by

            Here is my finished Macro. Hopefully will be helpful for others. I am not entirely sure why certain things behave a certain way though. This Macro does allow me to reliably change tools and still position the base of the tool a the work piece zero position.

            ; If the printer hasn't been homed, home it
            if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
            	G28
            
            ; Clear the tool Z offset
            G10 P0 L1 Z0
            
            G53 G0 Z0											; Go to 0 Z in Machine Co-ordanates
            
            var ZBeginPos = move.axes[2].userPosition			; Save the Z starting position (might not be 0)
            
            G53 G0 X{global.BtStrXLoc} Y{global.BtStrYLoc}		; Move to BitSetter location
            G91													; relative positioning
            
            ; Adjust probe for high speed probing
            M558 K0 P8 C"!io3.in" H20 F600 T300					; Z probe number - Z probe switch type - probe recovery 1s probe speed and travel speed
            G31 K0 P500 X0 Y0 Z0								; Set trigger value - set offset and trigger height - Z probe number
            
            ; Seak down rapidly till we contact the probe
            G38.2 Z{move.axes[2].userPosition + global.BtStrZTrig}
            
            ; Move up 2mm
            G0 Z2
            
            ; Adjust probe for low speed probing
            M558 K0 P8 C"!io3.in" H20 F120 T300					; Z probe number - Z probe switch type - probe recovery 1s probe speed and travel speed
            G31 K0 P500 X0 Y0 Z0								; Set trigger value - set offset and trigger height - Z probe number
            
            ; Seak down slowly till we contact the probe
            G38.2 Z{move.axes[2].userPosition - 3}
            
            var ZEndPos = move.axes[2].userPosition				; Save the Z end position
            
            ; set the tool offset
            G10 P0 L1 Z{global.BtStrZTrig - (var.ZEndPos - var.ZBeginPos)}
            
            G0 Z5												; rapid move Z axis up 5mm
            
            Nightowlundefined 1 Reply Last reply Reply Quote 4
            • Nightowlundefined
              Nightowl @CthulhuLabs
              last edited by Nightowl

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