Slowing down quadrature encoders

 comp.robotics.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Slowing down quadrature encoders ringo.davis 10-21-2005
Posted by on October 21, 2005, 10:47 am
Please log in for more thread options
I have 2 motors with quadrature encoders that I can controlling using a
pic16f877a. The problem is that at max rpm the encoders change faster
than the pic can count so everything goes haywire. This happens
basically when I give a position command and the motor can't move at
first and then the tension gets released and the motor moves very fast
(kind of like winding up a spring). I need full power so limiting the
pwm is not a choice. I have pcb's already made so switching to another
processor is out also. What I would like is a circuit to divide the
quadrature signal down but keep the phase information. I tried a couple
4017 clock dividers but they keep the same spacing between the signals
in time, not in phase. Anybody have any ideas on an IC or a circuit
that can do this?
Thanks
Ringo


Posted by Anthony Fremont on October 21, 2005, 11:58 am
Please log in for more thread options

> I have 2 motors with quadrature encoders that I can controlling using
a
> pic16f877a. The problem is that at max rpm the encoders change faster
> than the pic can count so everything goes haywire. This happens

Exactly how fast is that? IOW, how many ints/sec are you getting, or
are you polling the encoder?

> basically when I give a position command and the motor can't move at
> first and then the tension gets released and the motor moves very fast
> (kind of like winding up a spring). I need full power so limiting the
> pwm is not a choice. I have pcb's already made so switching to another
> processor is out also. What I would like is a circuit to divide the

Is it, wouldn't an 18F452 basically drop right in? AFAIK it's
completely pin compatible. It would certainly be faster running at
40MHz.

> quadrature signal down but keep the phase information. I tried a
couple
> 4017 clock dividers but they keep the same spacing between the signals
> in time, not in phase. Anybody have any ideas on an IC or a circuit
> that can do this?

Another PIC or two? ;-)


Posted by Randy M. Dumse on October 22, 2005, 5:13 pm
Please log in for more thread options
>> Anybody have any ideas on an IC or a circuit
>> that can do this?
>
> Another PIC or two? ;-)

Actually, if you want to read quadrature, why not get a micro with a
quadrature decoder built in. The DSP56F80x's in our 'Pod line can read
32 bits of hardware quadrature decoding at 40MHz input.

I think we had a discussion about this a few "which processor"
discussions ago, but there aren't many micros with quadrature, so the
choices are limited, but the DSP56F805's not only have two hardware ones
built in, they also have timers that can be grouped to read quadrature.
In one project I read 6 channels of quadrature inputs in hardware, and
also read velocity of those inputs by timing the pulse widths with
remaining timers.

Having the right processor for the job can make a huge difference.

--
Randy M. Dumse

Caution: Objects in mirror are more confused than they appear.



Posted by on October 21, 2005, 1:48 pm
Please log in for more thread options
Something like this, maybe?

http://www.usdigital.com/products/ls7183-ls7184/

or

http://www.usdigital.com/products/ls7166/


JW


Posted by on October 21, 2005, 2:53 pm
Please log in for more thread options
These chips would give me more resolution, which would make it worse.
I'm using the external interrupt for 1 encoder and the change-on-port-b
interrupt for the other one. When the interrupt fires I check the
status of the other line to decide to increment or decrement the
counter. At full speed I'm getting interrupts at something like 80khz.
Since a 20mhz pic processes instructions at 5mhz, that gives me about
62 instructions between interupts. And with 2 channels of interupts at
the same time it just swamps everything. I would drop in a 452 except
the LVP is different and my compiler only supports teh 16 series, not
the 18 series. I'm hoping to find some kind of circuit I can place in
between the pic board and the encoder.
Thanks
Ringo


Similar ThreadsPosted
High resolution, low cost, quadrature encoders August 30, 2005, 9:28 am
Slowing Down October 29, 2007, 2:45 pm
Slowing down a plotter October 9, 2007, 5:08 am
Encoders with QRD1114 November 6, 2006, 3:03 am
Robot kit that includes wheel encoders? October 4, 2006, 7:04 pm
steppers and DC motors as cheapo encoders ? April 4, 2008, 6:26 pm
Quadrature output September 7, 2005, 10:36 am
analog to quadrature converter? August 24, 2005, 2:28 pm
two questions about quadrature decoders October 1, 2006, 11:29 pm
Low-cost controller for 10 small DC servo motors with quadrature encoder September 6, 2008, 9:40 am

The site map in XML format XML site map
other useful resources:
Official Robosapien Website
Lego Mindstorms Website

Contact Us | Privacy Policy