Sunday, September 20, 2009
I've heard a lot of people talk about high resolution optical encoders being quite expensive. I've decided to use cheap optical sensors from optical mice to make optical encoders for little optical elves who live in optical cities making optical cookies with their little optical ... whoa ... shrooms are kicking in ... Anyway, Avago Technologies makes some pretty good ones. They optically measure the mouse sliding over a surface and convert this to a 16-bit delta X and 16-bit delta Y. The $2 encoders get 1600 dpi and the more expensive ~$6 encoders get 5000 dpi (claimed on the data sheet, not experimentally verified).
They perform multiple useful things.
First, they constantly measure the change in X and Y. This can be used to make a linear optical sensor or a rotary optical sensor (you measure the tangent). I think the rotary sensor might need a look up table to translate from delta Tangent to delta Angle, but this can be determined in the future. The linear sensor can measure travel in two dimensions. If it was possible to mount it under the table of the maker bot, it could record the XY motion at the same time.
Secondly, most can capture a 32x32 image. Some update this image over 1000 frames per second. This can be used to read a printed strip to update the absolute angle. In my design I have a strip of binary hamming encoded numbers that my sensor will periodically read to update the angle.
Third, the resolution scales linearly with the distance of travel. I use this to record angle. If I need a more accurate angle measurement, I increase the diameter of the strip it reads. I'm planning on printing my strips on CD labels (not how it looks in the picture). I'm using a half circle strip. The CD labels are about 118 mm in diameter. Therefore my strip is 118mm * PI / 2 (half circle) / 25.4 (mm to inches). About 7.29 inches long. My optical mouse sensor has a claimed resolution of 5000 dpi. Therefor my sensor has a theoretical resolution of 36468 ticks. I'm a bit skeptical of manufactures claims, but I should be able to get between 14 and 16 bits of resolution.
Fourth, as the machines scale up I want to maintain the same level of accuracy at the tip of the machine as the smaller machines have. This means that I will need much higher accuracy of the encoders. I accomplish this by making the encoder bigger.
Fifth, it might be possible to operate some of these devices as a camera to image objects far away. Some have a laser built into the device. These emit coherent light. Great thing about coherent light is that if your optics are focused to infinity then everything looks in focus. It doesn't depend on the distance. It might be possible to mount one of these next to the print head and use it to image the surface we are printing on or the object we are printing. This is a bit of a stretch, but it might work.
Sixth, one could be mounted on the print head to calibrate it's motion. A calibration algorithm would move the head down till the sensor is just above the surface of the table and then move the head in the XY plane. Using data from the sensor the motion of the print head can be characterized and corrected.
Because of this, I believe that this type of sensor will only give an estimate of the velocity of the surface it is measuring. Because this is just an estimate of the velocity when we integrate to get position we will always have error that in time(perhaps very quickly) will add up to too much error to use the device as a position control feedback device. However, I certainly have been wrong before, and I would like to be proven wrong because the idea is very cool.
There are several technologies already established that will work for this application. One is the optical sensors available from USdigital (and others) like the AEDR and HEDR reflective encoder moduals... NOTE that these products do not have index channels. They also sell (resell) other transmissive modules that are more rugged, have index channels, but are also quite a bit more expensive.
Another option is the use of magnetic encoders. Austria Microsystems sells several of these modules: http://www.austriamicrosystems.com/eng/Products/Magnetic-Encoders/Linear-Encoders/AS5311
The budgetary price of these modules is like $6 and $3-$4 for a multi-pole magnet to go with it.
I would suggest looking into these existing technologies before trying to re-invent the wheel.
Another device that may be high enough resolution and not much trouble for the first few versions is this CUI capacitive encoder. http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=102-1307-ND
That encoder has 8192 counts/rev or .04 degrees resolution for only $30 as a complete package.
The AS5311 and a 1" diameter multipole magnet disk would be better than anything USDigital or the CUI encoder can do. That would provide a 17.2bit periodic home position reading (80 poles *4096 bit per pole). That would be roughly equivalent to what the image sensor here is expected. Any much less and at maximum extension the arm will have absolutely HORRIBLE accuracy.
For instance, lets say you have a 1M reach and need the same accuracy as the Reprap target (+/- 0.1mm). To simply READ that accuracy you'd need 14 bits. If you want 10 times that (0.01mm) you need 17.3 bits. Now I know the absolute newest rotary encoder from Austria can do 14 bits, but you'd need gearing or something to hit 17 bits in a low cost manner. And it probably wouldn't be absolute. This system represents no need for magnets, and it's easy to expand your accuracy at home.
I have high hopes for the optical system to work, though. But things happen. That's why he's testing.
Since you usually gear down the motor, and the encoder is on the shaft, the counts is normally overkill if anything.
I found the chip difficult to wire ( since it is very small ) but other than that it worked very well.
I used a microchip PIC 18f2331 to read the chip-- since the pic has a built-in hardware quadrature encoder, coding was quite easy.
here's a (not great) picture of the setup:
Also, measuring the rotation angle before a gear box has some issues too. The gear boxes have slop in them. I need the encoders to measure the angle of the arm so that I can use algorithms to correct for this slop.
Magnetic strip encoders sound really cool. It does seem like finding a magnetic strip would be difficult. Keep me posted.
The encoder disks I'm using will usually be about 1/3 the length of an arm segment. For a one meter reach I would expect the arm segments to be about 3/4 of a meter each. Therefor the diameter of my disk would be 250 mm. 250mm * PI / 2 / 25.4 = about 15.45 inches. 5000 dpi * 15.45 inches equals 77264 ticks or about 16-bits.
Just realized that I thought 32K was 16-bits for some reason. Whoops.
I wonder if a floppy disk could be used...? Or would it be too hard to read data from a floppy disk...
Maybe we could print using a plastic with embedded magnetic material and apply a magnetic field during printing to orient it.
Using floppy discs and floppy read heads might be possible (by encoding a quadrature incremental encoder pattern with one channel on each side, unless the heads can read several adjacent tracks) anyone know the density you can get on these?
Links to this post: