Author Topic: odd power issue  (Read 848 times)

laazarus

  • Newbie
  • *
  • Posts: 6
odd power issue
« on: March 18, 2017, 04:58:13 am »
I'm using a digispark to drive a couple of servos (p0,p1) and having them move to preset positions based on pulling p2, p3 or p4 high with an rf remote board.
power for the servos, rf board and digispark are all pulled to a single point and power fed in at that point. problem I'm having is that it works perfectly using a 5v 3a BEC with a 3 cell lipo driving it (output measured at 5.02v). This power setup is too big so i'm trying to drive it with 2x aaa bateries through a 2a buck converter (measured output 5.08v) and the result seems to be that digispark is stuck in a boot loop. also tried driving it with 4x aaa (no buck converter and voltage over 6v) but get the same boot loop. With the meter connected i don't see any voltage drop as the board boots (or reboots). also tried with a smoothing cap in place but no improvement. The servos I'm testing with are only 5g and have no loading on them at this point. I have tested with a second digispark and get identical results.

can any one sugest any thing else to try, I'm running out of ideas. this all needs to be mounted on a headband so is cant be to big.

Ralf

  • Guest
Re: odd power issue
« Reply #1 on: March 18, 2017, 05:53:24 am »
Hi,

what value had the smoothing capacitor and did you attach it before or behind the switched regulator?

When I ran a servo from batteries, I had to use an smoothing capacitor of 470µF or more.

Ralf

laazarus

  • Newbie
  • *
  • Posts: 6
Re: odd power issue
« Reply #2 on: March 18, 2017, 09:11:40 am »
ran it after the buck converter and it is 1000uf and 6.3v

PeterF

  • Hero Member
  • *****
  • Posts: 804
Re: odd power issue
« Reply #3 on: March 18, 2017, 05:26:37 pm »
I think you mean boost converter - buck converters lower the voltage. There is no way you would get 5v from a buck converter with an input of 3v (2xAAA).

Do you know what the input range is on the ubec... is it a 6v - 24v one? Since you know the setup works with a proper regulated 5v supply from the UBEC, try the 4xAA and the UBEC... it will be close (as the differential input to output is only 1v), but since it is probably a switching type UBEC due to the 3A rating. And when you ran the digispark from the 6v directly... did you connect to the VIN connection, or the 5v connection on the digispark? (hope not the latter... 6v on 5v pin may have killed it!)

Ralf

  • Guest
Re: odd power issue
« Reply #4 on: March 19, 2017, 01:37:17 pm »
Laazarus,

there may be another reason for the Attiny hanging in boot mode, and it may be only a coincidence that you experienced it with your power tests.

You wrote that you use pin3 as an input.

When Pin3 is on LOW voltage during the DigiSpark's boot phase, the DigiSpark hangs in the bootloader and the program is never started. i just tried it wih a Digispark clone.

Ralf

laazarus

  • Newbie
  • *
  • Posts: 6
Re: odd power issue
« Reply #5 on: March 20, 2017, 12:26:35 am »
PeterF, your right it is a boost converter. The ubec input range is 7.2v - 22.2v. I haven't run any more than 5v into the 5v pin, all the higher voltages have been into VIN.

Ralf, I tried removing the input wires from pins 3 and 4 and still got the same results

Its starting to look like its an input current issue. any configuration of AAA batteries gets the same results. shifting up to 3x AA will just about drive a single servo though it will often restart halfway through a movement. stick a single 18650 on it and it works like a champ. in a quest to keep the size down I'm currently testing with an 14500 which seems to hold it own so far :)

Ralf

  • Guest
Re: odd power issue
« Reply #6 on: March 20, 2017, 01:38:07 am »
When the servos drive to a new position the motors need a lot of current. This may cause drops in the supply voltage, especially when using standard AA or AAA batteries.

Most analog servos are very sensitive to changes in the suppy voltage. There is a comparator in it - it compares the voltage of its internal potentiometer (which tells the angle the Servo actually has moved to) against the integrated (lenghtended and flattened) steering pulses coming out of the DigiSpark.

When the supply voltage changes, the potentiometer voltage changes, too, but the inegrated voltage from the steering pulses keeps its value. So the comparator circut gets a wrong idea about the Servo's position and it starts to move erratically, causing more voltage drops.

So you could try to increase the capacitor (using serveral in parallel), or to move the servos at different times, and/or program a ramp so that they do not move to the targeted position as fast as they can, but a bit slower, so that the motors need less current .

Ralf

laazarus

  • Newbie
  • *
  • Posts: 6
Re: odd power issue
« Reply #7 on: March 21, 2017, 01:23:31 am »
That makes sense though at this point it shouldn't be an issue. the current test servos are only 5g and have no load on them so current should be minimal (the final project will use 9g servos (if they ever arrive) so here's hoping its still ok with those). When I had the volt meter running there was no significant change in voltage from the boost converter when the servos tried to move, 0.02v at most so never dropped below 5.06v.
I could look at slowing the servos down a bit though this is not ideal and moving only one servo is not an option for the overall effect of the project (animated cat ears, I have friends who work as teachers out in asia who seem to like giving me projects like this. Last set were 2 9g servos per ear with a 5 button hand remote, though they were based round an arduino leonard usb key board and run happily for  a few hours on 4 aaa's)

Ralf

  • Guest
Re: odd power issue
« Reply #8 on: March 21, 2017, 01:52:57 am »
Well, the spikes on VCC may be so short that you do not see them on a slow voltmeter.

You could try something different, although I do not think that the DigiSpark causes the problems:

Decouple the DigiSpark's VCC from the batteries by a diode (for example, a 1N4001 (or another from the 1N400x series). Cathode (the side marked with the ring) pointing to the DigiSpark's VCC pin.

When the battery voltage drops, the Diode prevents the 4.7 µF capacitor on the DigiSpark from beeing discarged.

By the way, 6V is a bit too much for the ATTiny. The diode also eats up about 0.5V when it conducts - so the Digispark's VCC pin sees only 5.5V.


laazarus

  • Newbie
  • *
  • Posts: 6
Re: odd power issue
« Reply #9 on: March 21, 2017, 02:25:37 am »
I 'd agree that the digispark isn't at fault, getting the power right and it working proves that. The 6v was only part of testing, it's running ok now with the boost converter and a 14500 cell so that will do me. The BOM has gone up a bit but the overall footprint has gone down so that makes the job a bit easier. I've got 3 sets of these to build and another set of the more complex ones before the next trip out in a months time. may investigate the power issue a bit more after that. the digispark is a great little board for these projects so it will be handy to know the limitations and requirements as i'm obviously quite close to the the edge of some thing that it needs to run reliably.