Go to Post These predictions are just a bit of fun. Neither these, nor the division threads, are meant to be comprehensive. Don't like 'em? Go out there and prove them wrong! - Looking Forward [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 01-04-2010, 22:04
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
Possibility of Controller Overload using Compressor

Hello. If you have had any of the problems I have had, you probably keep a scribe close to hit the No App switch every time you download. Looking deep into the WPI library for possible causes of CPU overload, I found this.

The Compressor library opens a new thread to handle compressor updates. Kinda a weird thing to do, since it could just poll the compressor during every loop of Teleop or something, but it does. It uses FIFO to transfer enabled state between the main thread and the Compressor thread. The compressor thread has no delays - an infinite loop that reads the FIFO, reads the switch, and sets the relay. I don't know much about how FIFO operates, but I assume it dosen't take long to read the FIFO. I do know it dosen't take long to read a switch or set a relay. Thus, it is quite possible that all extra CPU power is dedicated to running the compressor as fast as possible, so it would be really really hard to tell if optimizations work, as the processor is always around 95% since the compressor is always eating the extra.

The solution is simple. I added a 100ms delay to the Compressor loop. After doing this, the CPU load on my cRio went from 96% to 56%. Drastic improvement. I can't certainly say it was this compressor, as I was trying desperately to get the drive lag to go away.
__________________
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
Reply With Quote
 


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
Using x-box 360 controller sparks-1784 Programming 13 23-03-2010 20:17
Using a TI-83+ or TI-84+ as an auxilary controller Hydr0g3n Programming 14 30-08-2006 19:34
Current reversed on compressor spike controller scottish144 General Forum 20 05-09-2005 07:33
using a ps2 controller Thunderhawk1038 Control System 6 26-02-2005 17:15
Using Accelerometer with '04 controller sanddrag Control System 4 20-02-2004 12:18


All times are GMT -5. The time now is 09:35.

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