- Posts: 3410
- Thank you received: 0
Threading
13 years 1 month ago #38424
by BigJohnT
This is my G76 threading subroutine. Place the attached image in the same directory.
JT
Code:
(info: G76 Threading)
o<g76> sub
#<tool> = #1 (= 7 Tool)
#<rpm> = #2 (= 250 RPM)
#<diameter> = #3 (Diameter)
#<tpi> = #4 (TPI)
#<inital_depth> = #5 (= 0.010 Inital Depth)
#<thread_depth> = #6 (= 0.045 Thread Depth)
#<spring_pass> = #7 (Spring Passes)
#<z_start> = #8 (= 0.100 Z Start)
#<z_end> = #9 (Z End)
#<x_offset> = #10 (= 0.025 X Offset)
#<q_angle> = #11 (= 29.5 Combine Angle)
#<taper> = #12 (= 0 Taper 0=none 2=exit)
#<coolant> = #13 (= 8 Coolant 8 On 9 Off)
#<pitch> = [1/#<tpi>]
#<radius> = [#<diameter> / 2]
G8 G18 G20 G40 G49 G97
T#<tool> M6 G43
M#<coolant>
S#<rpm> M3
G0 Z#<z_start> X[#<radius> + #<x_offset>]
G76 P#<pitch> Z#<z_end> I-#<x_offset> J#<inital_depth> K#<thread_depth> Q#<q_angle> L#<taper> E#<thread_depth> H#<spring_pass>
M5 M9
G53 G0 X0 Z0
o<g76> endsub
JT
Please Log in to join the conversation.
9 years 3 months ago #95784
by 10K
Here's another version of a threading subroutine. I designed it so that you have to input the minimum amount of information - the nominal diameter, the TPI, and the length of thread. It's in imperial units, but could be converted fairly easily if desired.
My lathe has manually controlled speed, so that is not set by the subroutine.
My lathe has manually controlled speed, so that is not set by the subroutine.
Please Log in to join the conversation.
- Dinuka_Shehan
- Offline
- Platinum Member
-
Less
More
- Posts: 333
- Thank you received: 0
7 years 2 months ago #142393
by Dinuka_Shehan
Replied by Dinuka_Shehan on topic Threading
Can threading with manually controlled speed(without vfd) lathe with this command lines?
I can measure spindle rpm with handheld tachometer!
don'tyouhavemetricthreadsub
I can measure spindle rpm with handheld tachometer!
don'tyouhavemetricthreadsub
Please Log in to join the conversation.
7 years 2 months ago #142958
by 10K
I don't have a VFD. Speed control of my lathe is outside of LinuxCNC. I do have two detectors on my lathe spindle. One is an index that gives one pulse per revolution. The other is a proximity probe that counts gear teeth to give several pulses per revolution. If I recall correctly, you can also have a second detector on the gear teeth to give direction, but it's not absolutely necessary for threading.
The one pulse per revolution is needed, as it assures you're starting the thread at the same location each pass. This is absolutely necessary.
Multiple pulses per revolution allow you to change the rpms on the lathe during threading.
I don't think it would be possible to have only the reading from a handheld tachometer to thread.
If you need the metric version of the threading subroutine, I think that I wrote one. I'm away from my system at the moment, and can't check. Just let me know.
The one pulse per revolution is needed, as it assures you're starting the thread at the same location each pass. This is absolutely necessary.
Multiple pulses per revolution allow you to change the rpms on the lathe during threading.
I don't think it would be possible to have only the reading from a handheld tachometer to thread.
If you need the metric version of the threading subroutine, I think that I wrote one. I'm away from my system at the moment, and can't check. Just let me know.
Please Log in to join the conversation.
- Dinuka_Shehan
- Offline
- Platinum Member
-
Less
More
- Posts: 333
- Thank you received: 0
7 years 2 months ago #143010
by Dinuka_Shehan
Replied by Dinuka_Shehan on topic Threading
Please Log in to join the conversation.
- Dinuka_Shehan
- Offline
- Platinum Member
-
Less
More
- Posts: 333
- Thank you received: 0
7 years 1 week ago #148230
by Dinuka_Shehan
Have not you created a metric one?
Replied by Dinuka_Shehan on topic Threading
If you need the metric version of the threading subroutine, I think that I wrote one. I'm away from my system at the moment, and can't check. Just let me know.
Have not you created a metric one?
Please Log in to join the conversation.
7 years 1 week ago #148232
by 10K
Here's a metric threading routine
Code:
o<threading-metric> sub
(metric threading subroutine)
(threading-metric.ngc)
(July 11, 2016 - M Kennedy)
(Change these values)
#<_MajorDiameter> = #1 (Major Diameter)
#<_Pitch> = #2 (Pitch mm)
#<_Z_Finish> = #3 (+/- Z Length mm, Z)
(Don't usually have to change these values)
(PeakOffset is initial tool clearance)
#<_PeakOffset> = #4 (= -.1 Offset -ext, +int, I)
#<_TipRadius> = #5 (= 0.005 Tip Radius)
#<_Z_LeadIn> = #6 (= 2.5 Z Leadin)
#<_Z_Final> = #7 (= 50 Z Final Position)
#<_Spring_Passes> = #8 (= 1 Spring Passes, H)
#<_First_Cut_Depth> = #9 (= 0.18 First Cut Depth, J)
#<_Depth_Regression> = #10 (= 1.2 Depth Regression, R)
#<_CompoundSlideAngle> = #11 (= 29.5 Angle, Q)
#<_TaperAmount> = #12 (= 0 Taper)
#<_TaperType> = #13 (= 0 Taper Type, L)
(check to see if tool set)
o100 if [#5400 EQ 0]
(msg, Tool not set)
M2
o100 endif
(Calculations)
(calculate ThreadDepth, K)
o110 if [#<_PeakOffset> GT 0]
(internal = pitch * cos30 * 2 * 6/8 - 2 * tip radius)
#<_ThreadDepth>=[#<_Pitch> * 1.299 - 2 * #<_TipRadius>]
(thread height = pitch * cos30 * 2 * 5/8)
#<_MinorDiameter>=[#<_MajorDiameter> - #<_Pitch> * 1.0825]
#<_Diameter>=[#<_MinorDiameter> - #<_PeakOffset>]
o110 else
(external = pitch * cos30 * 2 * 7/8 - 2 * tip radius)
#<_ThreadDepth>=[#<_Pitch> * 1.5155 - 2 * #<_TipRadius>]
#<_Diameter>=[#<_MajorDiameter> + #<_PeakOffset>]
o110 endif
G7 G18 G54 G90 G94
G21 (set metric units)
G95 (feed per revolution mode)
M3
F0 S500
(Go to OD and Z Lead in)
G0 X#<_Diameter> Z#<_Z_LeadIn>
(Thread)
G76 P#<_Pitch> Z#<_Z_Finish> I#<_PeakOffset> J#<_First_Cut_Depth> R#<_Depth_Regression> K#<_ThreadDepth> Q#<_CompoundSlideAngle> H#<_Spring_Passes> L#<_TaperType>
G00 X#<_Diameter>
G00 Z#<_Z_Final>
G20 (set standard units)
M5
o<threading-metric> endsub
Attachment not found
Please Log in to join the conversation.
- Dinuka_Shehan
- Offline
- Platinum Member
-
Less
More
- Posts: 333
- Thank you received: 0
7 years 1 week ago #148280
by Dinuka_Shehan
Replied by Dinuka_Shehan on topic Threading
It is complicated for change values.
O codes and hash tags confused me.
Can you please tell me how to create code with this.
Any examples
O codes and hash tags confused me.
Can you please tell me how to create code with this.
Any examples
Please Log in to join the conversation.
7 years 1 week ago #148328
by 10K
You don't have to change anything in the program. Link it to your GUI, and run it from there. I'm using the gmoccapy GUI. It'll bring up the parameters on an easy to change screen. Most of the info is OK as is. Input the thread size and pitch, and it'll generate the code automatically.
Here's the section of my .INI file that links this and several other o-code programs in:
Here's the section of my .INI file that links this and several other o-code programs in:
Code:
# NGCGUI Entries
# Note: TKPKG (one or more) specifies tcl/tk apps to embed in axis tab pages
TKPKG = Ngcgui 1.0
NGCGUI_FONT = Helvetica -10 normal
EMBED_TAB_NAME = NGCGUI
EMBED_TAB_LOCATION = ntb_user_tabs
EMBED_TAB_COMMAND = gladevcp -x {XID} ./pyngcgui_popupkeyboard.ui
NGCGUI_PREAMBLE = lathe_std.ngc
NGCGUI_SUBFILE = threading.ngc
NGCGUI_SUBFILE = threading-metric.ngc
NGCGUI_SUBFILE = npt_pipe.ngc
NGCGUI_SUBFILE = turning.ngc
NGCGUI_SUBFILE = taper-od.ngc
NGCGUI_SUBFILE = facing.ngc
NGCGUI_SUBFILE = knurling.ngc
NGCGUI_OPTIONS = nonew noremove
Please Log in to join the conversation.
- Dinuka_Shehan
- Offline
- Platinum Member
-
Less
More
- Posts: 333
- Thank you received: 0
7 years 1 week ago #148444
by Dinuka_Shehan
Steps or any guidance please!
Replied by Dinuka_Shehan on topic Threading
How to link with gui.10K wrote: You don't have to change anything in the program. Link it to your GUI
Steps or any guidance please!
Please Log in to join the conversation.
Time to create page: 0.138 seconds
