You are not Logged In!

Public:KiCad

From Illini Solar Car Wiki
Revision as of 22:02, 3 September 2020 by Jonathan (talk | contribs)
Jump to navigation Jump to search

See PCB Design for design basics & guidelines. See GitHub for setting up the files you're going to work with.


Tool-Icon.svg This Page is a Work In Progress
Removing tabs, out of date info, and reorganizing - Jonathan


KiCad is the e-cad (electrical computer aided design) program we use exclusively since 2018. It is an open-source project and is constantly improving and growing in capabilities. It has many advantages for a distributed long-term student project including that it is free/open-source, has human readable files, and is scriptable with python. On this page you will find info on getting your KiCad Install Setup for use on Illini Solar Car.

If you have any trouble with this set-up you can get help on Slack Icon.pngelec-cad. Please update these instructions if you find ways they can be better!


InfoIcon.png We use KiCad v5
We are currently using KiCad v5. Major versions of KiCad are not cross-compatible. Make sure you use a KiCad v5 production release. Nightly Releases are also not compatible with production releases.
Warning Icon.png Images may Differ
Minor versions of KiCad v5 have had many cosmetic updates, the images below may look a bit different than what you see.
Error Icon.png New Designs
If you have already started designing a board without using the template, please update it to use the template. The easiest way to do this is by copying your project folder to somewhere on your computer besides the repository, following the directions for creating a new project on GitHub starting at step 2, and copying your design into the new project. You can't copy & paste from one project to another, so you'll need to add your previous main sheet as a hierarchical sheet in your new schematic, then copy & paste the schematic. Please do this at a meeting so a senior member can help you with it.

First Time Setup

Install and Run

  1. Download the latest 5.x version of KiCad for your operating system
    • Some OS's have special instuctions - follow them.
      • Note that KiCad has historically had stability issues on OSX / MacOS. If you have access to Windows or Linux those are recommended.
    • KiCad is available on many Linux package managers - make sure you do not get the nightly version.
    • Otherwise KiCad installs like any other program
  2. As you go through the install wizard you can use the default options
    • You can optionally deselect the Help article languages you don't want, as well as deselect the Demonstration projects, since we have completed projects for you to look at already
  3. Enjoy, and check this wiki as well as the KiCad help resources before asking about issues on Slack Icon.pngelec-cad

Library Setup

Note: This applies to KiCad v5 projects on GitHub since Github Logo.png PCB#62.This should cover most projects, and all new projects. But if you need to view older projects please update them following the instructions at Upgrading a project from KiCad 4 to KiCad 5

Our libraries, as well as KiCad's own schematic symbol libraries, have now been moved to a submodule of the main repo. Make sure you've followed the GitHub directions in order to get those libraries on your machine. They are in the Libraries folder of the PCB repository. If you first open a schematic in KiCad, without setting this up, you'll probably see a lot of question marks (?) all around the schematic. To fix this follow the below instructions.

To setup the Libraries in General we need to let KiCad know where they are! To prevent our set-up from Interfering with your outside usage of KiCad we use ISC specific Environment Variables.

  1. Open KiCad. Start these Instructions from the home screen
  2. Click on Preferences --> Configure Paths...
  3. Add a new path (press "Add") with the name ISC_SYMBOL_DIR and insert the path to the Libraries in your repo: PathOnYourComputer\PCB\Libraries
Your Environment Variable should look like this

This should be all you need! Our libraries are now managed using project specific libraries specified by the library tables in the project (provided with the template project)

Starting a Project

  1. Create a checkout a branch for your project in the PCB Repo (See GitHub/PCB for specific guidelines) git checkout -b <branch>
    • If you need to make new symbols or footprints you also need to create a branch in the Libraries repo. If you are unsure, you can always do this later when the need arises. (See GitHub/Libraries for more info)
  2. Copy the latest template from the Dev Folder to the location where your project will live
  3. Rename your project following the naming conventions - you will need to rename the folder and every named file manually.
    • Do not rename the .kicad_wks file or others files not named for the template - otherwise your settings and/or libraries may not be set-up right
  4. Make an initial commit to the PCB Repo to create your branch on Github. (Use git push --set-upstream origin <branch> for the first push)
    • Remember that when working with Submodules you need to commit to the submoduled repo (Libraries in this case) first. See Github to learn more about submodules

Now you are good to go working on your project! Make sure to follow the Schematic Conventions and Layout Standards.

Viewing Old Projects

Some projects you may want to view, such as previous board version, may be made with an older software. To view them you'll need to do a bit of work using the instructions linked below:

  • For KiCad v4 Projects - follow the instructions at Upgrading a project from KiCad 4 to KiCad 5
  • For KiCad v5 Projects not using the ISC_SYMBOL_DIR Environment Variable (Note: these should have all been fixed with a script, so hopefully you don't find any)
    • Replace the sym-lib-table and fp-lib-table with the ones from the current template. Then open the files to double check it all looks right
    • Please open a PR with the fix on Github
  • For Diptrace files you will need to install Diptrace to view. See Electrical Software Instructions for info on activation and install.
  • For KiCad Projects without library tables (we originally used Global Libraries)
    • You should be able to just copy the tables from the template - but if you have issues you can follow the old library set-up (used before Github Logo.png PCB#62)
Old Library Set-up

General

  1. Click on Preferences --> Configure Paths...
  2. Change KICAD_SYMBOL_DIR (click on it and then "Edit") to the path of the Libraries folder
    • The Libraries folder should be <ISC folder>\PCB\Libraries

Schematic Symbols Assumes you have eeschema open

  1. If in Project window, otherwise go to next step. Click on Tools --> Edit Schematic Symbols...
    • If this is the first time you've run eeschema (or possibly after an update), it will ask you to "Configure Global Symbol Library Table". Stick with the default and click Ok
    • If you get a whole bunch of errors, then hold the ESC key until they're done. At least you know you're in the right place to fix those!
  2. Skip #1 to go here if you have a schematic open. Click on Preferences --> Manage Symbol Libraries...
    • Make sure you are on the Global Libraries tab of the popup box
  3. Select all (ctrl+A or cmd+A) the libraries that are there by default and remove them
  4. Then click on Browse Libraries... --> navigate to the folder called schematic in the Libraries folder in our repo --> select all --> Click ''Open''
    • These are the custom ones we've made for solar car parts.
    • Make sure you add these first; we override some of the default library symbols
  5. AGAIN click Browse Libraries... --> navigate to the folder called schematic_kicad in the Libraries folder --> select all --> Click Open

Layout Footprints Assumes you have Pcbnew open

  1. Click on Preferences --> Manage Footprint Libraries...
    • Make sure you are on the Global Libraries tab of the popup box
  2. Click Browse Libraries...
  3. Navigate to the Libraries folder inside the PCB repo
  4. Inside the Libraries folder is a folder called layout.pretty
    • KiCad uses the .pretty extension on folder names to delineate footprint libraries
  5. Select the layout.pretty folder and click OK
  6. In the list of libraries (probably at the bottom) you should now see one called "layout"
  7. Click OK again to exit the library manager


Bill of Materials

Export for Manufacturing

To manufacture your files you simply need to export the needed files. That is, the Gerber Files for each relevant layer and the drill file for the board outline and holes (such as mounting). You will do this using KiCad Plot functionality.

  1. You can follow this tutorial to export the files for your board.
    • Make sure the drill file is exported in millimeters, not mils or inches. Otherwise the Bay Area Circuits DFM will round and possible fail your board due to rounding.
  2. Compress all of the files into a .zip file. This .zip is what will be sent to the manufacturer and what goes on Git. Do not upload the individual files. This .zip should be inside your project folder
  3. Once you have this .zip you can run the DFM report to make sure that passes
  4. When the Board Run is ready the DFM report and zip file will be sent in.
  5. For assembly you will also need the Bill of Materials (above) in Partsbox

Useful Links

Shawn Hymel's Tutorials - videos for every step of PCB design and manufacture

KiCad's own website - videos, example PCBs, textual tutorials

"Make Your First Board" - great tutorial for visual learners


Old Content to be moved/updated/reinitigrated

Warning Icon.png Note
As of KiCad v5.0 (what you should have installed) there is a BOM button. These instructions are very much a work in progress. If you have solutions and ideas, please add/link them here.
Warning Icon.png Note 2
Usage of BOM tools with our new inventory tools (partsbox) is in progress.

Set Up Your Schematic Properly

See Schematic Conventions or more specifically Schematic Conventions: Part_Information: required part information on that page for details.

Built-In Plugins

KiCad now includes its own plugins in program location\KiCad\bin\scripting\plugins. This section is not a how-to, but a list of considerations for standardizing schematic component fields and editing the included BOM generator(s). When we have an end-to-end solution completed, please write directions. Mostly this is discussing how to edit files to get the BOMs we want. The included files in KiCad have a lot of good comments to read through, and that's where most of this information comes from.

Netlist reader

file kicad_netlist_reader.py

This file is included in the BOM generator scripts. One of the helpful things here is you can have it automatically exclude things from all BOMs. We should edit this to exclude things that say DNP.

Someone else with better python skills will probably enjoy figuring out all the cool things we can edit in this script to make things easier.

BOM to CSV

You can edit the .py files if you want. Seems like a pain. I'd just use the Interactive HTML BOM below.

OpenSource Plugins

Interactive HTML BOM

Click on any of the links below for infos. In summary this is a plugin for KiCad which will allow you to view which parts are where on the PCB you're assembling, completely separate from KiCad. Extra nifty points if you set up a small tablet next to you while soldering and use the files this plugin generates. It is also a good way to view BOM information in general, although be aware that the check mark status (for the Sourced and Placed columns) are saved in browser cache and not in the actual file. Therefore you will just have to use that for your own reference. You can alternately export (copy icon, paste into Excel or similar) the state of the BOM table and that does include the check marks.

Recommendations

Windows 10 Install

Simply download the repo as a zip file, extract it, make sure the top level folder doesn't just have one folder inside it (an intermediate folder). Move this folder as instructed in the creator's installation instructions, don't try messing with links/shortcuts unless you really want to. It's simple enough to download a more recent version and replace the old folder when the plugin is updated. Then open/restart KiCad and check for a neon green button called "iBOM" on the toolbar in Pcbnew. You shouldn't have to do anything else to install it. Nifty! Then you can explore the functions of the plugin.

Using it Since we Schematic Conventions: Part Information to KiCad components during the schematic process, they will not show up if you simply click "iBOM" and then (export? generate?). To tell iBOM about the custom fields, you should generate a netlist as instructed in the instructions.

Links

Giant Thread of Updates

The Source

Creator's Installation Instructions

Comments

The installation instructions for Windows do indeed work. Note that the "scripting console" is accessed by opening Pcbnew and going to Tools -> Scripting Console. Below are some minor clarifications which may make the setup instructions easier to read.

Windows 10 Installation

  1. Download the ZIP folder
  2. Extract all
  3. Locate/create the folder as instructed on the page
  4. Move the actual root folder of the repo to the folder you just found/created (make sure there isn't an extra level that's just a folder)
  5. Restart KiCad if you had it open
  6. Open Pcbnew
  7. There should now be a button on the toolbar next to the Scripting Console logo. It says "iBOM"

OS X installation

(coming soon)

Linux Installation

(coming soon)

From Missouri S&T

Procedure:

  • For each component, perform the following in Eeschema

Kicad eeschema.png

    • Clone/Download it onto your computer
    • Save it somewhere you’ll remember
  • Follow instructions on page under Usage (repeated below)
    • Open Eeschema for your board
    • Click Tools > Generate Bill of Materials
    • Click Add Plugin
    • Browse to folder you saved, select kicad_bom_generator.py
    • Click Open
    • Type meaningful name
  • To generate your BOM, just select the name that you typed in where it is listed under "Plugins" and then click "Generate"
    • By default, this will save an excel sheet in the same folder as your project

Instructions for Parser to be expanded upon later

Credit to Peter Leung for the content pre- 10-07-18