Go Down

Topic: Right power for servo based robotic hand advice needed (Read 264 times) previous topic - next topic

ChrisNZ

I was hoping to get some advice. I've got a 3.7v 1200 mAh LiPo hooked up to a servo in a robotic hand. I'm getting really unpredictable behaviour from the servo. Sometimes it refuses to move at all, sometimes it moves erratically, and sometimes it works (but not for long). When it does work I suspect it's because the battery has enough charge and is supplementing the USB power coming from the Battery Babysitter (https://www.sparkfun.com/products/13777)

My deduction so far (possibly wrong) is that it seems like the servo is drawing too much current when it's connected as the voltage drops (closer to 2v) as soon as it is hooked up (e.g. before I even send commands to the servo).

I don't have a discharge rating for the battery (https://nicegear.nz/product/lithium-ion-polymer-battery-1200mah)
 
This is the servo that's running off the battery: https://www.pololu.com/file/download/HD-3001HB.pdf?file_id=0J728

I'm self-taught at all this so my understanding of power and servos is limited. Do I need a battery with a higher discharge rating, higher capacity, higher voltage or something else? I don't have a multi-cell LiPo charger so trying to avoid increasing the voltage as the charger would be a significant extra expense. The other problem is that I'm based in New Zealand so have to rely on NZ based suppliers overseas won't airfreight LiPo batteries.

What's supposed to happen: a Myoware muscle sensor (https://www.sparkfun.com/products/13723) provides an analog reading of muscle movement. The arduino then translates this into a servo command to move a finger on a 3D printed hand.

Here's the code running:

Code: [Select]
#include <Servo.h>

Servo myservo;  // create servo object to control a servo

//setup variables
int pos = 0;
int pos2 = 0;
int lastpos = 0;
int posDifference = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  myservo.attach(9);
}

void loop() {
  //get an average reading from the sensor using the function below. The first variable is the analog pin on the arduino.
  pos = getSensorAverageValue(0, 10, 10);
  posDifference = pos - lastpos;
   Serial.println(pos);
   // only move the servo is there is a significant change in the sensor reading. I know I can squash these lines down later once it's all running properly
  if (posDifference >=5 || posDifference <=-5) {
    lastpos = pos;
    pos2 = map(pos, 80, 150, 0, 180);
    pos2 = constrain(pos2, 0, 180);
    myservo.write(pos2);
  }
}

// get an average value from a jumpy or erratic input sensor.
const int getSensorAverageValue (const int sensorPin,
                                 const int numberOfSamples,
                                 const long timeGap)
{
  static int currentSample; // current sensor sample.
  static int currentValue;  // current sensor value.

  // current value works as a sum counter.
  currentValue = 0;

  // get sensor samples with delay and calculate the sum.
  for (int i = 0; i < numberOfSamples; i++) {
    // get sensor sample.
    currentSample = analogRead(sensorPin);

    // add sample to the sum counter.
    currentValue += currentSample;

    // delay some time for the next sample.
    delay(timeGap);
  }

  // get the average sensor value (ignore the fraction).
  return (currentValue / numberOfSamples);
}


Fritzing diagram attached (the schematic wasn't representative as the pins weren't labelled properly). The battery babysitter is also hooked up to a USB power supply.

terryking228

#1
Jan 14, 2018, 03:02 am Last Edit: Jan 14, 2018, 03:03 am by terryking228
Hi,
See that specification you pointed to:

---------------------( COPY )---------------------  
Operating speed (at no load)
4.8V                  6.0V

0.14 sec/6°t       0.12 sec/6°t
-----------------( END COPY )----------------------

So your battery is WAY too low a voltage.. You might use 2 Lipos for 7.2V or so....

(DHL will ship small LiPo from China; extra charge of $10 or so..) Ask your supplier..
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

ChrisNZ

Thanks Terry,
Do I also need to worry about capacity or discharge rate, or just bump the voltage?
The arm is going on a kid so weight is a consideration.

Also I'm guessing I'm going to need a step down converter to drop the voltage from 7.4v to about 5v? What sort of current draw should I expect through it? 3A seems to be a common capacity for these items?

terryking228

Hi,
There is a lot of discussion out there about running "4.8..6V" servos on 7 volts which is what's approximately provided by 2 LiPo cells.  Quite a few people, especially model car racers, seem to get away with it OK.

There are two main parts to a typical servo: The motor-gears assembly and the motor driver and pulse electronics.  See THIS PAGE . The typical DC motors don't have an exact voltage and run faster/stronger with higher voltage.

I THINK you could get away with 7V on most servos, but the problem would be most severe if the servo was stalled with 7V applied. This might damage the motor but more likely would damage the electronics in the servo (especially the 'H-Bridge' that runs the motor in forward and reverse.) 

How fast a response do you need?  What is the interface between the human and the hand?

And 1000 more questions: Normal mode for the beginning of a design.

Arduino Generally: Just get started with simple things, get one thing working at a time..

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

ChrisNZ

Thanks Terry,
During testing we used a bench power supply at 5v which moved the finger pretty fast. I think I'll drop it to 5v as any faster would be too fast.
The interface is based on the Myoware sensor linked in my first post.
I think I'll source a 7.4v battery from China and go from there.

MarkT

Are you saying the LiPo voltage dropped to 2V??  If so its in a dangerous state and needs correct disposal.
LiPo should never be over-discharged.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

ChrisNZ

It temporarily drops to 2v when the servo is connected, then comes back up as soon as the servo is disconnected.

Go Up