Problem with Digital vs Analog Servos

Hello,

I've built a robot arm that uses four 20kg PWM servos to power each axis. I was using analog servos and everything was working fine, but then I switched to digital servos and now the movement, which was very smooth before, isn't anymore.

The axis, especially the ones with more load, don't rotate smoothly, they rotate just a little bit jerky, and the motor makes kind of a whirring noise, as if it were going through cycles. It kinda ruined the project.

These new digital servos have inside capacitors very close to the circuit. They are more expensive than the analog ones I was using before, so I'd expect them to perform better.

  • I'm powering the servos with an external 5V 8A power supply, so I think enough power isn't the problem.

  • I've run them using the PCA9685 module and the problem's still there. I also believe enough power isn't the problem because with this module there were no soldering or other made connections involved.

  • I've also tweaked the code, running with both faster and slow sample rates, and the problem persists. I'm using writeMicroseconds() in my code. If I put the analog servos back in, they work perfectly, as before.

I'm out of ideas on what could be the problem. Could it be just that these servos are bad? They are the DS3120 270° (https://www.aliexpress.com/item/32482130083.html?spm=a2g0o.detail.1000023.1.5d574f43b9O4Y9)

Below is how I'm powering them. I'm only showing one servo because even when I disconnect the other 3 the problem's still there, so I don't wanna add to it. Couldn't find anything related with a solution on the forum.

I can provide more details and images/videos as needed. Thanks in advance.

EDIT:

I've reduced the problem to something simpler instead of posting the whole project, which has thousands of lines of code. This way it'll be easier to isolate the source.

This is the circuit that I'm using now, and it's running only ONE servo, not four.

This is the code:
(I'm only using the PCA9685 in order to have a solderless connection so we can be sure that's not the problem. In my original project I use the standard Servo library with writeMicroseconds() and the same issue is there)

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

#define USMIN  700
#define USMAX  2300
#define SERVO_FREQ 50
#define SERVO_NUM 0

void setup() {
  Serial.begin(9600);

  pwm.begin();
  pwm.setOscillatorFrequency(27000000);
  pwm.setPWMFreq(SERVO_FREQ);
  
  delay(10);
}


void loop() {

  for (uint16_t microsec = USMIN; microsec < USMAX; microsec++)
  {
    pwm.writeMicroseconds(SERVO_NUM, microsec);
    delay(1);
  }

  delay(500);
  
  for (uint16_t microsec = USMAX; microsec > USMIN; microsec--)
  {
    pwm.writeMicroseconds(SERVO_NUM, microsec);
    delay(1);
  }

  delay(500);
}

And a video showing the problem:
(Notice how the motion isn't smooth and the motor kinda whines)

Any help is greatly appreciated! :smiley:

Digital Servo Specs:

image

What is an "analog servo" and what's a "digital servo"? Never heard that comparison before. Links to sales sites are no good. Links to datasheets are good.

Where's the code used?

Read this link and follow it: How to get the best out of this forum - Using Arduino / Installation & Troubleshooting - Arduino Forum

8A is too little current for 4x20 kg-cm servos. 12A minimum and possibly more. The start/stall current is not stated for the aliexpress serovs you linked, and you need to know that value.

Be sure to solder all connections, or use a servo power distribution PCB rated for that current.

Hi,
Can you please post;
Link to analog servos spec/data.
Link to digital servos spec/data.

It sounds like a power supply problem.

Do you have a DMM?

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

@Railroader
I'm no expert but apparently digital servos send pulses to the controller at a much faster rate than analog servos, resulting in faster responses and better torque holding capability. Also they don't make deep noises as analog servos do. I've added more info, code, pictures and a video, please check the original post. Thanks for trying to help!

@jremington
I agree with you but the problem happens even when I'm running only one servo. I'm using 8A because there's pretty much no load on the 4th servo, and the other 3 don't come close to stalling.

@TomGeorge
Tom these servos don't come with datasheets unfortunately, but below are the specs for the digital servo that I'm using now. I know that for both the rated voltage is 5V and the stall current is definitely 3A or less. Please take a look at the code, picture and video that I added to the original post. Yes I have a DMM, what can I do to understand what the problem is? Thanks!!

image

You suffer from a very common misconception.

All servos, and all brushed DC motors briefly draw the stall current, every time they start moving, regardless of the load.

The stall current for a 20 kgf-cm servo is typically greater than 3A for one servo, and in your case, the power supply must be able to easily handle four at once.

For example, the popular MG996R servo is only 9.4 kgf-cm, and the start/stall current is 2.5A.

Easily 95% of the servo problems reported on this forum are due to inadequate servo power supplies, so you are in good company!

I know that for both the rated voltage is 5V and the stall current is definitely 3A or less.

No, you don't know that. But even if you believe that to be true, the power supply must be able to handle 4x3A, or 12A, as I stated earlier.

@jremington I get what you're explaining, no arguments there. But did you see that in this test I'm only running one servo? In this case my power supply should be more than enough, right?

What could be the problem then?

Measure the output of your servo power supply as you apply servos.

The put your DMM in 10A mode and measure the current used by one analog servo then one digital servo.

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

Here are the measurements:

Analog Servo: (this is actually a 4.8 - 7.2V 10kgf.cm 180° servo)
Voltage output: 5.3V
Current draw: 0.6A
(Notice how it's smooth compared to the next one)

.
.

Digital Servo: (4.8 - 7.2V 20kgf.cm 270° servo)
Voltage output: 5.35V
Current draw: 0.12A

Hardware, connections and code are the same for both.

Aren't the values what we would expect? Voltages are okay and the less powerful servo is drawing more current to perform the same movement

Can You post the data for the device You name "analog servo"?
The data given for "digital servo" are the same as 50 years ago. 1.5 ms is the pulse widht for neutral, 2.5 is max and 0.5 is minimum.
Try and use a longer delay than 1 ms. 10, 20, 50 and note the responce.

Digital servo's are designed to be strong, fast and precise. So even if you command them to move a very little angle from their current position, they will do so with more force normally than an analog servo. Digital servos can accept an new position every 9 milliseconds (or even faster), where analog servos are designed for a 20 millisecond (50Hz) update interval.
With all those advantages, why do analog servo's still exist?
They are somewhat cheaper than digital ones.
Analog servos move smoother as they tend to have a slower ramp-up of their power and a friendlier ramp-down of their power when they approach the assigned position. This combined with a wider "deadband" makes them not so snappy, but smoother.

Your digital servo's have metal gears. Great for strength at the cost of more play in the gearbox. Metal gear servo's whine more than nylon gear servo's. Maybe your analog servo's had nylon gears?

1 Like

@Railroader
I don't have the datasheet for the analog servo, only the main specs which are 4.8 - 7.2V 10kgf.cm 180° servo. Not sure what you would do with more info than the voltage, stall torque, min and max us and dead band, since the only thing you can control is position and delay.

I've already tried using small (1ms) and longer (30ms) delays and making sure the difference between the previous and next commanded position is greater than the dead band. Didn't make a difference.

@hmeijdam
Thanks for the info. The analog servos I'm using also have metal gears.

I'm retiring PWM servos when it comes to robotics and switching to Serial Bus servos only. They cost 3x more but are way better and have position and temperature feedback. Already tested them with the arm and they work great. Leaving PWM servos to RC projects only, which is what they were intended for.

Looking at replies #3, #6 and #7 the current needed is still unknown.
Shoting from the hip, a guess: Chinese power supplies sometimes/often supply either the voltage or the amps but not necessary both at the same time.

1 Like

@Railroader
Thanks but I don't see how that would be the issue because in the test that I've run in the video only one servo is connected and the current draw is only 0.12A @ 5V. If all four servos were running then I would agree. I've stalled the movement on purpose and it rose to 2.4A.

It's not much but the servo is running unloaded. Never mind, it ought to work.
Even if that's the steady current, stall current couldn't possibly knock down the power supply, running a single device.

The hunt for the ghost continues....

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