Greetings all;

I am trying to put together a G76 wrapper that will let me do a clean 
cut, test the fit, and if it doesn't, decrement a value thats is added 
or subtracted from the desired thread OD and factored into the z_start 
point, to run it again until it fits. 

I am trying to use some math to allow the usual variations in thread face 
angles, normally around 30 degrees for most threads to adjust the z axis 
start point.  For a 30 degree example, sin[30]=0.5, but that with a 
#<_drive_zstart>=[2.0 +[#<_t_offset> * SIN[30]], according to the 
backplot, is too much of an advance.  Nominally twice too much.

What I want to get is a backplot that shows the start point of the 
threading motion follows the same up to the left angle as a normal G76 
run shows so that the point of the tool continues to cut on its leading 
edge only while cutting the thread deeper and deeper until it actually 
fits. The threads I am getting with good 08ERA60 inserts sure have a lot 
of "hair", and I do have the tip of the insert level with the 
centerline.  This hair, while it cleans up nicely with a die or a pass 
with the correct nut, totally makes trying to measure it a waste of 
time.

Here is the gcode, without adding the looping yet, this needs editing the 
t_offset at the top of the file.
====================
%
( adding a couple new vars to aid in the cut, test for fit, adjust and )
( wash rinse and repeat till the stop button is clicked because it now 
fits. )
#<_t_offset>    =       -0.7500 ( use this to adjust size! )
#<_p_offset>    =       0.000 ( place holder )
#<_thread_od>   =       9.525 ( starting value )
#<_thread_end>  =       -24 ( mm's obviously )
#<_q_angle>             =       30.000 (degrees)
G7 G21 (diameter mode,mm mode, g20=inch mode)
S250

( diddle this stuff if inches as below)
(#<_tp_mm>      =       1.00)
#<_tpi> =       24
#<_pitch>       =       [1.000 / #<_tpi>]
#<_pitch>       =       [#<_pitch> * 25.4] (needs mm's)
#<_thread_od>   =       [#<_thread_od> + #<_t_offset>]
( from thread_OD set drive xline )
( set drive line OD 1st)
#<_drive_xline> =       [#<_thread_OD> + 1.5000] ( a bit large for mm's, works 
for ext )
#<_p_offset>    =       [#<_t_offset> * SIN[#<_q_angle>]] (sine of 30? degree 
angle)

( constrain this #<_p_offset> to be lt #<_pitch> either direction )
o150 WHILE [#<_p_offset> lt -#<_pitch>]
#<_p_offset>    =       [#<_p_offset> + #<_pitch>]
o150 ENDWHILE

o151 WHILE [#<_p_offset> gt #<_pitch>]
#<_p_offset>    =       [#<_p_offset> - #<_pitch>]
o151 ENDWHILE

( set z far enough away sync is good for startup accel wibblies )
#<_drive_zstart> = [2.0 + #<_p_offset>] ( assumes mm's, too far for 
inches )
#<_z_end>       =       [#<_thread_end> + #<_p_offset>]
( calculate this K from pitch )
( set k, peak to valley of std USS/USF thread format = pitch/0.866 -10% 
clipped from peak and valley )
#<_kpp>=[0.8 * [#<_pitch> / 0.866]]

(debug, kpp=#<_kpp>)
( set threads OD, drive_line minus i )
#<_i_cut>=[0.000 - [#<_drive_xline> - #<_thread_OD>] - 0.01]

m3g4p1 (start spindle, wait for speed)
g0x41.1 ( clear armstrong bolts spinning base )
g1f450 z#<_drive_zstart>
g1f250 x#<_drive_xline>
g76 p#<_pitch> z#<_z_end> i#<_i_cut> j0.25 k#<_kpp> r1.6 q#<_q_angle> h5 
e0.25 l2
( leave it where it started from )
g1f450 x#<_drive_xline>
(but out of the way for test fits)
g1f650 z#<_drive_zstart>
m5
g1f650x41.1 (back it out of the way to check screw fit)
g0z150
m2
%
===========

Thanks all.

 
Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to