Go to Post I'm excited. Probably too much, but eh, I'm a big geek. - Brandon Martus [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 18-02-2014, 09:14
apm4242 apm4242 is offline
Registered User
FRC #4242
 
Join Date: Jan 2013
Location: United States
Posts: 88
apm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant future
HELP: 2 Motors 1 Button in LabVIEW

Hi

We are trying to program 2 motors to run in only one direction when a single button is pushed. We have tried a couple of different things with the code but nothing seems to be working. We get no response from either motor.

I have attached pictures of the code we tried. When using buttons 2,3,4, & 5 to run the motors in forward and reverse separately, everything works fine. Any help would be greatly appreciated.

Click image for larger version

Name:	photo 1.JPG
Views:	41
Size:	738.9 KB
ID:	16305
Click image for larger version

Name:	photo 2.JPG
Views:	23
Size:	698.0 KB
ID:	16306

We used the method outlined by Team 358 here:
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2014, 09:38
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: HELP: 2 Motors 1 Button in LabVIEW

The issue is, you have multiple values going into those motors at one time. If button 4 is not pressed and the trigger is pressed you are feeding both a value of 0 and a value of -1 into x motor at the same instant. You'll need to set the code up so you only have one set for each motor being used at any given time.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2014, 09:41
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: HELP: 2 Motors 1 Button in LabVIEW

In both pictures, you are trying to set each motor to two different values at the same time (having two MotorSet vi's for each motor). This causes the cRio to have to choose between the two values you're sending but it gets indecisive and doesn't cooperate. Condense your code down to only using one MotorSet for both of them and it should work.
__________________
Per Audacia Ad Astra
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2014, 09:56
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: HELP: 2 Motors 1 Button in LabVIEW

It is good LabVIEW programming practice to absolutely never use more than 1 motor set for a given motor that can execute concurrently. It creates race conditions where you have no idea which one is being set.

As the others have said - get rid of your multiple sets and use one for each motor.
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2014, 10:23
apm4242 apm4242 is offline
Registered User
FRC #4242
 
Join Date: Jan 2013
Location: United States
Posts: 88
apm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant futureapm4242 has a brilliant future
Re: HELP: 2 Motors 1 Button in LabVIEW

Thanks for the replies! That makes perfect sense.

Would it work if we wired button 1 to the green wires for buttons 2 and 4? Essentially having 2 buttons going into a single T/F operator.

I don't have the code in front of me or I would just try it.
Reply With Quote
  #6   Spotlight this post!  
Unread 18-02-2014, 10:24
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: HELP: 2 Motors 1 Button in LabVIEW

Delete the second pair of Motor Set functions. Use boolean OR functions on the button values to make multiple buttons able to activate the motor. I'm sorry, I don't have LabVIEW handy in order to show you an example.
Reply With Quote
  #7   Spotlight this post!  
Unread 18-02-2014, 10:25
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: HELP: 2 Motors 1 Button in LabVIEW

Quote:
Originally Posted by apm4242 View Post
Thanks for the replies! That makes perfect sense.

Would it work if we wired button 1 to the green wires for buttons 2 and 4? Essentially having 2 buttons going into a single T/F operator.

I don't have the code in front of me or I would just try it.
I like Alan's solution.
Reply With Quote
  #8   Spotlight this post!  
Unread 18-02-2014, 10:29
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: HELP: 2 Motors 1 Button in LabVIEW

Just move that bottom Select up and add it as a third Select to each of the previous cascades for the x & y motors.
You can add as many Selects as you have buttons.
Attached Thumbnails
Click image for larger version

Name:	Multiple buttons.png
Views:	31
Size:	23.6 KB
ID:	16309  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 18-02-2014 at 10:40.
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:16.

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