Go to Post I hope that 50 years from now, FIRST is no longer required. - Lil' Lavery [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 24-02-2011, 20:31
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Relay Set Time

How do you make a relay run for a set amount of time, then stop? I want to use this for autonomous. I know how to set it for forward/reverse, but the timing aspect is tricking me up.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2011, 21:45
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Relay Set Time

Look at the frcmastery.com video "Step 5 - Turn on Autonomous Mode". It walks through the default (non game specific) autonomous code, which runs the drive train for certain periods of time. It shouldn't be hard to do something similar for a relay.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2011, 22:15
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Relay Set Time

Quote:
Originally Posted by Joe Ross View Post
Look at the frcmastery.com video "Step 5 - Turn on Autonomous Mode". It walks through the default (non game specific) autonomous code, which runs the drive train for certain periods of time. It shouldn't be hard to do something similar for a relay.
I figure i can try that out. Thanks
Reply With Quote
  #4   Spotlight this post!  
Unread 25-02-2011, 13:24
Arthur But' Arthur But' is offline
Registered User
FRC #2213
 
Join Date: Nov 2010
Location: Israel
Posts: 17
Arthur But' is an unknown quantity at this point
Re: Relay Set Time

Just make a while loop, and stop the loop after a certain amount of time.
The is an example to it in the default project WITHOUT game code.
Also, if you do so, don't use constants at first but controls, because it's much easier to change those numbers in controls because you don't need to send your project all the time.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-02-2011, 13:36
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Relay Set Time

Quote:
Originally Posted by Arthur But' View Post
Just make a while loop, and stop the loop after a certain amount of time.
The is an example to it in the default project WITHOUT game code.
Also, if you do so, don't use constants at first but controls, because it's much easier to change those numbers in controls because you don't need to send your project all the time.
Thanks. I will try that too. I want to use the sensors though. So if a make something with a while loop to raise our arm, where do I put it in the default code WITH game code
Reply With Quote
  #6   Spotlight this post!  
Unread 25-02-2011, 17:25
Arthur But' Arthur But' is offline
Registered User
FRC #2213
 
Join Date: Nov 2010
Location: Israel
Posts: 17
Arthur But' is an unknown quantity at this point
Re: Relay Set Time

Quote:
Originally Posted by jhellr13 View Post
Thanks. I will try that too. I want to use the sensors though. So if a make something with a while loop to raise our arm, where do I put it in the default code WITH game code
Just make a case structure in the auto vi and the first case will be probably the line tracking code, the next case will be the arm and so on....

Also u don't have to use the default line tracking code to work with sensors, i made a much simpler code using only 2 sensors because of some problems that we had with the third sensor, and it works really good.
Reply With Quote
  #7   Spotlight this post!  
Unread 25-02-2011, 17:49
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Relay Set Time

Quote:
Originally Posted by Arthur But' View Post
Just make a case structure in the auto vi and the first case will be probably the line tracking code, the next case will be the arm and so on....

Also u don't have to use the default line tracking code to work with sensors, i made a much simpler code using only 2 sensors because of some problems that we had with the third sensor, and it works really good.
Can you send me your simple version of the line tracking code? I don't really like the default one because of all the different modes it has within. We aren't planning on changing what line we go down like the default code shows. We are probably gonna go down the ones on the side.

Thanks
Reply With Quote
  #8   Spotlight this post!  
Unread 28-02-2011, 12:10
Arthur But' Arthur But' is offline
Registered User
FRC #2213
 
Join Date: Nov 2010
Location: Israel
Posts: 17
Arthur But' is an unknown quantity at this point
Re: Relay Set Time

Quote:
Originally Posted by jhellr13 View Post
Can you send me your simple version of the line tracking code? I don't really like the default one because of all the different modes it has within. We aren't planning on changing what line we go down like the default code shows. We are probably gonna go down the ones on the side.

Thanks
Sorry, i don't have the lab computer on me now, i will try to send the code to u later.
U can create a very simple code using only 2 digital outputs (the sensors) a bunch of cases and a while loop with a stop condition when both digitals are true.
I am working with labview only for 2 month and those are very simple functions.
so i think u can make it, if you think about those functions for a while.

Again... i will try to send you the code soon as i get on the computer, but it will be only in couple of daysץ
Also, there are plenty of teams using only timers in the auto mode and it works pretty good, so u don't really need timers.

Last edited by Arthur But' : 28-02-2011 at 12:31.
Reply With Quote
  #9   Spotlight this post!  
Unread 28-02-2011, 13:39
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Relay Set Time

Quote:
Originally Posted by Arthur But' View Post
Sorry, i don't have the lab computer on me now, i will try to send the code to u later.
U can create a very simple code using only 2 digital outputs (the sensors) a bunch of cases and a while loop with a stop condition when both digitals are true.
I am working with labview only for 2 month and those are very simple functions.
so i think u can make it, if you think about those functions for a while.

Again... i will try to send you the code soon as i get on the computer, but it will be only in couple of daysץ
Also, there are plenty of teams using only timers in the auto mode and it works pretty good, so u don't really need timers.
Can you send me a copy of this code as well? Thanks
Reply With Quote
  #10   Spotlight this post!  
Unread 01-03-2011, 01:42
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Relay Set Time

If you're interested, I've attached a simpler line-following program. I tried to add a ton of comments so that modifying it is easier. PM me if you have any questions.

Note that it has nothing to deal with the Y or the diagonal bits. Also, the robot may not be aligned when it stops, so be prepared to deal with that. We have a mecanum base, so if you need some code for that I can send some your way. It's not very clean though
Attached Files
File Type: vi Tank Drive Autnomous Sample.vi (19.5 KB, 9 views)
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 20:32.

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