Re: [Emc-developers] This run once problem just won't to away.
On 3/13/24 15:19, gene heskett wrote: On 3/12/24 16:35, gene heskett wrote: 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. I found it, I think. When it fails, the speed signal value is being fed to pid.s.commamd, but pid.s.enable isn't being switched on, and I've located it in my hal, but I'm not visualizing it well since its nearly 10 yo code I've not modded since. Tracing backwards I'm getting lost in how I check the boot module for the pico-pwm-servo for an output of 5 at the state pin. I originally did a servo reboot at every spindle start. Its possible that I have lost the trigger signal in my mods to do the spindle turnaround as quick as I am. The idea is to delay the pid's output until the servo had been booted. I'll find it but its going to take more coffee. Which I've got to make. So call the St Bernards back in, its not LCNC's fault. It's mine and I'll own it. Thanks Andy. Cheers, Gene Heskett, CET. No, i won't own it. Someplace back in the fog of time, the comp module effectively got its in0 and in1 swapped so the man page is /now/ correct. It wasn't a decade back and I had to invert the .out to make it work then, now its correct and I no longer need the not if I swapped inputs. So I mow get an atspd indication that tells the truth. I s/b be fixed. Thanks Andy. Take care and 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 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] This run once problem just won't to away.
On 3/12/24 16:35, gene heskett wrote: 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. I found it, I think. When it fails, the speed signal value is being fed to pid.s.commamd, but pid.s.enable isn't being switched on, and I've located it in my hal, but I'm not visualizing it well since its nearly 10 yo code I've not modded since. Tracing backwards I'm getting lost in how I check the boot module for the pico-pwm-servo for an output of 5 at the state pin. I originally did a servo reboot at every spindle start. Its possible that I have lost the trigger signal in my mods to do the spindle turnaround as quick as I am. The idea is to delay the pid's output until the servo had been booted. I'll find it but its going to take more coffee. Which I've got to make. So call the St Bernards back in, its not LCNC's fault. It's mine and I'll own it. Thanks Andy. Cheers, Gene Heskett, CET. ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers 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 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] This run once problem just won't to away.
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] =
Re: [Emc-developers] This run once problem just won't to away.
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. -- "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 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] This run once problem just won't to away.
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. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] This run once problem just won't to away.
On 3/9/24 20:38, gene heskett wrote: This gcode, when I can get it to run, finda all 8 holes just fine. And now it will not run twice, refusing to go past the first move command on the 2nd try after a full restart, and rehome.. With no reported errors on the first run.. This is the current copy attached. nuke any others you might have before saving it, I won't touch till someone tells me to. Thanks all. Take care & stay well. Cheers, Gene Heskett, CET. 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. Does not highlight the failing line, no error messages except related to my camera which doesn't work on the terminal its started from. debug statements work up to the first s1000 call, but no further, the machine CAN move by hand or be rehomed but my code can't even start the spindle. It will do anything I've tried from the mdi. The only thing different between this code and other code I've written is the use of #[2xx+#50] syntax, where #50 is the loop counter start it 0, max 7, to access 6 10 element arrays, starting at 200,210,220,230,240 & 250, theoretically using 8 of the 10 locations which the part I have written uses to contain the xyz locations of the locations about 5mm away from each hole for the Z check location , that is 3 of the 6 arrays, and 3 more arrays to contain the XY's found for each of the 8 holes. Seems pretty simple and conventional. But w/o any error msgs, indicating what died, how should I proceed? The backplot has no problems displaying it including my mistakes. The coupling between the backplot and code list at the bottom works flawlessly. Many thanks to anyone who can help. ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers 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 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
[Emc-developers] This run once problem just won't to away.
This gcode, when I can get it to run, finda all 8 holes just fine. And now it will not run twice, refusing to go past the first move command on the 2nd try after a full restart, and rehome.. With no reported errors on the first run.. This is the current copy attached. nuke any others you might have before saving it, I won't touch till someone tells me to. Thanks all. 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> = 2000 ( first find starting x y z ) G17 G21 G40 G49 G54 G80 G90 G94 ( setup to use xy arcs, metric, ) ( 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 use it ) ( to a global var, we must first copy the #<_gvar> = #[basenum+#50] ) ( rather cumbersome proceedure ) (pre-alloocate the bounce vars for floats) o sub (allocate vars) #<_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) (so first, lets see if it actually works ) #50=0 ( set index to zeroth element ) #[200+#50] = 4 ( zeroth x location for z_check ) #[210+#50] = 1.117 ( zeroth y location for z_check ) #[220+#50] = -66 ( zeroth height to begin z search ) #[230+#50] = 9.5 ( zeroth hole xy x location ) #[240+#50] = 1.117 (zeroth holes xy y location ) #[250+#50] = [-1.75 + #[220+#50]] ( to see if math works) (debug, init_arrays done) o endsub 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) o endsub o sub (now the acid test, did it work?) (debug,lb 48 holenum=#50) (debug,lb 49 zx=#<_zx> #<_zy> #<_zz>) (debug,lb 50 xyx=#<_xyx> #<_xyy> #<_xyz>) (debug,lb 51 #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-70) o endsub o sub #51 = [#50+1] ( make 51 into next member of array ) #[210+#51] = #101 (propagate current z_c Y) #[220+#51] = #102 (propagate current z_c Z) #[230+#51] = [#100 + #<_hole_spc>] (add hole_spc to x for next hole) #[200+#51] = [#[200+#50] + #<_hole_spc>] (increment z c x spot too) #[240+#51] = #101 ( propagate found y to next hole) #[250+#51] = #102 ( propagate found z to next hole) o endsub o sub (debug,lb zc 72 in z check) s1000 (set spindle rpms) (debug,zc 74 spindle speed set 1000) G1 F1500 z-50 (lift tp clear traveler) G1 f1500 x#<_zx> y#<_xyy> (goto location of z check) G1 F1500 z[#<_zz> +1] (should be a mm above rail) M4 (start spindle, backwards) G4 P.3 (give move time to complete) G38.2 F15 z-70 ( locate top of rail for 1st time) #102 = #5063 ( save real z in mm) (debug,lb zc 82 Z=102=#102) M5 (stop spindle) o endsub o sub (debug,lb hc 87) G1 f1500 z-50 (clear traveler ) G1 f1500 x#<_xyx> y#<_xyy> (position over next hole) G1 f1500 z[#102 -1] (#102 has ben set, should place into hole counterbore) o endsub ( call hole_finder in main loop) o sub (debug,lb hc 94) G1 f1500 z-50 (clear traveler ) G1 f1500 x#100 y#101 (re-position over this hole using found values) G1 f1500 z[#102 -5] (#102 has ben set, should place into small hole) (ready for 2nd call to hole_finder2) o endsub o sub G1 f1500 z-50 G1 f1500 x#<_xyx> y#<_xyy> G1 f1500 z[#<_xyz> +15] (should place above hole) M4 G4 P10 (pause for inspection) M5 o endsub o sub (no z motion now) s#<_search_revs> (debug,HF 116 s/b just into current hole) M4 (start spindle in reverse) G4 p.25 G38.2 F#<_xy_spd> X[#<_xyx>-10] (find left side) G1 F1500 X#<_xyx> Y#<_xyy> (recenter) #110=#5061 (record it) G4 p.25 G38.2 F#<_xy_spd> X[#<_xyx>+10] (find right side) G1 F1500 X#<_xyx> Y#<_xyy> (recenter current hole) #111=#5061 (record it) g4 p.25 G38.2 F#<_xy_spd> Y[#<_xyy>+10] (find back side) G1 F1500 X#<_xyx> Y#<_xyy> (recenter current hole) #112=#5062 (record back side) G4