Welcome to Our Community

Some features disabled for guests. Register Today.

How to do a tool change for multi-tool jobs?

Discussion in 'Control Software' started by LukeAU, Aug 24, 2023.

  1. LukeAU

    LukeAU New
    Builder

    Joined:
    Dec 29, 2021
    Messages:
    3
    Likes Received:
    0
    Hi, first time posting so be kind :)

    I've recently switched over to the new Blackbox x32. I've got the machine configured, moving around accurately, hard and soft limits sorted, spindle control working.

    What I can't figure out is how to do a tool change mid job? I use Fusion 360 to generate the NC file. Within the file it parses T2 M6 or T118 M6 (whatever the tool number is). Control then seems to stop (no dialog box though), but I can't jog the machine to swap the tool, and can't probe either, unless I hit "Stop" which ends the job.

    I must be missing somerthing, but can't figure out what.

    Thanks in advance.
    Luke
     
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,408
    Likes Received:
    1,899
    you need to be using the Openbuilds post processor for Fusion360.
    It will automatically generate a gcode file per tool, since grbl does not support tool changes and I am guessing you do not have an automatic too l changer. The X32 can support automatic tool change, but that is rather more advanced than most users have, but even a semi automatic tool change needs a tool length sensor and a macro to support it (search these forums for it)
    To use these files, you load the first tool and run the first file, then load the 2nd tool and run the 2nd file, and so on.

    docs:software:fusion360 [OpenBuilds Documentation]

    however, the future is bright, grblHAL now supports gcode macros and I believe it will be possible to automate toolchanges with this feature such that the gcode sender does not need to know how to do it other than to send a 'keep running' after an M0.
     
    Peter Van Der Walt likes this.
  3. terjeio

    terjeio Well-Known
    Builder

    Joined:
    Oct 18, 2020
    Messages:
    59
    Likes Received:
    60
    ioSender (Windows only) and the WebUI supports the tool change extension in grbHAL, both for manual and semi-automatic modes. A tool length sensor is optional and no macros are needed. It would be nice if other senders supported this extension...

    Correct, at least one user that I am aware of is testing this. BTW a M0 following the M6 is optional, with an ATC there is, IMO, no need to pause the job.
     
    David the swarfer likes this.
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,763
    Likes Received:
    4,266
    Check out Toolchanges · Issue #26 · OpenBuilds/OpenBuilds-CONTROL and feel free to comment in there - it stalled out with Grbl itself for several internal reasons, but if its relatively simple to implement we can re-initiate that - would love to make it work inclusive of Grbl though as there is a large existing userbase of BlackBox 4X users who'd feel left out if we implement it in a grblHAL only way
     
  5. LukeAU

    LukeAU New
    Builder

    Joined:
    Dec 29, 2021
    Messages:
    3
    Likes Received:
    0
    Thanks David. That's good to know. I don't have a ATC but with my previous controller and software (CNCjs) had a macro written for toolchanges. CNCjs pauses the program when it hits a M6, I would then run the macro which moves the spindle to the front center of the machine, throw a dialog, I'd then swap the tool and hit ok, the macro would then move over to a specific location (I have a fixed location Z probe), perform the probe and tool length offset, then go back to where it was last.

    I tried running this macro in Control, but it obviously didn't work.

    Code:
    ; Wait until the planner queue is empty
    %wait
    ; Set user-defined variables
    %CLEARANCE_HEIGHT = -10
    %TOOL_CHANGE_X = 640
    %TOOL_CHANGE_Y = 15
    %TOOL_CHANGE_Z = CLEARANCE_HEIGHT
    %TOOL_PROBE_X =1212
    %TOOL_PROBE_Y = 15
    %TOOL_PROBE_Z = -65
    %PROBE_DISTANCE = 30
    %PROBE_FEEDRATE = 150
    %TOUCH_PLATE_HEIGHT = 0
    %RETRACTION_DISTANCE = 10
    ; Keep a backup of current work position
    %X0=posx, Y0=posy, Z0=posz
    ; Save modal state
    ; * Work Coordinate System: G54, G55, G56, G57, G58, G59
    ; * Plane: G17, G18, G19
    ; * Units: G20, G21
    ; * Distance Mode: G90, G91
    ; * Feed Rate Mode: G93, G94
    ; * Spindle State: M3, M4, M5
    ; * Coolant State: M7, M8, M9
    %WCS = modal.wcs
    %PLANE = modal.plane
    %UNITS = modal.units
    %DISTANCE = modal.distance
    %FEEDRATE = modal.feedrate
    %SPINDLE = modal.spindle
    %COOLANT = modal.coolant
    ; Stop spindle
    M5
    ; Absolute positioning
    G90
    ; Raise to tool change Z
    G53 Z[TOOL_CHANGE_Z]
    ; Go to tool change Y
    G53 Y[TOOL_CHANGE_Y]
    ; Go to tool change X
    G53 X[TOOL_CHANGE_X]
    ; Wait until the planner queue is empty
    %wait
    ; Pause the program for a manual tool change
    M0 – CHANGE TOOL
    ; Go to Clearance Height
    G53 Z[CLEARANCE_HEIGHT]
    ; Go to tool probe Y
    G53 Y[TOOL_PROBE_Y]
    ; Go to tool probe X
    G53 X[TOOL_PROBE_X]
    ; Go to tool probe Z
    G53 Z[TOOL_PROBE_Z]
    ; Wait until the planner queue is empty
    %wait
    ; Cancel tool length offset
    G49
    ; Probe toward workpiece with a maximum probe distance
    G91 ; Relative positioning
    G38.2 Z-[PROBE_DISTANCE] F[PROBE_FEEDRATE]
    G90 ; Absolute positioning
    ; A dwell time of one second to make sure the planner queue is empty
    G4 P1
    ; Update the tool length offset
    G43.1 Z[posz - TOUCH_PLATE_HEIGHT]
    ; Retract from the touch plate
    G91 ; Relative positioning
    G0 Z[RETRACTION_DISTANCE]
    G90 ; Absolute positioning
    ; Raise to tool change Z
    G53 Z[TOOL_CHANGE_Z]
    ; Wait until the planner queue is empty
    %
    ; Go to previous work position
    G0 X[X0]
    G0 Y[Y0]
    ; Restore modal state
    [WCS] [PLANE] [UNITS] [DISTANCE] [FEEDRATE] [SPINDLE] [COOLANT]
     
  6. LukeAU

    LukeAU New
    Builder

    Joined:
    Dec 29, 2021
    Messages:
    3
    Likes Received:
    0
    Thanks Peter. I'm curious how CNCjs and gSender are doing it as they're only running GRBL, not GRBLhal.

    I was just playing around earlier and can run the machine using both CNCjs and gSender but can't flash the Blackbox (I'm guessing because it's trying to flash GRBL not GRBLhal).
     
  7. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,763
    Likes Received:
    4,266
    In Grbl the host application has to do all the work. grblHAL takes over some of the hard work, but both still needs work on the host application to present a nice UI experience to the user. Hasn't been a high priority for us as splitting gcode is super easy, in in our trials easier for beginners to grasp. OpenBuilds always tries to make things easy :)
     
  8. Misterg

    Misterg Veteran
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 27, 2022
    Messages:
    349
    Likes Received:
    271
    If you can separate the gcode into one file per tool (can be done in the standard F360 grbl POST, or the Openbuilds POST) then the macro I wrote will do all of the other steps (it only needs to be run once to add a ‘tool length’ button to the Control toolbar).. After finishing the first tool path, click the toolbar button to handle the tool change and load the gcode for the new tool. I have used this macro a lot and it works well for me.

    Getting started with Javascript Macros in CONTROL / Library of Macros created by the community
     
    #8 Misterg, Aug 26, 2023
    Last edited: Aug 26, 2023
    Alain JBT and Peter Van Der Walt like this.
  9. Ccollings

    Ccollings New
    Builder

    Joined:
    Aug 16, 2023
    Messages:
    1
    Likes Received:
    0
    Would there be any way for the open builds software to split the different tools into their own files but queue them up with the tool offset macro so a single click can start the new file instead of having to fish around and upload it separately? That should work for the older controller as well as grblhal
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice