Go to Post push for what you think is right... just do it in the right way - Andy Baker [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-2012, 16:53
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
Exclamation Motor moving by degree amounts with a button

Hey,

Just a quick question regarding joystick buttons:

How would I make a joystick button so that when it is pressed once it moves a motor in a degree amount (e.g. 45*), then stops?

[ignore if you don't care about why]
We have a door that holds the basketballs from getting into the shooter, (which when the door moves (in a 360* fashion if that makes sense) it lets one ball through) and moving it in increments would be so much easier.
[/ignore]

I can make a motor that is controlled by a trigger where the motor stops when you release it, so I have some exposure to buttons but yeah.

Thanks guys,
Tony

p.s. I've done my research and I haven't really found anything that works.
__________________
Millerbots Team 2549
orange and blue
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2012, 17:01
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,112
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: Motor moving by degree amounts with a button

You'll need some sort of sensor to give you feedback on the position of your door. Use that feedback to stop the motor when it has moved far enough.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2012, 17:35
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: Motor moving by degree amounts with a button

In past years, our team has used a potentiometer for such a task. Have it connected in some way to the shaft of whatever it is you are having your motor turn, then read the voltage output in your code (analogue input). Take a few voltage readings at different degrees, then plot those points in a scatter plot in excel (x values would be the voltages, y values would be the degrees (you can choose what angle is 0 of course). Fit a trend-line to the data, and just incorporate the line's equation into your code. Easy conversion of pot voltage into degrees. There are other sensors that do a similar same thing, such as the encoder. Good luck!

Note: What I described only gives you the current "degree" of the object being rotated. You would need to determine how to take that data and make the motor turn (which way, what speed, for how long, etc)
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2012, 15:15
mtnteam mtnteam is offline
3747 - Programmer
AKA: Steven
FRC #3747 (ChaoTech)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Minnesota
Posts: 30
mtnteam is an unknown quantity at this point
Re: Motor moving by degree amounts with a button

This is exactly what I'm trying to accomplish as well. I've found an example from Team 358's website. I'm going to try it tonight but with a use of a button so ill let you know how it goes.

Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2012, 14:15
mtnteam mtnteam is offline
3747 - Programmer
AKA: Steven
FRC #3747 (ChaoTech)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Minnesota
Posts: 30
mtnteam is an unknown quantity at this point
Re: Motor moving by degree amounts with a button

Here's a thread that i think will help you.

http://www.chiefdelphi.com/forums/sh...d.php?t=102988
Reply With Quote
  #6   Spotlight this post!  
Unread 17-02-2012, 19:26
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: Motor moving by degree amounts with a button

Thanks for the help guys!
__________________
Millerbots Team 2549
orange and blue
Reply With Quote
  #7   Spotlight this post!  
Unread 21-02-2012, 16:00
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: Motor moving by degree amounts with a button

Now that I've thought about it, degree amounts can be measured in time. How would I go about controlling a motor (in seconds) with a button?
__________________
Millerbots Team 2549
orange and blue
Reply With Quote
  #8   Spotlight this post!  
Unread 21-02-2012, 16:38
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: Motor moving by degree amounts with a button

Sorry for the triple post, but I think I may have found what I needed. All I can't figure out is where to find the green arrow in the tan box with the green circle underneath as shown in the picture below.
Attached Thumbnails
Click image for larger version

Name:	ActionOnButtonPress.jpg
Views:	29
Size:	16.9 KB
ID:	12037  
__________________
Millerbots Team 2549
orange and blue
Reply With Quote
  #9   Spotlight this post!  
Unread 21-02-2012, 16:40
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Motor moving by degree amounts with a button

Quote:
Originally Posted by BenGrapevine View Post
Sorry for the triple post, but I think I may have found what I needed. All I can't figure out is where to find the green arrow in the tan box with the green circle underneath as shown in the picture below.
Search the LabVIEW help for "feedback node".


Reply With Quote
  #10   Spotlight this post!  
Unread 21-02-2012, 16: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: Motor moving by degree amounts with a button

Quote:
Originally Posted by Ether View Post
Search the LabVIEW help for "feedback node".


Oh that. I tried using that and all the connections would break when I tried to wire it. I'll keep playing with it, thanks though
__________________
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 11:22.

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