Searching \ for 'Code For Bourns ACE-128 Encoders' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/sensors.htm?key=encoder
Search entire site for: 'Code For Bourns ACE-128 Encoders'.

Truncated match.
PICList Thread
'Code For Bourns ACE-128 Encoders'
1996\12\20@055946 by F NPL, 2227

flavicon
face
Happy Xmas All,
              Just for once, not a problem mail!
I've recently been using Bourns' new ACE-128 rotary encoders.
(For those of you who haven't meet them, info is on my web page
shown below)
These give out a type of 'grey-code' to give the position of the
encoder. Bourns say to just use a 256 byte look-up table, but as
that can be upto 1/2 a PIC's memory, I've writen decoder routines
that are shorter (at the expense of speed). In case anybody
else out there is using these beasties, I stuck 4 of the routines
on my web page.

   For further info, or to see the routines, the web page is:-

http://ourworld.compuserve.com/homepages/steve_lawther/bourns.htm

   If anybody uses any of the routines, and / or improves on the
code size, for the speed specified, could they let me know - I've
spent the best part of a week trying to optimise them, but I isn't
perfect!
       Hope this helps somebody,

               Steve Lawther

PS - I'm not in any way linked with Bourns, and the ACE-128 is
    not a solution to the world problems - but it has its uses!

   *** Opinions are my own, not my employers, nor clients ***
   ***              For More PIC stuff, see               ***
ourworld.compuserve.com/homepages/steve_lawther/ucindex.htm

1996\12\21@005844 by John Payson

picon face
>                Just for once, not a problem mail!
> I've recently been using Bourns' new ACE-128 rotary encoders.
> (For those of you who haven't meet them, info is on my web page
> shown below)
> These give out a type of 'grey-code' to give the position of the
> encoder. Bourns say to just use a 256 byte look-up table, but as
> that can be upto 1/2 a PIC's memory, I've writen decoder routines
> that are shorter (at the expense of speed). In case anybody
> else out there is using these beasties, I stuck 4 of the routines
> on my web page.
>
>     If anybody uses any of the routines, and / or improves on the
> code size, for the speed specified, could they let me know - I've
> spent the best part of a week trying to optimise them, but I isn't
> perfect!

Hmm... I've looked at your web page and I must say that encoder sure does
have a wierd coding sequence, doesn't it.... :-)  Methinks I'll have to
brainparse that one a little bit...

1996\12\21@093010 by Louis A. Mamakos

flavicon
face
> Hmm... I've looked at your web page and I must say that encoder sure does
> have a wierd coding sequence, doesn't it.... :-)  Methinks I'll have to
> brainparse that one a little bit...

It's probably using Gray code to encode the shaft angle of the encoder.  Gray
codes have the property that only one bit changes in going from one state
to the next.  This prevents errors, since you don't have clock new
samples to make sure you've got a stable value; you need only look for
a valude which differs from the previous one.  You don't get this same
effect from a binary-encoded ripple counter.

There's a simple algorithm using XOR operations which can be used to
translate between gray code and "normal" binary encoded values.  Actually,
it's a pretty simple circuit as well using XOR gates.  I'd refer you to
"The Art of Electronics" by Horowitz and Hill.  ISBN 0-521-23151-5, but
I know there's a new edition subsequent to this one.

louie

1996\12\21@132302 by J.P.D. Kooij

flavicon
face
On Sat, 21 Dec 1996, Louis A. Mamakos wrote:

> > Hmm... I've looked at your web page and I must say that encoder sure does
> > have a wierd coding sequence, doesn't it.... :-)  Methinks I'll have to
> > brainparse that one a little bit...

Just take a walk on the wild sides of the 8-cube. No need to see all of
the sides, just turn once on every corner. Voila, the turning of the
shaft is in a roundtrip of the cube.

No, I am not on drugs and yes, I have had a good night's sleep. The
hallucinatory stuff is also known as mathematics.

A Gray code can be found by tracing a Hamiltonian cycles on the graph of
the n-cube. For you folks exclamating "now he's doing it again!": an
n-cube is the n-dimensional brother of 2-d square and 3-d cube, a graph
is a network consisting of points and lines (just like a schematic, but
without the parts), and a Hamiltonian cycle is a path over the lines of a
graph, traversing every point exactly once. Not every graph has such a
cycle, but every n-cube graph does.

In practice, you label all the points of an n-cube graph with their
respective "coordinates", like in:

  100           101
   *-------------*
   |\           /|
   | \110   111/ |
   |  *-------*  |
   |  |       |  |
   |  |       |  |
   |  |       |  |
   |  *-------*  |
   | /010   011\ |
   |/           \|
   *-------------*
  000           001

Now, if you go point to point, only one coordinate changes at a time,
making for very unambiguous state transitions, as opposed to a straight
binary scheme.

A Hamiltonian cycle would be:
000 -> 100 -> 110 -> 010 -> 011 -> 111 -> 101 -> 001 (-> 000 )

Note that this method is very easyly extended to higher values of n (if
you can't figure it, notice how this one is already an extension of n=2.)

> There's a simple algorithm using XOR operations which can be used to
> translate between gray code and "normal" binary encoded values.  Actually,
> it's a pretty simple circuit as well using XOR gates.  I'd refer you to
> "The Art of Electronics" by Horowitz and Hill.  ISBN 0-521-23151-5, but
> I know there's a new edition subsequent to this one.

Well, why not post the algorithm, it's an interesting thing to put in a pic.

BTW, I got mine from "Graphs, an introductory approach" by Wilson and
Watkins, ISBN 0-471-51340-7. For all you engineers thinking math is only
integration and differential equations, this is a definite gem. If you
hate math, get a copy of "Alice in wonderland". Also makes a great
Christmas gift to newborns :-)

Joost

1996\12\21@141812 by fastfwd

face
flavicon
face
Louis A. Mamakos <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> [The Bourns encoder is] probably using Gray code to encode the
> shaft angle of the encoder.
>
> [long explanation of Gray codes deleted]

Louie:

The Bourns encoder does NOT use Gray codes.  If you'd bothered to
look at the specs, you'd have seen that they use what appears to be a
completely ad-hoc encoding scheme, instead.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com                 ===
=== Fast Forward Engineering - Vista, California          ===
===                                                       ===
=== Custodian of the PICLIST Fund -- For more info, see:  ===
=== http://www.geocities.com/SiliconValley/2499/fund.html ===

1996\12\21@142852 by fastfwd
face
flavicon
face
J.P.D. Kooij <PICLISTspamKILLspamMITVMA.MIT.EDU> wrote:

> [a long description of Hamilton cycles on n-dimensional cubes and
> their relationship to Gray codes, including the following lines]
>
> A Hamiltonian cycle would be:
> 000 -> 100 -> 110 -> 010 -> 011 -> 111 -> 101 -> 001 (-> 000 )

Joost:

While every n-bit Gray code describes a Hamilton cycle over an
n-dimensional cube, the converse is nut true; every Hamilton cycle
over that cube does NOT describe a Gray code.

While many Hamilton cycles over your example 3-dimensional cube are
possible, only ONE of them is the 3-bit Gray code (and the example
you showed, by the way, isn't it).

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam.....ix.netcom.com                 ===
=== Fast Forward Engineering - Vista, California          ===
===                                                       ===
=== Custodian of the PICLIST Fund -- For more info, see:  ===
=== http://www.geocities.com/SiliconValley/2499/fund.html ===

1996\12\21@184624 by Bob Blick

flavicon
face
This thread is getting fun, keep it up, I'm enjoying the show!

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...