Recently our robot has been having a strange problem in which certain motors on the robot make small moements without being told to in the code. The problem occurs only when the robot is active (i.e. in teleop or auton). When printing out the victor outputs, I always get 0 even when they’re moving.
Are you sure it’s not your code? A PWM output updates nearly immediately after you set it in the code. If you’re setting the PWM to a non-zero value near the beginning of your loop and then setting it to zero somewhere later on, you might see something like this.
We had this happen before, though I dont know if it’s the same same reason. We found out a wire was shorting out and it made everything act crazy. Make sure your PWMs are plugged in the right direction(both on motor controller and digital side car) and that in the disabled case you set your motor output to zero. Hopefully it helps!
sounds like your pwm output isn’t zero’ed or your picking up electrical noise which is causing interference.
i don’t program so i don’t know what it’s called in in the FIRST control systems but in RC control land there is something called trim which is used to ‘zero’ the pwm signal.
Check if your victors aren’t uncalibrated, this might cause the issue.
To calibrate your victor do the following:
User Calibration:
Power ON the speed controller.
Press and hold the Cal button. After a moment, the
LED indicator on the Victor will begin alternating
between RED and GREEN to indicate a cal mode.
While continuing to hold the Cal button, move the
joystick to the maximum and minimum positions.
This can be done in any order and as many times as
desired.
While continuing to hold the Cal button, return the
joystick to center (neutral position).
Release the Cal button.
A flashing GREEN indicator confirms a successful
calibration.
A flashing RED indicator denotes an unsuccessful
calibration.
An unsuccessful calibration occurs when either:
a) Insufficient joystick travel was detected in forward
and/or reverse.
b) The trim tab is too far from center.
Resetting Calibration to Factory Pre-calibration:
Power OFF the speed controller.
Press and hold the Cal button.
While continuing to hold the Cal button, Power ON
the speed controller.
A flashing GREEN indicator denotes calibration is
reset. Release the Cal button.
The motors are being zero’d out in the code, and there are safeguards to prevent axis “jitter.” The problem does not happen while disabled, but it happens even when there aren’t any joysticks plugged in.
I’ll look into the other suggestions tomorrow and post the results.
Another thing you might check is if the parallel port from the cRIO to the Digital Sidecar is plugged in all the way. This gave us some troubles last year.
Could you just confirm that you are seeing this behavior only with Victor speed controllers? I’ve noticed sometimes Victor is used as a catchall for the various speed controllers, and like to check.
The 884 has, the last time I looked it up, something like a 4% built in deadband around neutral. Any command, intentional or otherwise, in this range won’t result in any output current being sent to the motors. While not impossible, it’d take some pretty serious jitter to get out of that deadband.
I do not know what, if any, deadband the Jaguars and Talons have.
My guess is that this is code related. The next leading alternative is something centered around the digital sidecar or ribbon cable connecting it to the cRio module. Swap the sidecar out if you have a spare and ensure you don’t have any other electrical wire or device near the ribbon cable, and that it is properly assembled and connected.
May I suggest that you move the pwm cable of the questionable motor to another motor controller to see what happens? If the problem moves to the other motor then your problem is coming from the Joystick to PWM link.
If it continues with the same motor then the problem is the Victor.
I’m betting its coming from the Victor motor controller.