On Sunday, June 03, 2012 10:37:11 AM cogoman did opine:

> I reworked the postscript program so you can specify encoder wheel size,
> and index pulse width for an encoder, then you can call the subroutine
> (done twice at the bottom) at different places on the paper.
>    Hopefully the instructions in another message for using GIMP can get
> you the resolution you need.
> 
> On 06/02/2012 03:58 PM, gene heskett wrote:
> > Thanks cogoman.  This would be useful if I had room for a 6" OD wheel,
> > but my limit in the space I have is about 2.7" in diameter.
> 
> %! Postscript utility for printing multiple encoder wheels
> 
> /inch {72 mul} def              % #points/inch (don't change me)
> /sizeo 2 inch def               % outside radius of encoder wheel
> /sizei 1.8 inch def             % inside radius of encoder wedges
> /segments 256 def               % number of segments (black and white)
> /ipwidth 5.5 def                % width of index pulse bar
> /moveout 4 def            % how far from left side to put encoder wheel
> /moveup 4 def            % how far from the bottom to put the encoder
> wheel /angle 360 segments div def
> 
> /wedge
>   { /radius exch def
>    /angle_s exch def
>    /angle_e exch def
>    newpath 0 0 moveto
>    0 0 radius angle_s angle_e arc
>    closepath
>   } def
> 
> /encoder
> {
>      % ADD IN THE ENCODER WHEEL AT THE SPECIFIED DIAMETER
>      gsave
>       0 1 segments {
>        360 segments div rotate
>        angle 0 sizeo wedge
>        2 mod 0 eq {1} {0} ifelse
>        setgray fill
>       } for
>      grestore
> 
>          %THIS ROUTINE FILLS THE CENTER WITH WHITE, AND SOMEHOW PUTS A
> SOLID CIRCLE
>          %                  INSIDE THE GROUP OF WEDGES
>          %THIS LINE SPECIFIES WHERE TO PUT THE CENTER
> 
>      0 0 sizei 0 360 arc
>      gsave
>        0 setgray stroke
>      grestore
>        9 setgray fill
> 
>        ipwidth 0 sizei wedge
>        0 setgray fill
> 
> 
> 
>          %THIS ROUTINE PUTS A TINY DOT IN THE CENTER TO AID IN MOUNTING
> THE DISC
>          %THIS LINE SPECIFIES WHERE TO PUT THE CENTER
>      0.0 inch 0.0 inch .01 inch 0 360 arc
>      gsave
>        stroke
>      grestore
>      0 setgray fill
> 
> } def
> 
> gsave
>      2.5 inch 2.5 inch translate
>      encoder
> grestore
>      2.5 inch 7.5 inch translate
>      encoder
> showpage
> 
With your hints on the import settings, I may have something usable if I 
can get it cut out accurately enough.  As for slot widths, this 50% duty 
cycle won't cut it at all, but if occurs to me that I can probably adjust 
not only the width of the index, but the angle too such that two of them 
could be mounted with the image sides to each other, and adjust the timing 
relative to each other to get the slot width needed.  I haven't re-added 
the center dot since I re-sized that snippet to be the spindle hole yet.  
That dot could be the registration dot for cutting them out of the sheet 
with an etch bit in the mill.

Would it be possible to adjust the 'duty cycle' of these by multiplying the 
slots but sequencing the black and white such that 3 out of a sequence of 4 
are black? or 4 out of 5, 5 out of 6 etc etc?

My brass one when it was done about 23:00 last night, I put on and was able 
to make it work at least as well with the encoder module in mode 0 as I was 
able to make the 39 cycle wheel work in mode 1.  But its duty cycle was 
about 57 on to 43 off, with an actual slot width setting of .31 for the 
duty cycle.  These opto units are great, 10 ns response times and rail to 
rail outputs, but their aperture, probably being expanded by the polished 
interior surfaces of these slots, is eating my lunch.

I'd try blackening the brass, but blackening is not very effective at the 
low incidence angles involved.  Before that, I think I'd cut into a trace 
on the board and dim the leds as I fed them with a current that was mid-
range of the spec sheet, s/b around 12.5 ma if my math is correct.  I think 
at the 25 ma max, these things could see right through a sheet of .03125 
brass!

I figured this encoder was gonna be a piece of cake when I started it, but 
I think Murphy must have eaten the cake too, he sure drinks enough of my 
beer. :)

As for the various methods of blackening brass, discussed here previously, 
most were butt ugly, giving all the colors of a good skin bruise rather 
than a nice flat black.  I believe that was because of my inability to get 
all the cutting oil washed back out of the brass with clean acetone or 
boiling in dish soap.  I can't go enough narrower to fix it with a 1/32" 
mill as I can't trim the slot width more than another thou, so today I will 
try dimming the leds.  There has to be a fix someplace, I just have to find 
it...

Someone posted a link to a PID tuning procedure that has by now expired 
from this mailbox.  Could I ask whomever that was to please post it again? 

What I had last night, piddling around in the hal config screen but didn't 
save, seemed to be pretty stable, but a speed change was immediately to 
about 80% of the diff, a small pause and then it ramped to the final speed 
over the next 1.5 seconds.  That would be a sign of which gain is too high?

And even at 2 rps, my attempts to stall it by hand weren't successful, so I 
believe this one will be usable once the leds are dimmed a bit.  I need to 
see if there is a 100 ohm trimpot in my junk box.

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>
Look afar and see the end from the beginning.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to