Go to Post Well I have to admit, most of the people on our team are geeks. I think that it's a title of honor considering it might as well be "boss" or "head supervisor" or something along those lines. - Cyberguy34000 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-03-2009, 19:35
ezygmont708's Avatar
ezygmont708 ezygmont708 is offline
FAIL = First Attempt In Learning
AKA: Zygmont
FRC #0708 (Hatters Robotics)
Team Role: Mentor
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Horsham, PA
Posts: 91
ezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant future
Autonomous Start Delay

We have been over the code about a dozen times... but we can't seem to figure out why our autonomous mode waits about 3 seconds before moving. Most robots are 1/4 way through the field by the time we start moving, and this is allowing the human play to score 2 -4 balls before we can get out of striking distance. I am not a programmer, but posting this question for the team!!!
__________________
E. Zygmont
Team Lead - Team 708 Hatters Robotics
Hatboro- Horsham Senior High School - Horsham, PA
  #2   Spotlight this post!  
Unread 05-03-2009, 19:49
ttldomination's Avatar
ttldomination ttldomination is offline
Sunny
no team
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Roanoke, TX
Posts: 2,066
ttldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond repute
Re: Autonomous Start Delay

It would really be something with the code, and ultimately you might have to end up posting the code,

but my best guess is that if you have a lot of sensor initializing, then if your program waits for sensors to stablize, ie an accelerometer, or gyro, or something, then it might take a sec, or seconds. But that's my two cents.
__________________
1261: 2007-2012
1648: 2013-2014
5283: 2015
  #3   Spotlight this post!  
Unread 05-03-2009, 20:03
ezygmont708's Avatar
ezygmont708 ezygmont708 is offline
FAIL = First Attempt In Learning
AKA: Zygmont
FRC #0708 (Hatters Robotics)
Team Role: Mentor
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Horsham, PA
Posts: 91
ezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant future
Re: Autonomous Start Delay

I will get you the code shortly, it's more of an issue to pull it off of our server...

Thanks for the quick response though...
__________________
E. Zygmont
Team Lead - Team 708 Hatters Robotics
Hatboro- Horsham Senior High School - Horsham, PA
  #4   Spotlight this post!  
Unread 05-03-2009, 20:49
Tanner's Avatar
Tanner Tanner is offline
Registered User
FRC #1261 (Roblions)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Suwanee, GA
Posts: 311
Tanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to behold
Re: Autonomous Start Delay

Sunny's right - it could be sensors. Specific sensors like the gyro, need time to initialize, whilst others do not. I can't exactly remember how much time is recommended for the gyro to initialize, but I don't think three seconds would be it - sounds too long.

Also, the mass amount of stuff to initialize could be it. If you are using a lot of motors, sensors, servos, or anything else - it could take a long time for the cRIO to create them all and initialize them all. I haven't seen this in experience with teleoperated, though I'm not sure about autonomous - we haven't exactly thought about that yet.

Another thing it could be if a student has placed a wait sub-vi in the autonomous initialize block (assuming they use LabView). If one is there, it literally pauses the entire program, while waiting for the time to pass. Its not exactly a possibility that it could happen, but it is a cause.

Hope this helps.

-Tanner

Last edited by Tanner : 05-03-2009 at 21:16.
  #5   Spotlight this post!  
Unread 05-03-2009, 21:15
ttldomination's Avatar
ttldomination ttldomination is offline
Sunny
no team
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Roanoke, TX
Posts: 2,066
ttldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond repute
Re: Autonomous Start Delay

Just so that programmers are on the same page, can we know what programming language you're using?
__________________
1261: 2007-2012
1648: 2013-2014
5283: 2015
  #6   Spotlight this post!  
Unread 05-03-2009, 21:36
ezygmont708's Avatar
ezygmont708 ezygmont708 is offline
FAIL = First Attempt In Learning
AKA: Zygmont
FRC #0708 (Hatters Robotics)
Team Role: Mentor
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Horsham, PA
Posts: 91
ezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant future
Re: Autonomous Start Delay

We are using labView, and we are trying to initialize a gyro and an accelorometer, in addition we have two wheel encoders.
__________________
E. Zygmont
Team Lead - Team 708 Hatters Robotics
Hatboro- Horsham Senior High School - Horsham, PA
  #7   Spotlight this post!  
Unread 05-03-2009, 22:38
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Autonomous Start Delay

Most of the Opens that do initialization are super fast, way under a millisecond. The exception is the gyro, and I suppose the accelerometer. Because these are trying to measure a baseline, they need to calibrate for drift when known to be stationary, and they average many values to get a good estimate. You may want to move the gyro init to Begin or outside the loop, then write it to a global to be used in auto.

Greg McKaskle
  #8   Spotlight this post!  
Unread 07-03-2009, 00:33
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,102
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Autonomous Start Delay

Yeah, the gyro takes 5 seconds to initialize in WPILib/C++. You need to move the initialization somewhere besides your autonomous routine, as I would imagine its about the same in LabView.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #9   Spotlight this post!  
Unread 07-03-2009, 00:46
duane's Avatar
duane duane is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2003
Location: Vacaville
Posts: 100
duane is an unknown quantity at this point
Send a message via AIM to duane
Re: Autonomous Start Delay

You should be initializing (everything) in the Begin.vi. If you are using autonomous independent mode, then you'll have to stash the references in a global and use the global in the autonomous independent vi.

Begin happens right when the robot is turned on. Way way before autonomous mode.
__________________
Duane Murphy
Mentor - Software
Vanden Vikings FIRST Team 701
http://www.vandenrobotics.com
  #10   Spotlight this post!  
Unread 07-03-2009, 15:16
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Autonomous Start Delay

I haven't looked at the internals of the gyro class, but automatic calibrations of things can sometimes slow down if there's a lot of noise while it's trying to calibrate(so it either tries to wait until there's less noise to tries to take more samples to compensate). In your setup, there are quite a few factors that could cause this--robot movment, vibration from a compressor, electrical noise from wires or motors, etc.
__________________
Get yer robot source code here!
  #11   Spotlight this post!  
Unread 07-03-2009, 20:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Autonomous Start Delay

The gyro init will always take several seconds to average values in order to get an accurate baseline. Both C and LV will do this. As mentioned, do this in Begin or outside the loop in Basic.

Greg McKaskle
  #12   Spotlight this post!  
Unread 07-03-2009, 23:03
Creator Mat Creator Mat is offline
Registered User
FRC #2338 (Gear it Forward)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Aurora Illinois
Posts: 178
Creator Mat is a jewel in the roughCreator Mat is a jewel in the roughCreator Mat is a jewel in the roughCreator Mat is a jewel in the rough
Re: Autonomous Start Delay

Do you have your robot starting at full speed? you could be burning out and the delay is your robot trying to gain traction
__________________

2010 Midwest Spirit award
2010 Midwest Quarterfinalists
2010 Wisconsin Quarterfinalists
2009 Midwest Finalists
2009 Wisconsin Quarterfinalists
2008 Midwest Rookie AllStars
  #13   Spotlight this post!  
Unread 17-03-2009, 01:02
ezygmont708's Avatar
ezygmont708 ezygmont708 is offline
FAIL = First Attempt In Learning
AKA: Zygmont
FRC #0708 (Hatters Robotics)
Team Role: Mentor
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Horsham, PA
Posts: 91
ezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant futureezygmont708 has a brilliant future
Re: Autonomous Start Delay

Sorry for the long delay... Not just word play!

Attached is a zip file with alll of our vi's.

An explanation of the code from our chief programmer:

In Autonomous Independent.vi, the outermost case is for autonomous mode selection, e.g. "2" for autonomous mode 2. The innermost case is a state machine used for the selected autonomous mode. It takes about 2 seconds to enter the "Start" case that is nested in the outermost autonomous mode case. Using probes, the outermost case is entered immediately, but a probe in case "Start" does not update until approximately 2 seconds later. Once the state machine is entered, everything operates as expected, but for some unknown reason entrance to the state machine is delayed. I have not had a chance to use Highlight Execution to find out where the delay is originating since I do not have access to a cRIO.



The encoder code and gyro code are used.



The code for the ultrasonic and IR sensors at the bottom is not used and will be deleted.

Thanks for any help that you all may be able to provide!!!
Attached Files
File Type: zip 0213.zip (524.1 KB, 74 views)
__________________
E. Zygmont
Team Lead - Team 708 Hatters Robotics
Hatboro- Horsham Senior High School - Horsham, PA
  #14   Spotlight this post!  
Unread 17-03-2009, 12:05
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Autonomous Start Delay

As the others have stated, the problem is that you have your gyro open in autonomous independent. This delays for 2 seconds.

Move the gyro open to your basic robot main, outside the while loop, and publish the dev ref with a global variable (I see you do this already with your encoders).

It's probably too late for this year, but next year you guys should look at the advanced framework. It should help keep your code more organized.
  #15   Spotlight this post!  
Unread 17-03-2009, 12:28
Chaos in a Can Chaos in a Can is offline
Joel Spadin
FRC #1736 (Robot Casserole)
Team Role: Programmer
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Peoria, IL
Posts: 58
Chaos in a Can is an unknown quantity at this point
Send a message via MSN to Chaos in a Can
Re: Autonomous Start Delay

Actually, my team has been having problems with delay in the advanced framework too. All sensors were initialized during the begin.vi, but there was still a 2-3 second hang-up during the init state of every mode.
During every state change, the driver station would display "Watchdog" for 1-2 seconds, enter the state for about half a second, display the watchdog timeout message again for another 1-2 seconds, then return to normal operations.

We even stumped the NI representative at the regional event after we pinpointed the cause of the hangup to be a section of a vi with approximately nothing in it.

I rewrote almost the entire program at the regional using the version 3 advanced framework and the delay between states disappeared, but there was still about a 1 second delay entering autonomous mode during matches. We were not using any sensors or the camera at the time, and the delay only seems to occur on the competition field (the first time it is run maybe?) because the robot appeared to start autonomous immediately when we tested it in the pits.

Any ideas as to where this delay is coming from?
__________________
2006 Xerox Creativity Award
2007 General Motors Industrial Design Award
2008 Judges' Award
2009 Chrysler Team Spirit Award

Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
A boolean delay m3rc1l3ss NI LabVIEW 1 18-02-2009 21:51
Delay jasonpeinko Programming 8 18-01-2008 15:56
How to Start Autonomous mode? jjbarrow Programming 14 16-01-2006 20:34
Delay in autonomous mode SpeakerSilenced Programming 1 22-02-2005 10:58
Delay Gal Longin Programming 1 09-12-2004 10:37


All times are GMT -5. The time now is 02:01.

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