Searching \ for '[PIC]: Rotary encoders ...Continue' 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 encoders ...Continue'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Rotary encoders ...Continue'
2002\01\24@180958 by Douglas Butler

flavicon
face
>Hi 2 All!
>
>Does anyone know how to "translate" this encoder? I want to recognize when
>it's turning right or left.
>I have no idea how to do it...any ideas?
>
>Thanks
>
>Tal

It is a "quadrature encoder".  For a quick start look at the state of BC
when AC falls.  There are many more sophisticated algorythms to get
better resolution and noise immunity.

Sherpa Doug

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\24@182330 by Tim H.

picon face
Well, the first thing that comes to mind is comparing terminals A and B.
If A comes high before B then you know it's going counter-clockwise.
Likewise, if B comes high before A then you know it's going clockwise.
Easy enough?

Regards,

Tim Hamel

Tal Bejerano - AMC wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\24@184312 by David Koski

flavicon
face
Use the edge of one output to clock in the other output.  CW will produce a data
that is opposite level of CCW.  Am I missing something?

David

On Fri, 25 Jan 2002 00:00:49 +0200
Tal Bejerano - AMC <spam_OUTkooterTakeThisOuTspamZAHAV.NET.IL> wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\24@184341 by Dave Mumert

flavicon
face
Hi

Check at
http://www.piclist.com/techref/microchip/qenc.htm

Dave

----- Original Message -----
From: "Tal Bejerano - AMC" <.....kooterKILLspamspam@spam@ZAHAV.NET.IL>
To: <PICLISTspamKILLspamMITVMA.MIT.EDU>
> Hi 2 All!
>
> Does anyone know how to "translate" this encoder? I want to recognize when
> it's turning right or left.
> I have no idea how to do it...any ideas?

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\24@191505 by Lawrence Glaister

flavicon
face
It looks to be a standard quadrature output encoder.
If all you need is cw or ccw, one easy way to do it is to look at the
rising edge of signal a-c. Each time you see it change from low to high,
sample the input b-c. If its high, you are going CW and if its low you
are going CCW.
You can also expand this logic to look at all the edges and with similar
logic, get updates more often.
hope this helps

On Thu, 2002-01-24 at 14:00, Tal Bejerano - AMC wrote:
> Hi 2 All!
>
> Does anyone know how to "translate" this encoder? I want to recognize when
> it's turning right or left.
> I have no idea how to do it...any ideas?
>
> Thanks
>
> Tal
>
--

=====================================================================
Lawrence Glaister VE7IT              .....lgKILLspamspam.....jfm.bc.ca
1462 Madrona Drive                   http://jfm.bc.ca/
Nanoose Bay, B.C.                    http://members.shaw.ca/cncstuff
Canada          V9P 9C9              http://gspy.sourceforge.net
=====================================================================

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\24@193456 by Tal Bejerano - AMC

flavicon
face
hi

I cant think how to do it, most of the manufacturers that use this device,
use them chips to decode it and the decoder is build-in  inside....
any electronic component that I can use?? more ideas?
Tal

{Original Message removed}

2002\01\24@201743 by Patrick J

flavicon
face
I just did a project which involved quad. decode. If you want some asm code
mail me off-list. If you only want to detect which direction the encoder rotates
it might be slightly overkill :-)

/PJ

> On Thu, 2002-01-24 at 14:00, Tal Bejerano - AMC wrote:
> Does anyone know how to "translate" this encoder? I want to recognize when
> it's turning right or left.
> I have no idea how to do it...any ideas?
> Tal

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\24@205001 by Patrick J

flavicon
face
If you dont understand howto do it using a pic from the suggested
solutions... pehaps you should try to learn some basic progamming skills
with the pic first ?

The general principle is that you have 2 wires which are called
phase A and phase B. They each send out a pulstrain. There is
a phaseshift (180 degrees) between them. By comparing the edges
you can detect which direction the encoder is rotating and if you
count the pulses/edges you can also find out how many revs it has done.

This is a good place to start your encoder info search:
www.piclist.com/techref/microchip/qenc.htm
tho not the easiest to understand perhaps.

You can do it in hardware with a couple of XOR ICs, if I am not
misstaken. If you do that you get a STEP and a DIRECTION outsignal.
(That would be kinda stupid since the pic can do it all so easily.)

TIP: clarify EXACTLY what you dont understand. Is it:
- how the encoder works ?
- how to write pic programs ?
- why ppl tend to see pink elephants on weekends ?

/PJ

> I cant think how to do it, most of the manufacturers that use this device,
> use them chips to decode it and the decoder is build-in  inside....
> any electronic component that I can use?? more ideas?
> Tal

I suggest you think real hard on this reply below.... thats how it works.

> Well, the first thing that comes to mind is comparing terminals A and B.
> If A comes high before B then you know it's going counter-clockwise.
> Likewise, if B comes high before A then you know it's going clockwise.
> Easy enough?

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\25@040102 by Roman Black

flavicon
face
David Koski wrote:
>
> Use the edge of one output to clock in the other output.  CW will produce a data
> that is opposite level of CCW.  Am I missing something?



When A goes high you register one unit movement,
and B tells you the direction, ie if B is high you
went clockwise and if B is low you went CCW.
2 PIC inputs, easiest thing in the world. ;o)
-Roman

PS, always use a schmitt input logic gate or schmitt
PIC pin to detect the encoder, to avoid the jitters.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\01\26@070955 by John

flavicon
face
Hello Tal & PIC.ers,

I deal with these a bit..
Please contact me off-list with some more detail, I couldn't read your
attachment.

       best regards,   John


{Quote hidden}

e-mail from the desk of John Sanderson, JS Controls.
Snailmail:          PO Box 1887, Boksburg 1460, Rep. of South Africa.
Tel/fax:            Johannesburg  893 4154
Cellphone no:   082 741 6275
email:                @spam@jsandKILLspamspampixie.co.za
Manufacturer & purveyor of laboratory force testing apparatus, and related
products and services.

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2002\01\26@091243 by info

flavicon
face
Most datasheets show a rotary encoders center pin connected to +5 and
the other terminals (phase) go to your pics inputs. Can you connect the
center pin (common) to ground and use the pics internal pull-ups to keep
the phase pins high and detect pull downs on the phase pins.
Kind of checking for 0 rather than +5?

{Original Message removed}

2002\01\26@114223 by M. Adam Davis

flavicon
face
A very basic discussion of rotary encoders was captured here:
http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml

Essentially the simplest way to look at it is:

Monitor terminal A.  When it goes from low to high, check terminal B.
If B is high, then it has rotated clockwise.

If B is low when A goes high, it has rotated counter-clockwise.

If you are twisting it by hand then yo can't rotate it very fast, so you
should only have to check it a few hundred times a second, which gives
you lots of time to do others things.

Once in awhile, run a routine like this one(pseudocode):
You need:
  One variable that doesn't get changed "SAVE"
  Terminal A will be hooked to a pin defined as "TA"
  Terminal B will be hooked to a pin defined as "TB"

Compare TA to bit 1 of SAVE.  If they are the same, exit the routine,
it's not being turned.
If TA = 0 then set SAVE (bit 1) equal to TA, and exit the routine.
If we are still in the routine, then TA must have changed from 0 to 1.
If B=1 then we are turning clockwise.  Set SAVE equal to TA, exit the
routine, and let the rest of the program know you've turned.
Otherwise, B = 0, and we are turning Counter-Clockwise.  Set SAVE equal
to TA, exit, and let the rest of the program know you've turned.

That doesn't give you as much information as you could possibly get from
a rotary encoder, but it will get you started, and when you need a
higher resolution from the same encoder then you can search teh archives.

-Adam



Tal Bejerano - AMC wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


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