Tool probe- Custom M or G code for probing

More
29 Jan 2016 03:01 - 29 Jan 2016 03:08 #69215 by JR1050
After spending a month running an old Fanuc 6 , I have come to appreciate a tool probe. My Cincinnati lathe originally had the probe pictured









The probe has four touch pads wired in series like so




I would imagine the acramatic control used tool table data to write off sets from the probe.
What is the best way to access the fields in the tool table? I'd like to add wear off sets. Changing the names of the tabs is easy, what is the best way to tell the control when it picks up an offset to add x-offset and x- wear offset fields from the tool table.

Getting the distances from the center of the spindle to the touch pads isn't difficult, In addition there would be fixed offset to be added to all the tools from the front of the probe to the front of the part in z.

Any suggestions?
Attachments:
Last edit: 29 Jan 2016 03:08 by JR1050.

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

More
30 Jan 2016 01:19 #69257 by cmorley
remaping is the usual way to handle tool wear offsets when changing tools.
Not sure how that would work with probing.

Chris M

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

More
30 Jan 2016 19:18 #69285 by JR1050
I wasn't looking to write a custom g or m code for this. I'd just like to jog each tool till it hits the pad and do the math to write an off set to the tool table. I'd prefer to write a component and will need to know what I can access in the tool table. I'd also like to add some wear off sets to the tool table.

Seems to me probing would go some thing like this

Jog axis till it hit the pad, as soon as the pad is hit suspend the jog move.
Write the present location relative to your work offset to a variable
Add that variable to the known fixed number from spindle center to the pad you just touched.
Write that to the appropriate field in the tool table


For the wear off sets
Add the field for the tool off set to the field for the wear off set when the tool offset is called in the program and assign that value to the offset for the g code program.

The original control required very complicated descriptions of the tools, so it n ew what pad was touched. I'm not sure I'm in the right forum for this task. Thanks..

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

More
30 Jan 2016 20:22 #69289 by cmorley
As I said remap is what is used for wear offsets (see sim/axis/lathe-fancucy sample)
You can not arbitrarily add info to the tool table - linuxcnc is not that flexible in this regard.

The current work around is fanuc style - use tool numbers above 10000 to hold wear offset values.
If you use Gmoccapy or Gscreen the tooledit widget can be made to show them separately.

As for probing while jogging that is tricky I think.
using motion.motion-feed-inhibit could stop the motion (I've not tested against jog moves)
but I'm not sure what would happen when you released it - it may continue to jog.
if that is true then you must abort the jog move some how.
Jog speed would need to be consistent between probes (and slow)
then you would need to calculate the offsets and save to the tool file and tell linuxcnc to reload the toolfile.
The toolfile is valid only when the machine is on and the interpreter is idle.
A HAL-python user program could probably do all this.
So it may be possible.
The consistency of the probing might be suspect - but that could be overcome by using a probe routine i would bet.

my 2-cents :)

Chris M

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

More
19 Aug 2020 23:37 #178775 by JR1050
Time has finally allowed the time to get back on the tool probe on this lathe, I need a custom M or G code I can call from MDI to measure the lengths of the tools . The original Cincinatti used the descriptions in the tool table along with the probe to determine what type of tool was being measured. I have what I think will work below. It uses M175 with P for X and Q for Z , I am assuming that P corresponds to #16 and Q #17 The idea being you park the tool about .1 from the pad and execute from MDI like so.

M175 P-1 measure X of od tool
M175 Q-1 measure length of any non left hand tool
(M175)

(PROBE X OD TOOL USE P)

if[#16=-1]
#102=-1.8031 (XOFFSET)
G49G94
G91
G38.3 X-.2 F5.
G0X.2
G38.2 X-.2 F5.
#101=[#5061+#102]
G0X.2
G90G49
G10 L1 P#5400 X#101
elseif

(PROBE X ID TOOL)

if[#16=1]
#103= 2.13 (XOFFSET)
G49G94
G91
G38.2 X.2 F5.
G0X-.2
G38.2 X.2F5.
#101=[#5061+#103]
G0Z.2
G90G49
G10 L1 P#5400 X#101
elseif

(PROBE Z FRONT OF TOOL USE Q)
if[#17=-1]
#104=-6.6714 (ZOFFSET)
G49G94
G91
G38.2 Z-.2F5.
G0Z.2
G38.2 Z-.2F5.
#101=[#5063+#104]
G0Z.2
G90G49
G10 L1 P#5400 Z#101
elseif

(PROBE Z LEFTHAND TOOL USE Q)
if[#17=1]
#105= -4.674 (ZOFFSET)
G49G94
G91
G38.2 Z.2F5.
G0Z-.2
G38.2 Z.2F5.
#101=[#5063+#105]
G0Z.2
G90G49
G10 L1 P#5400 Z#101
endif
M30

Big question, can I call a routine like this from an M code? Would this require a G code remapp, what is involved? Lcnc macro is bit different the the Fanuc-ish flavors, will the above work?Thanks.

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

More
23 Aug 2020 17:54 #179126 by Todd Zuercher
Yes, you can run it, no it does not require remap.
You simply need to set up a custom M1xx code.
linuxcnc.org/docs/html/gcode/m-code.html#mcode:m100-m199

As to the validity of your above code, I haven't looked it over real carefully. But I can at least see a few errors that won't work in Linuxcnc without some modifications.
Most of them relate to how conditional and sub routines are written in Linuxcnc.
linuxcnc.org/docs/html/gcode/o-code.html

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

Moderators: cncbasher
Time to create page: 0.100 seconds
Powered by Kunena Forum