Lathe Tool Z offset

Moderators: TomKerekes, dynomotion

tmday7
Posts: 51
Joined: Fri May 11, 2018 10:17 pm

Lathe Tool Z offset

Post by tmday7 » Thu May 16, 2019 10:04 pm

Can KMCNC be configured to automatically apply Z offset when a tool is called in Gcode? Most lathes use a format like this T101 for tool 1 offset 1. There is no need for a G43 or H. Asking this because lathe post processors output like this. Iam currently editing Gcode to have a G43 H line after post processor.

Thanks for any info,
Troy

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Lathe Tool Z offset

Post by TomKerekes » Fri May 17, 2019 1:12 am

Hi Troy,

Sorry, not currently. KMotionCNC treats tool numbers 100 or greater as Tool IDs as opposed to Slots.

I think there are some advantages to having tool loading and applying offsets independent.

Can't you change the post processor? What CAD are you using?
Regards,

Tom Kerekes
Dynomotion, Inc.

tmday7
Posts: 51
Joined: Fri May 11, 2018 10:17 pm

Re: Lathe Tool Z offset

Post by tmday7 » Fri May 17, 2019 2:24 am

Hi Tom,
I looked into trying to add the part of code thats in the post processor for my mill that handles the G43 H command, to the post for lathe , but the coding is a bit over my head.
Another idea i have is adding to my my M6 ccode program but cant figure it out, if it is even possible?? So when an M6 is executed the C code would turn on the H offset for the tool that is being called in the current gcode.
Iam using Fusion360. I also have BobCadv30, that i have not tried yet. Wanted to exhaust my options with Fusion360 first.
Thanks,
Troy

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Lathe Tool Z offset

Post by TomKerekes » Fri May 17, 2019 5:57 pm

Hi Troy,

I don't think there is currently a way to do G43Hxxxxx from KFLOP.

Did you try the Fusion 360 posts on our wiki?

This Thread seems to have the reverse problem the G43Hxxxx is being put in where the OP doesn't want it. It seems to be a selectable option.
Regards,

Tom Kerekes
Dynomotion, Inc.

tmday7
Posts: 51
Joined: Fri May 11, 2018 10:17 pm

Re: Lathe Tool Z offset

Post by tmday7 » Fri May 17, 2019 9:27 pm

Hi Tom,
Sorry, i completely forgot about trying that post processor you recommended in the other thread.
It appears to work, but the G96 and G97 needed to be changed in the post processor as it would output a G96 for Constant Surface Speed OFF and G97 for Constant Surface Speed ON.

tmday7
Posts: 51
Joined: Fri May 11, 2018 10:17 pm

M00 restarts Gcode

Post by tmday7 » Sat May 18, 2019 1:43 am

So i made some edits to the post processor from the wiki page. One thing i added was a M00 at tool change,my lathe has a manual tool post. But when KMCNC executes the M00 the Gcode program stops and resets to beginning. So i added a ccode program to the M00 to Execute and wait. The ccode does an MDI "M00". Now the M00 works like it should.
Is this by design or do i have something configured wrong?

Thanks,
Troy

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Lathe Tool Z offset

Post by TomKerekes » Sat May 18, 2019 5:17 pm

Hi Troy,

Strange that an M00 would reset to the beginning. M30 should reset to the beginning.

I just tested V4.34 and it does not reset to the beginning. What Version are you running?

Was M0 configured to do no Action?

Can you provide a simple GCode fragment that does this?

or try this:

Code: Select all

G90 G21
G0 X-37.939 Y8.793 Z16.000 
G1 X-37.939 Y8.793 Z16.000 
G1 X-37.939 Y8.793 Z6.000 
G1 X-35.617 Y8.793 Z6.000 
G1 X-34.780 Y8.748 Z6.000 
G1 X-34.060 Y8.622 Z6.000 
M00
G1 X-33.448 Y8.379 Z6.000 
G1 X-32.890 Y7.992 Z6.000 
G1 X-31.855 Y6.516 Z6.000 
M30
MCodes should not execute programs that invoke other MCodes (the GCode Interpreter should not call the GCode Interpreter). So it isn't clear how that could work correctly.
Regards,

Tom Kerekes
Dynomotion, Inc.

tmday7
Posts: 51
Joined: Fri May 11, 2018 10:17 pm

Re: Lathe Tool Z offset

Post by tmday7 » Sun May 19, 2019 3:58 pm

Hi Tom,
Using v4.34.
M0 had no action set.
Here is Gcode ...

Code: Select all

(1001)
(1UPPERROLLERFACE_TURNOP2)
N1 G18
N2 G90
N3 G20

(FACE1)
N4 G53 G0 X0.
N5 T1 M6
N6 G43 H1
M0
N7 G54
N9 G97S400 M4
N10 G94
N11 G90 G0 X5.175 Z0.35
G01X2F10.
G0X5.175
G97 S500 M4
G01X2F10.
G0X5.175
M05
G53X0Z0
M30
Something else i noticed today is. After first machine power on i ran the Init code, referenced machine and tried same Gcode again and program stopped at the next line, G54. So i reset Gcode and tried again and Gcode got to M0 and reset. When this happens the Axis DROs change to Yellow then back to blue.
I also have an action for M6 to Execute/wait. The ccode for M6 has a Pop up message to Change Tool.
The reason i have this M0 placed after the G43 H1 line is after i click OK on the pop up message the Gcode starts to run again instead of waiting for me to hit CycleStart button again.

Troy

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Lathe Tool Z offset

Post by TomKerekes » Sun May 19, 2019 9:28 pm

Hi Troy,

I tried your GCode with Version 4.34 and M6 configured to prompt the Operator using the example C Program KFLOPManualToolChange.c configured with Exec/Wait Thread=4 Var=9 and can't see any problem.

Maybe you have something strange in your M6 C Program? Please post it and your Init program and how they are configured in Tool Setup.
The reason i have this M0 placed after the G43 H1 line is after i click OK on the pop up message the Gcode starts to run again instead of waiting for me to hit CycleStart button again.
Why would you want to need to hit Cycle Start? Normally the Operator would install the specified tool and just hit OK to continue. If you do want the Program to halt after selecting OK you could issue a Halt Next Line from the C Program so M0 would not be needed. But adding an M0 should also halt and not rewind (as it does for me).
Regards,

Tom Kerekes
Dynomotion, Inc.

tmday7
Posts: 51
Joined: Fri May 11, 2018 10:17 pm

Re: Lathe Tool Z offset

Post by tmday7 » Mon May 20, 2019 1:41 am

Hi Tom,
Here is screenshots of my ToolSetUp. My main init code and ManualToolChange code. Note that i dont have CSS in my init yet as i have not figured it out yet.
The reason for another CycleStart after clicking the OK button is so user does not have to go from keyboard or mouse to machine buttons. This is mainly for when user is proving out a new Gcode/Setup and needs both hands, one on the CycleStart and the other on FeedHold.

Thanks,
Troy
Attachments
ManualToolChange2.c.txt
(249 Bytes) Downloaded 113 times
KMCNC2AxisAnalogV5,1.c.txt
(15.34 KiB) Downloaded 116 times
2.jpg
1.jpg

Post Reply