On Thursday, December 15, 2011 11:38:27 AM cogoman did opine:

> On 12/15/2011 05:35 AM, emc-users-requ...@lists.sourceforge.net wrote:
> >> was thinking about this what if one was to attach a synchronus steppe
> >> as an encoder one could under drive it ( incresed sensivity,and
> >> resolution), put current limiting resistors inline (10 k ohm?) and
> >> opt isolate to protect from overvoltage, and the back emf would
> >> provied sensor signal, any thoughts? and maybe an h bridge to clamp
> >> low (i.e. braking?) seems like this would be robust and relatively
> >> inexpensive with many benefits thanx jeremy
> > 
> > nice in theory, in practice you'll face serious magnetic noise in a
> > machine; I tried - not viable for me
> > 
> > you're better off shooting a decent encoder off ebay or so
> 
>     If you're looking for cheap, you could try having Staples laser
> print on transparency paper your favorite encoder disc from one of those
> encapsulated postscript  encoder files, and reading it with the optics
> from an old mouse with a ball.
>    Does anybody think a somewhat universal encoder file in .EPS format
> would make a good addition to the wiki?

There is already one there, in g-code IIRC, so you can cut it from sheet 
metal or some sort of composite like the pocket clip name tag plastic.  I 
grabbed it a couple years ago, and adjusted its scaling and hole sizes and 
pattern radii so I could cut it with a 1/16" bit & fits the shaft of the 
spindle in the lathe.  In this case its trapped between the preload nut and 
its locknut on the back end of the spindle in my 7x12.  But that is as far 
as I got, I need to order me up a bag of interrupters & finish making an A-
B + X encoder out of it.  But this time I am gonna be sure I have accurate 
basing and pin assignments KNOWN about the opto's I use.  The ones I got 
had absolutely no pin 1 marks of any kind that were visible by the 16MM 
projection lens used as a magnifier.  All the smoke came out about 1 
millisecond after I hooked up a 5 volt supply.  Discouraging.

Now, I WAS going to furnish the URL to that bit of code as I am sure I got 
it from the wiki originally, but now I cannot find it.  So my hacked up & 
shrunken copy is attached.  Adjust to suit with your fav editor

I cut mine from some fairly hard alu sheet of about 16 gauge thickness.  
This version is fairly compact since there isn't a heck of a lot of spare 
room under the gear cover on a 7xN lathe.

> I open them up in GIMP, and
> write out a .JPG or .PNG that can be brought into LibreOffice and sized
> to fit your needs (as long as there are enough dots per inch to your
> printer.)  If you try this and you want great resolution (lots of dots),
> and you have an old PC (256MEG of RAM) you WILL need a chunk of swap
> space.  This can make GIMP seem like it's locked up, but as long as you
> have enough swap space it will only take a long time.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene>
Extreme fear can neither fight nor fly.
                -- William Shakespeare, "The Rape of Lucrece"
( spindle-encoder.ngc )
( by Lawrence Glaister VE7IT )
( Sept 15 2007 )
( lerman - thankyou for named variables and owords.... very cool )
( Cut from arborite stock with 0.049" endmill. )
( This encoder ring mounts on the lathe spindle drive pulley. )
( Ring encoder provides A,B,Z phases using 3 H21TLB slot sensors. )
( The H21TLB sensor use 5v and can directly drive parallel port pins. )
( The sensor apeture is 0.035", so I used double that for the slot length )
( to allow for some runout on mounting the ring. )
( The main constraint is that the main track opto has to be able to physically )
( read the inner track... reaching over the outer index track )
( To preview what it will look like, set _endmill_dia = 0.0 below. )
( With a high speed spindle you may be able to cut to depth in 1 pass. )
( This example only cuts to -0.020... this can be edited and the program )
( rerun to do 2 passes )

(======================================================================)
(============================= Subroutines ============================)
( cuts a circle at request diameter around x,y to requested depth )
o100 sub
  (Subroutine to do a circle)
  ( P1=X center P2=Y center P3-diameter P4=depth P5=feedrate )
  g0 z#<_safe_Z>
  g0 x[#1-[#3/2]] y#2
  g1 F[#5/2] z#4
  g2 F[#5] x[#1-[#3/2]] y#2 i[#3/2] j0
  g0 z#<_safe_Z>
o100 endsub

(======================================================================)
(=================== Define Constants/Variables =======================)
#<_endmill_dia> = 0.047                                   ( endmill diameter )

#<_safe_Z> = 0.100                                ( safe Z height )
#<_Zcut> = -0.050                                 ( Z depth to cut encoder 
elements )
#<_feedrate> = 5.0                                    ( cutting feedrate )

( define characteristics of encoder and index tracks )
#<_main_track_dia> = 7.250                        ( diameter of main signal 
track )
#<_index_track_dia> = [#<_main_track_dia> + 0.140] ( diameter of index track )
#<_inside_cutout> = 5.500                 ( diameter of interior cutout == 
inside of pulley)
#<_outside_cutout> = 7.525                        ( diameter of exterior cutout 
~= enough space for tracks)
#<_encoder_cycles> = 90                           ( number of slots to cut 180 
* 4 == 1/2 degreee resolution)
#<_slotlen> = 0.090                       ( finished slot length for 1 encoder 
element ~= sensor aperture + runout )

( define 3 params for the mounting arrangement )
#<_mount_circle> = 6.000                                  ( mounting bolt 
circle diameter )
#<_mount_holes> = 6                                               ( number of 
holes to mill for mounting bolts )
#<_mount_hdia> = 0.130                                    ( sloppy #6 or a #8 
bolt )

#<_PI> = 3.14159
#<_endmill_rad> = [#<_endmill_dia>/2.0]   ( endmill radius )
#<_encoder_theta>=[360.0/#<_encoder_cycles>]  ( angular step around circle  - 
degrees)

(======================================================================)
(========================= Start of Main Code =========================)


G20 G90
G64 P.002
G0 z#<_safe_Z>
G0 X0 Y0

m0(DEBUG,spindle_encoder.ngc: #<_encoder_cycles> cycle disk uses 
#<_endmill_dia> dia endmill, material top,center at 0,0,0 ... unpause[S] when 
ready)
o100 call [0.0] [0.0] [#<_outside_cutout>+#<_endmill_dia>] [#<_safe_Z>] [30.0]
( cut the main encoder slots )

( compute angular size of cutter at cutting extremes )
#<inner_dia> = [#<_main_track_dia> - #<_slotlen> +  #<_endmill_dia>]
#<outer_dia> = [#<_main_track_dia> + #<_slotlen> -  #<_endmill_dia>]
#<icutter_deg> = [#<_endmill_dia>*360.0/[#<inner_dia>*#<_PI>]]
#<ocutter_deg> = [#<_endmill_dia>*360.0/[#<outer_dia>*#<_PI>]]
#<slot_deg> = [#<_encoder_theta>/2.0 ]
#<slots> = #<_encoder_cycles>     ( counter for cutting this many slots )
#<angle> = 360                    ( starting angle to cut )

( rough check to see if cutter dia and disk resolution are feasible )
o5 if [#<icutter_deg> GT #<slot_deg>]
  (print,icutter_deg= #<icutter_deg>, slot_deg= #<slot_deg>)
  (DEBUG, Unable to cut encoder because #<_endmill_dia> cutter is too large for 
a #<_encoder_cycles> cycle #<_main_track_dia> dia disk)
  m2
o5 endif
( check to see if we can machine mounting holes )
o7 if [ #<_mount_hdia> LE #<_endmill_dia> ]
  (print,Unable to machine mounting holes as #<_endmill_dia> endmill is too big 
to cut #<_mount_hdia> dia holes )
  (DEBUG,Unable to machine mounting holes as #<_endmill_dia> endmill is too big 
to cut #<_mount_hdia> dia holes )
  m2
o7 endif

( main loop to cut encoder slots around disk )
o10 do
  #<centerx> = [#<_main_track_dia>/2.0 * cos[#<angle>]]  ( x center of slot )
  #<centery> = [#<_main_track_dia>/2.0 * sin[#<angle>]]  ( y center of slot )
  g0 z#<_safe_Z>
  g0 x[#<centerx>] y[#<centery>]
  ( do a cut to the final depth at the cw inner corner of the slot )
  #<myangle> = [#<angle> - [#<slot_deg>/2.0] + [#<icutter_deg>/2.0]]
  #<myx> = [#<inner_dia>/2.0 * cos[#<myangle>]]
  #<myy> = [#<inner_dia>/2.0 * sin[#<myangle>]]
  g1 x[#<myx>] y[#<myy>] z[#<_Zcut>] f[#<_feedrate>/2.0]  ( decend to cut depth 
)

  #<myangle> = [#<angle> + [#<slot_deg>/2.0] - [#<icutter_deg>/2.0]]
  #<myx> = [#<inner_dia>/2.0 * cos[#<myangle>]]
  #<myy> = [#<inner_dia>/2.0 * sin[#<myangle>]]
  #<myr> = SQRT[#<myx>*#<myx> + #<myy>*#<myy>]
  g3 x[#<myx>] y[#<myy>]  r[#<myr>] f[#<_feedrate>] ( cut inside edge of slot )

  #<myangle> = [#<angle> + [#<slot_deg>/2.0] - [#<ocutter_deg>/2.0]]
  #<myx> = [#<outer_dia>/2.0 * cos[#<myangle>]]
  #<myy> = [#<outer_dia>/2.0 * sin[#<myangle>]]
  g1 x[#<myx>] y[#<myy>]                  ( cut ccw edge of slot )

  #<myangle> = [#<angle> - [#<slot_deg>/2.0] + [#<ocutter_deg>/2.0]]
  #<myx> = [#<outer_dia>/2.0 * cos[#<myangle>]]
  #<myy> = [#<outer_dia>/2.0 * sin[#<myangle>]]
  #<myr> = SQRT[#<myx>*#<myx> + #<myy>*#<myy>]
  g2 x[#<myx>] y[#<myy>] r[#<myr>]                ( cut outer edge of slot )

  #<myangle> = [#<angle> - [#<slot_deg>/2.0] + [#<icutter_deg>/2.0]]
  #<myx> = [#<inner_dia>/2.0 * cos[#<myangle>]]
  #<myy> = [#<inner_dia>/2.0 * sin[#<myangle>]]
  g1 x[#<myx>] y[#<myy>]                  ( cut back to inner cw point of slot )

  g0 z#<_safe_Z>
  #<slots> = [#<slots> -1]
  #<angle> = [#<angle> - #<_encoder_theta>]
o10 while [#<slots> GT 0]

( cutout index hole)

( compute angular size of cutter at cutting extremes )
#<inner_dia> = [#<_index_track_dia> - #<_slotlen> +  #<_endmill_dia>]
#<outer_dia> = [#<_index_track_dia> + #<_slotlen> -  #<_endmill_dia>]
#<icutter_deg> = [#<_endmill_dia>*360.0/[#<inner_dia>*#<_PI>]]
#<ocutter_deg> = [#<_endmill_dia>*360.0/[#<outer_dia>*#<_PI>]]
#<slot_deg> = [#<_encoder_theta>/2.0 ]
#<angle> = 360                    ( starting angle to cut )

#<centerx> = [#<_index_track_dia>/2.0 * cos[#<angle>]]   ( x center of slot )
#<centery> = [#<_index_track_dia>/2.0 * sin[#<angle>]]  ( y center of slot )
g0 z#<_safe_Z>
g0 x[#<centerx>] y[#<centery>] 
( do a cut to the final depth at the cw inner corner of the slot )
#<myangle> = [#<angle> - [#<slot_deg>/2.0] + [#<icutter_deg>/2.0]]
#<myx> = [#<inner_dia>/2.0 * cos[#<myangle>]]
#<myy> = [#<inner_dia>/2.0 * sin[#<myangle>]]
g1 x[#<myx>] y[#<myy>] z[#<_Zcut>] f[#<_feedrate>/2.0]  ( decend to cut depth )

#<myangle> = [#<angle> + [#<slot_deg>/2.0] - [#<icutter_deg>/2.0]]
#<myx> = [#<inner_dia>/2.0 * cos[#<myangle>]]
#<myy> = [#<inner_dia>/2.0 * sin[#<myangle>]]  
#<myr> = SQRT[#<myx>*#<myx> + #<myy>*#<myy>]
g3 x[#<myx>] y[#<myy>]  r[#<myr>] f[#<_feedrate>] ( cut inside edge of slot )

#<myangle> = [#<angle> + [#<slot_deg>/2.0] - [#<ocutter_deg>/2.0]]
#<myx> = [#<outer_dia>/2.0 * cos[#<myangle>]]
#<myy> = [#<outer_dia>/2.0 * sin[#<myangle>]]
g1 x[#<myx>] y[#<myy>]                  ( cut ccw edge of slot )

#<myangle> = [#<angle> - [#<slot_deg>/2.0] + [#<ocutter_deg>/2.0]]
#<myx> = [#<outer_dia>/2.0 * cos[#<myangle>]]
#<myy> = [#<outer_dia>/2.0 * sin[#<myangle>]]
#<myr> = SQRT[#<myx>*#<myx> + #<myy>*#<myy>]
g2 x[#<myx>] y[#<myy>] r[#<myr>]              ( cut outer edge of slot )

#<myangle> = [#<angle> - [#<slot_deg>/2.0] + [#<icutter_deg>/2.0]]
#<myx> = [#<inner_dia>/2.0 * cos[#<myangle>]]
#<myy> = [#<inner_dia>/2.0 * sin[#<myangle>]]
g1 x[#<myx>] y[#<myy>]                   ( cut back to inner cw point of slot )

g0 z#<_safe_Z>


( mill some mounting bolt holes )

#<holes> = #<_mount_holes>
#<myangle> = 0
o20 do
    #<myx> = [#<_mount_circle>/2.0 * cos[#<myangle>]]
    #<myy> = [#<_mount_circle>/2.0 * sin[#<myangle>]]
              ( X )      ( Y )             ( Diameter )           ( Depth )    
( Feed )
    o100 call [#<myx>] [#<myy>] [#<_mount_hdia>-#<_endmill_dia>] [#<_Zcut>] 
[#<_feedrate>] ( one mounting hole )
    #<myangle> = [#<myangle> + [ 360.0/#<_mount_holes>] ]
    #<holes> = [#<holes> -1]
o20 while [ #<holes> GT 0 ]

( cutout encoder ring )
          ( X ) ( Y )             ( Diameter )             ( Depth )    ( Feed )
o100 call [0.0] [0.0] [#<_inside_cutout>-#<_endmill_dia>] [#<_Zcut>]  
[#<_feedrate>]      ( interior cutout )
o100 call [0.0] [0.0] [#<_outside_cutout>+#<_endmill_dia>] [#<_Zcut>] 
[#<_feedrate>]      ( exterior cutout )



M2
------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to