On Monday 02 November 2020 14:58:59 Craig Hodne via Emc-users wrote: > > Here is the code I have adapted from counterbore.py's output to try > > and be position independent: Single stepped from MDI input > > ===================== > > (counterbore sub) > > o100 SUB > > (SHCS Counterbore, Diameter = 0.3900, Depth = 0.1750 ) > > (Number of Cuts 7, Depth of Cut 0.0250) > > (Tool Diameter = 0.2500) > > (Spiral Down to Depth of each Pass and Spiral Out) > > F10.0 S1000 M3 (start spindle) (works) > > (Hole Pattern Center is at touched off X0.0000 Y0.0000) > > (use polar coord moves to position, then call this sub) > > G90 (absolute distance mode) (works) > > G0 Z4.2500 (clear fixtures etc) (works) > > G91 (relative distance mode) > > G0 X0.0000 Y-0.0700 (pre-position to start a G3 move) (works) > > (spiral down in relative, so just step z down in additive mode) > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 (dies here) > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 > > G3 X0.0000 Y-0.0700 Z-0.0250 J0.0700 > > (clean up bottom of hole) > > G3 X0.0000 Y-0.0700 J0.0700 > > G90 (back to absolute) > > G0 Z4.2500 (clear work and clamps) > > G1 X0.0000 Y0.0000 (back to center of pattern) > > M5 (turn off spindle) > > o100 ENDSUB > > ( list of locations in polar format, 3 at this time) > > #<_clear_work> = 4.5 (inches) > > > > G0 z#<_clear_work> (works) > > G61 (works) > > G1 F20 @2.5000 ^11 (goes to 1st location, works) > > o100 CALL (fails, on first G3, see above) > > G0 z#<_clear_work> > > G1 F20 @2.5000 ^100 > > o100 CALL > > G0Z#<_clear_work> > > G1 F20 @2.5000 ^175 > > o100 CALL > > ( etc etc) > > M5 > > M2 > > ====================== > > Called counterbore5mm.ngc > > Won't load-run, 50% error. > > > > What am I doing wrong? > > > > Thank you. > > > > Cheers, Gene Heskett > > Gene, I believe your problem is based in incrementing the Y-axis > position in each of the steps. Change the Y-0.0700 to Y 0.0000 for > each of the steps in the subroutine. The only axis you want to > increment is the Z axis. > > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > G3 X0.0000 Y-0.0000 Z-0.0250 J0.0700 > > You want the end of the arc to be in the same place as the start of > the arc, not 0.0700 further in the negative Y direction. As you have > coded it, the arc begins with a radius of 0.0700 and ends with a > radius of 0.1400. > > Craig
That may indeed have been the problem, but it was a straight copy/paste from counterbore.py, from the "simple-gcode-generators.zip" from JT's site at gnipsel. I found that link in our wiki. In any event, the first move placed the tool at the top of the circle, and each subsequent y should have wound up at the same xy, with z decremented, and it bailed on the first g3 move before doing it. What fixed it was junking the G90/G91 in favor of a temporary G92 x0 y0, and a G92.1 to restore the mapping when that sub invocation was finished That and using arcgenm18.py for the code src allowed me to shrink the sub by about 13 lines. And it just worked. ;-) The cake icing was that I could use a G1 F40 @2.5000 ^degrees to do the circle of mounting holes at the edge of a circular plate, without all the math to calculate it in x/y format. Thanks Craig. 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) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/gene> _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
