Synchronize electronic and mechanical CAD with KiCad StepUp workbench

In this tutorial we will make a STEP or IGES file of PCB designed with KiCad EDA. Then PCB will be operable with CAD software. For that we will see how to associate KiCad footprints to proper 3D file (step 1 to 5) and then use KiCad StepUp workbench to load PCB and export it to desired format (step 6 to 9). To follow it, you must have at your disposal complete electronics board project on KiCad.

  1. Step 1: Visualize your project

    In Pcbnew, you can at any time get a 3D preview of your PCB via the menu View3D Viewer (Shortcut Alt+3). 3D view of board will then be displayed in the 3D Viewer interface.

    Note however in the overview below that two screw terminals J1 and J2 are missing, as well as the potentiometer RV1.

    NB: If the 3D model you are viewing suits you, you can go directly to step 6.

    In order complete our 3D model, it’s necessary to understand how 3D files are managed with KiCad.



  2. Step 2: File management

    At KiCad installation, number of 3D models (STEP and WRL) were downloaded to your computer at the location " C:\Program Files \ KiCad \ share \ kicad \ modules \ packages3d ". Below is an overview of packages3d folder with native 3D models in STEP and WRL format.

    These files are directly associated with component fingerprints, so we can get a fairly accurate preview of our board. Especially if it contains only usual components. If preview is incomplete, it means that no fingerprint was associated to some components.

  3. Step 3: Create and configure a 3D model library

    If it’s not already done, you have to create a library folder that will contain your electronics 3D files. If you try to put 3D files on native library (packages3d) they will be delete in case of update. You need a specific path for your work.

    Below you can see my KiCadLib library folder, specific to KiCad. 3D folder contains both my personal models and those I found on the internet.

    To simplify research of 3D model in KiCad, you must add a path to 3D folder. Go first to the fingerprint editor (from Pcbnew) then to Preference → Configure paths, as below.

    In last frame at GUI bottom, do: add a path (by clicking on "+" icon) then fill in name and path cells. In my case, illustrated below, name of my folder is MesModeles3D and path is "D:\02_QUENTIN\05_Projets_Tech\Bibliotheques\KiCadLib\3D".

    Procedure summary:

    → Create a KiCad library folder then create a subfolder to store your electronics 3D files;

    → From Pcbnew go to Fingerprint Editor then to Preference → Configure paths;

    → Add a path on KiCad (with " + " icon) then fill in all fields: Alias and Path;

    → Click on OK.

    From now, KiCad will propose this path in 3D Parameters that we will see later, after we put a 3D model in our library…

  4. Step 4: Add 3D model to your library

    To obtain these 3D files you can either download it from internet or make model yourself. First option is obviously the fastest. So, you will first search on websites like GrabCAD, TracePart, Sketchfab, etc. There is also SnapEDA which is specialised on electronic design, with component libraries mixing footprints and 3D files. You can also search directly on your browser. Image below shows SnapEDA on the left and GrabCAD on the right.

    After downloading STEP or WRL files, copy them to 3D folder created in step 2. To make sure that 3D files you uploaded are in agreement with footprints you can use the Measure Distance tool in the component editor.

    All that's left to do is associate 3D files to fingerprints...

  5. Step 5: Associate 3D model to component fingerprint

    To associate a 3D model to a footprint you have to go to its properties via the Footprint Editor: in Pcbnew click on Footprint Editor and search for your footprint in list on the left of GUI. Then, in Footprint Properties, go to 3D Parameter tab (3rd tab) which displays in interface below.

    In our case we can see that no preview is available and no path to a model library is indicated. We will have to indicate path where 3D files are stored by clicking on file icon at bottom of the terminal. You have to click on file icon to get window below. Select your path in the drop-down list Path then choose model.

    After clicking OK you will see that component has appeared but not positioned correctly. To position it correctly you must use the X Y Z rotations and movements.

    In my case, shown below, I had to rotate -90° along X and move 5 mm along X to correctly position my component. Then we record what we've done and that's it.

    For a native KiCad component, as the TC33X knob, modification is not possible because KiCad protects its native files. If you try to save changes an error message is displayed as below.

    To work around this problem, simply copy and paste to a library you have created. You can then be able to modify file. You will have to update your PCB (and possibly your schematic) by changing component path. In Eeschema, go to the Component Editor. In Pcbnew, select component then tap E and change path as below.

    Procedure summary:

    For a footprint already present in KiCad: copy-paste footprint in your personal library;

    → In Pcbnew, go to Footprint Editor;

    → Select path to be modified then go to Path Property → 3D Parameters;

    → Click on file icon;

    → Select path of your 3D library in drop-down list;

    If you go back to 3D Viewer model is complete after updating the footprint. To update do: shift or change.

    This is where we get to heart of the matter…

  6. Step 6: Installing FreeCAD 0.19 (development version)

    If you have not already done, you will need to install FreeCAD version 0.19 and KiCad StepUp workbench. FreeCAD 0.19 is a development version at today date. To get it I advise you to follow a video on YouTube which will explain all steps below with visual preview. I'll just summarize installation for a Windows OS :

    → Go to https://www.freecadweb.org/ ;

    → Click on Download and scroll-down to page bottom;

    → Click on FreeCAD releases page to access file repository;

    → Download folder which contain latest version for your OS, here FreeCAD_0.19.23141-Win-Conda_vc14.x-x86_64.7z ;

    → Download 7zip installation file at https://www.7-zip.org/download.html;

    → Launch 7zip installation executable;

    → Right click on previously downloaded compressed folder and select 7zip;

    → In the drop-down menu make Extract Files;

    → Extract file in Documents;

    → In Documents go to folder FreeCAD_0.19.23141-Win-Conda_vc14.x-x86_64;

    → Go to bin subfolder;

    → Search for FreeCAD executable file, named freecad.exe;

    → Send it to desktop to create a shortcut;

    → Click on desktop shortcut you created;

    → You now have access to FreeCAD 0.19.

  7. Step 7: Installing KiCad StepUp workbench

    Just open Addon Manager and select KiCad StepUp in the menu.

    You need to be connected to internet for allow Addon Manager to install StepUp workbench correctly. After clicking Install button, transfer takes some time depending on the quality of your connection.

    At the end of installation, GUI displays screen below which indicates to restart FreeCAD to apply changes. Restart FreeCAD to complete installation.


  8. Step 8: Load KiCad PCB on FreeCAD

    A presentation of the KiCad StepUp workbench is available in FreeCAD wiki where you will find a description of all functions.

    Here is procedure to load your PCB:

    → When opening the workbench, ignore all error messages and click on "OK”;

    → Then go to Edit → Preferences → kicadStepUpGui to define paths to 3D files, in my case (shown below) packages3d and 3D folders;

    → Click on Apply;

    → Click on Load KiCad Board or Parts function and select the project to be imported in "kicad_pcb" format.

    → Do OK to error messages. PCB appears in your interface as below.

    You can now save your PCB in the format you want.


  9. Step 9: Export PCB to STEP or IGES format

    To export electronic board to CAD format, simply select the whole with Ctrl+A then press Export as below.

    Afterwards, if you are interested in another file format, you can use the CAD Assistant software.

Comments