Go Down

Topic: COM-11102 Spark Fun Encoder Question (Read 551 times) previous topic - next topic

psppb

Greetings,

I am building a hobby Coordinate Measuring Machine with four 1024 pulse rotary encoders from the spark fun website www.sparkfun.com item #11102. it is basically a four segment arm with no motor just encoders. I'm not really going into any reverse kinematics as my arm, hand and brain will be my feedback loop.

These devices output 1024 pulses per rotation. I will be using 4 of them. The regular arduino has a sampling rate of 15 khz do you think with hand motion (rpm max) that a regular Arduino UNO could keep up with these or do I need to use something like a DUE?

Also has anyone used that specific encoder before? Example code is always my best friend. Or has anyone ever attempted this?

Thanks !

strykeroz

Hi,

There's a link on the product page for that encodeer that talks about this problem, and offers a solution (here).  Did you check that out? Looks promising.

Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

MarkT


The regular arduino has a sampling rate of 15 khz do you think with hand motion (rpm max) that a regular Arduino UNO could keep up with these or do I need to use something like a DUE?


15kHz?  No, that can't be right, digitalRead() takes about 5us or so, so reading two pins takes 10us - 100kHz rate.
analogRead is limited to about 10kHz, perhaps that's what you were thinking of?

With direct port reading you can read up to 8 pins simultaneously in 125ns or so...  The response time of the interrupt
handler will be the limiting factor, and again that is a few us.

I think with 4 encoders you'll need to look at using pin-change interrupts to drive the encoder reading, and
direct port reading.  There are probably examples of both on here if you search for them.
[ I won't respond to messages, use the forum please ]

Go Up