Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Robot Scan Time (http://www.chiefdelphi.com/forums/showthread.php?t=142148)

FancyGerald 19-01-2016 17:34

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.

Landonh12 19-01-2016 17:50

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).

rzoeller 19-01-2016 17:51

Re: Robot Scan Time
 
Quote:

Originally Posted by Landonh12 (Post 1526812)
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.

FancyGerald 19-01-2016 17:56

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.

Landonh12 19-01-2016 17:59

Re: Robot Scan Time
 
Quote:

Originally Posted by FancyGerald (Post 1526816)
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?

FancyGerald 19-01-2016 18:07

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;
}


otherguy 19-01-2016 19:28

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--

mynameistoe 19-01-2016 20:05

Re: Robot Scan Time
 
Thank you all for your help!

-3098


All times are GMT -5. The time now is 10:11.

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