Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Oscope - Roman Black's Two Transistor Switcher Design

Status
Not open for further replies.
I suspected it was inductor saturation dragging Vce up. :)

Try increasing R2 (current sense resistor) to a high value so the circuit turns off at about 10mA. So R2 = 0.6v / 0.010A = 600 ohms. You will have to reduce load current a lot too, or just remove the load resistor and use something like a 12v zener as per my original circuit.

That will give you an oscillator that turns off based on Q2 base >0.6v as it should, and after that you can increase the current in stages (with R2) to find the point the inductor saturation is causing an issue.

In real life the BC337 is good for 500mA (some for 1A) continuous, and even at currents far above that the BC337 may still have quite a low Vce saturation voltage, as it can be used to pulse 2A or so at least if I remeber right. I think your simulator might be simulating unlimited PSU amps or something, a situation that just doesn't happen in real life from a 3.3v battery!

It would be worthwhile using a 47uF - 220uF input cap on Vin, and setting a current limit for Vin of a few hundred mA, similar to a small battery.

As I said previously a good way to tune the circuit is to set the current switching point by R2 first, at a current that will just supply the max desired output current. That gives you a safe "max power" the circuit is capable of (when boosting), and then any Vout regulation you add simply increases the OFF time, as your previous mod seemed to be doing quite well. :)
 
Last edited:
I suspected it was inductor saturation dragging Vce up. :)

Yup, It would certainly appear so. :D

Try increasing R2 (current sense resistor) to a high value so the circuit turns off at about 10mA. So R2 = 0.6v / 0.010A = 600 ohms. You will have to reduce load current a lot too, or just remove the load resistor and use something like a 12v zener as per my original circuit.

Did most of this. The circuit wouldn't act properly at all anymore for some reason. :(

In real life the BC337 is good for 500mA (some for 1A) continuous, and even at currents far above that the BC337 may still have quite a low Vce saturation voltage, as it can be used to pulse 2A or so at least if I remeber right.

I'm using KN2222A's FYI. they are similar and are good for 600mA continuous. The data sheet doesn't say how much current you can do pulsed. But 1 Amp is not to far fetched. I would not push them past 2 amps I don't think. The leads would melt at around 5~10 Amps, obviously.

I think your simulator might be simulating unlimited PSU amps or something, a situation that just doesn't happen in real life from a 3.3v battery!

It would be worthwhile using a 47uF - 220uF input cap on Vin, and setting a current limit for Vin of a few hundred mA, similar to a small battery.

Yes, the Simulator DOES simulate unlimited amps, unrealistic I know. However, the real life batteries I have been using are 2 18650 sized laptop Li-ion cells in parallel. they can drop in excess of 10 Amps in to a circuit. Even more when they get hot since their ESR has a positive temperature coefficient. They are rated to deliver 1A and did so regularly before the lappy they came out of blew up. Anyway, this just means any current draw in my real device is entirely determined by the circuit characteristics, not the battery's.

Even so, I improved the battery model by adding a 3.9 Ohms resistor in series with it, to simulate 1 Amp current draw. I also added a capacitor in parallel with it. One can not add a capacitor in parallel to the simulated battery without a resistance between them, it causes a simulator error because of the unlimited current source. Both the input and output caps have a <1 Ohm resistor to simulate ESR, so this is more realistic now too.

As I said previously a good way to tune the circuit is to set the current switching point by R2 first, at a current that will just supply the max desired output current. That gives you a safe "max power" the circuit is capable of (when boosting)

I'm not disputing this. I simply want to marginalize the power wasted in R2 significantly. I would remove it if at all possible. I was thinking of a high side current sense instead, and set up Q2 to trigger entirely off of inductor saturation. What say you to this?

any Vout regulation you add simply increases the OFF time, as your previous mod seemed to be doing quite well. :)

Thanks for that. Sadly, I'm afraid it will likely prove to be the only real contribution I make to the blasted infernal contraption. At least that's what it's looking like so far.... :rolleyes: I may want to go back to the buck design, this damn thing is giving me (MORE) psychological issues. Plus I recently realized this boost circuit discussion could be seen as thread jacking the OP :)/)

I may start a new thread dedicated to generic low parts count Buck, Boost, Buck/Boost circuits. You would be invited of course :D
-()blivion
 
I just wanted to say that although only RB and ()blivion are active just now I expect there are others who are enjoying this thread including me. IMHO this sort of thread is refreshing after so very many of the same old thing.
 
Perhaps I am missing something with regard to Vce of Q1, but it appears to me that the base resistor limits the base current of Q1 to .7 ma with the result that Vce becomes larger than is being discussed. Looking at the PN2222A datasheet

http://www.datasheetcatalog.org/datasheet2/9/0o9g9t5j0kwhicxjckjr12szz0fy.pdf

According to figure 4, for a base current of .7 ma Vce is about .02V when Ic is 10ma but before the Ic rises to 150 ma, Vce is offscale at greater than 1V. If the simulator is correctly modeling the PN2222a this should add to the voltage rise at the base of Q2.
 
Perhaps I am missing something with regard to Vce of Q1, but it appears to me that the base resistor limits the base current of Q1 to .7 ma with the result that Vce becomes larger than is being discussed. Looking at the PN2222A datasheet

http://www.datasheetcatalog.org/datasheet2/9/0o9g9t5j0kwhicxjckjr12szz0fy.pdf

According to figure 4, for a base current of .7 ma Vce is about .02V when Ic is 10ma but before the Ic rises to 150 ma, Vce is offscale at greater than 1V. If the simulator is correctly modeling the PN2222a this should add to the voltage rise at the base of Q2.

You make excellent observations.

What post/circuit are you going off of though? Here is the current circuit I'm working on. It has the base current on Q1 up to ~1.5mA in the sim.

View attachment 66408

Also, and this is a small thing. I'm using *THIS* datasheet. Though the vender is different, the make and models look exactly the same. Honestly, I don't think it matters, I just want to bring it up as a "what if". But I would imagine the parts are pretty much identical. So we'll say both datasheets are fully inter-compatible. I can use yours if you prefer. I don't think it matters.

As for the simulation, It has been proven that the simulator in question is pretty much useless when it comes to accuracy. I would assume it is simulating only the most basic BJT functions. The only option in it for BJT's is adjusting the hFE. It is set to a gain of 200. Every other factor of the transistor modeling is hit or miss probably.

I made R1 (2k2) such that it worked in the sim with parts I had, then built that on the bread board. It physically functions as a real circuit, I don't know if it's optimum though. According to my datasheet, the KN222A has an hFE of ~200 at 150mA but drops off to ~40 at 500mA. So there would definitely be a jump up in Vce voltage when the current started to increase past 150mA. And referring again to figure 4, the knee of this change in hFE is right around 1.5mA base current, like I'm seeing in the sim. So if it works as your suggesting, this could very well be the "mystery turn off" for Q1 that me and Mr RB were discussing. I have removed R2 in the above circuit and it works perfectly still. It switches when Q1 current gets to about 230mA. I will bread board it later when I get some time.

I think now we are all on the same page in saying

"The switching off is being caused by inductor saturation forcing Q1 Vce up via a drop in effective gain."

About like this?.....

1) The circuit is switched on, Q1 gets base current through R1 and is ON.
*Phase one: Inductor is shorted to ground through Q1*
2) Inductor current ramps up until it saturates to the point that hFE of Q1 drops off substantially.
3) This causes a spike in Vce, and thus base voltage of Q2 through R4, Q2 starts switching on.
4) This leads to positive feed back since Q2 shorts Q1's base current/voltage.
5) Q1 quickly shuts off all the way, Vce spikes up, inductor feeds Q2 base more.
*Phase two: inductor is powering Vout through D1*
6) Eventually, the charge on Q2's base capacitor drains through R3, Q2 starts to switch off.
7) This again leads to positive feed back, this time Q1 is shorting out Q2's base.
^^^ Go back to Phase one ^^^

Now, assuming I didn't make any mistakes in my analysis.... I don't see the drawbacks of doing this.

OK... Yeah, Q1 burns up some power until it get's up to 600mV, then the positive feedback kicks in, making the time in liner region of operation really quite short. It's not going to be a lot of power and R2 burns up power too. And running like this can completely eliminate R2, since we are no longer using current sense to determine switching.

So I'll return to you the same question.... am *I* missing something?

Power and efficiency
skyhawk, If I remember correctly... you like the maths. :) I took the data from the above image and used it to calculate the efficiency of this circuit to right around 80%. Can you confirm my process? The tricky part is averaging out the input current. it's a nearly perfect triangle wave, so I figured I would divided the peek value of 244.8mA by the square root of 3 and got 141.3mA. With the voltages shown, that suggests ~480mW of input power. And the load is showing about 390mW. So ~90mW lost out of 480mW, or about 18.75%. Is this the correct way to do the calculation?
 
()blivion,

I was referring to the first sim in post 57 with:
R1 = 4K7
R2 = 6R
R3 = 1K
R4 = 10K

Yes, I agree with the cycle you describe, but I am confused by the use of the term "inductor saturation". By inductor saturation, I understand that the magnetic material in the inductor saturates with the result that the inductance decreases and the back emf from the inductor drops resulting in a further increase in the inductor current. What I am suggesting is that as the current through Q1 increases, Q1 moves out of its saturated condition as determined by its base bias resulting in a rapid increase in Vce part of which is fed to the base of Q2 by way of the voltage divider formed by R3 and R4.

The average value for a triangular waveform is 1/2 the peak. I calculate the input power as 453 mw based on an average current of 122.4 at 3.7V.

p.s. I used the datasheet that I did even though it is from a different manufacturer because I find that figure 4 presents the data in a very useful form.
 
skyhawk said:
Yes, I agree with the cycle you describe, but I am confused by the use of the term "inductor saturation". By inductor saturation, I understand that the magnetic material in the inductor saturates with the result that the inductance decreases and the back emf from the inductor drops resulting in a further increase in the inductor current.

You understand inductor saturation correctly.

Inductor saturation is the point where the inductors reactance (inductive impedance) drops to nearly zero and thus it's current becomes the DC max. It's the point where the inductor is no longer acting like an inductor and is instead acting like a plain wire.

In truth, the inductor is not necessarily genuinely "saturating" on us. It is reaching a current level that the transistor can no longer short to ground that causes things to start switching. The inductor in question could in reality have many Amps before it reaches saturation, and the switching effect in question would still happen at a few hundred milliamps. We are using the term to highlight that the action is very much like saturation, and as such it's effect is dependent on inductor characteristics. Or to put it another way, it is saturating as much as the rest of the circuit will allow.

skyhawk said:
What I am suggesting is that as the current through Q1 increases, Q1 moves out of its saturated condition as determined by its base bias resulting in a rapid increase in Vce part of which is fed to the base of Q2 by way of the voltage divider formed by R3 and R4.

100% Correct, and that is what we believe as well. Know though that the ON current going through Q1 is determined by the inductors impedance at any given time. So in order for Q1 current to rise as suggested, the inductor must "saturate" to some large degree first.

skyhawk said:
The average value for a triangular waveform is 1/2 the peak. I calculate the input power as 453 mw based on an average current of 122.4 at 3.7V.

I don't mean to question you, especially after I was the one that asked for your input. But are you 100% sure you half the waveforms peek? I don't expect your wrong, but that seams too simple if you ask me... LOL.

Anyway, if your correct that would suggest closer to 90% efficiency!!! That seems a little far fetched to me, though is certainly not impossible. I'm sure the real device would show different real world values. Suspect simulator error to be sure.

ronv said:
I think # 65 may be a wrong schematic.

How so? You think I got it wrong? Or are you saying the simulator is getting it wrong? Or.... what exactly are you saying here? Sorry I'm confused.

If you would like you could simulate this circuit for us. We could use some LTspice on this. Falstad sim is only good from the first steps.

Note to all: I found something quite interesting and relevant....
https://en.wikipedia.org/wiki/Hydraulic_ram
 
...
I'm using KN2222A's FYI. they are similar and are good for 600mA continuous.
...

Ahah! I did not know that. The 2222 is nowhere near the performance of a BC337, it has a higher sat voltage and much lower beta at the higher current levels.

That's a couple of significant changes from my circuit, dropping from 5v to 3.3v has left you very little overhead to drive the Q1 base, so the value of it's base resistor and the beta of Q1 are much more critical in your circuit. :)

... I improved the battery model by adding a 3.9 Ohms resistor in series with it, to simulate 1 Amp current draw. I also added a capacitor in parallel with it.
...

That's good. Not only will that simulate more like a real circuit, it gives you an easy way to measure input power. You should make sure the Vin cap is big enough (47-220uF).

...
I'm not disputing this. I simply want to marginalize the power wasted in R2 significantly. I would remove it if at all possible. I was thinking of a high side current sense instead, and set up Q2 to trigger entirely off of inductor saturation. What say you to this?

Sorry if I sounded grumpy there, that was not intentional. :) OK, I think it is a bad move forcing the circuit to oscillate based on the saturation. In that case, the inductoir becomes a lot less efficient and even worse; Q1 is forced into a linear mode where it has a higher Vce and this is extremely energy inefficient.

The best case is that Q1 is either hard on (with a very low Vce) or fully off, and there should be very fast switching between the two states. So the voltage on Q1 collector should look pretty much like a square wave.

...
Thanks for that. Sadly, I'm afraid it will likely prove to be the only real contribution I make to the blasted infernal contraption. At least that's what it's looking like so far.... :rolleyes: I may want to go back to the buck design, this damn thing is giving me (MORE) psychological issues. Plus I recently realized this boost circuit discussion could be seen as thread jacking the OP :)/)

I understand it can get frustrating. By picking 3.3v as the Vin, and picking 2N2222 you made it much harder for the reasons mentioned above.

If you want to continue this, and still have that goal of reducing the voltage loss on the current sense resistor R2, it should not be that hard. Especially with a fixed Vin.

What you could do is add a voltage divider between Vin and the top of R2. If the voltage divider gives say 0.45v, then R2 only needs to produce 0.15v for the base of Q2 to get the 0.6v it needs for good fast oscillation.

skyhawk said:
...
Perhaps I am missing something with regard to Vce of Q1, but it appears to me that the base resistor limits the base current of Q1 to .7 ma with the result that Vce becomes larger than is being discussed. Looking at the PN2222A datasheet...

Absolutely! A combination of the inductor sat and Q1 sat for sure. I didn't know he was using a small signal transistor like the 2N2222 instead of a small power transistor with high beta.

To 3v0; thanks for commenting! :)
 
I can't get it to oscillate. Did I get a value wrong?

OOPS! I don't know what happened there. It was working fine for me at first but now it won't start oscillating with R4 at 8K. It looks to only maintain an already existing oscillation. Try 7k or 6k instead for R4. Not common values I know, but we can deal with crossing that bridge when we come to it.

Also, The zener in my unit is 7.7 volts, for ~8 volts target Vout. I have before observed HUGE changes in the circuits characteristics when target Vout is greater than 2x Vin as opposed to Vout less than 2x Vin. Right now I'm aiming for boosting to greater than 2x Vin.

If you want we can start over with the original circuit + zener mod and rework the whole thing from the top? I'm aiming for good regulation, with good efficiency, while maintaining the low parts count. I want to "collect the whole set" so to speak. For efficiency, I want to aim for no less than 80%. For Regulation, we can't really ask for more than 0.1v p-p ripple I don't think, but then again maybe I'm just being pessimistic. For parts count, below 15 parts would be optimal, 20 would be survivable.

Mr RB said:
Sorry if I sounded grumpy there...

No no, not at all. I didn't think of what you were saying as grumpy. And I was not trying to be grumpy either. All is well.

Mr RB said:
OK, I think it is a bad move forcing the circuit to oscillate based on the saturation. In that case, the inductoir becomes a lot less efficient and even worse; Q1 is forced into a linear mode where it has a higher Vce and this is extremely energy inefficient.

You're prolly right of course. But here are some thoughts.

From what I see, as soon as Q1 is pulled out of saturation, it's collector spikes rapidly, raising R4 as well. And this positive feed back does/could powers it through the whole liner region in a hurry. The idea is we use Q1 as our current sense, and tune it to jump right at saturation. This should still be able to get good switching times while minimizing power lost in Q1 and removing R2 altogether.

As for the inductor saturating and loosing efficiency, as I was saying to skyhawk. The inductor does not necessarily have to be in honest and actual saturation for the transistor to be pulled out of it's saturation. They are intimately related to be sure, but they are distinct factors of circuit operation. As what skyhawk pointed out in fig 4 of his datasheet, with Q1 base current between 1-2mA, Q1 can be pulled out of saturation with a collector current of about 150mA. This is lower than most inductor saturation currents that we would be using.

It's only a matter of getting the feedback to work with this instead of R2. And do so in a fast enough way to get Q1 out of the liner as soon as it starts to enter it. Which may or may not prove to be impossible.

Mr RB said:
What you could do is add a voltage divider between Vin and the top of R2. If the voltage divider gives say 0.45v, then R2 only needs to produce 0.15v for the base of Q2 to get the 0.6v it needs for good fast oscillation.

Are you sure you really mean the top of R2? And not actually somewhere on Q2 base, or something?

With respect, I don't see the first thought as a working option since R2 would effect the voltage divider such that the top half would need to be very low resistance, this would draw excessive quiescent current, and do so constantly.

With R1 being ~1 ohms, and Vin being 3.3 volts. To get 0.45v, The top of the divider would need to be some where around 7 to 8 Ohms. That would draw <400mA by it's self. And even if R2 was brought up to 8 Ohms. And thus the top of the divider brought up to ~64, the quiescent current drain would still be 45mA. And all this current is wasted, not providing any power to the load.

Conclusion
I honestly need to really hammer this thing out with a better environment. I keep trapping myself with this crap simulator. So what works for me isn't working for others it would seem.

Time to learn LTspice...
 
Last edited:
OK. Working with LTspice now. And wouldn't you know it.... I can't get any of the boost circuits to oscillate!!?!!?!???¿ Not even the original. I know it works, so i can only assume it's the simulator.

HIGHLY possible that It's just me, I'm not very familiar with LTspice. And I also have the handicap that it is the exact opposite of the falstad sim, which I AM very familiar with. (-__-) I hate the mystical magic known as "technology". (I'm a certified PC tech in real life... LOL)

Attached is the LTspice file of the circuit I'm working with now. It is pretty much Mr BR's circuit right from his site.
 
hi

You have a 47 FARAD cap across the 3.9V source with an internal resistance of 3.9R.!!

also the 1K [R3] is sinking so much current Q2 is held well below Vbe ON.

Try this asc file,,, set the initial voltage to zero.

E.
 
WOH!!! oops. HA HA HA. Damn technology :shakes fist:

Edit: R3 is as was shown in Mr RB's version BTW.
 
Last edited:
I think the voltage was set to 3.9 instead of 5. Resistance of 3.9 ohms it doesn't like - 1 is ok. Also need to watch the resistance of the inductor.

Now we gotcha (). :p;)
 
The zener is a nice touch.

Hint for today:

To measure average current (or voltage):
Click on component (load resistor) should see waveform.
Move cursor over lable above the waveform and control left click.
 
The zener is a nice touch.

Thanks, literately just happened that way.

On another note, attached is my latest incarnation. This time I have a low pass filter before the load. Less energy efficient, but only about 15mV P-P ripple over the entire load range if you can believe that. This is still an infant circuit, so I'm expecting the other shoe to drop. I still don't know the sim very well obviously and may have made a booboo. (read: most likely have made a mistake) And the circuit is not optimum at all I'm sure. You can change the transistors to just about any different default one available in LTspice, But you will likely have to adjust R4 a bit to get it to oscillate.

Edit: May want to install a resistor on Q2 base, I forgot it. :p
 
Last edited:
...
If you want we can start over with the original circuit + zener mod and rework the whole thing from the top? I'm aiming for good regulation, with good efficiency, while maintaining the low parts count. I want to "collect the whole set" so to speak. For efficiency, I want to aim for no less than 80%. For Regulation, we can't really ask for more than 0.1v p-p ripple I don't think, but then again maybe I'm just being pessimistic. For parts count, below 15 parts would be optimal, 20 would be survivable.
...

No problem starting over, speaking for me anyway. One thing I would suggest (at the risk of being boring!) would be to create a spec list and usage description.

For instance if it is to supply 5v Vout for microcontroller use, from two AA cells, then it doesn't need a lot of Iout but it will need good Vin regulation, and may need to work well even at 2v Vin.

So if we can nut out a spec and usage that will help a lot in deciding the best way to go. :)

...
From what I see, as soon as Q1 is pulled out of saturation, it's collector spikes rapidly, raising R4 as well. And this positive feed back does/could powers it through the whole liner region in a hurry. The idea is we use Q1 as our current sense, and tune it to jump right at saturation...

I understood that from your other post, but still think it's a bad idea. One of the things I've learnt from SMPS design is to really avoid any slow switching or any rise in Vce during the current delivery time, it's a huge killer of efficiency.

...
Are you sure you really mean the top of R2? And not actually somewhere on Q2 base, or something?

With respect, I don't see the first thought as a working option since R2 would effect the voltage divider such that the top half would need to be very low resistance, this would draw excessive quiescent current, and do so constantly.

I should have explained that better, I meant a 2 resistor voltage divider AND R2. The voltage divider only needs to supply enough current to keep Q2 reliably on, so 1mA or so would be enough through those 2 resistors. The full Q1+inductor current only passes through R2.

Re your last post with LTSpice, can you please also post a GIF etc as some people (like myself) don't use simulators and can't see an ASC file. :)
 
Re your last post with LTSpice, can you please also post a GIF etc as some people (like myself) don't use simulators and can't see an ASC file.

Morning Roman,

A quick gif of OB's sim.

E.
 
Thank you Eric! :)

I'm a little concerned by that 0.75 sec delay before startup! There is very little capacitance on Q1 base (or Q2 collector) so right from Vin 3.9v being applied there should be 3.3v across R1 and 1.5mA into Q1 base, so Q1 should be turned on pretty hard right from the start, until L1 and Q1 current reach about 0.6A to give the required 0.6v on R2 1 ohm. That is assuming the L1 ohms is low enough to get to 0.6A with about 3v.

Of course if that 0.75 sec delay was deliberately added then please ignore all that. :)

Putting the resistor before the load looks like some of my early designs for the buck reg, it can improve stability and oscillation a lot by giving a much larger ripple voltage at that point, which is more "signal" to operate the regulator. Reducing C3 would help a lot here (giving more ripple to work the V regulator).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top