Log in

View Full Version : So i have another problem >.<


JohnFogarty
18-01-2010, 18:55
Thanks to all who helped me with the earilier cRIO Not Working Post. I set up the Robot Project as the startup and it worked my only problem now is one joystick is controling both motors. And if i'm reading the program i made correctly it should be Right joystick controlling PWM 1 and Left controlling PWM 2 Right now it is doing only the right stick controlling both. Moving the stick forward moves 1 back and 2 forward, moving the stick back moves 1 forward and 2 back, moving it left goes both reverse, and moving it right makes them both go forward. I am trying to acheive Tank drive. If anyone has a program they could send me it would be immensly helpful.

mikelowry
18-01-2010, 19:01
Are you using c++?
It's been a while since I did anything with the code, but if you post yours then I can tell you what is wrong with it.

JohnFogarty
18-01-2010, 19:10
My bad i forgot to mention i'm using LabVIEW xD

Zorkinian
18-01-2010, 19:46
If you post a picture of the code in question, we might be able to help you out. =]

JohnFogarty
18-01-2010, 20:37
http://i810.photobucket.com/albums/zz25/FRCOMG/V.png

http://i810.photobucket.com/albums/zz25/FRCOMG/Win.jpg

http://i810.photobucket.com/albums/zz25/FRCOMG/Teleop_vifrontpanel.jpg

Alan Anderson
18-01-2010, 20:37
Thanks to all who helped me with the earilier cRIO Not Working Post. I set up the Robot Project as the startup and it worked my only problem now is one joystick is controling both motors. And if i'm reading the program i made correctly it should be Right joystick controlling PWM 1 and Left controlling PWM 2 Right now it is doing only the right stick controlling both. Moving the stick forward moves 1 back and 2 forward, moving the stick back moves 1 forward and 2 back, moving it left goes both reverse, and moving it right makes them both go forward. I am trying to acheive Tank drive. If anyone has a program they could send me it would be immensly helpful.

What you describe sounds like you've got Arcade Drive with the right motor running inverted from how it's supposed to be. That suggests that you aren't deploying the code that you posted pictures of.

JohnFogarty
18-01-2010, 20:57
Yeah that's what i thought, but i went back and this is the code it deploys. idk i'm quite confused

Gary.C
18-01-2010, 21:06
Seems like you have the joysticks on arcade mode. Well on the joysticks there should be a little knob type thing. The manual says to move the z wheel on the joystick down to the [-] on both. Move the z wheel to the [+] for arcade. I had the same problem for a minute or two and then I realized you had to move the z wheel.

Joe Ross
18-01-2010, 23:26
One thing to keep in mind is that telop.vi is called 50 times a second by robot main. Thus, 50 times a second you are opening robot drive. If it works at all, I'd expect a lot of error messages in the diagnostics window of the driver station.

If Robot Drive VIs are only going to be used in telop, you could open robot drive in the init case of telop.vi and use feedback to save the device reference. However, this becomes cumbersome if you have a lot of devices, or if you want to access them other places (such as autonomous).

The better thing to do is put your open in begin.vi, and then set the device reference. In telop.vi, you can get the device reference and then use it.

Green2
19-01-2010, 22:07
I am going to guess that the enums for the joystick are both on USB 1 (can't tell from the posted pictures). Make make sure they are pointing to the proper USB ports...

JohnFogarty
20-01-2010, 06:48
they are on USB 1 and USB 2 still only one of them works, i tried the + wheel - and it did nothing, i tried changing the axis in the code...nothing changed, and i reversed the motor inverses and...still nothing

Mark McLeod
20-01-2010, 10:18
You might try downloading code that has no joysticks just to be sure you aren't executing old code for some reason.

JohnFogarty
20-01-2010, 10:35
Ok, i'll try that. Does anyone have a Tank Drive program i could use?

jhersh
21-01-2010, 03:45
Try changing the controls for selecting the PWM channels and the USB channels to constants. That way we don't need to worry about them getting reset to default values.

Tanner
21-01-2010, 06:08
From my experience, Joe's answer explains the problem. Otherwise, I don't see anything else that is wrong.

One thing to keep in mind is that telop.vi is called 50 times a second by robot main. Thus, 50 times a second you are opening robot drive. If it works at all, I'd expect a lot of error messages in the diagnostics window of the driver station.

If Robot Drive VIs are only going to be used in telop, you could open robot drive in the init case of telop.vi and use feedback to save the device reference. However, this becomes cumbersome if you have a lot of devices, or if you want to access them other places (such as autonomous).

The better thing to do is put your open in begin.vi, and then set the device reference. In telop.vi, you can get the device reference and then use it.

You could open all your motors/joysticks in Teleop.vi, but it gets complicated in just setting that up.

-Tanner

JohnFogarty
21-01-2010, 10:53
I put that into my code last night, i'm going to try it today. It seemed the 2nd joystick was not in the Begin.vi that might have been the problem. and i set the open jaguar reference in the begin.vi as well.

Matt95
21-01-2010, 11:00
From my experience, Joe's answer explains the problem. Otherwise, I don't see anything else that is wrong.



You could open all your motors/joysticks in Teleop.vi, but it gets complicated in just setting that up.

-Tanner

While Im not exactly sure about your problem, but i recommend removing all connection with the right control and seeing if the left motor works (by doing what it originally was suspost to do.) if the left control still isn't working, then the left control probably has a malfunction of some sort. In that case, you should get a new left control.

JohnFogarty
21-01-2010, 21:44
ok so i've definatly got a problem, i took the right motor out of the code and set it to the y axis of joystick 1. AND it's doing the same thing and it's running both motors, i tried Joe's idea NOTHING IS WORKING. O.o ....:confused:

TheOtherGuy
21-01-2010, 22:06
Could you explain in detail how you are deploying the program?

bladetech932
21-01-2010, 22:28
I would try separating out those constants on the axis it shouldn't change anything i know but thats what caused ours to do that.

jhersh
21-01-2010, 22:37
Have you looked at the Diagnostics tab of the driver station? There is a window that will show all your errors there. Please tell us what errors you see. It's best to clear the error list, then run it, so you can get a clear picture of what errors happen in a single run.

JohnFogarty
22-01-2010, 10:42
I had so many errors it wasn't funny when i replaced Arcade Drive with tank drive. I tried Arcade and it still screwed up but the errors were gone. What i do is start a new Robot Project I build it and set it as the startup. I edited the tele-op File to use jostick, watchdog and Open motor references from the begin.vi, I changed the Arcade drive to Tank Drive and i set the 2 get axis's to Axis 2 and axis 5 because i'm using the Daul Action Gamepad. then i took axis 5 off and so nothing was to supposed to run the right motor. When i ran the program to see if the left motor worked on the left stick. Both motors ran they were not supposed to, when i took axis 2 off and tried axis 5 right y axis stick nothing happened. To run my code i save my teleop changes and Deploy it from the boot time thing at the bottom by right clicking and selecting deploy (I DO GET A MESSAGE BOX SAYING THAT CERTAIN VI's are real time vi's and that if i choose to continue all vi's on the device will close the vi's it lists are mostly camera realted though it sometimes shows the main vi as well). then i reboot and open the drivers station.

hschase
22-01-2010, 11:05
There should be usable tank drive code in the WPI Labview Library! Check it out, my programmers, who could write code with their hands tied behind their backs plan on using the library because they are pieces that they know work for the intended purpose.

TheOtherGuy
22-01-2010, 11:21
I had so many errors it wasn't funny when i replaced Arcade Drive with tank drive. I tried Arcade and it still screwed up but the errors were gone. What i do is start a new Robot Project I build it and set it as the startup. I edited the tele-op File to use jostick, watchdog and Open motor references from the begin.vi, I changed the Arcade drive to Tank Drive and i set the 2 get axis's to Axis 2 and axis 5 because i'm using the Daul Action Gamepad. then i took axis 5 off and so nothing was to supposed to run the right motor. When i ran the program to see if the left motor worked on the left stick. Both motors ran they were not supposed to, when i took axis 2 off and tried axis 5 right y axis stick nothing happened. To run my code i save my teleop changes and Deploy it from the boot time thing at the bottom by right clicking and selecting deploy (I DO GET A MESSAGE BOX SAYING THAT CERTAIN VI's are real time vi's and that if i choose to continue all vi's on the device will close the vi's it lists are mostly camera realted though it sometimes shows the main vi as well). then i reboot and open the drivers station.

So you select deploy rather than 'Run as Startup' and then reboot the cRio once it's finished downloading? When you deploy, it just loads and runs your program on the cRio while the LabVIEW program is running, and if you turn off the cRio it will lose that code. The last program set as startup will then load when you reboot. Seems like you're loading the same arcade drive program each time you turn it off and back on. Right click on Build Dependencies in the project tree and select Build, then Run as Startup once that's done. Then you should be able to reboot without losing the program.

JohnFogarty
24-01-2010, 17:56
I'm going to feel slightly stupid if that is the problem XD thanks.