I control two servos using the MegaServo library. The library works excellent only the servos jiggle a little bit from left to right. you can constantly hear (clicking noise) them move just a little bit.
I've connected the servos to digital pin 24 and 25 of my Arduino Mega.
Does anyone also has got this experience and maybe a solution?
I use an external power device to power the servos. I control the servos using a SNES game pad.
When the buttons are pressed the servos respond correctly. But when the game pad is idle (no buttons are pressed) the servos move a little bit (jiggle). The servos move from left to right and back over a very small area.
I want to connect a camera to the servos, because of this moving it is difficult to create still images.
In idle mode no commands are send to the arduino so I have no idea what this "moving" can be?
It would help to track down the problem if you can run at test to see if it's a hardware or software problem.
Try connecting the servos to pins 11 and 12 on the mega (keep all other wiring and power supply connections the same) and run a test using the standard Arduino servo library. If the problem does not go away then it may be an issue with the power supply (perhaps electrical noise produced by the servo that will require a decoupling capacitor). If the problem does go away we can look to see if its caused by the software.
I think kenwaldek is asking if you used pull-up or pull-down resistors on the switches in the test sketch. You don't need resistors on the pins connecting servos
Ok I am about to continue solving this problem (I know its been a while :))
I've heard a few options:
Add a decoupling capacitor.
Add a pull up/down resistor.
What will be the best option a combination of both or just one (decoupling of pull up/down)?
How do I connect a decoupling capacitor? Just between the digital pin and the servo? And what value should this capacitor be (uF)?
When using a pull up/down resistor, does it matter which one? Is there for example a special purpose for a pull up resistor as well for a pull down resistor? Or just use a pull up or a pull down resistor? (same purpose, just a different connection)?
Pull-up and pull-down resistors serve the same purpose and both are equally effective, choose whichever you find easier or more intuitive. Try it with just the resistor, you may not need to use decoupling capacitors.
Not sure if your saying the problem only occurs or only stops when the motors are idle. Try a test with just the servos wired up (the motors completely disconnected) and with short wires to the power and servos.