Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Need help with tank drive (http://www.chiefdelphi.com/forums/showthread.php?t=81467)

nickcvet89 29-01-2010 23:02

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.

Mark McLeod 30-01-2010 00:11

Re: Need help with tank drive
 
Double check the names you gave the joysticks in Begin.vi and in Teleop.vi
They may be mixed up.

nickcvet89 30-01-2010 10:34

Re: Need help with tank drive
 
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.

Alan Anderson 30-01-2010 20:44

Re: Need help with tank drive
 
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.

Mark McLeod 30-01-2010 20:48

Re: Need help with tank drive
 
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...:)

zebrabots 02-02-2010 10:12

Re: Need help with tank drive
 
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

zebrabots 02-02-2010 11:17

Re: Need help with tank drive
 
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:


It continues into another screenshot







zebrabots 02-02-2010 11:18

Re: Need help with tank drive
 
Here is the rest





Alan Anderson 02-02-2010 11:28

Re: Need help with tank drive
 
Quote:

Originally Posted by zebrabots (Post 911750)
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...

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?

Joe Ross 02-02-2010 11:50

Re: Need help with tank drive
 
Quote:

Originally Posted by zebrabots (Post 911750)
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...

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

tbuo1 02-02-2010 12:26

Re: Need help with tank drive
 
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!

Alan Anderson 02-02-2010 13:02

Re: Need help with tank drive
 
Quote:

Originally Posted by tbuo1 (Post 911814)
I am trying to get tank drive too, but my .vi files look completely different than the ones showed above.

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.

tbuo1 02-02-2010 13:24

Re: Need help with tank drive
 
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!

Alan Anderson 02-02-2010 15:15

Re: Need help with tank drive
 
Quote:

Originally Posted by tbuo1 (Post 911843)
I think the original .vi that the Zebras used to code was different.

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.)

zebrabots 02-02-2010 15:34

Re: Need help with tank drive
 
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

Joe Ross 02-02-2010 15:42

Re: Need help with tank drive
 
Quote:

Originally Posted by zebrabots (Post 911903)
We put the code on via build under the build specifications tab. We have not tried to click run and see if it works.

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.

zebrabots 02-02-2010 16:35

Re: Need help with tank drive
 
ok thanks for the help we will be sure to try this as soon as we fix our program.


All times are GMT -5. The time now is 22:39.

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