KiCad Spice, Anyone Tried It?

I didn't realize KiCad has a spice simulator built in. Anyone used it? I could have been editing my board schematic and doing the simulation at the same time!

I don't know how compatible models are with various simulators. I contacted one vendor about a problem with their spice model and they basically blew me off saying I needed to use Orcad spice. lol

I guess when you've seen one spice simulator, you've seen one spice simulator.

--

  Rick C. 

  - Get 1,000 miles of free Supercharging 
  - Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C
Loading thread data ...

KiCad is on my list of programs to try when I get the time. The nice thing about this list is that programs usually get better before I round to using them!

So while I have nothing to add here to help you, I can encourage you - it's nice to see these threads in the midst of all these political or viral threads.

Reply to
David Brown

Not quite. It's an export to LTSpice. No, I haven't used it. I Spice little things, but by the time I get to Kicad I pretty-much know what I want, and it doesn't need Spice-ing.

I'm pretty keen on trying out the Kicad/JLCPCB combination soon though. It seems a pity that though they publish their parts list (even including current stock levels!) they don't publish a matching Kicad library for any of the parts - and the standard Kicad footprints use a different centroid/rotation standard.

CH

Reply to
Clifford Heath

I don't think this is a front end to LTspice unless I misunderstand. A web page says, "KiCad uses ngspice internally to perform SPICE based circuit s imulation."

A video shows the tool running in real time in the KiCad display.

Heck, even if it only were an LTspice front end it would have to be better than LTspice. Trying to learn how to do things in LTspice is insanely muck ed up. I needed to add multiple models to a design I'm working on and the issues involved took more of my time than the design!

One of the big issues had to do with the awkwardness of just adding the mod els in an easy to use manner. Then when I sought help there was not much w illingness to find easier ways of doing it. Eventually a found that I coul d copy the symbol from an intrinsic device to my design directory, edit the fields in that symbol ONCE and then use the component as much as I want wi thout further editing of internal values of the component. I don't need to clutter up the schematic with commands to add libraries. Seems like a win ner to me, but figuring that out was a huge PITA.

--

  Rick C. 

  + Get 1,000 miles of free Supercharging 
  + Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

most part are standard footprints so just pick the part and the right footprint afaiu the rotation is different because Kicad uses the standard for where pin 1 should be, jlcpcb uses the way the part is in the tape

I use a script to spit out BOM and placement file with corrected rotation, just need to add the lcsc part number as a field to the schematic symbol

jlcpcb has previewer to show the placement some you can check it and I believe they also do a manual check if the silkscreen shown the pin 1 location

Reply to
Lasse Langwadt Christensen

Yes, it's a fairly recent addition (with KiCAD 5 I believe). It's based on ngspice. Definitely more convenient to use than the older approach (exporting a SPICE netlist and then running it into a stand-alone ngspice or gnucap or a similar Spice version or equivalent).

I've been using it to simulate the frequency/phase responses, and impulse response of an audio power amplifier I'm working with. It has been quite helpful, although its output-and-reporting capabilities are somewhat limited. You can probe voltages and currents, but in the current release version there's no way to enter more complex expressions (e.g. voltage differences). I believe that's on the wishlist for future versions.

The current-and-display graphings works, but zooming is a bit quirky.

If I recall correctly, it can export the data it collects (all of the voltages and currents) into a .csv, so if you wish you can import this data into a spreadsheet and do additional calculations and graphings.

One thing to be aware of, is that if you have e.g. bipolar or FET transistors whose pin ordering doesn't match up with the SPICE conventins (e.g. C B E), you must add an attribute to the component description in your library to tell it which pins go to those three nodes. The same is true for diodes or any other non-symmetrical component. Otherwise, the SPICE simulation won't match your schematic and the results will be... odd. The models which are released with the current KiCAD 5 should have the necessary attribute already, but if you cons up your own from a data sheet, be aware of this need (and maybe start with one of the canned part models which have the pins in the right order).

I've been able to use a bunch of externally-sourced models (simple ones, not subcircuits) from various sites. The ngspice tool tends to report seeing parameters it doesn't recognize, but that doesn't seem to affect its ability to use the parameters in the models that it does understand.

It won't handle any vendor's proprietary/encrypted model format, of course.

Reply to
Dave Platt

The older version of KiCAD was limited to exporting. The new one has an ngspice-based interface built in.

I used that combo for the prototype boards for my current project (PCB manufacture only, not assembly), and I'm happy enough that I'll be having JLCPCB do the small production spin as well. The boards all look fine, and the one prototype I assembled is working nicely.

I think it was eight days from the day I uploaded the Gerbers, to the day a DHL truck drove up with the package... and that's for boards which I had had plated up to 2 oz copper, which adds a couple of days to the production. I waited until after the worst part of the lockdown in China was over and they were opening back up... even so, it was very good service, all things considered.

Reply to
Dave Platt

Is there any reason to generate a Spice netlist in a PCB program? They really don't have much in common. Sounds clumsy to me.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

tirsdag den 2. juni 2020 kl. 21.46.32 UTC+2 skrev John Larkin:

same as any other spice just using a different schematic editor

Reply to
Lasse Langwadt Christensen

LT Spice has a nice schematic editor and good probing hooks.

I usually do my Spicing well before I start a real product schematic, and I'd never simulate a real design, just little bits here and there.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

You misunderstand.

KiCAD has both a schematic-capture module (which exports netlists in various forms), and a PCB layout module.

A common work-flow with the current version is

  • Capture and annotate schematic.
  • SPICE simulation (either export a SPICE netlist and use an external version of SPICE, or use the built-in ngspice-based simulator).
  • Add footprint information for whatever components didn't have a suitable footprint in their symbol-library description.
  • Do an "internal export" of the netlist over into the PCB-layout module.
  • Lay out your PCB.

You don't export a netlist from the PCB part of the program (except in the sense that KiCAD can annotate the traces and pads in the Gerber export with the net identities, per Gerber X2).

Reply to
Dave Platt

Not a bit.

That's what I call "a PCB program."

Not my flow. I Spice any little bits that might need it before I draw the actual board schematic. Often nothing needs to be Spiced. Sometimes many circuits have to be played with, and only one will survive to go onto the PCB schematic.

I'd never try to Spice the entire board.

I generally give a hand-drawn PCB schematic to a drafting guy to enter for me, and do the layout. That's a different tool set from Spice.

LT Spice is awfully good.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Oh, right you are. There is an LTSpice integration also, and I'm recalling that.

Yeah, Kicad still acts like a bunch of separate tools, not well integrated. Management of 3d models alongside the footprints is another problem.

CH.

Reply to
Clifford Heath

A discussion on eevblog.com suggests:

" Kicad footprints generally are using the IPC-7x51 standard. Parts are oriented so that pin 1 is on the upper left, or on the left for two pin parts. Rotation from that base orientation is CCW e.g. a +90 degree rotation puts pin one on the lower left.

JLC seems to be using the EIA-481-D standard, or perhaps the IEC61188 standard."

I don't know any of these standards, but it might mean something to fo;k here.

CH.

Reply to
Clifford Heath

On Tuesday, June 2, 2020 at 1:56:49 PM UTC-4, Lasse Langwadt Christensen wr ote:

w

tprint

pin 1 should be, jlcpcb uses the way the part is in the tape

I'm not sure what you are saying with this. Are you talking about the cont ents of the XYRS file that the tool spits out? I would expect that to indi cate the orientation on the PCB. Are you saying the jlcpcb program indicat es how much to turn the part rather than where it should be? I'm just not following this.

, just need to add the lcsc part number as a field to the schematic symbol

lieve they also do a manual check if the silkscreen shown the pin 1 locatio n

I've never understood why pin 1 orientation is such a complex issue. But I do know it fails from time to time.

--

  Rick C. 

  -- Get 1,000 miles of free Supercharging 
  -- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

Another - more fundamental - misunderstanding.

Yet another misunderstanding. A printed circuit layout program uses a netli st as one of it's inputs. A schematic editor is the usual name for the prog ram that let's you create the net-list in a form that you can understand - a schematic.

The schematic editor needs device symbols that you can put into the schemat ic so that you can link pins in a way that gives you something you can comp rehend.

The printed circuit layout program needs device footprints so your can rout e printed circuit races between the same pins in a way that realises the ne t list.

Dumb customers want the whole package to arrive in one neatly wrapped bundl e

Nor would anybody sane.

This works a lot better when the schematics are simple.

Reworking a hand-drawn schematic after you've decided that a particular app roach isn't going to work well enough is extremely tedious.

Doing the same thing on-screen isn't painless, but you can cut and paste la rge chunks, which reduces the chance that you'll get some minor correction wrong.

But it wasn't designed to fit into a suite of design tools.

The really nice thing about a properly integrated set-up is that you can si mulate what you have designed (and catch any trivial drop-offs early) and p ass on exactly the same net-list that worked in the simulation to the print ed circuit layout program. John Larkin doesn't work with really complicated circuits, where this can be really helpful.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

models in an easy to use manner.

I was actually talking about LTspice. It's great that it is available and free, but the tools has a kludgy interface that is very unintuitive with a series of arcane steps to include models. The lack of good documentation i s also a hold back. I recently found "bugs" or more accurately, undocument ed behaviors in digital components in the LTspice A group devices. Even th e LTspice wiki does not have accurate data on this particular part and othe r areas. It's a wiki, so I could change that, right? No, the wiki has bee n locked to outside contributions. So it's not even a wiki anymore.

It's not your typical user community. But then I'm posting in s.e.d, so wh at do I know about "normal"?

I'm posting about a couple of issues in KiCad to their forums. One issue h as been recognized as a bug and reported. The other is about the visibilit y of the text with zoom levels. Not an easy thing to discuss or illustrate . Any means of capturing the screen display is distorted by the image and display the image is viewed on in addition to the software that is displayi ng it. So how do you show someone in a forum what you are seeing? Anyway, I find the program mostly not hard to use.

It's a bit of a bother that it seems to have odd ways to select the object of the action. Most programs have you select an verb action and then you p oint and click the noun, the thing you want to perform the action on. With many commands in KiCad you have to point your cursor to the object first w ithout a click, then select your verb. When you press the delete key, what ever object is being pointed to by the cursor gets deleted... NOW! That's a bit tricky to adjust to when used to selecting the delete mode first and then clicking to invoke the action. Or I guess it is common to actually se lect something and then using the delete key.

It is a mixed thing though. Some commands work on groups and you select th e group first. Oddly enough there are different keys for doing the same th ing on groups. You hover over a part and press G to drag the single item. To drag a group you click and drag the select the group, then press TAB to drag. Why two different keys???

I guess in the grand scheme these are not big issues, but switching between LTspice and KiCad messes with your instincts. They are often opposites. Even the default zoom direction is opposite in LTspice from the rest of the world. At least you can change it.

--

  Rick C. 

  -+ Get 1,000 miles of free Supercharging 
  -+ Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

I have. It's a bit clunky to use, and has a tendency to crash without explanation, taking the rest of KiCad with it, especially with subcircuits (so make sure you save your work). But it does function.

Sylvia.

Reply to
Sylvia Else

ow

.

ootprint

re pin 1 should be, jlcpcb uses the way the part is in the tape

I did my first layout around 2008 and struggled with this a bit. The progr am I used for layout was FreePCB and it had a bug in rotations on the botto m side. What does the standard say about that??? You can view the rotatio ns as viewed from the top side in the X-ray view or as viewed from the bott om side as if you flipped the board over which you do when you actually ass emble it. I think the IPC standard selects the former, the X-ray view from the top of the board. So if the same IC with pin one reference in the upp er left as viewed from the top were in a position with pin one in the lower left corner as viewed from the top of the board, it would be a +90 degree rotation for both parts in the XYRS file.

I will be checking this carefully with this board. But it is a hard thing to check unless you thoroughly understand how it is all supposed to work. I've not seen software that help with this verification yet. Maybe KiCad w ill spit out files that provide all the assembly info in a standard format that can be viewed in the equivalent of a Gerber file viewer. That's a rea son I was hoping for the ODB++ output, but it sounds like they have another standard they use.

--

  Rick C. 

  +- Get 1,000 miles of free Supercharging 
  +- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

I guess I spoke too soon about KiCad being easy to pick up... well it isn't about picking up really. It's about issues of multiple pages. They don't really support a flat, multi-page schematic. It must be hierarchical. So to have a two page schematic, you must have a top sheet and one or more lo wer sheets.

The parts can have multiple units, but schematics can't have multiple pages . That seems oddly inconsistent.

--

  Rick C. 

  ++ Get 1,000 miles of free Supercharging 
  ++ Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.