Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Labview Invert Motors with Push of Button (http://www.chiefdelphi.com/forums/showthread.php?t=99516)

jhellr13 08-01-2012 16:10

Labview Invert Motors with Push of Button
 
Hey all,

I'm starting to work on the programming for this year's bot on our old robot. We plan on using an arcade drive for the new bot, and the old one also has an arcade drive.

This year we are thinking of having the ability to invert the drive system when a button is pushed. Basically switch forward and back. The system would work where the robot would be operated like normal moving the joystick forward/back/left/right, but when a button is pushed and held down, it inverts the motors swapping forward and backward.

I tried this before by making two of the same drive configurations in the begin.vi, but one having a different name and opposite true/false values on the inverts. Then in teleop.vi, I made a case structure with the joystick on the outside. I took button 7 and wired it to the case structure. When the case was false I put my original drive configuration in, and when true put the new one in. The code ran, but didn't work as planned.

When the button was not held down, and the joystick was moved, nothing occured with the robot. No wheels moving. But when the button was held, the motors spun.

How can I go about doing this? Any help would be greatly appreciated.
Thanks

JBotAlan 08-01-2012 16:21

Re: Labview Invert Motors with Push of Button
 
Might be a good idea to post either the VI in question and/or a screenshot of said VI.

I'm not a LabVIEW guy myself, just noting that we'll need to see what exactly you are looking at.

jhellr13 08-01-2012 17:24

Re: Labview Invert Motors with Push of Button
 
Quote:

Originally Posted by JBotAlan (Post 1099651)
Might be a good idea to post either the VI in question and/or a screenshot of said VI.

I'm not a LabVIEW guy myself, just noting that we'll need to see what exactly you are looking at.

I just left our workplace a little while ago. I can post it sometime tomorrow when I get back there.

Thad House 08-01-2012 17:26

Re: Labview Invert Motors with Push of Button
 
1 Attachment(s)
You would not need to use 2 separate configurations. In the teleop VI, you would put a switch statement between the joystick and the motors. then you would connect a button to the switches. similar to the screenshot below

jhellr13 08-01-2012 17:47

Re: Labview Invert Motors with Push of Button
 
Quote:

Originally Posted by sst.thad (Post 1099705)
You would not need to use 2 separate configurations. In the teleop VI, you would put a switch statement between the joystick and the motors. then you would connect a button to the switches. similar to the screenshot below

That is extremely helpful. But how would I make the button invert the motors?

3p1c w1n 08-01-2012 17:50

Re: Labview Invert Motors with Push of Button
 
Quote:

Originally Posted by jhellr13 (Post 1099727)
That is extremely helpful. But how would I make the button invert the motors?

it looks like in the picture that if the button is pressed (true) that the values coming from the joystick are multiplied by -1.

jhellr13 08-01-2012 17:53

Re: Labview Invert Motors with Push of Button
 
Quote:

Originally Posted by 3p1c w1n (Post 1099730)
it looks like in the picture that if the button is pressed (true) that the values coming from the joystick are multiplied by -1.

Yea I realized that after I replied already. I'll try this tomorrow and let you all know how it works.

Thanks all you guys!

3p1c w1n 08-01-2012 18:00

Re: Labview Invert Motors with Push of Button
 
Quote:

Originally Posted by jhellr13 (Post 1099733)
Yea I realized that after I replied already. I'll try this tomorrow and let you all know how it works.

Thanks all you guys!

please do, this in a great idea and I'm planning on implementing it as well on this years' bot.

jhellr13 08-01-2012 18:02

Re: Labview Invert Motors with Push of Button
 
Quote:

Originally Posted by 3p1c w1n (Post 1099743)
please do, this in a great idea and I'm planning on implementing it as well on this years' bot.

Yea it's a smart idea. My friend thought of it yesterday as it would increase our driving efficiency. It is basically so when we want to pick up balls we can drive in the direction the slot will be rather than driving backwards.


All times are GMT -5. The time now is 01:52.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi