What you want is a quadrature encoder counter chip. A stand alone
chip that does the job is the LS7366. The other alternative
is to use a microcontroller that has one built in. The costs
are actually quite comparable.
The higher level issue you are running into is the "my microcontroller
is running out of steam" issue. The solution is usually 1) faster
microcontrollers, 2) more microcontrollers, or 3) both. Personally
I've moved onto embedded ARM microcontrollers -- ARM Cortex M3's to be
more specific. I use them like popcorn. Yes there is some learning
curve. Frankly, that is what the HBRC is all about -- people with
similar interests helping one another.
Regards,
-Wayne
On 04/17/2012 02:57 PM, jgeidl wrote:
> I have motors with encoders that will provide from 1600 CPR to 6400CPR
> depending on what part of the rise and/or fall I read from the A& B
> outputs. I plan on using this with and Arduino and using interrupts
> on the Arduino otherwise, I won�t capture all the ticks.
>
> Here�s my question. For the sake of this question let�s say I am
> reading 1600 CPR � rise only on a given motor. If the motor is
> running at full speed this is going create a real flood of
> interrupts. Isn�t that going to make any other procedures extremely
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To post to this group, send email to hbrob...@googlegroups.com.
To unsubscribe from this group, send email to hbrobotics+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hbrobotics?hl=en.
James M. Geidl, K6JMG
D.B. Cooper, you have a message.
Jim:
Regards,
-Wayne
> on the Arduino otherwise, I won't capture all the ticks.
>
> Here's my question. For the sake of this question let's say I am
> reading 1600 CPR - rise only on a given motor. If the motor is
> running at full speed this is going create a real flood of interrupts.
> Isn't that going to make any other procedures extremely sluggish? Am
Alan
DE KM6VV mobile
James M. Geidl, K6JMG
D.B. Cooper, you have a
message.
I ran into a similar problem on an older robot project that was using a HandyBoard as the main controller. The encoders would just put out information faster than the controller could handle and some of the counts would be lost. For the project I didn't really need the high resolution but losing track of the encoders and missing counts wasn't acceptable either. So, what I did was use a small microcontroller (SX28) in between as encoder processor to scale the values. It is can be configured to scale down the readings to divide them down to a level that the main controller can handle. Since it always keeps track of the intermediate values none of the counts are lost. Since it still looks like an encoder to the host, no special communication is needed. If you have back issues of SERVO you can find a whole write up on the project in the July 2008 issue:
http://www.servomagazine.com/index.php/magazine/issue/2008/07
Robert
James M. Geidl, K6JMG
D.B. Cooper, you have a
message.
Hello James,
The code I used on the SX28 processor was written in SX/B (compiled BASIC) and the source code is in a ZIP file on the SERVO site:
The source shouldn't be too hard to follow and may help.
Glad to hear that the castor kit made it there ok.
--
James M. Geidl, K6JMG
D.B. Cooper, you have a
message.
James M. Geidl, K6JMG
D.B. Cooper, you have a
message.
If I recall correctly, the LS7366 (I’ve worked with them) part is more suited to a micro processor (Intel or Motorola part) then a micro computer (Arduino). The part has a bus, the Arduino’s don’t have an exposed bus for data/address. (Although there’s always a way around it, if you want to bit-bang).
Alan KM6VV
On Behalf Of Chris Palmer
If you can find them, a LS7366 chip paired with each quadrature encoder would be your easiest solution. They aren't microcontrollers and don't need programming, but take commands from your microcontroller and will independently keep count. You poll them when you want to know their current count. Doing it on a timer interrupt is a clean way to go.
I don't know if it has changed, but it used to be difficult to find a source for them. Wayne organized a club group purchase several years back, and I still have some.
-Chris
Butokim <but...@gmail.com> wrote:
This looks like something I may be able to figure out, thanks.
Something else hit me. The smaller Arduinos only have two interrupts so I would have to use two Arduinos just to read the A and B out puts from the encoders on each wheel. The other option is to use a Arduino Mega 2560 which has 6 interrupts available.
I am warming up to the idea of having some kind of chip in between the main processor and the encoders to , as you say, scale the values.
James M. Geidl, K6JMG
D.B. Cooper, you have a message.
.
James M. Geidl, K6JMG
D.B. Cooper, you have a
message.
Chris is correct. I did organize a group buy of the LS7366 in a DIP-16
package many moons ago. At the time, only Gemini would sell the part
in a DIP-16 package. My recollection at the time is that Gemini had
a minimum order that was greater $50 (my memory is fuzzy on this topic.)
US Digital sells the chip in surface mount form. I have 3 LS7366's
(DIP-16) sitting in my drawer that I will bring to the SIG tonight.
I doubt I will ever use them.
These are SPI devices and can be used with 4 GPIO lines from a
processor. Bit-banging works just fine with SPI devices. If you
have two LS7366's, you need 5 lines (serial clock, serial in,
serial out, select 1 and select 2.)
Regards,
-Wayne
On 04/18/2012 03:35 PM, Butokim wrote:
> Gemini has the chips in SM and through-hole. They are 3.95 ea with 12.00
> shipping.
>
> James M. Geidl, K6JMG
> /D.B. Cooper, you have a message./
>
>
> ------------------------------------------------------------------------
> *From:* hbrob...@googlegroups.com [mailto:hbrob...@googlegroups.com]
> *On Behalf Of *Alan
> *Sent:* Wednesday, April 18, 2012 3:27 PM
> *To:* hbrob...@googlegroups.com
> *Subject:* RE: [HBRobotics] Reading my motor encoders properly
>
> If I recall correctly, the LS7366 (I�ve worked with them) part is more
> suited to a micro processor (Intel or Motorola part) then a micro
> computer (Arduino). The part has a bus, the Arduino�s don�t have an
> exposed bus for data/address. (Although there�s always a way around it,
> if you want to bit-bang).
>
> Alan KM6VV
>
> *On Behalf Of *Chris Palmer
>
> If you can find them, a LS7366 chip paired with each quadrature encoder
> would be your easiest solution. They aren't microcontrollers and don't
> need programming, but take commands from your microcontroller and will
> independently keep count. You poll them when you want to know their
> current count. Doing it on a timer interrupt is a clean way to go.
>
> I don't know if it has changed, but it used to be difficult to find a
> source for them. Wayne organized a club group purchase several years
> back, and I still have some.
>
> -Chris
>
> Butokim <but...@gmail.com <mailto:but...@gmail.com>> wrote:
>
> This looks like something I may be able to figure out, thanks.
>
> Something else hit me. The smaller Arduinos only have two interrupts so
> I would have to use two Arduinos just to read the A and B out puts from
> the encoders on each wheel. The other option is to use a Arduino Mega
> 2560 which has 6 interrupts available.
>
> I am warming up to the idea of having some kind of chip in between the
> main processor and the encoders to , as you say, scale the values.
>
> James M. Geidl, K6JMG
> /D.B. Cooper, you have a message./
From: hbrob...@googlegroups.com [mailto:hbrob...@googlegroups.com] On Behalf Of Butokim
Sent: Wednesday, April 18, 2012 4:44 PM
James M. Geidl, K6JMG
D.B. Cooper, you have a
message.