Voltage drop under load and voltage sensing

I have a resistor divider to measure voltage. The values of both the resistors are 10k. My battery voltage is 8.4 volts that provides the voltage for my motors and servos outputting 6v via a linear regulator. A separate battery with a switching regulator provides 5v for the micros .etc.

The regulator for the motors/servos will no longer output 6v when the voltage is lower than 7v. Thus, I turn off the regulator if that happens with my Arduino.

The issue I am facing is that if the actual voltage of the battery is around 7.4 and I am drawing current from 5 servos simultaneously, and 2 motors, the voltage display goes quickly down to ~7 and then the system shuts off.

The issue is that there is a discrepancy between the voltage under high load (all motors/servos working) and the voltage under minimal load (maybe 2-3 servos working) causing the system to shutdown prematurely. I check the voltage every 6 seconds, and the running total gets added to an array via the function digital_smooth to sort of, well, smooth out the actual ADC values.

This function actually I think helps with some of the load spikes, but if the spikes are consistent than it drops quickly.

Is there anyway I can minimize the load drops or account for it in some non-arbitrary way? Or is that just par for the course when dealing with massive simultaneous current draws?

If the latter is true, I guess I could implement some current sensing to see when the draw is high and to somehow account for that with the voltage readings.

I guess I'm curious to see if anyone has faced an issue like this before when doing voltage measurements, and if so, how they dealt with it.

float check_motor_batt() {
  int raw = digital_smooth(analogRead(motor_batt_div), motor_batt_array);
  return voltage_divider(raw);
}
int digital_smooth(int rawIn, int *sensSmoothArray) {    // "int *sensSmoothArray" passes an array to the function - the asterisk indicates the array name is a pointer
  int j, k, temp, top, bottom;
  long total;
  static int i;
  // static int raw[filterSamples];
  static int sorted[filterSamples];
  boolean done;
  i = (i + 1) % filterSamples;    // increment counter and roll over if necc. -  % (modulo operator) rolls over variable
  sensSmoothArray[i] = rawIn;                 // input new data into the oldest slot
  // Serial.print("raw = ");
  for (j = 0; j < filterSamples; j++) { // transfer data array into anther array for sorting and averaging
    sorted[j] = sensSmoothArray[j];
  }
  done = 0;                // flag to know when we're done sorting
  while (done != 1) {      // simple swap sort, sorts numbers from lowest to highest
    done = 1;
    for (j = 0; j < (filterSamples - 1); j++) {
      if (sorted[j] > sorted[j + 1]) {    // numbers are out of order - swap
        temp = sorted[j + 1];
        sorted [j + 1] =  sorted[j] ;
        sorted [j] = temp;
        done = 0;
      }
    }
  }
  /*
    for (j = 0; j < (filterSamples); j++) {   // print the array to debug
    Serial.print(sorted[j]);
    Serial.print("   ");
    }
    Serial.println();
  */
  // throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom
  bottom = max(((filterSamples * 15)  / 100), 1);
  top = min((((filterSamples * 85) / 100) + 1  ), (filterSamples - 1));   // the + 1 is to make up for asymmetry caused by integer rounding
  k = 0;
  total = 0;
  for ( j = bottom; j < top; j++) {
    total += sorted[j];  // total remaining indices
    k++;
    // Serial.print(sorted[j]);
    // Serial.print("   ");
  }
  //Serial.println();
  //Serial.print("average = ");
  //Serial.println(total / k);
  return total / k;    // divide by number of samples
}

alex_fagard:
Is there anyway I can minimize the load drops or account for it in some non-arbitrary way?

Capaticors, but they only help in some way / for the short bursts

alex_fagard:
Or is that just par for the course when dealing with massive simultaneous current draws?

So mainly, yes. 5 servo's alone is already a pretty high load. A small servo on its own can draw 1A+ with ease.

alex_fagard:
If the latter is true, I guess I could implement some current sensing to see when the draw is high and to somehow account for that with the voltage readings.

Why take that in account? If you do draw that much the voltage IS to low which WILL cause the regulator to drop out which IS not what you want...

So more of a solution, get a battery that can deliver the current better. Or don't try to do all motion at the same time. If the voltage drops that much under load I bed you discharge the battery faster then it's designed for. (Or you just have very poor wiring...)

septillion:
Capaticors, but they only help in some way / for the short bursts
So mainly, yes. 5 servo's alone is already a pretty high load. A small servo on its own can draw 1A+ with ease.
Why take that in account? If you do draw that much the voltage IS to low which WILL cause the regulator to drop out which IS not what you want...

So more of a solution, get a battery that can deliver the current better. Or don't try to do all motion at the same time. If the voltage drops that much under load I bed you discharge the battery faster then it's designed for. (Or you just have very poor wiring...)

I've got some reservoir caps on the output of the regs, and some smaller caps where it goes from the first stage of the robot to the second stage (beginning of the black base in the image). So I don't think that's the issue. Also the wiring is all pretty robust (18awg) until it goes to the servo wire (22awg).

Indeed I know servos can draw a lot of power, that's why I'm not using a switching reg for the servos/motors an instead an LM338 which is rated to deliver 5 amps. I should note that I made a mistake in my original post: the motors use the same battery but are not on the regulator.

I'm using this battery: https://www.conrad.nl/nl/nimh-accupack-84-v-3000-mah-conrad-energy-stick-tamiya-stekker-238795.html?WT.mc_id=gshop&insert=8J&gclid=CjwKEAjw1PPJBRDq9dGHivbXmhcSJAATZd_BWaM6HmIfvxVtb7VzbRgKu95lFdyavvSvAC9Z6tjORxoCfpTw_wcB&tid=810747757_43526169802_pla-303872096111_pla-238795&WT.srch=1

Do you think that might be the issue? Its 3000mah.

What regulator are you using that can supply that many servos at one time?

tinman13kup:
What regulator are you using that can supply that many servos at one time?

LM338. says in the post above :wink:

I would not call AWG18 robust...

And what do you see if you connect a DMM to various places? So directly over the battery. Over the regulator. etc

And using a linear regulator doesn't really make sense to me... You have high power switch modes as well. Because (8,4V - 6,0V) * 5A = 12W!!!! So that LM338 can get pretty hot very easily. A switch mode will load the battery less.

And it doesn't really matter if the motors load the regulator. But what do they draw? And is the total rating under (or better a order of magnitude under) the max discharge rating of the battery? I can't see a rating but NiMH batteries are not terrible good at delivering high current. And if I assume the motor to also draw 1A with ease you might draw 2C to 3C out of the battery which will indeed cause it to drop considerably.

So bottom line, I think you should just limit (by not turning on to many things at the same time) the current. Or use a battery that can handle higher discharge rates and use a switch mode converter.

septillion:
I would not call AWG18 robust...

And what do you see if you connect a DMM to various places? So directly over the battery. Over the regulator. etc

And using a linear regulator doesn't really make sense to me... You have high power switch modes as well. Because (8,4V - 6,0V) * 5A = 12W!!!! So that LM338 can get pretty hot very easily. A switch mode will load the battery less.

And it doesn't really matter if the motors load the regulator. But what do they draw? And is the total rating under (or better a order of magnitude under) the max discharge rating of the battery? I can't see a rating but NiMH batteries are not terrible good at delivering high current. And if I assume the motor to also draw 1A with ease you might draw 2C to 3C out of the battery which will indeed cause it to drop considerably.

So bottom line, I think you should just limit (by not turning on to many things at the same time) the current. Or use a battery that can handle higher discharge rates and use a switch mode converter.

The 18 awg wire I have is approx 4 cores and according to this it means it can deliver 5.6 amps? But in any case I can't really make it any larger otherwise the base wouldn't rotate properly as the strain of 'moving' the wires would be too much on the servo. Kindof hard to explain.

Anyways, I was unable to find a switching reg to deliver more than 5amps so I didn't go for it. And I had a PCB printed with the lm338 in mind which is currently housed so that's out as well.

Do you perhaps have an recommendations for the type of battery I should try? Even a link to one in specific so I can hone in my search would be very useful!

Thanks for all your input! :slight_smile:

Being able to deliver that current without melting or getting hot is one thing, not dropping to much voltage for the application is another. And I would say around 5% is about the max I would let it drop under load.

They do exist. And you can always use multiple smaller converters. Extra benefit is you can place them close to the servo and use a higher voltage (thus lower current) in the supply wires.

A big fat LiPo (or other Lithium type) with a high C rating. But you really need to know what you pull to know what you need.

The ancient LM338 has a dropout voltage of ~2.5volt under load.
Bad choice trying to make a stable 6volt from a ~7.2volt battery with that regulator.
Leo..

Are the pcb traces sized to handle the current? Battery packs can be put in parallel to up the amps, but you have to look at it as a system. A battery pack capable of 20A is worthless if you have 10mil traces

Hi,

Can you please post a COMPLETE copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Also your PCB design and a picture of your project?

Thanks.. Tom.. :slight_smile:

Indeed I know servos can draw a lot of power, that's why I'm not using a switching reg for the servos/motors an instead an LM338 which is rated to deliver 5 amps.

Non sequitur.

You can find switching regulators in an extremely wide range of sizes, from the micropower regulators that boost up a single AA to run a wireless mouse to the beefy synchronous, multi-phase VRMs on a computer motherboard capable of throwing 100 amps at an overclocked CPU.

Saying "they use too much power, so I'm using a linear regulator" is like saying "This room's too hot, turn off the air conditioning". Everyone around you is just going to give you a blank stare.

alex_fagard:
The issue I am facing is that if the actual voltage of the battery is around 7.4 and I am drawing current from 5 servos simultaneously, and 2 motors, the voltage display goes quickly down to ~7 and then the system shuts off.

The issue is that there is a discrepancy between the voltage under high load (all motors/servos working) and the voltage under minimal load (maybe 2-3 servos working) causing the system to shutdown prematurely. I check the voltage every 6 seconds, and the running total gets added to an array via the function digital_smooth to sort of, well, smooth out the actual ADC values.

If you knew the total load current and the internal resistance of the battery you could correct for
the internal resistance voltage drop. However internal resistance of a battery usually varies with the
temperature and state of charge, so its not so easy to do this.

If you can arrange to only sample the battery voltage when the load is a minimum, that would be a
possible way around this.

Alternatively if you know how heavy the load is at the time you make the measurement you could subtract
a fudge-factor from the threshold to allow for the voltage droop and not cut-off prematurely.

Jiggy-Ninja:
Non sequitur.

You can find switching regulators in an extremely wide range of sizes, from the micropower regulators that boost up a single AA to run a wireless mouse to the beefy synchronous, multi-phase VRMs on a computer motherboard capable of throwing 100 amps at an overclocked CPU.

Saying "they use too much power, so I'm using a linear regulator" is like saying "This room's too hot, turn off the air conditioning". Everyone around you is just going to give you a blank stare.

I'm simply stating that I couldn't find a 5amp rated switching reg pre built, not that I chose it for its power usage characteristics.

tinman13kup:
Are the pcb traces sized to handle the current? Battery packs can be put in parallel to up the amps, but you have to look at it as a system. A battery pack capable of 20A is worthless if you have 10mil traces

The PCB traces are about ~40mil (1mm) for all the power traces. I used some online tool to determine this.

But even if you compensate for battery resistance, the voltage really IS to low for the reg to regulate so the turning off IS want you want if you want to turn the system off if you don't have a stable 6V...

And 1mm tracks, that sounds more like a fuse able track to me... I would say 20mm is closer to what you need....

alex_fagard:
I'm simply stating that I couldn't find a 5amp rated switching reg pre built, not that I chose it for its power usage characteristics.

Fair enough. It's just an odd thing to see.

Instead of (or in addition to) just monitoring the battery voltage, why not monitor the regulator output? I think most servos can operate from 4V-6V, so if you monitor the regulated line for brownouts you don't need to care that much about the battery characteristics. Even if it sags below the input dropout voltage for the regulator, as long as the output is in range you don't need to cut things off.

Hi,
Pleasee read post #10,
You have all the information that we need in two items, circuit diagram and a picture of your project.

A picture is worth more than the odd thousand words.

Thanks.. Tom... :slight_smile:

Jiggy-Ninja:
Fair enough. It's just an odd thing to see.

Instead of (or in addition to) just monitoring the battery voltage, why not monitor the regulator output? I think most servos can operate from 4V-6V, so if you monitor the regulated line for brownouts you don't need to care that much about the battery characteristics. Even if it sags below the input dropout voltage for the regulator, as long as the output is in range you don't need to cut things off.

That is a really interesting idea! Really like it!

TomGeorge:
Hi,
Pleasee read post #10,
You have all the information that we need in two items, circuit diagram and a picture of your project.

A picture is worth more than the odd thousand words.

Thanks.. Tom... :slight_smile:

Without taking everything apart my robot is separated into two parts. A base which has tracks and all of the power circuitry and a 'body' which rotates on the base. First the battery goes into a distribution block, then goes to a terminal block on the pcb (attached; base) from there it goes up to the 'body' and into another pcb where power gets distributed to the servos (this schematic is also attached). All the power wires are 18awg and the traces 1mm.

rufus-connectorb.pdf (16.9 KB)

rufus-base-v1e-newholes.pdf (53 KB)

Hi,
Thanks for the PCB and picture, now the circuit diagram.
I don't see much in the way of bypass caps, especially at the LM338.

Also a tip, when you pay to get your PCB made, it is no cheaper if you leave as much copper on your PCB as possible.
Don't be scared to thicken up your tracks, especially around power components like BD139.

Don't forget your PCB started as two sheets of copper which you have payed for, then you are paying to remove it and not get it back.

Good bit, lots of pinout and component labels. Needs e, b ,c but thats nit picking.

Tom... :slight_smile:

TomGeorge:
Hi,
Thanks for the PCB and picture, now the circuit diagram.
I don't see much in the way of bypass caps, especially at the LM338.

Also a tip, when you pay to get your PCB made, it is no cheaper if you leave as much copper on your PCB as possible.
Don't be scared to thicken up your tracks, especially around power components like BD139.

Don't forget your PCB started as two sheets of copper which you have payed for, then you are paying to remove it and not get it back.

Good bit, lots of pinout and component labels. Needs e, b ,c but thats nit picking.

Tom... :slight_smile:

The company I use - Easy EDA - charges for copper actually (I think they print it on the board). I used the LM338 datasheet for the 1uf cap on input stage, and then 10uf on output, isn't that enough?