Robot Main.VI Driving Issues

Last night as we were finishing up on the robot, I tried to deploy the RobotMain.VI to the cRIO with all of the added programming for the shooter/loader/etc.

The problem is that with all of these extra things on there, for some reason the driving motors no longer work.

When the extra programming is removed, the driving works fine.

One thing we noticed is that when the extra information is on there, all of the motors go solid except for the two Talons that would control the driving (whereas they would normally be solid without the extra programming).

Does anyone have any idea as to why this is happening/how to fix it?

A coding problem like that is hard to help diagnose without being able to see any code.

Are you just looking for generic recommendations?

Most likely you have to many functions in teleop.vi. If it does not run fast enough the wheel will not move. I believe it has to run faster than 20ms. Check the errors on the drive station. If this is the case it will say something about teleop.vi running too slowly.

How would I go about making it run faster? I’m not very adept at LabView, and I’ve only been able to do what I’ve done based on very basic tutorials.

Picture of Teleop.vi







That’s got some things wrong with it.
Mostly the code isn’t structured that way.
Teleop is supposed to be a quick execute and leave, so it can go pick up new driver orders.
The new code you added includes a While loop that doesn’t ever let it leave to go get new driver commands, staying in there forever, because it’s structured as a stand-alone program that’s been stuck inside a sub-program. The For loops don’t accomplish anything other then to slow down execution while they set the motor output over and over again to the same value.

  • Device Opens on the left belong in Begin.vi (you’ll have to name them there and use the new names in Teleop to reference them).
  • Using the Device goes in Teleop.vi (remove the While loop and all the For loops)
    *]Device Closes on the right go in Finish.vi

You have basically added an infinite loop to teleop and teleop is intended to be called and to return for each new joystick command.

If you move the loop and place it into Periodic Tasks.

Either that, or you can put the opens in the Begin.vi and store then in the name registry. Put the closes in the Finish.vi, and let the body of the loop remain in teleop.

Either approach should work for you.

Greg McKaskle