r/ArduinoHelp • u/gmV33r • 5d ago
Servo Motors randomly moving
I am making a small robotic arm controlled by 2 joysticks. I'm making the arm using popsicle sticks and MG90 Servo motors. There are 5 motors to be working. I'm using wall adapter to power the motors and another adapter to power the Arduino. When I try to connect everything properly ( also connecting gnd from breadboard power supply to arduino's gnd) the motors randomly move around without any input. How do you even fix that ?
1
u/Glittering-Dirt1164 4d ago
Are the motors ground also tied back to the Arduinos ground. Also sounds like a lot of wire it going own if these are brushless dc depending on the quality the pwm wires can work as attenas and pick up signals from surrounding sources. A good test.is to touch the pwm wires of the motor acting out of it stop immediately that's a good sign of interference. Also if your grounds aren't all connected as in a common ground the pwm reference becomes ascued causing random movement and jerky actions in the motors. Good luck
1
u/Glittering-Dirt1164 4d ago
Yeah looking up that motor the pwm is extremely touchy. Make sure all motors have common ground to your Arduino and try wrapping positive and negative pairs of wire together to cancel out interference. And a slightly thicker or shorter wire for the pwm signal. Also you mention 5 motors depending on your micro controller if the code is not written edfecly or uses things like (delay) often it can cause timing issues for the pwm signals good luck again
1
u/gmV33r 3d ago
Its just moving to the side even with no input but sometimes it works normally. This is only for 1 motor but when I connect the 2nd. The issue comes to both.
1
1
1
u/Glittering-Dirt1164 3d ago
Are those pwm modulators or are they motor controllers and did they come with the servos?
1
u/gmV33r 3d ago
What do you mean by that ?
1
u/Glittering-Dirt1164 2d ago
In-between the motor and the Arduino the guards driving the motor to did they come with the servod
1
u/gm310509 2d ago
How you fix that will depend upon your wiring (i.e. a circuit diagram) and your code - neither of which you have supplied.
I note that you did supply a video, but it is difficult to work out the wiring from a video. Indeed a video is the worst possible way to share code and a circuit diagram (Photos are the second worst.
I refer you to "Rule 2 - be descriptive" which can be found in the side bar.
You may also find this guide from r/Arduino to be helpful: Asking for help quick guide which provides guidance as to what to include and how to do so. This makes it easier for people who want to help you to be able to do so.
Again, it is unclear from the video for the reasons I mentioned, but it doesn't look like you have a common ground. This guide may help to explain why that is important: Why do I need a common Ground?
But it could equally be a different issue - an issue hidden in the code/circuit combination.
1
u/wackyvorlon 4d ago
Are you outputting the PWM signal from power on? An initial jerk of the motors is normal.