View Single Post
  #3   Spotlight this post!  
Unread 06-02-2008, 18:25
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
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