# How to make affordable DIY low-res absolute rotatory optical encoders with fibers? [closed]

I have zero knowledge of optics and want to make a very low resolution (~10°) absolute rotary optical encoder using rapid manufacturing (I have 3D printers, laser cutter, and desktop CNC). Digging the internet I realized that one can use some sort of code-disk with some slots in an angular/concentric pattern [Fig.1], and putting a light source and sensor on both sides of the disk to count the number of steps. This is called an incremental encoder.



Fig.1 - Simple relative encoder measuring only the steps with no sens of direction.
(image courtesy of [Hydraulics&Pneumatics][1])



Now if you want to have a sense of direction you may have two tracks of slot patterns (e.g. at different radii) or have a mask in front of the disk, plus two sets of light source and sensor [Fig.2].



Fig.2 - A relative encoder with the sense of direction.
(image courtesy of J.P. Trevelyan [2])



For example, as shown in [Table.1] if the current state is [00] and the following state is [10] we are in CW direction (or vice-versa).

                           |    |  00 |  10 |  11 |  01 |
|:--:|:---:|:---:|:---:|:---:|
| 00 |  -- | CCW |  -- |  CW |
| 10 |  CW |  -- | CCW |  -- |
| 11 |  -- |  CW |  -- | CCW |
| 01 | CCW |  -- |  CW |  -- |

Table. 1 - Columns are the current state and the rows are the subsequent state.


This is called an incremental quadrature encoder.

Now I have some issues:

1. I don't want to have the light source and sensor in the encoder but to use optical fibers to transfer light to and from the encoder to my electronics. The reason is that I can not have any electronics in the nevironment I want to use the necoder. However, I'm being told that if there is an air gap between two ends of optical fibers, a lot of light will be lost. I want to know what is the limit? does it depend on the sensor or source or the quality of the fibers?
2. I do not understand how absolute encoders work. Do they also follow the same rationale of a disk-mask plus light sources-sensors? Is their design simple enough to be built DIY?
3. What light source and sensor should I use to emit light into the fibers and read it back? is there some sort of off-the-shelf sensor and source connected to fibers already available which I can plug into an Arduino for example?

Sorry for my novice questions I but I would appreciate if you could help me through. Thanks in advance.

### Refrences:

• What is the motivation for using fiber optics? The amount of signal you will receive will change your receiver design from being trivial to requiring a bit of effort. – W5VO Sep 17 '19 at 14:41
• Why do you want an optical fiber if the rest of of the world doesn't use it. – Marko Buršič Sep 17 '19 at 14:41
• @MarkoBuršič because I have to. I can't have any electronics in the MRI enviroment. – Foad Sep 17 '19 at 15:07
• If you can't have any electronics in the environment, then don't say you want to use fiber, edit your question to say you must not have electronics in there, and why. Clear questions lead to sensible answers. – TimWescott Sep 17 '19 at 15:26
• This sounds like a student project, and like it's just one part of a larger project. Measurements like this have to be a solved problem in MRI machines -- have you researched how its done? Perhaps you can get your hands on an angular sensor that's already designed for use in an MRI machine? – TimWescott Sep 17 '19 at 15:27

I don't want to have the light source and sensor in the encoder but to use optical fibers to transfer light to and from the encoder to my electronics. However, I'm being told that if there is an air gap between two ends of optical fibers, a lot of light will be lost. I want to know what is the limit? does it depend on the sensor or source or the quality of the fibers?

The limit is that you lose practically all the light.

It depends on the sensor, the source, the quality if of the fibers, how you mount them, and probably a hundred things that I don't know about.

You need to experiment on this one. I suspect that you'll do much better if you focus the light from and to the fibers, so that it's roughly collimated as it passes through the disk.

You might want to search on "light pipe".

I do not understand how absolute encoders work. Do they also follow the same rationale of a disk-mask plus light sources-sensors? Is their design simple enough to be built DIY?

Absolute encoders have one track per bit. If you want "about 10 degrees" that means 5 bits (32 divisions, 11.25 degrees/LSB) or 6 bits (5.625 degrees/LSB). In general you lay out the tracks in something called a "gray code", which is arranged so that no two bits change state at the same time -- this prevents the erroneous readings that would happen in a normal code (at, for instance, the transition from 'b111111 to 'b000000, where there would be six opportunities for errors, some of them large).

What light source and sensor should I use to emit light into the fibers and read it back? is there some sort of off-the-shelf sensor and source connected to fibers already available which I can plug into an Arduino for example?

I can't answer this one. I'd look for LED/lasers and sensors that are pre-mounted to fibers.

1. fibres become point sources at gaps >diameter so losses become 1/r^2 but with a lens can be focused back into a line source.

2. Absolute encoders are parallel bits, while incremental encoders are quadrature and grey code.

3. 3mm <=15 deg IR LEDs should be good with same narrow angle detector using AWG 30 magnet wire. You can extract this from any old laser mouse wheel encoder. Stray light must be blocked and wheel ought to be dust free.

Depending on your resources, you could just go for an MRI-safe encoder that's commercially available -- though small electronics thoroughly screened for potential performance and safety issues, are often allowable, certainly outside the magnet and sometimes inside.

Also, for the resolution you need, there may be more straightforward ways to get the same answer than an encoder. For example, a ceramic or conductive plastic potentiometer might do the job just fine.

So many things have been done with patient response systems in MRI that I suggest you go to the literature to find similar use scenarios, and read about how others have solved similar problems.

https://micronor.com/products/rotary-encoders-mri/

It's actually not hard to do, With the AEDR encoders from avago. I printed out an encoder on a clear sheet using a laser jet with a high DPI (needs to be over 1200, but this depends on your linewidth). You need to draw the wheel or strip in a vector graphics software and print it out to scale. We also used mylar on the backside, but for reflective sensors this is needed, for pass though sensors only a clear sorry would be needed. We used the wheels in a prototype and then made some real wheels out of phosphor bronze (had to be metal because we launched them into space).