|
Re: How many interrupts is too many interrupts?
Ok, this is not exactly in the case of a robot, but it shows how far/fast an 18F8722 processor can go.
At work, we made a crab drive AGV to load parts into various production machines automatically. We used stepper motors to drive the robot due to their inability to run away and ability to be controlled with swiss-watch precision. While running, the 18f output two completely seperate motor command pulse trains to two motors.
The ISR for each side included a table lookup (acceleration table) and some bit shifting, but made great use of the CCP registers (you won't believe how much more you can do with those things once the chip isn't hindered by IFI's hardware configuration of it in the robot controller).
Anyhow, both of these ISRs run up to 12,500steps/second (that's 25KHz interrupt together) and keeps the robot in communication with the plant coordination computer (there are multiple AGVs) over Zigbee at the same time. Oh yeah and the Local_Keypad_Service() loop (which runs on 26.2ms (yes I did that for old time's sake)) which just watches for the overflow flag on the freerun timer feeding the CCPs runs at the same time. Beleive me... any glitches would be instantly noticed with these stepper motors... running at these high speeds they stall if you have the tiniest hiccup in your pulse timing.
As long as you're smart about your code... you can make these things fly.
By the way, does the third thing you're encoding go around infinitely many times or is it limited? You can get multi-turn potentiometers.
-q
p.s. If you have huge problems with high frequencies on your encoder interrupts, you can always get a microchip development board for one of their new 16-bit or 32-bit core processors which have built in programmable quadrature decoder modules that run up to several MHz/channel... and you don't have to do a thing with them until you want a number. I believe they are DMA-compatible modules, so you can make the register (essentially) as big as you like.
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
Last edited by Qbranch : 07-02-2008 at 08:06.
|