You are not Logged In!

Difference between revisions of "Public:KiCad"

From Illini Solar Car Wiki
Jump to navigation Jump to search
imported>Amalia
 
(128 intermediate revisions by 12 users not shown)
Line 1: Line 1:
 +
''See [[PCB Design]] for design basics & guidelines. See [[Public:GitHub]] for setting up the files you're going to work with.''
  
__TOC__
+
[https://www.kicad.org/ 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.
  
''See ((PCB Design)) for design basics & guidelines. See ((GitHub)) for setting up the files you're going to work with.''
+
If you have any trouble with this set-up you can get help on {{SlackLink|elec-cad}} or speak to other electrical team members.
  
{REMARKSBOX(type="warning" 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 HDD, following the directions for creating a new project on ((GitHub)) starting at step 2, and copying your design into the new project. Please do this at a meeting so James, Amalia or Tony can help you with it. {REMARKSBOX}
+
{{RemarksBox Info|Title=We use KiCad v8|Text=We are currently using KiCad v8. Major versions of KiCad are not cross-compatible. Make sure you use a KiCad v8 production release. Nightly Releases are also not compatible with production releases.}}
 +
{{RemarksBox Warn|Title=Images may Differ|Text=Minor versions of KiCad v8 have had many cosmetic updates, the images below may look a bit different than what you see.}}
  
{REMARKSBOX(type="info" title="Note")}This page is under construction. If you run into some confusing or incomplete instructions, ask James what to do. {REMARKSBOX}
+
{{RemarksBox
 +
  | bordercolor    = #F5C6CB
 +
  | backgroundcolor = #F8D7DA
 +
  | iconfile        = Error Icon.png
 +
  | width          = 100%
 +
  | Title          = Use the Template for New Designs
 +
  | Text            = You must start your projects from the KiCad v8 template or they will not be accepted! This can be found in the Dev folder of our PCB repo. If you have started without the template you should create a new project from the template and copy your board into that (Note: in KiCad v8 this is a simple ctrl+c, ctrl+v). You can ask for help with this on {{SlackLink|elec-cad}}
 +
}}
  
[http://kicad-pcb.org/ 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!
+
== First Time Setup ==
 +
A video tutorial for downloading and setting up [[GitHub]] as well as cloning the PCB repository can be found in [https://www.youtube.com/watch?v=6VV7DvNGEA8&list=PLYWKqdG09eYLCqh8V8gjJpYXOJ60yJ5xG&index=1 the first video of Rahul's KiCad tutorials playlist]. The video goes over KiCad v5, but the installation process is very similar to v8.
  
{TABS(tabs="Setup|File Structure|BOM|Manufacturing" toggle="n")}
+
=== Install and Run ===
 +
# [https://www.kicad.org/download/ Download the latest '''8.x.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
 +
# 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
 +
# Enjoy, and check this wiki as well as the [https://docs.kicad.org/ KiCad help resources] before asking about issues on {{SlackLink|elec-cad}}
  
''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.''
+
=== Library Setup ===
 +
''Note: This applies to KiCad v6, v7, and v8 projects on GitHub since'' {{GithubPRLink|repo=isc-hw-libs|number=84}}.''This should cover most projects, and all new projects. But if you need to view older projects please update them following the instructions at [[Viewing KiCad v5 Projects]]''
  
==Initial Install & Run==
+
Our libraries, as well as KiCad's own schematic symbol libraries, our libraries are now back to their own repo. Make sure you've followed the [[GitHub]] directions in order to get those libraries on your machine. They are in the the seperate [https://github.com/IlliniSolarCar/isc-hw-libs/ isc-hw-libs] repo. 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.
# [http://kicad-pcb.org/download/ 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).
 
# 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
 
# Enjoy, and check this page as well as the [http://kicad-pcb.org/help/ KiCad help resources] before asking about issues on #elec-cad (((Slack)))
 
  
==Library Setup (Since GitHub pull request #62)==
+
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.
 +
# Open KiCad. Start these Instructions from the home screen
 +
# Click on ''Preferences --> Configure Paths...''
 +
# Add a new path (press "Add") with the name <code>ISC_SYMBOL_DIR</code> and insert the path to the isc-hw-libs repo: <code>PathOnYourComputer\isc-hw-libs</code>
 +
[[File:KiCad Libs Config.png|none|frame|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)
  
(applies to KiCad 5.0)
+
=== Starting a Project ===
  
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&nbsp;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.
+
# Create a branch for your project in the PCB Repo (See [[GitHub/PCB]] for specific guidelines) <code>git checkout -b <branch></code>
 +
#* If you need to make new symbols or footprints see [[Adding Symbols %26 Footprints to KiCad]] you also need to create a branch in the [https://github.com/IlliniSolarCar/isc-hw-libs/ isc-hw-libs] repo. If you are unsure, you can always do this later when the need arises. (See [[GitHub/Libraries]] for more info)
 +
# Copy the latest template from the Dev Folder (make sure you <code>git checkout master</code> and <code>git pull</code>first) <code>PathOnYourComputer\PCB/Dev/Template_v0.0</code> to the location where your project will live
 +
# Rename your project following the naming conventions - you will need to rename the folder and every named file manually.
 +
#* Do not rename the <code>.kicad_wks</code> file or others files not named for the template - otherwise your settings and/or libraries may not be set-up right
 +
# Make an initial commit to the PCB Repo to create your branch on Github. (Use <code>git push --set-upstream origin <branch> </code> for the first push)
  
===General===
+
Now you are good to go working on your project! Make sure to follow the [[Schematic Conventions]] and [[Layout Standards]].
# Open KiCad. Start these instructions from the home screen.
 
# Click on ''Preferences'' --> ''Configure Paths...''
 
# Change KICAD_SYMBOL_DIR (click on it and then &quot;Edit&quot;) to the path of the Libraries folder
 
* * The Libraries folder should be -+<isc>\PCB\Libraries+-
 
 
 
[[File:121]]
 
 
 
===Schematic Symbols===
 
# 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 &quot;Configure Global Symbol Library Table&quot;. 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!
 
# Click on ''Preferences'' --> ''Manage Symbol Libraries...''
 
* * Make sure you are on the Global Libraries tab for this initial setup
 
# 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.
 
# Click ''OK'' again to exit the library manager
 
# You are done with the initial setup!
 
 
 
===Layout Footprints===
 
# 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
 
# 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.
 
# Click ''OK'' again to exit the library manager
 
# You are done with the initial setup!
 
 
 
===Creating/Adding a new Library===
 
# 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'''
 
# Open the libraries manager
 
* * For schematic: click on ''Preferences'' --> ''Manage Symbol Libraries...''
 
* * For layout: click on ''Preferences'' --> ''Manage Footprint Libraries...''
 
# Go into the &quot;Project Libraries&quot; tab
 
# Click &quot;Browse Libraries&quot; and find the library you just saved
 
* * '''Make sure it uses relative paths.''' The path should start with -+{$KICAD_SYMBOL_DIR}+-
 
# See Making changes on ((GitHub)) to update GitHub with your new library
 
 
 
==Troubleshooting==
 
 
 
((Upgrading a project from KiCad 4 to KiCad 5))
 
  
==Old Library Setup (Pull request #62 and before)==
+
== 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:
  
===General===
+
* For KiCad v4 Projects - follow the instructions at [[Upgrading a project from KiCad 4 to KiCad 5]]
 +
* For KiCad v5 Projects - follow the instructions at [[Viewing KiCad v5 Projects]]
 +
* For KiCad v6 Projects - follow the instructions at [[Viewing KiCad v6 Projects]]
 +
* For KiCad v7 Projects - follow the instructions at [[Viewing KiCad v7 Projects|Viewing KiCad v7Projects]]
 +
* 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 {{GithubPRLink|repo=PCB|number=62}})
 +
{{Collapsible Box|title=Old Library Set-up|content='''General'''
 
# Click on ''Preferences'' --> ''Configure Paths...''
 
# Click on ''Preferences'' --> ''Configure Paths...''
# Change KICAD_SYMBOL_DIR (click on it and then &quot;Edit&quot;) to the path of the Libraries folder
+
# Change <code>KICAD_SYMBOL_DIR</code> (click on it and then "Edit") to the path of the Libraries folder
* * The Libraries folder should be <isc>\PCB\Libraries
+
#* The Libraries folder should be <code><ISC folder>\isc-hw-libs</code>
 
 
]] ===Schematic Symbols===
 
  
 +
'''Schematic Symbols'''
 
''Assumes you have eeschema open''
 
''Assumes you have eeschema open''
 
# ''If in Project window, otherwise go to next step.'' Click on ''Tools'' --> ''Edit Schematic Symbols...''
 
# ''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 &quot;Configure Global Symbol Library Table&quot;. Stick with the default and click ''Ok''
+
#* 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!
+
#* 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!
 
# ''Skip #1 to go here if you have a schematic open.'' Click on ''Preferences'' --> ''Manage Symbol Libraries...''
 
# ''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
+
#* Make sure you are on the Global Libraries tab of the popup box
 
# Select all (ctrl+A or cmd+A) the libraries that are there by default and remove them
 
# Select all (ctrl+A or cmd+A) the libraries that are there by default and remove them
# Then click on ''Browse Libraries...'' <nowiki><nowiki> --> </nowiki></nowiki> navigate to the folder called '''schematic''' in the Libraries folder in our repo <nowiki><nowiki> --> select all --> Click ''Open'' </nowiki></nowiki>
+
# Then click on ''Browse Libraries...'' --> navigate to the folder called '''schematic''' in the isc-hw-libs repo --> select all --> Click <nowiki>''</nowiki>Open<nowiki>''</nowiki>
* *These are the custom ones we've made for solar car parts.
+
#* 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
+
#* Make sure you add these first; we override some of the default library symbols
# '''AGAIN''' click ''Browse Libraries...'' <nowiki><nowiki>--> </nowiki></nowiki> navigate to the folder called '''schematic_kicad''' in the Libraries folder <nowiki><nowiki> --> select all --> Click ''Open'' </nowiki></nowiki>
+
# '''AGAIN''' click ''Browse Libraries...'' --> navigate to the folder called '''schematic_kicad''' in the Libraries folder --> select all --> Click ''Open''
 
 
===Layout Footprints===
 
  
 +
'''Layout Footprints'''
 
''Assumes you have Pcbnew open''
 
''Assumes you have Pcbnew open''
 
# Click on ''Preferences'' --> ''Manage Footprint Libraries...''
 
# Click on ''Preferences'' --> ''Manage Footprint Libraries...''
* * Make sure you are on the Global Libraries tab of the popup box
+
#* Make sure you are on the Global Libraries tab of the popup box
 
# Click ''Browse Libraries...''
 
# Click ''Browse Libraries...''
# Navigate to the Libraries folder inside the PCB repo
+
# Navigate to the isc-hw-libs repo
# Inside the Libraries folder is a folder called layout.pretty
+
# Inside the isc-hw-libs repo is a folder called layout.pretty
* * KiCad uses the .pretty extension on folder names to delineate footprint libraries
+
#* KiCad uses the .pretty extension on folder names to delineate footprint libraries
 
# Select the layout.pretty folder and click ''OK''
 
# Select the layout.pretty folder and click ''OK''
# In the list of libraries (probably at the bottom) you should now see one called &quot;layout&quot;
+
# In the list of libraries (probably at the bottom) you should now see one called "layout"
# Click ''OK'' again to exit the library manager
+
# Click ''OK'' again to exit the library manager|autocollapse=true|width=100%}}
 
 
/////
 
 
 
=The .kicad&nbsp;Folder=
 
 
 
All project&nbsp;are put together in one&nbsp;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&nbsp;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 &quot;schematics within a schematic&quot;
 
 
 
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
 
 
 
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
 
 
 
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&nbsp;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.
 
 
 
more to come!|&nbsp;|&nbsp;||
 
 
 
=Symbol Libraries=
 
 
 
Under construction
 
 
 
=Footprint Libraries=
 
 
 
Under construction
 
 
 
=3D Model&nbsp;Libraries=
 
 
 
Under construction
 
 
 
Files&nbsp;
 
 
 
''Credit to Byron Hopps for the content pre- 10-07-18''
 
 
 
/////
 
 
 
{REMARKSBOX(type=&quot;warning&quot; title=&quot;Note&quot;)}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 [https://github.com/openscopeproject/InteractiveHtmlBom/wiki/Installation 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 &quot;iBOM&quot; 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 Conventiosn|#Part_Information|add custom fields)) to KiCad components during the schematic process, they will not show up if you simply click &quot;iBOM&quot; and then (export? generate?). To tell iBOM about the custom fields, you should generate a netlist as instructed in the instructions.
 
 
 
===Links===
 
 
 
[https://forum.kicad.info/t/interactive-html-bom-plugin-for-kicad-5-0/11713 Giant Thread of Updates]
 
 
 
[https://github.com/openscopeproject/InteractiveHtmlBom The Source]
 
 
 
[https://github.com/openscopeproject/InteractiveHtmlBom/wiki/Installation Creator's Installation Instructions]
 
 
 
===Comments===
 
 
 
The installation instructions for Windows do indeed work. Note that the &quot;scripting console&quot; 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'''
 
# Download the ZIP folder
 
# Extract all
 
# Locate/create the folder as instructed on the page
 
# 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)
 
# Restart KiCad if you had it open
 
# Open Pcbnew
 
# There should now be a button on the toolbar next to the Scripting Console logo. It says &quot;iBOM&quot;
 
 
 
'''OS X installation'''
 
 
 
(coming soon)
 
 
 
'''Linux Installation'''
 
  
(coming soon)
+
== Bill of Materials ==
 +
The Bill of Materials (BOM) is the list of parts you need in order to fully assemble the board. Since all this info is in KiCad, we just have to get it out in a format that is useful for what we are doing with it!
  
==From Missouri S&T==
+
Before you begin, you need to make sure that all of your parts have the required information as specified in the [[Schematic Conventions]].
 +
{{RemarksBox Error|Title=Our BOM Methods need improvement|Text=Note that we don't have a great BOM system as of now. Currently, there is a lot of manual work to make sure to get it right. If you want to work on this, you can make this better with Python Scripts/Plugins and/or [[GitHub Actions]]!}}
 +
The ''Tools -> Edit Symbol Fields'' table can act as a BOM Previewer within KiCad to view all of your parts and their info. You can also mass edit things (such as applying part numbers to a bunch of the same part)
  
===Procedure:===
+
See the [[Adding a BOM to PartsBox]] for our current workflow and [[KiCad/BOM]] page for info on how to export the BOM for different usages!
* For each component, perform the following in Eeschema
 
  
[[File:51|70px|400px]]  
+
== Export for Manufacturing ==
* Go to the following link: [https://github.com/mst-solar-car/kicad-bom-generator Kicad BOM Generator]
+
To manufacture your files you simply need to export the [https://bayareacircuits.com/are-you-providing-your-pcb-manufacturer-with-the-correct-files/ needed files]. That is, [[wikipedia:Gerber_format|the Gerber X2 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.
* *Clone/Download it onto your computer
+
# You can follow [http://support.seeedstudio.com/knowledgebase/articles/1824574-how-to-generate-gerber-and-drill-files-from-kicad this tutorial] to export the files for your board.
* *Save it somewhere you&rsquo;ll remember
+
#* 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.
* Follow instructions on page under '''Usage''' (repeated below)
+
# 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
* *Open '''Eeschema''' for your board
+
# Once you have this .zip you can run the DFM report to make sure that passes
* *Click '''Tools > Generate Bill of Materials'''
+
# When the Board Run is ready the DFM report and zip file will be sent in.
* *Click Add Plugin
+
# For assembly you will also need the Bill of Materials (above) in [[Partsbox]], [[Adding a BOM to PartsBox]]
* *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 &quot;Plugins&quot; and then click &quot;Generate&quot;
 
* *By default, this will save an excel sheet in the same folder as your project
 
  
Instructions for Parser to be expanded upon later
+
== Plugins ==
 +
KiCad makes it really easy to integrate 3rd party plugins in KiCad. A plugin is essentially just a python script that you can run from inside KiCad so it has access to what you are currently working on. You can find KiCad plugins online from many sources to do all sorts of things. Additionally, we may also develop some of our own.
  
''Credit to Peter Leung for the content pre- 10-07-18''
+
Installing Plugins is easy, just place the plugin files in their own folder in the KiCad Plugins folder. This differs by OS:
 +
* Windows: <code>%APPDATA%\kicad\scripting\plugins</code>
 +
* Linux: <code>/usr/share/kicad/scripting/plugins/</code>
 +
* Mac: <code>~/Library/Application Support/kicad/scripting/plugins</code>
 +
If you have KiCad open you can add the Plugin by going to <code>Tools -> External Plugins -> Refresh</code> although some may need a full restart of KiCad
  
/////
+
Some useful Plugins, we recommend that everyone install HTML BOM - install others as needed:
 +
* [https://github.com/openscopeproject/InteractiveHtmlBom Interactive HTML BOM], useful for helping you while building a board. See [[KiCad/BOM]] for more info
 +
* [https://github.com/easyw/RF-tools-KiCAD RF Tools]: Includes several tools, not only useful for RF, including Curved Traces, Track Length Matching, Via Fencing
 +
* [https://github.com/NilujePerchut/kicad_scripts/tree/master/teardrops Teardrops] : makes teardrops into vias and/or pads which increases the inferface between the trace and the via/pad. Most useful to reduce mechanical/thermal strain and thus prevent cracking traces
 +
* [https://github.com/jsreynaud/kicad-action-scripts Via Stitching and Circular Zones]: Stitch together copper areas with vias more easily and create round copper zones
  
Files needed before getting a PCB manufactured:
+
== Useful Links ==
* Export all of the '''[https://bayareacircuits.com/are-you-providing-your-pcb-manufacturer-with-the-correct-files/|correct]''' files in [http://support.seeedstudio.com/knowledgebase/articles/1824574-how-to-generate-gerber-and-drill-files-from-kicad Gerber X2 format]
+
[https://shawnhymel.com/portfolio/video-series-introduction-to-kicad/ Shawn Hymel's Tutorials] - videos for every step of PCB design and manufacture
* 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}
+
[https://www.kicad.org/help/ KiCad's own website] - videos, example PCBs, and textual tutorials can be found under "learning resources"
  
~tc~ (alias(KiCad)) ~/tc~
+
[https://www.build-electronic-circuits.com/kicad-tutorial/ "Make Your First Board"] - great tutorial for visual learners
  
~tc~ <nowiki>(alias(https://wiki.illinisolarcar.com/wiki/tiki-index.php?page=KiCad#content_index1-2))</nowiki> ~/tc~
+
[https://www.youtube.com/playlist?list=PLYWKqdG09eYLCqh8V8gjJpYXOJ60yJ5xG Rahul's tutorial videos] - Created during Electrical Onboarding 2020, great guide for getting started with the team
 +
{{PCB Design Navbox|collapsed=}}
 +
[[Category:KiCad]]

Latest revision as of 17:02, 9 June 2024

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

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 or speak to other electrical team members.


InfoIcon.png We use KiCad v8
We are currently using KiCad v8. Major versions of KiCad are not cross-compatible. Make sure you use a KiCad v8 production release. Nightly Releases are also not compatible with production releases.
Warning Icon.png Images may Differ
Minor versions of KiCad v8 have had many cosmetic updates, the images below may look a bit different than what you see.
Error Icon.png Use the Template for New Designs
You must start your projects from the KiCad v8 template or they will not be accepted! This can be found in the Dev folder of our PCB repo. If you have started without the template you should create a new project from the template and copy your board into that (Note: in KiCad v8 this is a simple ctrl+c, ctrl+v). You can ask for help with this on Slack Icon.pngelec-cad

First Time Setup

A video tutorial for downloading and setting up GitHub as well as cloning the PCB repository can be found in the first video of Rahul's KiCad tutorials playlist. The video goes over KiCad v5, but the installation process is very similar to v8.

Install and Run

  1. Download the latest 8.x.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 v6, v7, and v8 projects on GitHub since Github Logo.png isc-hw-libs#84.This should cover most projects, and all new projects. But if you need to view older projects please update them following the instructions at Viewing KiCad v5 Projects

Our libraries, as well as KiCad's own schematic symbol libraries, our libraries are now back to their own repo. Make sure you've followed the GitHub directions in order to get those libraries on your machine. They are in the the seperate isc-hw-libs repo. 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 isc-hw-libs repo: PathOnYourComputer\isc-hw-libs
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 branch for your project in the PCB Repo (See GitHub/PCB for specific guidelines) git checkout -b <branch>
  2. Copy the latest template from the Dev Folder (make sure you git checkout master and git pullfirst) PathOnYourComputer\PCB/Dev/Template_v0.0 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)

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:

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>\isc-hw-libs

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 isc-hw-libs 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 isc-hw-libs repo
  4. Inside the isc-hw-libs repo 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

The Bill of Materials (BOM) is the list of parts you need in order to fully assemble the board. Since all this info is in KiCad, we just have to get it out in a format that is useful for what we are doing with it!

Before you begin, you need to make sure that all of your parts have the required information as specified in the Schematic Conventions.

Error Icon.png Our BOM Methods need improvement
Note that we don't have a great BOM system as of now. Currently, there is a lot of manual work to make sure to get it right. If you want to work on this, you can make this better with Python Scripts/Plugins and/or GitHub Actions!

The Tools -> Edit Symbol Fields table can act as a BOM Previewer within KiCad to view all of your parts and their info. You can also mass edit things (such as applying part numbers to a bunch of the same part)

See the Adding a BOM to PartsBox for our current workflow and KiCad/BOM page for info on how to export the BOM for different usages!

Export for Manufacturing

To manufacture your files you simply need to export the needed files. That is, the Gerber X2 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, Adding a BOM to PartsBox

Plugins

KiCad makes it really easy to integrate 3rd party plugins in KiCad. A plugin is essentially just a python script that you can run from inside KiCad so it has access to what you are currently working on. You can find KiCad plugins online from many sources to do all sorts of things. Additionally, we may also develop some of our own.

Installing Plugins is easy, just place the plugin files in their own folder in the KiCad Plugins folder. This differs by OS:

  • Windows: %APPDATA%\kicad\scripting\plugins
  • Linux: /usr/share/kicad/scripting/plugins/
  • Mac: ~/Library/Application Support/kicad/scripting/plugins

If you have KiCad open you can add the Plugin by going to Tools -> External Plugins -> Refresh although some may need a full restart of KiCad

Some useful Plugins, we recommend that everyone install HTML BOM - install others as needed:

  • Interactive HTML BOM, useful for helping you while building a board. See KiCad/BOM for more info
  • RF Tools: Includes several tools, not only useful for RF, including Curved Traces, Track Length Matching, Via Fencing
  • Teardrops : makes teardrops into vias and/or pads which increases the inferface between the trace and the via/pad. Most useful to reduce mechanical/thermal strain and thus prevent cracking traces
  • Via Stitching and Circular Zones: Stitch together copper areas with vias more easily and create round copper zones

Useful Links

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

KiCad's own website - videos, example PCBs, and textual tutorials can be found under "learning resources"

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

Rahul's tutorial videos - Created during Electrical Onboarding 2020, great guide for getting started with the team