Powering big servos and running them smoothly

Hello, I'm sure I'm not the only one with this dilemma. Servos are awesome to use, especially big ones used for RC cars, cause you can also make cool robots with them. But sometimes controlling them can be a hassle. I'm currently planning a project that involves 4*20 kg servos. The problem is that when I control them, they sometimes become possessed in where they move full 360s when they are not supposed to. completely destroying their surface they are placed on. I used the PCA9685 motor driver and gave it 5 volts and 2.6 amps in total. considering that the board feeds them power in a series way. Why is this happening, and what can I do to fix this?! Hopefully the robot gets done and starts doing what it's supposed to do INSTEAD OF DESTROYING ITSELF!!! Let me know if you guys need any information.

by the way here are the specific servos I'm using and boards.

HiLetgo 2 pcs 16 channel PCA9685

the 20 kg servos

That sounds like a faulty servo to me.

If you remove the feedback variable resistor in a servo you get what is erroneously known as a continuous servo, which will move constantly round.

Real servos have a limited range of movement so I can't see what they can be used for in an RC car, apart from altering the steering.

According to your link, you have 270deg servo.
It shouldn't go 360deg but could easily do 300.

"Pulse range 500usec-2500usec for 0° - 270° (90°--1166usec, 180°--1833usec)."

If yo give it pulses for example in range 400-2700, it might go beyond 270deg and eventually hit the mechanical limits it has.

Edit: Actually it has limits at 360 deg, so pulse long enough will take it there.

Which Arduino are you using?
Please show your code.
How are you applying power to the PCA9685 board, via the screw terminals or from the header?
Are you using the Adafruit lib?

I see you are using the cheap PCA9685 with limited current capability (500mA)

Please elaborate, this makes no sense. The power to the servos is wired in parallel on these boards, and any/all may draw their maximum current at any time, including simultaneously.

Hence, if you stall multiple simultaneously, you will likely hit your current limits quickly. You didn’t quote the “stall current" for your servos, but if they’re as powerful as you seem to think, that stall current is likely a problem.

HI, @robotsofthefuture

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Do you have bypassing capacitors in your circuit?

Can you post some images of your project?
So we can see your component layout.
This is important as layout of signal and power supply wiring to prevent interference could be a problem.

Also checking that power ground and signal grounds do not share the same wire will minimise any glitches.

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

Stall current (at locked):1.8A(5V)/2.2A(6.8V)

Yeah. As I expected, stall even one and your PCA9685 is toast, as @jim-p pointed out.

It is probably incorrect logic or wiring, but since you have not posted the code in code tags and a wiring diagram (photo(s) of hand drawn is fine) we can't tell.

4 * 1.8A = 7.2A, you need a 9 ~ 10A power supply.

DroneBotWorkShop is a good reference...

Okay, this makes sense, but if I wanted to make the project portable, which would be the best rechargeable battery by choice that fits the servos and the Arduino's requirements? by the way I'm using a Arduino Mega 2560 kinda ancient at this point but very good for the type of projects I'm making

I actually have no variable resistor because it's a complete board. but the reason they are actually useful is the fact the they can move a bunch of weight and easy to program example between a stepper motor and these servos which first aren't as expensive as the steppers (which I can't find anything cheap) these are perfect for like tension appliers and robotic grippers these are perfect in prototyping before moving on to steppers

Thanks this will help I search through my whole YouTube to find this video and I could not find it.

here's the code

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

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

const int servoChannel = 0; // PCA9685 channel 0
const int pirPin = 2; // Motion sensor input pin
const int ledPin = 13; // Status LED pin (built-in on many boards)

const int servoMin = 150; // Adjust for 0 degrees
const int servoMax = 375; // Adjust for 180 degrees

unsigned long lastCheckTime = 0;
const unsigned long interval = 20000; // 20 seconds

void setup() {
Serial.begin(9600);
pwm.begin();
pwm.setPWMFreq(50); // 50 Hz for servos
delay(10);

pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);

// Set servo to 0 degrees
pwm.setPWM(servoChannel, 0, servoMin);
digitalWrite(ledPin, LOW); // Ensure LED is off
}

void loop() {
unsigned long currentTime = millis();

if (currentTime - lastCheckTime >= interval) {
lastCheckTime = currentTime;

int motionDetected = digitalRead(pirPin);
Serial.print("Motion: ");
Serial.println(motionDetected);

if (motionDetected == HIGH) {
  digitalWrite(ledPin, HIGH); // Turn on LED

  // Move to 50 degrees
  int angle50 = map(50, 0, 180, servoMin, servoMax);
  pwm.setPWM(servoChannel, 0, angle50);
  delay(3000); // Hold at 50° for 3 seconds

  // Return to 0 degrees
  pwm.setPWM(servoChannel, 0, servoMin);

  digitalWrite(ledPin, LOW); // Turn off LED
}

}
}

of course I'm powering the servos with 5 volts 2.6 amps but if I power even 1 servo after 13 resets the servo becomes crazy

The video is also immediately after the fourth paragraph under "Introduction."

Please post your code using code tags <CODE>

Please answer all the questions given in post #5

Also... do you have a pulling resistor on your PIR pin (it might be installed on the module form, but not on the component form)?

Which pin is being used by the servo? I just realized it is driving a mux.

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

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

const int servoChannel = 0; // PCA9685 channel 0
const int pirPin = 2; // Motion sensor input pin
const int ledPin = 13; // Status LED pin (built-in on many boards)

const int servoMin = 150; // Adjust for 0 degrees
const int servoMax = 375; // Adjust for 180 degrees

unsigned long lastCheckTime = 0;
const unsigned long interval = 20000; // 20 seconds

void setup() {
  Serial.begin(9600);
  pwm.begin();
  pwm.setPWMFreq(50); // 50 Hz for servos
  delay(10);

  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);

  // Set servo to 0 degrees
  pwm.setPWM(servoChannel, 0, servoMin);
  digitalWrite(ledPin, LOW); // Ensure LED is off
}

void loop() {
  unsigned long currentTime = millis();

  if (currentTime - lastCheckTime >= interval) {
    lastCheckTime = currentTime;

    int motionDetected = digitalRead(pirPin);
    Serial.print("Motion: ");
    Serial.println(motionDetected);

    if (motionDetected == HIGH) {
      digitalWrite(ledPin, HIGH); // Turn on LED

      // Move to 50 degrees
      int angle50 = map(50, 0, 180, servoMin, servoMax);
      pwm.setPWM(servoChannel, 0, angle50);
      delay(3000); // Hold at 50° for 3 seconds

      // Return to 0 degrees
      pwm.setPWM(servoChannel, 0, servoMin);

      digitalWrite(ledPin, LOW); // Turn off LED
    }
  }
}

Better now how about some answers.