How can I measure PF (power factor) of a circuit in the simulator ?
It would require the voltage and current waveform, over 1 cycle For example, as seen in a simple power supply rectifier followed by a capacitor input filter.
Since there is no built in measurement function for this, what is the best way to do this ?
Draw a circuit and post it here.
Mark the point (branch) where to mesure the power factor.
Define the power factor, derived from current and voltage, for a more or less arbitrary waveform. Give a function PF = f(V, I).
Then we might be able to measure it, e.g. by using a user defined function.
when you say power factor… do you really mean power factor or displacement power factor?
if it truly is PF you could determine it via V*A in and W out. if you want DPF you will need to isolate the fundemental of the current waveform to determine the phase shift. An FFT outputing phase information should do
First this circuit is giving me trouble this morning (Timestep too small…), or I would upload the file, that’s a different topic. Will fix that later.
This is a common simple power supply behavior, after C1 is charged, a current spike seen at R3 recharges C1 only when the AC is above the current C1 level.
I did find this interesting web page which is going to help.
V(V1) and I(V1) should be all the info needed, I think. The PF load on the power source is what is normally of interest. Then it will be useful for whatever circuit is downstream from it.
I can’t help with the simulation part, just wanted to point out that v8.0.4 is quite old within the v8 releases. v8.0.9 is the (probably final) v8 release. Also, v9.0.0 is now fully released with many bug fixes between rc3 and the released build. In case you run into other issues, it may be worth updating to the most recent bugfix of whichever major version you choose to work with.
scone, thanks for the version info, but unfortunately I am having problems using apt for installing the stable version 9.0.0 .
The following packages have unmet dependencies:
libocct-visualization-7.6t64 : Depends: occt-misc (= 7.6.3+dfsg1-7.1build1) but 1:7.6.3+dfsg1-8~ubuntu24.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
I added the MES1 component to get a pretty sine wave since V1 isn’t ground referenced
The circuit is finicky, some changes and the simulation won’t run
I tried to set the start stop time to get 2 full half cycles of relevant data
Avoided initial capacitor charge
I’m not at all sure I am computing the input apparent power correctly. Help.
AC Input Power
35.35 Vrms = 50V * .707 (50V peak was specified)
0.217 AMP rms ngspice measured
7.67 W = 35.35V * 0.217A
DC Output Power
2.33 W in R1 Load, NgSpice measured
In the 1970s I simulated AC>Bridge Rectifier>Filter Capacitor using a programmable calculator. (HP55 model number comes to mind as the first one with which I did this.) The results were pretty close to those on the bench, if I remember correctly. The HP55 had limited memory so I would have to run the program more than once for different outputs, such as RMS current and p-p output ripple.
Once I had a PC, It was do-able in Microsoft Excel.
The current pulses which I see in the graphical result above look surprisingly narrow.
They look about right, given the circumstances.
But using ideal diodes and a voltage source without output impedance will not give a realistic picture.
I had been using the 45 degree diodes from the kicad standard library. Its possible that was part of my inconsistent simulations. So, here using the un-angled diodes, so far better results. Still not 100% sure why I had problems.