Twitching servos

I’m using 3 MG996R servos that twitch under no load. I tested them individually to check if the problem was one of the servos. All servos worked without any twitching. I then added 2 Gear motors with the motor driver L298N and still no twitching. When I combine all 3 servos and the 2 Gear motors together, the twitching occurs. I’ve also done some research and found the jumper wires i’m using are too small for the servos as they are only 28 AWG which according to this chart, (What gauge wire should I use for my project? - #3 by Idahowalker ) the wires can only deliver 0.226A. However, the wires are enough to power 2 Gear motors and a single servo. So is it a power supply problem? Should I purchase bigger jumper wires?

Here are the materials:

  • MG996R servos
  • 2 TT Gear motors
  • L298N motor driver
  • 28AWG jumper wires
  • Turnigy 7.4V 2.2A Li-po 2S
  • LM2596 Buck Converter

Here is the schematic:

Any tips and help would be very much appreciated. Thank you

Please show a schematic and actual wiring images to us ?

What does the voltage going to the servos measure when they are twitching ?

1 Like

Do not use solderless bread board, they are not designed for such currents. Yes it is probably a power supply issue.

Also what measures have you taken to minimise the interference generated by your motors?

1 Like

Servo twitching is usually due to an inadequate power supply.

For 3xMG996R, the servo power supply should be rated for 8 Amperes minimum. As mentioned above, do not use a breadboard. Solder all connections, or use connectors rated for 3 Amperes minimum (each servo).

The ancient, extremely inefficient L298 should be tossed in the recycle bin. Pololu has the best selection of modern, efficient brushed D.C. motor drivers.

3 Likes

Here is the schematic:

The input voltage spikes up and down between 7.4V to around 6.5V when they run, but the output voltage (5V) remains stable.

I used 3 50V 220uF capacitors as shown in the updated circuit. Before adding the gear motors, I placed the capacitors to regulate the voltage and current flow to the servos and it fixed the twitching. Only when I put everything together does the twitching re-occur.

If the servo needs to keep pressure on, it usually requires the constant repetition of the incoming pulses. if the problem is happening under "no-load", you could try turning off any pulses to a particulr servo once it has reached position. Twitching is usually because of external interference, placing the capacitors for each servo between the signal wire signal and GND (not the supply and ground) to shunt away any high frequency spikes on the signal wire.
Many servos also produce a 'kick' when they are first powered up. This is a feature of their internal electronics and is cleared in almost all cases by soldering a 10k resistor between the servo's signal wire and the +5V supply line, or the signal line and the 0V line.

You have no reverse diodes across those motors. This will result in a lot of interference being generated. As this is a H-bridge output you need four diodes not one for each motor output.
See the example schematic in this link:-
L298N Motor Driver Data sheet PDF

Your buck converter can supply how much current ?

Where does the Arduino get its 5v power from ?

Confirm your Arduino GND is connected to the converter GND ?

Double check the motor input (L298N) voltage connection, btw, it is recommended this be 7-12V.

The servo power supply is totally inadequate.

It says here the input current is 3A which is more than enough for my battery

The Arduino is plugged into the computer with the micro-USB

I have tried with connecting Arduino GND to the converter GND and still twitching occurs.

I can also confirm the L298N motor driver voltage input is at +12V.

Maybe the problem is the servo.h , it interferes with PWM output of pins 9+10.
Although the problem of the TE is more related to PWM for the motors not working, you find more information here:

3 servos on that converter is overloading it.

Did you suggest 8 Amperes minimum for the servo power supply because of the stall current of the servo? The stall current of each servo is 2.5A at max load times 3 which is 7.5A total. Since, we can't go exactly 7.5A and want room for adjustments, round it off to 8 Amperes. Is this the right calculation?

Figuring out the right power supply for my project has been an ongoing issue for me. Based on what I've read, I chose the lipo battery and the buck converter but it seems like I messed up and I don't know where I made my mistake. What calculations are you using?

UPDATE: Soldering the wires and components that are connected to the power supply completely got rid of twitching!

I learned a lot from you all. Thank you guys for taking the time to help me out and give me advice.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.