Hey guys, I’ve been having a problem lately with the programming on our robot. We’ve developed a program and have gone to test it, but there has been a problem. When we hit a button on a joystick, the robot won’t respond. However, the lights on all the Jaguars are on, and using probes in LabView tells me that there are being numbers sent to the Jaguars. The only vi’s I’ve actually changed are Begin.vi and Teleop. We even brought in our programmer from the prior year, and he doesn’t know what’s wrong either. Does anybody have any ideas? Thanks very much!
Joystick buttons controlling motors, eh?
I’m guessing you have multiple buttons controlling the same motor. But I’d rather not try to advise you based on a guess. Tell us exactly what you expect the program to do, and post a picture of (or attach a copy of) your code if possible.
Try flipping the pwm cables in the jags/spikes/talons 180 degrees, this -should- fix your issue,
A backwards PWM cable would not result in a Jaguar’s LED being steady on.
Alright, here’s part of our Begin.vi, the rest of Begin.vi has been left default.
And here’s the Teleop.vi. All of the Case Structures, when set to “False,” simply output a zero.
Here’s a basic rundown of what I want our program to do:
- Pushing a joystick forward moves a motor on one side. Since we have two joysticks, each controls a side. This works fine.
- We have a system that pushes frisbees into position to fire. This is “Queue.” It is controlled by the throttle and Button 1 of the same joystick.
- Our “Launcher” mechanism is essentially the same thing. Controlled by the throttle and Button 1 of the other joystick, with the throttle setting speed.
- We want the “Lift” system to be controlled by two buttons. Button 2 sends a value of -1 and should lower the robot. Button 3 sends a value of 1 and should raise the robot.
That’s a basic rundown. As I said, the drive system works flawlessly. Also, we’ve determined there is no problem with the other motors, as we moved those over to the working (red and green) Jaguars, and they operated as expected.
Running the code through LabView and using the probe tool shows that, towards the end of each line, the desired output is being to sent to the Tank Drive vi.
If you need any more details, I’ll try my best to provide you with them. I’m really quite new to LabView and programming in general, so the chance that I’ve made an elementary mistake is pretty high. Thanks again for the help!
If you only have one motor you should not be using Open 2 Motor.
There is a single Motor Open you should be using instead, and Motor Set rather than Tank Drive.
Those vi’s are found under *WPI Robotics Library -> Actuators -> Motor Control
*
Using a PWM more than once as an input will invalidate it.
Oh wow, I wasn’t aware that Single Motor Open existed. That seems like a pretty simple fix too. We have a work day tomorrow, so I’ll go try that out and see how it works. Thanks!
Edit: Everything works now!