Fanuc-Style Toolchange

More
2 years 1 month ago #310563 by Aciera
Replied by Aciera on topic Fanuc-Style Toolchange
seems odd that 'emccanon.CHANGE_TOOL()' should not work but sure try
Code:
self.execute("M6 T%d"% tool)

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

More
2 years 1 month ago #310564 by Jakemestre1
Replied by Jakemestre1 on topic Fanuc-Style Toolchange
No dice, all I get is an error code"T change aborted (return code 0.0)" It seems like the emccannon.change_tool is skipping over my remapped m6.
What would be an efficient way to find out why it's not executing the M6 in stdglue?
also I edited my last post just after you posted Aciera:
Where do I find documentation on the syntax of that python line? Also is this even a good idea to change the stdglue or should I be writing my own python script?

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

More
2 years 1 month ago - 2 years 1 month ago #310573 by Aciera
Replied by Aciera on topic Fanuc-Style Toolchange
I feel we should try to glean some more information about why it fails in the first place.
Not sure if this will work as I cannot test on this machine but in the 'index_lathe_tool_with_wear' function replace:

Code:
except: self.set_errormsg("T change aborted (return code %.1f)" % (self.return_value)) yield INTERP_ERROR

with this:


Code:
except Exception as error: self.set_errormsg('T change error: ', error) self.set_errormsg('T change self.selected_pocket = ', self.selected_pocket) yield INTERP_ERROR

Then run again from the terminal and check the output for the above error message, which will hopefully relay the actual error.
Last edit: 2 years 1 month ago by Aciera. Reason: fix script

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

More
2 years 1 month ago #310582 by Jakemestre1
Replied by Jakemestre1 on topic Fanuc-Style Toolchange
emc/task/emctask.cc 68: interp_error: remap_finished: got -6 - not in cblock.remappings!
remap_finished: got -6 - not in cblock.remappings!
/home/jake/linuxcnc/configs/Lathatron2-9/Lathatron2-9.ini:66: executing 'import sys
sys.path.insert(0,"/home/jake/linuxcnc/python")'
/home/jake/linuxcnc/configs/Lathatron2-9/Lathatron2-9.ini:68: executing 'import sys
sys.path.append("/home/jake/linuxcnc/python")'

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

More
2 years 1 month ago - 2 years 1 month ago #310599 by Aciera
Replied by Aciera on topic Fanuc-Style Toolchange
1. regarding documentation:
linuxcnc.org/docs/devel/html/remap/remap.html

2. I'm afraid that error message is somewhat out if my depth.

3. Question: Before we started modifying 'index_lathe_tool_with_wear' did the adding of wear tool offsets work for you but just the physical toolchange on the lathe did not work?

4. I've had a play around with 'index_lathe_tool_with_wear ' as remap for T on my simulation PC and I've noticed that the wear offset would only be added to the tool offset for a moment and then revert back to the pure tool offset. Do you get this as well?

 
Last edit: 2 years 1 month ago by Aciera.

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

More
2 years 1 month ago #310907 by Jakemestre1
Replied by Jakemestre1 on topic Fanuc-Style Toolchange
I Solved it! Holy cow! it was crazy simple.  So here's the lowdown of what needed to happen.  The ngc in the remap had to be lowercase.  That's it.  I had no idea that you couldn't use an upper case ngc name when remapping.  Is this a bug or it's supposed to be that way?  Goodness that would have saved me about a year of challenge. 

I believe Andy has a more elegant solution using pure python as: index_lathe_tool_with_wear but I can't write in python so I was in too deep.  
So here's my road to success with T.   Paths and directories are very important and you need to pay attention to where your python and subroutine code lives (mine is home/jake/linuxcnc/python, and ./) respectively.
Since I had already put together a M6 remap it got pretty tricky with what to do.  I kept thinking that remapping with the fanucy lathe example was creating a circular loop but it wasn't. 
My turret has a closed loop stepper with fault output an air cylinder to lock/unlock the turret, an index, and a inductive sensor to see if the hirth joint is locked.  With that my m6 remap ngc just goes through and rotates the stepper motor as joint 2/axis A and I scaled everything so that one tool pocket is equal to one unit on A. ex: T0=A0 T1=A1.0 T4=A4.0  It has an exit if the stepper is faulted for whatever reason, or the turret hirth fails to lock.  The downside to using this method and not a carosel component is that g30 causes the A axis to want to go home so use G28 instead. In the end I leave the remapped M6 alone.
Next up was making sure the remap.py in the python directory had the remap.py with has an added"get_t_number" from the fanucy_lathe example config. 
Also make sure you've got stdglue.py and toplevel.py in that same directory.  
Modify your ini file to remap T using the prolog=get_t_number and then this is where I made the fatal mistake I named an ngc Ttotool.ngc
(I always got this weird error "file not open" with that name)  the name ended up ttotool.ngc and it worked perfectly.
Next make sure you copy the toolchange.ngc that's called out in the lathe_fanucy example remap T but rename it with the exact subroutine you plan on having in your subroutine directory.  MAKE SURE IT IS ALL LOWERCASE. 
Remapped T should theoretically work after you complete these steps.  If you get issues with python crashes, just go through the remap  linuxcnc.org/docs/devel/html/remap/remap.html and reimport the python directories and try again editinging with the lathe_fanucy python changes.  
Good luck. 
The following user(s) said Thank You: Aciera

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

Time to create page: 0.079 seconds
Powered by Kunena Forum