6 Servos for a Robot Arm jittering like crazy! Can someone please help?

I have a couple projects using an two UNO R3's. The first project has two 17HS4401 Steppers with A4988 drivers, and two MG995 servos with Pololu D36V28F6 6V 2.7A Step-down converters. My power supplies are two PC-650W PC Power supplies with an ATX adapter on it (one for each project). Everything works perfectly on the one above.

EDITS:

  1. The power is hooked up to 12V, not 5V as shown in my design. Oops.
  2. Yes, I am using breadboards, I don't have the means to solder everything until design is final. (My first project is also on a breadboard and works flawlessly.)

The code definitely is not the issue, because it's the same exact code, just modified for the additional servos.

My other UNO R3 project uses six MG996R servos with a 2.5A stall supplied by the the other 650W p/s.

For some reason, every single servo jitters like crazy. I have absolutely NO idea why.

Can anyone possibly lead me to clues as to why? I checked YouTube, tons of Googling, and everything else I could think of, and all I find is people having jittery issues.

I tried lots of values of electrolytic decoupling capacitors, nothing worked.

I have attached a wiring diagram of the latter project. Wiring was checked and rechecked ad nauseum.

One thing I just did was use a longer breadboard and separated the step-downs as much as I could.

It still was jittery. Just in case you're wondering, I did NOT spill any caffeinated coffee on it.

Thanks in advance for any help.

Mike

Hi,
First off are you really using protoboard?
If so then it is not meant to carry the currents you will be using?
Is your Uno gnd connected to the gnd of the servos? (Doesn't look like it in you "diagram")

Can you post a drawn circuit, rather than a cut and paste image.
Pen(cil) and paper will be fine.

Do you have a DMM?
What is the current rating of your servos?
Even when not moving they are consuming current to maintain the position they are commanded to be in.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Jittering is almost always a sign of an inadequate servo power supply. Do NOT use a breadboard for power distribution, as the tracks will burn. Breadboards are strictly for temporary experimentation with low power logic circuits.

Make sure that the power supply can provide at least 3 Amperes per MG996R servo, so 18 Amperes total for 6 servos.

You use Pololu D36V28F6 6V 2.7A Step-down converters by connecting it to 5 volts on the PSU? What is the point? It seems to me that this way you can even burn the converters. In order for the input voltage to work normally, it must be higher than the output voltage - in this case the input voltage must be more than 6 volts. Connect the converters to the 12 volt line or remove them and connect the servo directly to the 5 volt line - servo MG995 works in operating voltage 4.8~ 6.6v. Or use Step-up converters.

Thanks for the tip. Honestly, I won't be able to draw that by hand. Remember how we drew when we were 5 years old? :grinning:

Yes I am really using a breadboard. I never knew not to. When I first started using Arduinos and servos, everyone on YouTube was doing it.

Good call on connecting the UNO to the grid.

I just find it odd that my other project with 2 servos and 2 steppers works perfectly, set up the same way...

Thanks for the reply. As I replied to TomGeorge, I am surprised to hear I shouldn't use breadboards. All the videos I've seen on YouTube are doing it.

I reread my post and realized I forgot to mention that my P/S is putting out 30A and I am not using the 5V line, I am using 12V. So even if the servos used 3A each, I am well within the limits of the 30.

I was wondering why folks were asking me why I as using 5V. Oops... Those 'lines' were supposed to be placed on the 12V output, not 5. Time for new glasses...

So, yes, it is 12V I am using. I have to make sure I have all the grounds connected. I may not have done that. Bot if that one wire is all I needed...

Other have also wondering why I am using breadboards. Honestly it would be difficult for me to do it another way at this time, especially for testing. Once it's working, then absolutely it'll be soldering permanently.

Thanks again.

Mike

You are watching at the wrong YouTube videos. Those are made by people who have very little idea what they are doing.

Noted. But unfortunately, that's my only option at this point.

Any ideas for options? Someone also said not to use perfboards, which is what I would have done next.

I can't have circuit boards made (at least not until my whole project is finished.)

Commercial power distribution PCBs with heavy duty traces are available for servos.

I use these really nice prototyping PCBs for stepping motors (easily support 1 Ampere/winding with no problems). The traces are reasonably heavy duty and you can always double them up, or add solder to the traces to increase the current handing capability.

If you use a single 3-5 Ampere stepdown converter for EACH servo (an iffy proposition), your best bet is to solder the servo power wires directly to the converter output power and ground terminals. Connect all grounds with heavy wire.

I have not seen this mentioned yet: The Servo library use timer interrupts to schedule the control pulses going to the servos. The pulses are typically in the range 1 to 2 milliseconds (1000 to 2000 microseconds). IF INTERRUPTS ARE EVER DISABLED FOR MORE THAN A FEW MICROSECONDS, the pulses going to the servos will be wrong and the servo will take that as a command to move to a new position.

Is your sketch doing anything with interrupts? Is your sketch using SoftwareSerial (which disables interrupts for each character sent)? Are you using any third-party libraries?

Thanks for the reply. I actually took it off the breadboard and wired it directly. and I just used one servo of the 6. tried each one separately and it still jittered like crazy.

I wonder if the Arduino is messed up maybe?

I am not using interrupts at all.

I don't have the option at this time to use a PCB until all testing is final. (Limited budget kinda thing...)

Are you using any libraries other than Servo?

Are you sure you have the servo ground (black wire) connected to Arduino Ground?

One person got jitter by accidentally wiring +5V to the servo Signal line (white or yellow wire) and wiring the Arduino pin to the servo Power line (red wire).

So it is NOT the same exact code. You have modified it.

Please post the code so that we can check whether it is "definitely not the issue". Because you seem to have excluded almost everything else.

Steve

Hi,
You may have a timer clash, from I2C library and the servo using Timer1.

Try using SrervoTimer2.

Worth a try.
Tom... :smiley: :+1: :coffee: :australia:

@slipstick Thanks for the reply. I'm not the best at describing things (obviously). What I meant by modifying was that I just added the other ones. I didn't actually change the code for what each individual servo does/did. Sorry 'bout that.

@johnwasser The only other libraries being used are Wire.h and LiquidCrystal_I2C.h. The Arduino ground is connected to the power supply ground. The only thing connected to the Arduino ground is the display. So can I ask, if I connect the servo grounds to the Arduino board, where does the ground from the power supply go?

@TomGeorge Thanks for that advice on ServoTimer2. I will try that.

The signal to the servos is relative to Arduino ground so the servos must share a ground with the Arduino. The power to the servos is relative to power ground so the servos must share a ground with the power supply. Therefore the Arduino and the power supply for the servos must share a ground.