Saturday, July 20, 2024

Kicad 8--Importing Designs From Eagle

 


The "ditch Eagle for Kicad" post is turning into one of my most viewed.  

In that post (read it here) I briefly detailed importing files from Eagle format to Kicad. 

Kicad Version 7 could ingest most Eagle data into a Kicad Project but not all of it. 

Nevertheless, importing a subset of my Eagle data into a new Kicad project was easier and less time consuming than recreating the entire project from scratch.  

Good news! With Kicad 8 all the data needed for a new Kicad project can be imported from Eagle. This is hugely beneficial for anyone ditching Eagle for Kicad.

I have a workflow I use for this process; since adopting Kicad I have imported frequently....I felt the steps deserved their own post to help me own efficiency. If this post is useful for you as well, even better! However, if you have no need to import Eagle data into Kicad your time is arguably better spent watching these guys

GETTING STARTED

For this example I am importing a simple Eagle project with 4x Thonkiconn jacks and a few wirepads.

First up: I needed a name for the new Kicad project. 

I made up a name. It could have been anything: Big Fun With Small Jacks, Bored with Inserting, etc. 

But instead I got pedantic: "mono 4x1 mixer Euro Jacks".

With the new project name in hand I made copies of the .sch and .brd files I needed to import from Eagle; I left the original Eagle files as-is.

I created a new directory in my Kicad root folder called "Mono 4x1 mixer source files from Eagle".  

Then, I pasted the copies of the Eagle .sch and .brd source files into this new directory and renamed the Eagle .sch to .brd files to filenames I want to use for the new Kicad project. 

When importing from Eagle Kicad will reuse the names of the files from Eagle but put its own extensions on them. If you want to give your imported Kicad files new names, renaming the copied source files from Eagle is an easy way to do this.

Copy the .brd and .sch files from Kicad to an newly created empty "source" directory. 

Next: I created a new project folder for Kicad.

Under my Kicad Root folder I created an empty folder with the project name--this will be the target for the import; the folder name matched the filenames of the renamed Eagle files.



LET'S IMPORT!

In Kicad 8:

file > import non-Kicad Project... > Eagle Project...

I navigated to the renamed Eagle .src file.

Kicad asked me what folder I wanted to use for the imported new project. 

I chose the empty project folder I just created:



I was asked if I wanted to auto-match layers. I had no idea how layer matching worked, so I just said "auto-match layers" and "OK".  Good enough.

Do you have time to figure out how Kicad's layer matching feature works, beyond just choosing defaults?  I don't.

From here Kicad used the Eagle .sch file to create a Kicad schematic, board, footprint, symbol, and other helper files.  

It was that easy right?

For any Kicad_pcb fabrication needs check out PCBWAY, this blog's sponsor


COOKING WITH OIL....

During the import process I got a couple of warnings/errors; hello??

For instance when preparing all of this for this post I got this error when initially navigating from the new Kicad brd file to its sch file; not sure why. 





I could confirm with Windows Explorer that the kicad sch file was there. I said OK, closed up everything by clicking X's in the top right corner (this is Windows kids--mac linux etc, same idea, different corner)

Kicad asked me if I wanted to save the PCB and SCH.  

YES! 

This made the error go away.  

With that done, I could reopen the new Kicad project and keep working.

I also have seen a similar error on occasion: the .pretty (footprints) file for the new Kicad project couldn't be found. I didn't get that error this time but have seen it many times before.

When this error appeared I clicked OK and pretended I never saw it. 

The dot pretty folder was A-OK; the error could be ignored.  

From here I had everything I needed to get working. 

So, really, this was all easy!

New sch file--just like what I had for Eagle!


New footoprint file! How easy is this?



EDITING SYMBOLS AND FOOTPRINTS 

Kicad's stock footprints and symbols are completely different than Eagle's. But we are importing footprints and symbols--called "Devices" in Eagle, into Kicad.

How will this work?

Kicad's developers solved this problem by creating a custom library of symbols and footprints for each imported Eagle project. 

This is clever, and works, but, unedited the footprints and to a lesser degree symbols imported from Eagle into Kicad often threw errors and warnings during the Inspection/DRC process when I used Kicad DRC with its default constraints.  

Therefore I usually DRC'd the imported sch and brd Kicad Kicad then edited the imported parts:
  • Creating Courtyards.  Footprints imported from Eagle didn't have them but Kicad wants 'em as a best practice. Courtyards for imported footprints have to be created by hand, so what the heck, I edited the imported footprints and added 'em. Not technically necessary, but, if I started moving things around I figured courtyards were a good thing to have.
  • Making Eagle fonts Kicad friendly.  By default Kicad wants footprint fonts to be .8mm.  Imported fonts from Eagle can be smaller. 
  • Easy fix: I chose the text causing DRC issues, hit the magic e key, and changed the font width and height to .8mm or greater.  
  • Then, I reimported the updated footprint from its library into the PCB.
  • Silkscreen madness: Eagle allows overlaps of silks and other silkscreening oddities that its DRC doesn't catch but Kicad's does. 
  • To ameliorate: I edited the footprint, getting rid of or relocating silkscreen artwork that was causing Kicad's DRC to throw errors and warnings. I saved the updated footprint to my custom Kicad footprint library then reimported the updated part into my design. 
  • Pin name Changes: this now seems obvious but I missed it at first. 
  • For my own edification: I should never expect pin assignments from Eagle to match much of anything in Kicad. 
  • Using imported footprints and symbols in a single new project worked, but as soon as I used the part in a different project things occasionally broke. 
  • Meaning: traces to cathodes went to anodes, traces to transistor emitters went to collectors, traces to a pot wiper went to something other than a wiper--all bad news.
  • Modifying symbols and devices from Eagle to work universally in Kicad required a bit of forethought and elbow grease. Diodes in Kicad needed pin 2 for anodes and pin 1 for cathodes, for example, as this seems semi-standard for Kicad. 
  • I found I needed to carefully examine imported footprints and symbols, then edit them to make them work for a given future design. No easy fix for this, I had to do this extra work or not use an imported Eagle footprint beyond its initial project.
  • (BTW: for me--everything I think might be useful for future projects goes in my github custom footprint and symbol repos--e.g., my footprint custom library can be found on Github--here)
Following these steps created an added benefit: my Eagle folder has 20+ years of useful footprints and symbols, some I imported, others I modified and/or created, with a teeth gnashingly frustrating degree of difficulty

Since the Eagle > Kicad import process brings over these custom devices I could further modify them, then save them to my Kicad libraries--steps to import footprint data into a custom Kicad library are here; github of my Kicad Symbol and Footprint libraries are here and here.

This meant: all my custom devices in Eagle could be preserved without too much difficulty. Whew! 

OUTTRO

With a bit of patience and attention to detail the Eagle > Kicad import process works--GREAT.  

Kudos to the Kicad development team, they must have spent hours and hours getting this import process to work; their time and hard work has already saved me hours and hours doing schematic capture and layout "from scratch."

And this is a guess but: I figure the documentation for Eagle's API sucked, since most Eagle documentation sucks. 

I would wager the Kicad coders implementing the Eagle > Kicad import algorithms had to wade through endless reams of crap documentation and employ a fair degree of trial and error to get the imports to work....since in my experience anything touching Eagle means figuratively embracing the collective works of Kafka.  

They figured it out!  

The best things in life really are free--the exception is vintage Roland. Kicad RULES!


No comments:

Post a Comment

JTAG to SWD Converter

Readers: If you'd like to build the project featured in today's post, please go to PCBWAY's Community pages--gerber file, KiCAD ...