Go to Post Never underestimate the power of human ingenuity. - Wetzel [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 22-01-2015, 19:51
abraker abraker is offline
Registered User
FRC #0333
 
Join Date: Jan 2015
Location: Brooklyn
Posts: 6
abraker is an unknown quantity at this point
Wierd roboRIO lag spike

Hi teams!

We are trying to debug encoders to get an accurate reading, and determined that some sort of lag spikes happen randomly. I stripped the loop so that it only checks for a raw value (for debugging purposes), and stops the motor when the value is >=1440 (360 deg rotation using k4X encoding type) and prints the number of milliseconds it took. Most of the time it runs for ~630 ms, but when the random lag spike hits, it runs for anywhere between 700 ms to 800 ms.

Our loop:

Code:
t1.set(0.15);
t2.set(0.15);
while(isAutonomous() && isEnabled()){
   if(encoder.getRaw())>=1440-56){  // it overshoots everytime, so -56 to compensate
      t1.set(0.0);
      t2.set(0.0);
      clock.stop();
      SmartDashboard.putNumber("Timer: ", clock.get());
   }
}
Reply With Quote
 


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 11:44.

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