Go to Post Must...squish....bugs... :p - nighterfighter [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 18-03-2013, 21:25
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
80-100% CPU usage

My dad is having issues when running code on the cRIO. The cRIO is running at was is being reported as 80-100% CPU usage causing it to act sluggish and lag a lot. I do not have access to his code but I can get it this weekend when I go home. When he runs the default code I believe he said it was 50-60%. Any one see anything like this before? If so what was the cause of it?
Reply With Quote
  #2   Spotlight this post!  
Unread 18-03-2013, 21:28
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 800
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: 80-100% CPU usage

check for unneeded loops. This is the #1 for me to look for. I generally advocate for loopless code (outside robot main and periodic tasks).

Do you have vision code?
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
Reply With Quote
  #3   Spotlight this post!  
Unread 18-03-2013, 21:31
bbuncher12 bbuncher12 is offline
Registered User
FRC #0540 (Talon 540)
Team Role: Electrical
 
Join Date: Jan 2013
Rookie Year: 2004
Location: Richmond, VA
Posts: 23
bbuncher12 is an unknown quantity at this point
Re: 80-100% CPU usage

We had a similar problem during several matches, where the cRio either rebooted or stopped responding for a while because the cpu usage maxed out. We will be doing more tests, but in our case it seems to be due to lots of sensors (Axis and NXT cameras, a repeating if->then loop with an ultrasonic).
Reply With Quote
  #4   Spotlight this post!  
Unread 19-03-2013, 07:36
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,748
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: 80-100% CPU usage

CPU usage of 100% will not in itself cause a reboot or a crash. It can cause lag, but doesn't necessarily have to.

If the code has errors being printed to the Messages tab of the DS, then that adds quite a bit to the CPU load. Correct the errors first, as they may also explain other driving symptoms.

If the CPU usage still seems high, post code along with a description of how it behaves and we can help and can show tools that will help determine how fast various parts of the code are running.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 20-03-2013, 00:11
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: 80-100% CPU usage

We repeatedly get CPU usage errors from the code if we are calling Refnums in Periodic Tasks or Teleop that are not valid. Make sure every Refnum (the pink string that names a motor/solenoid/etc) you are calling is being properly set-up in Begin and is actually wired on the robot.

In addition, calling the same Refnum twice in periodic tasks has caused 100% CPU usage as well. Just my 2 cents
Reply With Quote
  #6   Spotlight this post!  
Unread 21-03-2013, 07:02
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,748
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: 80-100% CPU usage

The refnum issues you mention would cause errors, and piping unhandled errors to the console is somewhat expensive. If you fix the errors, the CPU usage will drop dramatically.

Greg McKaskle
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 04:43.

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