This thread really belongs over at the CNC subject with the DRO. Maybe it should be moved there?
About a year and a half ago my tool setter arrived so I decided to add it along with my touch probe to the PSNG Touch Screen. Last time I did anything with it was last January. Although I thought I'd done a good enough job documenting things it turns out I didn't. Can't remember how to use it...
canadianhobbymetalworkers.com
BTW. I found one of the two problems. I won't go into the general G-Code details but here's a summary.
First some poorly documented code.
; Save current Z position
#<z>=#<_z>
Seriously? That's like saying
MyCopyofPi = 3.14; // Put 3.14 into MyCopyofPi.
This kind of crap documentation is everywhere unfortunately. It's obvious
what's been done but not
why.
Say we had something in the vise that extended just above the jaws and we machined a slot in it starting at Z=0.000 and to a depth of 0.200". We went down so Z became bigger.
Now we clamp a large block in the vise and it extends 2" above the jaws. We also want to put a 0.2" slot in that so first we have to establish the top as Z=0.000. We use the probe for that. Knee goes further down and Z gets bigger. What's saved when we're ready to touch off, Z is at 2.2" and that's what's saved.
The touch probe detects the surface of the new block and sets our Z origin to Z=0.000 and we're ready to cut the slot. But first the tool setting code does this:
G0 Z#<z>
Full speed to the saved Z position which was 2.2" so the knee heads down very quickly away from the touch probe.
Next we want to cut a small part in the vise again. It's only 0.5" above the jaws and we want to cut another slot 0.2" deep. Tool change to the probe and move it within 0.25" of the surface as before. We've really moved the knee up 1.75" to bring the shorter piece in the vise up to the probe and of course closer to the spindle is a negative move so the value saved is -1.75".
The touch probe detects the surface of the new block and sets our Z origin to Z=0.000 and we're ready to cut the slot. But first the tool setting code does this:
G0 Z#<z>
Full speed to the saved Z position which was -1.75" so the knee heads up very quickly towards from the touch probe which was sitting 0.1" above after finishing the probe.
Bang.
So I changed the code to do this:
O2 if [#<z> GT 0.000]
G0 Z#<z>
O2 else
(PRINT, <z> is negative, would move into probe. Don't move at all)
O2 endif
I'm not sure what the thinking was behind saving Z and then restoring it.
The original screen has a checkbox for set origin. So if I probe the mill table with the checkbox set then the table is now Z=0.000.
Next if I uncheck the box and probe a part I set on the table it would probe and stop 0.1" above what it probed. It doesn't change the Z origin so now I know the part is say 2.5" high because the DRO shows -2.6"
I guess.