Author Topic: Crude comparator sensing above VCC (or below 0V) with discretes  (Read 256 times)

0 Members and 1 Guest are viewing this topic.

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1675
  • Country: gb
Crude comparator sensing above VCC (or below 0V) with discretes
« on: September 15, 2024, 09:34:43 pm »
Posting this in beginners, because its been a loong time since I studied classic analogue circuits, it might help beginners and students - since it deals with basic transistor stuff - and it's not really a critical problem, more of a curiosity.

A number of years back I designed a crude, but somewhat effective circuit for charging capacitors using a flyback converter - not the TV kind (DIY transformer 1:12), but I did use it for a xenon strobe (250-300V) as well as lower voltage apps. It was based on a 555, using a crude transistor/diode based current limiting, so the on-time was controlled by peak current, but the off time was fixed.  This made it a bit better than just a standard 555 circuit with fixed on/off itmes which can't keep track of inductor current, and relies on VCC, L, and the on time of the 555 to set the peak current.

Now, I realise there are thousands of cheap controllers that will do this just very well, but as with all side projects, I wondered if I could still use the 555 as acrude MOSFET driver and SR latch, but improve upon it by making it pseudo resonant.  Again, this is hardly practical, but I didn't want it to turn into an x-y problem, its more for my own understanding of what can be done "really cheap" using discretes.

Essentially my idea was, instead of a fixed off-time - we wait for the inductor current in the secondary to fall to 0, or wait for the primary switching node to drop back down to VCC before we turn the switch on again.  I'll still be peak current setting the on-time, but the off-time will vary as the output voltage rises, and the secondary current falls quicker.

So this sent me down a rabbit hole of thinking about ways to sense this using discretes - sure an LM393 could work, and will be far better, but what using transistors?  Essentially I'll be looking to sense when the switching mode drops from >VCC to VCC, or a current sense on the secondary going from <0V to 0V.  My only idea as this point is a PNP current mirror, or an actual comparator, with thresholds set by resistors.

Again, this is more about learning than anything practical (and because I get kind of hooked on certain ideas until I'm satisfied I've thought of enough solutions).  Plus this isn't a DC/DC converter designed for a smooth regulated output - it'll charge a cap up to a preset voltage then stop.  Only turned back on once the cap voltage drops below a certain amount. And I chose a flyback rather than boost because I may be shorting this output cap out.  Doesn't have to be pretty, but it woudl be nice if there some some efficiency and a form of current control so it doesn't draw too much.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7072
  • Country: pl
Re: Crude comparator sensing above VCC (or below 0V) with discretes
« Reply #1 on: Yesterday at 06:50:46 am »
For sensing above VCC:

1. The simplest solution, if you can live with 600mV offset voltage: connect PNP base to VCC, emitter to the signal through a resistor.
2. For lower offset voltage: connect the base to 600mV below VCC, using an identical PNP as a diode at similar bias current.
3. An NPN differential pair with emitter followers to level-shift away from the rail, see LM358 input stage (but upside down).
4. An NPN differential pair loaded with folded cascode, see AD797 simplified schematic for example.

edit
Actually, the last two may not work very well as they will probably show phase reversal for inputs greater than VCC+300mV or so.
« Last Edit: Yesterday at 06:54:40 am by magic »
 
The following users thanked this post: Buriedcode

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1675
  • Country: gb
Re: Crude comparator sensing above VCC (or below 0V) with discretes
« Reply #2 on: Yesterday at 03:33:32 pm »
Thanks for the reply.

Your suggestions:
1) This was my immediate thought however, the issue I have is that.. when charging very large capacitors, the first few cycles of the converter increase the voltage on the output cap very little - say we have a 330V photoflash cap, of 470uF for a large xenon tube.  For a reasonable current limit on the converter of say 2A peak (or less if we want to stress the batteries less for a longer charging time), it'll take a while for that cap to reach >5V. 

Because of the turns ratio of the transformer, the voltage reflected back on the primary will be the cap voltage/turns. Given a 1:12 transformer, when the output cap is just starting up, say its 2V.  The reflected voltage is 2/12 = 167mV.  This will of course be much smaller when the output cap is *just* starting.  So the ~0.7V Vbe drop would be too much.   It will however work well once the output cap is 0.7*12 = ~8V

Initially I thought of just having an RC circuit set the maximum off time, a timeout, so if the reflected voltage doesn't trigger the next on time, the RC circuit will, then, once the cap is charging nicely, its triggered by the reflected voltage again and increases frequency.

2) this seems to be what I've thought off, and is actually what triggered me to post the question.  See the attached image.
Initially Q3 was a diode, to bias Q2 so that the transistor is just at the point of turn on.  But it occured to me that the diode Vf won't be exactly the same as Q2's Vbe, so a matched transistor wired as a diode. Of course I quickly realised this is a current mirror and I'm a moron for not seeing it sooner.  My only worry is how to limit the current for Q2 - emitter resistor? Since the emitter voltage in that circuit could reach >40V, with a base voltage of VCC-0.6 (~12V?).

It's a nice idea - just two transistors - albeit perhaps have to be matched in some way and R6 can be adjusted to provide the correct bias so that the 555's trigger isn't activated unless the switch node goes to VCC or below. 

3/4) I'll have to look more closely at these, but this sort of thing is great - revisiting this stuff, and doing tests with a breadboard and scope is always fun, a good excuse to sit down and test these things with a breadboard and tinker.  As I said, its been years since I studied analogue transistor circuits and I embarrassed at how much I have forgotten (don't use it, you lose it) so I thought messing about with a circuit like this would be a valuable exercise rather than throw DC/DC controllers or even just comparators at the problem.

Cheers!


 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4651
  • Country: dk
Re: Crude comparator sensing above VCC (or below 0V) with discretes
« Reply #3 on: Yesterday at 03:57:14 pm »
something silly like this:

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf