Arduino Forum

Using Arduino => General Electronics => Topic started by: BabyGeezer on Apr 22, 2019, 06:37 am

Title: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 22, 2019, 06:37 am
First off, i have concluded that Bluetooth (v2) is quite power hungry and am probably going to end up abandoning it and switching to using the nRF24L01 modules.

However, i encountered a weird situation re powering the circuit and that is the main reason for this question.

The issue is at the power supply end, i don't think there is anything amiss elsewhere but the whole setup looks like this;
(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=304954)

FWIW: the setup works with power from the PC-USB through a 3v3 USB-to-TTL adaptor.

But when i try alternative power supplies, it fails - my conclusion is insufficient current for (or because of) the HC-05 - which is why i will switch to the nRF24 option.

The following are the various options that i had tried just for completeness sake, but the key point is the last one, #5 ; and of course #1 as reference point of what did work.
(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=304947)

FYI, i break the circuit (for current-measuring) at the top-left part of the schematic - ie. where the power supply goes to the power rail.

Why is the circuit "stable" (ie. servo does not jitter) when i'm measuring the current ?
(Is the DMM acting like some kind of buffering capacitor - i had already tried a 10uF and even 1000uF which didn't make a difference, well - slightly less of a jitter)

EDIT:
just to clarify further - *when i'm measuring* - means the servo jitters when the circuit is left alone, but when it is broken and the DMM is inserted (to measure the current) the servo doesn't jitter anymore - what is happening here ?

EDIT2:
forgot to add that Servo ground *is* also tied.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 22, 2019, 10:07 am
Quote
Why is the circuit "stable" (ie. servo does not jitter) when i'm measuring the current ?
You have inadequate power supply decoupling in the circuit and the meter is acting as an inductor. See the last circuit on this page
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html (http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html)
Servos do generate a lot of interference and an inductor along with a capacitor does cut this down. The most effective place for a Pi circuit like this is in the supply to the servos. The inductor suppresses sudden spikes which it looks like you are getting into the control circuit.
For the most effect you could have a Pi circuit like this on each servo.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 22, 2019, 11:09 am
ahh, i see - while the supply was separated, it was a matter of insufficient current to the control circuit, but then when i combined/shared the supply (to something beefier) - it became a different problem - ie. "over current" due to spiking - i did see the numbers surge briefly.

so; even if i had switched over to the nRF24, i would have faced the exact same problem !
(Thanks for saving me from going through that ! :) )

i guess one simple solution would be to just maintain separate power supplies.



Quote
For the most effect you could have a Pi circuit like this on each servo.
hmm, i'm not sure how to set that up since it's using a "servo controller" module.
(i'd have to setup a whole PCB of support circuitry next to the PCA9685 module)

although, i just had a look at the datasheet for the PCA9685 and it's really meant for PWM-ing LEDs and not really servos.

i'm hoping that using 9g micro servos will still be okay though.

is this number '400mA' (ISS) from the datasheet the maximum current that the module can withstand (on it's driving outputs) ?

(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=304964)

Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Paul__B on Apr 22, 2019, 11:51 am
so; even if i had switched over to the nRF24, i would have faced the exact same problem !
Frequently the case.

If it doesn't work and you don't know why, well, trying "something else" is not so smart.  :smiley-roll:
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 22, 2019, 01:17 pm
Frequently the case.

If it doesn't work and you don't know why, well, trying "something else" is not so smart.  :smiley-roll:
ehm... isn't that the basis of the scientific method ? :P
you don't know - but you guess* what it is, and then that guess is either validated or proven wrong, at which point you will then DO know (something).

* = educated one, conjecture or theory...
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Qdeathstar on Apr 22, 2019, 02:44 pm
I agree, try something else till it works is OK, especially for hobbiest.  It's not efficient but it is certainly an acceptable method for learning.
 
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 22, 2019, 03:09 pm
...try something else till it works is OK,...
 
i don't mean just trying other things until it sticks - i still want to find out *why* the previous attempt did NOT work. (that is how you DO learn)

the 50+mA for the HC-05 was still a shock to me though, so i would be making that change (to nRF24) nonetheless.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: wvmarle on Apr 22, 2019, 03:37 pm
ehm... isn't that the basis of the scientific method ? :P
you don't know - but you guess* what it is, and then that guess is either validated or proven wrong, at which point you will then DO know (something).

* = educated one, conjecture or theory...
Close. The scientific method is more like: propose a theory, design experiments that can test it. Definitely not "just try something". Repeatability is part of this.

In your case, you concluded "not enough power due to the BT module". The simplest experiment to prove/disprove this would be to remove the BT module from the circuit, see if the jitter goes away. That's an experiment I don't see in your power supply tests. I expect it won't make a difference, if only because BT is designed to be low power, secondly because the power requirement of a BT (or NRF24) module is far less than that of a typical servo.

Your PCA9685 should be perfectly fine as it just provides the signal for the servo, not the power (unless you wire it totally wrong). If used with LEDs it can probably drive LEDs directly. An LED takes 10-20mA typically, a signal ideally no current, in reality maybe a few µA, should be <1mA. No problem there.

Pi filters work well. I'm using them mostly on the MCU side, to keep the noise of the motors out. That's when using a 12V circuit supplying power to a number of motors and projects. 12V supply, diode (Schottky for lower voltage drop but a 1N400x will do just fine), then Pi filter before the 12V-5V buck converter. The diode is to prevent back flow, really helps in my case even though I'm using 1.5 mm2 wires.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 22, 2019, 05:30 pm
Close. The scientific method is more like: propose a theory, design experiments that can test it. Definitely not "just try something". Repeatability is part of this.

In your case, you concluded "not enough power due to the BT module". The simplest experiment to prove/disprove this would be to remove the BT module from the circuit, see if the jitter goes away. That's an experiment I don't see in your power supply tests. I expect it won't make a difference, if only because BT is designed to be low power, secondly because the power requirement of a BT (or NRF24) module is far less than that of a typical servo.
yeah, okay - my method of conclusion was suspect - but that was when using separate supply, and i did measure current draw of the control circuit with and without the HC-05 under the "working" situation, so there was no jittering in that setup.

i failed to take into consideration the new factors when i then combined the supply, because the symptoms looked the same.


Your PCA9685 should be perfectly fine as it just provides the signal for the servo, not the power (unless you wire it totally wrong). If used with LEDs it can probably drive LEDs directly. An LED takes 10-20mA typically, a signal ideally no current, in reality maybe a few µA, should be <1mA. No problem there.
okay, thanks for the confirmation - i did think that the PCA9685 would "just" be dealing with the signalling currents and so surmised the servo (power) currents themselves wouldn't be catered to in that datasheet.


Pi filters work well. I'm using them mostly on the MCU side, to keep the noise of the motors out. That's when using a 12V circuit supplying power to a number of motors and projects. 12V supply, diode (Schottky for lower voltage drop but a 1N400x will do just fine), then Pi filter before the 12V-5V buck converter. The diode is to prevent back flow, really helps in my case even though I'm using 1.5 mm2 wires.
i guess i should make one then - if not Mike's ideal suggestion of one per servo, at least one for the control circuit as a whole.

will have to start learning how to make my own choke (air-core coils) and set up a proper power circuit for the project from a single supply.

i think the PCA9685 can't handle V+ above 6V and i probably don't want to run the SG90s with more than that anyway - which doesn't leave much room for a series(back flow) diode (drop) and then the LD1117A(3v3) also.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: wvmarle on Apr 22, 2019, 06:46 pm
That series diode is absolutely not needed for motors, or in most situations really. But when running nearly a dozen water pumps (brushless DC) and a handful of air pumps (probably brushed DC) on the same power supply you do get to see quite some noise.

Don't bother making your own coils, not worth your time. Basic inductors are really cheap. Ferrite core is far more efficient, you're not looking for perfection in this application - air coils are for things like HiFi sound applications.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 22, 2019, 07:06 pm
hmm, i'm not sure how to set that up since it's using a "servo controller" module.
(i'd have to setup a whole PCB of support circuitry next to the PCA9685 module)
Using a servo control module is irrelevant. It is the power feed to the servos not the signal that need decoupling. So:-
power supply -> Pi circuit 1 ->  +ve of servo 1
power supply -> Pi circuit 2 ->  +ve of servo 2
power supply -> Pi circuit 3->  +ve of servo 3
power supply -> Pi circuit 4->  +ve of servo 4
and so on.

Quote
although, i just had a look at the datasheet for the PCA9685 and it's really meant for PWM-ing LEDs and not really servos.
Again irrelevant it is equally suited to servos as it is to LEDs or anything else that needs PWM. Incidentally you can't set up the chip so that you can do LEDs on some channels and servos on others. It is a bit of a long winded explanation not worth going into but just stick to servos or LEDs per chip.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 22, 2019, 07:29 pm
That series diode is absolutely not needed for motors, or in most situations really. But when running nearly a dozen water pumps (brushless DC) and a handful of air pumps (probably brushed DC) on the same power supply you do get to see quite some noise.
i see, i had another thread on a simple 2-wheel vehicle with BJTs running DC motors and a series diode was suggested on the (shared) power supply to the Pro Mini to prevent potential brownout if the motors tried to draw more current.


Don't bother making your own coils, not worth your time. Basic inductors are really cheap. Ferrite core is far more efficient, you're not looking for perfection in this application - air coils are for things like HiFi sound applications.
well, certainly not as a habit, but i think it would be at least worth the learning experience and calculating values from first principles - plus, if i had to buy them it would take a while to arrive, and i do have some enamel wire on hand for experimentation. (also for mucking about with Joule Thiefs :) )

and even if only just to see the above circuit "improve" as per the effect with the insertion of the DMM.

Using a servo control module is irrelevant. It is the power feed to the servos not the signal that need decoupling. So:-
power supply -> Pi circuit 1 ->  +ve of servo 1
power supply -> Pi circuit 2 ->  +ve of servo 2
power supply -> Pi circuit 3->  +ve of servo 3
power supply -> Pi circuit 4->  +ve of servo 4
and so on.
thing is the PCA9685 module handles the V+ (for each servo) as well, so i'd have to breakout the 3-pin male headers just to insert a Pi circuit for each.


Again irrelevant it is equally suited to servos as it is to LEDs or anything else that needs PWM. Incidentally you can't set up the chip so that you can do LEDs on some channels and servos on others. It is a bit of a long winded explanation not worth going into but just stick to servos or LEDs per chip.
yes, read that part in the datasheet.

again, i got side-tracked with thinking of the servo power consumption, whereas i should just be thinking servo signal only.

now, if it were PWM-ing a DC motor for speed control, that would be a different matter right ?
seeing there's a limit of 10mA per pin in the datasheet - and i'm guessing that a flyback diode would also be necessary.
no, just use a MOSFET...
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: wvmarle on Apr 22, 2019, 07:52 pm
The main problem of Pi filters is the size. Big inductor, big capacitors. Especially if you use 2,200µF ones on the output side as I usually do (220µF was just not enough...)
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 22, 2019, 08:35 pm
Quote
thing is the PCA9685 module handles the V+ (for each servo)
No it dosn't.

Quote
The main problem of Pi filters is the size. Big inductor, big capacitors.
No you can use small inductors and small capacitors. I do it all the time.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Southpark on Apr 22, 2019, 11:45 pm
ehm... isn't that the basis of the scientific method ? :P
you don't know - but you guess* what it is, and then that guess is either validated or proven wrong, at which point you will then DO know (something).

* = educated one, conjecture or theory...
Science is about explaining and predicting observed/observable/measurable phenomena - coming up with plausible/backable theories to explain the mechanisms behind the observations. It is built-up on accumulated scientific knowledge - (math, gathered data, physics, chemistry etc).

Switching over to something else (eg. nrf24L01) when the existing device (hc-05) is expected to be workable is certainly an option. But, naturally - it is definitely advantageous to find out the reason(s) for a particular approach being currently unable to achieve your objective ----- which is why you asked about it, and which is good. This enters the area of electronics/electronic engineering, and working towards improving electronics knowledge and skills.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: wvmarle on Apr 23, 2019, 03:20 am
Size is relative. The smallest inductor is huge compared to a 0805 resistor; especially if you want lower resistance. Typical 9-10mm diameter and some 12-15 mm high.
Electrolytic capacitors are likewise bulky.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 23, 2019, 03:46 am
Quote
thing is the PCA9685 module handles the V+ (for each servo)
No it dosn't.
maybe i should have phrased it differently, i meant that the whole breakout module that the PCA9685 chip is on has just one pin (two in parallel actually) for the incoming V+, meaning that to insert a Pi circuit for each servo, one has to breakout the 3-pin male headers to achieve the setup of;
Quote
power supply -> Pi circuit 1 ->  +ve of servo 1
power supply -> Pi circuit 2 ->  +ve of servo 2
power supply -> Pi circuit 3->  +ve of servo 3
power supply -> Pi circuit 4->  +ve of servo 4
and so on.
Science is about explaining and predicting observed/observable/measurable phenomena - coming up with plausible/backable theories to explain the mechanisms behind the observations. It is built-up on accumulated scientific knowledge - (math, gathered data, physics, chemistry etc).
if the accumulation is unstructured and quite haphazard in its collection, it becomes quite inefficient and the knowledge is filled with (unknown) gaps.


Switching over to something else (eg. nrf24L01) when the existing device (hc-05) is expected to be workable is certainly an option. But, naturally - it is definitely advantageous to find out the reason(s) for a particular approach being currently unable to achieve your objective ----- which is why you asked about it, and which is good. This enters the area of electronics/electronic engineering, and working towards improving electronics knowledge and skills.
yes, this is more my objective than just getting a project to actually work.

it's been three years since i first bought a MPU-6050 module (with unsoldered headers) and i am still learning about all the basics of each part that goes into making a self-balancing robot, trying to make do with existing actuators and power supply options, and finding out why it is not suitable and then trying to make cheap setups work just on principle.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 23, 2019, 07:08 am
Quote
i meant that the whole breakout module that the PCA9685 chip is on has just one pin (two in parallel actually) for the incoming V+, meaning that to insert a Pi circuit for each servo, one has to breakout the 3-pin male headers to achieve the setup of;
No.
You put the filter between the break out board and the servo.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Southpark on Apr 23, 2019, 12:32 pm
if the accumulation is unstructured and quite haphazard in its collection, it becomes quite inefficient and the knowledge is filled with (unknown) gaps.
Which is to be avoided where possible. And there are gaps in knowledge.... which is why pursuit of science knowledge and methods is ongoing. Science and engineering and other disciplines have gotten us to this interesting technological stage.... I have no issues with the 'structure' and 'efficiency' side of things with science.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Chetan_ on Apr 23, 2019, 12:42 pm
I just want to know which 3.3V regulator you used I am also with the same project.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 23, 2019, 12:52 pm
Size is relative. The smallest inductor is huge compared to a 0805 resistor;
No it is not.
Surface mount inductor on the left 0805 resistor on the right.
(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=305212)
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 23, 2019, 01:42 pm
I just want to know which 3.3V regulator you used I am also with the same project.
i'm still prototyping and haven't even settled on how to supply the power properly - at the moment i'm using the LD1117A(3v3) - it's a LDO type. (although also using a DC-DC step-down converter - based on LM2596 chip)

No.
You put the filter between the break out board and the servo.
so you mean like this ?
(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=305216)

meanwhile, on your webpage that you linked, it says using inductance values of tens of milli-henries.

i've been calculating what length and radius of coil that would involve and it's *huge* !

is my current circuit really needing that high a value - i can't imagine that's what my DMM was "contributing" ?

what sort of inductance/choke levels would be reasonable for 6V spikes of 100mA ?
(is there a formula for this and what would the 'phenomena' be called ?)
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 23, 2019, 02:59 pm
Quote
so you mean like this ?
No.

Like this:-
(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=305227)
The square boxes are the servos.

Quote
i can't imagine that's what my DMM was "contributing" ?
Your right it wasn't so that suggests you don't need that much inductance so you only need a small value. That was a general purpose comment for heavy motors.

Quote
what sort of inductance/choke levels would be reasonable for 6V spikes of 100mA ?
You can't say without first defining the period of the pulse and you don't know that.

Quote
is there a formula for this and what would the 'phenomena' be called
This is called "inductive reactance" https://www.electronics-tutorials.ws/inductor/ac-inductors.html (https://www.electronics-tutorials.ws/inductor/ac-inductors.html) and is the effective resistance an inductor presents when fed with an AC signal. This is a pure inductance where the actual resistance is considered zero.

The formula is inductive reactance in ohms = 2 * Pi * f * L
where f is the frequency in Hz and L is the inductance in Henries
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: wvmarle on Apr 23, 2019, 03:08 pm
meanwhile, on your webpage that you linked, it says using inductance values of tens of milli-henries.

i've been calculating what length and radius of coil that would involve and it's *huge* !
My 10 mH inductors are still the standard 10mm radius, 12mm tall. Not too bad. Ohmic resistance is increasing of course (I'm sure the larger the induction the thinner the wire used to be able to have more coils, so more resistance per length and more overall length) so I'm normally using 330µH for my filters. Just 2-3Ω so not too much losses.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 23, 2019, 05:36 pm
No.

Like this:-
The square boxes are the servos.
yes, that was kind of my original point about having to "insert" the Pi circuit and not being able to (be lazy and) "just plug in the servo connection" :P

(https://forum.arduino.cc/index.php?action=dlattach;topic=611516.0;attach=305249)


Your right it wasn't so that suggests you don't need that much inductance so you only need a small value. That was a general purpose comment for heavy motors.
i see - okay then, i'll try and hand make a coil just to see if it holds back the jitter.
(more to do with "see what happens" than designing the circuit ideally.)

by my calculation, a simple straight (air core) coil of 20mm radius, 10mm long with 20 turns should give about 63 micro-H. (that's already 2.5 meters of the enamel wire needed(!), i don't have any ferrite (nor iron) core - now i get the "don't bother making your own" comment !)


You can't say without first defining the period of the pulse and you don't know that.
...
the effective resistance an inductor presents when fed with an AC signal. This is a pure inductance where the actual resistance is considered zero.
so, good'ol V=IR applies here where the (supressing) "resistance" required would be an equivalent of (6V / 100mA) = 60 Ohm ?
and if i can get the frequency; the (minimum) inductance would be L = 60 / (2*Pi * f)

would the inverse of the pulse(time) be considered the 'frequency' ?
(am just realizing that AC doesn't have to be a constant period, and that a "DC spike" is also AC !)

Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: wvmarle on Apr 23, 2019, 06:11 pm
An inductor basically tries to keep the current constant - it uses energy stored in its magnetic field for that. That's also why you need that flyback diode on inductive loads: so the current can continue to flow.

When you have a pure DC current flowing, all you see is the ohmic resistance, as in the normal resistance of the wire used. Note that when the power is switched on the inductor resists, so current starts up a bit slower as the magnetic field builds up.

So it rejects all changes in current, that includes spikes. For the same reason an inductor has a much larger resistance for AC current - it changes all the time. This is normally called "impedance" which includes many more effects than just ohmic resistance.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: Grumpy_Mike on Apr 23, 2019, 06:32 pm
Quote
would the inverse of the pulse(time) be considered the 'frequency'
Yes.

Reactance is just one aspect of impedance but for this application you don't care about impedance.

Without a ferrite core an air core inductor is too big and does not work as well as the ferrite is lossy and absorbs some of the energy in the spikes.
Title: Re: Why does the DMM make this circuit "work" ? (Power issues : servo & bluetooth)
Post by: BabyGeezer on Apr 24, 2019, 04:40 am
ok then - thanks a lot, Mike and wvmarle !

new adventures into the world of coils will have to be planned soon.