go_away

Author Topic: Wheel encoders w/ Axon - interrupts?  (Read 2368 times)

0 Members and 1 Guest are viewing this topic.

Offline OperationIvyTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Wheel encoders w/ Axon - interrupts?
« on: March 07, 2009, 06:02:55 PM »
We have a set of wheel encoders that operates by sending a logic edge every 1/32nd of a rotation. How do we detect this edge and increment our odometry count on the Axon? I don't want to get into interrupts in C because I think it's over my head. Is there some sort of IC that will count edges and give some kind of output that we can use? I thought I used a chip that did something like this in a class I took but I can't remember what it was called. If anyone has some insight on how to make a wheel encoder work without interrupts (or if anyone has some help on interrupts!) we would really appreciate it.

Thanks!

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 953
  • Helpful? 5
  • cooll
Re: Wheel encoders w/ Axon - interrupts?
« Reply #1 on: March 08, 2009, 04:11:48 AM »
when encoder reading ===1...incremen a counter....whenthat counter reaches 32...tht means one full revolution has occure reset couner to 0 and calculate distance moved...thats it..
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Wheel encoders w/ Axon - interrupts?
« Reply #2 on: March 09, 2009, 12:16:55 AM »
What is your RPM? Quadrature encoders?

Have you had a look at the encoder source code that comes with AVRlib?

Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: Wheel encoders w/ Axon - interrupts?
« Reply #3 on: March 09, 2009, 10:54:29 AM »
There are IC's available available for wheel encoders like the LS7366 It counts steps and you communicate to it with a 4 pin spi microwire system.

These things are a good way to free up your microcontroller (without them there are too many interrupts and functions called by the interrupts going on to actually do anything useful)

Offline Resilient

  • Full Member
  • ***
  • Posts: 111
  • Helpful? 4
Re: Wheel encoders w/ Axon - interrupts?
« Reply #4 on: May 23, 2009, 09:12:56 PM »
There is encoder code in AVRlib? Where?

What is your RPM? Quadrature encoders?

Have you had a look at the encoder source code that comes with AVRlib?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots

Offline Resilient

  • Full Member
  • ***
  • Posts: 111
  • Helpful? 4
Re: Wheel encoders w/ Axon - interrupts?
« Reply #6 on: May 23, 2009, 10:13:42 PM »
http://lmgtfy.com/?q=avrlib+encoder  <--- ::)

In that code, interrupts are not disabled before the encoder count is read. Wont this create an error if the count is read at the same time an interrupt is triggered? Is there a way to simply delay the processing of that interrupt till after the encoder count is read?

Disabling the interrupt, reading the value, then enabling it, it would simply ignore any interrupt and your count would be off if you got unlucky, right?

 :-\


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Wheel encoders w/ Axon - interrupts?
« Reply #7 on: May 23, 2009, 10:22:55 PM »
In that code, interrupts are not disabled before the encoder count is read. Wont this create an error if the count is read at the same time an interrupt is triggered? Is there a way to simply delay the processing of that interrupt till after the encoder count is read?

Disabling the interrupt, reading the value, then enabling it, it would simply ignore any interrupt and your count would be off if you got unlucky, right?
In either situation the interrupt would be missed, whether enabled or not. It works on this assumption:

time to read signal after interrupt << time it takes for the next interrupt to trigger

That assumption will always be true on a typical microcontroller . . . unless your robot is going at light speeds . . .

 


Get Your Ad Here

data_list