On 3/1/24 07:22, andy pugh wrote:
On Fri, 1 Mar 2024 at 08:04, gene heskett <ghesk...@shentel.net> wrote:

One last Q in this thread, assuming the machine has been homed and I
want to G38.2 z-70. where contact is expected at about -67mm. But I
occasionally get a stop before contact. Noise? Will #5070 tell me?.

No, the system can't tell the difference between a false and a genuine trigger.

Well, I seem to be up to the first named subroutine call. But it cannot find it.
my .ini file has:

[RS274NGC]
DISABLE_G92_PERSISTENSE = 0
PARAMETER_FILE                  = linuxcnc.var
SUBROUTINE_PATH                 = /home/gene/linuxcnc/nc_files/subs/
RS274NGC_STARTUP_CODE = G21 G61 #4990=0.0000 #4991=0.0000 #4992=0.0000 #4993=0.0000 #4994=0.0000 #4995=0.000000

Then I noted that it wasn't looking in the directory named above, but in a hash named subdir in /tmp. So I hunted it down with mc and deleted the whole thing from /tmp, I had restarted and rehomed lcnc a couple times to get the stripped to the above path to subs into effect but after nukeing it from /tmp the EOF error is gone. Does anyone have any idea where/how/why /tmp even got into the lcnc env? 4 damned days I've looked at that error, seeing the filename and the line # of the error w/o a solution.

Stopped lcnc, nuked that dir in /tmp restarted linuxcnc, the dir in /tmp is recreated but it still cannot find that file, and the path to it is not being looked at despite the above SUBROUTINE_PATH being specified, so I moved the file to nc_files where the error msg says it is looking, but still can't find it, put copies both places, still can't find it, copy of tholefinder.ngc file attached. Whats wrong?

I'm DIW.

Thanks all.

Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
o<tholefinder.ngc> sub
( tholefinder.ngc, a hole finding routine to aid in properlyregistering )
( the top and bottom machining operations based on the eagle CAD program. )
( The files are issued by pcb2gcode ulp when it converts an eagle designed )
( board to gcode commands)
( VERY IMPORTANT this code makes some assumptions )
( I am also rigging it to look at a much larger hole, in this case about )
( a 27mm hole in the bellows nipples for the Sheldon's z screw bellows covers )

( 1. That a small piece of brass tubing has been let into the pallet, at )
( board left front corner -0.2X and +0.1Y and is connected to the probe )
( circuit )

( a year later, working on Kip Koons first board )
( now effectively random, and we must find that offset anew )
( when this is finalized, copy to coco-baord1 directory )

( 2. This location device is not known to eagle. Since I found that the )
( whole pattern worked better if the eagle output files were moved to )
( the left by 0.1X, this program will leave at $100 in memory, a value )
( that when applied with a G43.1 X#100 command, the offset to X that will )
( do that, but _all_ tool probing is done without that offset in effect )

( 3. The mill is driven by gcode or by hand before this routine is run )
( so that the tip of a conical probe is already reasonably well centered )
( and lowered slightly into the hole and that the probes hot lead is )
( actually connected to the board! )

( 4. From that point we can probe to find the exact X center of the hole )
( in just 3 probing moves, and an additional 2 probing moves will show )
( the actual Y offset.  For informational use only so far. )

( 5. My probe for this was a very small dremel burr that was cut off to )
( leave a tapered shank but it has some runout, hence the probe is turning )
( slowly at high rate in comparison to the probing moves to effectively )
( cancel out the runout, improving the accuracy by at least 2 decimal places)

( 6. The returned value will be returned in var #100, using other 100 up )
( vars for local scratchpad as it runs &  available for bot.etch and )
( bot.drill use in setting a G43.1 offset )
( 7.  In any event this MUST be used before any other top machining )
( operations. )

( Copyright Feb 2012 by Gene Heskett, licensed the same as LinuxCNC )
( these values are custom for each board pallet made!!!! )
( change signs of fudges here in these 2 statements )
( set initial search limits )
(and I just found why some puzzliing results, I was re-using inital values! )
( so use tmp_name for contact results )
#<_right_x> = 0.1500000
#<_1st_speed>   =       1.5
#<_2nd_speed>   =       .05
#<_left_x>      = -#<_right_x>
#<_back_y>      =       #<_right_x>
#<_front_y> = -#<_right_x>
#<_tmp_f_y>     =       0.0000000
#<_tmp_b_y>     =       0.0000000
#<_tmp_l_x>     =       0.0000000
#<_tmp_r_x>     =       0.0000000
( Assume machine is lost, reset so machine & g54 match )
( G53 G0 X0.0000 Y0.0000 Z0.0000 )
G92.1 (cancel any G92 offsets)
(G10 L2 P1 X0.00000 Y0.0000 Z0.0000 R0.0000) (set G54 to match machine actual)
G49 (turn off tool offsets)
M5 ( make sure spindle is off )

G4 P0.5( que breaker wait, remove all machine offsets )
G17 G20 G40 G49 G54 G80 G90 G94
S1150 ( preset suitable spindle speed )
M4 G4 P0.5 ( start spindle .25 sec wait )

G38.2 F#<_1st_speed> X#<_right_x> ( search fast for right side of hole )
G1 x[#5061 - 0.015] ( open probe, this is in thou! )
G04 P.2 ( wait for cap to charge )
( now lets fine tune it )
G38.2 F#<_2nd_speed> X[#5061 + 0.05]  ( search slowly for right side of hole )
#<_tmp_r_x>     = #5061 ( record fine tuned x value as rightx )

G1 F#<_1st_speed> x[#5061 - 0.015] ( open probe  for left side search )
( now do the same double touch for other side of x )
G38.2 F#<_1st_speed> X#<_left_x> ( search fast for left side of hole )
G1 x[#5061 + 0.025] ( clear the probe contact )
G38.2 F#<_2nd_speed> X[#5061 - 0.05] ( search slowly for left side of hole 2nd 
time )
#<_tmp_l_x>     = #5061 ( record left x value, fine tuned )

( put machine at centered x )
#<_center_x>=[[#<_tmp_r_x> + #<_tmp_l_x>] / 2.0000] ( gives center of hole in x 
dir )
G1 F#<_1st_speed> x#<_center_x> ( put probe in center of X )

( x is working, do the same for y )
( FIND BACK OF HOLE FOR Y )
G04 P0.1 ( wait for cap to charge ) 
G38.2 f#<_1st_speed> y#<_back_y> ( now find back of hole for back y OK )
G1 y[#5062 - 0.015] ( Open probe contact )
G04 P.2 ( wait for cap to charge )
G38.2 f#<_2nd_speed> y[#5062 + 0.05] ( now find back of hole for back y )
( BACK OF HOLE IS TMP_B_Y )
#<_tmp_b_y>     = #5062
G1 F#<_1st_speed> y[#5062 - 0.015] (break contact)

( FIND FRONT OF HOLE FOR Y )
G38.2 F#<_1st_speed> y#<_front_y> ( now find front of hole for front y )
G1 y[#5062 + 0.015] ( Open probe contact )
G04 P.1 ( wait for cap to charge )
G38.2 f#<_2nd_speed> y[#5062 - 0.05] ( now find front of hole for front y )
( FRONT OF HOLE IS TMP_F_Y )
#<_tmp_f_y>     = #5062
( CALCULATE CENTER OF Y )
#<_center_y>=[[#<_tmp_b_y> + #<_tmp_f_y>] / 2.0000]
G1 F#<_1st_speed> y#<_center_y> x#<_center_x> ( put in center of hole )
( output value established, HOME XY here )
M5 (stop spindle)
#100    = #<_center_x>
 ( last is board X offset for top )
#101    = #<_center_y>
(debug, corrected X offset for X is #<_center_x>)
(debug, corrected Y offset for Y is #<_center_y>)

(msg, now manually home X and Y  & repeat run if either error is more than 
0.001)
(msg, if X or Y are more than .001 from zero, re-home and re-run)
o<tholefinder.ngc> endsub

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to