Inverter Simulation Library Copyright 2003-2004 by Jonathan Kimball This library contains a number of useful blocks for simulation of motor control inverters, or other similar topologies. See paper in COMPEL'04 for more details. The basic building blocks are in the buck and boost libraries. These are used to build halfbridges, which are used to build sixpacks. Dlossy is a diode with a given forward voltage and on-state resistance, with proper translation so that the I-V characteristic passes through the origin. SwitchedVCVS and SwitchedCurrent are used to build the buck and boost circuits. OneShot emulates 555 monostable operation with no state variables. ModulatedSine takes frequency and magnitude inputs and generates a smooth sinusoid. Work extended for PESC'05 (digest submitted 10/27/04) to include MOSFETs. Assumes a symmetric bridge.
| Name | Description |
|---|---|
| SwitchedCurrent | Current Source with Boolean Pulsing |
| SwitchedVCVS | Voltage Source with Control Voltage and Boolean Pulsing |
| ModulatedSine | Sine Wave Source with Controllable Amplitude and Frequency |
| OneShot | Boolean One-Shot Triggered on RisingEdge |
| Dlossy | Lossy Diode (conduction loss model) |
| DlossyThermal | Lossy Diode with Thermal Port |
| NewIdealSwitch | |
| Buck | Buck-derived Switch Models (Controlled Upper, FWD Lower) |
| Boost | Boost-derived Switch Models (Controlled Lower, FWD Upper) |
| Halfbridge | Half Bridge Models Built from Buck/Boost Models |
| Sixpack | Hex bridge (three-phase bridge) circuits |
| FETbridge |
Inverter.SwitchedCurrent
Switched current source. Current through the device is zero for Boolean FALSE, Ion for Boolean TRUE. Building block, to be used in switching models.
| Name | Default | Description |
|---|---|---|
| Ion | Current when on [A] |
model SwitchedCurrent "Current Source with Boolean Pulsing"
extends Modelica.Electrical.Analog.Interfaces.OnePort;
parameter Modelica.SIunits.Current Ion "Current when on";
Modelica.Blocks.Interfaces.BooleanInPort TurnOn;
equation
if TurnOn.signal[1] then
i = Ion;
else
i = 0;
end if;
end SwitchedCurrent;
Inverter.SwitchedVCVS
Switched voltage-controlled voltage source. Voltage across the device is zero for Boolean FALSE, k*control for Boolean TRUE. Building block, to be used in switching models.
| Name | Default | Description |
|---|---|---|
| k | 1 | Voltage Control Gain |
model SwitchedVCVS
"Voltage Source with Control Voltage and Boolean Pulsing"
extends Modelica.Electrical.Analog.Interfaces.OnePort;
parameter Real k=1 "Voltage Control Gain";
Modelica.Electrical.Analog.Interfaces.PositivePin ControlP;
Modelica.Electrical.Analog.Interfaces.NegativePin ControlN;
Modelica.Blocks.Interfaces.BooleanInPort TurnOn;
Modelica.SIunits.Voltage control=
ControlP.v - ControlN.v;
equation
ControlP.i = 0;
ControlN.i = 0;
if TurnOn.signal[1] then
v = k*control;
else
v = 0;
end if;
end SwitchedVCVS;
Inverter.ModulatedSine
Modulated Sine Wave Inputs are Magnitude and Frequency Parameters allow for generating "n" phase sine waves with arbitrary phase relationships. Also allow for DC offset, as is necessary when comparing to a ramp from 0 to 1.
| Name | Default | Description |
|---|---|---|
| noutputs | 1 | Number of Outputs |
| phase[:] | {0} | Phase Angles of Outputs [rad] |
| offset | 0 | Offset |
model ModulatedSine
"Sine Wave Source with Controllable Amplitude and Frequency"
parameter Integer noutputs=1 "Number of Outputs";
parameter Modelica.SIunits.Angle phase[ :]={0} "Phase Angles of Outputs";
parameter Real offset=0 "Offset";
extends Modelica.Blocks.Interfaces.MO(final nout=noutputs);
Modelica.Blocks.Interfaces.InPort Amplitude;
Modelica.Blocks.Interfaces.InPort Frequency;
protected
constant Real pi=Modelica.Constants.pi;
parameter Real p_phase[nout]=(if size(phase, 1) == 1 then ones(nout)*phase[
1] else phase);
Real theta(start=0);
equation
der(theta) = 2*pi*Frequency.signal[1];
for i in 1:nout loop
outPort.signal[i] = offset + Amplitude.signal[1]*Modelica.Math.sin(theta
+ p_phase[i]);
end for;
end ModulatedSine;
Inverter.OneShot
One-shot emulates 555 operation in a Boolean framework with no state variables. On each rising edge of the input, the output generates a pulse with width equal to parameter pw. Output is high only if input is high, so input pulse should be wider than output pulse. This is a useful building block.
| Name | Default | Description |
|---|---|---|
| pw | 1 | Pulse Width in Seconds [s] |
model OneShot "Boolean One-Shot Triggered on RisingEdge"
parameter Modelica.SIunits.Time pw = 1 "Pulse Width in Seconds";
Modelica.SIunits.Time T0[
1](final start={0});
extends Modelica.Blocks.Interfaces.BooleanSISO;
equation
when edge(u) then
T0[1] = time;
end when;
y = time >= T0[1] and time < T0[1] + pw and u and T0[1] > 0;
end OneShot;
Inverter.Dlossy
Diode model based on Modelica.Electrical.Analog.Ideal.IdealDiode. Translates corner point to Von, Ion where Ion=Von*Goff.
| Name | Default | Description |
|---|---|---|
| Von | 0.320 | On-state Voltage [V] |
| Ron | 0.106 | On-state Resistance [Ohm] |
| Goff | 1e-6 | Open diode conductance [S] |
model Dlossy "Lossy Diode (conduction loss model)"
extends Modelica.Electrical.Analog.Interfaces.OnePort;
parameter Modelica.SIunits.Voltage Von = 0.320 "On-state Voltage";
parameter Modelica.SIunits.Resistance Ron = 0.106 "On-state Resistance";
//default parameters are for 1N5819 diode, measured 26 September 2003
parameter Modelica.SIunits.Conductance Goff( final min=0) = 1e-6
"Open diode conductance";
Boolean off(start=true) "Switching state of diode";
Modelica.SIunits.Power Pdiss "Power Dissipation";
protected
Real s "Auxiliary variable";
equation
off = s < 0;
(v - Von) = s*(if off then 1 else Ron);
(i - Von*Goff) = s*(if off then Goff else 1);
Pdiss = v*i;
end Dlossy;
Inverter.DlossyThermal
Similar to Dlossy, with added thermal port.
| Name | Default | Description |
|---|---|---|
| Von | 0.320 | On-state Voltage [V] |
| Ron | 0.106 | On-state Resistance [Ohm] |
| Goff | 1e-6 | Open diode conductance [S] |
model DlossyThermal "Lossy Diode with Thermal Port" extends Dlossy; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b Junction; equation Junction.Q_dot = -Pdiss; end DlossyThermal;
Inverter.NewIdealSwitch
Ideal switch with finite on-state resistance and zero off-state conductance. Switch is "on" when input is "true", which is different from Modelica library.
| Name | Default | Description |
|---|---|---|
| Ron | 1e-5 | On-State Resistance [Ohm] |
model NewIdealSwitch extends Modelica.Electrical.Analog.Interfaces.OnePort; parameter Modelica.SIunits.Resistance Ron = 1e-5 "On-State Resistance"; Modelica.Blocks.Interfaces.BooleanInPort s; equation i = if s.signal[1] then v/Ron else 0; end NewIdealSwitch;