05-25-2012 01:26 PM
I'm attempting to simulate a PWM amplifier with an H bridge output and feedback/ comparatros/etc.
The simulation is quite rough with default time steps, and if I try for a more accurate simulation with small time steps it takes a very long time.
One thing that would be nice it to stop the grapher continuously updating and wasting all that time. Is there a way to do this? I try to hide the window, but I don't see that it takes advantage of that and skips the graph update.
Another good thing to be able to do is to have the grapher update with a fixed, most recent data window width. This would be way more useful that just packign millions of data points into the window which is re-drawn every 10 seconds or so.
Any ideas?
How can I configure the transient simulation to solve to more accuracy, without suffering the small timestep everywhere that it might not be needed so much?
Thanks.
05-25-2012 01:32 PM
dbur,
Improving the grapher (including its peformance) is definitely on the radar.
Can you supply your circuit? I'll see if anything could be done.
Thanks,
05-25-2012 01:48 PM
Here is the file. I'm simulating for 100msec with 1e-8 time steps.
05-25-2012 01:51 PM
I think if I just close the grapher window it speeds up a bit, and at least doesn't stop for each graph update.
05-25-2012 02:19 PM
so a few things...
You have floating (unused) components. I recommend that you delete them or move them to another design as these components actually get loaded into the simulator and get simulated.
I also recommend using the new COMPARATOR_IDEAL instead of the COMPARATOR_VIRTUAL (unless you need to model slew rate, sourcing/sinking limits, etc). Your running at 33kHz PWM or 30us period. You generally should not need a timestep smaller than 1us (I typically aim for TMAX that is 10-100 times smaller than PWM period). I am not sure what is "rough" in your observation.
Finally you can perhaps lossen some simulation tolerances (VNTOL=1e-4 ABTOL=1e-6) since you seem to be dealing with higher (than low-power IC) power levels.
Hope that helps.
05-25-2012 06:47 PM
I tried the settings you suggest.
At max timestep 300e-9 it simulates successfully, but the signals are all over the place, which should just not happen with this circuit. (PWMsim1)
The same simulation with the only difference being min timestep = 30e-9 produced better waveforms (at least they were monotonic), but fails with an 'internal simulation error'. (PWMsim2b)
Maybe there is too much data for the grapher.