Let's Make Robots!

How, When, Damn it, Why do servos jitter?

I've had a lot of trouble with servo jitter lately, I seem so have solved the problem but I'm not sure why it has worked.

servos.jpgAt first I thought it was the power supply being spiked, no amount of decoupling capacitors solved the problem.

I thought it was software and although my code was improved, the jitter continued.

Because I was using optic sensors, I thought fluctuations in the light is causing my inputs to give false readings. Still no luck and I stubbed my toe in the dark.

The oscilloscope showed clean power and signals to the servo but ocassionally the pulse width changed rapidly.

Still could be software. Debug was slowing the whole thing down too much so I got the picaxe to transmit just the 3 variables I was interested in via the sertxd command and serial cable to the terminal emulator built into the programming editor.

My software was behaving and all of a sudden my servo was behaving. I tried a different servo, same thing, jumps all over the place like a kangaroo in peakhour traffic the moment I removed the sertxd command. So now I'm baffled and wondering if anyone out there knows what is going on. For now I've left the sertxd command in.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I apreciate your help, it will be another few hours before dark. I might actually use your code with an ultrasonic sensor I just recieved. A maxbotix EZ1. I've just had a play with it and your code would be more suited to its output.

 

let pin2=0                                                              'turn off IR LEDs


low 7 'turn the servo off so the timer wont bother it!! 

pause 15                                                               'Allow time for inputs to stabilise   
  
 sertxd (#b2," ",#b3," ",#b0,13,10)

servo 7,b0   'restart the servo

I didn't consider the pause command as a possible trouble maker. I was looking more at commands like pwmout. I'll try this too.

I will try (tonight, another six hours from now) to make my servo jitter, using your code. One major difference though: I do not own a picaxe 40x1, just a 28x1. Hope I can still see a jittering servo.

Could you explain when/where in the code the jittering starts/stops? Or is it something that begins right away after resetting the picaxe and never stops again?

8ik

The 28X1 should be fine as I've had this same problem with the 14M in my MkII laser RF. I'll post a video of the jitter for an accurate comparison as the "twitchy" behavor of the servo in my IR tutorial was partly due to an earlier version of the software.