Comparison of Duty Cycle Generator Algorithms for SPICE Simulation of SMPS

The paper presents and discusses an algorithm for average modeling of the PWM modulator in switch-mode power systems by general purpose electronic circuit simulators such as PSPICE. A comparison with previous theoretical models is conducted. To test the accuracy of the average PWM models comparison to cycle-by-cycle simulation was conducted. The proposed algorithm shows better accuracy than earlier counterparts.


Introduction
Today circuit simulation and computer-aided design are universally accepted engineering tools and have become industry standard method of product development.Two approaches are possible for simulation of switched mode systems: cycle-by-cycle simulation and average behavior simulation.Cycle-by-cycle simulation is a quite straightforward approach.Cycle-by-cycle simulation can be performed programming the complete power electronic circuit to the simulator.Cycle-by-cycle simulation allows studding the power stage at the switching frequency scale and observing the instantaneous voltages and currents at any point in the circuit.First disadvantage of cycle-by-cycle simulation is that simulating the detailed switching process is time consuming.This is particularly true for nontrivial practical cases.The second and by far more important limitation is that the cycleby-cycle model of a switching circuit does not lend itself to frequency response analysis.This is because the switching stage has no stable operating point and, hence, does not allow the PSPICE simulator to perform linearization and calculate the small signal gains required for frequency response analysis.Therefore, a different approach is needed to attain frequency domain simulation of the control loop.
Average modeling of the power stage can also be helpful in simulation as they can be readily implemented using PSPICE behavioral sources [6][7][8].Average models are continuous and, hence, can be automatically linearized by the PSPICE simulator and prepared for the frequency domain analysis.The ability to obtain the frequency response of the feedback loop allows the practicing engineer to evaluate the system's stability and to design the compensator network to meet the design objectives.
The distinct characteristic of SMPS is that a switchedmode stage is employed as power processor, whereas the control circuits are mostly analog where Pulse Width Modulator (PWM) is used as an interface.A typical structure of a PWM switch-mode power system (SMPS) is illustrated in Figure 1 [8].Here, as an example, an average current mode (ACM) system is shown.There are two major challenges in simulation of a switch-mode system.The first is modeling the switcher, whereas the second is modeling the PWM modulator.To model the average behavior of switch mode power stages Switched Inductor Model (SIM) was proposed [6][7][8], whereas the PWM duty cycle generation process can be modeled by software Duty Cycle Generator (DCG) approach [8].The PWM modeling problem is that in practice the switching ripple propagates into the control loop and affects the switch on and off times.However, the average SIM model has no ripple components; therefore, in order to obtain accurate simulation results, software DCG should be programmed to predict the switching ripple effects using only the average signals of the SIM model.Another task of the DCG is to anticipate the mode changes of the power stage and calculate the correct off duty cycle in case of CCM-DCM transition.
This paper proposes a more precise, PSPICE compatible, average DCG algorithm for modeling the PWM comparator.The operation of the proposed average PWM model is demonstrated by time domain and frequency domain simulations.The paper also conducts a comparison with previously reported results.To validate the model's accuracy, the proposed average algorithm and its earlier counterparts are compared to cycle-by-cycle simulation.Particularly, in the discontinuous current mode the proposed algorithm shows better accuracy than earlier counterparts.

Software Duty Cycle Generators
2.1.PWM Relationships.In recent years ACM control has become the method of choice for many advanced SMPS.The principle of ACM is to implement a multiloop control system in which the inner loop (see Figure 1), controls the average current and makes it tightly follow the outer loop command.The inner/current loop amplifier, CA, provides higher gain in the low-frequency region and extends the inner loop bandwidth.These features are very desirable and provide good tracking performance.
Usually, the average current loop amplifier (CA) is designed to have a high/low-frequency gain and a flat response in the vicinity of the switching frequency as shown in Figure 2 [9].Consequently, the current programming signal at the output of CA, v cp , has an average component, v cp , with a superimposed attenuated inductor current ripple, as shown in Figure 3.The ripple is scaled by the gain of the current sensing network, R s , and the CA amplifier gain at the switching frequency, a = |A ca ( f s )|.
Referring to Figures 1 and 3, the switch on time is initiated by a clock pulse and terminated by the PWM comparator at the moment the current programming signal, v cp , intersects the external ramp.The comparator is usually followed by a latch, which remains reset till the end of the switching cycle and prevents output chatter.A real world comparator uses instantaneous ramp and CA output voltages, whereas in the average system represented by SIM these variables do not exist.The essence of the modeling problem is to accurately determine the on duty cycle, D on , relaying on the knowledge of the average CA output voltage, v cp , the ramp amplitude, V p , and other average system parameters.
Let the external, charging, and discharging slopes of PWM comparator input signals (see Figure 3), be defined following the notation of [8]: where (see Figure 1) V ab and V ac are the SIM terminal voltages; L is the SIM inductor value; T s is the switching cycle; V p is the external ramp peak voltage; a, R s are as defined above.
The intersection instance of current error amplifier and the ramp voltages (see Figure 3) uniquely determines the on duty cycle, D on , as well as all the average quantities for the given switching cycle.Investigating the modulator waveforms of Figure 3(a), and applying basic geometrical considerations to calculate the area under the v cp curve, as suggested in [10], reveals that the average current programming signal, v cp , D on and D off duty cycles and other circuit parameters are related as follows: ( Advances in Power Electronics 3 The required on duty cycle, D on , is the solution of the quadratic equation ( 2), which takes into consideration the CA average current programming signal v cp as well as other operating conditions.The switcher terminal voltages are imbedded in the slopes S on and S off , as defined in (1), whereas D off in DCM depends on D on as well as on the average current and system's parameters.Inspection of (2) reveals that under CCM conditions, the term (1 − D on − D off ) vanishes and ( 2) is reduced to the expression, previously reported in [10]:

Comparison with
DCG based on (3) can be used in CCM under transient conditions for which S on and S off may assume an arbitrary value.Obviously, with the term (1 − D on − D off ) missing, (3) is less accurate than (2) in DCM.
Considering that the power stage is operating with slow varying signals in the vicinity of the CCM steady-state equilibrium so that S e D on ≈ S off D off , (2) takes the following form: which is identical to that suggested in [11].For a CA amplifier with a significant attenuation of the switching ripple, S e S on , S off , ( 2) is further simplified yielding which is identical to the classical Voltage Mode PWM function [12].

On Duty Cycle
Programming.Algorithms (2)-( 5) are arranged in a descending order of accuracy and programming complexity.Explicit solution for D on duty cycle could be obtained from ( 4) and (5).The case of (5) could be implemented in PSPICE by a simple "E" source yielding D on duty cycle, coded in voltage at the output.The "E" source should have a gain constant (1/V P ) and controlled by a single input variable, that is, by the average current programming signal v cp : The modulator model ( 6) totally disregards the ripple component.As it is clearly shown at Figure 3, (6) aims at the intersection of the ramp and the average CA voltage, v cp , somewhat to the right of the correct value of D on , thus, providing only an approximate results for both the CCM and the DCM modes.Therefore, ( 6) is generally recognized as a simplistic model that can be used under low current ripple conditions arising in Voltage Mode converters, whose loop gain provides heavy attenuation of the switching ripple.
Implementation of ( 4) requires E-value source performing a division: Here, the constant k = aR s /2L f s , V p , and the switching frequency, f s = 1/T s , should be defined as parameters in PSPICE program.This result is analogous to that suggested by [11].DCG programmed according to (7) is relatively simple; however, it accounts for the current ripple.Implementation of ( 7) requires an E-value source governed by two Advances in Power Electronics control variables v cp and V ab .Note that application of (7) requires a preliminary calculation or simulation to correctly establish the system constant k [7,8].
A different programming approach is required in order to apply the nonlinear DCG algorithms (2).Using (1) and rearranging terms, the proposed DCG algorithm (2) could be realized as follows: Due to its relative complexity, the proposed DCG implementation ( 8) is hardly useful as an analytical tool; however, PSPICE can obtain a numerical solution of recursive equations of the D on = f (D on , . ..) type.Equation ( 8) holds several advantages for simulation purposes.First is that accurate D on duty cycle could be generated of the given average current programming signal, v cp , and the average SIM terminal voltages V ab and V ac .
As suggested by [6], in order to take account of the DCM-CCM mode transitions frequently encountered in switchmode systems, the Don generator should also be accompanied by the Doff software generator.A quick reference to Doff generator programming is given in the Appendix.

Comparison of the DCG Algorithm's Performance through
Simulation.In order to compare the performance of the previously described software duty cycle generator algorithms, a PSPICE simulation program was created.The program simulated the time domain response of an ACM dc-dc boost converter in DCM and CCM regimes.Simulation diagram of the circuit is shown in Figure 4(a).The circuit parameters were input dc voltage 12 Vdc, output dc voltage 48 Vdc, boost inductor 200 uHy, switching frequency 100 kHz, peak ramp voltage 5 Vpk.Other circuit parameters are given in the diagram.The circuit was commanded to operate in the DCM and in CCM modes by appropriately stepped current reference signal.The simulation was run cycle-by-cycle to obtain the exact time domain behavior of a real circuit.The obtained results were used as a reference for comparison.The average values of the current amplifier output signal and the inductor current were obtained by heavily filtering.The filtering was done using ORCAD lowpass filter ABM blocks with passband attenuation of 1 db up to 75 kHz, whereas attenuation of 50 db was attained at 100 kHz which effectively removed the switching ripple components.The so-obtained averaged variables were used to command the average models of the DCG generators according to (6), (7) and (8).Doff duty cycle was obtained using (A.5) as described in the Appendix.
The simulated waveforms of the key variables in both the DCM and the CCM modes are shown in Figures 4(b)-4(e).The normalization of the saw-tooth ramp and the current programming signals was done relatively to the peak ramp voltage, V p .The average duty cycles, generated from the averaged variables, were compared to the waveforms of the cycle-by-cycle-simulated PWM comparator.The closer the average D on signal is to the intersection point of the ramp and CA voltage, the accurate the D on algorithm is.As expected, for both CCM and DCM modes DCG generator (8) proved to be the most accurate, (7) had good accuracy and (6) was only fairly accurate.Particularly, in DCM, see Figure 4(c), the accuracy of the proposed algorithm ( 8) is noticeably better than that of (7), and much better than that of (6).In CCM (see Figure 4(e)) algorithm ( 6) achieves only fair accuracy, whereas both algorithms (7) and ( 8) are of comparable performance providing excellent results where only a negligible advantage in favor of ( 8) can be seen.

Demonstration of Autonomous Operation of the Proposed DCG.
Next, a complete model of the inner loop of an ACM Boost PFC converter based on benchmark design [9] was derived using the methodology described in the previous sections.The SIM equivalent circuit was used to model the boost power stage and DCG duty cycle generators to model the PWM.The DCGs ( 7) and ( 8) were compared.The simulation diagram of the circuit is shown in Figure 5(a).The simulation program operates only with the average variables and allows performing Transient as well as AC study of the current loop.The circuit should be prepared for the frequency response analysis by properly placing an AC test source, V test , within the current loop as shown and introducing offset value to the Vline source to preserve the operating point.Introducing initial conditions helps guiding the simulator to settle on a correct operating point.Comparisons of the simulated frequency response plots due to the DCG (7) and DCG (8) of the inner loop are shown in Figure 5

Conclusion
The paper presented a PSPICE software algorithm for modeling the average behavior of PWM modulator in switchmode systems.The proposed duty cycle algorithm describes the PWM function in both CCM and DCM operating modes and correctly predicts the duty cycle under any operating conditions.Comparison with previously published results supports the theoretical validity of the proposed approach.The proposed average PWM model (8) was implemented in PSPICE software and compared with cycle-by-cycle simulation yielding excellent results.The proposed algorithm (8) was also compared to the earlier counterparts and was indeed found to be more accurate.Particularly, in DCM, the accuracy of the proposed algorithm ( 8) is noticeably better than that of (7), whereas in CCM ( 7) and ( 8) are of comparable performance with only a negligible advantage in favor of (8).In the frequency domain, which uses log scale for the amplitude, the responses were comparable.However, the higher accuracy of the proposed algorithm (8) comes at the price of added programming complexity, which is its main disadvantage.The proposed algorithm (8) can be Limit (min(( 208.33 n * V (a)

Gcref
Parameters: Grec Erec successfully applied in simulation; however, it is inconvenient to be used as a theoretical tool.Also, the recursive nature of ( 8) aggravates convergence problems.While having somewhat lesser accuracy in DCM, the software duty cycle generation algorithm (7) has the advantage of simplicity and lesser convergence problems.Moreover, the expression ( 7) is identical to the PWM modulator function proposed by [11], which is currently considered as a widely accepted method for theoretical analysis of current mode converters.Therefore, the results of this study provide an additional verification and support the validity and soundness of [11].SIM was developed by [6] and is shown in Figure 6(b).SIM derives the average inductor current applying an average voltage, E L , across the power stage inductor, L [6].The average voltage, E L , is a function of the terminal voltages, V ab and V ac , and the duty cycles D on and D off :

Appendix
The physical feature of current steering between the terminals b and c is modeled by the dependent current sources of the SIM model [8] (Figure 6  To implement (A.2) the simulation program is also required to produce the D off duty cycle.In case the power stage operates in CCM (see Figure 7 (A.3) In the case of DCM, however (see Figure 7(b)), D off depends also on other system parameters and operating conditions: The DCM D off by (A.4) is always smaller than CCM D off by (A.3).Hence, the software Off-Duty Cycle Generator is programmed to calculate both expressions (A.3) and (A.4) and decide on the proper, D off , using the PSPICE minimum function [7]: As a result, PSPICE is able to identify CCM-DCM mode changes and calculate the correct D off under any operating conditions.

Figure 1 :
Figure 1: A typical ACM SMPS.Modeling the SMPS requires the SIM to model the power stage and the DCG to model the PWM [8].
Other Theoretical Results.The proposed software DCG algorithm (2) can generate the required average duty cycle, D on , in the steady state, in transient conditions, CCM or DCM modes.
(b) and are hardly distinguishable from each other.The steady-state time domain waveforms of the average APFC model with DCG (8) are shown in Figure 5(c).

Figure 4 : 6 Advances
Figure 4: Simulation diagram of the ACM Boost converter (a): simulated waveforms of the instantaneous inductor current IL, instantaneous normalized ramp voltage VrampN, instantaneous normalized current programming voltage VcpN, cycle-by-cycle duty cycle D, average duty cycle DonM according to (6), average duty cycle DonR according to (7), average duty cycle Don according to (8).The DCM mode waveforms (b); exploded view of the DCM mode waveforms (c); the CCM mode waveforms (d); exploded view of the CCM mode waveforms (e).

Figure 5 :
Figure 5: PSPICE simulation diagram of the Average Current mode APFC current loop (a); Simulation of the current loop frequency responses (b); time domain waveforms of the scaled line voltage Vline/100 and line current I(Vline) (top), and the duty cycles Don, Doff; note that the sum D off + D off < 1 as DCM commences (bottom) (c).

A
. A Quick Reference to SIM and D off DCG Energy transfer in hard switched power converters is accomplished by periodic charging and discharging of an inductor.The topology of the switched inductor is shown in Figure 6(a).The switched inductor model (SIM) is an average behavioral model of the switched inductor block.

Figure 6 :
Figure 6: The topology of the switched inductor in PWM converters (a); and the Switched Inductor Model (SIM) equivalent circuit (b) [6].

Figure 7 :
Figure 7: Definition of the inductor discharge duty cycle Doff: CCM mode (a) and the DCM (b).
(a)) the Off Duty Cycle depends solely on D off :D off = 1 − D on .