Making/Printing Optical Encoder Disks; Inkjet vs. Toner; QRD1114 vs. Hamamatsu,
![Zoot](https://forums.parallax.com/uploads/userpics/559/nW4UO23UEIWZ4.png)
I'm working on some home-brew encoders for one of my 'bots. While the Hamamatsu detector (acroname.com/robotics/parts/R64-P5587.html would be a much better choice for the sensor, I have a bunch of the QRD1114 sensors on hand so I thought I'd try them.
I set up a test rig on my bench -- the sensors and my optical pattern seem fine (on the scope) BUT THE INKJET PRINTED DISKS do not have a black that is black (or dark, or matte, or whatever) enough to deactivate the sensor. In other words, when I made a disk with lines of black electrical tape, it worked great, even at high speeds. On the inkjet (printed on cardstock) disks, the "black" is seen the same as "white", i.e., regardless of how it looks, the inkjet black still reflects a high amount of IR.
I don't want to cut disks out of tape -- any suggestions? I even tried printing 2-3x on the same sheet to get the ink darker (it was extremely black and dark at that point) but it still reflected the IR.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 5/20/2008 10:16:19 PM GMT
I set up a test rig on my bench -- the sensors and my optical pattern seem fine (on the scope) BUT THE INKJET PRINTED DISKS do not have a black that is black (or dark, or matte, or whatever) enough to deactivate the sensor. In other words, when I made a disk with lines of black electrical tape, it worked great, even at high speeds. On the inkjet (printed on cardstock) disks, the "black" is seen the same as "white", i.e., regardless of how it looks, the inkjet black still reflects a high amount of IR.
I don't want to cut disks out of tape -- any suggestions? I even tried printing 2-3x on the same sheet to get the ink darker (it was extremely black and dark at that point) but it still reflected the IR.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 5/20/2008 10:16:19 PM GMT
Comments
If the former, maybe you could print the ink on an IR-absorbing material ?
Have you tried other ink colors, to determine their reflectivity ?
PAR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I would have used a laserprinter but we don't have one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
[noparse][[/noparse]Maybe "dullcote"?· Might have an adverse effect on the ink.]
The chances are pretty good at this point that the problem is not the ink. I suspect the problem is that you're using ordinary high-gloss printer or utility paper. Try using a low-gloss paper, like ordinary typing paper, for a standard typewriter.
What you're probably getting is a glossy black surface, and what you want it a dull or "matte" black surface. Another way to say it is "non-glare", if you've seen that term used before in speaking about finished surfaces.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
I took a Sharpie and hand-darkened the stripes (only took a minute) and now I'm getting nice results. That said, this particular disk only has 15 black stripes + 15 white stripes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
All results the same. I actually thought the same thing -- I figured running heavy ink on matte lightweight paper would have the best chance of absorbing the ink droplets, but it doesn't. Either that or the inkjet ink is highly reflective to IR (at least with these particular detectors). I may try some other stock tomorrow if I have any likely candidates lying about.
Going over with Sharpie not bad though -- and I'm not making 10 disks a day or anything
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
You should be able to see if the I/R is reflected by using any sort of camera with a CMOS image sensor. This would include web-cams, video recorders, security cameras, etc. Any solid-state camera will do.
You may need to move the camera around to catch the light angle, if you get my meaning. If the light is on one side, you need to be on the opposite side, at the proper angle. Like light reflecting off a mirror, so to speak.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
http://www.parallax.com/Store/Components/IntegratedCircuits/SensorChips/tabid/618/CategoryID/83/List/0/SortField/0/Level/a/ProductID/90/Default.aspx
At some point I am going to order and try out the Hamamatsu's -- my guess is they won't be as easily fooled (since they are designed for paper detection, are focused, not diffused, have faster rise/settling time, etc.). But I could be wrong. I am also going to try out a toner based disk at some point.
Re: dust/IR interference -- when I can find the time to mount these up, I'm going to be enclosing the whole encoder apparatus in some kind of can (the dusty Southwest has already maimed the encoder on our Roomba just from dust and dust bunnies), e.g. -- www.dprg.org/projects/2001-09a/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
-Phil
What about lowering the gain to the IR transmitter LED by increasing the value of the series resistor?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Try printing on a transparency and view the ir coming through it with a camera. The ink may just be ir transparent.
Rick
Phil -- specular angle -- I had the sensor on a "third hand" and tried all sorts of angles. Off perpindicular angles certainly gave better results, but not with any regularity or consistency.
Beau -- I tried LED limiting resistors from 220 up to 20k. On my jig, with about 2mm between detector and disk, around 10k gave the best results on the Sharpie-darkened disk -- higher resistance gave a lot of false negatives, lower resistance just made things erratic.
I will print on transparency and test the ink itself -- while darkening a disk by hand is OK, it would be nice to be able to just print out encoder disks and linear encoder strips w/o a lot of hand-work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
First, unless there is someone out there that knows something I don't, INKJET INK WILL NOT ABSORB IR. And trust me, I tried more variations than you want to think about -- different colors, different mixes, different papers, running through black only, printing 3-4-5 times on the same sheet, printing both sides, etc.
Second, most any TONER based print WILL work EVEN IF THE PRINTS ARE REALLY CRAPPY. I had dark dark dark inkjet prints that would not absorb, the same disks as a bad xerox or laser-print (where the "blacks" are washed out and you can see paper showing through, etc) WORKED perfectly every time. I checked all kinds of prints under loupe -- the toner or ink coverage is NOT what matters -- there is something about inkjet ink (at least for Espon, HP, Canon, etc) that reflects IR really really well. In fact, in a number of tests, the "darker" the inkjet ink, the MORE it reflected IR. I had one disc where the "black" actually reflected better than the blank "white" paper. Ambient light, changing sensor distances, different resistance values on the IR led do not seem to affect the results.
Third, while the QRDs are great sensors, since they are meant for "diffused" purposes, they did not give me nearly the sharp waveforms (nor the rise and fall times) that the Hamamatsus I ordered gave me. The Hamamatsus are SWEET for this purpose -- they are designed specifically for highspeed paper edge detection at close distance (like in copiers). I tested the QRDs both as discrete components and using the Parallax's line-sensor board (which is basically the QRD with a ready-to-go RC circuit). That said, if the encoder is not moving quickly AND you can get by with "wide" stripes, the QRDs would be fine.
In fact, the QRDs have proven their worth as cliff-detectors in table top robots. If you are using them with RCTIME, you can easily distinguish between a "cliff" (radically high RCTIME) and "black", "white" and "table" -- presuming the latter is a theoretical gray somewhere distanced from your black and white. But that's a separate topic for another time (i.e. when I get pix and video of my line-following, paper-finding "printer" bot up in the projects sections).
I'm installing encoders on my biggest 'bot over the next few days. I've got 4.25" disks with 142 (72 pairs) edges -- giving me about .26 CM per "tick" of resolution. This is with the Hamamatsus. Not doing quadrature (though I have the parts and the mounts) for now, but should be pretty nice.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
- you'll get best "ticks" resolution and largest size of black/white stripes if you mount encoder disk to motor shaft or secondary gear shaft (rather than the wheel). E.g, my motors are geared down ~87:1 so I could put just 6 stripes on a disk on the motor shaft and get 282 ticks per revolution of the wheel. But I didn't. Why? A) I didn't want to permanently glue/modify the motors or secondary shaft on my motors (they are old and not easily replaceable;
- I cut my encoder disks out of the clear plastic spacer "lid/washer" thingies that come at the top and bottom of a spindle stack of blank CDs or DVDs (sorry, don't know what else to call them). They fit my axles perfectly, are light, stiff, and easily cut. I "turned" them by putting a dowel in a piece of plywood for a spindle, then using a Dremel like record-player needle -- I lowered the cutter and then turned the disk.
- disks were printed out on an inkjet and mounted with spray adhesive. I also printed a drilling template on the inkjet for mounting holes and such.
- by sheer luck, the 4 holes already in each wheel are perfectly sized for servo mount plastic "pop" rivets... but super glue (the kind that comes with a plastic prep component) works fine as well.
- see academic1.bellevue.edu/robots/tanner/ for quickie guide on setting up encoder on a motor shaft (super glue really is way stronger than some may think).
- encoder ticks are read by an SX -- I'm doing (for now) 50ms PID velocity frames and 100ms odometry frames. Encoders are read and clicks updated as often as they change (the effective encoder click rate is actually pretty low).
See below for some pix of pieces, wheel where the disks mount, etc. Will try to get some finals up if I finish it up over the next few days (my camera half-quit on me last week or I'd have more current photos).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
For my wheel set, I used a postscript file (not mine) -- all that needs to be done is set the number of segments using a text editor to edit the .ps file. At 142 segments it's a *lot* stripes and quite dizzying to look at
I take the edited .ps file and open it in Illustrator for further editing (targets, bolt holes, trim marks, bleed, etc). But you can also open a .ps file right into Acrobat (Adobe's PDF environment) and have a ready-to-go PDF.
Really, the best way to get nice optical disks would be to have the black strips silk-screened with matte ink onto polished aluminum -- but my next project w/encoders will either use off-the-shelf motors with encoders or I'll use sealed optical interrupt (old optical mouse wheels are perfect for raiding for this purpose, btw).
In attached .ps file edit the line:
/segments 142 def % number of segments (black and white)
and change the number to however many segments you want. That's black and white TOTAL. If you are doing quadrature, remember that HALF the above number needs to be ODD to get 90 phase on the sensors. That's presuming you align the two quadrature sensors 90 degrees apart. I.E., the above is 142 segments, with 71 white, 71 black (odd number of blacks, odd number of whites = 90 degree phase shift).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 5/21/2008 1:20:17 AM GMT
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
To be honest, ·I never tried them in practice,· but I bet they'd have worked.· They were very nice.·
Since it is Black and White, the processing only needs a developer and a fixer. The intermediate stop bath can be either just a wash of plain water as a way to save a few bucks. The chemicals are not so expensive, paper is the main costs. You can even create denser transparencies that are more physically stable.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······
-Phil
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
In any case, rolling-your-own is pretty satisfying and inexpensive, though more time-consuming. Each encoder/disc combo cost me about $6.
Here are some pics on the bench. The Hamamatsus are spec'ed for a nominal 3mm distance from surface -- I found once I had aligned the depth of the sensors to the "sweet" spot (just shy of 3mm), the "clicks" on my 'scope are razor sharp, and *insensitive* to vibration, wiggle on the wheel bushings, actual rotational alignment of sensor, etc. The current encoder wheel gives me a resolution of about .26 cm per "click" which is pretty good. The only thing I am concerned about over time is dust and smudges (the disks are on the wheels and are bound to pick up huge amounts of floor lint).
Hoping to crank out some code this week for the SX servo controller already on board the 'bot: handle encoder counts; velocity PID and comm with the motor controller; speed ramping; comm. with host for x, y and theta odometry calculations; stall conditions; etc.
P.S. -- you can see in the photos that I drilled mounting holes for another encoder on each wheel -- the discs are good for quadrature encoding. For now, for simplicity's sake, I'm just doing one per wheel and will set direction based on what the the motor controller is sending. It won't be perfect, but this 'bot is pretty heavy, and it's hard to "drag" it (the reverse is more likely). Also PID velocity control is my primary concern on this platform, not precise odometry (the latter is a bonus, really). But I could always add the extra pair of sensors if the need is there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 6/2/2008 11:14:26 PM GMT
If you have trouble with finding a program that will manipulate your original image into the exact size or quality that you need, this may be a good solution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······