Go to Post To limit FIRST to robots, tools, and competition is to strip away its immense potential. - Madison [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 11-02-2011, 10:09
mitchftw903 mitchftw903 is offline
Registered User
no team
 
Join Date: Feb 2011
Location: nevada
Posts: 11
mitchftw903 is an unknown quantity at this point
Autonomus timed tasks

I need to control motors for certain amounts of time. Like drive motors for two seconds, then arm motors for 3, etc. How do I do this in labview?
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2011, 10:21
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,372
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Autonomus timed tasks

This can easily be achieved with a state machine. Check out FRCMastery.com for a really helpful tutorial on how to set this up.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2011, 10:58
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: Autonomus timed tasks

Quote:
Originally Posted by billbo911 View Post
This can easily be achieved with a state machine. Check out FRCMastery.com for a really helpful tutorial on how to set this up.
A state machine is only necessary if your code needs to run very quickly and exit, and then run again the next loop, for example if it's being run in telop. That's not necessary for autonomous independent, because that code doesn't need to exit. State machines are great tools, I just wouldn't apply one in this situation.

Look at the frcmastery 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 to add arm control.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2011, 10:59
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Autonomus timed tasks

If you really want to do different things based only on elapsed time, the easiest tool to use is probably the Flat Sequence. It looks like a movie timeline. Each frame in the sequence will run in turn after the previous frame has completed. If you place a simple Wait function in a frame, that frame will complete only after the specified time has elapsed.

The motor safeties will shut down the outputs if you don't keep setting a value continuously, so you need to either find a way to loop inside the frame to keep them happey, or just disable or lengthen the safety timeout.
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2011, 12:10
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,372
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Autonomus timed tasks

All three of these options are workable solutions to the task at hand.
I'll acknowledge, as Joe pointed out, that a state machine may not be the most convenient way, but depending on how you trigger state changes, it is actually a very useful and effective way to program autonomous. In fact, last year we had four different autonomous modes, each was it's own state machine. It worked great.

Joe's suggestion to follow the "Step 5 - Turn on Autonomous Mode" on FRCMastery.com is an excellent and simple way to make autonomous work.
Alan's suggestion to use a Flat Sequence is almost exactly the same approach as the timed loops show in Joe's suggestion, just implemented a slightly different way.

Learn all three methods and you will be prepared for almost any Autonomous challenge, and many other challenges as well.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
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:29.

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