On 3/12/24 13:49, gene heskett wrote:
On 3/11/24 12:31, andy pugh wrote:
On Mon, 11 Mar 2024 at 00:11, gene heskett wrote:
Since no one has commented I updated to todays build, no help there.
lcnc refuses to move the machine by my code more than once per startup.
It sounds like the code leaves a parameter in a state that causes the
code to skip.
If it isn't error-ing then it is probably running to completion, but
not doing what you expect.
Try running through it in single-block mode.
I got tired of looking at all the screaming qt was doing trying to get
my camera to work, so I commented it out. Another and2 fixed the false
atspeed indicator saying its at speed when stopped. But what I set for
MIN_VELOCITY in the spindle_0 section of the ini has no effect. I still
have to click the + button to start the spindle at about 105 revs. So
now its warmed up, I'll go play.
Cheers, Gene Heskett, CET.
More of the same, might be a little more stable w/o all the qt
screaming.
It will Single Step to the end of the first
hole while I fine tune some of the presets for the first hole, And as
the center of x or y is found. I mam updating the 3 vars that the hole
finder routine uses to recenter before starting the next measurement.
But my run once per restart of linuxcnc continues. It will not restart
the spindle on the 2nd try. This "first move" is in the o sub.
The s<_searck_revs> command is a few lines prior to the M4, works the
first time every time, very occasionally works 2nd time.
When I know it should have spun up the spindle to around 1000 revs to
find the linear rails top, the spindle hasn't turned and the atspd led
is still red. No debug statements elsewhere in the code ever exec.
No response at all to the step button but the stop button works fine.
All indications are that atspeed is the culprit. I can debug the
#<_search_revs> var, and it reads just fine. But an M4 on the mdi line
does zip.
I sure could use a clue. Latest, probably messy code attached.
Thanks Andy. Take care & stay well.
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
( linear_bearings.ngc, copyright 25 Feb 2024 by Maurice E Heskett, CET )
#<_measure>=1. ( zero to drill after changing fr probe to 3mm cutter )
#<_hole_spc> = 60. ( nominal space beteen holes drilled )
#<_xy_spd> = 3
#<_z_spd> = 15
#<_search_revs> = 1500 (in M4 reverse)
G17 G21 G40 G49 G54 G61.1 G80 G90 G94 ( setup to use xy arcs, metric, exact
path)
( cancel diameter comp,cancel length off set, G54 coordinates system 1, )
( cancel any canned cycles, absolute distances, feed per minute mode )
( setup contact to ground to bearing, put probe in spindle with probe wire )
( NOTE Andy Pugh says this is a valid way to address an array: #[100 + #3] )
( but he didn't mention that debug was broken, so if we want to see it )
( to a global var, we must first copy the #<_gvar> = #[basenum+#50] )
( rather cumbersome proceedure )
(pre-alloocate the bounce vars for floats)
(allocate vars, 6 point holding tank)
#<_zx> = 0. (for z stuffs)
#<_zy> = 0. (for z stuffs)
#<_zz> = 0. (for z stuffs)
#<_xyx> = 0. (for hole stuff)
#<_xyy> = 0. (for hole stuff)
#<_xyz> = 0. (for hole stuff)
#50=0 ( set index to zeroth element then set starting points )
#[200+#50] = 2.6 ( zeroth x location for z_check )
#[210+#50] = 2.1974( zeroth y location for z_check )
#[220+#50] = -84 ( zeroth height to begin z search )
#[230+#50] = 11.500( zeroth hole xy x location )
#[240+#50] = 1.8424 (zeroth holes xy y location )
#[250+#50] = [-1.75 + #[220+#50]] ( to see if math works place xy probe 1.75mm
into hole)
(debug, init_arrays done)
o sub
( now, copy all that to global vars )
#<_zx> = #[200+#50] (z_check x)
#<_zy> = #[210+#50] (z_check y)
#<_zz> = #[220+#50] (z_check z)
#<_xyx> = #[230+#50] (hole_check x)
#<_xyy> = #[240+#50] (hole_check y)
#<_xyz> = #[250+#50] (hole_check z)
( preset 3 vars for hole_finder)
#100= #<_xyx>
#101= #<_xyy>
#102= #<_xyz>
o endsub
o sub
(debug,lb sa 47 hole=#50)
(debug,lb sa 48 zx=#<_zx> #<_zy> #<_zz>)
(debug,lb sa 49 xyx=#<_xyx> #<_xyy> #<_xyz>)
(debug,lb sa 50 #100 #101 #102)
o endsub
o sub
( uses hole arrays 230-240-250 but update all for this hole )
#[230+#50] = #100 (metric x return from hole_finder)
#[240+#50] = #101 (metric y return from tholefinder)
#[250+#50] = #102 (metric z return from latest g38.2 z-75)
o endsub
o sub ( last command of main loop )
( will make data for 9th hole but while will never use it)
( z_checks xyz locations for next hole )
#51 = [#50+1] ( make 51 into next member of array )
(first 3 for z_check)
#[200+#51] =