Speed Controllers are Confused

We’ve been having this weird error with victors. When I compile code on my laptop, which changes the victor from on to off based on the press of a button, the victor’s light changes from solid red(when the victor is set to 0) to the LED being off(When the victor is set to 1). We compiled the same code on a different laptop, and we got it to work as it should. What I’m asking is if anyone has had the same problem, and if they found a work-around or fix.

The fact that the EXACT same code is causing a problem is…weird.

Are you sure there aren’t any minute changes? It could be an issue of the button press is being read inside a loop or something, making the value change/stay changed, whereas in the other version of your code it isn’t.

Make sure the IDE on both computers are configured correctly.

Barring this problem, there is the remote possibility that the WPI libraries on the first computer may be corrupted or out of date (the latter of which is highly unlikely, as I’ve never seen an unstable WPI library), which means that when code is deployed to the robot, the commands you wrote using the WPI libraries produce different electric signals, resulting in this disparity.

Here’s my reasoning (in the case of the former laptop): A solid red light on the Victor implies that the Victor is interpreting the command it’s receiving as a -1. No light on the Victor implies that it is receiving a command very, very close to 0, but not close enough or far away enough to trigger a color in the LED. Rounding this signal, the Victor is seeing here a 0 command. Your code is supposed to be sending, respectively, a 0 and 1 command.

Therefore, your Victor is responding to a signal 1 below what the code you’ve written is intended to send. The libraries that translate the command in the code you write, however, have to do convert that command into a PWM duty cycle to command the Victor, and this conversion is the only point of error that comes to mind.

I can’t imagine how anything would change electrically when you just change laptops, and if your code really does stay the same, then the WPI libraries are the only variable you have to deal with.

I suspect you may find that you need to calibrate your victor. Neutral is ON solid, so if the LED is off, I suspect you are seeing a forward command at the output of the victor, but not full forward due to a calibration issue. We found that on the Victor 888’s it was necessary to calibrate many of them. We rarely saw that issue on the 884’s, but we did a couple times.

Check the controller output with a multimeter to see if it is, indeed, changing the output voltage. It doesn’t make sense that it would change between laptops, but who knows.