some info about kicad - lafayette college · kicad 7 v e r s i on c on tr ol often, during large...

18
KICAD 1 Lafayette College | Electrical and Computer Engineering Some Info About KiCad ECE/ME 492 | Spring 2020 Last Revision: 4/13/2020 Prepared by: Jon Abel, Connor Winiarczyk, Noah Engime

Upload: others

Post on 01-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 1

Lafayette College | Electrical and Computer Engineering

Some Info About KiCad ECE/ME 492 | Spring 2020

Last Revision: 4/13/2020 Prepared by: Jon Abel, Connor Winiarczyk, Noah Engime

Page 2: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 2

Introduction KiCad is a free and popular open source EDA suite used for creating schematics and

printed circuit board design files. Project information for schematics, board layouts, symbols and footprints are primarily stored in text files, making version control with tools such as Git very easy and effective. The 2020 team made an effort to store as many project repositories for circuit boards and for firmware online as possible. An organization called Lafayette College FSAE was created on Github to track each repository, and it can be found at the URL https://github.com/Lafayette-FSAE.

This guide is intended to provide information on how to set up and maintain a KiCad

environment so that teams do not need to waste time every year getting access to old files, realizing that entire projects were deleted with a graduating student’s user account, or copying over outdated symbol libraries. While some helpful information about KiCad may be included below, providing a tutorial on how to use KiCad is not the main goal.

Some Background A few different file extensions/types are described below for your convenience. Detailed

information can be found at https://kicad-pcb.org/help/file-formats/.

- *.pro - Top level project file, has both interesting and boring project information in it,

only one per project - *.sch

- A schematic file, contains information about all symbols and connections within a schematic, there is one file per schematic sheet in the project

- *.sch-bak - Just a backup of each schematic file

- *.kicad_pcb - A printed circuit board (PCB) description file, contains information about all

footprints, silkscreen, copper traces, board outline, etc., there is one file per project, and it wants to have the same name as the project

- *.kicad_pcb-bak - Just a backup of each PCB file

- *.lib

Page 3: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 3

- A schematic symbol library file, it acts as a container for schematic symbols which are created in KiCad’s symbol editor

- *.pretty - An folder extension to turn a normal folder into a footprint container

- *.kicad_mod - File type for a PCB footprint, which describes the physical size and pad layout for

a part package

Getting Started The first thing to do is install KiCad. Most recent KiCad projects were created in KiCad

5.1, but the most recent version will ~hopefully~ still have backwards compatibility, depending on when you are reading this document. Download the program at https://kicad-pcb.org/download/. Once KiCad is installed, run it and open up Eeschema, the schematic editor. Go with the default option in the popup. Close Eeschema and do the same with PcbNew. Select Accelerated Graphics if possible. Close PcbNew.

Next, clone the “KiCad-Libraries” from the Github into Documents or Desktop or something like that. This repository contains the symbol libraries and footprint modules that have been created or downloaded by past students. Other KiCad projects depend on these symbols, so without the libraries the projects will not load correctly.

In order to configure KiCad to include these libraries, first navigate to the “Preferences” drop down menu and then select “Manage Symbol Libraries.”

Page 4: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 4

Under the “Global Libraries” tab click the folder icon at the bottom that says “Add existing library to table.”

Navigate to the KiCad-Libraries directory and select “Lafayette_Electric_Car_Internals.lib.” Select “Open” and then “OK” to close out.

Page 5: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 5

Back under “Preferences” open up “Manage Footprint Libraries,” under the “Global” tab

select the “Add existing library to table” and this time choose “Lafayette_Electric_Car_Footprints.pretty”.

Select “OK” and “OK” to close out. The libraries should now be included whenever KiCad loads the symbol libraries or footprint libraries.

Page 6: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 6

KiCad also comes with 3D model packages installed. These are very useful when utilizing PcbNew’s 3D viewer. However, the paths occasionally are not set up correctly on install. Under “Preferences” again, go into “Configure Paths.” Check that the “KISYS3DMOD” path resembles something like below, and if it doesn’t, change it to point to the “packages3d” directly in the KiCad install location. Once done, that should be it for setting up KiCad from a fresh install.

Page 7: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 7

Version Control Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad stores all of its data as text files, it is extremely easy to integrate it with version control software like Git or SVN. To take advantage of this, the Lafayette FSAE team keeps a git repository for each of its in house Printed Circuit Boards, and an additional, separate repository for symbols and footprints. The purpose of keeping all symbols and footprints in a separate repository is to allow for easy sharing of parts and collaboration between board designers . All repositories are kept in the 1

Lafayette-FSAE github organization, https://github.com/Lafayette-FSAE and are accessible to all members of the team at all times. The team has been using Sublime Merge (https://www.sublimemerge.com/) as its Git client of choice, and would highly recommend it to anyone doing PCB designs for the team in the future.

1 Often, more than one board on the project may require the same part, this is especially true of generic parts like MOSFETs or LEDs, and keeping a shared repository of symbols and footprints makes it easy to use these parts on many boards without having to re-spec them or make symbols more than once.

Page 8: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 8

Configuring the gitignore There are a number of files that should not be tracked by Git, these include temporary files used by KiCad, gerber files produced for manufacturing, and documentation files. To make this easier, all gerber files should be plotted in a folder labelled CAM (Computer Aided Manufacturing), or something similar, and documentation plotted in a dedicated folder named Documentation. Recommended .gitignore file: # For PCBs designed using KiCad: http://www.kicad-pcb.org/ # Format documentation: http://kicad-pcb.org/help/file-formats/  CAM/ Documentation/  # Temporary files *.000 *.bak *.bck *.kicad_pcb-bak *~ _autosave-* *.tmp *-cache.lib *-rescue.lib *-save.pro *-save.kicad_pcb  # Netlist files (exported from Eeschema) *.net  # Autorouter files (exported from Pcbnew) *.dsn *.ses  # Exported BOM files *.xml *.csv 

Page 9: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 9

A version of this recommended .gitignore can be automatically added to a new git repository if the repository is created online, as seen below.

Maintaining a Project

Creating New Schematic Symbols or Footprint Modules You will often find that when you decide to use a specific component, KiCad will not

have a schematic symbol specific to it or even a footprint module that is compatible (this is especially true for connectors, relays and power modules). This will require you to create a new schematic symbol using the Symbol Editor or a new footprint using the Footprint Editor. Since these types of modules are both stored in the KiCad-Libraries repository, it is important to keep the repository updated so that work is not lost or overwritten.

Luckily, using version control tools like Sublime Merge makes these extremely easy.

Save newly created symbols in the Lafayette_Electric_Car_Internals library and newly created footprint modules in the Lafayette_Electric_Car_Footprints directory. Try to make the symbol and footprint names as descriptive as possible. For example, there are some very well named footprints in the library already. There are also some very poorly named footprints as well. We’ll let you decide which are which. Once the symbols are saved, simply commit and push them to the Git and they will forever be remembered and available for others to use.

Page 10: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 10

Symbol Conventions Because all members of the team contribute to and use the same set of symbols, it is

important that all members adopt the same set of conventions when creating and editing them. The team has adopted the following standard, and recommends it to future teams:

Schematic Fields: The following fields are considered necessary for all symbols and are extremely useful when generating BOMs and purchase orders.

Reference  Required by KiCad 

Value  Required by KiCad 

Footprint  Link to Footprint file. This doesn’t need to defined at the symbol level, but we recommend doing so to prevent confusion and footprint errors 

Datasheet  -- 

Manufacturer  -- 

Manufacturer Part  Part Number as defined by the manufacturer, useful for referencing the part and finding related documentation 

Vendor  Vendor you intend to buy the part from. This should be Digikey unless there is a good reason for it not to be Digikey. Used for generating BOMs and Purchase Orders 

Vendor Part  Part number as listed on Vendor site. Including this makes it very easy to auto populate Digikey Carts from BOMs, and is very useful when generating purchase orders 

Optional Fields:

Mates With  Use this for any part that mates with a part not included 

Page 11: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 11

in the schematic. Connectors, Jumpers, Fuse Holders, etc. Specify the part number of the part it mates with so that they are included in the documentation 

Uses Cable  Include the Part Number of cables so that they can be ordered and included in documentation when needed 

Tagging Tagging is a useful method for finding major releases or milestones of projects. Github

allows you to quickly jump to tagged releases and download zip files of the project, which makes it very easy to reference previous versions. We encourage the use of tagging to mark commits of KiCad projects which are major revisions (ex. 1.0, 1.2, 2.0) and to mark commits of projects that have Gerber files which were sent out for PCB manufacture (ex. v1.2_ordered, v1.3_rushordered). When making tags, remember to explicitly push them to origin.

Project Organization When KiCad projects are allowed to grow out of control, you can be left with dozens of

files of different types spread out between directories with little hope of reorganizing them while maintaining dependencies. We offer the following recommendations for project organization in order to have uniform dependencies and structures across all KiCad project:

- Keep all custom symbols and footprints updated in the KiCad-Libraries repository and out of individual project directories.

- Group production files (Gerber, drill files) for different board revisions in their own directories in a master “Production Files” directory - this makes it easy to determine what files should be or have been sent to a board manufacturer.

- Export documentation files for at least every major release to a “Documentation” directory. This would include a PDF of the schematic, a PDF of the board layout, a 3D rendering of the board, and a BOM spreadsheet.

- Refer to the 3D section below for maintaining 3D models

Page 12: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 12

3D Models KiCad can use STEP and WRL files to render 3D models of components in PcbNew’s

3D viewer tool. KiCad comes shipped with several 3D model libraries of standard components like resistors, capacitors, standard integrated circuit packages, diodes, etc. These 3D models are all linked to specific footprints. There may be custom footprints that you make for components like relays, power converters, or connectors. 3D models of most components can be downloaded from the manufacturer’s website and used in KiCad’s 3D viewer.

Unfortunately, KiCad does not yet include an effective way to manage 3D models like schematic symbols and footprints, so the KiCad-Libraries repository does not include any centralized location for 3D models. Instead, each project should have a folder dedicated to storing 3D models for any non-standard parts used within the project. KiCad is then able to reference these files based off of the project directory and maintain dependencies.

To assign a 3D model to a custom footprint, place it within the 3D models directory of

the project. Then, in the Footprint Editor, select the footprint to link the model to. Next, select the “Footprint properties” option as shown below.

Page 13: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 13

In the “3D settings” tab, select the folder icon to open a dialog for locating the 3D model.

Use the “Paths:” dropdown at the bottom to select the project directory. Open the 3D models folder and select the correct STEP file. A preview of the model is shown to verify. Select OK to confirm.

Now the 3D model will likely need to be aligned to match the footprint. Selecting the isometric perspective view and choosing a top-down view makes this easier.

Page 14: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 14

Use the Scale, Rotation and Offset adjustments to properly position the model within the footprint, and click OK.

Now, when that footprint is included on a PCB and the 3D viewer is entered, the 3D model will be used. As long as the STEP files remain in the 3D model folder in the project directory, they will remain usable by KiCad even across machines, if the full project is cloned.

Page 15: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 15

Custom Logos in KiCad KiCad has the ability to convert images to formats that are usable in Eeschema and

PcbNew in order to display images as a schematic symbol, silkscreen symbol, solder mask cutaway, or user layer image. This is useful for including college logos, paw prints, competition required high voltage images, or flattering images of your professors.

1. Find png of image you want to use 2. Convert to lineart if desired. (KiCad can do it but not always very well.) I used this

online converter: https://online.rapidresizer.com/photograph-to-pattern.php

3. Save as png 4. Go to KiCAD and select bitmap converter

Page 16: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 16

5. Click on load bitmap and select the png file. Under format, make sure the PcbNew file

option is selected. Export the file a. If the Eeschema option is selected in the “Format” menu on the right, the tool will

output a schematic symbol instead of a footprint module b. Note: the “Board Layer for Outline” menu option determine if the image is output

as silkscreen or as solder mask keepout 6. You’ll need to rescale the file. You can either use the scaling in the upper right of the

tool, or you can use an online service again http://img2mod.wayneandlayne.com/

Choose a name for the module and pick a scale factor. If you select the Preview? option and click Upload, the site will show you the dimensions of the scaled image. Once it’s good, unclick preview and hit Upload.

Page 17: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 17

If this doesn’t work, you can also use the lineart png and the site will convert it into a kicad_mod file.

7. The file needs to be in a folder to work. Create a folder and put the mod file in it. 8. Go back to KiCAD. Inside the PCB editing page, go to Preferences -> Manage Footprint

Libraries. Select the little folder button to add custom libraries. Find the folder and select it. Hit ok and go back to the PCB editing page

a. (do it this way) You can also drop the new *.kicad_mod file in the KiCad-Libraries repository directory into the *.pretty folder in order to make it available to others to use

9. Go to add footprints on the sidebar. Click to open the footprint library, and search for your folder. When you find it, select the mod file inside the folder. If everything worked, you should see the icon on the editing page now.

10. Your results should look something like:

Page 18: Some Info About KiCad - Lafayette College · KICAD 7 V e r s i on C on tr ol Often, during large projects, it is a good idea to keep track of revisions and changes. Because KiCad

KICAD 18

A Note on Copper Fills A useful feature of many PCB layout tools like KiCad, which is sometimes missed by beginners, is the ability to fill a large area of the board with copper, and assign it to a specific net. We will avoid describing the feature in too much detail here, but we would like to recommend it as a tool for routing ground traces, which, if used properly, can significantly reduce the board’s development time and routing complexity. It is more than likely that doing this will invite discouragement from one of the project’s managers, who will suggest that such copper fills should only be used for boards operating at RF frequencies, or which need to dissipate a large amount of heat. While it is true that a copper fill is more useful in these cases, and not strictly required for many of the boards used in the car, there is nothing wrong with using copper fills to make routing easier, and such discouragement can be safely ignored.