Quote:
Originally Posted by 3dude_2231
...where is the code that handles the pwm signals?
well, our team's camera servos are tweeching,
and I suspect it may be caused by irregulations in the pwm signal.
|
If you're using PWMs 13-16, your suspicion is justified. It isn't a matter of time delay between PWM pulses, though. It's the width of the PWM pulse itself that makes it happen.
The last four PWM signals are generated by the user CPU. The default code does not deal with interrupts perfectly, and the pulse width can sometimes be longer than desired when serial port and wheel encoder interrupts occur. Kevin Watson wrote some code to correct the jittery behavior, which you can find here:
http://www.kevin.org/frc/frc_pwm.zip
There is still some occasional twitchiness with Kevin's code when writing EEPROM. It doesn't affect normal robot operation, and I haven't taken the time to figure out whether it's due to interrupts being disabled briefly or some other cause.
The code for PWMs 1-12 runs in the master CPU, and is not usually a problem. If you're seeing twitchy camera servos connected to one of those signals, you are probably getting interference from the serial data signal. Try rerouting the wires to keep the servo and serial data physically separated.