|
Re: How many interrupts is too many interrupts?
Madison,
We used three encoders last year (two for traction and another for lift), generating at most 4 thousand counts per second and we never had a problem (not even close). We did use a potentiometer, but read it using IFI's slow Get_Analog_Value, not Kevin's high sampling rate, high resolution ADC code.
You can use high count rates if your code is smart, for example:
- never use floating point calculations
- don't send printf's when you don't need them (that is, only use them for debugging on the pits, never on the field)
- optimize your Interrupt Handling Routine to be as short and quick as possible
This year we'll be using two low count home-made encoders and a gyro (sampled at least 6400 times a second) and I'm not a bit worried.
We have used the gyro and high count encoders (3200 Hz and 4000 counts per second) in practice robots and, although the code was never tweaked, we did have some occasional red-light-of-death blinking.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
|