Go to Post When I see stuff like that, sometimes I say, "That's BRILLIANT, why didn't I think of that?" But I never like the answer. - dtengineering [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 27-09-2011, 20:59
Andrew Lawrence
 
Posts: n/a
Delay in controls (HELP!)

Our robot has been fine up until today. Nothing different has happened. When we turned it on today, it seemed like the motors wouldn't run. But then the robot moved. It seems we are experiencing some major delay between our driver station, and our robot. We tried it inside our room, with the robot on blocks right before that, and it worked perfectly. we then took it outside, and....lag! Any answers would be great!
Reply With Quote
  #2   Spotlight this post!  
Unread 27-09-2011, 21:00
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,727
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: Delay in controls (HELP!)

Coding in C++? Check how you're allocating memory.
__________________
Mentor / Drive Coach: 228 (2016-?)
--2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
.
College Mentor: 2791 (2010-2015)
-- 2015 TVR Motorola Quality, FLR GM Industrial Design -- 2014 FLR Motorola Quality / SFs (with 341, 4930)
-- 2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
-- 2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 MN 10K Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #3   Spotlight this post!  
Unread 27-09-2011, 21:03
Andrew Lawrence
 
Posts: n/a
Re: Delay in controls (HELP!)

Quote:
Originally Posted by Chris is me View Post
Coding in C++? Check how you're allocating memory.
We haven't changed our code at all. It's the same code that ran at the competition (We will, however, be adding major changes within the next week). That code worked fine.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-09-2011, 21:05
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,727
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: Delay in controls (HELP!)

Quote:
Originally Posted by SuperNerd256 View Post
We haven't changed our code at all. It's the same code that ran at the competition (We will, however, be adding major changes within the next week). That code worked fine.
A very strange bug that I know little about happened to my team once. Apparently, when something specific happened (in our case, unplugging the Axis camera), the code would write to memory in such a way that it would just use up more and more memory to the point of causing lag a few matches later. This would persist when we turned it off and on, but not when we reloaded code. This problem was eventually isolated in code.
__________________
Mentor / Drive Coach: 228 (2016-?)
--2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
.
College Mentor: 2791 (2010-2015)
-- 2015 TVR Motorola Quality, FLR GM Industrial Design -- 2014 FLR Motorola Quality / SFs (with 341, 4930)
-- 2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
-- 2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 MN 10K Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #5   Spotlight this post!  
Unread 27-09-2011, 21:21
Andrew Lawrence
 
Posts: n/a
Re: Delay in controls (HELP!)

Quote:
Originally Posted by Chris is me View Post
A very strange bug that I know little about happened to my team once. Apparently, when something specific happened (in our case, unplugging the Axis camera), the code would write to memory in such a way that it would just use up more and more memory to the point of causing lag a few matches later. This would persist when we turned it off and on, but not when we reloaded code. This problem was eventually isolated in code.
We'll try that. The only thing that I can see is we unplugged our compressor, since we won't be using pneumatics anymore, and it was taking up too much memory, so as that we couldn't drive. Thanks!
Reply With Quote
  #6   Spotlight this post!  
Unread 27-09-2011, 22:53
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: Delay in controls (HELP!)

In LV, I've seen this issue when the WPIlib spits out errors. It seems that, if any individual thread gets a VI or two spitting constant errors, then the processor load of logging and transmitting all of these errors to the DS bogs it down enough for the thread to become unhappy (which usually trips one of the 100ms watchpuppies, which then sends more errors, and then everything dies).


I'd see if there are any errors being spit out.
__________________
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
  #7   Spotlight this post!  
Unread 28-09-2011, 00:53
Andrew Lawrence
 
Posts: n/a
Re: Delay in controls (HELP!)

Quote:
Originally Posted by apalrd View Post
In LV, I've seen this issue when the WPIlib spits out errors. It seems that, if any individual thread gets a VI or two spitting constant errors, then the processor load of logging and transmitting all of these errors to the DS bogs it down enough for the thread to become unhappy (which usually trips one of the 100ms watchpuppies, which then sends more errors, and then everything dies).


I'd see if there are any errors being spit out.
If it weren't for that last sentence, I'd have almost no idea what you were saying.
Reply With Quote
  #8   Spotlight this post!  
Unread 28-09-2011, 01:57
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Delay in controls (HELP!)

Quote:
Originally Posted by Chris is me View Post
code would write to memory in such a way that it would just use up more and more memory to the point of causing lag
Sounds like you forgot to deallocate your memory. I find segfault and memory leak stories break the ice with any CS person.

SuperNerd256, I find it unlikely that your compressor was taking up that much memory. I am rusty on my C++ library, but I could not imagine it is doing massive amount of of operations(perhaps a few function calls that go no where when the compressor is unplugged) or declare so much memory you eventually get a lag(unlike an image which is large).
Some suggested trouble shooting(which you may have tried), is your battery good? Is the Classmate running something else(possibly in the background, an update program or something that has highest network priority then the driver station and is trying to figure out why your robot is not responding to its internet request) using task manager? Is this a recent compile of the code(like Chris is me's story, but insert any variable that has never been deallocated will add up over time)? Is your robot in a Faraday Cage?
Reply With Quote
  #9   Spotlight this post!  
Unread 28-09-2011, 09:21
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: Delay in controls (HELP!)

Maybe my understanding of embedded programming is different than everyone else's, but I've always understood embedded systems (such as FIRST robots) which run in real time iteratively have little need for dynamic memory allocation (as they always use the same variables, and pass data in and out of functions and variable storage). For things like the camera image it might be nice to allocate memory dynamically, but still, does a robot really need to create and destroy objects while it is running (post-initialization)?

Although all of the RT embedded programming I've done outside of FRC is for systems which lack dynamic memory allocation (and I'm lucky if it has an RTOS with pre-emptive scheduling). In FRC, I use LabVIEW which does everything for me.
__________________
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
  #10   Spotlight this post!  
Unread 28-09-2011, 10:06
Andrew Lawrence
 
Posts: n/a
Re: Delay in controls (HELP!)

Quote:
Originally Posted by mesamb1 View Post
Sounds like you forgot to deallocate your memory. I find segfault and memory leak stories break the ice with any CS person.

SuperNerd256, I find it unlikely that your compressor was taking up that much memory. I am rusty on my C++ library, but I could not imagine it is doing massive amount of of operations(perhaps a few function calls that go no where when the compressor is unplugged) or declare so much memory you eventually get a lag(unlike an image which is large).
Some suggested trouble shooting(which you may have tried), is your battery good? Is the Classmate running something else(possibly in the background, an update program or something that has highest network priority then the driver station and is trying to figure out why your robot is not responding to its internet request) using task manager? Is this a recent compile of the code(like Chris is me's story, but insert any variable that has never been deallocated will add up over time)? Is your robot in a Faraday Cage?
Battery is at fully charge. I don't think classmate was running anything else, but I'll check. The code hasn't been loaded since last season. It's not in a Faraday Cage, but now I want to build one!
Reply With Quote
  #11   Spotlight this post!  
Unread 28-09-2011, 10:08
Andrew Lawrence
 
Posts: n/a
Re: Delay in controls (HELP!)

Quote:
Originally Posted by apalrd View Post
In FRC, I use LabVIEW which does everything for me.
We are using C++ for the first time this year. It worked out pretty well.
Reply With Quote
  #12   Spotlight this post!  
Unread 28-09-2011, 22:49
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Delay in controls (HELP!)

Quote:
Originally Posted by SuperNerd256 View Post
The code hasn't been loaded since last season
I would try to recompile the code. While I dont know what specifically it would fix with your code, it might be a magic bullet that solves the issue. What is going through my mind, is a delay on the classmate side, a memory issue, an lagging loop, or a bad wireless connection.
Reply With Quote
  #13   Spotlight this post!  
Unread 28-09-2011, 22:50
Andrew Lawrence
 
Posts: n/a
Re: Delay in controls (HELP!)

I told me lead mentor, and we will be reloading the code at our next meeting. Thanks!
Reply With Quote
  #14   Spotlight this post!  
Unread 28-09-2011, 23:58
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Delay in controls (HELP!)

Quote:
Originally Posted by apalrd View Post
I've always understood embedded systems (such as FIRST robots) which run in real time iteratively have little need for dynamic memory allocation (as they always use the same variables, and pass data in and out of functions and variable storage).
Quote:
Originally Posted by apalrd View Post
In FRC, I use LabVIEW which does everything for me.
The short answer is not quite. You cant ever forget memory. Any time you call a function and it has any variable you have allocated more memory you run the risk of trouble. Even with 8GBs of ram a recursive statement just declaring 1.01 run a billion times will run into issues with memory allocation. That sounds insanely unlucky to happen, but if you dont get rid of variables you are using over time you have a left a lot of variables the processor has not optimized out of existence once used.
Even labview you do this. All those close vi's de-allocate all the cache you initialize.
Reply With Quote
  #15   Spotlight this post!  
Unread 29-09-2011, 00:47
linuxboy linuxboy is offline
Registered User
AKA: Oliver Graff
FRC #3780
Team Role: Alumni
 
Join Date: Nov 2010
Rookie Year: 2009
Location: MI, USA
Posts: 217
linuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud of
Re: Delay in controls (HELP!)

Someone may have mentioned this but If you are in a area with a lot of Wi-Fi Access Points you could be getting interference which would cause dropped packets / lengthy packet delivery times. I suggest using the 5GHz range if you can and wireless N because in my experience using those settings has avoided interference.
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 02:48.

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