Need help with tank drive

I need some help with my tank drive code, I originally took the default code that was provided and changed all of the vi’s for tank drive in the tele-op vi. In the begin I placed the second joystick function. We kept the 2 motor vi because we have one motor driving one side and another driving the other side. Now the problem I am having is that when I run the code, when I push Joystick 1 both left side motor and right side motor are moving, but when I push Joystick 2 nothing happens. I checked that everything is plugged in and that the Joystick is in the right usb port. If I need to provide anymore information, just let me know.

Double check the names you gave the joysticks in Begin.vi and in Teleop.vi
They may be mixed up.

Now do u need to add a second joystick read in the tele-op vi, because the code shows a broken arrow without it there? Because the second get axis is not hooked up.

Arcade drive uses the X and Y axis from one joystick. Tank drive uses the Y axes from two joysticks. You definitely need to have two different Joystick Get vi blocks, one for the reference to each joystick, and each followed by an unbundle by name to get the Y axis. The two values go to the inputs of the Tank Drive vi.

Don’t use the stock Joystick Read vi to get your Y values. It only looks at one joystick. You can ignore it, or you can open it up and modify it to read your two joysticks.

In teleop.vi the inner “False” case Tank Drive icon needs wires running from:

  • a Joystick 1 Get Axis 2 (y)
  • a Joystick 2 Get Axis 2 (y)
    You don’t need to wire the x axis anywhere.

See if any of this helps any.

P.S. What Alan said…:slight_smile:

We are also having problems with our robot… When we download our program (which is tank drive) it only uses one joystick… Do you have an idea how we can fix this…

Thanks for your help Zebrabots

Thanks for the reply… I am sorry that the pictures wont fit one to one screen shot because i have to swich computers…

Here they are:

http://funkwebdesigns.com/FIRST/First%20images/begin%20bottom.jpg
It continues into another screenshot
http://funkwebdesigns.com/FIRST/First%20images/finish%20bottom.jpg

http://funkwebdesigns.com/FIRST/First%20images/begin%20top.jpg

http://funkwebdesigns.com/FIRST/First%20images/finish%20top.jpg

Here is the rest

http://funkwebdesigns.com/FIRST/First%20images/teleop%20top.jpg

http://funkwebdesigns.com/FIRST/First%20images/teleop%20bottom.jpg

How does the robot behave when you move the joystick in various directions?
How are you downloading it?
Have you tried clicking the “run” arrow on the Robot Main vi and using probes to see what values are being fed to the Tank Drive inputs?

Out of curiosity, have you installed the mandatory LabVIEW Update 2.0?

Hi everyone!

I am trying to get tank drive too, but my .vi files look completely different than the ones showed above. What did I do wrong? I installed the Update2.0 according to the instructions online. Please help!

Thank you!

The code posted by zebrabots has had a lot of things changed and added from the default project. Don’t worry if yours doesn’t end up looking at all like it.

I think the original .vi that the Zebras used to code was different. When I read other peoples posts, it seems as though they are using a different version or framework than I have. My original teleop.vi looks like this:

http://decibel.ni.com/content/thread/5882?tstart=0

(the picture at the bottom)

My other .vi Team Code, such as begin.vi, are different than ones I’ve seen people post about as well. I’m new to LABVIEW and I am not sure what is going on, haha.

Thanks for your help!

It looks to me like it started out with exactly the same structure, but has had most of the guts removed and replaced with the team’s own code.

Your picture on the NI site looks like what I remember as an unmodified default Teleop vi. (The comment about button 2 next to the Gyro Reset block doesn’t match what I think the code actually does, but I don’t know whether my memory is playing tricks on me or not.)

The joystick acts as though it was in arcade mode and only used one joystick.

Do I not have the most updated version??? My partner says that he has updated it.

We put the code on via build under the build specifications tab. We have not tried to click run and see if it works.

Thanks for the quick responses everyone.
I am sorry that I have not been able to get back on sooner because of school.

Zebrabots programmer TyAdley

Build only compiles the program on your local PC. You need to click Run as Startup to download it to the cRIO (both are required each time you change anything). Alternately, for debugging, you can click the run button in Robot Main.

ok thanks for the help we will be sure to try this as soon as we fix our program.