FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Emergency help needed for button actuating a spike

I have finally gotten all the communications working, and can run the robot in arcade mode.  i have deployed code successfully.  my real question is this - we are trying to wire a spike, off the realy side of the digital sidecar, to be actuated with a push of the button on the joystick.  I can't find where to convert the button input into something that can actuate the spike (and in turn trip the compressor to kick the paddle out).  Can anyone help me -  i am familiar with labview, I just have problems with the finer points.  and we travel to minneapolis for competition on the 30th.  so, no rush or anything.  Acutally, this is the last thing i need to work out to have us ready for any sort of competition.

Thanks for your help in advance.

Bobby

0 Kudos
Message 1 of 5
(8,639 Views)

Take a look at the examples, there's probably one that will get you close.  Under Help, open Find Examples, choose "By directory structure" and look in the FRC folder.  There's an example for the compressor showing how it should be wired (both electrically, and in LabVIEW).  It uses buttons on the front panel to trigger the solenoid, but it should be clear how to connect a joystick button instead of a front-panel button.

I'm assuming here that you don't actually want a button on the joystick to turn the compressor on and off, but rather to switch a valve.  You need to wire the compressor as instructed, using a pressure switch wired to a digital input to turn the compressor on and off.  If you were to connect the compressor directly to a kicker piston it wouldn't work well, because the piston would extend very slowly as the compressor built pressure.

0 Kudos
Message 2 of 5
(3,375 Views)

I had the same problem when I tried to figure out how to activate a solenoid from a button on a joystick.  The examples were all activated from the front panel.  I think you are having a similar problem.  I was able to call ni and one of the engineers was able to walk me through it very quickly.  Unfortunately, those phone lines have been severed by "the man" so we are at the mercy of this forum.  The engineers are pretty good at reading them and helping out though.

As best as I can tell, here is your solution, keep in mind that I am pretty new to this stuff too. 

•  On the left side of the "while" loop you need 'open relay" vi (I had to put and open solenoid vi there).  Inside the while loop put a "set relay" vi.  Outside to the right place a "relay close "vi.  On the relay open vi, choose to add a constant by right clicking over its inputs.  Here you should be able to assign it to relay output 1,2,3,4 etc (the great thing about Labview is that you are limited to only choices that actually work).  Wire the Devref output  of the Open relay vi to the devref input of the set relay (inside the while loop) and then wire the devref output of the set relay to the input of the close relay vi outside the while loop.

•  Assuming that you wish to activate the relay from a button on your joystick, on the left side of the while loop place a "joystick open" vi (it does not matter whether you already have and open joystick vi there even if it is for that joystick).  On the left side of this vi, there is a place where if you hover over it with the mouse and right click the mouse you can choose "add constant."  This allows you to assign the joystick to USB 1, 2, 3 or 4.

•  Inside the while loop on the right side of the "joystick get" vi there is an output that you want to wire to an "unbundle by name" vi.  This vi is located on one of the pallets of the WPI library but at this point I don't really remember where it is or exactly how to wire it to the output of the "joystick get" vi.  From the unbundle by name you should be able to pull out the button that you want to assign to the relay (once again this part is fuzzy to me.).  Then from the this button assignment you connect a wire to the left side of the the "set relay" vi. 

•  Connect the devrefs of the joystick and you should be in business.

I am including the file of my program which uses three joysticks to operate three motors with the third joystick's buttons assigned to solenoids.  Take a look at it, I think what what you need to do is very similar to what I had to do with the solenoids.

good luck

0 Kudos
Message 3 of 5
(3,375 Views)

Hello Bobby,

Both of the two previous posts gave you some pretty good options.  It just so happens that I will be at the Minneapolis Regional Competition and will be happy to help you in person if it still isn't working.

However, please feel free to post back here if you need anything more than what you have already been given and I can start working with you here as well.

Thanks!

Bob H

NI FIRST Support

Thanks!
Bob H
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,375 Views)

Bob,

Thanks for your offer - I am the programmer for Team 3227, and I still have the Classmate PC - so I can try to program the code.  Unfortunately, in my zeal to get the button to activate the valve, I somehow corrupted the Teleop.vi!  I have managed to completely hose our robot brains.  I will most ceratinly be looking out for you at the regionals.  Thanks again for the ofer of help.

Bobby McVay

Team 3227, Medtronic Mentor

0 Kudos
Message 5 of 5
(3,375 Views)