|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: How many interrupts is too many interrupts?
Quick question for this thread, does a single quadrature encoder count as one irq or 2 irq's ? My quick calculations show that a wheel speed of 8 feet/sec with a 256 pulse/rev encoder yields about 1000 interrupts per second or is it really 2000 interrupts per second because the encoder has two channels? The addition of a second encoder can now push the processor to 2000/4000 interrupts per second. So, if 2 irq's per encoder, the processor will be operating nearly 4000 interrupts per second?
![]() |
|
#2
|
|||
|
|||
|
Re: How many interrupts is too many interrupts?
Quad encoders represent 1 interrupt, the phase b line is polled during the interrupt caused by a phase a transition. The phase b is used to determine direction but shouldn't be tied to another interrupt line.
|
|
#3
|
||||
|
||||
|
Re: How many interrupts is too many interrupts?
Quote:
-Kevin |
|
#4
|
|||
|
|||
|
Re: How many interrupts is too many interrupts?
Quote:
This thread is rapidly disappearing into the tech rat-hole that the original posted requested it not. So backing up a couple levels. I've run IFI default code with ~8500 interrupts/sec without any issue. The code should be able to handle upwards of 20,000 interrupts/sec based upon the typical interrupt handlers I've seen. But... There are tech gotchas that start coming into play above 10,000 interrupts per second with the standard IFI robot code framework. But those are best left for another thread. Maybe we should start a separate tech thread on the subject. |
|
#5
|
||||
|
||||
|
Re: How many interrupts is too many interrupts?
Quote:
Quote:
8 ft/sec = 96 in/sec 96 in/sec at 18 in/rev = 5.333 rev/sec 256 pulses/rev at 5.333 rev/sec = 1365 pulses/sec At 12 ft/sec, this becomes 2048 pulses/sec. If you have an ISR for each channel, then double the above numbers. |
|
#6
|
|||||
|
|||||
|
Re: How many interrupts is too many interrupts?
The number of interrupts you want to generate is dependent on the accuracy you design for. Any quadrature encoder you choose can be quadrupled in accuracy by discriminating programming.
An encoder rated to return 128 counts per revolution (cpr) assumes the use of an interrupt only on “output A,” and triggering an interrupt only on one edge, rising or falling, of output A, e.g., Digital Inputs 1 & 2. You can double the effective resolution (a 128cpr encoder will give 256cpr) by alternating the interrupt trigger within the ISR to tick on both the rising and the falling edges of output A, a la Digital Inputs 3-6. Further, you can quadruple your effective resolution (a 128cpr encoder will produce 512cpr) by also interrupting on “Output B” and triggering on both rising and falling edges. BTW: Never use the combination of interrupting on both A & B, but only on one edge (rising or falling), since "ticks" would then vary in distance rather than be of constant length. Quote:
Last edited by Mark McLeod : 08-02-2008 at 10:15. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Too many R/C commands in a loop? | ManicMechanic | VEX | 1 | 02-07-2007 00:52 |
| 3 Teams Per Side Too Many? | ben281 | FRC Game Design | 65 | 15-05-2005 18:24 |
| pic: TOO MANY TETRAS!!!! | Ali Ahmed | Extra Discussion | 12 | 22-01-2005 10:06 |