Spectrum Software
spacer
Industrial Strength Simulation
select:

divider

 

News:

Spectrum Software has released Micro-Cap 11, the eleventh generation of our SPICE circuit simulator.

For users of previous Micro-Cap versions, check out the new features available in the latest version. For those of you who are new to Micro-Cap, take our features tour to see what Micro-Cap has to offer.

 

divider

 

Three Phase Triangle Source Macro

 

Many power system simulations need a three phase voltage input source available. For a three phase sine wave, it is a simple task to place three sine sources in a schematic and set their phases at 0, 120, and 240 degrees. For other input waveforms, such as a three phase triangle wave, it is a little more difficult since there is not a phase parameter that is easily set. The figure below displays a three phase triangle source macro created in a standard Y configuration.

Three Phase Triangle Source Macro Circuit

The macro has two parameters available for passing: Per and Mag. Per defines the period of a single triangle wave, and Mag defines the magnitude of the triangle wave. The macro circuit consists of three independent SPICE voltage sources. These sources are located under the Analog Primitives/Waveform Sources section of the Component menu with the name 'V'. The sources have their VALUE attributes defined using the PWL, piece-wise linear, capability of the source as follows:

V1 (0 degrees):
PWL TIME_SCALE_FACTOR=per VALUE_SCALE_FACTOR=mag REPEAT FOREVER 0,0 .5,1 1,0 ENDREPEAT

V2 (120 degrees):
PWL TIME_SCALE_FACTOR=per VALUE_SCALE_FACTOR=mag REPEAT FOREVER 0,.6667 .3333,0 .8333,1 1,.6667 ENDREPEAT

V3 (240 degrees)
PWL TIME_SCALE_FACTOR=per VALUE_SCALE_FACTOR=mag REPEAT FOREVER 0,.6667 .1667,1 .6667,0 1,.6667 ENDREPEAT

Each of the sources have their time and voltage pairs defined in relation to one cycle of the triangle wave. For example, the V1 source has its time/voltage pairs defined as:

0,0 .5,1 1,0

which will produce a voltage of 0 at time=0, a voltage of 1 at time=.5 and a voltage of 0 at time=1. The V2 and V3 sources have their time and voltage data adjusted to reflect the phase shift that each one of them needs to produce in a three phase system. The REPEAT FOREVER and ENDREPEAT keywords will repeat the data for the entire simulation time so that the waveform is now periodic.

The TIME_SCALE_FACTOR uses the Per parameter to scale all of the defined time values. The VALUE_SCALE_FACTOR uses the Mag parameter to scale all of the defined voltage values. These two scale factors give the macro great flexibility in that the period or magnitude of the waveforms can be easily scaled with the factor rather than having to edit each and every data point within the PWL data. This is also the reason why the time and voltage in the PWL definitions were based on a scale of 1 so that the factors can scale to the appropriate period or magnitude using the parameter values passed into the macro.

The results of a 5ms transient analysis with the three phase triangle source is shown below. In this case, the Per parameter was defined as 1m, and the Mag parameter was defined as 5. Note that the period of the triangle waves is 1ms with a magnitude of 5V just as the parameters specified, and that the three sources have produced a nice 120 degree phase shift between each other.

Three Phase Triangle Source Macro Example Analysis

 
Return to the main Newsletter page