Lathe odprofile

More
05 Jan 2011 11:45 - 14 Jul 2013 03:10 #6422 by Rick G
Lathe odprofile was created by Rick G
When I need to make a part on the lathe I normally draw it with CAD, add the paths for the rough cuts, optimize it then convert it to g code.
This works well for me especially if I need to make several of the same parts efficiently.
Recently John Thorton introduced some sub programs to the forum using the ncgui interface. I found myself using them more and they really save a lot of time.
When using the lathe od sub I got to thinking it would be nice if not just a straight line or taper could be done this way but also an existing profile.
To that end I modified lathe od to odprofile.
With it you fill the blanks and for the size of the material the smallest diameter of the finish part etc. and then select an existing profile to use to create the gcode.
There are a couple of thinks to keep in mind.

1. The profile must be named with a number.
2. The profile must be set up as a sub and start with

o<number of file> sub

lines of code

and end with

o<number of file> endsub

at the end.

Below is a rough untested idea of how it might work. Currently my lathe is being upgraded so I will have to test later.

This of course is not the most efficient way to make a part. If there are deep cuts there will also be a larger amount of air cuts before getting to the finish.
However to knock out an existing profile from varying sizes of stock material it just might save some time.

Rick G

Attachment odprofile.ngc not found

Last edit: 14 Jul 2013 03:10 by Rick G. Reason: Wrong file, will add new one later in thread.

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

More
05 Jan 2011 11:48 #6423 by Rick G
Replied by Rick G on topic Re:Lathe odprofile
Here is an example file.

File Attachment:

File Name: 5-2ecdaebd...e447.ngc
File Size:0 KB
Attachments:

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

More
05 Jan 2011 12:53 #6429 by BigJohnT
Replied by BigJohnT on topic Re:Lathe odprofile
Rick,

That is pretty neat. If I get back to my shop before sleepy time today I give it a try.

John

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

More
25 Jul 2013 17:59 - 25 Jul 2013 18:12 #37026 by Rick G
Replied by Rick G on topic Re:Lathe odprofile
Here is a newer version.

To calculate the number of cuts / passes the smallest diameter of the part and the material diameter must be known.
The material diameter may change depending on the stock used but the smallest diameter of the part should remain the same.

In the original the smallest diameter was input with ngcgui which means we need to know that diameter.
On a simple part with only a couple moves this is easy to find or maybe remember, but on a more complicated part it can be more difficult.
Also as the file name is now a number it is helpful to have some information or the original name of the file appear on the screen.

#<_TEST:SUB> is used to see if the sub has been edited for odprofile3, if not there is an intentionally bad move to error emc2 out.

The following is added to the beginning of the new subs:

(name of file)
(some descriptive information of the part)
#<_small:diam> = n where n is the smallest diameter of the part which will be used by odprofile3 for calculations
#<First_round> = #1 first call of sub to read #<_small:diam> #<_large:diam> #<_Z:start> #<_Z:end>then return to odprofile, remaining calls to run part.
#<_Z:start> = n Z location to start
#<_Z:end> = n Z end location
#<_TEST:SUB> = 1 variable to check if sub is set up for odprofile3

For example...

o<10> sub
(File 10.ngc)
(October 24, 2006)
(turning 10 legbw111 for lathe)
(sample code not for actual turning used only to demonstrate odprofile3)

#<First_round> = #1

; #<_small:diam> is smallest diameter of part, read by odprofile3 used to set number and depth of cuts
; #<_large:diam> is largest diameter of part
; #<_Z:start> is location for Z to start each cut at
; #<_Z:end> is end of Z cut

#<_small:diam> = .50
#<_large:diam> = 1.008
#<_Z:start> =.020
#<_Z:end> =-20.50

#<_TEST:SUB> = 1

o101 if [#<First_round> eq 1]
;give user some info on file
(MSG, legbw111 test file)
(debug, small diam #<_small:diam> large diam #<_large:diam>)
(debug,Z start #<_Z:start> Z end #<_Z:end>)
(print line: #<_small:diam> #<_large:diam> #<_Z:start> #<_Z:end>)
o100 return
o101 endif

; moves start here

lines of code


o<10> endsub

With this the description of the part and the small diameter, large diameter, Z start and Z end show on the screen and are followed by a M0 to give opportunity to review the information and proceed or cancel.

File Attachment:

File Name: odprofile3.ngc
File Size:4 KB
Attachments:
Last edit: 25 Jul 2013 18:12 by Rick G.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum