PLECS 3.0 Online Help

Application Example

This section demonstrates the application of the analysis tools for the design of the regulated buck converter system operating at a switching frequency of 100 kHz shown in the figure below. The converter shall supply a regulated 15 volts to a resistive load at a nominal load current of 5 amperes.

pict pict

The examples used in this section follow the design example in [Erickson], chapter 9. They have been implemented in the demo models plBuckSweep, plBuckImpulseResponse and plBuckLoop.

Steady-State Analysis

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 Vout∕Vsrc = 15V ∕28V  . 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.

pict
Steady-state output voltage

AC Sweep

Open-loop control-to-output transfer function

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          √ ---
f0 = 1∕(2π LC) ≈ 1kHz   and a dc gain of G0 = 28V ≈ 29dB  .

pict pict pict
Open-loop control-to-output transfer function

Open-loop output impedance

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.

pict pict pict
Open-loop output impedance

Impulse Response Analysis

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.

pict pict
Using the Impulse Response Analysis block

Loop Gain Analysis

Compensator settings

pict
pict
PID compensator and transfer function

The compensator should attain a crossover frequency of fc = 5kHz  . At this frequency the open-loop control-to-output transfer function has a phase of nearly - 180∘ . It should be lifted by 52∘  to get a peak overshoot of 16%. This is achieved using a PD compensator with a zero at fz = 1.7kHz  , a pole at fp = 14.5kHz   and a dc gain of k = (fc∕f0)2∘fz-∕fp∕G0 ≈ 0.3  . For a zero stationary error a PI compensator with an inverted zero at fZ = 500Hz   is added.

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.

Loop gain

pict pict pict
Closed-loop gain

The gain of the closed control loop is measured by inserting the Loop Gain Analysis block into the loop path. A good place is the feedback path as shown below. The average steady-state load voltage is 15 volts; the initial perturbation amplitude is therefore chosen as 1e-2. The convergence of the initial steady-state analysis can be accelerated by pre-charging the capacitor to its average steady-state voltage.

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.

State-Space Averaging

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

d-~x(t)  =  A~x(t)+ B~u(t)+ {(A  - A )x+ (B  - B )u}m~(t)
dt                       {  1    2       1   2  }
  ~y(t)  =  C~x(t) + D~u(t)+  (C1 - C2)x+ (D1 - D2)u m~(t)

where the quantities ~x(t)  , u~(t)  , ~y(t)   and ~m(t)   are small ac variation around the operating point x  , u  , y   and m  . The averaged state-space matrices A  , B  , C   and D   are defined as

A  =   mA1 + (1- m)A2
B  =   mB1 + (1- m)B2
C  =   mC1 + (1- m)C2

D  =   mD1 + (1- m)D2

where the subscript 1 denotes the interval when the switch is conducting and the diode blocking, and the subscript 2 denotes the interval when the switch is blocking and the diode conducting.

You can use PLECS to calculate the different matrices A1  , A2   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:

load_system(’plBuckSweep’);  
names = plecsedit(’get’, ’plBuckSweep/Circuit’, ...  
  ’StateSpaceOrder’);  
names.Switches  
 
ans =  
    ’Circuit/FET’  
    ’Circuit/D’

Next you retrieve the state-space matrices for the two circuit topologies:

plecsedit(’set’, ’plBuckSweep/Circuit’, ’SwitchVector’, [1 0]);  
t1 = plecsedit(’get’, ’plBuckSweep/Circuit’, ’Topology’);  
 
plecsedit(’set’, ’plBuckSweep/Circuit’, ’SwitchVector’, [0 1]);  
t2 = plecsedit(’get’, ’plBuckSweep/Circuit’, ’Topology’);

Now you can calculate the averaged state-space matrices:

m = 15/28;  
A = t1.A*m + t2.A*(1-m);  
B = t1.B*m + t2.B*(1-m);  
C = t1.C*m + t2.C*(1-m);  
D = t1.D*m + t2.D*(1-m);

Output impedance

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:

 ~
Y(s)-= C(sI- A) -1B + D
U~(s)

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:

names.Inputs  
 
ans =  
    ’Circuit/V_dc’  
    ’Circuit/I_ac’  
 
names.Outputs  
 
ans =  
    ’Circuit/Vm’  
    ’Circuit/Am’  
    ’Circuit/FET’  
    ’Circuit/FET’  
    ’Circuit/D’  
    ’Circuit/D’

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:

bode(ss(A,B(:,2),C(1,:),D(1,2)), {2*pi*100, 2*pi*50000})

The figure below shows the output impedance drawn with a solid line. The dots represent the data points returned by the ac sweep.

pict
Open-loop output impedance

Open-loop control-to-output transfer function

The control-to-output transfer function describes the effect of the small ac variation m~  on the system outputs. From the small-signal ac model equations we find that

~Y(s)               -1
~----= Cco(sI- Aco)  Bco +Dco
M(s)

with

A    =  A
 co     {             -1             }
Bco  =    - (A1 - A2)A  B + (B1 - B2) u
Cco  =  C
Dco  =  { - (C1 - C2)A -1B + (D1 - D2)} u

Note that B
  co   and D
 co   are column vectors since there is only one scalar input variable, ~m  . The vector u   is a column vector consisting of the dc input voltage and the small-signal ac current.

This leads to the following program code:

u = [28; 0];  
 
B_co = (-(t1.A-t2.A)*(A\B)+(t1.B-t2.B))*u;  
D_co = (-(t1.C-t2.C)*(A\B)+(t1.D-t2.D))*u;  
 
bode(ss(A,B_co,C(1,:),D_co(1)), {2*pi*100, 2*pi*50000})

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.

pict
Open-loop control-to-output transfer function

Reference

R.W. Erickson, D. Maksimović, "Fundamentals of Power Electronics, 2nd Ed.", Kluwer Academic Publishers, 2003.