Author Topic: Simulate MC34063 on LTspice  (Read 29822 times)

0 Members and 2 Guests are viewing this topic.

Offline odgonzaTopic starter

  • Newbie
  • Posts: 6
Simulate MC34063 on LTspice
« on: January 31, 2013, 01:48:22 am »
Hi.
I'm trying to simulate the MC34063A. As you can think, that model is not available in the LTspice.

I found one model from ON Semiconductors web for SPICE, and I had imported it into LTspice, but I have some problems. LTspice is a Linear Technology version of SPICE and can't use directly the simulation model I got from On Semi. The error that LTspice reports are:

              SPICE error log:
Line 31  -->  Error: unknown token in: "[~](v(9)&v(8))"
Line 36  -->  Error: unknown token in: "[~](v(4)&v(10))"
Line 48? -->  Fatal Error: Bad <cond> ? <true> : <false> syntax.

A lot of years ago I studied PSPICE, but I can't remember the sintax now. I don't remember to use the symbol "~" (ASCII 126) in a SPICE file.

Can someone give me an idea about how to solve my problem?
 

Offline tinhead

  • Super Contributor
  • ***
  • Posts: 1918
  • Country: 00
    • If you like my hacks, send me a donation
Re: Simulate MC34063 on LTspice
« Reply #1 on: January 31, 2013, 01:54:28 am »
take this one, comes from http://tech.groups.yahoo.com/group/LTspice/
and sems to work

I don't want to be human! I want to see gamma rays, I want to hear X-rays, and I want to smell dark matter ...
I want to reach out with something other than these prehensile paws and feel the solar wind of a supernova flowing over me.
 
The following users thanked this post: fullmoon6661

Offline odgonzaTopic starter

  • Newbie
  • Posts: 6
Re: Simulate MC34063 on LTspice
« Reply #2 on: January 31, 2013, 02:19:58 am »
Great! It works!

Thank you very much :-)
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4784
  • Country: pm
  • It's important to try new things..
Re: Simulate MC34063 on LTspice
« Reply #3 on: November 16, 2019, 10:27:10 am »
Be aware the ltspice "models" are "models only".
100% deviation from the reality could be easily the case.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Simulate MC34063 on LTspice
« Reply #4 on: November 16, 2019, 11:22:30 am »
The OnSemi MC34063 model you posted appears to be written for IsSpice4.  See http://www.intusoft.com/lit/IsSpice4.pdf for the user manual. 

The line:
Code: [Select]
B5 5 0 V=~(v(9)&v(8))is a IsSpice specific digital behavioural source, consisting of a NAND function - see page 176 (PDF page 186) of the user manual.

For LTspice, you could try simply replacing the ~ with ! but the thresholds wont be correct, so it may be preferable to rewrite the line replacing the B source with a LTspice A (special function) AND/NAND gate, with instance parameters:
Code: [Select]
Vhigh=3.5, Vlow=0.3, ref=1.5to match the IsSpice default behaviour.

The easiest way to get the syntax correct is to place the A AND/NAND gate (lib\sym\Digital\and.asy) on a 'scratch' schematic, label its used pins with the model's numeric net names, and set its instance parameters, then View the SPICE Netlist to get a line that should be a 'drop in' replacement in the model:
Code: [Select]
A1 0 9 0 8 0 5 0 0 AND Vhigh=3.5, Vlow=0.3, ref=1.5
For lines like:
Code: [Select]
B4 6 0 V=v(2,90)  > (v(vref,90) + v(voff,90))  ? 0 : v(vdd)the IsSpice ternary (If-Then-Else) operator condition ? true_val : false_val (see PDF page 189) can be directly translated to a LTspice if function: if(condition, true_val, false_val) giving:
Code: [Select]
B4 6 0 V=if(v(2,90) >(v(vref,90)+v(voff,90)) , 0 , v(vdd))
It may well be worth drawing up a schematic for the model in LTspice one line at a time, checking the netlist after each one to create a subcircuit of the model to aid debugging it.  If you add the circuit elements in the same sequence as the lines of the model, the component lines in the netlist will be in the same order. Unfortunately comments and .model statements will be moved to the end of the netlist irrespective of the entry order.
« Last Edit: November 16, 2019, 12:36:42 pm by Ian.M »
 

Offline Chupacabras

  • Regular Contributor
  • *
  • Posts: 64
  • Country: sk
Re: Simulate MC34063 on LTspice
« Reply #5 on: November 16, 2019, 12:33:18 pm »
Sorry, I deleted my post :(
Anyway, I probably made mistake. The switching frequency IS below 100kHz (around 25kHz). Firstly I was looking at startup curves and there is some 200kHz oscillations, after it stabilizes there is clearly 25kHz switching.

My bad. Sorry for that.
btw. is there a way to undelete post I have deleted?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf