Code Monkey home page Code Monkey logo

eagle-to-kicad's Introduction

Converting from Eagle to KiCad.

  • Quick Introduction Video (DEAD LINK, MOVING to NEW SERVER)
    Recommended video player Firefox 87.0+ with VLC video player plugin

  • The following 5 ulp (eagle user script file) and one ulp include file, work together or stand alone to convert Eagle sch/pcb version 6.xx*(7.xx-8.xx maybe?)* file(s) and any version of Eagle lib(lbr) to KiCad sch/pcb and lib/mod files.

  • The Programs will do

    • Eagle multi sheet schematic to KiCad multi sheets.
    • Global and local net labels for multi sheets. (This is a real nasty bit of hacking!)
    • Multi part gates.
    • Build KiCad PCB modules and sch libs from Eagle sch.
    • Make project director to store all the converted files.
    • And basic error checking.
    • Eagle 6.xx(7.xx-8.xx?) PCB files can be directly import to KiCad.
    • Eagle LBRs (any version of Eagle libs or size ) can be converted to KiCad lib/mod using eagle-lbr2kicad-1.0.ulp see Eagle Lib conversion for more details.
    • Converts VIA to Pads, which helps with KiCad's flood fill, when VIAs have no connections.
    • Documents fills over SMD pads on Eagle Layer 155,156
    • Documents on layer's 150,152,153,154 of (Eagle) the unconnected VIAs and tracks.
    • The examples directory contains a number of converted schematics/boards.
  • By using the following ulps a consistent link from the schematic to PCB is maintained so forward and backward net-list annotations work under KiCad!

  • WARNINGS, AND NASTY SURPRISES, PLEASE READ!!!

  • Only works correctly for version 4.7, or 5.1.(X?) of KiCad, it may not on other version.

  • In KiCad Eagle PCB import of vias and tracks don't retain their NET information if they are not connected to a pad with a track, whereas they do in Eagle, (KiCad assigns a null net-name on Eagle PCB import in KiCad's Pcbnew).*
    The result will be KiCad flood fill will not connect to them!!! There is an option to convert and document on layers 150,152,153,154 of (Eagle) the unconnected VIAs and tracks which will make finding and fixing the problem much easier.

  • Schematics wire's/nets can terminate in a bus or onto another wire/net/pad and not be connected in Eagle!! Whereas in KiCad schematic wires to wires and wires to pads which terminates at the same location will be connected!!

  • Eagle oval pad shapes are not supported in KiCad, you will only end up with a round pad!!

  • Eagle PCB design rules are not imported by KiCads Pcbnew.

Installing.

  • Download the zip file, and unzip using your favorite zip program to your target directory OR if your prefer git:

      	git clone https://github.com/lachlanA/eagle-to-kicad.git  
    
  • WARNING: The ULPs file-name will conflict with Eagles ULPs file-names so
    DO NOT install them in Eagle's ULP directory

  • There are 5 ULPs and one ULP include file have been hack together.
    run-me-first-from-eagle-sch.ulp ..... stage 1: Start here, script missing number(s) to parts prefixes.
    fix_via_hack.ulp .............................. stage 2: Converts unconnected VIAs to pads.
    eagle6xx-sch-to-kicad-sch.ulp .... stage 3: Build sch and project files, etc
    exp-lbrs.ulp ....................................... stage 4: Extract libs from eagle schematic/PCB
    eagle-lbr2kicad-1.0.ulp.................... stage 5: Converts Eagle lbr to KiCad lib/mod
    eagle_to_kicad_include.inc .......... Include file used by the other 4 ULP\s

HOW TO RUN THE ULPs

WARNING Always backup your Eagle sch/PCB files before running this program!

  1. Start your Eagle program (Make sure your using version 6.xx of Eagle)

  2. Open the eagle sch/PCB file you wish to convert. Make sure the eagle sch and PCB files are both, Correct and pass all ERC/DRC checks in Eagle.

  3. Next Open the top left hand File menu and select Run ULP

  4. A file requester window will open. Use this to find the location of the run-me-first-from-eagle-sch.ulp ULP you download from this website. We use this script to make sure all part prefixes are ending in a number IE: R0, X1 etc. as KiCad will ask to renumber any prefix which does not end in a number. (It may do this any way, but don't worry it won't change any prefixes which have already been numbered unless you tell it too!) Keeping prefixes consistent from schematic to PCB will allow net-list forward and back annotation to work in KiCad. Select OK (this will run the script). When this completes all references without a number should have a number appended to them. Note: This number will start from the largest reference number on the sch/PCB.

  5. Next stage will run automatically, fix_via_hack.ulp This will check for free unconnected VIAs and convert them to pads, this is very much a hack, as it changes the Eagle sch/PCB files. The changed files are saved in targetdir/modified_eagle_files/ There are 2 option's Document the VIAs/pads buy putting a > and net lable name on the VIA/pad on layer 51 for Eagle, and Dwgs.User for KiCad. Second option is to Not to convert the VIAs to pads.
    The ulp hack adds pad's to the sch file, at X,Y 0,0 this may conflict with any net/part at this location, so please move the sch/PCB contents so there are no parts/nets at this location before running the script. You may getting warnings from Eagle about connecting net??? to a power plan net, just click OK, as this is normal for this script.

  6. Next stage will run automatically. Set the option/location of the download ULP. And also Make sure you make/select a clean target directory where all the KiCad files will be put. Select OK, And with luck you should have sch part done. The previous ULP will link automatically to exp-lbrs.ulp for the next step: If you have selected extract the KiCad lib's from Eagle sch/PCB (The default). This ULP will build Eagle lbr file, Note: this can be a very slow process, and will leave the Eagle PCB editor window open when complete. Just ignore this for the moment. If this complete OK, the previous ULP will link to eagle-lbr2kicad-1.0.ulp which will convert the Eagle lbr file to a KiCad lib/mod files. The eagle-lbr2kicad-1.0.ulp window will open with quite a few options. Just select OK for the moment. And if Murphy's Law is sound asleep we should have the target directory with all the converted files, including KiCad project files. But with one exception, it will be missing KiCad PCB file.

  7. For this, we need to Open KiCad's pcbnew program directly, at the command prompt ("c:\Program Files\KiCad\bin\pcbnew.exe"). If you make the mistake of not opening pcbnew directly, and instead chose to run it from KiCad's pcbnew menu. You will have no option for importing the Eagle 6 PCB file! In Pcbnew click on File->Import Non-KiCad Board File..., a window will pop-up. Select the PCB eagle file linked to the eagle sch file we used at the beginning. On the lower right side you will have a drop down menu box option, select Eagle ver. 6.x XML PCB files (*.b, and press OK. After importing the Eagle PCB file, (without errors I hope). Do a SAVE AS to PROJECTNAME.kicad_pcb to the new target directory (where you saved the output from to preceding ULP's to). PROJECTNAME being the name you give to your project early on. As a helper a dummy kicad_pcb file with the correct name has been created in the target directory which you can use to do a Save-As to.

  8. Next step is to check the KiCad sch and KiCad PCB are consistent for parts and nets. Start KiCad, and open the project in the newly created target directory. Open the sch file. And if it was converted from the single sch file, you should have the sch file in the display. Or multi sheet sch file you will have a number of small boxes spread across the page. Each one of those boxes being a converted Eagle sub-sheet. Click on the first one and check for errors. All being good, click on Generate Net-list, and click OK. It may ask to Annotate the schematic. If so do the Annotation step. And then come back and click on Generate net-list. And Generate it.

  9. Next click on CvPcb, this assigns the PCB footprints with the sch parts. Most likely you will get the following warning: Some of the assigned footprints are legacy entries (are missing lib nicknames). Would you like CvPcb to attempt to convert them to the new required FPID format? (If you answer no, then these assignments will be cleared out and you will have to re-assign these footprints yourself.) Just click the yes button. And a window will open up listing all the parts and footprints which it has assigned. Under FILE menu click Save. And then File Close.

  10. Next Clink on PcbNew button on the top menu, and the PCB should open up. Now click on the NetList and a window should open up, from there click on Read Current Net-list. All going well you should not have any extra parts added, and only a few warning's about changing net list names. And you should be done. Please check over the converted sch/PCB as there are many things which can go wrong! While I have tried to catch as many conversion problem, I expect there many still waiting to be found. So check and triple check the results!!!

NOTES: For more info on KiCad https://www.kicad.org/display/KICAD/Installing+KiCad
As KiCad is the process of major upgrade, and enhancement. Please be nice when asking questions of the Development team. I think you will love the new Push and shove router. This feature alone makes it worth while moving from Eagle to KiCad. I hope these ULPs make the job a lot easier.

eagle-to-kicad's People

Contributors

caerbannog avatar faeranne avatar lachlana avatar maximeborges avatar nseidle avatar petelawler avatar robkam avatar steffenmauch avatar t0jan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eagle-to-kicad's Issues

Rectangles are not rotated

I had an issue with a rectangle in tDocu layer (51) that I used to represent an LQFP pin: the original rectangle was 1 mm x 0.22mm and laid out 2x16 of them to make the left and right LQFP sides, but I rotated them 270° to make the top and bottom sides.

Unfortunately, the rotated rectangles are not rotated by the conversion.

renumber ulp; Unknown identifier 'EAGLE_HOME'

Even with a fresh install of 6.3.0 i'm getting the following error;

Unkown identifier 'EAGLE_HOME'

pointing to the following lines in the ULP;

string outputPath = EAGLE_HOME + '/';
string myULP_HOME = EAGLE_HOME + '/';

when trying to run renumber-sheet.ulp. I've tested against the RGBled example with the same result. and tried adding EAGLE_HOME to the environmental variables. Any ideas?

machine; win7 64bit

Converting large library from eagle to kicad

I am getting the following error:
eagle-to-kicad/eagle-lbr2kicad-1.0.ulp(2116)

Reference to uninitialized object variable.

I am using Eagle CAD 7.4, I know it is officially not supported but maybe it is an easy fix.

The library is pretty big but I am not at liberty to share it publicly. Alas my eagle script skills are not sufficient to tackle this problem by myself, can I send you the library?

Well I am currently converting all my libraries, and this open source library shows the same problem.
SquantorIC.lbr.zip

KiCad PCB import bugs

There are a number of bug's on KiCad PCB import, which I hope to some patch's accepted.
will give status report in a few weeks.. As RC2 is not far away. Of Kicad

Absolute path names in converted Kicad files

I attempted to run the ULP scripts on a Mac and created all the Kicad files. I moved the Kicad files over to a Linux box to continue there with Kicad. Naturally, moving all the Kicad files changed their absolute path filenames on the Linux machine compared to where they were originally saved on the Mac.

The first indication of the problem was when running CvPCB. I immediately got an error about not being able to locate the .mod file.

Looking through the Kicad files, it is not clear where this absolute path has been stored. I assume that files created by the ULP scripts ought to use relative path filenames to avoid this problem when relocating the files. I think this will be especially common problem since Eagle is more likely to be run on Windows and Kicad more likely on Linux.

Via stitching

Hi Lachlan,

Most of my boards are using via stitching for GND planes. This causes a lot of ugly GND VPDEV0 devices to be added to the schematics.

It looks like it is possible to have via stitching in the layout only, please check this video and forum post:
https://contextualelectronics.com/learning/via-stitching-in-kicad/
https://forum.kicad.info/t/protip-nicer-via-stitching/1103/21

Would it be possible to apply this method during the conversion instead of creating these ugly parts?

Power plan, and fill order draw order problems

KiCad fill's work very in odd ways compared to eagle, so you will need to adjust copper zone priority levels to fill spacing and track size to get it to work correctly.
Other wise zone's will be joined, even thou there are diffident net's !!!
go figure..

wrong comment in ulp

In the Eagle-ulp eagle6xx-sch-to-kicad-sch.ulp, line 2116 there is printf("#P.device.name:....
instead of printf("$P.device.name:... or just comment it out by //
That causes Kicad to not open the generated schematic.
Klaus-Michael

assert "IsValid() && dt.IsValid()" failed in operator!=(): invalid wxDateTime

I'm trying to convert an Eagle file (Ray's Hobby Opensprinkler Beagle v1.1) from Eagle to KiCAD.

During the conversion, at the "Assign Component Footprint" stage, I receive multiple versions of this same error. I'm unsure whether it is the script or something else, however I feel the script should maybe handle the issue. I would certainly feel more confident about the output if these errors didn't happen.

Using Eagle 7.7.0 and KiCAD 4.0.5+dsfg1-4 wx Widgets 3.0.2 Unicode Boost 1.62.0 on Debian Stretch amd64 x86_64 64 bit

ASSERT INFO:
/usr/include/wx-3.0/wx/datetime.h(876): assert "IsValid() && dt.IsValid()" failed in operator!=(): invalid wxDateTime

BACKTRACE:
[1] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[8] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[9] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[10] wxEvtHandler::TryHereOnly(wxEvent&)
[11] wxEvtHandler::DoTryChain(wxEvent&)
[12] wxEvtHandler::ProcessEvent(wxEvent&)
[13] wxWindowBase::TryAfter(wxEvent&)
[14] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[15] wxMenuBase::SendEvent(int, int)
[16] g_closure_invoke
[17] g_signal_emit_valist
[18] g_signal_emit
[19] gtk_widget_activate
[20] gtk_menu_shell_activate_item
[21] g_closure_invoke
[22] g_signal_emit_valist
[23] g_signal_emit
[24] gtk_propagate_event
[25] gtk_main_do_event
[26] g_main_context_dispatch
[27] g_main_loop_run
[28] gtk_main
[29] wxGUIEventLoop::DoRun()
[30] wxEventLoopBase::Run()
[31] wxAppConsoleBase::MainLoop()
[32] wxEntry(int&, wchar_t**)
[33] __libc_start_main
[34] _start

PCBNew bug on Mac OSX

With my pcbnew 4.0.0-rc2-1 on Mac OSX :
I have this error message :
Error loading board.
IO_ERROR: Unknown file type
from /Users/jenkins/remoteroot/workspace/KiCadBuildMac4/kicad/pcbnew/legacy_plugin.cpp : checkVersion() : line 570

Unknown part in schematics

Hi Lachlan,

Thank you for your great work!

I am in the process of moving away from EagleCAD due to the new subscription-only business model, and I use your latest scripts to convert my existing projects from EagleCAD 7.5 ti Kicad 4.0.5 on Linux.

I face 2 issues (do I have to open separate tickets in Github?):

  1. all my passive resistors and capacitors are replaced in the schematics by squares with question marks for pins
  2. all my power supplies except GND are doing the same

I kind of figured out what is going on for issue 1), my EagleCad parts are using variants (e.g. CAP_0402 or RES_0402), and this is the name that is assigned to them by the conversion tools, whereas the converted part library name does not have the variant as suffix (e.g. CAP_ and RES_). By removing the extra variant in the schematic part name, I get the right part displayed correctly. So, it looks like to me the variants are not handled correctly by the conversion tools, are they?

As for issue 2), I don't know how to fix them, since the missing power supplies are not in the converted library. I thought it was because they were prefixed with a "+" sign (like +3.3V), but this is not the case, as I am also missing a "PE" power supply. Do you have a hint how I could correct this?

Best regards,
Michel

Unknown identifier 'EAGLE_HOME'

When trying to run the renumber-sheet.ulp I only get the following error:

/Users/silverdr/sources/eagle-to-kicad/renumber-sheet.ulp(97):

Unknown identifier 'EAGLE_HOME'

I guess I may need to set it somewhere but it would be nice to take a case where this is not set also into account.

  • EAGLE is 6.1.0 run on OSX 10.11.6.

screen shot 2017-02-18 at 01 42 53

Error loading board.

I tried going through your example video and encounter the following problems.

At 10:08 when I open the kicad project I note that the following files are not listed as part of the project:
RGB LED 1.4.lib
RGB LED 1.4.net
RGB LED 1.4-cache.lib

At 11:52 when I run CvPcb to associate the components and footprints I get the following error message:
"No PCB footprint libraries are listed in the current project file."

At 12:26 when I open pcbnew I get the following error message:
"Error loading board.
PARSE_ERROR: Expecting 'number' in input/source "/home/user/RGB LED 1.4.kicad_pcb", line 67, offset 23
from /build/buildd/kicad-0.20131208+bzr4024/common/dsnlexer.cpp : Expecting() : line 285"

error message

image

1 - don't know what the error message is trying to tell me.
2 - note 1: "chance" should be "changed".

eagle6xx-sch-to-kicad-sch.ulp asks wether to apply net list label fix, but ignores choice

Line 3228:
dlgCheckBox("", enableNetListLableFix ); dlgLabel("<nobr><b>Enable Netlist Label Fix</b></nobr>"); dlgSpacing(20); dlgStretch(0);

is the only real occurance of the variable enableNetListLableFix.

It is declared in Line 377: int enableNetListLableFix = 1; but that's all.

No evaluation of its value. Just mentioning.

I stumbled across this, as I like to fix the labes by myself.

@lachlanA : Also mentioning that I really enjoy using the scripts. Great collection - works just fine (with the mentioned downsides of asthetic resulting of this hacks).

Documentation of these scripts is really difficult to follow

Would you be willing to accept a PR that cleans up some of the language in this repo's README.md?

Specifically, Step 7 is as tedious as understanding a train wreck. The correct operation is closer to something like:

  1. Open PcbNew without opening KiCad
  2. File > Open
  3. In the file type filter drop down, select Eagle ver. 6x XML PCB files (*.brd)
  4. Select original, Eagle .brd file used for the rest of the ULP conversion process
  5. Open the file

If no errors occur:

  1. File > Save As...
  2. Navigate to the kicad/ directory the ULP scripts put it's output files (Note: If you changed the ULP output directory, look in there instead)
  3. Select the .kicad_pcb file that's already there
  4. Click Save

Continue to Step 8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.