Tool offset

More
05 Jun 2015 06:36 #59449 by ReinaldoP
Tool offset was created by ReinaldoP
I'm trying to get Txxyy working like our other lathes in our shop. I'm running linuxcnc 2.6.7 and using gmoccapy. What would be the recommended procedure?

I already read all the posts on this topic and I'm confused should I do the patch? remap? change .ini settings? create new remaps?

Please Log in or Create an account to join the conversation.

More
05 Jun 2015 06:41 #59450 by andypugh
Replied by andypugh on topic Tool offset

should I do the patch? remap? change .ini settings? create new remaps?


I would suggest remap. You ought to be able to just copy the relevant files from the sim->axis->lathe-fanucy config.

(run that config first from the chooser, see if it acts like you expect)
The following user(s) said Thank You: ReinaldoP

Please Log in or Create an account to join the conversation.

More
09 Jun 2015 23:00 #59656 by ReinaldoP
Replied by ReinaldoP on topic Tool offset
Thanks, it worked. Ran the sim first, then used the .ini file from the sim to figure out where all the files needed to go, copied them to the new destinations. Loaded my configurations with the new files and paths fixed and it worked.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 23:47 #59712 by ReinaldoP
Replied by ReinaldoP on topic Tool offset
While using this remap I noticed the offsets are not being applied the first time I command a Txxyy. It takes two commands instead of one, first one changes the tool and applies Txx offset but the actual wear offset is not apllied until I rerun Txxyy a second time. So basically it only applies the wear offset if the tool is already there. Any ideas on what may be causing this?

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 03:54 #59729 by andypugh
Replied by andypugh on topic Tool offset

So basically it only applies the wear offset if the tool is already there. Any ideas on what may be causing this?


Hmm, no, not really. :-/

Can you raise that as a bug on the bug tracker assigned to me? (The bug tracker is in the "Community" section,

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 05:28 #59734 by ReinaldoP
Replied by ReinaldoP on topic Tool offset
Just did, I'm on 2.6.7 but I set milestone as future-release by mistake.

Please Log in or Create an account to join the conversation.

More
13 Jun 2015 08:21 #59773 by cmorley
Replied by cmorley on topic Tool offset
try adding m6 after the '0100 endif' in the toolchange.ncg
I found I had to do this in my python script.

Chris M

Please Log in or Create an account to join the conversation.

More
01 Jul 2015 23:45 #60315 by ReinaldoP
Replied by ReinaldoP on topic Tool offset

try adding m6 after the '0100 endif' in the toolchange.ncg
I found I had to do this in my python script.

Chris M


I tried that but still got the same behavior.

Please Log in or Create an account to join the conversation.

More
02 Jul 2015 05:08 #60318 by cmorley
Replied by cmorley on topic Tool offset
did you add it or change it.
In my python script I had to have it twice:
def index_fanuc_lathe_tool(self,**words):
    # only run this if we are really moving the machine
    # skip this if running task for the screen
    if not self.task:
        return INTERP_OK
    try:
        # check there is a tool number from the Gcode
        cblock = self.blocks[self.remap_level]
        if not cblock.t_flag:
            self.set_errormsg("T requires a tool number")
            return INTERP_ERROR
        tool_raw = int(cblock.t_number)

        # If it's less then 100 someone forgot to add the wear #, so we added it automatically
        # separate out tool number (tool) and wear number (wear), add 10000 to wear number
        if tool_raw <100:
            tool_raw=tool_raw*100
        tool = int(tool_raw/100)
        wear = 10000 + tool_raw % 100

        # uncomment for debugging
        # print'***tool#',cblock.t_number,'toolraw:',tool_raw,'tool split:',tool,'wear split',wear

        # set HAL pins
        self.h["tool-number"] = cblock.t_number
        self.h["tool-wear-number"] = wear

        # check for tool number entry in tool file
        (status, pocket) = self.find_tool_pocket(tool)
        if status != INTERP_OK:
            self.set_errormsg("T%d: tool entry not found" % (tool))
            return status

        # if there is a wear number, check for it in the tool file
        # For wear offset 00, we dont require a tool 10000 entry in the tool file - so we will skip this check
        if wear>10000:
            (status, pocket) = self.find_tool_pocket(wear)
            if status != INTERP_OK:
                self.set_errormsg("T%d: wear entry not found" % (wear))
                return status

        # index tool immediately to tool number
        # immediately add tool offset
        self.selected_tool = self.selected_pocket = tool
        emccanon.SELECT_POCKET(self.selected_pocket, self.selected_tool)
        self.execute("m6")
        self.execute("g43 h%d"% tool)
        # record the x and z offsets of the current tool
        x1= float(self.tool_offset.x)
        z1= float(self.tool_offset.z)

        # if the wear offset is specified, immediately add it's offset
        if wear>10000:
            self.execute("g43.2 h%d"% wear)
        # Not sure why but must call this again to resynch, other wise
        # ;py,print self.tool_table[0].toolno (in mdi) will always be one tool behind
        self.execute("m6")

        # calculate wear offset and set HAL pins 
        self.h["tool-offset-x"] = x1
        self.h["tool-offset-z"] = z1
        self.h["tool-wear-offset-x"] = (float(self.tool_offset.x) -x1)
        self.h["tool-wear-offset-z"] = (float(self.tool_offset.z) -z1)
        # all good
        return INTERP_OK
    except Exception, e:
        self.set_errormsg("T%d index_fanuc_lathe_tool: %s" % (int(words['t']), e))
        return INTERP_ERROR

Please Log in or Create an account to join the conversation.

More
02 Jul 2015 22:43 #60348 by ReinaldoP
Replied by ReinaldoP on topic Tool offset
What .py file is that? stdglue.py or the remap.py? its totally different from what I have. My remap.py only gets the tool number and passes over to toolchange.ngc

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds
Powered by Kunena Forum