1

I have found some solution in LTspice but Im wondering if anybody could achieve to sweep duty cycle of a fixed freq. pulse in PSpice.

Is that possible?

I tried the following but it didnt work:

enter image description here

floppy380
  • 1,845
  • 7
  • 38
  • 74
  • Build a pulse width modulator and run a ramp signal into it. – John D Sep 30 '17 at 18:32
  • Sure thing. Ypu can set your on-time to {ton} and do a parametric step or sweep. – winny Sep 30 '17 at 18:59
  • @winny I use VPULSE pulse generator in Orcad's Pspice. There are only parameters: V1 V2 TD TR TF PER PW. I just started to use Pspice. Could you please write what you suggest as an answer with a simple example. Thanks in advance – floppy380 Sep 30 '17 at 19:37
  • I normally use LTspice, but your PW should have the same effect. Set it to a variable. – winny Sep 30 '17 at 20:15
  • If you want a continuous sweep with a simple voltage source, you can't, but you can use the .STEP directive on the Ton parameter, as @winny mentions. If you decide to use two sources and a comparator (of your choice), then you can use JohnD's suggestion for a continuous sweep. – a concerned citizen Oct 01 '17 at 06:39
  • @aconcernedcitizen Please see my edit. I tried comparator way but couldnt make it work. Please help with an answer if you can. – floppy380 Oct 01 '17 at 16:42

1 Answers1

1

You are not using a comparator. I would have answered in the comments section, but I feel it may not be enough, so here's as example made in LTspice:

example

What you are using is a VCVS (voltage controlled voltage source), which simply outputs the difference between its non-inverting input and its inverting one, multiplied by the amount of gain.

You need to use a comparator, or something with a comparator's properties. I used LTspice's Schmitt A-device, which has complementary ouputs (you can ignore the negated one) and is set with a 1mV positive hysteresis, in order to directly compare with an VCVS (E1 in the schematic) transformed to behave similarly to a comparator.

Note that, while I seem to recall (from some 20 years ago) that PSpice has some default, ideal comparator (that you can use instead of my A1), and that it should have some form of the original Berkeley SPICE's table() function, I don't know how to implement it, so it's up to you.

V1 acts as a variable duty-cycle generator (it is a simple voltage going from 5% of the ramp's amplitude, to 95% -- it could have been a PWL just as well), while V2 is the ramp generator. Notice I didn't use extreme values like 1ps for the timings, or so, but simply a more relaxed 0.1% of the total period, which works just fine while also not uselessly encumbering the simulation.

a concerned citizen
  • 21,445
  • 1
  • 23
  • 40