Simple 555 PWM - disappointing performance

May 25, 2005 106 Replies

Your measured brush resistance riding on the "chocolate" oxide coating on copper commutator is quite normal.

I've just measured the motors in a 2.4Vdc high powered multi-tool thingie. The screwdriver motor measured 0.3ohm/0.16mH and the drill motor was 0.3ohm/0.06mH. Both sets of measurements did not change for any positions of the rotor. So your 0.1mH could be ok. After all, there is an air gap in each magnetic path.

The LTspice simulation had a 3mH guess. The change to 0.1mH (and to 0.3 ohms) drastically changes the L/R time constant. At 300Hz there is now no integration effect from the L and the motor current just bangs on and off.

With a base-current of 112mA the generic 2N3055 in LTspice pulls out of saturation at Ic= 2.4A, and this makes a nonsense of everything.

Tony Williams.

I've been trying to model something that simulates the back-emf that a motor generates whilst running.

--+-- 4V | \\ /R1 (0.5R) \\ | ) )L1 (3mH) ) | +----+-----+-------+ | | | | _|_ | | _|_ | | \\ |+ | | I2| I | /R2 ===C1 | I |I1 |___| \\ | |___| \\|/ | | \\|/ | | | | +----+-----+-------+ | 100R |/c 300Hz------/\\/\\---|Q1 = 2N3055 +12v to +0.4v |\\e | -+-0v

I2 represents a fixed gearbox torque loss.... = 0.5A R2 is the speed dependant torque loss........ = 1.9R I1 is the external torque load... 0 to 1A so far. C1 represents the energy storage of the rotor. The value of C1 is roughly chosen to emulate the time constant of the rotor. 2000uF as a first stab.

When chopping, the voltage that results across C1 should represent the generated back-emf, which is also a measure of the speed of the motor.

The LTspice simulation, at 300Hz 50:50, shows a pitiful performance from the 'motor'. At an I1 of only 1A the voltage across C1 is down to 0.16V, which suggests a motor rpm of only 8% of the no-load speed at 2.4Vdc.

Suggestions to improve the model are welcomed.

Tony Williams.

it depends on how the inductance changes (with current and rotor angle), but yes it will.

The technique I use to measure L is as follows:

gear:

1 x whopping great cap + 1k resistor to DC psu 1 x current probe (or 10 1R resistors in parallel)

- charge up the cap. slap a scope probe across it, to measure Vcap

- with the current probe in series (usually I use the R's and another scope probe), slap the choke across the cap, and measure I-vs-t. For a perfect inductor, the current ramps up in a straight line, to infinity (well, ok, stray R's limit this value) *until* the cap discharges "too much".

- the slope of the current-vs-time curve = dI/dt = Vcap/L

- L = (dI/dt)/Vcap (if you measure dV = dI*Rs, convert to dI)

- to check an L at a known I, ensure 0.5CV^2 >> 0.5LI^2

oops, need to kinda know L,I first. Nah, all we are saying here is that the energy in the cap is large compared to the energy in the choke. As long as Vcap doesnt change by more than about 10%, this assumption is valid (hence measuring Vcap)

The series R of the L will cause this ramp to roll off like an RC charge curve - ie a decrease in slope

saturation of the inductor is seen by an *increase* in slope. For an iron-cored inductor, you will see a shallow slope at first (permeability is high at low B), then a moderate slope, then a sharp increase in slope as it saturates (at which point it becomes air-cored).

- I have a digital scope (along with half-a-dozen analogue scopes), so capturing the waveform is easy. I have also made a repetitive tester with a 555 & a FET, that works nicely on an analogue scope (its a production tester, and to date has tested 20,000 gapped cores).

Cheers Terry

Two comments re. your circuits.

Firstly, you brute! 100nF slapped on the output of poor old CMOS gates. Still, rise time is slow, around 300ns IIRC, so I = C*dV/dt =

0.1uF*13V/0.3us = 4A, IOW it'll take a month of sundays to rise, and frighten the pants off of the cmos gate. I would have slicer R3,R4 in half, and popped the caps in there.

Secondly, the caps across the 2 switches. These will, at turn-on, pull

4001-6 and 4001-13 high (actually it will be an exponential spike, time constant 10ms). Whether or not this is an issue, I leave as an exercise to the reader (IOW I didnt check) but its something to be aware of.

Cheers Terry

To learn something needs thorough understanding of the proper function. The same is valid for measuring, especially on a motor. A motor has an inductance, which can be measured at stall, but when turning an additional voltage source comes in play(Back EMF), so the only way to determine the force is to measure the current through the motor, which Terry so far has not managed to do. Exept a few static values. So we do not know if the repetition rate of the PWM is too high. He also seems to insist to use the "quarter-bridge" he has found somewhere on the web together with the 3055. I do not see any insight here, so whatever anybody suggests takes a long time to be evaluated and the final result will be accordingly.

ciao Ban Bordighera, Italy

Tony, I just popped in briefly and probably missed a lot of important stuff. But I came across this SPICE model that may have some bearing on the problem:

formatting link

Mike Monett

You need to experiment with different materials (nylon works well) and have a very smooth pulley. I've only seen it done with quite small motors though,

Thanks. Surprisingly consistent, to 1 dp across two motors!

Terry Pinnell Hobbyist, West Sussex, UK

thats a fairly piss-poor description, indicative of a deep lack of understanding.

---+-- +4V | [motor] | | | |/e

555--[R]-----| pnp |\\c | ---+-- 0V

Dont forget the 555 runs from +15V.

When the 555 o/p pulls low, the motor turns on, but where does the substantial base current required come from? As the emitter pulls down, the voltage across Rbase drops, so Ibase drops, so PNP turns off. Besides, even if we magically required almost no base current (eg darlington, Ibase = 3A/10,000 = 300uA) the emitter will *always* be Vbe above the base, losing a large chunk of the available 4V supply. The reducing base drive "feature" of this POS *forces* the transistor to dissipate far more power than it would if switched properly.

When the 555 o/p goes to +15V, where does the motor current flow to? by Lenz' law, the emitter voltage will rise, until the base-emitter diode is forward biased (IOW about 15.7V) at which point the pnp will turn on, shunting the motor current to 0V. Of course Vce = 15.7V, with 3A across it, ramping down to zero in time t = Lmotor*Ipeak/15.7V. dissipation acros the pnp is thus 23.5W for however long it takes. The motor current ramps down a lot faster than it ramps up, as it has almost 3x the voltage across it.

If D1 is left connected across the motor, this turn-off behaviour does not happen, as motor current commutates thru D1, keeping about 0.7V across the motor (so current downslope is about 5-6 times *slower* than the up-slope)

I did a simple simulation in Simetrix, using an MJD2955 and a 1mH inductor (no winding R), chopped at 100Hz with 15V square-wave base drive. Peak current is controlled *entirely* by Rbase (ergo by Hfe, so all over the show with time, temperature and type of transistor). To get

2.5A, I needed Rb = 50 Ohms, and Vcesat actually pulls right up to the supply rail! The turn-off current commutation behaviour is as described.

In conclusion, this is a *terrible* idea, and will not work.

I dont use LTSpice, alas.

ten bucks says 14uH is bullshit. at 200kHz, the stray capacitance will significantly alter the measurement. try it at 1kHz, betcha the result is different.

say 1mH - at 200kHz thats 12578 Ohms. You measure 14uH = 17.6 Ohms, which would be 12578 Ohms paralleled with 17.84 Ohms. Were that a cap, it would be 44nF, which is bugger all really.

These numbers tend to suggest the inductance is a lot higher, and that you have a few tens of nF of capacitance.

Another way to "prove" this. Dismember the motor, and guesstimate/count the number of turns. do the calcs for an air-core solenoid of roughly the same dimensions as the motor, the answer will be a *lot* more than

14uH (mostly because there are a hell of a lot of turns)

as for the R, dont forget that this DC machine has a commutator, which can easily bollocks up your measurement as a function of rotor position.

Cheers Terry

Incorrect, its always been a totem-pole output stage (which is why 555's draw 300mA current spikes on each switching edge, as both totem-pole transistors momentarily conduct, hence the need for a hefty bypass cap right across the pins of the device). The totem-pole output can sink much more than it can source, for much the same disappearing Ibase reason as this terrible idea.

I am not discussing turn off here at all, merely turn on. As the pnp turns on, the emitter voltage falls, therefore so does the base, therefore so does the voltage across the 555-to-base resistor.

my simulation shows this clearly, and I use an ideal voltage source (ie one that can sink and source many trillions of amps)

*you* said "Replace Q1 with a PNP transistor"

please explain to me how I can have a pnp transistor that is *not* bipolar?

read it again. I said "until the base-emitter diode is forward biased" which of course means Ve > Vb for a pnp. This is implicit in the "about

15.7V" statement immediately thereafter.

although it is possible, depending on stray capacitances and the 555 dV/dt, to apply a momentarily high reverse voltage across the base-emitter junction. yet another reason not to do it this way.

I should mention that, unless the 555 has output clamp diodes (or a FET output stage) the pnp wont work at all, as all base current has to flow

*into* the 555 output when it is high. An LMC555 will do that just fine (FETs dont care which way the current goes) but I cant recall OTTOMH what the vanilla 555 output stage looks like. They probably do have clamp diodes, and its probably *not* a good idea to bung more than a few mA thru them, lest you trigger the internal SCR which sits across the device supply rails (thereby shorting out the 15V supply thru the 555, and cooking it quick-smart).

changing the supply voltage to 4V does not change the circuit behaviour, only the voltage at which the pnp turns on again (Ve = 4.7V or so), and of course the rate-of-change of motor current. Its still a ratshit circuit, which explains why *nobody* does this.

the magical disappearing base current alone is enough to consign this POS to the wastepaper basket, where it truly belongs :)

I'd love to see your circuit analysis of this. Admittedly I dont know much about pissant little motors (definition: anything a human can lift unaided), but my calculus is OK. yes, V=dLambda/dt = LdI/dt (if and only if L is constant, otherwise add in an IdL/dt term) so dI/dt = V/L.

all that happens in this case (apart from the appallingly low efficiency, due to piss-poor base drive and linear operation) is that the pnp transistor functions as the clamp diode, but in a much more lossy fashion. For Vcc(555) = 4V, 0.7V is dropped across the motor (exactly the same as with D1) *but* the C-E voltage of the pnp transistor is 4.7V, so it dissipates 4.7/0.7 = 6.7 times more power than D1 would in the same situation.

Cheers Terry

Hi Graham,

Its entertaining, and if we do a decent job of explaining why its all crap, then others (specifically Terry Pinnell) will learn some analytical techniques, as well as another circuit to put in the "dont do this" pile.

Cheers Terry

Well done Terry. I just love basic physics.

Cheers Terry

Not if you are modeling the stalled motor condition.

formatting link

Nice one Mike, thank you. That looks like it will enable a far better modelling of the generated Vbemf.

Tony Williams.

this is true, but I spice'd it to prove the disappearing-base-drive "feature" of Herberts suggested "improvement."

High Rmotor indeed limits the current eg 4GOhms gives 1nA (reductio ad absurdum). If its a grunty little motor (out of an electric screwdriver) then I would expect Rmotor to be relatively small (say 10%) thus initially, ignoring it isnt *that* bad.

ignoring back-EMF, OTOH, is a far more grievous sin :)

Cheers Terry

*NO* not with the circuit as drawn, because the voltage across which the base current is developed, GETS SMALLER as the transistor turns on. This is because when the transistor turns on, Vce tends to zero (ish). Therefore Vbe tends to zero, and so does the voltage across Rbase (because the 555 output is at zero-ish)

this gets tricky, as the voltage across Rb changes a *lot* - from 4V or so at the onset of turn-on to a few hundred mV when the transistor is on (or at least as on as it gets)

Herbert, the *reason* Vce is high is twofold:

1) Ve is *always* Vbe *above* the base voltage, which (if you want any base current) is *always* above the 555 output "zero". This is due to the circuit topology, rather than the bjt itself. If you want low Vcesat, dont do it this way. Likewise, dont use a Darlington, for much the same reason. the original NPN arrangement has a much lower Vcesat, yet is a BJT, because Vbe doesnt get in the way. 2) the disappearing base drive causes real problems here.

only for a very short period of time. The 555 output has a finite, non-zero slew rate. As Vb rises above 4V, the transistor turns OFF, and the inductive current has to go somewhere. It wants to keep flowing in the same direction, so charges up whatever C is lying around, and makes the pnp emitter voltage *rise* (again, finite non-zero slewing). It keeps rising until its at 15.7V or so, at which point the pnp B-E junction becomes forward-biased again, and the motor current flows thru the emitter to 0V - except for 1/Hfe, which flows out the base and

*into* the 555 (where else can it go?)

this is exactly analagous to the npn switch case - when the npn turns off, Vce rises, forced by the inductive load attempting to commutate somewhere (anywhere). If no commutation path is found, Vce rises to +4V

  • LdI/dt (actually more like 4+IZo but thats a whole 'nother thang). Normally this is a very high value. Consider 1A, 1mH and 1us turn-off - Vce rises to about 4V + 1mH*1A/1us = 1004V, which will kill the npn switch (thereby giving the current somewhere to commutate to...). Hence the so-called freewheeling diode.

if the pnp is OFF, where does the motor current go to? its an inductor.....if when the switch is on, current is flowing from +4V into the inductor, its going to want to keep flowing that way when the switch turns off. And it does, as both a simple explanation and SPICE show.

^^^^^^^^^ no its not, but I assume its just a typo on your part. e^(-Rt/L)

yep. that of course has nothing to do with you appalling circuit.

Cheers Terry

Thanks. I'm still having lots of fun with it. This is the first time I have dealt with amplifier nonlinearity as a good thing.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required