tomae wrote: |
---|
The Tormach post outputs a tool change in some strange (to me) syntax like: T0505
I changed my version of the post at this line: writeBlock("T" + toolFormat.format(tool.number * 100 + compensationOffset));
To be instead these three lines: writeBlock("G53 G0 X0"); writeBlock("G53 G0 Z0"), writeBlock("M6 T" + toolFormat.format(tool.number) + " G43 H" + toolFormat.format(tool.number));
And now it writes:
G53 G0 X0 G53 G0 Z0 (to send my turret to the change position) M6 T0005 G43 H0005
HOWEVER, this is a complete hack-job. I don't know what compensationOffset is doing or why it is added ("+") to the toolnumber multiplied by 100....? So buyer 😉 beware! No warranties expressed or implied 😛
I can say that there is no difference in the posted code (other than the tool change lines) between using the original post and my hacked post for the several parts I have used it with.
Also, the Tormach post doesn't use G76 for threading according to Linuxcnc documentation (http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G76-Threading-Canned). Not sure why - looks more like a Fanuc maybe? Anyway, the threading code that the Tormach lathe post put out wouldn't run on my Linuxcnc (ver 2.7) controller. I would love for someone to modify the post to implement the correct syntax for the Linuxcnc G76 canned cycle!!
-Tom
|
A typical Fanuc lathe uses the T# to call the tool# and offset#, so calling T0505 = tool 5, offset register 5. T0105 = Tool 1 offset 5, etc. So the fanuc post is taking the tool number (for instance, 5), multiplying it by 100 (500) and adding the offset register (5) to achieve a final result of 505. It then outputs this using 4 digits and leading zeroes to get the proper formatting, provided the tool/offset numbers are below 99.
I'm actually a little curious how your setup works, using an H# on turning.. A mill "needs" just one offset measurement, length. A lathe NEEDS both an X offset and a Z offset to be of much use.. does the turning version of LinuxCNC contain two offset registers for the H value? It's odd to me that linuxcnc wouldn't have followed convention here, as they're usually pretty good.
Then again, i'm not sure if the Fanuc method actually sticks to rs274D either, come to think about it.
Anyway, I don't see anything particularly wrong or troublesome about the modifications you made to the post.