I am testing a flyback converter with secondary side regulation, by means of a 431 in conjunction with an optocoupler with nominal CTR of 50-100%. A snippet of the regulator part is below.
I have used the 431 before to regulate non-isolated supplies (Sepic, Cuk) using the same 431 and modulator without issues, i.e. I didn't use the optocoupler in the feedback of those supplies.
simulate this circuit – Schematic created using CircuitLab
The full schematic is here:
The issue
According to my spice sims (using the 431 model from Diode's website), the regulator should be stable as shown in the schematic. The switching frequency is approx. 1.3 MHz. It is stable with no Iload at all, or with various load currents, up to 100 mA in this test. It becomes unstable if the compensation capacitor C1 is smaller than ~100 pF, or if the 5V capacitor is smaller than approximately 1 uF.
However, the actual converter is ringing heavily, overshooting and undershooting the regulation at irregular intervals. All the voltage waveforms on the primary side modulator look completely as expected, with the only exception being the feedback node that is pulled on by the opto. This feedback seems to over-react. Therefore, I suspect an issue with the regulator compensation. This feedback node on the primary side has an impedance of 33 kΩ || 100 pF.
Adding some load current of around 50 mA made the regulation a bit better, but it was still changing between essentially maximum duty cycle (50%) and fully off phases.
I then added a 120 µF electrolytic cap on the output to provide a large high frequency load. This fixed stability at higher frequencies. But now the regulator is ringing at a pretty constant frequency of about 2 kHz. Where "ringing" means toggling between off and a few pulses of high-duty operation.
Is there some general suspicion to be made about the compensation scheme? Can the frequency of the ringing (2 kHz) be a trace to some part of the regulation loop that I could fix? Does the opto perhaps restrict regulation bandwidth considerably over the non-isolated supplies I built succesfully using the same modulator and regulation? The opto datasheet lists 3-4 µs as toggle time, so it should be plenty fast for the time constant of voltage sense node (33 µs).