Go to Post I just want to say that the rack 'n roll was my first year with FIRST! It was the best thing I ever did. I cant wait to learn more when we get to start up again! - ctorloey [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 11-03-2012, 21:35
hsekhon27 hsekhon27 is offline
Registered User
FRC #0280 (TNT)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Taylor, MI
Posts: 23
hsekhon27 is an unknown quantity at this point
Startup Delay

Once I enable teleop, it takes 5-6 seconds for the robot to start responding. Could someone please look at my code and see what's wrong? It won't let me post robot main so I just posted the three vi's that I use the most

Thanks!
Attached Files
File Type: vi Begin.vi (57.9 KB, 14 views)
File Type: vi Teleop.vi (43.7 KB, 16 views)
File Type: vi Periodic Tasks.vi (82.4 KB, 20 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 12-03-2012, 05:55
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Startup Delay

i'm pretty sure that this is normal. A lot of people experience this, us included.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2012, 08:49
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,752
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: Startup Delay

Actually, I don't think that is a normal place for a delay.

From memory, here is what I'm used to seeing.

Powering the robot will have a delay, waiting for the various devices to power up. LEDs will appear almost instantly and start blinking through their startup sequences. If you are tethered, you will have a communications light in about 15 seconds. If you aren't tethered, it takes about 40 to 50 seconds for the wifi to be up.

After communications is up, the OS on the cRIO boots, and then the user program. As the user program boots it will run through Begin or other initialization code and start running Periodic and Vision.

At this point, the code should be able to process packets from the DS, and those should be disabled. Every 20ms, the DS receives a packet from the DS, either auto, tele, or disabled. It will process that packet as soon as it looks for it. The transition from disabled to tele should take one packet of delay. That transition will call disabled one last time as a shutdown condition, and I think the next packet calls the actual teleop.

In order to better debug this, can you describe more about when the delay happens? Is it each time you enable tele, the first time, or occasionally? Is it always the same amount of time? Do you have any messages on the Diagnostics?

If you know when the delay is likely to happen, then you can open panels to see what is going on, or watch the Charts tab of the DS to see what code is reported as running.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2012, 08:56
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Startup Delay

Did you change Robot Main? Teams are supposed to leave it alone and put all their custom code in other places.

I do see something that might be the cause of the problem. You chose your own name for the drive motors device reference. You didn't change the name from the default in Periodic Tasks, and you probably left it as the default in Disabled. Aren't you seeing continuous errors on your Driver Station when the robot is disabled, saying that "Left and Right Motors" is not defined? Those errors will clog up the communication, and could possibly be the reason for things remaining unresponsive for a few seconds after being enabled.

One other thing: your ball density check isn't in a loop. It's only going to run once when the program starts up.
Reply With Quote
  #5   Spotlight this post!  
Unread 13-03-2012, 20:36
hsekhon27 hsekhon27 is offline
Registered User
FRC #0280 (TNT)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Taylor, MI
Posts: 23
hsekhon27 is an unknown quantity at this point
Re: Startup Delay

Quote:
Originally Posted by Alan Anderson View Post
Did you change Robot Main? Teams are supposed to leave it alone and put all their custom code in other places.

I do see something that might be the cause of the problem. You chose your own name for the drive motors device reference. You didn't change the name from the default in Periodic Tasks, and you probably left it as the default in Disabled. Aren't you seeing continuous errors on your Driver Station when the robot is disabled, saying that "Left and Right Motors" is not defined? Those errors will clog up the communication, and could possibly be the reason for things remaining unresponsive for a few seconds after being enabled.

One other thing: your ball density check isn't in a loop. It's only going to run once when the program starts up.
Thanks!!

One more problem: Once the "Shoot" motors are in a loop in periodic tasks vi, they run in short intervals, like the motors will turn on and off automatically once I press button 8 or 9. What might be causing this problem?
Reply With Quote
  #6   Spotlight this post!  
Unread 13-03-2012, 23:53
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Startup Delay

Quote:
Originally Posted by hsekhon27 View Post
One more problem: Once the "Shoot" motors are in a loop in periodic tasks vi, they run in short intervals, like the motors will turn on and off automatically once I press button 8 or 9. What might be causing this problem?
It's because you've defined them as Drive motors, and that enables the Motor Safety. If you don't set their value every 100 milliseconds or faster, the system will shut them off. That feature is designed to keep the robot from driving out of control.

You can disable the Motor Safety for those motors using the Safety Config function (it's in the Robot Drive > Advanced palette).
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 22:07.

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