-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
servo vibration on pc #1
Comments
Ah yes... Servo Jitter. I knew this was going to be an issue for some people. Hobby servos are notoriously low-quality, and some of them "jitter" even with clean power and a consistent position pulse being sent. (As long as the servo is powered on you DO have to keep sending the position to it, in the form of a PWM pulse. That's what the Arduino Servo.h library abstracts away for you.) As you found, sometimes the jitter can be caused by noisy voltage. Other times it can just be inherent in the inexpensive potentiometer used internally to determine the servo position. Sometimes it happens in one position but not others, so "nudging" the servo a degree left or right will make it quit. (E.g. try increasing / decreasing the problem position by one degree in the code) The real solution to servo jitter would be to power off the servo between movements. We can't run the power pin directly from an IO pin since they only source 3.3V and 12ma. So, we'd need to run the servo power through a transistor (e.g. a 2N3904 or 2N3906) driven to saturation (through a resistor!) and acting as a switch. Then you'd just add digitalWrite HIGH / LOW statements to the moveto() code to switch the servo on/off (via the base pin of the transistor) before & after moving. I considered this, but decided on keeping the project super simple, with the possibility of jitter as the trade-off. ;) |
[changed my mind - leaving open for visibility in case anyone else is interested / curious] |
not really an issue, just something to note. my servo was vibrating and went through the code thinking it was setting the position over and over but it turned out to just be noise on the pc's usb power line. prob needs a ferite core if you run it from pc usb power. the issue went away with a wall charger.
The text was updated successfully, but these errors were encountered: