Tuesday, January 29, 2013

Netlist error?

I have the following CCM5 netlist (see below) as part of a larger schematic.  I get the following errors when I "run" it:
"Questionable use of curly braces in "b§er 1 1x v=v(5)*i(et)*{ron}+(1-v(5))*({et})*{rd}"
    Error: undefined symbol in: "[et]"
Questionable use of curly braces in "b§gd 4 3 i=({qr}/{ts})+({tr}/{ts})*i(et)+(1-v(5))*({et})"
    Error: undefined symbol in: "[et]"
Fatal Error: u1:gd:  -- Syntax Error --
Unknown symbol: et"

Any ideas why LtSpice does not like Et?

Also, is the CCM5 model found in switch.lib the correct model for HW2, problem 2?

Thank you,
CD

**********************************************************
* MODEL:    CCM5
* Application:    two switch PWM converters, includes
*         conduction loses due to Ron, VD, RD, Qr,
*        and tr for Ts
* Limits:    CCM only, no transformer
*
* Implementation:
* i1, v2 = independent variables
* v1, i2 = dependent variables
* <v1> = d(<i1>*Ron) + d'( <i1>*RD + VD + <v2>)
* <i2> = Qr/Ts + (tr/Ts)*<i1> + d'(<i1>)
**********************************************************

* Parameters:
*    Ron = transistor on-resistance, ohms
*    VD  = diode forward voltage drop, volts
*    RD  = diode on-resistance, ohms
*    Qr  = recovered charge, coulombs
*    tr  = recovery time, seconds
*    Ts  = sample frequency period, seconds
**********************************************************

* Nodes:
* 1: transistor positive (drain for an n-channel MOS)
* 2: transistor negative (source for an n-channel MOS)
* 3: diode cathode
* 4: diode anode
* 5: duty cycle control input
**********************************************************
.subckt CCM5 1  2  3  4  5
+params: Ron = 0.01 VD = 1 RD = 0 Qr = 0.00000015 tr =0.00000003 Ts = 0.000005
Er 1 1x value = {v(5)*i(Et)*Ron + (1-v(5))*(Et)*RD}
Et 1x 2 value = {(1-v(5))*(VD + v(3,4))}
Gd 4  3 value = {(Qr/Ts) + (tr/Ts)*i(Et)+(1-v(5))*(Et) }
.ends
**********************************************************

5 comments:

  1. Try putting the Et line before the Er line... if it is like MATLAB, it won't know what Et is until you define it. Since you have Et in the Er line, it might be complaining about that.

    ReplyDelete
  2. try copying the text to your 'notepad' then copying it back to the library file. It might be text errors.

    ReplyDelete
  3. I tried to copy/past your stuff in my LTSpice and got something weird on the Gd line... here is what I get when I paste it in:

    Gd 4 3 value = {(Qr/Ts) + (tr/Ts)*i(Et)+(1-v(5))*(Et) }r)}

    should be this:
    Gd 4 3 value = {(Qr/Ts) + (tr/Ts)*i(Et)+(1-v(5))*(Et) }

    maybe your LTSpice doesn't match what you want it to? Otherwise, I have pretty much the same thing and am not getting errors. Hope that helps

    ReplyDelete
  4. in the line Gd 4 3 value = {(Qr/Ts) + (tr/Ts)*i(Et)+(1-v(5))*(Et) }r)}

    shouldnt it be Gd ={(Qr/Ts) + (tr/Ts)*i(Et)+(1-v(5))*i(Et) }r)}

    ReplyDelete

Note: Only a member of this blog may post a comment.