S-Z AC ANALYSIS OF SWITCHED CIRCUITS IN PSPICE PROF. ING. DALIBOR BIOLEK, CSC. ING. IERA BIOLKOÁ DOC. DR. ING. ZDENĚK KOLKA Absrac: Th papr xplains basic idas how o modl and analyz h AC bhavior of circuis conaining analog swichs, conrolld by priodical xrnal clock, namly Sampl-Hold circuis and swichd capacior filrs. A procdur of making up h so-calld s-z modls is dscribd as wll as hir implmnaion in PSPICE. Ky words: Swichd circui, Sampl-Hold, Swichd capacior, AC analysis, PSpic INTRODUCTION In h ara of analog signal procssing, h rm swichd circui dnos a circui, conaining analog swichs wih h possibiliy of conrolling hir sas lcronically. A numbr of circuis from various applicaions blong o his group. L us mnion swichd capacior filrs, Sampl-Hold circuis, pak dcors, mixrs, modulaors of shif-kying chniqus, a wid rang of swich-mod powr supplis, swichd DC-DC convrrs, c. Th swich sa can b conrolld ihr by an indpndn clock signal (h cas of swichd capacior circuis), or i dpnds on h inrnal sa of h circui (.g. h fdback volag rgulaor of DC-DC convrr). Thn w alk abou circuis wih xrnal and inrnal swiching []. Swichd circuis blong o sysms in which h procsss hav vry dissimilar im scals (h procss of swich acion on h on hand, and h nvlop or avrag valu of h signal on h ohr hand). During h ransin analysis, h program mus conrol h im sp according o h fas phnomna, which rsuls in long simulaing runs. Anohr problm is associad wih h inffciv procss of h im sp conrol whn simplifid (bhavioral) modls of idalizd swichs ar usd. Th convnional circui analysis programs do no provid any suppor for an ffciv analysis of such a kind of nworks. Th only ool is rprsnd by h ransin analysis, whos im sp is drmind by h swiching frquncy. Also, h dirc compuaion of h priodical sady sa as wll as h AC analysis is no availabl (wih h xcpion of spcial RF simulaors which do no arg h swichd circuis). In h pas, a numbr of mhods hav bn dvlopd for compur modling and simulaion of swichd circuis wih ngligibl raios of im consans of ransin phnomna and lnghs of swiching phass. Ths mhods wr crad paricularly for h analysis of circuis wih capaciors chargd in jumps, i.. for swichd capacior filrs. Th wll-known paprs by lach al. [], [], [3] and his spcial programs such as SWANN [] should b mniond hr. Th abov programs work on qui a diffrn principl han SPICEcompaibl programs. Thy mploy idal modls of circui lmns: idal swichs (shor conncion in h on-sa, opn circui in h off-sa), capaciors, and idal ransforming clls (conrolld sourcs and idal opraional amplifirs). Th circui quaions, which ar mad up from h swichd circui opology and ar subsqunly solvd by spcial algorihms, ar h socalld z-domain charg quaions, whr z is h opraor of h z-ransform. A crain progrss in h compur simulaion of swichd circuis was achivd during h 980s also in our counry: Th firs COCOSC and MINICOCOSC programs for h symbolic analysis of idalizd swichd capacior filrs in h world wr dvlopd in coopraion bwn Tchnical Univrsiy of Brno and Miliary Acadmy Brno [4-7]. Subsqunly, h firs program for smisymbolic analysis of swichd nworks SCSK [8] and h firs program for im-domain analysis SCC [9] wr dvlopd. Th lar providd (on h hn
8-bi compurs) for h analysis of forcd circui rsponss o various signals from h library and vn for h analysis of h priodical sady sa. Anohr imporan conribuion by h prsn applicans o h hory and praxis of swichd circui modling and simulaion is h so-calld hory of gnralizd ransfr funcions (GTF) [0], which nabld h AC analysis of ral swichd nworks. A ha im, as a consqunc of h dvlopmn of swichd circui applicaions in powr lcronics, an urgn ncssiy of compur simulaion appard for circuis which wr a sor of opposi o h swichd capacior circuis. Th swichd DC-DC convrr is a ypical rprsnaiv: h im consans of h ransins ar longr (much longr in h idal cas) han h duraion of h swiching phass. Th mhods of modling swichd circuis wih ngligibl im consans canno b usd in such cass. Tha is why nw mhods, basd on h so-calld avraging approach, hav bn dvlopd [3], [4], which rplac h swichd circui, a h cos of crain simplificaion, by an quivaln modl for h signal nvlop or is avrag valu. A gra advanag consiss in h asy ingraion of h avragd modls ino h SPICE-compaibl programs, bu on h assumpion ha h usr is familiar wih h chniqu of avragd modling. Thr ar also som drawbacks in his approach. Th avragd modls sop working for phnomna ha ar fas in comparison wih h swiching priod. Tha is why h frquncy rsponss of DC-DC convrrs, usd.g. in h dsign and opimizaion of fdback rgulaors of h oupu volag, provid rlvan rsuls only up o on half of h swiching frquncy. Also, hr ar no known procdurs of how o xrac informaion from h avragd modl abou h sid ffcs, which ar rlad o aliasing in h frquncy domain. Th avraging also smoohs all h informaion abou h swiching characr of h signals. Tha is why on canno find, for xampl, h sady-sa volag rippl from h avragd modl. Such characrisics ar only availabl via im-consuming ransin analysis. Our prliminary analyss [5] indica ha som of h abov problms should b ovrcom using h hory of gnralizd ransfr funcions, bcaus modling, basd on GTF, ss no limis o h lngh of ransin phnomna in h circui. Tha is why h GTFs would offr a mor univrsal mhodology for modling h swiching phnomna ihr in h circuis of powr lcronics or in h swich capacior nworks. L us conclud ha h algorihms hihro dvlopd for an ffciv analysis of swichd circuis, canno b convnionally implmnd in SPICE-compaibl programs in mos cass. Thr is no univrsal mhod simulanously applicabl for h analysis of swichd circuis wih small im consans (swichd capacior circuis), and wih larg im consans (swichd DC-DC convrrs), and hus for h hybrid circuis ihr (.g. h Sampl-Hold circuis, which combin h xrmly small and larg im consans). Tha is why a numbr of spcial programs wih diffrn inrnal algorihms xis, which nabl h analysis of circuis from limid applicaion groups. Th sourc cods of hs programs ar no frly availabl and hr is no lgal possibiliy of modifying and rdisribuing hm. This is in conradicion wih our nds for a dirc ingraion of nw mhods of modling and analysis ino h simulaor. In his papr, w dscrib a possibiliy of dirc AC analysis of swichd circuis in PSpic, wihou any limiaions o h valus of im consans in h circui bing analyzd. Th mahmaical ool which will b usd is h GTF approach. No ha w limi our considraions o h AC analysis. Th discussion of ohr yps of Spic analyss is byond h scop of his papr. GENERALIZED TRANSFER FUNCTIONS Considr a simpl modl of Sampl-Hold (S-H) circui in Fig. (a) and h corrsponding wavforms in Fig. (b). A any momn, h circui opras in on of wo possibl phass, dnod in Fig. as phas (h clock signal φ is HIGH and h swich is closd), and phas (h clock signal φ is LOW and h swich is opn). Th raio ε of duraion of phass and can b from 0 o. In ral S-H circuis, ε is blow ½, ypically ε = 0.. Du o nonzro im consan of charging h capacior hrough h nonzro swich on-rsisanc, h oupu volag a im insan kt+ of finalizing h sampl slcion will no xacly qual o h inpu volag. Analyzing his dynamical rror of sampl slcion, w concrn no in h nir oupu signal, bu only in is discr valus a h nd of swiching phass. Th corrsponding dos ar markd in Fig. (b) by unfilld rings. Dpndnc of h qualiy of h sampl slcion on h frquncy of sampld signal can b valuad as follows:. W xci h S-H circui by a harmonic volag wih a crain frquncy. This signal will gradually s h circui in h (quasi)priodic sady sa.. In h oupu signal w idnify poins which w ar concrn in. In our cas, hs poins li a nds of swiching phass. 3. Th poins from sp w inrlav wih a harmonic signal wih h frquncy qual o hos of h inpu signal. This ask is unambiguous [0]. W obain a signal calld quivaln signal v o signal v [0]. 4. Comparing wo harmonic signals v and v yilds valus of gnralizd ampliud and phas frquncy rsponss of h circui on h concr frquncy of inpu signal. 5. W rpa h abov sps for various frquncis of xcid signal, aking hm from rquird limis on h frquncy axis in ordr o obain gnralizd frquncy rsponss. No ha jus h GTF K(s, is a compac mahmaical dscripion of h gnralizd frquncy rspons. Th frquncy rsponss can b acquird from GTF afr wll-known subsiuions s = jω and z = xp(jωt), whr T is h swiching priod. I sands for rason ha frquncy rsponss will dpnd on how o choos h poins of inrs on h oupu wavform. As an xampl, h scond quivaln signal v is shown in Fig. (b), which is inrlavd wih crosss a h nds of phas. Anohr poin, markd by filld circl T p sconds afr nd of phas, conains
informaion abou h valu of oupu volag a im insan of finishing AD convrsion by convrr, aachd o h S-H oupu. Anohr quivaln signal and frquncy rspons will b assignd o hs poins. Comparing i wih h signal v and h corrsponding frquncy rspons, on can dduc an amoun of volag drop of h oupu volag during h AD convrsion in h HOLD sa. L us conclud ha an infiniy s of quivaln signals can b assord o singl signal of swichd circui, and on GTF o any rlaion of inpu-quivaln oupu signal. In his way, on can modl h swichd circui from mor poins of viw, dpnding on circui faurs w ar inrsd in. kt w() Φ T p kt+ kt+t w() v() Φ v ( ) C v ( ) R v() (a) Fig. : (a) Modl of h Sampl-Hold circui, (b) h corrsponding wavforms. EXAMPLE OF GTF EALUATION FOR S-H CIRCUIT Considr h modl of S-H circui in Fig. (a) wih nonzro and signal indpndn on-rsisanc R on and infiniy off-rsisanc of h swich. Thn h circui is dscribd by linar quaions in ach swiching phas. Th following quaions valua oupu volag a h nds of givn phass. Indx of his phas is markd by h suprscrip. Phas : kt < kt+ τ v ( kt + ) = v ( kt ) + g ( ξ ) w( kt + ξ ) dξ () whr Phas : kt+ < kt+t v ( kt 0 (b) (ε τ + T ) = v ( kt + T ), () ε τ τ = ( Ron & R) C, τ = RC, g( ) =. (3) RonC Now considr harmonic inpu signal, dscribd by a complx phasor s w( ) = W ˆ, s = jω. (4) Lf sids of () and () dscrib sampls of oupu volag a h nds of swiching phass and. In ohr words, hy ar sampls of quivaln signals v () and v () from (b), which naur is also harmonic. L us dscrib hs signals by complx phasors v s ˆ s ( ) = ˆ, ( ) =. (5) v Subsiuing (4) and (5) o () and () and arrangmn yild h rsuling form of Eqs. () and (): whr ˆ τ ˆ ε = z + G ( s, Wˆ, (6) (ε ˆ τ ˆ (ε ) = z, (7) st z =, (8) τ sξ R z G ( s, = g( ξ ) dξ = R + R + τ s 0 on ε. (9) Eqs. (6) and (7) g formulas for phasors of boh quivaln signals: whr ˆ ˆ ˆ = K ( s, W, = K ( s, Wˆ, (0) K ( s, = G ( s, (ε τ τ (ε τ K ( s, = K ( s, z z, (ε ) ar gnralizd ransfr funcions of S-H circui, corrsponding o h abov quivaln signals v () and v (). 3 GTF IMPLEMENTATION IN PSPICE Equaions (6) and (7) can b asily implmnd in PSpic program for a dirc AC analysis of S-H circuis. Blow is a compl lis of h circui fil for PSpic analysis: S-H circui, sampling frquncy 00kHz, GTF modling *.param C=0nF R=00kOhm Ron=50Ohm fs=00khz p=0. +Ts={/fs} RonR={Ron*R/(Ron+R)} +au={c*ronr} au={c*r} +xp={xp(-p*ts/au)} xp={xp((p-)*ts/au)} in in 0 AC= Eou ou x LAPLACE= +{(in)} {R/(R+Ron)*(-xp*xp(-s*p*Ts))/(+au*s)} Ex x 0 LAPLACE={(ou)} {xp*xp(-s*p*ts)} Eou ou 0 LAPLACE={(ou)} {xp*xp((p-)*s*ts)}
.sp param Ron lis 0 0 50 00.AC dc 00 00 500k.prob.nd Rsuls of h AC analysis for four diffrn swich on-rsisancs ar in Fig.. Th rsuling frquncy rsponss wr carfully chckd wih h rsuls of sady-sa ransin analysis of h swichd-lvl modl of S-H circui in Fig. (a). Th ngligibl diffrncs wr causd mainly by numrical inaccuracis of xpnsiv ransin analysis. 0-5 -0-0d -5d -50d -75d DB((ou)) -90d 00Hz.0KHz 0KHz 00KHz 500KHz P((ou)) Ron = (0,0,50,00)Ohms Ron = (0,0,50,00)Ohms Frquncy Fig. : Ampliud and phas frquncy rsponss of S-H circui for quivaln signal v. Th ncssiy of analyical drivaion of quaions ()-(0) prior hir modling in PSpic is a srious drawback of his mhod, paricularly in h cas of mor complicad swichd circuis. Th alrnaiv mhod dscribd blow ovrcoms his difficuly by mans of spcial numrical compuaions wihin h convnin ransin analysis. 4 SIMPLIFIED Z-DOMAIN GTF IMPLEMENTATION IN PSPICE Th GTF approach ruly modls h swichd circui bhavior also in h frquncy rgion abov on half of h swiching frquncy. Howvr, in many cass only h analysis blow Nyquis s frquncy is normally prformd wihou h ncssiy o uiliz his uniqu faur. Thn a simplifid z-domain modling can b usd insad of h mor gnral s-z dscripion. This simplificaion nabls asy PSpic modling, basd on h numrical approach, avoiding h xpnsiv analyical prprocssing. L us considr ha h inpu signal w() rmains consan wihin h individual swiching phass. Thn quaions () and () can b wrin as follows: v ( ( kt T ) = av ( kt + T ) + bw( v kt + ε T ) = a v ( kt) + b w( kt ), () + ε kt + ). () Hr h cofficins a, b, a and b dpnd on h circui opology in phass and and on h duraion of swiching phass. I is obvious ha b = 0 if h swich has an infini off-rsisanc. Th rmaining cofficins can b compud in PSpic during h ransin analysis by h following mhod. Th cofficins from Eq. () / () will b valuad via h ransin analysis of h circui, which is simplifid for h swiching phas /, wihin h lngh T / T of h simulaion run. Hr T = and T =(-ε)t. Th a cofficin is givn by h naural rspons o h iniial volag of h capacior for h inpu volag o b zro a h nd of ransin analysis. Th b cofficin is qual o h final valu of forcd rspons o h inpu volag of wih zro iniial condiion. Knowing hs cofficins, h frquncy rspons will b compud from h s of z-domain quaions ˆ ˆ ˆ ε = ( a + bw ) z, (3) ˆ ˆ ˆ (ε ) = ( a + bw ) z. (4) Howvr, hr ar wo fundamnal problms whn implmning h abov procdurs in PSpic: Rpad ransin analysis is rquird in ordr o obain rsuls of hs analyss for h subsqun analysis. OrCad PSpic dos no allow his. Afr h ransin analysis, h AC analysis should b xcud, procssing h daa from h ransin analysis. Howvr, PSpic dos no suppor such daa sharing. Problm can b ovrcom by xcuing on ransin run of lngh T >T. Th auxiliary modls for phass and ar analyzd simulanously. Th a and b cofficins ar valuad a im poin T, h a and b cofficins a h nd of analysis run. To kp h valus of all h cofficins a h nd of h analysis, w mus compl his schm by idal Track-Hold blocks wih h sampling acion a im T. Th volag a hir oupus will hn corrspond o valus a and b. To nsur a high prcision of h sampling a im T, w us a spcial BREAK funcion which is implmnd in OrCad PSpic 5.7. Similarly, h idal Track-Hold block can b modld, combining h nw BREAK and STATE funcions for bhavioral modling. Problm mus b solvd on h plaform of ransin analysis. For a paricular angular frquncy ω, complx quaions (3) and (4) can b rwrin as four ral quaions, uilizing h qualiy jωt z = = cos( ωt ) + j sin( ωt ). Th frquncy will b dfind as a global paramr by h.param samn, wih h possibiliy of spping i wihin h rquird frquncy rang. Th abov s of quaions mus b solvd simulanously wih quaions
() and (). For a givn frquncy, h corrc valu of frquncy rspons is availabl a h nd of h ransin run. Th compl PSpic v. 5.7 inpu fil is as follows: SH circui, z-domain soluion.param C=0nF R=00kOhm Ron=50Ohm fs=mghz + p=0. p={-p} + T={p/fs} T {(p)/fs} T={/fs} f=k om={*pi*f}.param cos={cos(om*p*t)} sin={sin(om*p*t)} + cos={cos(om*p*t)} sin={sin(om*p*t)} *prcis compuaion of circui valus for =0.us x x 0 valu={brak(0.u)} *compuing a=volag across C a h nd of im T Xa 0 oua SH XTHa oua a TH.IC (oua)= *compuing b=volag across C a h nd of im T b b 0 Xb b oub SH XTHb oub b TH *compuing a=volag across C a h nd of im T Xa oua SH a a 0 valu={(oua)}.ic (oua)= *compuing AC rspons via ransin analysis!!! wr wr 0 DC= wi wi 0 DC=0 Ecr cr 0 valu={((a)*(cr)+(wr)*(b))*cos+ +((a)*(ci)+(wi)*(b))*sin} Eci ci 0 valu={-((a)*(cr)+(wr)*(b))*sin+ +((a)*(ci)+(wi)*(b))*cos} Ecr cr 0 valu={(a)*(cr)*cos+ +(a)*(ci)*sin} Eci ci 0 valu={-(a)*(cr)*sin+ +(a)*(ci)*cos} Emod mod 0 valu={sqr((cr)^+(ci)^)} Epha pha 0 valu={aan((ci),(cr))*80/pi}.sp dc param f k 3mg 50.ran 0 0.9u skipbp.prob.subck SH in ou Ron in ou {Ron} C ou 0 {C} Rload ou 0 {R}.nds.subck SH ou C ou 0 {C} Rload ou 0 {R}.nds.subck TH in ou TH ou 0 valu={if(im<=0.u,v(in),sa(0,(ou)))}.nds.nd -00 0-0 SEL>> - 50-0 -50 db(yalasx((mod))) -50.0K 0K.0M YaLasX((pha)) f Fig. 3: Frquncy rsponss, compud by numrical z- domain mhod (solid lins), compard o gnral s-z mhod (dashd lins), f s = MHz. Th rsuling frquncy rsponss for a swiching frquncy of MHz, compud via h ransin analysis, ar shown in Fig. 3. Th sandard YaLasX masuring funcion is usd in PROBE for valuaing h las valu of circui variabl a h nd of ransin analysis. Th dashd curvs from h gnral s-z analysis ar addd for comparison. I should b nod ha boh rsuls ar narly idnical for h frquncy rang up o on half of swiching frquncy. 5 CONCLUSIONS A novl mhod of AC analysis of linar circuis wih xrnally and priodically conrolld analog swichs is dscribd. This mhod uilizs h so-calld gnralizd s-z ransfr funcions. In comparison wih h classical mhods basd on avragd modling, h advanags consis in a mor faihful modling of circui bhavior, paricularly in h frquncy rang around fswich/, as wll as in h abiliy o modl corrcly h ransfrs abov his bordr frquncy. A drawback consiss in h ncssiy of analyical prprocssing of circui modls prior o hir implmnaion in SPICE. An algorihm of auomad building up of h corrsponding circui
marics is publishd in [0]. Howvr, i is incompaibl wih h inrnal SPICE algorihms. Tha is why i can b implmnd only in spcial-purpos programs. To avoid his difficuly, an original mhod of AC analysis via convnional ransin analysis in PSpic has bn dvlopd. This mhod is basd on h assumpion ha h inpu signal rmains unchangd during h swiching phas. In spi of his simplificaion, h prcision of AC analysis is lil affcd for frquncis up o on half of h swiching frquncy. 6 REFERENCES [] Bdrosian, D. G., lach, J. An acclrad sadysa mhod for nworks wih inrnally conrolld swichs. IEEE Trans. on Circuis and Sysms I, ol. 39, No. 7, pp. 50-530, 99. [] alsa, J., lach, J. Swann - a Programm for Analysis of Swichd Analogu Nonlinar Nworks. Inrnaional Journal of Circui Thory and Applicaions, 995, vol. 3, pp. 369-379. [3] Opal, A., lach, J. Analysis and snsiiviy of priodically swichd linar nworks. IEEE Trans. on Circuis and Sysms I, ol. 36, No. 4, pp. 5 53, 989. [4] Čajka, J., Dosál, T., Fncl, F. Compur-Aidd Analysis of SC Circuis. In: Th Library of Scinific works, UT Brno, 987, No. B-4, pp. 97-00 (In Czch). [5] Čajka, J. Compur-Aidd Symbolic Analysis of Nworks Conaining Immianc Convrrs and Idal Opraional Amplifirs. ISCAS 74, pp. 55-59, IEEE, San Francisco, 974. [6] Čajka, J., Dosál, T., Fncl, F. Nw rsion of h COCO Program. Radionginring, ol. 3, No. 3, pp. 8-, 994. [7] Čajka, J., rba, K., Biolk, D. Improvd program for symbolic analysis and synhsis of linar circuis. AMSE'94, Lyon, ol., pp. 99-30, 994, Franc. [8] Biolk, D. SCSK program for analysis of swichd capacior circuis. Elcronic Horizon, ol. 50, No. 4, pp. 7, 989 (In Czch). [9] Biolk, D. Compur analysis of wavforms in swichd capacior filrs. Elcronic Horizon, ol. 5, 990, No. 5, pp. 4 (In Czch). [0] Biolk, D. Modling of Priodically Swichd Nworks by Mixd s-z Dscripion. IEEE Trans. on CAS-I, ol. 44, 997, No. 8, pp. 750-758. [] Opal, A., lach, J. Consisn iniial condiions of linar swichd nworks. IEEE Trans. On Circuis and Sysms I, ol. 37, No. 3, pp. 364 37, 990. [] Biolk, D. Tim domain analysis of linar sysms using Laplac invrsion. Radionginring, No., 994, pp.7-0. [3] Middlbrook, R.D., Ćuk, S. A gnral unifid approach o modling swiching-convrr powr sags. In. Journal of Elcronics, 977, vol. 4, no. 6, pp. 5-550. [4] Basso, C.P. Swich-Mod Powr Supply SPICE Cookbook. McGraw-Hill, 00. [5] Biolk, D., Biolková,., Dobš, J. Modling of swichd DC-DC convrrs by mixd s-z dscripion. In: IEEE Inrnaional Symposium on Circuis and Sysms, ISCAS006, Grc, Kos, 006, pp. 83 834. Acknowldgmn This work is suppord by h Gran Agncy of h Czch Rpublic undr grans No. 0/05/077 and 0/05/077, and by h rsarch programms of BUT MSM00630503, MSM0063053, and UD Brno MO FT0000403. Th corrsponding auhor: Dalibor Biolk, Prof. Ing. CSc., UO Brno, K7, Kounicova 65, 6 00 Brno, dalibor.biolk@unob.cz