Go to Post I'm not the programmer, thank god. - Veselin Kolev [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 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
  #2   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
  #3   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,101
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
  #4   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
  #5   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,101
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
  #6   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
  #7   Spotlight this post!  
Unread 24-11-2010, 00:07
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,

I went through your code and pointed out a few changes that will further boost speed. Mainly, I edited one your subvi's to avoid the use of waits. Function is unchanged and details are on the block diagram. Caveat: This code is untested!

BTW, nice use of LabVIEW's documentation features. In my experience, very few teams use them.

Best regards.
Attached Files
File Type: zip Team 35 edited.zip (64.0 KB, 28 views)
Reply With Quote
  #8   Spotlight this post!  
Unread 24-11-2010, 00:21
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,887
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)

I must say, I was not expecting such a strong response from the CD community. I am humbled by such Gracious Professionalism :-). We shall endeavor to pay it forward.
__________________
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 : 24-11-2010 at 00:23. Reason: grammer/spelling
Reply With Quote
  #9   Spotlight this post!  
Unread 24-11-2010, 20:12
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)

The robot locks up with your edits, I have a few ideas why: you placed a while loop in my subvi, since this vi was in another while loop, it could be causing the lockup. You also had all the state numbers minus 1. so you had state 1 always going to 1, 2 always going to 2, so they never moved forward. Otherwise, I completely understand all of your comments. The switcher was not something I had thought about, but is certainly something I'll remember. As for the shift registers, in FRC I always use them, but they are a bit of a pain in FTC because the only structure that supports them is while loops, and those cause the robot to lock up if you place them inside of each other. In FRC I just use a for loop where n = 1. it's true i could have the state and timer values go in and out of the subvis as controls and indicators, and use the entire teleop while loop for the registers, but by that point it's more ugly than it's worth, considering it gives a milisecond reduction in lag. Plus although we did have those counters in there, they didn't seem to freeze anything up when we tested running the arm and the drivetrain at the same time. And finally, I had my suspicions about the usefulness of the hz limiter, and you finally confirmed it.

While I'm reverting back to my version of most of the code, I still must thank you, I learned a lot from your edits that can be used in FRC.
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #10   Spotlight this post!  
Unread 24-11-2010, 22:00
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,

As you state, there is a problem with my case numbering and this is causing the hang. Oops. There may be other errors as well.

The while loop, however, is not an issue. At first glance it looks like it will cause a stall but that is not the case. A false constant is wired into the "continue if true" conditional terminal. This has the same effect as using a for loop with n=1. For further information:

http://zone.ni.com/devzone/cda/epd/p/id/356

Best Regards
Reply With Quote
  #11   Spotlight this post!  
Unread 24-11-2010, 22:41
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: 747
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 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.
Hi

Looks much better now.
Some suggestions:

1) You should put a small time delay in the lower control loop (maybe 25mS). This will prevent the arm control loop from hogging all the spare CPU cycles when it's not doing anything.

2) Your "Enable" logic is not quite right. You don't want to be exiting the arm control loop based on the enable flag. Both loops should run forever (FALSE wired to terminator), but the Enable indicator should be set by the Robot Driving Case Structure (True if driving, False if disabled). Then if you want to use this indicator to also disable your arm control (good programming practice), then put a case structure in your arm loop to do-nothing if the "Enabled" local variable is false.

3) Your Button 5 code turns on the NXT motor if the button is pressed, but doesn't turn it off when the button is released....

Hope this helps.

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

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #12   Spotlight this post!  
Unread 25-11-2010, 09: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)

Yes, I see now, I thought it was a true statement the first time I saw your while loop.

And yes, I am aware the motor stays on, it was intentional for our purposes. Just putting the motor on break was causing the motor to still be moved at least far enough that batons would escape, so we have it continue moving until we need to open it back up. I'm experimenting with alternative so that we don't burn up the lego motor.
__________________
"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 13:06.

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