Go to Post It's official: we've run out of things to talk about. - Jessica Boucher [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 14-03-2010, 10:18
dwodrich dwodrich is offline
Registered User
FRC #1706
 
Join Date: Dec 2008
Location: Wentzville
Posts: 45
dwodrich has a spectacular aura aboutdwodrich has a spectacular aura aboutdwodrich has a spectacular aura about
Slowness and delays in teleopt

We are see lots of delays in the exicution of our teleopt code. Useing an elapsed time vi. We know we are getting anywhere from the expected 50ms with spikes all the way up to 1800 ms. The average is probably about 300ms.

We also know that the teleopt code is self is running pretty fast, just a few ms.

We also know that when we turn off vision processing from robot main, the average goes up to about 55ms.

We have tried all of the suggestions we could find here on what to change with the camera savings. (Image size, FPS and compression)

We have all the latest updates to the CRio and DS.

I'm pretty sure teh delay must be in the DS clling the teleopt loop, but am unsure how to fix the problem.

Any ideas? Our regional is this weekend!
  #2   Spotlight this post!  
Unread 14-03-2010, 11:26
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,753
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: Slowness and delays in teleopt

What language? And is the vision code running during tele? Do you have logical branches in your tele code that have delays for timing kickers and such?

Greg McKaskle
  #3   Spotlight this post!  
Unread 14-03-2010, 11:27
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Slowness and delays in teleopt

1. Are you using the Vision Processing loop called from Robot Main?

2. Are you using the camera on the Dashboard?

3. Are you powering the USB hub correctly (both the power+data (black) and power only (red) to classmate?)

4. Are you doing a full deploy or just running Robot Main while open?

5. How is your network setup?
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #4   Spotlight this post!  
Unread 14-03-2010, 11:45
dwodrich dwodrich is offline
Registered User
FRC #1706
 
Join Date: Dec 2008
Location: Wentzville
Posts: 45
dwodrich has a spectacular aura aboutdwodrich has a spectacular aura aboutdwodrich has a spectacular aura about
Re: Slowness and delays in teleopt

Quote:
Originally Posted by Greg McKaskle View Post
What language? And is the vision code running during tele? Do you have logical branches in your tele code that have delays for timing kickers and such?

Greg McKaskle
Labview
yes, but in different loop
Teleopt just does driving (it is running in <5ms)
  #5   Spotlight this post!  
Unread 14-03-2010, 11:48
dwodrich dwodrich is offline
Registered User
FRC #1706
 
Join Date: Dec 2008
Location: Wentzville
Posts: 45
dwodrich has a spectacular aura aboutdwodrich has a spectacular aura aboutdwodrich has a spectacular aura about
Re: Slowness and delays in teleopt

Quote:
Originally Posted by apalrd View Post
1. Are you using the Vision Processing loop called from Robot Main?
####yes, when I turn it off the problem goes away.
2. Are you using the camera on the Dashboard?
####yes, and the problem improves when I turn it off, but we still have big delays

3. Are you powering the USB hub correctly (both the power+data (black) and power only (red) to classmate?)
####Both joystick plugged directly into the classmate, no hub.

4. Are you doing a full deploy or just running Robot Main while open?
#### We have tried both, same result

5. How is your network setup?
#### Have tried wired and wireless for development laptop and ds, with same result. Robot has always been wireless.
  #6   Spotlight this post!  
Unread 14-03-2010, 12:00
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Slowness and delays in teleopt

If you have both joysticks plugged into the Classmate then you don't have a stop button. Bad.

We noticed the largest issues in competition when using the camera on the dashboard.

Try running the robot tethered. It is very possible there are some other wireless networks in the area and you are set to the same channel as them.

I have never had any problems running Vision, although it does eat alot of the processor.

Do a full deploy on tether. Having many VI's open will cause alot of network traffic as LabVIEW updates all of the front panels.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #7   Spotlight this post!  
Unread 14-03-2010, 12:33
jspatz1's Avatar
jspatz1 jspatz1 is offline
Registered User
AKA: Jeff
FRC #1986 (Team Titanium)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Lee's Summit, MO
Posts: 836
jspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond reputejspatz1 has a reputation beyond repute
Send a message via AIM to jspatz1
Re: Slowness and delays in teleopt

We experienced this delay in Kansas City. Had never seen it before reaching the field there. The delay would even persist AFTER our matches, while testing tethered in the pit or practice field. Re-imaging the cRio would solve it, but I believe it returned at least once again and required the same fix. One theory offered to us was that the field shut-down of the cRio left the memory full of vision data that was never cleared and somehow caused this delay. Don't know if this is correct, but abandoning our vision entirely did seem to prevent it from coming back. We would like to solve the problem while still getting our vision back.

Between this and the widespread comm problems we and others have experienced on the field, it would appear that negotiating the pitfalls in the control and communication system are as important a part of the challenge this year as the game itself. You can't always prevent them even with thorough testing, but make sure you get to the field on Thursday so you can check your system with the FMS, and make sure you use proper power-up procedures at your matches.
__________________
  #8   Spotlight this post!  
Unread 14-03-2010, 13:53
Dale's Avatar
Dale Dale is offline
Head Coach & Mentor
AKA: Dale Yocum
FRC #1540 (Flaming Chickens)
Team Role: Coach
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Portland, OR
Posts: 504
Dale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud of
Re: Slowness and delays in teleopt

By any chance are you using CAN? Our software, written in C++, was seeing large lags and lack of responsiveness due to errors the Jaguars were returning on occasion back up the CAN bus, through the 2CAN and then being displayed by printfs. When we patched the WPI code to ignore those errors the lag went away. I can't remember the error the Jaguar was returning but it was one we didn't care about since we send the commands to them every time through the loop.

I don't know if a similar thing is happening in Labview. If you are using PWM in either environment, ignore all this.
__________________
2016 PNW Championship Chairman's; 2016 Winner Oregon City District, 2015 PNW Championship Chairman's; 2015 PNW District Engineering Inspiration; 2015 PNW District Finalist; 2014 PNW Championship Chairman's; 2014 Championship Innovation in Controls; 2013 Chairman's (Oregon); 2013 Finalist (OKC); 2012 Winner (OKC); 2012 Chairman's (OKC); 2012 Woody Flowers (Oregon); 2011 Volunteer of the Year (Oregon); 2011 Finalist & Captain (San Diego); 2011 Innovation in Control (San Diego); 2010 & 2007 Chairman's (Oregon); 2010 Regional Champions (Colorado); 2010 Innovation in Control (Colorado); 2009 & 2008 Engineering Inspiration (Oregon); 2008 Regional Champions (Oregon); 2007 Regional Finalist (Oregon); 2005 Rookie Inspiration (PNW)
  #9   Spotlight this post!  
Unread 14-03-2010, 14:22
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,753
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: Slowness and delays in teleopt

The symptoms don't sound identical, but the first thing I'd do is to turn off the error logging on the cRIO. As mentioned, C++ and Java teams have in some conditions been seeing delays due to excessive numbers of errors causing lots of printf/logging. Similarly, the LV code has globals for sending uncaught errors to the driver station and logging them.

To turn off the global, search for a post from Doug Norman and follow the directions. Also, if you'd rather not turn off vision, it is possible to speed up the dashboard vision quite a bit by building your own custom one from the template. One useful performance enhancement is to right click on the image control>>Visible>>Image Information. This should hide the textual information below the display. A combination of this and the chart were causing expensive draws on the classmate. This was pretty easy to locate using the performance tools.

As for the vision memory not clearing, I'd like to hear the explanation for that which doesn't use Star Trek technobabble. In short, the vision adds some overhead, but can be used just fine on a controller provided everything else is pretty well behaved. I'd encourage you to do your own debugging and not buy into explanations which require RAM to misbehave in a very special way, just on your robot.

Greg McKaskle
  #10   Spotlight this post!  
Unread 14-03-2010, 15:51
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: Slowness and delays in teleopt

I saw something about a separate loop, but I'm not sure what that was referring to. If you have a neverending while loop running somewhere, try inserting a short delay inside it so that it doesn't monopolize the cRIO's CPU.
  #11   Spotlight this post!  
Unread 16-03-2010, 08:08
dwodrich dwodrich is offline
Registered User
FRC #1706
 
Join Date: Dec 2008
Location: Wentzville
Posts: 45
dwodrich has a spectacular aura aboutdwodrich has a spectacular aura aboutdwodrich has a spectacular aura about
Re: Slowness and delays in teleopt

OK, Over the weekend we made several changes and tested them last night and we are back to performing as before. 20-60ms between calls to teleopt.

I think the problem was ether the logging I turned off with the global or creating a new LV project and copying all our changed code into that project.

At this point we have moved on to work out other issues, so further diagnosis will have to wait till after the season.

Just wanted to post incase the solution will help someone else.

Thanks!
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
[FTC]: Kit Delays? ttldomination FIRST Tech Challenge 0 14-10-2008 16:16
Programing delays in MPLAB Shivang1923 Programming 1 14-02-2008 12:19
WEATHER DELAYS!! Gamer930 General Forum 3 16-03-2007 21:44
"VENDORs", reasonable delays in shipping due to out of stock items, and other errata Madison General Forum 12 08-12-2006 18:14
weather delays? archiver 2001 6 23-06-2002 22:11


All times are GMT -5. The time now is 23:19.

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