Go to Post I mean I am a pocket protector kind of guy. - techhelpbb [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-03-2012, 04:40
DM High Voltage DM High Voltage is offline
Registered User
FRC #2852
 
Join Date: Jan 2012
Location: St. Catharines, ON
Posts: 2
DM High Voltage is an unknown quantity at this point
Maximum digital interrupt rate

We have an encoder on a rotating shooter wheel. The encoder generates 500 pulses per rev and we are running at 30 rps and generating 15000 pulses/sec. This rate is causing lag in our control system and intermitent communication failures. Does anyone know what the practical maximum interrupt rate is?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-03-2012, 07:16
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Maximum digital interrupt rate

Are you actually using interrupts? If so, why not use the encoder class and let the FPGA handle the counting, then you'll see no change in your code regardless of how fast the shaft spins.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-03-2012, 08:11
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Maximum digital interrupt rate

Interrupts don't enter into it. The FPGA can keep up with digital inputs that change more than 30,000 times a second. Even if you had signals that were too fast for it, it wouldn't cause any control lag. It would just produce inaccurate measurements.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-03-2012, 08:31
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,933
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: Maximum digital interrupt rate

A little background here Any program you write will be too slow to count encoder pulses directly. The encoder function calls relies on the FPGA part of the CRIO to do the actual counting. The FPGA is fast enough. Since you cannot program the FPGA, you have to rely on the encoder class to get your number.

You software types please excuse me if I mixed languages on the explanation.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-03-2012, 08:36
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Maximum digital interrupt rate

Quote:
Originally Posted by Alan Anderson View Post
Interrupts don't enter into it. The FPGA can keep up with digital inputs that change more than 30,000 times a second. Even if you had signals that were too fast for it, it wouldn't cause any control lag. It would just produce inaccurate measurements.

I don't have the link handy but Ether referred me to a white paper that says the max count rate (by the FPGA) is around 44k/s. So the lag is not because of the 30K count rate unless he is using k2X or k4X for the mode. If so, switch to k1X.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi