Go to Post Probably planning on milling the bumpers out of solid pool noodle stock, too. Ever wonder how they drill that hole down the middle of pool noodles? ;) - Bill_B [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 12-02-2011, 18:52
thepcphysician thepcphysician is offline
Registered User
FRC #1678
 
Join Date: Jan 2010
Location: Davis, CA
Posts: 12
thepcphysician is an unknown quantity at this point
Potentiometer causes code to hang

Hello everyone,

We are having a problem with our potentiometer code. We essentially are continuously polling the potentiometer, using "GetAverageValue". This works, but it causes severe problems; the robot will suddenly "hang" and remain unresponsive to user input for 5-10 seconds. This will occur several times each minute, but in between hang periods, the code will operate perfectly.

We initially tried using "GetValue" instead, as we suspected the problem was caused by excessive averaging overloading the C-RIO. However, this did not resolve the problem; the ONLY way we were able to improve the problem was by putting a wait in the loop, polling the potentiometer every .1 seconds. This introduces more lag than we'd like, but it does reduce the hang problem significantly, although it does not eradicate it completely.

Any ideas you might have are much appreciated - we're stumped.
__________________
Perhaps today is a good day to die!
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2011, 20:26
PatrickS's Avatar
PatrickS PatrickS is offline
I get my code from /dev/null
FRC #1742 (Shockwave)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Oklahoma City
Posts: 21
PatrickS is an unknown quantity at this point
Re: Potentiometer causes code to hang

Quote:
Originally Posted by thepcphysician View Post
Hello everyone,

We are having a problem with our potentiometer code. We essentially are continuously polling the potentiometer, using "GetAverageValue". This works, but it causes severe problems; the robot will suddenly "hang" and remain unresponsive to user input for 5-10 seconds. This will occur several times each minute, but in between hang periods, the code will operate perfectly.

We initially tried using "GetValue" instead, as we suspected the problem was caused by excessive averaging overloading the C-RIO. However, this did not resolve the problem; the ONLY way we were able to improve the problem was by putting a wait in the loop, polling the potentiometer every .1 seconds. This introduces more lag than we'd like, but it does reduce the hang problem significantly, although it does not eradicate it completely.

Any ideas you might have are much appreciated - we're stumped.
If you could post the relevant code it would help immensely.
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 17:48.

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