PLECS 1.3 Online Help |
Both simulation methods are based on a piece-wise linear state-space approach: a circuit containing only linear components can be described mathematically by one set of time-invariant equations:
where x is the state variable vector with the inductor currents and capacitor voltages, and u is the input vector with the source voltages and currents. The output vector y contains voltages and currents measured in the circuit. If a circuit consists not only of linear components but also of one or more ideal switches, every combination of switch positions (i.e. open/closed) is described by a different set of matrices.
The basic working principle of PLECS is outlined in the figure below.
When you start a simulation, PLECS analyzes your circuit schematic and builds the state-space model for the initial switch positions (i.e. in general: all open). During the simulation, the Switch Manager monitors the gate signals of the switches and the currents and voltages measured in the circuit and decides whether a switching action is necessary. If any switching occurs, a new set of state-space matrices is calculated on the fly.
When simulating a circuit with the continuous method, PLECS employs the Simulink solver to solve the differential equation and integrate the state variables. The Switch Manager communicates with the solver in order to ensure that switching occurs at the correct time. This is done with Simulink's zero-crossing detection capability. For this reason the continuous method can only be used with a variable-step solver.
In general, the default solver of Simulink, ode45, is recommended. However, your choice of circuit parameters may lead to stiff differential equations, e.g. if you have large resistors connected in series with inductors. In this case you should choose one of Simulink's stiff solvers.
When simulating a circuit with the discrete method, PLECS transforms the circuit into a discrete state-space model with fixed time steps. The continuous state-space equations are discretized using the bilinear transformation (also known as Tustin's method). The integration of the state variables is thus replaced with a simple update rule:
where t is the sample time.
With line commutated power electronic devices such as diodes and thyristors, the natural switching instants will generally not coincide with a time step of the discretized circuit model. The Switch Manager detects such non-sampled events and uses an interpolation scheme to ensure that the state variables are always consistent with the switch positions.
Sample time This parameter determines the sample time used to discretize the circuit. A setting of auto or -1 means that the sample time is inherited from the Simulink model.
ZC step size This parameter is used by the Switch Manager when a non-sampled event (usually the zero crossing of a current or voltage) is detected. It controls the relative size of a step taken across the event. The default is 1e-9.
Tolerances The error tolerances are used to check whether the state variables are consistent after a switching event. The defaults are 1e-3 for the relative tolerance and 1e-6 for the absolute tolerance.
This applies for instance to the standard models for the induction machine and the two synchronous machines with wound rotor. For these machines the library contains discretizable equivalents, in which the feedback loops have been broken using the Integrator block.