Motors turning on when I click enable the 2nd Time

So today we have tested our code and everything seems to run fine except one thing. After we disable our robot on the driver station everything disables as usual. This is the weird part after we click enable the second time everything seems to turn on by themselves. Only our drivetrain doesn’t move. But our “Shooters”, “Mover”, and “Feeder” turn on by themselves on the second click on enable. Something must be wrong with my code. Thanks in Advance

Begin.vi (47.6 KB)
Periodic Tasks.vi (35.2 KB)
Teleop.vi (40.8 KB)
Finish.vi (25.5 KB)


Begin.vi (47.6 KB)
Periodic Tasks.vi (35.2 KB)
Teleop.vi (40.8 KB)
Finish.vi (25.5 KB)

I didn’t look at the code, but I have a pretty good guess as to what will explain your issue.

Disabling an output prevents it from controlling a motor, spike, etc. It doesn’t zero the value, however. This means that the setpoints for speed of a motor are still sitting there waiting to be enabled again.

One approach to consider is to zero the values in the disable VI. You can also do this initialization in the first frame of teleop. The Call Context will be Init on the first call.

Greg McKaskle

So we were able to fix the problem. It was exactly what you said, it stored that value until we enabled it once again. Thanks for the great explanation!