I am trying to use a mpu 9250 to control 4 servos. This code works when I control 1 servo at a time however when I connect all 4 servos, they become VERY jittery. Does anyone see any flags within my code or may it be a hardware problem. There is no jitter when the gyroscope is disconnected. I am using an Arduino nano clone.
It probably worked because when testing 1 servo at a time it was powered by the board! I switched the servos to a power supply when adding 3 more so I didn't overload it. Im going to try adding the ground and will report back. Thank you all!
Circuit: an unbroken path that returns to its starting point.
Think about this: if the only connection between your Arduino and your servos is the signal connection, where do the electrons that flow along the signal line return to the Arduino? That's why there's a common ground: to complete the circuit.
I added a ground from the nano board to the power supply and that did not help. will be keeping it there since having a common ground makes complete sense but the jitters persist.
Servos briefly draw the start/stall current every time they start moving, so the power supply needs to be substantial.
Experienced people budget 1 Ampere per servo for small ones (e.g. SG90) and 2.5 A/servo for larger ones like MG996R. If you don't, expect the servos to twitch.
A 5V/1A phone charger certainly won't do for four servos.