Hi. I basically am learning how to use LabView as i go along, so any help would really be appreciated. I am trying to set up a TeleopTankDrive.vi and a SolenoidControl.vi in hopes of, (obviously,) controlling the robot with two joysticks. I have verified that both joysticks and motors work. Now, here’s my problem. Whichever joystick I have plugged into USB port one on the driver station controls both motors. It should only control one. The other joystick should control the other motor, however, it doesn’t move either motor at all. When I first tried this, I had the second joystick plugged into USB port 2. I thought that maybe the USP port was broken so i tried port 3, however that didn’t fix the problem. I attached my two programs. (Sorry about the quality though, it was too large a file as a .bmp) If you have any further questions about what I’m trying to attempt I will try to explain it better. Again, any help is appreciated. Thanks.
Doc2.doc (79 KB)
Doc2.doc (79 KB)
hi… i haven’t done lab view before however i have done programming in both java and visual basic so i may be able to help. the way it is sounding is that the one controller is getting listened to but the other is not. As a means to help u create a small section of programming that will let you see the data as it is going through along specific points. you can use that to figure out where the second controller is getting lost. it is also possible that both of them are imputing into the program however due to the way it is set up it uses only the data received from the first controller for both motors. Also another thing you should try is not to use the first port at all and try it on the 2nd and 3rd ports and see what happens.
If you are using the default code, check the trim tab on the fwd-aft axis on the joystick that is working. It will probably be at one end or the other of its travel. Slide the trim tab to the other end and things will probably work the way you want.
This feature is written into the program to enable teams to try different control configurations with minimal effort, but it is easy to forget it is there. On Saturday we spent 20 miutes trying to figure out why one side of the robot wasn’t working. Finally somebody remembered to check the trim tab and fixed it. It was only about the third time this happened, so maybe next time we will remember.
It is hard to see in the graphic, but it looks like the second joystick is actually on USB 3. So your description of your configuration and the picture of the code seems to disagree.
By the way, be sure to reset the DS if you unplug/plug USB devices.
Greg McKaskle
On both joysticks you will see a lever/switch right below it, when moved all the way up i believe it allows you to move that joystick, when moved down it will do the same thing, try centering both those levers/switches, this allows you to move both motors at the same time. Being that you’re just learning i feel that would make it alot easier for you since you wont have to program it in. The down side of this of course is that whoever may be driving might accidentally bump the switch and disable one motor ( that could easily be fixed by just centering it again but why the hassle) Hope this helps.:rolleyes:
Are you saving that particular bit of code as a separate .vi, or is it a part of the Basic Robot Main.vi ? I know that the latter has a built in arcade-drive code, which might be superseding your code if you’re deploying the entire project to the cRIO, especially with the “Stop” command in the lower right of the while loop set to “Always True”
I’d try changing that constant “True” to an indicator, changing USB 3 to USB 2 as Greg suggested, and deploying just that VI to the cRIO using the run button. If it works under those circumstances but not under a full deployment, you’re probably going to have to go into the Robot Main vi and take out the default drive code (or even better, integrate the code you’ve written into the Robot Main!)
Hope this Helps
Thanks everyone. It works now! One of my problems was the USB 3 thing, and the main problem was what surferacf talked about. Thank you very much!