What's the best way to read quadrature encode with PandaBoard?

51 views
Skip to first unread message

Osman Eralp

unread,
Nov 17, 2011, 5:45:45 PM11/17/11
to RobotReferencePlatform
Has anyone tried to read a quadrature encoder with the PandaBoard? If
so, how did you do it? Some processors, such as the Freescale imx
processors, have inputs for a rotary encoder, but I can't find such an
input on the TI processor. Using an interrupt might work, but my
encoder can put out 5K pulses per second which mean a lot of
interruption. I've also thought about an external counter, but I don't
have any experience with any. Does anyone have any suggestions on the
best method?

Thanks,
Osman

Ralph Gnauck

unread,
Nov 17, 2011, 6:13:09 PM11/17/11
to robotrefere...@googlegroups.com
Osman, I assume you are trying to avoid any sort of USB interface, therefore you could look for a q-decoder chip that has an I2C or SPI interface, I think Wayne has posted some part numbers in the past for something like that. Look out for the interface voltages since I think the Panda is only 1.8V like the BB.
 
Or you could try using a PIC or AVR and having it do the counting and then talk to the Panda vi SPI or I2C,  I have done this with a PIC that then spoke USB to the BB, but if you are trying to avoid USB, I2C or SPI should work.
 
Ralph
 
 


--- On Thu, 11/17/11, Osman Eralp <osman...@gmail.com> wrote:

Bob Smith

unread,
Nov 17, 2011, 7:29:38 PM11/17/11
to robotrefere...@googlegroups.com, Osman Eralp
It is not just the interrupt rate, right? Wouldn't
you also have to write a driver of some kind to get
to the count? This might be the bigger problem.

Osman Eralp wrote:
> I've also thought about an external counter, but I don't
> have any experience with any.

Interested in learning Verilog? I'll be glad to
show you how to program a CPLD to make it into a
dual channel 50 MHz quadrature decoder with an SPI
output. The XC9572XL-10VQG44C costs $2.26 quantity
one at Digi-key.

Bob

Wayne C. Gramlich

unread,
Nov 17, 2011, 8:30:50 PM11/17/11
to robotrefere...@googlegroups.com, Wayne C. Gramlich
Osman:

There are multiple options. The ones that I can think are:

1) Use the Bob Smith FPGA board and have it do the work.
I think you have already started down this path, so
I'll be interested if there is some issue that I do
not know about.

2) You could find some 1.8V level shifters and hook directly
to the pins on the PandaBoard. If you go down this route,
I would recommend trying to compile up a version of Linux
that has the real-time extension patches loaded in. The
EMC2 CNC controller running the RTAI real-time extensions
is capable of keeping track of a quadrature encoder (for
rigid tapping.)

3) The path I am going down is to have an embedded microcontroller
hooked up to the PandaBoard. I call the board Panda1 and it
has level shifter that allow you to communicate with it via
UART, I2C or SPI. I have another board, called Motor3 (3.5A
H-bridge), that contains an embedded microcontroller that
has a a quadrature encoder as well. Both these boards exist
and have been populated with chips. Progress is slow. If
you are interested in this path, I have plenty of spare PCB's.

4) You can grab a dedicated chip (e.g. LS7366, add 1.8V level
shifters, etc.) It is a lot of work and microcontrollers
with quadrature encoders built in are pretty cheap.

I'm sure that there are other methods. All have their pro's and
cons'.

Regards,

-Wayne

Osman Eralp

unread,
Nov 20, 2011, 9:04:42 PM11/20/11
to RobotReferencePlatform
Thanks for the all of the excellent suggestions. I'll report back when
I get something working. --Osman
Reply all
Reply to author
Forward
0 new messages