Kirk Wallace wrote:
> In case anyone is interested, I have an .ngc file that I'll probably run
> tomorrow, but if anyone finds anything that might improve it, I would
> appreciate hearing from you. Thanks.
>
> http://wallacecompany.com/machine_shop/EMC2/ngc/encoder-100ppr-4c.ngc 
>
>   
Without reverse engineering the actual slot angles, etc, it is difficult 
to really *know* what the code does. Assuming though, it is intended to 
do what the AXIS backplot shows it is doing, the code can be greatly 
improved. Just to be sure, I'm going to start by stating what I think 
the intention of the code is.

The code mills a disk. The disk has a center hole and twenty-five radial 
slots. The slots have equal size and spacing. The spacing is different 
than the slot width.

I would start by defining what I want to do as a gcode subroutine:

See: http://pastebin.com/m7803d6eb for an outline -- reproduced, below.

   1.
      (helper function to mill a single slot)
   2.
      (#1 - angle)
   3.
      (#2 - slot width in degrees)
   4.
      (#3 - radial distance from center to edge of slot)
   5.
      (#4 - radial length of slot)
   6.
      o<encoder_MillSlot> sub [#<angle>] [#4>] [#5] [#6]
   7.
      (...code to be supplied)
   8.
      o<encoder_MillSlot> endsub [#<angle>] [#4>] [#5] [#6]
   9.
       
  10.
      (Mill an encoder disk)
  11.
      (#1 - outside diameter)
  12.
      (#2 - hole diameter)
  13.
      (#3 - number of slots)
  14.
      (#4 - slot width in degrees)
  15.
      (#5 - radial distance from center to near edge of slot)
  16.
      (#6 - radial length of slot)
  17.
      o<encoder> sub
  18.
      #<N> = #3
  19.
       
  20.
      (mill the outside)
  21.
      (...code to be supplied)
  22.
       
  23.
      (mill the central hole)
  24.
      (...code to be supplied)
  25.
       
  26.
      (mill the slots)
  27.
      #<cnt>=0
  28.
      o<slotLoop> while [#<cnt> LT #<N>]
  29.
         #<angle> = [360 * #<cnt> / #<N>]
  30.
         o<encoder_MillSlot> call [#<angle>] [#4>] [#5] [#6]
  31.
      o<slotLoop> endwhile
  32.
       
  33.
      o<encoder> endsub

If you write something like this, it will be useful for all of us. 
Things that you might consider adding to the general outline:

1 -- cutter diameter (to user cutter compensation)
2 -- depth of cut
3 -- an arbitrary center (I've assumed the center at (0,0))
4 -- roughing and finishing passes and specs for them

Ken




------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to