Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Reducing Maximum Drive Speed Through Drive VI (http://www.chiefdelphi.com/forums/showthread.php?t=101748)

kully kekaula 02-02-2012 00:12

Reducing Maximum Drive Speed Through Drive VI
 
I'm a first year programmer so I might have a lot of wrong ideas and false concepts of how to execute this but please bear with me :)

So my team wants to implement two individual drive systems: One to use on the bridge in which the bot's maximum speed is reduced to 1/3 the maximum speed for easier control, and another which is used normally on the field that will be run at full speed. The reason why I need two individual drive systems is that on the field we want to use a holonomic drive system for control, but on the bridge we want to use a tank drive, with the tank drive driving at 1/3 speed. We're planning on using an Xbox controller for the holonomic drive, one joystick for forward/backward and turning, and another for strafes. For the tank drive, we want to use a joystick that will be forward/backward and turning constituting the tank drive.

Now this leads me to two questions. How might I reduce the maximum speed of the drive systems in only ONE of the drive systems and will both drive systems work cooperatively if executed within the same teleop.vi?

Thanks for any help!

Cecil 02-02-2012 00:57

Re: Reducing Maximum Drive Speed Through Drive VI
 
To reduce the speed to 1/3 power, simply take the joystick axis and divide it by .66. this will scale the joystick to only output a third of its normal power. For the 2 drive systems, i would assign a joystick button to where, when held down, would change a case statement to use the tank drive code, and when it is released, use the normal holonomic code.

kully kekaula 03-02-2012 21:38

Re: Reducing Maximum Drive Speed Through Drive VI
 
How exactly would something like that look? I currently have it where, in teleop, it opens the joystick and unbundles the buttons that control the case statement. Inside the case statement would be the normal teleop code for a drive system, including getting the motors and joystick and connecting them to the tank drive vi. Would something like that work? Thanks

Ether 03-02-2012 21:39

Re: Reducing Maximum Drive Speed Through Drive VI
 
Quote:

Originally Posted by Cecil (Post 1118290)
To reduce the speed to 1/3 power, simply take the joystick axis and divide it by .66.

Take a second closer look at that sentence.


kully kekaula 03-02-2012 22:09

Re: Reducing Maximum Drive Speed Through Drive VI
 
Im sorry, I should've clarified. I've gotten the reduction of speed to work but now I am confused as how to execute the two different drive systems.

Cecil 03-02-2012 23:44

Re: Reducing Maximum Drive Speed Through Drive VI
 
Quote:

Originally Posted by Ether (Post 1119513)
Take a second closer look at that sentence.


Oh wow.. I need to go back to math class.. I'm sorry.. multiply it by .33…… :ahh: -insert blushing emoticon here-

Cecil 03-02-2012 23:46

Re: Reducing Maximum Drive Speed Through Drive VI
 
Quote:

Originally Posted by kully kekaula (Post 1119511)
How exactly would something like that look? I currently have it where, in teleop, it opens the joystick and unbundles the buttons that control the case statement. Inside the case statement would be the normal teleop code for a drive system, including getting the motors and joystick and connecting them to the tank drive vi. Would something like that work? Thanks

You don't necessarily have to put the entire thing inside that case statement. Call the motor refnum and joystick refnums outside, and have one side that passes straight into the tank drive for one side (so there is only the tank drive vi in the statement), and on the other side, have the same thing, only with your math statement too to scale it down.

kully kekaula 04-02-2012 01:31

Re: Reducing Maximum Drive Speed Through Drive VI
 
Okay, thank you very much Cecil! :) And no worries, I figured out what you meant by divide .66. I just substituted it for dividing by 3.


All times are GMT -5. The time now is 11:34.

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