I'm seeing a weird output glitch using the servo and servopos commands. I'm using the 20M2 chip. I initialize the servo with the servo command and use servopos to set the throttle position for a standard RC aircraft ESC (Castle Creations), but fairly frequently (maybe 2x-3x a minute the oscilloscope will catch it) the servo pulse train has a glitch – I get a pulse split up into a long and a short pulse. This glitch is audible as a brief bump in RPM, as the ESC likely interprets the first pulse as a command for 0 throttle. I've tried several things to rule out some possibilities. I've ruled out that it is not an issue with the code, the wiring length, and the Picaxe is not resetting. Something seems to be happening with the internal timing. Also FYI, the code takes a 20-sample average of the potentiometer reading to help smooth it out, and updates the servopos command at roughly 10 Hz.
clean.jpg shows the original waveform ~ 1600us
short.jpg shows the width of the first glitch ~ 36us
long.jpg shows the width of the second glitch ~ 500us
The error seems to always be with these two widths, and the start of the first glitch and end of the second line up with when the correct pulse is supposed to start and end. It doesn’t seem likely that this is a wiring issue since the pulses line up so exactly.
Has anyone seen position glitches/twitchiness in servos with servopos? Could something else be conflicting with the timer servopos uses? I am also using the ADC to read a potentiometer and i2c to send info to a DAC. Serial communication is not being used except on the download circuit.
Thanks!
clean.jpg shows the original waveform ~ 1600us
short.jpg shows the width of the first glitch ~ 36us
long.jpg shows the width of the second glitch ~ 500us
The error seems to always be with these two widths, and the start of the first glitch and end of the second line up with when the correct pulse is supposed to start and end. It doesn’t seem likely that this is a wiring issue since the pulses line up so exactly.
Has anyone seen position glitches/twitchiness in servos with servopos? Could something else be conflicting with the timer servopos uses? I am also using the ADC to read a potentiometer and i2c to send info to a DAC. Serial communication is not being used except on the download circuit.
Thanks!
Attachments
-
401.2 KB Views: 13
-
365.4 KB Views: 9