View Full Version : Basic LabVIEW Arcade Drive Program
jhellr13
01-02-2011, 20:59
My team is starting to get anxious to drive our robot around to get a feel. We are only slightly experienced with labview, so we need a little help. I was wondering if someone could make a diagram to drive in arcade mode. We have 2 motors for each gear box, thus 4 jaguars. If anyone could help me here, that would be greatly appreciated
Mark McLeod
01-02-2011, 21:20
The default code is Arcade Drive.
It comes setup for 2 motor drive though, so you need to change that.
Create a Default Framework
Open Begin.vi, then the block diagram
Locate the Open 2 Motor icon.
Right-click on Open 2 Motor and go to Replace -> All Palettes -> WPI Robotics Library -> RobotDrive and choose Open 4 Motor
Delete the two PWM settings left over. There's a reason, really.
Add constants for all four input nodes and set them to your other two motors. Okay so you're adding back the two PWMs you just deleted--there really is a reason.
Right-click on each of the PWM inputs, go to Visible Items -> Label and let go. The name of the input will appear and you might want to drag it to the left side of the PWM constant. The reason for deleting the old PWMs was the labels would get updated.
Set the PWMs to match where your 4 motors are.
Create constants for the two Inverted nodes on the bottom of the Open 4 Motor icon.
Set both the motors on one side of the robot be Inverted. If you guess wrong and the robot drives backwards instead of forwards, just go back into the code and reverse which side gets Inverted.
Save, Build & Run as Startup
In the Project Explorer window, at the bottom, you'll see Build Specifications. Expand that and you'll see FRC Robot Boot-up Deployment
Right-click on FRC Robot Boot-up Deployment and choose Build
Turn the robot on and connect to it
Right-click on FRC Robot Boot-up Deployment again and choose Run as startup
jhellr13
01-02-2011, 21:27
Thanks for the explanation, it really helps. Does it matter what the constants are? and also could you just explain the whole pwm thing to me, i am a little confused about them.
Does this default code work with the joystick automatically? If not, how do i configure that?
Mark McLeod
01-02-2011, 21:34
The constants that appear need to be changed, but that's easy.
If you put the cursor over each one 'til it turns into a little hand, then you can left-click and you'll get a list to choose from.
The PWMs are the numbered motor outputs on the Digital Sidecar. They are the white 3-pin contacts that you plug the tri-color PWM cables into. One end of a cable connects to the PWM and the other end connects to a Jaguar (or Victor).
So in the code you're telling it which numbered PWM pins will drive which motor.
The joystick is already setup to drive the robot.
You can look to see how that's all handled in the teleop.vi block diagram.
If you get stuck I can come for a visit. I was just down at Connetquot tonight.
If you have your laptop that's giving you LabVIEW activation trouble I could take a look at that, too.
jhellr13
01-02-2011, 21:38
Great. Thanks for the help
jhellr13
02-02-2011, 13:55
I will probably be able to figure it out. In reference to that labtop, I deleted everything on my computer related to ni and labview. I am gonna get the kop disc and do a clean install
IisMathwizard
02-02-2011, 15:30
did you uninstall NI or personally delete it.
jhellr13
02-02-2011, 21:35
did you uninstall NI or personally delete it.
I uninstalled NI, and did a search for national instruments and labview on my hard drive and deleted the contents
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.