Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating with a PWM source?

Solved!
Go to solution

 

Is there a way to simulate with a PWM source?

 

It could be a voltage controled duty cycle at a preset frequency.

 

Thanks.

0 Kudos
Message 1 of 6
(7,836 Views)
Solution
Accepted by dbur

Hello,

 

You can read this from our KB (knowledge database), it even has a sample to see how it works.

 

Link

http://digital.ni.com/public.nsf/allkb/EF391C48CF71AE4F862571B900644F84

 

EDIT: I forgot to add that depending on the version and type of multisim, there is an entire section for PWMs and other uses under the POWER family.

 

Cheers,

Miguel V
National Instruments
0 Kudos
Message 2 of 6
(7,830 Views)

There are a number of ways to do this, all of which revolve around comparing a control signal to a triangular swithcing waveform. This is the basis for PWM generation.

 

In Multisim V12, to simply this popular task we added parameterizable components that do exactly this. Look under the Power/POWER_CONTROLLERS family.

 

 

Max
National Instruments
0 Kudos
Message 3 of 6
(7,821 Views)

The PWM block worked much better than using two sources and an ideal comparator, though they should have produced the same result.

 

Thanks.

0 Kudos
Message 4 of 6
(7,795 Views)

dbur,

 

This might have something to do with the time step settings.  If you let Multisim set TMAX automatically (default) and you are using a built in source, Multisim will take that into consideration and overestimate TMAX (such as with the case with a rapidly changing PWM signal, it will take into account the rise/fall time of the edges). 

 

However with another source like a triangle or sinusoid and a comparator, Multisim will likely not overestimate on the TMAX to accurate represent the rise/fall time at the output of the comparator (the tool is not aware of the "comparator" from a SPICE model standpoint).

 

So for you to get equivalent results, you may have to set the TMAX manually (it defaults to 1E-5 when set to manually mode, but for accurately representing the falling/rising edge of a PWM signal you may want to go to 1E-8/1E-9 or smaller as the maximum time step (TMAX).  There will be a direct correlation between simulation time, accuracy and TMAX (which for manually setting of TMAX, you will need to balance to get a sufficient simulation, yet in a timely fashion).

 

To configure from the menu in an interactive mode simulation, go to: 

Simulate -> Set maximum timestep (TMAX) and then select (*) Maximum time step (TMAX):

 

;and set to a small enough value to capture the rising/falling edges of the PWM signal.

 

- Pat N

0 Kudos
Message 5 of 6
(7,753 Views)

Yes, this is what I have learned as well.  I did receive some result imporvements by tightening many of the simulator tolerances as well.  I am assumming that causes the simulator to shorten the time steps further (and maybe other things) when signals are active in order to solve to smaller errors.

0 Kudos
Message 6 of 6
(7,743 Views)