OP amp as comparator.

Papabravo

Joined Feb 24, 2006
22,116
They are very commonly used as feedback from the secondary side to the primary side. Again commonly, a TL431 monitors the output voltage and drives the LED in an opto-isolator thus any variation in CTR between devices or over time is compensated for by the TL431. This feedback is an analog signal.
I believe you, but how is it that the TL431 can compensate for a change in the CTR? It is monitoring the output voltage.
 

AlbertHall

Joined Jun 4, 2014
12,663
Here is a schematic using that arrangement. Because of the gain of the TL431, a change in CTR will produce only a tiny change of output voltage. Also consider that this circuit can cope with a very large change in input voltage which would necessitate a change in the feedback to the transistor base without materially affecting the output voltage.
1599690340765.png
 

Papabravo

Joined Feb 24, 2006
22,116
Because of the high gain I don't see that there is much point to the actual value of the current in the diode or the CTR. It looks like a digital bang-bang system to me. What am I missing?
 

AlbertHall

Joined Jun 4, 2014
12,663
Because of the high gain I don't see that there is much point to the actual value of the current in the diode or the CTR. It looks like a digital bang-bang system to me. What am I missing?
Having worked on a lot of these *&^% things I can assure you that the feedback is analog. In the example above it changes the operating point of the transistor. The transistor is configured as an oscillator with two windings on the transformer and the opto- alters the biasing of the transistor.
 

Papabravo

Joined Feb 24, 2006
22,116
I can see that the transistor can get base current from three different places. The input source voltage of 140-340 Vdc (with ripple), via the 4z winding and the 390 Ω resistor, and lastly from the output of the opto. What are the relative magnitudes of these three sources?
 

AnalogKid

Joined Aug 1, 2013
12,303
The diode allows you to convert a push-pull output to open collector.
In schematic #15, the chip already is open-collector.
Try not to use op-amps as comparitors.
I disagree with that as a blanket statement. Opamps make excellent comparators in some situations. For a signal "never above 1 kHz", an opamp should be fine (assuming input and output voltage ranges are obeyed, etc.). It saves having to add a pull up resistor if you don't need open collector for something else, and it makes the hysteresis equations easier because the (not needed) pull up resistor isn't a part of them.

ak
 

AlbertHall

Joined Jun 4, 2014
12,663
I can see that the transistor can get base current from three different places. The input source voltage of 140-340 Vdc (with ripple), via the 4z winding and the 390 Ω resistor, and lastly from the output of the opto. What are the relative magnitudes of these three sources?
The opto is a sink not a source. There is not enough info to fully analyse the circuit, for start it would depend on the transformer characteristics, and in any case beyond my abilities, I repaired them, not design them.
 

Thread Starter

engrokstate

Joined Jul 1, 2018
9
What is the part number of the counter the circuit is driving? If it is a logic device (IC) rather than a piece of test equipment, what is its power supply voltage? Depending on the answers, you might be able to eliminate VS2 and LED1. Also, there is no reason for the feedback resistors to be so low. Consider R2 = 10K and R3 = 47 K.

ak
[/QUOTE
What is the part number of the counter the circuit is driving? If it is a logic device (IC) rather than a piece of test equipment, what is its power supply voltage? Depending on the answers, you might be able to eliminate VS2 and LED1. Also, there is no reason for the feedback resistors to be so low. Consider R2 = 10K and R3 = 47 K.

ak
That's funny, I had just simulated 10k and 1k for R2 and R3 so I had the same thought. My input signal is +- 10 volts and I can't change that. I'm a mechanical engineer that crossed over into industrial electronics so I rarely deal with things on the board level. I think I stated above that the receiving device is a high speed input card on a PLC which accepts up to 24Vdc made for encoders at 5V level up to counting devices at 24Vdc. The input has 2.5kohm resistor and turns on around 4v and off around 2v. The only reason I chose an optocoupler is because I had one in the grab bag and the counter has a push/pull input that would count in both directions or more likely not be off fast enough to count at all.
 

Thread Starter

engrokstate

Joined Jul 1, 2018
9
That's funny, I had just simulated 10k and 1k for R2 and R3 so I had the same thought. My input signal is +- 10 volts and I can't change that. I'm a mechanical engineer that crossed over into industrial electronics so I rarely deal with things on the board level. I think I stated above that the receiving device is a high speed input card on a PLC which accepts up to 24Vdc made for encoders at 5V level up to counting devices at 24Vdc. The input has 2.5kohm resistor and turns on around 4v and off around 2v. The only reason I chose an optocoupler is because I had one in the grab bag and the counter has a push/pull input that would count in both directions or more likely not be off fast enough to count at all.
If I could figure out how to do it with a single supply that would reduce component count but otherwise I will move on since this is a one-off x 3.
1599695746709.png
 

Papabravo

Joined Feb 24, 2006
22,116
The opto is a sink not a source. There is not enough info to fully analyse the circuit, for start it would depend on the transformer characteristics, and in any case beyond my abilities, I repaired them, not design them.
Right. so it is reducing the amount of current available to the "BUT11AF". As I understand what the transformer is up to it is specified in terms of the impedance of the windings. So the 2x27z for the primary looks like two windings in series, which are each 3 times the impedance of the secondary winding at 9z. On the primary side there is this additional 4z winding which seems like it could be the primary feedback from the secondary, but I'm not real clear on how that works. The coupling to the primary and the 4z winding is also not clear. I've designed converters before, but nothing with magnetics of this complexity.
 
@AnalogKid Your allowed to disagree. There is always an exception to nearly every rule.

Favorite line from a college instructor: your not supposed to know "that" yet. I got credit for my answer on an exam. No one else did.
 

Ian0

Joined Aug 7, 2020
13,317
Probably for someone unfamiliar with the flyback converter, the self-oscillating type isn’t the best place To start. Have a look at one that uses a control IC.
As the output voltage increases beyond the voltage of the zener plus the forward voltage of the opto LED the opto transistor starts to conduct. That reduces the input to the error amplifier, which sets the current threshold at which the MOSFET switches off, thus reducing the energy stored in the inductor (which looks like a transformer in the diagram) and consequently reduces the Output power.

By the way, if we can’t cope with optoisolators because the parameters vary all over the place, how on earth did we manage with bipolar transistors?34DE268B-71F6-47CC-B1C6-C2A6A75907FC.jpeg
 

Papabravo

Joined Feb 24, 2006
22,116
So we now have two designs using optos, but no analysis of how the circuit behaves as the CTR goes from a nominal value to something considerably less. Paper schematics are a dime a dozen on the internet. The claim on the first schematic was that the "gain" of the TL431 compensated for the change in CTR. Well there is no TL431 in the second design to compensate for the change in CTR. What an analysis should show is that the opto continues to perform the desired function over some range of CTR values, or alternatively that the function of the opto does not depend on CTR at all.

As for bipolar transistors, the reason we don't care about parameters having a particular value is that we design circuits that don't depend on a particular value, and we have an analysis to back up that claim. Where's the beef?
 

Ian0

Joined Aug 7, 2020
13,317
As for bipolar transistors, the reason we don't care about parameters having a particular value is that we design circuits that don't depend on a particular value, and we have an analysis to back up that claim. Where's the beef?
The opto is inside the feedback loop. i.e. The circuit is designed so that it does not depend on a particular value (of CTR),
the circuit is from OnSemi’s datasheet,
and it works,
and there is analysis to back up the claim.

It’s not Just the gain of the TL431 that compensates for changes in CTR, it’s the open-loop gain of the entire circuit: the gain of the error amplifier and the gain of the power stage.

An opto isolator operates no differently from a bipolar transistor: a current between base and emitter causes a vaguely related current to flow between collector and emitter. The relation between the two is called beta, and it varies with every parameter imaginable: voltage (Early effect), collector current, temperature and frequency, and has a wide manufacturing spread.
In an opto isolator a current between diode anode and cathode causes a vaguely related current to flow between collector and emitter. The relation between the two is called CTR, it varies with collector voltage, Collector current, temperature and frequency, and has a wide manufacturing spread.
 

Papabravo

Joined Feb 24, 2006
22,116
I'll check out the datasheet.
And there is no analysis there, so no happiness here. The internal block diagram which you did not originally post shows that the FB pin has a 20K pullup to approximately +5VDC which comes from the internal Vcc generator. It also connects to a high impedance input on the Skip Cycle Comparator. As I understand what I have read, the controller will begin skipping cycles when the pin is pulled below 1.1 volts. In addition pulling the FB pin to GND would require only 250 uA, so I am left to conclude that the magnitude of the current out of the opto is entirely relevant. How this all works seems to depend on the values of the components on the output side specifically the resistor and the zener diode. I must still be missing something although I believe you can make this part work, I don't see how you can accommodate a wide range of CTR values. If you know what the range is ahead of time maybe you can work with it.
 
Last edited:

Ian0

Joined Aug 7, 2020
13,317
Just to give you the “exception to the rule”, devices do exist such as H11L1 and IS609 which have a Schmitt triggers on the output. Of course, they are digital and they do have some uses : Midi inputs for example.
 

Ian0

Joined Aug 7, 2020
13,317
I’ll also add a comment on the original subject. . . ( do we all remember what it was? )
there are some op-amps such as NE5534 which have clamp diodes between the inputs. They work as comparators, but give some very odd effects if the difference between the inputs is greater than 0.6V!
 

Ian0

Joined Aug 7, 2020
13,317
The technique has been around so long that the analysis tends to be in the older application notes. In newer devices' datasheets it seems to be "taken as read".
Here's a few useful ones that I found
https://static5.arrow.com/pdfs/2004/0424/semi_ap/cs/fsc/application note/an-4103.pdf
https://www.infineon.com/dgdl/Infin...N.pdf?fileId=5546d46266f85d6301670783808317e8
There's three levels of accuracy in SMPS design: the lowest just uses the auxiliary winding, which (sort of) tracks the output winding. Above that is the zener and opto, and finally the TL431 if you need real accuracy.
The NCP1200 datasheet https://www.onsemi.com/pub/Collateral/NCP1200-D.PDF shows how it can be used both with and without an opto.
 

Attachments

Top