Go to Post The robot is never 'done' there is always something that can be done to improve it. - Jonathan Norris [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 14-02-2013, 17:02
BenGrapevine's Avatar
BenGrapevine BenGrapevine is offline
Head Programmer
AKA: Tony Simmering
FRC #2549 (Millerbots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Minneapolis, Minnesota
Posts: 46
BenGrapevine is an unknown quantity at this point
3 Stage Motor Control

How would I go about making a motor that would run forward for a very short period of time, backward that same distance, then stop? We want to have a window motor slide a frisbee into the shooter and quickly retract back so it can slide the next frisbee (which will be falling in place of the previous one, they are in a vertical 4 stack).

Please let me know if that is confusing, thanks.
__________________
Millerbots Team 2549
orange and blue
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2013, 17:41
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: 3 Stage Motor Control

Will there be any feedback sensors on this window motor (such as a potentiometer), or do you want it to run solely on time? If this motor is turning an appendage of some kind, it may be wise to have some form of feedback to avoid over-turning and potentially breaking your arm.

If you want to go ahead with just using time, I can post some code to get you started.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2013, 17:42
BenGrapevine's Avatar
BenGrapevine BenGrapevine is offline
Head Programmer
AKA: Tony Simmering
FRC #2549 (Millerbots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Minneapolis, Minnesota
Posts: 46
BenGrapevine is an unknown quantity at this point
Re: 3 Stage Motor Control

Quote:
Originally Posted by propionate View Post
Will there be any feedback sensors on this window motor (such as a potentiometer), or do you want it to run solely on time? If this motor is turning an appendage of some kind, it may be wise to have some form of feedback to avoid over-turning and potentially breaking your arm.

If you want to go ahead with just using time, I can post some code to get you started.
It's running a very very small appendage so time would do just fine.
__________________
Millerbots Team 2549
orange and blue
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2013, 18:18
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: 3 Stage Motor Control

I've attached some code I created that should do what you're looking for. A few important things about it:

1. The case structure on the left should be in teleop with the case selector wired up to your driver's station input (button I presume).
2. The case structure on the right should be in periodic tasks. I think it would be best to put it here because it will let you feed frisbees into your shooter in autonomous as well with minimum additional code.
3. The "Feed Frisbee" local variable should be a global variable in your code.


The case structure on the right will use the elapsed time (once the button is pressed) to run the motor forward at .5 for one second, then backwards at .5 for one second. It will then return itself to the false case to await another button press.


Edit: I just realized this could be done with less code using a flat sequence. I'm not a fan of them personally, but if you want to take that route, just modify the code in the image below to run your motor for the desired amounts of time.

http://team358.org/files/programming...imedAction.jpg
Attached Files
File Type: vi Motor Forward.Backward.Stop.vi (13.7 KB, 5 views)

Last edited by propionate : 14-02-2013 at 18:24.
Reply With Quote
  #5   Spotlight this post!  
Unread 15-02-2013, 11:15
BenGrapevine's Avatar
BenGrapevine BenGrapevine is offline
Head Programmer
AKA: Tony Simmering
FRC #2549 (Millerbots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Minneapolis, Minnesota
Posts: 46
BenGrapevine is an unknown quantity at this point
Re: 3 Stage Motor Control

Quote:
Originally Posted by propionate View Post
I've attached some code I created that should do what you're looking for. A few important things about it:

1. The case structure on the left should be in teleop with the case selector wired up to your driver's station input (button I presume).
2. The case structure on the right should be in periodic tasks. I think it would be best to put it here because it will let you feed frisbees into your shooter in autonomous as well with minimum additional code.
3. The "Feed Frisbee" local variable should be a global variable in your code.


The case structure on the right will use the elapsed time (once the button is pressed) to run the motor forward at .5 for one second, then backwards at .5 for one second. It will then return itself to the false case to await another button press.


Edit: I just realized this could be done with less code using a flat sequence. I'm not a fan of them personally, but if you want to take that route, just modify the code in the image below to run your motor for the desired amounts of time.

http://team358.org/files/programming...imedAction.jpg
Thanks! I completely forgot about using timed tasks. I'll be sure to check everything out
__________________
Millerbots Team 2549
orange and blue
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 08:56.

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