Go to Post Do not interrupt, do not defend yourself - just listen. After they are done, be sure to thank them for their honest feedback, and close the books. Arguing or defending is not how to accept feedback. - DonRotolo [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 21-01-2009, 16:10
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Joystick Button Programming in Labview Help Needed

...Yeah.... okay... Trying to program the joysticks' buttons... More specifically, trying to get a spike/relay to be able to be controlled by a button. (Forward/Reverse would be nice for one, Forward/Neutral/Reverse for the other) so I've looked at just about every tutorial/help guide thing that I could find... At the moment, we have two spikes on our electrical board, one of which, when attached to any of the DIO things it will stay a constant red (reverse) which does run a motor, albeit all the time and only in reverse. Code-wise, here's what I have so far (In attachments). [In the inner-most case structure, the false case is set to a constant of 'Reverse' as I believe you have said to do. Also tried 1 and -1, but to no avail.] Any help or advice would be greatly appreciated. Thank you~
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2009, 16:33
Brdn666's Avatar
Brdn666 Brdn666 is offline
Registered User
AKA: Brandon
FRC #2604 (Metal & Soul)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Capac, MI
Posts: 24
Brdn666 is an unknown quantity at this point
Send a message via Yahoo to Brdn666
Re: Joystick Button Programming in Labview Help Needed

I can tell you how to get the true/false inputs from buttons right now. I'm not at my main computer with labview so I can't tell you everything.
First right click on the white window (memory is bad for me, even at 16). Go to WPI Robotics library. Click on driver station and then joysticks. Place the VI labeled get in your teleop code. There is a pink output on the right side of the VI, called buttons. Right click on that on go to the menu labeled something like cluster, group and such. Go to the one labeled "unbundle" and click on it. There you go! If you hook up the VI like the other joystick VI's, you should be good.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2009, 17:25
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Re: Joystick Button Programming in Labview Help Needed

Ah yes, we have tried this multiple times... the opening of the GET Joystick and then the unbundling of the buttons... Still don't know why it's not working. Have tried to hook up relays and (jaguar controlled) motors to the buttons (in separate files, of course, not both relays and motors at once), and still can't get buttons to work. See attached pictures for what we've tried.
Attached Thumbnails
Click image for larger version

Name:	withmotors.jpg
Views:	450
Size:	116.9 KB
ID:	7188  Click image for larger version

Name:	withrelays.jpg
Views:	342
Size:	109.7 KB
ID:	7189  
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2009, 17:48
DavidAllen DavidAllen is offline
Registered User
FRC #2415 (The Westminster Wiredcats)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Atlanta
Posts: 5
DavidAllen is an unknown quantity at this point
Re: Joystick Button Programming in Labview Help Needed

You have the right idea, but have not executed it quite correctly. The best way would be to make a case statement and pass the boolean into the checker (for lack of a better term). Then you can set the motor speed to whatever amount you wish when it is true, and stop it when it is false.

Here's an image of what I'm talking about:


The question is talked about more here:
http://www.chiefdelphi.com/forums/sh...ad.php?t=70564
Reply With Quote
  #5   Spotlight this post!  
Unread 21-01-2009, 18:00
mgurgol mgurgol is offline
Registered User
FRC #1094
 
Join Date: Jan 2006
Location: St Louis MO
Posts: 76
mgurgol is just really nicemgurgol is just really nicemgurgol is just really nicemgurgol is just really nicemgurgol is just really nice
Re: Joystick Button Programming in Labview Help Needed

Have you tried probing the buttons while the code is running to confirm that you are getting the True/False as you expect?

Can you drive the robot with the Joysticks?
Reply With Quote
  #6   Spotlight this post!  
Unread 21-01-2009, 18:03
Brdn666's Avatar
Brdn666 Brdn666 is offline
Registered User
AKA: Brandon
FRC #2604 (Metal & Soul)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Capac, MI
Posts: 24
Brdn666 is an unknown quantity at this point
Send a message via Yahoo to Brdn666
Re: Joystick Button Programming in Labview Help Needed

I have not used a relay yet. Are you sure that they are wired correctly? In the right slot and whatnot? Also test every relay you have wired.
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 21-01-2009, 20:04
TotalChaos's Avatar
TotalChaos TotalChaos is offline
Registered User
AKA: Austin
FRC #2837 (Freebird Robotics)
Team Role: College Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Gilbert AZ
Posts: 112
TotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud of
Send a message via MSN to TotalChaos
Re: Joystick Button Programming in Labview Help Needed

Ok,

So I finally got a chance to test out the Spikes on our practice base and here's what I've found.

In this other thread I first said you could wire a numerical constant as the input for the Set VI. Then I read that it needed an Enum constant. It turns out I was half right both times.

The input to the Set VI accepts two types of data, numerical constants and enum constants. If you right click on the input node and select Create > Constant it gives you an enum constant (the drop down menu thingy) that has 4 choices: Off, On, Forward and Reverse. My best guess for Off and On is that Off means it's completely off and that On means the brakes are applied. (Though this could be reversed) Forward and Backwards are self explanatory. Now if you're going to use an enum constant inside of a case statement I found out one crucial thing that I didn't know about before. If you make the enum constant from scratch it seems that you have to add all the possible selections and set it to the one you want. (To add options you can right click the enum constant and select "Add item before" or "Add item after") They may also have to be in the correct order. (I didn't test this but the order would be Off, On, Forward, Reverse from top to bottom).

As it turns out, you can also just use numerical constants for inputs as well. They match up pretty simply:
0 - "Off"
1 - "On"
2 - "Forward"
3 - "Reverse"
So if you hooked up a value of 2 to the input it would be the same as hooking up an enum constant with "Forward" Selected.

I hope this clears things up a bit more. If you have any more questions or something I said didn't make sense just let me know!

- Austin
__________________
The 39th Aero Squadron - Team 39! (Visit our website!)
Team Role: 3 Years as Driver - College Student/Mentor!


Freebird Robotics - On a 1 year hiatus! (Visit our website!)
Arizona 2009: Semifinalists! (69 and 498), Delphi "Driving Tomorrow's Technology" Award
Reply With Quote
  #8   Spotlight this post!  
Unread 21-01-2009, 21:47
CPUGenuis's Avatar
CPUGenuis CPUGenuis is offline
Registered User
AKA: Matthew Marshall
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Illinois
Posts: 9
CPUGenuis is an unknown quantity at this point
Re: Joystick Button Programming in Labview Help Needed

we usually stuck to the enums from create.

a note that our team may have not said earlier is that we hooked them to DIO and they had a solid reverse, but we couldn't change it then either. then again, that may just be because it is a constant 0 or something making it go in reverse.....
__________________
it's electrical's fault. end of story.
Reply With Quote
  #9   Spotlight this post!  
Unread 22-01-2009, 12:43
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Re: Joystick Button Programming in Labview Help Needed

@DavidAllen: Hrmmrrr... have tried a few different case statement configurations but perhaps I was not doing them correctly... Will try this when Electrical gives me the board back. > . >

@mgurgol: Probing the buttons? Have definitely pressed like... every button with every combination of code I've ever put into it... and zilch. (And yeah, the joysticks will control the jaguars and we can drive with them, but one set of two jaguars keep going in reverse when we push the joystick -usb slot 2- and we don't know why... Especially since we are only trying to control PWM signals 1 and 2 for the motors... and have deleted all the pre-done driving code in hopes that we could just call the individual PWMs etc on our own just for those two jaguars... and it still wants to control all four for some reason... though that's a separate issue... /rant)

@brdn666: Pretty sure they were wired correctly, though many of our all day 'why can't we figure this out??' problems that have been blamed on programming were actually just a backwards PWM cable... But I'm pretty sure there's no real way to mess up the wiring on these. Just going from the spike directly into the correct numbered relay-slot-thing that I specified in the code, right? When we plugged a spike into any of the DIO-slot-things, it would go in full reverse... which is better than nothing, but we're still looking for a way to make them go forward, neutral, and stop, as well as a way to toggle between these modes (ie. buttons... haha)

@TotalChaos: Hrmrrr... Yeah I was a bit confused on what the difference was between On/Off and Forward/Reverse. We want the CIM motor attached to the spike to be toggle-able from Reverse/Neutral/Forward... So I suppose that'd be Reverse/On/Forward or 3/1/2...? So if we wanted to do this... We'd like... make a case structure thing with three cases (one for each of the states) and then... I guess... Well I suppose the trouble is that I don't know how I would wire a single button to it in order to be able to trigger all three of these states. Mechanical wants it to be neutral until say... button two is pressed (pressed once, not held down... another issue I'm not sure how to do...) and then it would go forward. They also want it to be able to then (with the same button, presumabley) be able to turn the motor in reverse somehow.... yeahh... not sure if that's possible. But if it isn't, I suppose I'd have to do sorta like... two different buttons, one of which will toggle the spike from neutral to forward and one from neutral to reverse...?

Thank you all again for the quick responses and all your help~~~
Reply With Quote
  #10   Spotlight this post!  
Unread 22-01-2009, 14:01
MikeZ MikeZ is offline
Registered User
FRC #0624 (CRyptonite)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Katy, TX
Posts: 21
MikeZ has a spectacular aura aboutMikeZ has a spectacular aura about
Re: Joystick Button Programming in Labview Help Needed

Quote:
Originally Posted by domoarigato View Post
We want the CIM motor attached to the spike to be toggle-able from Reverse/Neutral/Forward...
Remember to keep in mind Rule 54 (A):
<R54>
A. Each CIM motor and Fisher-Price motor must be connected to one Victor or Jaguar speed controller. They must not be connected to relay modules.
__________________
Mike Zanghi
Mentor
FIRST Team 624
CRyptonite Robotics
Reply With Quote
  #11   Spotlight this post!  
Unread 23-01-2009, 12:54
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Re: Joystick Button Programming in Labview Help Needed

@MikeZ: Okee... thanks for the info on the rules about that... Looks like we are probably going to only use one spike now, and attach the CIM to one of the Jaguars...
Reply With Quote
  #12   Spotlight this post!  
Unread 28-01-2009, 10:55
solomason519 solomason519 is offline
Registered User
FRC #0519
 
Join Date: Jan 2009
Location: detroit
Posts: 16
solomason519 is an unknown quantity at this point
Re: Joystick Button Programming in Labview Help Needed

is there a way to program the motor to go forward on button six and reverse on button seven.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming a joystick button... programmr Programming 2 05-01-2009 16:13
programming help needed krunal Programming 3 29-01-2007 00:18
HELP-URGENT PROGRAMMING HELP NEEDED Rohith Surampudi Lego Mindstorm Discussion 1 24-03-2006 23:05
Joystick Button programming Bharat Nain Programming 5 18-02-2005 11:48
URgent Programming Help needed rcubes85 Programming 4 15-02-2005 23:21


All times are GMT -5. The time now is 22:47.

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