PLECS 3.0 Online Help |
We first examine the open-loop behavior of the system. In order to get the desired
output voltage we need to apply a fixed duty-cycle of . You
can verify this by using the Steady-State Analysis block to obtain the steady-state
waveform of the output voltage.
For this purpose you copy the block into the model and double-click it to open the dialog box. The parameter System period length is already set to the correct value, i.e. 1e-5. Set the parameter Show steady-state cycles to e.g. 10 so that you can more easily check that the system is indeed in the steady state when the analysis finishes. Then click on Start analysis. The algorithm should converge after the first iteration, and the scope should show the waveform in the figure below.
Steady-state output voltage
In order to determine the control-to-output transfer function you need to perturb the steady-state duty-cycle and measure the corresponding perturbation of the output voltage. This is achieved by connecting an AC Sweep block as shown below. The block output is the perturbation signal; it is added to the steady-state duty cycle. The block input is connected to the load voltage signal.
The initial amplitude of the perturbation is set to 1e-3 which is approx. 2/1000
of the duty cycle. We want to sweep a frequency range between 100Hz and 50kHz
with a few extra points between 800Hz and 1200Hz. This is achieved by setting the
parameter to [100 800:50:1200 50000]. As expected, the resulting bode plot of the
transfer function shows a double pole at and a dc gain of
.
Open-loop control-to-output transfer function
Although not required for the compensator design we will now calculate the output impedance for demonstration purposes. To do so we need to inject a small ac current into the converter output and measure the resulting perturbation of the output voltage. We therefore connect a controlled current source in parallel with the load resistor as shown below. This current source is controlled by the perturbation signal of the AC Sweep block. The block input is again connected to the load voltage signal. The average steady-state output current is 5 amperes; we therefore set the initial perturbation amplitude to 1e-2.
Open-loop output impedance
Alternatively you can determine the open-loop transfer functions using the Impulse Response Analysis block as shown in the figure below. In this analysis method the calculation of an individual output point is relatively inexpensive; we therefore set the number of points to 300 and extend the sweep range to [10 50000]. In order to compensate for the discrete rectangular pulse used to perturb the system, we choose the setting external reference for the control-to-output transfer function and discrete pulse for the output impedance.
Using the Impulse Response Analysis block
PID compensator and transfer function
The compensator is implemented as shown above. The compensator output is limited to 0.1…0.9. In order to prevent windup problems during the steady-state analysis the integrator is limited to the same range.
Closed-loop gain
The resulting bode plot of the closed-loop gain shown in the figure below. Also shown are the open-loop control-to-output function with a dashed line and the PID compensator transfer function with a dotted line. As you can see, the design goals for crossover frequency and phase margin have been reached.
Another method for obtaining the open-loop transfer functions of a circuit is a technique called state-space averaging. This topic is fairly complex and could easily fill a book of its own. This manual therefore assumes that you are familiar with the concept and just highlights how to use PLECS in the process. The code examples given here are collected in the demo M-file plSSADemo.
The small-signal ac model of a dc converter operating in continuous conduction mode (CCM) is described by the equation system
You can use PLECS to calculate the different matrices ,
etc. and
from these the various transfer functions. Using the buck converter from the
previous example, the first step is to determine the internal order of the
switches:
Next you retrieve the state-space matrices for the two circuit topologies:
Now you can calculate the averaged state-space matrices:
The output impedance is the transfer function from a state-space input (the current source I_ac) to a state-space output (the voltmeter Vm). Such a transfer function is given by:
Since the circuit model is a MIMO (multi-input multi-output) model, you need to specify the indices of the proper elements in the input and output vector. You can identify them using the fields Inputs and Outputs of the struct names that you retrieved earlier:
So, the output impedance is the transfer function from input 2 to output 1. If you have the Control System Toolbox you can now display the Bode diagram:
The figure below shows the output impedance drawn with a solid line. The dots represent the data points returned by the ac sweep.
Open-loop output impedance
The control-to-output transfer function describes the effect of the small ac variation
on the system outputs. From the small-signal ac model equations we find that
with
This leads to the following program code:
The figure below shows the control-to-output transfer function drawn with a solid line. The dots represent the data points returned by the ac sweep.
Open-loop control-to-output transfer function