Tool offset

More
11 years 4 months ago #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
11 years 3 months ago #60315 by ReinaldoP
Replied by ReinaldoP on topic Tool offset

cmorley wrote: 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
11 years 3 months ago #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:
Code:
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
11 years 3 months ago #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.

More
11 years 3 months ago #60628 by andypugh
Replied by andypugh on topic Tool offset

ReinaldoP wrote: Just did, I'm on 2.6.7 but I set milestone as future-release by mistake.


I finally got round to this. (spare time in a hotel room working in Spain) and I have not yet seen the issue described.

What I did was compile master, then ran it, and selected the lathe-fanucy config.
I homed it.
Changed to DRO view to see the tool offsets.
Then in the MDI tab issued the command T0106. I then saw the Z offset go to 0.5010, which is the sum of the 06 and 10001 offsets, so that seems to work exactly as it should.

Can you give the steps required to get the wrong behaviour?

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

More
11 years 3 months ago #60808 by ReinaldoP
Replied by ReinaldoP on topic Tool offset
lathe-fanucy simulation works correctly on my computer also. The behavior only shows up when I run the actual machine. I double checked remap.py, toplevel.py , stdglue.py and toolchange.ngc. They are identical in latthe-fanucy and my configuration. The only difference between these are the hal files which of course are machine specific. Im handling the actual toolchange with a custom component, is it possible something in my hal files is interfering with the proper execution of the remap? Could the following iocontrol net connections in my hal file be causing me problems?

net tool_prep iocontrol.0.tool-prepare sl35TURRET.tool-prep
net tool_prepd sl35TURRET.tool-prepd iocontrol.0.tool-prepared
net tool_CMD iocontrol.0.tool-prep-number sl35TURRET.tool-cmd
net tool_change iocontrol.0.tool-change sl35TURRET.tool-change
net tool_done sl35TURRET.tool-changed iocontrol.0.tool-changed

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

Time to create page: 1.033 seconds
Powered by Kunena Forum