Loading ...
Sorry, an error occurred while loading the content.

Re: [mach1mach2cnc] First Auto Tool Change in Mach4

Expand Messages
  • Dclifton2
    What about a macro like Ger did in his 2010 screen set that did a simiautomatic tool change by comparing the offset of the bit length. Thanks Don Clifton Sent
    Message 1 of 76 , Sep 25, 2013
      What about a macro like Ger did in his 2010 screen set that did a simiautomatic tool change by comparing the offset of the bit length.
        Don Clifton

      Sent from Don Clifton's IPad

      On Sep 25, 2013, at 3:10 PM, Brian Barker <brianb@...> wrote:


      I think I need to make my module for toolchangers.. if I can do that I think Terry will be very very happy.. I bet I can get a changer down to under about 10 lines of code and the code would only be positions to move too..

      Just an idea..

      On 9/25/2013 3:06 PM, Henrik Olsson wrote:

      Hi Terry,


      I don’t mind the age of CB per se, it’s just that EVERYONE ELSE has moved on (whether we like it or not) while CB hasn’t moved one bit (no pun intended) for almost a decade. The result of this is that it (CB) is getting more and more incompatible with everything around it.


      If you are able to piece together stuff in CB I’m sure you will be able to do the same thing in LUA if you want to.


      Classic ladder might be fairly simple to you, personally, like I said I can’t imagine programming a toolchanger in it - and I work with PLC’s from time to time….

      With that said one manufacturers ladder dialect is not the same as the other though the basics are the same in both – just as it is with CB and LUA.




      ---Original message--- 

      HIYA Henrik, (;-) I still cannot program in CB all I can do is assemble bits and pieces of code to make things work, SOMETIMES.


      Just because something is OLD does not make it needed to be replaced. Take Ladder everyone STILL uses it for hardware integration so it MUST work and is Fairly simple to use.



    • Brian Barker
      If you look at the functions I added you get to do that and it sets the variable in the module that I made.. I did this so later I can add more and more error
      Message 76 of 76 , Oct 2 6:49 AM
        If you look at the functions I added you get to do that and it sets the variable in the module that I made.. I did this so later I can add more and more error checking. I think in the end that is the best thing we can do

        On 10/2/2013 9:30 AM, vmax549@... wrote:

        HIYA Brian, I am not questioning you r code it looks FINE to me for a winerack tool changer. What I suggested is Create the SAME function with the positional values AS variables(parameters) so for the OP to set up the function the OP only has to plug in the positions to parameters to make it WORK for HIS table.

        Every where you have a positional value for XYZ  make it a variable then link it to a system parameter. The OP should NEVER have to be exposed to the macro code just to make the function work.

        If I had a new table with a WR tool changer I would only need to KNOW the travel height of the spindle and the locations of the actual tool holders. These things would then be set as parameter values . You would NOT have to mess with ANY macro code to make the Tool changer function work. AND remember after a tool change the TC function DOES NOT return the tool to the last position. THAT is the CAM/Programmers job.

         Same with tool comp. KEEP it out of the TC function as it belongs in the Gcode side. Remove the COMP before the M6 and apply it AFTER the M6 finishes and you are headed back to work.

        Apon set up of MAch4 you would select a tool changer function such as WR (wineRack) then define the parameters for its operation.  

        NOW IF you want to create a new macro to control that mongral tool changer NOT A PROBLEM have at it.

        (;-) TP

        ---In mach1mach2cnc@yahoogroups.com, <mach1mach2cnc@yahoogroups.com> wrote:

        Terry I don't know how to make it anymore simple and still allow you to change it. Please show me what you are thinking in pseudo code and we will see if it can be done.


        On 9/30/2013 8:29 PM, vmax549@... wrote:

        NOW put the function code out of sight and just bring out the variables as parameters we can set . Do the same for each class of tool changer and you will have it done.  Then IF someone wants to build a tool changer they can simply build to teh class spec and it will work. Presto.

        Just a thought, (;-) TP

        ---In mach1mach2cnc@yahoogroups.com, <mach1mach2cnc@yahoogroups.com> wrote:

        Hi guys I started to make the module for Lua to make the wine rack tool
        changer seem a little more simple. Please tell me if you think this is
        any better to follow. This only took about 2 hours to make the module so
        something like this is very doable..


        -- Name: RouterToolChanger
        -- Author: B Barker
        -- Modified by:
        -- Created: 09/26/2013
        -- Copyright: (c) 2013 Newfangled Solutions. All rights reserved.
        -- Licence: BSD license

        --Load the Module for the wine rack type tool changer

        local Tc = require 'WChanger'

        --Set the output to release the tool (mc.OSIG_OUTPUT1)

        --Set the Pull out distance (x_pullout , y_pullout)
        --This is the distance to get the tool out of the toolchanger fingers
        Tc.SetToolPullout(0.0, -1.1)

        --Position of the Z axis to engage the tool in the changer

        --Position of the Z axis to get from tool to tool

        --Set the tool change positions and the number of tools
        --Tool 1 location
        Tc.AddChangePos(26.019, -1.83)
        --Tool 2 location
        Tc.AddChangePos(29.6, -1.873)
        --Tool 3 location
        Tc.AddChangePos(33.218, -1.839)

        --Add more Tc.AddChangePos(x, y) to add more tools

        function m6()
        --Get the instance of the controller
        --Get current tool and next tool
        local NewTool = mc.mcToolGetSelected(inst)
        local CurrentTool = mc.mcToolGetCurrent(inst)

        if(m_changePos[NewTool] == nil)then
        return (false)

        if(NewTool ~= CurrentTool)then --Skip if the tool is the same

        if (CurrentTool > 0) then
        --Drop off the current tool (nil is telling NOT to move that axis)
        Tc.MoveMachinePos(nil, nil, 0.0);
        --Move tool ahead of the toolchange finger
        --Move tool to Z change height
        --Move tool into changer
        --unclamp tool
        --Pull up off tool
        --Unclamp if no tool in spindle

        --Get the new tool

        --Move to new tool
        --Move on to the tool
        --Clamp Tool
        --Set current tool
        mc.mcToolSetCurrent(inst, NewTool);
        --Pull tool out of changer
        --Move to Z max
        Tc.MoveMachinePos(nil, nil, 0.0);
      Your message has been successfully submitted and would be delivered to recipients shortly.