Servo motor not functioning

I have an Emax ES09A servo, which behaves badly. It should perform operations in a 45 degree sector. Every once in a while it stops moving and does nothing until I twist it gently. I have three other servos continuing working and there is a lot of noice hence, but I'm in the impression that the faulty servo stops working alltogether, not only slipping cogs. If cogs were slipping, it would be out of direction when it continues to work. So total stop!

The servo is glued onto the rest of the machinery, so it's a difficult task to replace it. Therefore I'm looking for ideas here. Could this behaviour be due to a faulty potentiometer? Smudge on the swiper track? If the swiper loses contact, it's like a floating analog pin, if it were a digital system. But this is an analog servo.

If anyone, based on this, can exactly point out what's wrong with the servo, I might be able to proceed without having to guess. If not, I'm trying to detatch the servo horn, attach it 90 degrees off and hope to have it working in a "fresh" 45 degree sector. This could fix the problem, if it's caused by smudge on the swiper track of the potentiometer.

Because the damn thing is glued onto the system, I can't open the whole servo, just the top of it, revealing the cog wheels, which seem to be intact.

Please post links to the datasheet for servos, eventual driver and data for the power supply.

This is the best data I found:

I have an Arduino Leonardo, a PCA9685 SERVO DRIVER, an LM2596 buck converter adjusted to 5 V, and a 12 V led battery. The driver connects to four servos. Three of them work properly. The fourth one doesn't.

I really do suspect the servo is faulty, not my connection. I did have problems getting the angles right, which led to the servos turning more than allowed, which might have damaged them.

That link points at a sales site, not to the servo manufacturer.
You use words but You miss data like current. Post a schematic containing voltages, currents etc.
Helpers are supposed to give answers but instead we too often must spend time writing questions to understand what the setup contains. Too little power available is often the case.

I haven't thought of that. I have four servos connected to one PCA9685 servo driver. Three work flawlessly, one stops working and continues working only if I give it a push, then it stops again. I still suspect it has a dead zone, where it simply needs a push. But I shall measure the voltage while everything is operating. If it remains at 5 V, the flaw must be in the servo. I should also check the buck converter. It does a heavy job dropping 7 V and yet provide current.

This page says 10 W dissipation. I'm afraid I've went over that. I might raise the voltage to 6 V.

Hi,

Please post a schematic, including component names and pin labels.
What is your "battery"?
Do you have a DMM?

Did you breadboard your project before "glueing" it?

A copy of your code would help and an explanation of what your project is and is supposed to do?
A picture of your project will help us see your component layout.

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

Make a test disconnecting the working servo and see if the troubeling servo becomes more active.
Reading specifications and watching the needs of current is mandatory for success.

The battery is a 12 V led battery for mopeds.
Yes, I have a DMM and I'm about to use it to record all currents and voltages.
It's kind of in a breadboard stage, where I can disconnect everything. Only thing glued are the servos. One critical connection might be the servo sockets, which are connected to the pins of the PCA9685 driver, just because the driver has these matching pins. The driver not only provides the signal for each servo, but also the power. It is kind of a stupid design that the servos have these sockets with GND, VIN and Signal, when the GND and VIN should be soldered to the power source.
I have the whole thing at my work. I can't do anything before Sunday, but I will post more pictures as soon as I get there.

Right now I'm already very thankful for the help. First of all I'm going to measure currents and voltages.

The project is a mechanical glockenspiel. Two mallets are hitting the glockenspiel bars, playing 2 part melodies. It all works very well already, except for the one servo hanging up. One mallet is attached to a servo, which makes the vertical strike. This servo is glued onto another servo, which moves the mallet horizontally, aiming for the right glockenspiel bar. An Arduino Leonardo reads midi data from a computer and makes the mallets act accordingly.

Here's the code:

#include <frequencyToNote.h>
#include <MIDIUSB.h>
#include <MIDIUSB_Defs.h>
#include <pitchToFrequency.h>
#include <pitchToNote.h>

#include "PCA9685.h"

uint16_t angles[2][25][3] =
{
  { // Bass 
    // horiz, vertic upper, vertic lower
    { 190, 224, 203 },
    { 204, 222, 205 },
    { 217, 227, 206 },
    { 230, 227, 206 },
    { 241, 227, 206 },
    { 254, 227, 207 },
    { 264, 227, 206 },
    { 276, 227, 206 },
    { 289, 227, 206 },
    { 301, 227, 206 },
    { 311, 227, 204 },
    { 323, 227, 204 },
    { 336, 227, 204 },
    { 349, 227, 204 },
    { 362, 227, 205 },
    { 374, 227, 204 },
    { 384, 227, 206 },
    { 397, 227, 206 },
    { 411, 227, 204 },
    { 421, 227, 204 },
    { 428, 227, 206 },
    { 432, 227, 206 },
    { 443, 227, 206 },
    { 450, 227, 206 },
    { 450, 227, 206 },
  },
  { // Discant
    // horiz, vertic upper, vertic lower
    { 164, 278, 290 },
    { 164, 278, 290 },
    { 177, 278, 290 },
    { 189, 278, 290 },
    { 203, 278, 290 },
    { 213, 278, 290 },
    { 227, 278, 290 },
    { 237, 278, 290 },
    { 250, 278, 290 },
    { 265, 270, 289 },
    { 276, 278, 290 },
    { 290, 278, 290 },
    { 307, 278, 290 },
    { 320, 274, 288 },
    { 336, 274, 287 },
    { 348, 278, 290 },
    { 362, 278, 290 },
    { 377, 278, 290 },
    { 392, 278, 290 },
    { 406, 278, 289 },
    { 421, 278, 290 },
    { 436, 278, 290 },
    { 451, 277, 287 },
    { 466, 275, 286 },
    { 480, 278, 290 },
  }
};

bool blinker = true;
unsigned long t0 = millis();
int8_t isConnected = 0;

PCA9685 *servobank;

struct my_event
{
  uint32_t tst;
  int np;
  int mallet;
};

#define my_delay 200
#define queuelen 5
my_event queue[queuelen];
int queuepush = 0;
int queuepop = 0;

int horiz_servo[2] = { 12, 14 };  // Bass, discant
int vertic_servo[2] = { 13, 15 }; // Bass, discant



// -----------------------------------------------------------------------------
// G4 to G6, midi nr 67 to 91
// -----------------------------------------------------------------------------

void noteOn(byte channel, byte pitch, byte velocity) 
{
  uint32_t tst;
  tst = millis();
  int np;
  int mallet;

  // Blink
  digitalWrite(13, blinker);
  blinker = !blinker;

  
  np = pitch - 67;
  if (np >= 0 && np < 24)
  {
    if (velocity)
    { 
      if (channel == 0) // diskant
        mallet = 1;
      else
        mallet = 0;

      // At note on event, move horizontal servo to place,
      // as well as vertical servo to upper position
      servobank->setPWM(horiz_servo[mallet], angles[mallet][np][0]);
      servobank->setPWM(vertic_servo[mallet], angles[mallet][np][1]);
      
      // If velocity is 1, the mallet is supposed to move to place,
      // but not hit the key. To be used to avoid collision of mallets.
      // If velocity is > 1, place the event in a queue.
      if (velocity > 1)
      {
        queue[queuepush].tst = tst;       // Time stamp
        queue[queuepush].np = np;         // # of key
        queue[queuepush].mallet = mallet; // Discant or bass (1 or 0)
        queuepush++;  
        queuepush %= queuelen;
      }
    }
    
  }
}
  
void noteOff(byte channel, byte pitch, byte velocity) 
{
}

void controlChange(byte channel, byte control, byte value) 
{
}



void setup()
{
  Serial.begin(115200);
  Serial.println("Me too...");
  servobank = new PCA9685(0x40);
  servobank->begin();
  servobank->setFrequency(50, 0); 
  
  for (int i = 0; i < 10; i++)
  {
    digitalWrite(13, HIGH);
    delay(300);
    digitalWrite(13, LOW);
    delay(300);
    
  }
  delay(500);
  pinMode(LED_BUILTIN, OUTPUT);
  

}

bool blynker = false;

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void loop() {
  int toggler = 0;
  midiEventPacket_t rx;
  rx = MidiUSB.read();
  switch (rx.header) 
  {
    case 0:
      if (queuepop != queuepush)
      {
        if (millis() - queue[queuepop].tst > my_delay)
        {
          servobank->setPWM(vertic_servo[queue[queuepop].mallet], 
                            angles[queue[queuepop].mallet][queue[queuepop].np][2]);
          queuepop++;
          queuepop %= queuelen;
        }
      }
      
      break; //
      
    case 0x9:
      noteOn(
        rx.byte1 & 0xF,  //channel
        rx.byte2,        //pitch
        rx.byte3         //velocity
      );
      digitalWrite(LED_BUILTIN, blynker);
      blynker = !blynker;
      break;
      
    case 0x8:
      noteOff(
        rx.byte1 & 0xF,  //channel
        rx.byte2,        //pitch
        rx.byte3         //velocity
      );
      break;
      
    case 0xB:
      controlChange(
        rx.byte1 & 0xF,  //channel
        rx.byte2,        //control
        rx.byte3         //value
      );
      break;
      
    
  }

}

Hi,

Can you post a link to data/specs of battery, or post an image of the battery and its label?

A circuit diagram will eventually save many posts, draw your circuit with pen(cil) and paper and post an image, that will be fine.
Include power supply, component names and pin labels.

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

1 Like

Here's a page to the specs of the battery:
https://nedis.com/en-us/product/energy/lead-acid-batteries/lead-acid/550677739/battery-lead-acid-rechargeable-12-v-7200-mah-151-mm-65-mm-95-mm

And here's the circuit:

The LM2596 is adjusted to output 5.0 V. Confirmed with a DMM. And the +- power wires of the servos don't go to the terminal, where the servo driver is fed with power, but to the triple pins of each PWM port that gives the PWM signal, V+ and GND:

And here's a video with the glockenspiel in action. You can notice how the right mallet stops doing the vertical strike at 1:02. After a gentle push, it continues to function to the end, even though the left mallet starts to perform a more advanced rhythmic pattern, which most sure takes more power. That's why I don't suspect the power supply in the first hand. But I have yet to measure it.

But as an academic question, what would happen if an analog servo would lose contact to the potentiometer wiper (apparently not called swiper) due to a burnt spot or some smudge on the wiper surface? The circuit receives the PWM like signal, then tries to read the wiper potential to determin how to rotate the motor. But the wiper potential is undefined due to the loss of contact. The wiper can't provide a potential that differs from the expected potential according to the signal. My guess is that the motor is not activated. This is just a wild guess, without knowledge of how the analog circuit works. Out of academic interest.

Hi,
Can you try it without the arm on the servo?
I am inclined to agree with @Johan_Ha .

Also measure the servo power supply, 5V, when this happens.

Tom... :grinning: :+1: :coffee: :australia:

Looking at my own diagram, I see I have forgot the OE pin. It should be grounded. If high, it disables all output. If it floats, heaven knows what happens. Maybe it can disable single ports.

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