Mr RB
Well-Known Member
Hi, I'm trying to make a low resolution linear encoder with one sensor. The sensor reads 1 "bit" either 0 or 1, for every 10mm of movement. So when the machine is moving it outputs a continuous string of reliable bits.
The goal is to know absolute position after reading N number of bits. Here are the two simplest examples;
So it looks simple enough, the length, ie amount of bits is; (2^N)+(N-1);
2bits tested; 2^2 +1 = 4+1 = length 5
3bits tested; 2^3 +2 = 8+2 = length 10
So an 8bit system would allow 256+7 = length263 which should be long enough.
So, does anyone know the best way to generate the string, or if this is a commonly used system do you know the name for it? I found some grey encoders and other systems on google but none of them seem to be what I want.
I can write some software to brute force it, but it would be easier if there was a simple process or rules etc to generate the bit string.
Thanks!
The goal is to know absolute position after reading N number of bits. Here are the two simplest examples;
Code:
N=2, determines position from ANY 2 bits;
00110 (encoder string)
00
01
11
10
=4 positions
N=3, determines position from any 3 bits;
0001110100 (encoder string)
000
001
011
111
110
101
010
100
=8 positions
So it looks simple enough, the length, ie amount of bits is; (2^N)+(N-1);
2bits tested; 2^2 +1 = 4+1 = length 5
3bits tested; 2^3 +2 = 8+2 = length 10
So an 8bit system would allow 256+7 = length263 which should be long enough.
So, does anyone know the best way to generate the string, or if this is a commonly used system do you know the name for it? I found some grey encoders and other systems on google but none of them seem to be what I want.
I can write some software to brute force it, but it would be easier if there was a simple process or rules etc to generate the bit string.
Thanks!