When we’re setting a constant speed to the victor speed controllers, we notice that the controllers randomly set the pwm value to 0. When printing the pwm output to the smart dashboard, we notice that for 95% of the duration the speed is constant to what we set it to but every 5 seconds or so it drops to 0 and goes back up. This is putting a lot of strain on our gearboxes and I was wondering if anyone knows why this happens.
Have you tried setting them to run at a constant speed in autonomous to see if its an isolated problem to teleop?
Do you have any sensors that have anything to do with the motors?
What programming language do you use?
Do you have any error messages in the Driver Station message window and DS log?
Code is the first suspect.
If it’s showing up in your logs, then your code is setting the speed to zero. Look for some edge case in your code where you do a set to zero. If that doesn’t work, try printing your joystick values to the dashboard - there’s always the possibility of an issue there, such as an intermittent connection. If you can’t find it, post your code here (use code tags if C++ or Java by selecting the block and clicking on the # control above) and we can put more sets of eyes on it.
The issue occurs in both teleop and autonomous, we’re using Java and the driver station outputs are all constant except for the victor.get() method which returns 0 randomly.
Would you mind posting your code?
Just a thought.
I’m working with LabVIEW with my team, and I came across some documentation for the WPI Motor Init subVI (which I can only assume is similar in Java to the Motor class or the class for the specific motor controller), which stated that there is a Safety Config parameter which, when set to Enabled, will send a dead-stop PWM pulse code after a certain time since the last invocation of Motor.set() (or in my case, the Motor Set Output subVI). Does your code set the motor output for all motors on every DS packet cycle? If not, this is where I’d start looking.
Luckily, we don’t have to bag-and-tag our code so you can keep looking at this while waiting on your first competition.