Verilog PWM Switch Models

download Verilog PWM Switch Models

If you can't read please download the document

description

Verilog PWM Switch Models2

Transcript of Verilog PWM Switch Models

// *****************************************************************//// PWMswVM.va - voltage mode PWM switch CCM-DCM auto-togggling//// ***************************************// Owner : Nicolas Cyr// E-mail : [email protected]// ***************************************// // Using Christophe Basso's model from his book "Switch-Mode Power// Supplies" (McGraw-Hill, 2008); based on Dr. Vatch Vorprian// initial concept developped in 1986 at Virginia Polytech Institute// (in "Simplified Analysis of PWM Converters Using the Model of the// PWM Switch", Transactions on Aerospace and Electronics Systems,// vol. 26, no. 3, May 1990).//// ***************************************// Revision history//// 2008 Jan 23 - Nico Cyr - creation//// *****************************************************************`include "constants.vams"`include "disciplines.vams"module PWMswVM(a, c, p, DC);inout a; electrical a; // "active" terminalinout c; electrical c; // "common" terminalinout p; electrical p; // "passive" terminalinput DC; electrical DC; // "duty cycle" inputparameter real L=100u from (0:inf); // inductance valueparameter real Fsw=100k from (0:inf); // switching frequencyparameter real DCmax=0.99 from (0:1); // duty cycle max clampparameter real DCmin=0.016 from (0:DCmax); // duty cycle min clampreal d1clh, d1cl, d_2, d2clh, d2cl;analog begin// calculate and clamp ON time duty cycle d1d1clh = (V(DC) >= DCmax) ? DCmax : V(DC);d1cl = (d1clh = (1-d1cl)) ? (1-d1cl) : d_2;d2cl = (d2clh