Quadrature Inputs

Started by Paul Johnson March 8, 2003
I'm surprised, given the number of embedded applications involving motor
control or data capture, that almost no micros out there support quadrature
input. On our products, we use Xilinx FPGA's that provide 8 sets of
quadrature input and handle all the accumulation, etc.

However, on small footprint boards, with a simple task, it would be very
desirable to lose the Xilinx and just read quadrature directly. Even just
one pair of quadrature inputs would be fine.

Has anyone out there solved this problem?

Thanks,

Paul Johnson
Lynx Robotics
8125 Lankershim Blvd.
North Hollywood, CA 91605
Voice: (818) 252-7890
FAX: (818) 252-7892



"Paul Johnson" <> wrote:

>I'm surprised, given the number of embedded applications involving motor
>control or data capture, that almost no micros out there support quadrature
>input. On our products, we use Xilinx FPGA's that provide 8 sets of

Ack, that's bad.

[...]

>Has anyone out there solved this problem?

Do you know the LS7183 from www.lsicsi.com ? It seems you could count
the up and down pulses with HC12 pulse counters.

I already used a small, cheap PIC for this task, these days I would
use a HC08.

Oliver
--
Oliver Betz, Muenchen





Hi Paul,

yes, the quadrature input is important and rare. But there is one optimal
solution - go to see the Motorola Hybrid solution - DSP56F800 family.

http://e-www.motorola.com/webapp/sps/site/taxonomy.jsp?nodeIdM95961783629
2
or go direct to DSP56F803

http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=DSP56F803&no
deId27956292

Many information and tools on the Motor Control you can find at
http://e-www.motorola.com/webapp/sps/site/homepage.jsp?nodeIdnQXG

Regards
Jiri > ----- Original Message -----
> From: "Paul Johnson" <>
> To: <>
> Sent: Saturday, March 08, 2003 5:28 PM
> Subject: [68HC12] Quadrature Inputs > > I'm surprised, given the number of embedded applications involving motor
> > control or data capture, that almost no micros out there support
> quadrature
> > input. On our products, we use Xilinx FPGA's that provide 8 sets of
> > quadrature input and handle all the accumulation, etc.
> >
> > However, on small footprint boards, with a simple task, it would be very
> > desirable to lose the Xilinx and just read quadrature directly. Even
just
> > one pair of quadrature inputs would be fine.
> >
> > Has anyone out there solved this problem?
> >
> > Thanks,
> >
> > Paul Johnson
> > Lynx Robotics
> > 8125 Lankershim Blvd.
> > North Hollywood, CA 91605
> > Voice: (818) 252-7890
> > FAX: (818) 252-7892
> >
> >
> >
> > --------------------
> >
> >
> >
> > ">http://docs.yahoo.com/info/terms/
> >
> >
> >
>





Don't forget the MC68332 provides quadrature inputs via the TPU. But I am
sure since the original poster is looking for 'HC12, small footprint
soutions, even the '332 may be too big a stretch for him but not as severe
as going to DSP chips.

Also, keep in mind that various vendors make encoder chips. HP and Gailel
come to mind. Check also Nat Semi.

Bob Smith

--- Avoid computer viruses, Practice safe hex ---

-- Specializing in small, cost effective
embedded control systems --

http://www.smithmachineworks.com/embedprod.html Robert L. (Bob) Smith
Smith Machine Works, Inc.
9900 Lumlay Road
Richmond, VA 23236 804/745-1065
----- Original Message -----
From: "Jiri Gutman" <>
To: <>
Sent: Saturday, March 08, 2003 3:12 PM
Subject: Re: [68HC12] Quadrature Inputs >
> Hi Paul,
>
> yes, the quadrature input is important and rare. But there is one optimal
> solution - go to see the Motorola Hybrid solution - DSP56F800 family.
http://e-www.motorola.com/webapp/sps/site/taxonomy.jsp?nodeIdM95961783629
> 2
> or go direct to DSP56F803
http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=DSP56F803&no
> deId27956292
>
> Many information and tools on the Motor Control you can find at
> http://e-www.motorola.com/webapp/sps/site/homepage.jsp?nodeIdnQXG
>
> Regards
> Jiri > > ----- Original Message -----
> > From: "Paul Johnson" <>
> > To: <>
> > Sent: Saturday, March 08, 2003 5:28 PM
> > Subject: [68HC12] Quadrature Inputs
> >
> >
> > > I'm surprised, given the number of embedded applications involving
motor
> > > control or data capture, that almost no micros out there support
> > quadrature
> > > input. On our products, we use Xilinx FPGA's that provide 8 sets of
> > > quadrature input and handle all the accumulation, etc.
> > >
> > > However, on small footprint boards, with a simple task, it would be
very
> > > desirable to lose the Xilinx and just read quadrature directly. Even
> just
> > > one pair of quadrature inputs would be fine.
> > >
> > > Has anyone out there solved this problem?
> > >
> > > Thanks,
> > >
> > > Paul Johnson
> > > Lynx Robotics
> > > 8125 Lankershim Blvd.
> > > North Hollywood, CA 91605
> > > Voice: (818) 252-7890
> > > FAX: (818) 252-7892
> > >
> > >
> > >
> > > --------------------
> > >
> > >
> > >
> > > ">http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> >
> -------------------- >
> ">http://docs.yahoo.com/info/terms/ >




> >I'm surprised, given the number of embedded applications involving motor
> >control or data capture, that almost no micros out there support
> quadrature
> >input. On our products, we use Xilinx FPGA's that provide 8 sets of
>
> Ack, that's bad.

I'm sorry, Oliver, I don't know what you mean. Do you mean that it's bad
that we're using Xilinx's or that there are no micros out there with
quadrature, or something different altogether?

> >Has anyone out there solved this problem?
>
> Do you know the LS7183 from www.lsicsi.com ? It seems you could count
> the up and down pulses with HC12 pulse counters.

I didn't, and thanks for the reference. However the reason for quadrature
is that it's so much more noise immune than clock and direction or dual
clock. Still, on a small board, close to the micro, this might not be a
problem.

> I already used a small, cheap PIC for this task, these days I would
> use a HC08.

Yes, precisely, I am looking to do it with a PIC. I was hoping there was a
solution out there so that I would not have to reinvent the wheel. Ideally,
I would like a parallel interface to off-board accumulators.

Regards,

Paul


Hi Jiri,

I did find these chips, but they are quite a bit larger and more expensive
than this little board requires. Most of the resources would be wasted as
well. They do look like great chips for larger designs.

You would think that some of the high-end PIC's, with their focus on motor
control, would have addressed this issue, but apparently not.

Regards,

Paul

> -----Original Message-----
> From: Jiri Gutman [mailto:]
> Sent: Saturday, March 08, 2003 12:13 PM
> To:
> Subject: Re: [68HC12] Quadrature Inputs >
> Hi Paul,
>
> yes, the quadrature input is important and rare. But there is one optimal
> solution - go to see the Motorola Hybrid solution - DSP56F800 family.
>
> http://e-www.motorola.com/webapp/sps/site/taxonomy.jsp?nodeIdM9
> 5961783629
> 2
> or go direct to DSP56F803
>
> http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=DS
> P56F803&no
> deId27956292
>
> Many information and tools on the Motor Control you can find at
> http://e-www.motorola.com/webapp/sps/site/homepage.jsp?nodeIdnQXG
>
> Regards
> Jiri > > ----- Original Message -----
> > From: "Paul Johnson" <>
> > To: <>
> > Sent: Saturday, March 08, 2003 5:28 PM
> > Subject: [68HC12] Quadrature Inputs
> >
> >
> > > I'm surprised, given the number of embedded applications
> involving motor
> > > control or data capture, that almost no micros out there support
> > quadrature
> > > input. On our products, we use Xilinx FPGA's that provide 8 sets of
> > > quadrature input and handle all the accumulation, etc.
> > >
> > > However, on small footprint boards, with a simple task, it
> would be very
> > > desirable to lose the Xilinx and just read quadrature directly. Even
> just
> > > one pair of quadrature inputs would be fine.
> > >
> > > Has anyone out there solved this problem?
> > >
> > > Thanks,
> > >
> > > Paul Johnson
> > > Lynx Robotics
> > > 8125 Lankershim Blvd.
> > > North Hollywood, CA 91605
> > > Voice: (818) 252-7890
> > > FAX: (818) 252-7892
> > >
> > >
> > >
> > > --------------------
> > >
> > >
> > >
> > > ">http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> >
> -------------------- >
> ">http://docs.yahoo.com/info/terms/




In a message dated 3/8/03 8:52:38 PM Eastern Standard Time,
writes:

> I'm surprised, given the number of embedded applications
> involving motor
> control or data capture, that almost no micros out there support
> quadrature
> input. On our products, we use Xilinx FPGA's that provide 8 sets of
> quadrature input and handle all the accumulation, etc.
> However, on small footprint boards, with a simple task, it
> would be very
> desirable to lose the Xilinx and just read quadrature directly. Even
> just
> one pair of quadrature inputs would be fine.
> Has anyone out there solved this problem?

Just hook one of the encoder lines to an input with edge triggered interrupt,
arm for falling edge interrupt (for instance), read other encoder line in
handler, inc on hi, dec on lo.


"Paul Johnson" <> wrote:

[...]

>I'm sorry, Oliver, I don't know what you mean. Do you mean that it's bad

I meant that it's bad that uCs seldom have quadrature inputs.

[...]

>Yes, precisely, I am looking to do it with a PIC. I was hoping there was a
>solution out there so that I would not have to reinvent the wheel. Ideally,
>I would like a parallel interface to off-board accumulators.

It's pretty simple:

In a loop: Concatenate the actual two bit encoder information with the
saved two bits of the last round. From these 4 Bits you get 16
combinations, forward, backward, no change and illegal (each four
times).

Use a jump table to increment/decrement the counter (accumulator) or
signal an error.

Use some kind of handshake to the host if you output parallel data:
either a strobe signal triggered by the host, or a "data illegal" bit.

With a 20MHz PIC, I got 4,5us cycle time IIRC.

Oliver
--
Oliver Betz, Muenchen




wrote:

[...]

>Just hook one of the encoder lines to an input with edge triggered interrupt,
>arm for falling edge interrupt (for instance), read other encoder line in
>handler, inc on hi, dec on lo.

This doesn't work reliable: if your encoder moves forward and
backward, you loose the backward transition.

Oliver
--
Oliver Betz, Muenchen



> It's pretty simple:
>
> In a loop: Concatenate the actual two bit encoder information with the
> saved two bits of the last round. From these 4 Bits you get 16
> combinations, forward, backward, no change and illegal (each four
> times).
>
> Use a jump table to increment/decrement the counter (accumulator) or
> signal an error.
>
> Use some kind of handshake to the host if you output parallel data:
> either a strobe signal triggered by the host, or a "data illegal" bit.
>
> With a 20MHz PIC, I got 4,5us cycle time IIRC.

It sounds like this is a polling approach. I was thinking of doing
something similar to what Bob suggested, but attaching Quad-A to an
interrupt which triggers on any transition, then checking the value of the
other line in the ISR. I suppose that if the encoder was sitting right on a
line, however, this might swamp the interrupt input, but I have not commonly
seen this with encoders. With low interrupt latency, I would think this
would be pretty reliable, no?

Paul