Searching \ for '[PIC] rotary encoder interface' 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/microchip/ios.htm?key=encoder
Search entire site for: 'rotary encoder interface'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] rotary encoder interface'
2007\09\27@181900 by alan smith

picon face
I know I have it someplace...stored under something obvious at the time....but there was some posts dealing with rotary encoder interfaces, and now of course I need to recall what was said....

anyone remember?

     
---------------------------------
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links.

2007\09\27@195231 by Jim Korman

flavicon
face
alan smith wrote:
> I know I have it someplace...stored under something obvious at the time....but there was some posts dealing with rotary encoder interfaces, and now of course I need to recall what was said....
>
> anyone remember?
>
>        
> ---------------------------------
> Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links.
>  
There was a thread
"Rotary encoders: advanced decoding..." that started with
the following

http://www.piclist.com/techref/postbot.asp?by=time&id=piclist\2007\01\18\150014

Might be what you're looking for.

Jim




2007\09\27@234719 by Harold Hallikainen

face
flavicon
face

> I know I have it someplace...stored under something obvious at the
> time....but there was some posts dealing with rotary encoder interfaces,
> and now of course I need to recall what was said....
>
> anyone remember?
>

How about this?

http://www.piclist.org/techref/microchip/qenc.htm

Harold

--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2007\09\28@124903 by alan smith

picon face
thanks, looks familiar at least!  

Harold Hallikainen <spam_OUTharoldTakeThisOuTspamhallikainen.org> wrote:
> I know I have it someplace...stored under something obvious at the
> time....but there was some posts dealing with rotary encoder interfaces,
> and now of course I need to recall what was said....
>
> anyone remember?
>

How about this?

http://www.piclist.org/techref/microchip/qenc.htm

Harold

--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!


'[PIC] rotary encoder interface'
2007\10\01@090140 by M. Adam Davis
face picon face
I have some amount of rotary encoder info here:
http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml

It covers very simple decoding (treat A as direction, B as step), then
gives an overview of typical state machine decoding.  It also covers
the different types of encoders, and quotes a few people talking about
some interesting absolute encoders.

It's not likely the same discussion you remember but perhaps it has
the information you need.

And if not - ask away!  The piclist can never have too many
discussions on rotary encoders!

-Adam

On 9/27/07, alan smith <.....micro_eng2KILLspamspam@spam@yahoo.com> wrote:
> I know I have it someplace...stored under something obvious at the time....but there was some posts dealing with rotary encoder interfaces, and now of course I need to recall what was said....
>
> anyone remember?
>
>
> ---------------------------------
> Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links.
> -

2007\10\19@145928 by alan smith

picon face
yep...think this is what I was looking for...thanks!!

"M. Adam Davis" <stienmanspamKILLspamgmail.com> wrote:  I have some amount of rotary encoder info here:
http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml

It covers very simple decoding (treat A as direction, B as step), then
gives an overview of typical state machine decoding. It also covers
the different types of encoders, and quotes a few people talking about
some interesting absolute encoders.

It's not likely the same discussion you remember but perhaps it has
the information you need.

And if not - ask away! The piclist can never have too many
discussions on rotary encoders!

-Adam

On 9/27/07, alan smith wrote:
> I know I have it someplace...stored under something obvious at the time....but there was some posts dealing with rotary encoder interfaces, and now of course I need to recall what was said....
>
> anyone remember?
>
>
> ---------------------------------
> Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
> -

2007\10\19@164830 by M. Adam Davis

face picon face
I'm very glad I can help!

As far as google is concerned, this is one of the most popular pages
on my website, just behind the pic archive and dighole pages.

-Adam

On 10/19/07, alan smith <.....micro_eng2KILLspamspam.....yahoo.com> wrote:
{Quote hidden}

2007\10\19@181840 by William Benson

picon face

Hi,

Here is another link that might be helpful:

http://www.robh.nl/electro.php  

About the fourth item down "Quadrature encoders circuits for cheap mechanical rotary encoders"

BEN

> Date: Fri, 19 Oct 2007 11:57:26 -0700> From: micro_eng2spamspam_OUTyahoo.com> Subject: Re: [PIC] rotary encoder interface> To: @spam@piclistKILLspamspammit.edu> > yep...think this is what I was looking for...thanks!!> > "M. Adam Davis" <KILLspamstienmanKILLspamspamgmail.com> wrote: I have some amount of rotary encoder info here:> http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml> > It covers very simple decoding (treat A as direction, B as step), then> gives an overview of typical state machine decoding. It also covers> the different types of encoders, and quotes a few people talking about> some interesting absolute encoders.> > It's not likely the same discussion you remember but perhaps it has> the information you need.> > And if not - ask away! The piclist can never have too many> discussions on rotary encoders!> > -Adam> > On 9/27/07, alan smith wrote:> > I know I have it someplace...stored under something obvious at the time....but there was some posts dealing with rotary encoder interfaces, and now of c!
ourse I need to recall what was said....> >> > anyone remember?> >> >> > ---------------------------------> > Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.> > -

2007\10\19@181910 by William Benson

picon face

Hi,

Here is another link that might be helpful:

http://www.robh.nl/electro.php  

About the fourth item down "Quadrature encoders circuits for cheap mechanical rotary encoders"

BEN

> Date: Fri, 19 Oct 2007 11:57:26 -0700> From: RemoveMEmicro_eng2TakeThisOuTspamyahoo.com> Subject: Re: [PIC] rotary encoder interface> To: spamBeGonepiclistspamBeGonespammit.edu> > yep...think this is what I was looking for...thanks!!> > "M. Adam Davis" <TakeThisOuTstienmanEraseMEspamspam_OUTgmail.com> wrote: I have some amount of rotary encoder info here:> http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml> > It covers very simple decoding (treat A as direction, B as step), then> gives an overview of typical state machine decoding. It also covers> the different types of encoders, and quotes a few people talking about> some interesting absolute encoders.> > It's not likely the same discussion you remember but perhaps it has> the information you need.> > And if not - ask away! The piclist can never have too many> discussions on rotary encoders!> > -Adam> > On 9/27/07, alan smith wrote:> > I know I have it someplace...stored under something obvious at the time....but there was some posts dealing with rotary encoder interfaces, and now of course I need to recall what was said....> >> > anyone remember?> >> >> > ---------------------------------> > Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.> > -

2007\10\21@052529 by Morgan Olsson

flavicon
face
Den 2007-10-19 20:57:26 skrev alan smith <RemoveMEmicro_eng2spamTakeThisOuTyahoo.com>:

> yep...think this is what I was looking for...thanks!!
>
> "M. Adam Davis" <stienmanEraseMEspam.....gmail.com> wrote:  I have some amount of rotary encoder info here:
> http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml
>
> treat A as direction, B as step

If implemented straight like that it have a problem that is severe if you need to keep exact track of position:

For example:
In case of small movement/viration/noise inpulse, such that B channel sensor repeatedly go on and off but movemet is to little for A to change, Then your counter wanders off from reality!

Unfortumately this bad examplke it taught in many schoolbooks :(

The right way of doing this is to decode all changes in both channels.

SAMPLING:
One way of sampling is to use PortB interrupt on change, but if you already have a timer interrupt faster than any predicted movement you can hang the sampling on that to save on tie spent in context save/restore.

DECODING EXAMPLE:
Concatenate the status from the channelas from previous sample with the last sample into 4 bit.
Use that in a jump table to jump to count:  no change (exit) / forward / backward / illegal (both channels changed)

--
Morgan Olsson

2007\10\21@061045 by wouter van ooijen

face picon face
> The right way of doing this is to decode all changes in both channels.

I'd put it more bluntly: that is the *only* way to do it.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2007\10\21@093208 by Morgan Olsson

flavicon
face
Den 2007-10-21 13:08:51 skrev wouter van ooijen <EraseMEwouterspamvoti.nl>:

>> The right way of doing this is to decode all changes in both channels.
>
> I'd put it more bluntly: that is the *only* way to do it.

Well, a sneak way in case you only have one pin availabe that can throw interrupt, (and it can do it on both transitions) is to count on that pin change only, in direction = A XOR B.   (uh, if i am not too sunday-tired now...  I have not not tested nor seen this.)


--
Morgan Olsson

2007\10\21@125953 by Harold Hallikainen

face
flavicon
face

{Quote hidden}

Kinda like this?

http://www.piclist.org/techref/microchip/qenc.htm

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2007\10\21@163131 by Morgan Olsson

flavicon
face
Den 2007-10-21 18:59:33 skrev Harold Hallikainen <RemoveMEharoldEraseMEspamEraseMEhallikainen.org>:

> Kinda like this?
>
> http://www.piclist.org/techref/microchip/qenc.htm

Whoops
I did not know it was up there!

I really like the more effective methods below my code there.

Thanks

--
Morgan Olsson

2007\10\22@095219 by M. Adam Davis

face picon face
On 10/21/07, Morgan Olsson <RemoveMEost011spam_OUTspamKILLspamosterlen.tv> wrote:
> > Adam Davis wrote:
> > treat A as direction, B as step
>
> If implemented straight like that it have a problem that is severe if you need to
> keep exact track of position:
>
> For example:
> In case of small movement/viration/noise inpulse, such that B channel sensor
> repeatedly go on and off but movemet is to little for A to change, Then your
> counter wanders off from reality!


Thanks for pointing this out!  I had never implemented such an
interface, but it's obvious given your example that this is a serious
flaw!

For this to work one would have to implement a more complex version:
Treat A as direction, and B as step for positive transitions, and
reverse step for negative transitions.  Given that this is nearly as
much work as a state machine approach, which is significantly better,
then one should rarely see need for this method.

I'll be updating my webpage this week.

Thanks again for pointing this out.

-Adam

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
Moving in southeast Michigan? Buy my house: http://ubasics.com/house/

Interested in electronics? Check out the projects at http://ubasics.com

Building your own house? Check out http://ubasics.com/home/

2007\10\22@102043 by Morgan Olsson

flavicon
face
Den 2007-10-22 15:52:17 skrev M. Adam Davis <RemoveMEstienmanTakeThisOuTspamspamgmail.com>:

> On 10/21/07, Morgan Olsson <EraseMEost011spamspamspamBeGoneosterlen.tv> wrote:
>> > Adam Davis wrote:
>> > treat A as direction, B as step
>>
>> If implemented straight like that it have a problem that is severe if you need to
>> keep exact track of position:
>>
>> For example:
>> In case of small movement/viration/noise inpulse, such that B channel sensor
>> repeatedly go on and off but movemet is to little for A to change, Then your
>> counter wanders off from reality!
>
>
> Thanks for pointing this out!  I had never implemented such an
> interface, but it's obvious given your example that this is a serious
> flaw!

Thank you :)


> For this to work one would have to implement a more complex version:
> Treat A as direction, and B as step for positive transitions, and
> reverse step for negative transitions.  Given that this is nearly as
> much work as a state machine approach, which is significantly better,
> then one should rarely see need for this method.

Harold gave the link:
http://www.piclist.org/techref/microchip/qenc.htm

Below my ADDWF PCL based method there are a couple short smart routines.


--
Morgan Olsson

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