Go to Post Anyone else think we're (including me) a little obsessed? The seasons over and were already onto the next one. - Bjenks548 [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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 22-11-2010, 14:28
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is offline
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,888
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
[FTC]: Lag and Teleop (Labview)

Greetings,

My team seems to be having a recurring issue. Every year we have to fight lag in our FTC robots. It seems to me that the robot isn't checking for the position of the controls often enough. The robot misses quick corrections while driving and may take up to 2 seconds to respond to commands.

My students are thinking that we are overloading the NXT with commands and the packets are being dropped. I am not sold on this explanation considering we are only using 1 touch sensor, 2 encoders, 4 DC motors (skid drive) 1 Lego motor and 6 servos. I have a hard time believing that our hardware is so... anemic that this would be too much for it.

So I have two questions: 1. Is anyone else having this issue? 2. Would someone with experience be willing to look at our code to see what is going on? (I will post it as soon as I can figure out how...)
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.

Last edited by wilsonmw04 : 22-11-2010 at 14:32. Reason: I can't type...
Reply With Quote
  #2   Spotlight this post!  
Unread 22-11-2010, 17:58
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is offline
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,888
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: [FTC]: Lag and Teleop (Labview)

Here is the code. I'm really looking for some Labview/NI support. However, if we can't find the cause of this lag we will be dropping Labview and going to robotC where we have heard there isn't this lag issue.
Attached Files
File Type: vi 0035_teleop.vi (55.1 KB, 56 views)
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-11-2010, 21:23
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: [FTC]: Lag and Teleop (Labview)

To add to my mentor's post, we also experimented with a vi I found last year on the FTC forums known as Read Packet Flush.vi that replaced the read packet vi, in which it erased the inbox before accepting the next packet (least I think that is how it worked, the help file was a little lacking in the technical aspect). Last year this completely got rid of our lag for competition. This year I tried it with a vi of using only the drivetrain and it worked, however when I add the other code for the rest of the robot the lag seems to return.

My first idea is that the NXT is simply running too much code in each iterative and that it wasn't reading fast enough because of this, but I've seen teams with more complex setups than this, so I find it hard to believe. I understand that LABview is not as commonly used in FTC (least not from who we asked at competition last year), but help would be appreciated. The only idea I have left is run the NXT in two states, one for the first controller functions, one for the second, but i can't imagine this being easy or helping much.
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #4   Spotlight this post!  
Unread 22-11-2010, 22:17
aklego aklego is offline
Registered User
FTC #3595 (Schrödinger's Hat)
Team Role: Mentor
 
Join Date: Oct 2009
Rookie Year: 2004
Location: Alaska
Posts: 89
aklego is just really niceaklego is just really niceaklego is just really niceaklego is just really nice
Re: [FTC]: Lag and Teleop (Labview)

Greetings,

Could you also post the HEY LOOK AT THIS!!!.vi? I'll go through your code and see it I can find some optimizations.
Reply With Quote
  #5   Spotlight this post!  
Unread 22-11-2010, 22:19
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is offline
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,888
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: [FTC]: Lag and Teleop (Labview)

Umm Bobby,
Do we have they VI? ;-)
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.
Reply With Quote
  #6   Spotlight this post!  
Unread 23-11-2010, 08:16
ProgramLuke's Avatar
ProgramLuke ProgramLuke is offline
Captain
AKA: Luke
FRC #2169 (KING TeC)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Prior Lake, MN
Posts: 144
ProgramLuke is an unknown quantity at this point
Re: [FTC]: Lag and Teleop (Labview)

Could you post a picture of the code (I don't have access to LV right now).
__________________
2012 Inaugural Minnesota State High School League State Champions
2012 Galileo Division Semifinalists
2012 Wisconsin Regional Finalists
2012 Wisconsin Regional Entrepreneurship Award
2012 Lake Superior Regional Chairman's Award
2012 Lake Superior Regional Champion
2012 Lake Superior Innovation in Control
2011 Championship Imagery Award
2011 Championship Archimedes Quarterfinalist
2011 Minnesota 10000 Lakes Finalists
2011 Lake Superior Regional Chairman's Award
2011 Lake Superior Finalists
2010 FTC World Championship Finalist
2010 FTC World Championship Edison Division Champion
2010 Minnesota 10000 Lakes Regional Chairman's Award
2009 Minnesota North Star Regional Chairman's Award
2008 Wisconsin Regional Finalist
2007 Wisconsin Regional Champion
Reply With Quote
  #7   Spotlight this post!  
Unread 23-11-2010, 11:55
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 753
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: Lag and Teleop (Labview)

Quote:
Originally Posted by wilsonmw04 View Post
Here is the code. I'm really looking for some Labview/NI support. However, if we can't find the cause of this lag we will be dropping Labview and going to robotC where we have heard there isn't this lag issue.
First...

You don't need to use "Read Packet Flush.vi" this year because the Samantha Module uses USB, which doesn't suffer the 5 packet buffer problems that Bluetooth does.

Next...

To drive your wheels you are running tank mode, and you have TWO Move MotorS (group) VIs, that are each controlling one wheel. That's OK, but you are using the "Multiple Motor" version of each one. So you are passing each one an array of motors, that only contains ONE motor. This will double your processing. I suggest changing these to single Move Motor VI's by clicking on the pull-down list below them and chosing "Move DC Motor" (Without the Group or Multi option). This will require that you also delete the Arrays of DC motors an inputs, and replace them with Single DC Motor inputs.

Finally

I suspect that your lags are really due to the MANY 0.7 second delays that you have in your servo processing code. Whenever you hit an arm function you are moving your servos and putting in a big delay. This delay will prevent the code from processing any new joystick inputs. Yeah... it will be sluggish.

The best way to do this (As shown in the templates) is to read the controls in one loop, and then share the button actions via local variables. Put your servo actions in another loop that can run independantly.

I also noticed that you have set your Message timeout to 10 Ms. (Going into FTC Robot Status). I can't imagine this is helping.
This tiemout is for detecting loss of link. 1000 ms Is more than adequate.

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor

Last edited by PhilBot : 23-11-2010 at 11:58.
Reply With Quote
  #8   Spotlight this post!  
Unread 23-11-2010, 12:02
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: [FTC]: Lag and Teleop (Labview)

oddly, I totally forgot that the original template shows manipulators as being in a second loop, I will definiatly try that. As for the increase in the timeout, we found that the NXT kept switching between enabled and disabled without us doing anything to the FCS (we were using the Samantha module when this happened) and when we heightened the number, it stopped doing that. But again, that could be because we were processing so much. I will definiatly make those changes and test the robot with that ASAP. I am planning however to make a backup piece of code using RobotC, if that is ok with my mentor.
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #9   Spotlight this post!  
Unread 23-11-2010, 12:04
wilsonmw04's Avatar
wilsonmw04 wilsonmw04 is offline
Coach
FRC #1086 (Blue Cheese)
Team Role: Teacher
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Midlothian, VA
Posts: 1,888
wilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond reputewilsonmw04 has a reputation beyond repute
Re: [FTC]: Lag and Teleop (Labview)

Excellent responses so far. Thanks!
We have our next meeting Saturday. This will give the programmers something to chew on.
__________________
Currently: Coach FRC 1086/FTC 93
2006-2011 Coach FRC 2106/FTC 35
If you come to a FRC event to see a robot competition, you are missing the point.
Reply With Quote
  #10   Spotlight this post!  
Unread 23-11-2010, 13:37
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: [FTC]: Lag and Teleop (Labview)

While working on the code i have a question that I was wondering if anyone knew. Is the NXT capable of handling flat sequence structures with multiple frames this year? I know in the past multiple frames were not allowed, but this year I'm not getting a broken vi icon on my run button, but I don't have the robot with me right this second so I don't know if it will maybe say something when I try to download the code.
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #11   Spotlight this post!  
Unread 23-11-2010, 15:23
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: [FTC]: Lag and Teleop (Labview)

I have just finished a revised version of how teleop code. I think I've ironed out most of the problems, but I would like to submit it here for review while I'm waiting on a chance to work on the robot.

The zip file contains the revised version known as 0035 teleopstate.vi plus all the subvis. All of the comments and context help data is up to date, and the front panel contains information the vis.
Attached Files
File Type: zip 0035 teleop.zip (59.8 KB, 32 views)
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #12   Spotlight this post!  
Unread 23-11-2010, 15:47
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,124
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [FTC]: Lag and Teleop (Labview)

Quote:
Originally Posted by iblis432 View Post
I have just finished a revised version of how teleop code. I think I've ironed out most of the problems, but I would like to submit it here for review while I'm waiting on a chance to work on the robot.

The zip file contains the revised version known as 0035 teleopstate.vi plus all the subvis. All of the comments and context help data is up to date, and the front panel contains information the vis.

See attached screen shot.

By saving the vi in LabVIEW9, you have significantly reduced the pool of people who would potentially be willing and able to help you.

Attached Thumbnails
Click image for larger version

Name:	LabVIEW error.png
Views:	36
Size:	5.9 KB
ID:	9438  
Reply With Quote
  #13   Spotlight this post!  
Unread 23-11-2010, 16:02
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: [FTC]: Lag and Teleop (Labview)

my understanding is that 2009 is the only version of labview you are allowed to use in FTC. I know when FTC first started with 8.5, but after that 2009 was what came in the kits. I have both versions on my computer, and if I have time i'll make a similar one in 8.5 if I find we are still having problems, otherwise I will keep the format in 2009 until I have a significant reason to change it.
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #14   Spotlight this post!  
Unread 23-11-2010, 16:34
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,124
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [FTC]: Lag and Teleop (Labview)

Quote:
Originally Posted by iblis432 View Post
if I have time i'll make a similar one in 8.5
See attached screenshot.

You don't have to manually reconstruct the vi in a different version of LabVIEW.

Just use the "save for previous version" menu item from the File drop-down menu.



Attached Thumbnails
Click image for larger version

Name:	save for previous version.png
Views:	26
Size:	5.7 KB
ID:	9439  
Reply With Quote
  #15   Spotlight this post!  
Unread 23-11-2010, 18:55
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: [FTC]: Lag and Teleop (Labview)

I am not allowed to save it for a previous version because I do not have the password to save certain FTC toolkit vis.

The code was just tested on the robot however, and everything is working perfectly. It is all thanks to the suggestions here. Thanks so much.
__________________
"Don't worry, programming can fix it"
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java in RobotC for FTC TeleOp lmnotran Java 3 30-01-2010 19:03
Teleop Lag Xavier Brandall Programming 14 17-03-2009 18:21
Labview Autonomous AND Teleop Two-Face Programming 1 14-02-2009 18:33
[FTC]: Bluetooth lag? Nick 568 FIRST Tech Challenge 5 12-02-2009 07:49
[FTC]: First problem with FTC and LabView.....? PhilBot FIRST Tech Challenge 5 07-11-2008 10:36


All times are GMT -5. The time now is 08:30.

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