View Single Post
  #22   Report Post  
Posted to rec.crafts.metalworking
Jon Elson Jon Elson is offline
external usenet poster
 
Posts: 1,384
Default IGGY - Pocket Drilling

Ignoramus4779 wrote:


Did He give any explanation? I am writing them right and left and am
very happy.

My program was a bit different, instead of passing parameters to the
subroutine, I was
offsetting the work coordinate system each time before calling the
subroutine.
So, I would do :
G01 X1.2345 Y3.456
O100 call
G01 X3.456 Y4.567
O100 call
......
and the subroutine had :

O100 sub
N01 G55
N02 G92 X0 Y0
N03 G01 F45.0 X0.0725 Y0.0725
N04 Z0.01
......

The first problem I had was an unspecified Z offset was changing without
my specifying it. I was
assuming that if I didn't specify a Z offset in the G92 that the Z
offset would not be changed.

The fix for that was to use G10 L20, and to specify
all axes in the command. This all got discussed on the EMC developer's
list on 5/14/2010.
Up to this point, I think the entire problem was my fault in not
understanding how G92 works.

But, then, I ran into the "run from line" problem, where I could not
restart the program in the
middle. It wasn't until 5/17 that John Kasunich made the immortal "it
is evil. don't do it"
statement, but he actually said that Run from line was evil, not
subroutines! Sorry for my
mis-remembering exactly what he said.

Anyway, I don't think there was ever a concrete explanation of what was
wrong, or if there
was any fix. The program is still up on pastebin, at
http://pastebin.com/embed_js.php?i=QyjpZUD9
If you want, you can try it out. It defines a subroutine, then moves to
the first slot corner
and calls the subroutine, moves, calls it again, etc. The subroutine
shifts the G55 coordinate
system with G10 L20 P2, then changes to the G55 system and machines a
slot, then goes
back to G54 and returns. At the end of 24 slots, it does some different
cutouts with linear program steps. If you interrupt the run after the
first subroutine, and then try to run from
line, it will skip the 24 subroutine slots and perform the last cutouts
perfectly. You can try this in air
and watch the Axis preview to follow what it is doing. It didn't do
anything wild, it just skipped over
a huge part of the job.


Jon