Home Filter manual [0101] [Filt] [Math] [Pwr] Examples Utilities
Go back to:

Block models that are, in general, three-phase and power electronics related, built in the same idealized manner. The list of the devices is in the table below. The Examples section has examples with many devices from [Pwr], so they will not be repeated here; those that don't either don't need one (their usage is straight-forward) or have a link in their names which will open a non-intrusive pop-up window with some screenshots with basic usage.
Quick menu:
3lvl_mod
3ph_ACMotor
3ph_br_vm, 3ph_br_cm
3ph_gen
3ph_SW
BrdgRect
BrdgRectThy
Cable
Disturb
HystComp
Isense, Vsense
RLC
SVHCC
SVPWM
sym
Transforms
WattMeter
wt
Name Description Symbol Parameters
3lvl_mod Three-phase, three level modulation, with internal/external ramp/triangle
INa
INb
INc
Three-phase inputs, 1
1 External ramp/triangle control, needs f=0, floating (may be left floating if not used)
A, _A
B, _B
C, _C
Three-phase complementary ouputs, 1Ω
_EN External ENABLE control, active high (V(EN)≥0.5), 1
Vhigh
Vlow
V Ouput logic levels
Vpk V Amplitude of the carrier (internal)
f Hz Carrier frequency
  • f>0 ⇒ internal, symmetric (triangle) carrier
  • f=0 ⇒ external carrier (anything from ramp to triangle)
  • Hidden:
    td s Total delay time for the internal logic
    vt
    vh
    V Threshold and hysteresis voltages for the (SCHMITT) comparators, default null, both
    TOP
    3ph_ACMotor A three-phase AC motor model, .uic may be needed for simulation. It has two modes of operation:
    1. Specify rotor's and stator's inductances and resistances (the SpiceLine2 line)
    2. Set all the parameters on SpiceLine2 to zero ⇒ automatic determination of elements after the parameters on SpiceLine
    The 2nd method is fairly idealized so it has its quirks, but it does a pretty decent job for moderate powers. Back EMF is modelled with current sources in parallel with 1 resistors.
    Inspired after The simulation of a.c. adjustable electric drive systems, Mihail-Florin Stan, Marcel Ionel, Octavian Marcel-Ionel
    a
    b
    c
    Three-phase inputs, 1 parallel with load current source
    W Outputs the angular rotation
    J Outputs the inertia
    Common parameters:
    Zp Number of poles (even numbers, e.g. 2 pairs ⇒ Zp=4)
    J Kg⋅
    m2
    Moment of inertia. If null, additional capacitor is needed at pin W, can be behavioural
    Direct mode:
    (the direct mode parameters default internally to zero, all)
    Lm H Magnetizing inductance
    Lr H Rotor's leakage reactance (inductance), raported to stator
    Ls s Stator's leakage reactance (inductance)
    Rf Ω Iron losses
    Rr Ω Rotor's leakage reactance (resistance)
    Rs Ω Stator's leakage reactance (resistance), raported to stator
    Indirect mode:
    Pn W Shaft's delivered power
    fn Hz Electrical frequency
    Vn V Nominal line-to-line voltage
    In A Nominal current. If null, it's automatically calculated
    phi rad Displacement factor, cos(φ)
    slip Slip factor
    Hidden:
    tripdv
    tripdt
    V/s LTspice specific for B-sources, default null/null
    att≥1 Tweak for the internal dynamic range calculation; choose tripdv/tripdt instead. Default 1
    TOP
    3ph_br_cm
    3ph_br_vm
    Three-phase switching bridges, current-mode and voltage-mode (the link is the same as 3lvl_mod's)
    INa _INa
    Inb _INb
    INc _INc
    Complementary inputs, 1
    A
    B
    C
    Outputs, 1Ω
    DC+
    DC-
    Power supply pins
    Ron
    Roff
    Ω Switches' on/off resistances
    Vfwd
    Vrev
    V Forward and reverse voltages for the anti-parallel diodes
    Rs
    Cs
    Ω
    F
    Series RC snubber across switches
    Hidden:
    vt
    vh
    V Threshold and hysteresis voltages for the input SCHMITT triggers
    TOP
    3ph_gen Three-phase voltage or current harmonics generator.
    1
    2
    3
    Three-phase outputs
    NUL Wye common node
    FM External frequency control, 1
    AM External amplitude control, 1
    PM External phase control, 1
    sym=<0,1>
  • sim=0 ⇒ asymmetric waveforms, i.e. the phase of the harmonics are sin(n2πf+φ)
  • sim=1 ⇒ symmetric waveforms, i.e. the phase of the harmonics are sin(n2πf+nφ)
  • f Hz
  • f>0 ⇒ internal fundamental frequency
  • f=0 ⇒ external frequency control at pin FM
  • amp V
  • amp>0 ⇒ fundamental amplitude
  • amp=0 ⇒ external amplitude control at pin AM
  • phi rad
  • phi>0 ⇒ phase of the harmonics (N>|2|)
  • phi=0 ⇒ external phase control at pin PM (fundamental and harmonics)
  • Ro Ω
  • Ro>0 ⇒ outputs are voltage sources and have <Ro>Ω
  • Ro=0 ⇒ outputs are current sources
  • N=±<0:51>
  • N>0, N=2k+1 ⇒ odd harmonics
  • N>0, N=2k ⇒ even harmonics
  • N<0 ⇒ odd+even harmonics
  • N=0 ⇒ null output
  • dc1
    dc2
    dc3
    V Per phase voltage offset
    A1
    A2
    A3
    Per phase amplitude modifier, think of it as p.u. relative to amp or V(AM)
    phi1
    phi2
    phi3
    rad Per phase fundamental displacement modifier
    h1
    h2
    h3
    When set, hx will
  • subtract the harmonic number hx if already present
  • add the harmonic number hx if not present
  • The added/subtracted harmonics obey the spectrum shape, e.g. N=0 h1=100 [default rest] ⇒ 3.25Vpk
    The indices [1,2,3] have no meaning except to differentiate the parameters between themselves. Only their values matter
    a b c
    d e
    p q
    xp xq
    Parameters for the spectrum shaper. The formula, where n is the index, is this:
    (a sin(b π n + c) + cos(d π n + e)) / (p nxp + q)xq
    The table below shows a few combinations for some common waveforms
    TOP
    3ph_SW Three-phase to three-phase timed switch
    A1
    B1
    C1
    First three-phase inputs
    A2
    B2
    C3
    Second three-phase inputs
    A
    B
    C
    Three-phase outputs
    Ron
    Roff
    Ω The on/off resistancesfor the series switches
    ON
    OFF
    s The on- and off-times relative to the first input
    Hidden:
    trf multiplied with min(ON,OFF) gives the rise/fall times, default 0.01
    TOP
    BrdgRect Three-phase bridge rectifier. Using only (any) two of the three inputs will make it a single-phase rectifier
    A
    B
    C
    Three-phase alternating current inputs
    +
    -
    Positive and negative outputs
    Vfwd
    Vrev
    V The forward and reverse voltages for the diodes
    Ron
    Roff
    Ω The on/off resistances for the diodes
    Rs
    Cs
    Ω
    F
    The series RC snubber across the diodes
    TOP
    BrdgRectThy Three-phase thyristor rectifier
    A
    B
    C
    Three-phase alternating current inputs
    +
    -
    Positive and negative outputs
    S[1:3] The logic commands for the upper leg switches (the complementary signals are internally generated) with <0,1> logic
    Note:
    The pulse width needs to span over the entire π/6 duration
    EN
  • if V(EN)<0.5 or pin EN is floating, the angle is internally generated through ang
  • if V(EN)≥0.5, external control at pins S[1:3] is possible
  • ang rad The internal firing angle (valid for V(EN)<0.5 or pin EN floating/grounded)
    Vfwd
    Vrev
    V The forward and reverse voltages across internal devices
    Rs
    Cs
    Ω
    F
    The series RC snubber across the switches
    Ron
    Roff
    Ω The on/off resistances for the internal devices
    f Hz The working frequency
    phi rad The phase displacement at the inputs A, B, C
    dt s The dead-time
    Hidden:
    td s The overall delay for the logic gates, default 0
    Vh=<0..-0.5> V The hysteresis voltage for the switches. Internally, they are LTspice's SW and the logic levels are <0,1>, so positive values should be avoided
    TOP
    Cable A power cable model. It's a CLC Π model with terminating resistances, not as accurate for four-wire as it is for three-wire and the three-wire may behave a bit worse than the four-wire. Either way, it's meant to be used for HVAC applications up
    11
    21
    31
    41
    I/O
    10
    20
    30
    40
    I/O
    phi m The diameter of the conductor
    f Hz The working frequency
    len m The length of the wire
    CuAl=<0,1>
  • CuAl=0 ⇒ copper wire
  • CuAl=1 ⇒ aluminium wire
  • Space m The distance between the exteriors of the insulated wires
    Dins m The diameter of the insulated wire
    TriPlan=<0,1>
  • TriPlan=0 ⇒ the wires follow a triangular (equilateral) formation
  • TriPlan=1 ⇒ the wires are disposed in line
  • T oC The working temperature
    Hidden:
    ratio Determines the distribution of the series resistance between the terminating resistors and the Π's middle inductor. The default value of 0.5 means the resistors at the ends get ½ of the value, each, while the inductor has none; 0 means the inductor has all the resistance while the ending resistors have none.
    RparL
    RparC
    Ω The dummy parallel resistances for the inductors and capacitors, default 100*X (reactance), each
    TOP
    Disturb Disturbance inducer. It's meant to work in conjuncture with 3ph_gen, but can do anywhere else. It's a sine, amplitude modulated by a modified Gaussian bell, with skewing
    OUT Output, <A>Ω
    A V The DC level
    B V The peak of the Gaussian bell, relative to A
    delay s The delay of the Gaussian bell's peak
    sigma s The Gaussian bell distribution. It's modified so that it represents the time from the peak to 1% of the skirt's amplitude.
    xp The exponent multiplier:
    exp(-x2⋅xp)
    skew The skew factor, given by multiplication with a tanh();
    skew severely distorts the amplitude of the bell
    f Hz The modulated sine's frequency
    phi rad The phase of the modulated sine
    sq The time's exponent for the modulated sine, to provide a crude way of non-linear sweeping
    TOP
    HystComp Hysteresis comparator with complementary outputs
    IN Signal reference input, floating
    CMP Signal compare input, floating
    ERR External error input, valid for err=0, 1
    Q _Q Complementary outputs, 1Ω
    _EN External ENABLE control, active low (V(_EN)<0.5), 1
    Vhigh
    Vlow
    V Output logic levels
    err V
  • err>0 ⇒ internal, fixed hysteresis band (±err/2)
  • err=0 ⇒ external error control at pin ERR
  • dt s Dead-time
    Hidden:
    td s Delay time for the internal logic, default 25ns
    TOP
    Isense
    Vsense
    Isolated current and voltage sensors
    +
    -
    Inputs
    OUT+
    OUT-
    Outputs, 1Ω
    G Gain/attenuation
    TOP
    RLC Universal three-phase RLC load. It can be wye (with or without null) or delta, series or parallel, with any power combinations possible
    1
    2
    3
    Three-phase inputs
    4 Null, valid for NUL=1
    V V The line-to-line peak voltage
    f Hz The working frequency
    NUL=<0,1>
  • NUL=0 ⇒ pin 4 is disabled
  • NUL=1 ⇒ pin 4 is enabled, only if DY=1
  • DY=<0,1>
  • DY=0 ⇒ delta connected loads
  • DY=1 ⇒ wye/star connected loads
  • SP=<0,1>
  • SP=0 ⇒ series RLC
  • NUL=1 ⇒ parallel RLC
  • P W Load's active power
    QL VAr Load's reactive power (inductive)
    QC VAr Load's reactive power (capacitive)
    Rd Ω Damping resistor, only valid for directly driven reactive elements (e.g. parallel RLC). If null, it defaults to 1mΩ
    TOP
    SVHCC Space-vector hysteresis current controller, a simple approach for minimizing the number of swithings
    ia*
    ib*
    ic*
    Reference signal inputs, floating
    ia
    ib
    ic
    Compare signal inputs, floating
    Sa _Sa
    Sb _Sb
    Sc _Sc
    Complementary logic outputs
    _EN Logic ENABLE, active low (V(_EN)≤0.5), 1
    Hi
    Ho
    V The inner and outer hysteresis bands
    Vhigh
    Vlow
    V The output logic levels
    dt s The dead-time
    Hidden:
    td s The delay time for the internal logic, default 50ns
    TOP
    SVPWM Space-vector PWM controller
    A
    B
    Quadrature inputs, floating
    Sa _Sa
    Sb _Sb
    Sc _Sc
    Complementary logic outputs, 1Ω
    _EN Logic ENABLE, active low (V(_EN)≤0.5), 1
    fsw Hz The switching frequency
    Vhigh
    Vlow
    V The output logic levels
    dt s The dead-time
    [a,b]=<-1,1> The signum for the A and B inputs
    Hidden:
    td s The delay time for the internal logic, default 50ns
    TOP
    sym Symmetrical components analyser. It has two subcircuits contained in sym.sub: abc-120 (three-phase to symmetrical components) and 120-abc (symmetrical components to three-phase). Depending on the chosen subcircuit (through the SpiceModel's drop-down menu in the symbol's properties), the pins from the sides are either inputs or outputs. abc-120 may need .uic set
    A
    B
    C
  • abc-120 ⇒ inputs, floating
  • 120-abc ⇒ outputs, 1Ω
  • M[1:3]
  • abc-120 ⇒ outputs, 1Ω
  • 120-abc ⇒ inputs, floating
  • A[1:3]
  • abc-120 ⇒ outputs, <their value in degrees or radians>Ω
  • 120-abc ⇒ inputs, floating
  • f Hz The working frequency
    deg=<0,1>
  • deg=0 ⇒ pins A[1:3] work with radians
  • deg=1 ⇒ pins A[1:3] work with degrees
  • ic The initial conditions for the A-devices
    TOP
    Transforms Three-phase transformations: the Clarke matrix (abc↔αβ0), the Park matrix (abc↔dq0), the quadrature Park matrix (αβ↔dq) and a cvasi-instantaneous approach for symmetrical components
    IN1
    IN2
    IN3
    Inputs, floating (IN3 not used for AB/dq and dq/AB)
    OUT1
    OUT2
    OUT3
    Outputs (OUT3 not used for AB/dq and dq/AB), 1Ω
    WT Angle input (for Park-related matrices, only), floating
    f Hz The working frequency
    sq=<0,1> abc/B0 and inverse, only
  • sq=0 ⇒ amplitude invariant
  • sq=1 ⇒ power invariant
  • TOP
    WattMeter One-phase wattmeter
    I+
    I-
    The current sensor, 0Ω
    V+
    V-
    The voltage sensor, floating
    S Outputs the apparent power
    P Outputs the active power
    Q Outputs the reactive power
    PF Outputs the power factor
    V Outputs the RMS voltage
    I Outputs the RMS current
    att≥1 Tweak for the internal dynamic range calculation, useful for large powers but affecting accuracy. Better use tripdv/tripdt instead
    f Hz The working frequency
    Hidden:
    tripdv
    tripdt
    V/s LTspice specific for B-sources, here used for the calculation of voltage/current/powers, default 100V/µs
    tripdt2 s LTspice specific for A-devices, here used for the clock and resetting pulses. It should be tighter than tripdt, default 10ns
    off V The clock is a function of sgn(V(V+,V-)) and the reset is sgn(V(V+,V-)±off), so off should be at least 1000 times less than the peak input voltage, to have as few errors as possible. Default 1mV
    TOP
    wt A slightly less cumbersome and more compact way of generating the angle without a PLL (or the PLL)
    OUT Output, 1Ω
    f Hz The working frequency
    phi rad The initial phase
    Hidden:
    tripdt s LTspice specific for B-sources, with fixed internal tripdv=5, default 1µs
    TOP

    A few predefined settings for 3ph_gen to achieve some commonly found waveforms (~ means "don't care"):

    N a b c d e p q xp xq
    square wave
    (amp=pi/4 for unity amplitude)
    2n+1110001011
    UPS square wave
    (variable width x, 1<x<1.5)
    2n+10~~x01011
    trapezoidal
    (fixed slope, variable amplitude x≥2)
    2n+111/x00pi/21021
    Hilbert transform of a square wave 2n+111/2pi/40pi/21011
    sinc impulses
    (alternating single, x=2, or variably spaced alternating double, x>2)
    2n+111/x00pi/21001
    two steps square sine
    (x varies lower step's amplitude, y upper step's width)
    2n+111-pi/x1/y01011
    sawtooth
    (double period)
    2n11/2-pi/21/2pi1011

    The subcircuit files are pwr.sub, sym.sub and transforms.sub. All the symbols and libraries are archived in one file and are available in two flavours:

    Zip archive: Pwr.zip (29875 B) 7z archive: Pwr.7z (20907 B)
    TOP






































































































    ©Vlad, 2014 - 2015