Go to Post ...your stress reliever is a ziptie with the end cut off so you can pull it straight through. It really works! - Storcky [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-05-2010, 11:08
WIllowSquID WIllowSquID is offline
Registered User
FRC #1877
 
Join Date: Feb 2010
Location: georgia
Posts: 8
WIllowSquID is an unknown quantity at this point
button activation for motor

We are trying to program two motors in labview to run by pressing buttons on the joystick.

can anyone help us out?
  #2   Spotlight this post!  
Unread 17-05-2010, 11:22
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: button activation for motor

Please describe in detail exactly what you want to do. The more information you give about your goal, the more helpful will be the answers you receive.

What kind of motors? Which way do you want them to turn? Are the motors completely separate, or does the action of one depend on the action of the other? Will you be wiring the motors to a Spike, a Victor, or a Jaguar? Which joystick buttons do you want to use? Do you want them to run only while the buttons are pressed and stop when the buttons are released, or will you have a "start" button and a "stop" button? As you can see, there are a lot of things that will make a difference. Pin them down for us and we can give you plenty of useful advice.
  #3   Spotlight this post!  
Unread 17-05-2010, 12:55
WIllowSquID WIllowSquID is offline
Registered User
FRC #1877
 
Join Date: Feb 2010
Location: georgia
Posts: 8
WIllowSquID is an unknown quantity at this point
Re: button activation for motor

Well, we can use any buttons, but we think it simple enough to go with buttons numbered one and two.

The goal of this is to have two motors, which are attached to wheels (for a total of two separate motors and two separate wheels), spin and launch a soccer ball, similar to those tennis ball launchers.

We want the buttons set up so that the motors activate when button #1 is pressed, and then continue running until button two is pressed.

The motors (CIM motors) are directly attached to the wheels (no chain or anything) and need to spin in opposite directions.

We will be wiring them to jaguars.
  #4   Spotlight this post!  
Unread 17-05-2010, 13:18
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: button activation for motor

What happens if button 2 is pressed before button 1? What happens when button 1 is released? What happens when button 2 is released? What happens when button 1 and button 2 are pressed at the same time?
  #5   Spotlight this post!  
Unread 17-05-2010, 13:57
WIllowSquID WIllowSquID is offline
Registered User
FRC #1877
 
Join Date: Feb 2010
Location: georgia
Posts: 8
WIllowSquID is an unknown quantity at this point
Re: button activation for motor

Well, pressing number 2 only stops the motor. if it isn't started already, then nothing happens. nothing is initiated from the releasing of button 1. its just the pressing that activates the motor. same thing with button number two, except with stopping it. when they are pressed at the same time, well i hadn't figured that in so i don't know.
  #6   Spotlight this post!  
Unread 17-05-2010, 16:03
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: button activation for motor

It sound like a simple "State Machine" will do the trick.
Default it so that a "0" value is sent to both Victors. Then when button 1 is pressed, a 1 is sent to one victor and a -1 is sent to the other. Have this second state look for button 2 to be pressed. If 2 is not pressed, it stays in this state. Once button 2 is pressed, it switches state back to the first, default, state.

The last bit of logic you might want to apply is to prevent the pressing of both buttons 1 and 2 at the same time from causing a problem. To do this, place an AND gate in line with button 1, then put an inverter between button 2 and the second input on the AND gate. The output of the AND gate will go into the state machine as the button 1 input.
__________________
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
  #7   Spotlight this post!  
Unread 18-05-2010, 09:54
WIllowSquID WIllowSquID is offline
Registered User
FRC #1877
 
Join Date: Feb 2010
Location: georgia
Posts: 8
WIllowSquID is an unknown quantity at this point
Re: button activation for motor

well we aprieciate all the help, but we need to know what labview will look like to make this work.
  #8   Spotlight this post!  
Unread 18-05-2010, 10:46
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: button activation for motor

Quote:
Originally Posted by WIllowSquID View Post
well we aprieciate all the help, but we need to know what labview will look like to make this work.
Do you know how to read the state of a joystick button?

Do you know how to set the speed of a motor connected to a Jaguar?

Do you know what a Case block is in LabVIEW?

What program will you be starting with? Will this program need to do anything besides controlling the two motors?
  #9   Spotlight this post!  
Unread 18-05-2010, 10:57
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: button activation for motor

Quote:
Originally Posted by WIllowSquID View Post
well we appreciate all the help, but we need to know what labview will look like to make this work.
Along the lines of what Alan suggested... it is much more valuable for you to learn the process than it is for us to give you the answers. Don't get me wrong, I will help in any way I can, but for now I would prefer to point you to sources where you can learn the processes.
Let's start off with my favorite site for learning LabView from an FRC perspective. There are a couple different links into the site that work, but this is my favorite. This is on the LVMastery web site.

I'll bet by the time you run through the first 14 lessons, you will be able to answer your own question. Do your self a big favor and don't stop after #14, finish them all. It will be well worth your time.
__________________
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
  #10   Spotlight this post!  
Unread 20-05-2010, 13: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: button activation for motor

Assuming the answers to the first three questions I posed a couple of posts ago are all "yes":



Open the joystick and both motors in the Begin vi, giving them useful names with RefNum Set functions. Close them all in the Finish vi.

Put two Case blocks in the Teleop vi.

Wire the "Buttons" output of a Joystick Get to an Unbundle By Name and choose the two buttons you want to use.

Wire the state of the first joystick button to the selector terminal of the first Case block. Inside the "True" case, set both motors to run at the desired speed. Leave the "False" case empty.

Wire the state of the second joystick button to the selector terminal of the second Case block. Inside the "True" case, set both motors to stop. Leave the "False" case empty.



This will do exactly what you asked for, including the part about not being sure what happens when both buttons are pressed simultaneously.
  #11   Spotlight this post!  
Unread 21-05-2010, 10:22
WIllowSquID WIllowSquID is offline
Registered User
FRC #1877
 
Join Date: Feb 2010
Location: georgia
Posts: 8
WIllowSquID is an unknown quantity at this point
Re: button activation for motor

Thank you so much this helped tremendously.
  #12   Spotlight this post!  
Unread 21-05-2010, 10:36
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: button activation for motor

Quote:
Originally Posted by WIllowSquID View Post
Thank you so much this helped tremendously.
That is exactly why we are here. Please feel free to ask if you need any additional help.
__________________
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
Closed Thread


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
Joystick Button Motor!!! HELP!!! furiousgeorge Programming 3 07-02-2009 22:57
using a switch/button to turn on a motor smcmahon NI LabVIEW 3 26-01-2009 18:42
How do I Link a (group of) Joystick button(s) to a motor? CardcaptorRLH85 C/C++ 2 22-01-2009 23:23
Reset Button for Vex RC's irishninja FIRST Tech Challenge 5 18-06-2006 15:56
White Paper Discuss: Approx. Motor Spec for Taigene Motor Joe Johnson Motors 2 22-01-2005 16:36


All times are GMT -5. The time now is 23:54.

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