Would a quad decoder in hardware be worthwhile on AVR ?

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some how, Atmel has managed to pack 10lbs of goodies in a 5lb bag and sell it for the price of a 2lb bag! Good job! So I'm not complaining a bit here. A while >after< completing the survey I thought of another device that might be handy in hardware. Quadrature decoders can be rather intensive on the processor when spun quickly and/or have super high resolution. I started to imagine how having the quad decoding done in hardware would lighten the workload up on the processor and reduce glitches.

Markets?

Might fit in a 'motion control' line that would keep a few PWM channels and a CAN interface. Could fit right in to automotive apps where they interface with interior controls to adjust seat position per operator settings... Actuator drivers...

Some features?:

1) Have a couple interrupts for say start/stop, direction change, overflow, could copy a bunch of the logic from PWM parts of counters to make adjustable overflow (TOP) values... (might could just integrate into one the counters, or add another)

2) couple bits for count options, i.e.
QDCRA (Quadrature Decoder Control Register A)
.bit QPOL (quadrature polarity) [default = 0]
.......0 Rising Edge
.......1 Falling Edge

.bits CB0, CB1 (Count Bits 0 & 1) [default = ?]
......CB1.CB0
.......0...0 Rising and Falling both A & B (QPOL ignored)
.......0...1 Rising A only
.......1...0 Rising B only
.......1...1 Rising A and B
*this one could help as a free divider...

3) Asynchronous operation to allow count register to stay current even in sleep mode? Use pulses from A & B phases as (optional) clock source.

4) 32 (or more) bit register bank to expand abs position abilities for lead screw driven tables with encoder on motor for example.

I don't know; maybe there's just not enough room left. Shouldn't require any extra pins on most megas though.

In my research on this before posting I found Atmel gave us a couple nice App Notes about interfacing the AVR to a quad decoder/counter; I only skimmed through them but learned that this has already been done in a sense. The FPSLIC is capable of doing just what I'm thinking of, but you will have to download the example code and program the FPGA component of the chip yourself. I guess I need to expand my horizons to these FPGAs now that they have the AVR core integrated. From what I read about the FPSLIC the cost is high and you have to buy a license to play around with them?? I still think a quadrature decoder would be cool thing to have in a couple models of the megas.

I added the pole cause the feature it there...

Last Edited: Wed. May 23, 2007 - 01:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are encoder chips available that don't require downloads. You could interface that to the AVR.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check out Agilent's HCTL2016, HCTL2020 (both 16 bit) & HCTL2032 (dual 32 bit) quadrature decoder ICs.

I've used the HCTL2016 with really good success.

I have been wanting to use the HCTL2032 but, just haven't gotten there yet.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dksmall wrote:
There are encoder chips available that don't require downloads. You could interface that to the AVR.

Oh yeah, it's not that I need help interfacing to an encoder; at the moment ;-) It's just that most of the quad decoder ICs I've seen are almost as big as the lower pin count ATmegas. People could save a lot of board space if it were integrated into the AVR. I think that would make it easyer to locate the motor control board right on the motor/actuator. That's why my comment about CAN or other robust serial interfaces to connect them to the main system controller.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Carl, I've actually played with those a little bit. The HCTL1100 is a monster too. IIRC that's the number.

Mostly my point was to find out opinions on if it would be nice to have one integrated onto the AVR chip. Maybe it's a silly notion with no market for the added feature.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bnemec wrote:
Carl, I've actually played with those a little bit. The HCTL1100 is a monster too. IIRC that's the number.

The HCTL1100 is actually the whole motion controller, minus the encoder, driver and motor. I was refering to the devices that capture the encoder pulses only.

bnemec wrote:
Mostly my point was to find out opinions on if it would be nice to have one integrated onto the AVR chip. Maybe it's a silly notion with no market for the added feature.

Well yes, I think having a whole motion controller within the AVR would be great! The issue is that, most applications I encounter have at least three axes so, there would need to be AVR versions that incorporate 1, 2, 3 and, possibly 4 motion controllers "On Board" the AVR. The alternative would be to have AVR flavors with the ability to capture between 1 and 4 quadrature encoders with 32 bit resolution.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The issue is that, most applications I encounter have at least three axes so, there would need to be AVR versions that incorporate 1, 2, 3 and, possible 4 motion controllers "On Board the AVR. The alternative would be to have AVR flavors with the ability to capture between 1 and 4 quadrature encoders with 32 bit resolution.

Oh :(

And I assume that having one controller on each axis plus a mastor corrdinating would only slow things down and cost more money and boards... hmm

I guess asking for 3 or 4 quad decoder modules in one AVR plus the 3 or 4 PWM channels would be asking a bit much. Oh well, was a fun thought.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bnemec wrote:
And I assume that having one controller on each axis plus a mastor corrdinating would only slow things down and cost more money and boards... hmm

I guess asking for 3 or 4 quad decoder modules in one AVR plus the 3 or 4 PWM channels would be asking a bit much. Oh well, was a fun thought.

I'm just saying that, if you're going to do it, do it all at once! Several flavors would be great!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh, heck ya; if they could fit that in there.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In a recent thread https://www.avrfreaks.net/index.p... Renesas H8 was brought up. Some of the H8 models have encoder interfaces as you describe.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.