Electronic – LTspice model of the UC3845 oscillator

emcltspiceoscillatorswitch-mode-power-supply

I have a circuit whose the purpose is to reduce the EMI by "moving" the switching frequency around a value. I would like to understand how this circuit affects the switching frequency, i.e. how it affects the oscillator frequency of the UC3845. For this, I need to understand how the UC3845 is working. Finally I would like to do an FFT for seing how it change the frequency spectrum.

Here is the datasheet: https://www.mouser.fr/datasheet/2/308/UC3844B-D-1814882.pdf

According to the datasheet the frequency is set according to a capacitor Ct and a resistor Rt. It is mentionned that the "capacitor Ct is charged from the 5.0 V reference through resistor Rt to approximately 2.8 V and discharged to 1.2 V by an internal current sink." I can predict the charging time of the capacitor but with the informations given I can't predict what would be the discharging time… as I do not know the sink current. Apparently the sink current or the capacitor depends on the deadtime that we want to have." During the discharge of Ct, the oscillator generates an internal blanking pulse that holds the center input of the NOR gate high. This causes the output to be in a low state, thus producing a controlled amount of output deadtime" The output is the pin linked to N MOSFET. So it is opened. Well, I though "deadtime" was the time when the energy in the inductor is null, it is only possible in DCM. Nevertheless in the datasheet it seems to mean that the MOSFET is just OFF. Did I do a mistake?

What is interesting, or (what I learnt) is that the resistor Rt and the capacitor Ct do not only set the switching frequency but also the deadtime.

Nevertheless, I do not know how to model the oscillator without knowing the current drawn from the capacitor by the current sink. That's why i am looking for an LTspice model of this IC.

Thank you very much and have a nice day!

Best Answer

Since you're aiming to make a model for an IC, I'd recommend you go the behavioural way. You could implement a real current source, discharge, proper elements, but the simulation will just go much slower for virtually the same results.

This is a behavioural version for an oscillator I made once for the venerable TL494. It can be configured based on external R and C, with a frequency f=1.2/(R*C) (which can be changed), with variable blanking time set by the a parameter, and with adjustable peak voltage set by Vpk.

osc

The nodes R and C are the external pins, and rst is the blanking pulse. Rt and Ct don't need to be defined with a .param, but like this they are there for automatic frequency calculation (shown on V1, not needed) and measuring purposes, which show that the method is pretty accurate. This can be simplified to work without I1 and R1, different configurations (charge from Vref, discharge to ground), etc. This is one option out of many, it gives you an idea (or more).

As a final note, unless your aim is to "get dirty" with modeling, I'd recommend to search the net for already existent models, which may be made by people who are likely to know more than you about these things. If it were me, I'd recommend to search the LTspice group, in the Files section (you'll have to register, no money needed though). I seem to recall models for these PWM ICs in there.


Looking over the datasheet you linked, it looks like there's no mention of the internals of the oscillator, but if you search for the datasheet from TI (for example), it says that there is an internal threshold of ~2.7V, and the pk-pk oscillator waveform is ~1.7V. It also says that the discharge current is ~6mA.

However, in your datasheet (which is taken from OnSemi), it depicts the waveforms of the oscillator, where it clearly shows that the charge/discharge is not made with constant current. That the charging is not constant, it's obvious since Rt goes from Vref to RT/CT pin, but the comment on the 6mA discharge in the TI datasheet seems to be misleading.

With these in mind, here's an adapted version which is not accurate, but works:

v2

V1 shows (in green) the frequency that should have been, according to TI's datasheet (f=1.72/(RC)), and the error log shows the measured frequency. It's ~10% difference, and you could set some lower/upper thresholds, maybe a larger discharge resistance for the switch, and you could get closer. If you really want this path, by all means, have fun.

Related Topic