You are not Logged In!

Difference between revisions of "Public:KiCad"

From Illini Solar Car Wiki
Jump to navigation Jump to search
imported>Amalia
imported>Jonathan
Line 1: Line 1:
  
__TOC__
+
__NOTOC__
  
 
''See ((PCB Design)) for design basics & guidelines. See ((GitHub)) for setting up the files you're going to work with.''
 
''See ((PCB Design)) for design basics & guidelines. See ((GitHub)) for setting up the files you're going to work with.''
Line 80: Line 80:
 
((Upgrading a project from KiCad 4 to KiCad 5))
 
((Upgrading a project from KiCad 4 to KiCad 5))
  
==Old Library Setup (Pull request #62 and before)==
+
==+Old Library Setup (Pull request #62 and before)==
  
 
===General===
 
===General===

Revision as of 15:23, 9 September 2019


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

{REMARKSBOX(type="error" title="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. {REMARKSBOX}

KiCad is an open source e-cad program (electrical computer aided design) that we have been using since early 2018 to design our PCBs. It has many advantages over our previous ECAD software, Diptrace, most notably the file types all being special text files, basically, which play nice with ((GitHub|Git)). It's also compatible with Windows, macOS, and many distributions of Linux!

{TABS(tabs="Setup|File Types|BOM|Manufacturing" toggle="n")}

If you run into a step which is not listed in these instructions, you should probably follow the default or ask a channel on Slack about it. Please write down whatever you do in case it brings up new issues or improves things.

Note: Kicad has known stability problems on OSX and only officially supports a few specific versions of OSX. It is highly recommended that you use Kicad on a Windows (or Linux) machine. As is standard ISC only officially supports Windows, although you may be able to get our tools to run appropriately on other platforms with extra work

Initial Install & Run

  1. Download the latest version of KiCad for your operating system
  • *If there are special instructions for that OS on KiCad's website, follow them
  • *Otherwise it installs much like any other program (e.g. open/run the .exe file for Windows).
  1. As you go through the install wizard menus, 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
  1. Enjoy, and check this page as well as the KiCad help resources before asking about issues on #elec-cad (((Slack)))

Library Setup (Since GitHub pull request #62)

(applies to KiCad 5.0)

Our libraries, as well as KiCad's own schematic symbol libraries, have now been moved to a submodule of the main. Make sure you've followed the [Github Setup] directions in order to get those libraries on your machine. They are in the Libraries folder of the PCB repository. When 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.

General

  1. Open KiCad. Start these instructions from the home screen.
  2. Click on Preferences --> Configure Paths...
  3. Change KICAD_SYMBOL_DIR (click on it and then "Edit") to the path of the Libraries folder
  • * The Libraries folder should be -+<isc>\PCB\Libraries+-

File:121

Schematic Symbols

  1. Open the Schematic layout/library editor

File:122 **If this is the first time you've done this (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!
  1. Click on Preferences --> Manage Symbol Libraries...
  • * Make sure you are on the Global Libraries tab for this initial setup
  1. Select all (ctrl+A or cmd+A) the libraries that are there by default and remove them. This should make your -+Global Libraries+- tab empty.
  • * If you use KiCad for another project, you will need to set it up like ours or mess with settings every time you work on it. This is outside the scope of this tutorial.
  • * The libraries will be added later by the -+sym-lib-table+- file in the template
  1. Click OK again to exit the library manager
  2. You are done with the initial setup!

Layout Footprints

  1. Open the PCB layout editor or Footprint library editor

File:123 # Click on Preferences --> Manage Footprint Libraries...

  • * Make sure you are on the Global Libraries tab for this initial setup
  1. Select all (ctrl+A or cmd+A) the libraries that are there by default and remove them. This should make your -+Global Libraries+- tab empty.
  • * If you use KiCad for a non-ISC project, you will need to set it up like ours or mess with settings every time you work on it. This is outside the scope of this tutorial.
  • * The libraries will be added later by the -+fp-lib-table+- file in the template
  1. Click OK again to exit the library manager
  2. You are done with the initial setup!

Creating/Adding a new Library

  1. If the library doesn't exist, create the library in KiCAD as you would normally. Save it in the correct folder.
  • * For symbol libraries: -+PCB/Libraries/schematic+-
  • * For footprint libraries: TBD
  1. Open the libraries manager
  • * For schematic: click on Preferences --> Manage Symbol Libraries...
  • * For layout: click on Preferences --> Manage Footprint Libraries...
  1. Go into the "Project Libraries" tab
  2. Click "Browse Libraries" and find the library you just saved
  • * Make sure it uses relative paths. The path should start with -+{$KICAD_SYMBOL_DIR}+-
  1. See Making changes on ((GitHub)) to update GitHub with your new library

Creating a New Project

See the instructions on the ((GitHub)) page.

Troubleshooting

((Upgrading a project from KiCad 4 to KiCad 5))

+Old Library Setup (Pull request #62 and before)

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>\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!
  1. 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
  1. Select all (ctrl+A or cmd+A) the libraries that are there by default and remove them
  2. Then click on Browse Libraries... <nowiki> --> </nowiki> navigate to the folder called schematic in the Libraries folder in our repo <nowiki> --> select all --> Click ''Open'' </nowiki>
  • *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
  1. AGAIN click Browse Libraries... <nowiki>--> </nowiki> navigate to the folder called schematic_kicad in the Libraries folder <nowiki> --> select all --> Click ''Open'' </nowiki>

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
  1. Click Browse Libraries...
  2. Navigate to the Libraries folder inside the PCB repo
  3. Inside the Libraries folder is a folder called layout.pretty
  • * KiCad uses the .pretty extension on folder names to delineate footprint libraries
  1. Select the layout.pretty folder and click OK
  2. In the list of libraries (probably at the bottom) you should now see one called "layout"
  3. Click OK again to exit the library manager

/////

See ((Standards|File storage standards)) for how to name and organize your project files.

The .kicad Folder

All project are put together in one folder. This folder has the .kicad ending to make it easy to tell a KiCad project folder apart from a regular folder. The folder is named after your project, and should have the same name as the project file, top-level schematic, and PCB. An example name would be projectName.kicad

Files that belong on git

||File Name|Type|Status|Description

projectName.pro|KiCad Project Meta File|Required|This file contains information about the KiCad project. There can only be one project file per project! (If you see others associated with your hierarchical schematics, get rid of them and don't open your schematic files straight from your file browser.

projectName.sch|KiCad Schematic File|Required|This is the top-level schematic for the project. You can add additional schematic files to your project and include them as heirarchical schematics, or "schematics within a schematic"

projectName.kicad_pcb|KiCad PCB File|Required|This is the physical layout of your circuit board. There can only be one PCB per project!

projectName_section.sch|KiCad Schematic File|Optional|It is all right to have more than one schematic file. Since each schematic file is the size of one page of paper when printed, it is common to have multiple-page schematics for larger projects

sym-lib-table|KiCad Library Database|Required|This tells KiCad what symbol libraries your project uses. If it doesn't exist, all your components will be '?'.

fp-lib-table|KiCad Library Database|Required|This tells KiCad what footprint libraries your project uses. If it doesn't exist, something breaks but I don't know how.

symbols/|Folder|Optional|This folder contains any local symbol libraries you create. You can put stuff here that you don't want to commit to the main libraries, for example, a one-off symbol for a project that doesn't meet quality standards. See the Symbols Libraries section below for more information on what goes in here

footprints.pretty/|Folder|Optional|This folder contains any local component footprints you create. You can put stuff here that you don't wnat to commit to the main libraries. See the Footprint Libraries section for more information on what goes in here

models.3dshapes/|Folder|Optional|This folder contains 3D CAD models of components. See the 3D Model Libraries section for more information on what goes in here

bom.ini|BOM Settings File|Optional|This file is generated by the KiCad BOM generator plugin if it can't find a settings file. It contains information on how the BOM plugin parses the component list to generate the BOM||

Files that don't belong on git

Under construction

||File Name|Type|Description

schematicName.bak|KiCad Schematic Backup File|This file contains a backup of your schematic when it's saved. If you really mess something up and the previous git commit is not up-to-date at all (in this case, shame on you!), then you can change the name of this file to have a .sch ending and open it in KiCad

_saved_anyName.sch|Autosave|This file is an autosave file from KiCAD to restore from crashes. You should fix this before pushing, so we don't need them on git.

any .lib file not in the Libraries directory|Library|This is a library file. It should be in the Libraries.

projectName-cache.lib|KiCad Library File|Automatic|This file will be generated automatically by KiCad to store a local copy of schematic symbols. This lets you view the schematic even if the main libraries are unavailable (but should not replace using them!), and it protect you if symbols in a library change

more to come!| | ||

Symbol Libraries

Under construction

Footprint Libraries

Under construction

3D Model Libraries

Under construction

Credit to Byron Hopps for the content pre- 10-07-18

/////

{REMARKSBOX(type="warning" title="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.{REMARKSBOX}

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>\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|add custom fields)) 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

400px

  • Go to the following link: Kicad BOM Generator
  • *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

/////

Files needed before getting a PCB manufactured:

  • Export all of the [1] files in Gerber X2 format
  • Make sure drill files are exported in mm not mils or inches, otherwise the Bay Area Circuits DFM will round and cause problems
  • Compress all the files into a zip. Move this to the directory with the schematic files.
  • ((KiCad|#content_index1-3|Export a BOM)) and save as a Microsoft Excel file
  • Place both files inside your project's folder
  • add, commit, and push those files to your branch

{TABS}

~tc~ (alias(KiCad)) ~/tc~

~tc~ (alias(https://wiki.illinisolarcar.com/wiki/tiki-index.php?page=KiCad#content_index1-2)) ~/tc~

~tc~ (alias(KiCAD)) ~/tc~