Lathe Taper OD
24 Mar 2012 17:09 - 24 Mar 2012 17:17 #18760
by BigJohnT
Lathe Taper OD was created by BigJohnT
I finally got around to fixing my lathe taper OD so it would have proper angle and depth of cut. Make sure you name the file taper-od.ngc. If you copy the image to the same directory as the subroutine the image will show up in your tab.
John
John
Last edit: 24 Mar 2012 17:17 by BigJohnT.
Please Log in or Create an account to join the conversation.
25 Mar 2012 09:44 #18772
by Rick G
Replied by Rick G on topic Re:Lathe Taper OD
Hey John,
Nice work, thanks for sharing, I will give it a try when I get to work.
Rick
Nice work, thanks for sharing, I will give it a try when I get to work.
Rick
Please Log in or Create an account to join the conversation.
25 Mar 2012 12:09 - 25 Mar 2012 12:17 #18778
by BigJohnT
Replied by BigJohnT on topic Re:Lathe Taper OD
Last edit: 25 Mar 2012 12:17 by BigJohnT.
Please Log in or Create an account to join the conversation.
19 Nov 2012 00:19 #26762
by Tom
Replied by Tom on topic Lathe Taper OD
I've recently got NGCGUI going on my lathe, using John's subs as a starting point (thanks John).
The behaviour of the original taper OD sub was not what I wanted for 2 reasons:
1) Cutter rad comp is a step beyond me at the moment
2) My machine has backlash, so needs some run in and out of the taper cut
I set something up to behave as I wanted (see attached screenshot). You specify a "run-in/out" value to start the cut beyond the end of the workpiece (Z), and the cut continues until clearing the diameter by the same run in/out value.
The problem I have is the angle. This screenshot was programmed as a 45 degree chamfer, and you can see that's not what is output (closer to 35 degrees). The rest of the program behaves as expected. I suspect the problem is something to do with the TAN function (and my maths). Before I post up the code (my first foray into subroutine programming), is there anything special I should know about the trig functions in LinuxCNC that could give this type of error? Degrees/Radians, etc?
The behaviour of the original taper OD sub was not what I wanted for 2 reasons:
1) Cutter rad comp is a step beyond me at the moment
2) My machine has backlash, so needs some run in and out of the taper cut
I set something up to behave as I wanted (see attached screenshot). You specify a "run-in/out" value to start the cut beyond the end of the workpiece (Z), and the cut continues until clearing the diameter by the same run in/out value.
The problem I have is the angle. This screenshot was programmed as a 45 degree chamfer, and you can see that's not what is output (closer to 35 degrees). The rest of the program behaves as expected. I suspect the problem is something to do with the TAN function (and my maths). Before I post up the code (my first foray into subroutine programming), is there anything special I should know about the trig functions in LinuxCNC that could give this type of error? Degrees/Radians, etc?
Please Log in or Create an account to join the conversation.
19 Nov 2012 00:34 #26763
by BigJohnT
Replied by BigJohnT on topic Lathe Taper OD
If you don't use cutter compensation on any move that is not parallel to an axis you won't get the part as it is programmed.
linuxcnc.org/docs/html/lathe/lathe-user.html#_tool_path
All the trig functions are here and nothing special about them.
linuxcnc.org/docs/html/gcode/overview.ht...nary-Operation-Value
John
linuxcnc.org/docs/html/lathe/lathe-user.html#_tool_path
All the trig functions are here and nothing special about them.
linuxcnc.org/docs/html/gcode/overview.ht...nary-Operation-Value
John
Please Log in or Create an account to join the conversation.
19 Nov 2012 01:28 - 19 Nov 2012 01:31 #26768
by Tom
Replied by Tom on topic Lathe Taper OD
I'm planning to add cutter comp back in when I understand what is happening. The angle shouldn't change.
I've attached the GCode, with all my maths. The basic concept is:
Start of cut: Z is always <face-z> + <runinout>
End of cut: X is always <diameter> + <runinout>
The tricky part (for me at least - I've spent hours debugging this) is calculating X for the start of the cut, and Z for the end of the cut.
I'll upload a sketch in a minute to show how I arrived at the trig...
Tom
I've attached the GCode, with all my maths. The basic concept is:
Start of cut: Z is always <face-z> + <runinout>
End of cut: X is always <diameter> + <runinout>
The tricky part (for me at least - I've spent hours debugging this) is calculating X for the start of the cut, and Z for the end of the cut.
I'll upload a sketch in a minute to show how I arrived at the trig...
Tom
Last edit: 19 Nov 2012 01:31 by Tom. Reason: change file name to indicate problem
Please Log in or Create an account to join the conversation.
19 Nov 2012 01:37 #26769
by BigJohnT
Replied by BigJohnT on topic Lathe Taper OD
The angle will as programmed but the location will be off by the distance from the cutter edge to a point defined by perpendicular lines tangent to the X and Z edge of the cutter. Wow what a mouthful, now I sound like a programmer...
John
John
Please Log in or Create an account to join the conversation.
19 Nov 2012 03:29 #26772
by Tom
Replied by Tom on topic Lathe Taper OD
Hi John,
Gotcha about the cutter compensation, thanks for that. I'm going to add it back in when I need accurate parts, and when I'm confident I know that everything else is behaving normally.
My problem is the angle is not as expected. Programmed 45 degrees, but actually less.
I've attached a sheet of workings, and looking at them it's perhaps not a surprise it's not working.
Polar co-ords is the way to do this, but they don't appear to be available outside of the XY plane.
I'm going to sleep on this a few nights and come back to it. My head hurts!
Gotcha about the cutter compensation, thanks for that. I'm going to add it back in when I need accurate parts, and when I'm confident I know that everything else is behaving normally.
My problem is the angle is not as expected. Programmed 45 degrees, but actually less.
I've attached a sheet of workings, and looking at them it's perhaps not a surprise it's not working.
Polar co-ords is the way to do this, but they don't appear to be available outside of the XY plane.
I'm going to sleep on this a few nights and come back to it. My head hurts!
Please Log in or Create an account to join the conversation.
19 Nov 2012 04:40 #26777
by BigJohnT
Replied by BigJohnT on topic Lathe Taper OD
Yea, I gotta crack open the Machinist Handbook when I figure out angles and find a formula that I can understand.
This is what I'm currently using...
John
This is what I'm currently using...
G1 X#<diameter> Z[#<z-start> - [#<current-depth> * TAN[90 - #<angle>]]]
John
Please Log in or Create an account to join the conversation.
19 Nov 2012 06:53 #26784
by Tom
Replied by Tom on topic Lathe Taper OD
Hi John,
I had one last look at this tonight.
My code is a little more involved because of the "run in/out" move, but not much.
In fact, I made a spreadsheet as a sanity-check, which shows that my code (corrected from the version I posted earlier) should give the correct taper angle. It's quite confusing.
I've got to do my working week now, but when I'm back I will try pre-calculating the co-ordinates into variables, and then passing the results to the G00 and G01 lines.
Tom
I had one last look at this tonight.
My code is a little more involved because of the "run in/out" move, but not much.
In fact, I made a spreadsheet as a sanity-check, which shows that my code (corrected from the version I posted earlier) should give the correct taper angle. It's quite confusing.
I've got to do my working week now, but when I'm back I will try pre-calculating the co-ordinates into variables, and then passing the results to the G00 and G01 lines.
Tom
Please Log in or Create an account to join the conversation.
Time to create page: 0.099 seconds