Go to Post You know, I love the fact that FIRST has always got your back. :D - Beth Sweet [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 19-01-2016, 17:34
FancyGerald FancyGerald is offline
Registered User
FRC #3098
 
Join Date: Feb 2015
Location: Mi
Posts: 6
FancyGerald is an unknown quantity at this point
Robot Scan Time

I am trying to find the scan time of my robot. As in how long the gap is in between each command processed by the robot itself.

Thanks in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2016, 17:50
Landonh12's Avatar
Landonh12 Landonh12 is offline
270 points
AKA: Landon Haugh
FRC #0364 (Team Fusion)
Team Role: College Student
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Gulfport, MS
Posts: 211
Landonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud of
Re: Robot Scan Time

What language are you using? In LabVIEW you can set custom loop times, and in Java/C++ the loop interval for the scheduler is defaulted to 20ms (noted here: https://wpilib.screenstepslive.com/s...d-programming).
__________________
Team Fusion 364 - Driver/Programmer 2012-2015; Controls Mentor 2016-Present
Reply With Quote
  #3   Spotlight this post!  
Unread 19-01-2016, 17:51
rzoeller rzoeller is offline
MN GOFIRST Recruitment Officer
AKA: Ryan Zoeller
FRC #2169 (RI3D 'Snow Problem; KING TeC)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2007
Location: Savage, MN
Posts: 111
rzoeller is a jewel in the roughrzoeller is a jewel in the roughrzoeller is a jewel in the rough
Re: Robot Scan Time

Quote:
Originally Posted by Landonh12 View Post
In LabVIEW you can set custom loop times
Note that he is referring to code written in Periodic Tasks, code written in Teleop will be executed only when a packet from the driver station is received.
__________________
Ri3D - 'Snow Problem Programmer
MN GOFIRST Recruitment Officer
FRC 2169 Alumni
Reply With Quote
  #4   Spotlight this post!  
Unread 19-01-2016, 17:56
FancyGerald FancyGerald is offline
Registered User
FRC #3098
 
Join Date: Feb 2015
Location: Mi
Posts: 6
FancyGerald is an unknown quantity at this point
Re: Robot Scan Time

We are using java to program our robot and we would like to know the scan time if the scan time were ever to fluctuate.
Reply With Quote
  #5   Spotlight this post!  
Unread 19-01-2016, 17:59
Landonh12's Avatar
Landonh12 Landonh12 is offline
270 points
AKA: Landon Haugh
FRC #0364 (Team Fusion)
Team Role: College Student
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Gulfport, MS
Posts: 211
Landonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud ofLandonh12 has much to be proud of
Re: Robot Scan Time

Quote:
Originally Posted by FancyGerald View Post
We are using java to program our robot and we would like to know the scan time if the scan time were ever to fluctuate.
It shouldn't fluctuate unless you start dropping packets and experience sporadic ping timings. What are you going to use this information for?
__________________
Team Fusion 364 - Driver/Programmer 2012-2015; Controls Mentor 2016-Present
Reply With Quote
  #6   Spotlight this post!  
Unread 19-01-2016, 18:07
FancyGerald FancyGerald is offline
Registered User
FRC #3098
 
Join Date: Feb 2015
Location: Mi
Posts: 6
FancyGerald is an unknown quantity at this point
Re: Robot Scan Time

We want to have acceleration for our drive train.

My idea was to increase the speed of a motor at a constant rate multiplied by the scan time of the robot.

Code:
if(maxSpeed > currentSpeed)
{
    currentSpeed += ACCELERATION * SCANTIME;
}
Reply With Quote
  #7   Spotlight this post!  
Unread 19-01-2016, 19:28
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 430
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Robot Scan Time

The time elapsed is going to be approximately 20ms, but it will fluctuate depending on network latencies.

Just perform the calculation each time through the loop.

Code:
currentTime = Timer.getFPGATimestamp(); //time in seconds
elapsedTime = currentTime - lastTime;

//do your math

lastTime = currentTime;
More info on what the getFPGATimestamp method does here: http://team2168.org/javadoc/edu/wpi/...PGATimestamp--
__________________
http://team2168.org

Last edited by otherguy : 19-01-2016 at 19:31.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-01-2016, 20:05
mynameistoe mynameistoe is offline
Registered User
FRC #3098
 
Join Date: Jan 2016
Location: Waterford
Posts: 3
mynameistoe is an unknown quantity at this point
Re: Robot Scan Time

Thank you all for your help!

-3098
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 10:11.

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