Tutorial: How to check footprint correctness? (Pre Version 6 nightlies)

This article is made by use of a nightly build! It is expected that later nightly builds and by extension the stable version 6 are similar to how it is described in this article but there can be small differences.

The nightly build used for this tutorial is from May 22 2021 with git hash be436ec.

Introduction

This tutorial will first give a general introduction followed by two different workflows of how to use KiCad to check if a footprint fits your component.

What to Check?

The first and most important part to check is if the pads are at the correct place and have the correct size for your personal requirements.
You will most likely also want to check if graphical layers follow your personal rules and therefore fit into your project.
And of course you might want to ensure any metadata is correct (most likely the footprint description).
Of general help especially for enforcing a consistent look and feel can be verification scripts like the one developed for checking contributions to the official library. Feel free to adapt it to your personal needs.

What Should be Dimensioned

Dimension the footprint as closely as possible to how your reference drawing is made. That way you do not need to make too many calculations which reduces sources for errors.

Where to get Reference Measurements

To check a footprint you will need to use the dimensions given in the datasheet. These drawings are typically found near the end of datasheets. However, they can be anywhere, including in separate documents.

Pad Sizes and Positions

If you are lucky then there might even be a suggested footprint to be found in the datasheet. This is definitely a good starting point. However, keep in mind that you might want to choose to have differently sized pads to better fit your production process. For example, you might want to increase pad sizes if you will hand solder your PCB.

You might also opt to use an industry standard like IPC-7351B to calculate a footprint better fitting your production parameters than the one suggested in the datasheet. This can also be used if the datasheet gives no suggestion for a footprint. More details on that can be found in the how to make a footprint tutorial.

In any case you will want to have some drawing that constrains the position and size of all pads. In this tutorial we will use the suggested footprint as given in the datasheet.

Graphical Outlines and Courtyard

You will want to have some outline to indicate the body size on for example the Fab and Silk layers. As these are not mission critical, you have a lot more freedoms. You might however find that it helps to have the nominal body size on some layer as it is often used as a reference to constrain pads. The official library requires the nominal body outline to be on the Fab layer (and this must be exact).

As shown in the next section, you might not directly find the nominal dimension in the datasheet. It could be that you need to calculate it from the minimum and maximum values. (Assuming you care about the exact outline. You can of course decide that it just needs to be close enough for your personal needs.)

The courtyard outline is intended to help ensure that you have enough space for tooling. This should take into account any tooling needed for populating the board, for soldering it and potentially to rework the board. It is up to you to decide what clearances to use (and therefore how to check that a given footprint fits your needs). The official lib specifies component specific rules see https://klc.kicad.org/footprint/f5/f5.3/

How to read dimensioned drawings?

Reading dimensioned drawings is a skill that needs a bit of knowledge. There are a lot of differing standards how such drawings should look like. And some organizations do not even follow an official standard. So it will need a bit of common sense to be able to read datasheets.

In this section a short basic introduction into reading drawings is made. For more details refer to either a standards book or a tutorial for mechanical engineering. A few examples are

Be aware that datasheets are sometimes so badly made that it is basically impossible to tell what the designer wants to specify. In such cases one might need to contact the manufacturer or buy a part and measure the dimensions that are left unclear (the latter might not be an option for somebody producing at large scales as tolerance ranges can not be determined this way, while the former might be an unfruitful exercise for somebody working with low production volumes as one might be ignored by the manufacturers customer support).

The Dimension Object

A dimension consists of the size specification, a line parallel to the measured direction with some end markers (typically arrows) and potentially helper lines orthogonal to the measured direction connecting the measurement to the object feature.

This is best shown with examples. Note that these examples do not conform to any standard! (The arrow shapes are wrong). Nor are the drawings to any scale.

basic_dimension
Simple example to introduce the dimension object.

horizontal_dimension
The measurement line specifies the direction of measurement. Both of these dimensions are therefore communicating the horizontal size of the object.

aligned_dimension
Dimensions can be aligned to any direction. The left dimension specifies that this slanted line is 12 long while the right gives the vertical dimension as 5.

short_dimension
The arrows as well as the size specifier can be moved outside the helper lines for short dimensions. In this case the horizontal dimension of this rectangle is specified as having size 1.

Tolerance Specification for Dimensions

The dimensions will typically not be given as a single number but with a tolerance range. These ranges can be specified as follows:

  • Nominal value plus symmetrical tolerance range. This is typically written with the syntax “nominal value” ± “tolerance”. (the separator can also be written as +/- or ∓depending on what tool was used to create the drawing)
  • Nominal value plus asymmetrical tolerance range. This is typically written with positive and negative tolerances prefixed with their sign and placed on top of each other after the nominal value (in smaller font). But there are also datasheets that place the tolerances just one after the other.
  • Minimum and maximum value. This is often used for tabular communication but can also be done in the drawing directly. For the latter it is common that the maximum value is placed above the minimum value with a horizontal line between them. But they can also be on the same line separated with some character (I have seen “…”, “-”, “/” in different datasheets)
  • Minimum and maximum plus nominal. Similar to only minimum plus maximum but with nominal added (basically the same syntax used with nominal sandwiched between the other two).
  • Tolerances drawing global In some drawing styles the tolerances are not added to single measurements but are defined global to the drawing itself. Either via a single note that binds the tolerance to the significant digits or by giving some indicator pointing to a tabular tolerance specification.

Unit Specification

Both the imperial and metric system are in use for dimensioned drawings within datasheets. It depends heavily on the organization creating the datasheet which measurement system is used in the drawing or if both of them are given. In all cases this is always specified somewhere within the drawing itself.

Datasheets for Multiple Components

Some datasheets define dimensions for a full series of components. A typical example is the datasheet for connectors available for many pin counts. In such documents, dimensions that differ between the described parts are typically marked with a letter in the drawing and specified in a table. An alternative is that a specific dimension is given as an equation (example (pincount - 1) * pin pitch to describe the distance between the outermost pins)

The Example Component for this Tutorial Series

In this tutorial we will be checking the following footprint for correctness (it can be found in the official library since version 5).
Molex_Micro-Fit_3.0_43045-1215_2x06_P3.00mm_Vertical.kicad_mod (5.2 KB)
For convenience here a simplified drawing from the datasheet (removed unnecessary stuff to reduce clutter for this tutorial) with highlighted dimensions.

2 Likes

Checking a Footprint for correctness in KiCad within the Footprint Editor

An easy option to quickly verify a footprint is to use the Measure Tool found in the Inspect menu (or in the right toolbar and via the default hotkey Ctrl+Shift+M).
This tool allows to verify any given dimension of the footprint without the need to make a full dimensioned drawing of it.

Utilizing snap to Objects

Snap Options

Any tool in KiCad can either snap to the grid or a point of interest for objects. The snap type is communicated via the crosshair graphics. If it snapped to a point of interest than it will have a circle if it snaps to the grid then this circle is missing.

It is also possible to offset the snap in horizontal and vertical direction such that it lies on a grid “line”. In that case the circle stays at the point of interest and a thin dashed line indicates the offsetting with the normal cursor cross indicating the active point generated for the tool in use.

Grid
A cross indicates “snap to grid”

point of interest
Circle plus cross indicates snap to point of interest and active point is the snap point.

offset
An offset snap arrangement. The circle with the snall cross shows the reference point, the dotted line the offset direction and the larger cross the active point for the tool.

Avoid Snapping to the Grid

For measuring footprint features we are generally not interested in snap to the grid as we want to measure the footprints features. There is however no way to globally turn it off like one might be used to from tools like librecad. The only option available is to temporarily disable it by holding down the alt key (on platforms that allow its use). Or a potentially better option is to just increase the grid spacing to make it less likely that a grid point is near any point of interest.

Ensure Snap to Objects is Active

Snap to objects like lines and pads can be turned off in the editor properties. This setting is found in Preferences -> Preferences -> Footprint Editor -> Editing Options. Within that settings page there are two tick-boxes for magnetic pads and magnetic graphics. Ensure both of them are turned on.

Taking Measurements

The measurement tool is found in the inspect menu or in the right toolbar. It can also be activated with the hotkey Ctrl+Shift+M (default value).

If active, one can add a dynamic ruler between two snap points. This ruler gives a general scale along its length but more importantly the full length to the current end point plus the vertical and horizontal component of this measurement.

A second click at the endpoint will temporarily fix the ruler in place, but there is no way to have more than one ruler active at once (the next tool action will clear the ruler).


The measure tool used to check the body outline on the fab layer. By checking across the diagonal it is possible to check both the length and width of the body in one go.

Changing the Unit

The measurement unit can be set via View -> Units -> [mm/mil/inch]. These options can also be changed in the left toolbar.

The unit can even be changed while a ruler is placed.

2 Likes

Creating a Dimensioned Drawing of a Footprint (in pcbnew)

While the inspection tools of the footprint editor are definitely enough for a quick check, they do not allow documenting any findings for later reference. In this section we will therefore look at the workflow used to document the verification of contributions to the official library.

Sadly the footprint editor does not have any tool that can fulfil this requirement as the inspection tool can always only show one dimension at a time. This is where the dimension tools of pcbnew come in handy.

The Goal

The workflow described in this section of the tutorial will end in a fully dimensioned drawing of all relevant features as present in the footprint to be verified. Wrong measurements will be clearly identifiable. Effort is made to make the process as fast and flexible as possible (to achieve this a bit of one time setup is required that allows future work to be more efficient).

Making the Dimensioned Drawing

In this section we will create a dimensioned drawing for the footprint given in the introduction.

Add Footprint to Pcbnew

The first step is to add this footprint to your project (my suggestion would be to make a new project to follow this tutorial and add the supplied footprint to a project local library). See How to get a downloaded symbol, footprint or full library into KiCad version 5?

Then just open pcbnew and use the add footprint tool (found in the “Place” menu or in the right toolbar) to get the footprint into the layout. In the dialog that opens navigate to the footprint to be dimensioned and double click its name. You can of course use the filter field to make finding it easier. Just place the footprint anywhere on the canvas.


The footprint added to the canvas.

Adding a Dimension

Now the fun can start. First lets check if the inside to inside dimension for pads in y direction is correct. Select the Orthogonal Dimension tool from the Place menu or by using the button in the right toolbar (to get to the orthogonal dimension tool in the right toolbar you need to hold left click on it which will open its submenu where you can select other dimension options than the aligned one)

Select for example User1 as the active layer to place your dimension.

Assuming snapping to pads is turned on (see setup below) you can move your mouse near the top right corner of pad 12 and the cursor should snap to it. While snapped, do a single left-click and then move the mouse to the bottom right corner of pad 6. As soon as you are snapped to that corner do another left-click and then move the mouse towards the right until the dimension is at a place where you like it. Finalize the placement with another left click.

For additional details about snapping see the Utiilizing snap to Objects section above.

Edit Dimension settings

As you might notice this dimension has a very large font size. It also has more significant digits than we need and it includes the unit specifier. We can change all of this in the dimensions property dialog. Select the dimension object and use the hotkey e (or right-click -> properties).
In the dialog that opens reduce the text size, select “remove trailing zeros” and change the unit format such that the specifier is not shown.

In addition, you could also reduce the size of the arrows as well as reducing the line width.
Of course doing this for every dimension becomes tedious. So i suggest to setup defaults as suggested in the setup section below. The rest of the tutorial will assume you have set your defaults to a more sensible size.

Dimension pad sizes

Dimensioning the SMD pads uses the same process as dimensioning the distance between them. We again use the snap feature and make a dimension for the horizontal as well as vertical size of for example pad 1.

Dimensioning the size of the non plated through holes is a bit trickier. KiCad does not come with a tool for dimensioning diameters (see list of known restrictions below). But we can again use the snap to object tool as it allows snapping to 4 points around the circumference of a circular pad. I just choose the points on top and bottom and then place the dimension to the left of the pad.


Pad sizes dimensioned. Note that there is no diameter tool so the normal orthogonal tool is used to dimension the NPTH diameter.

Dimensioning Remaining Pad Positions

Now we just need to dimension the center to center dimension for the NPTHs as well as the distance between these to the SMD pads. And of course the pitch between SMD pads (and/or) the distance between the leftmost pad and rightmost pad.

For these dimensions the only new thing is to realize that one can snap to the center of every pad as well as to the center of every side for a rectangular pad.

Move Dimension Position

While making a dimensioned drawing you might realize that you left too little space to cleanly add a new dimension. Luckily, one can simply move a dimension out of the way. For that click onto it to select it which will bring up filled rectangles as interaction points similar to any other graphical object in KiCad. Hold the left mouse button while on top of the square near the arrow of the dimension object. Now you can change its position by moving the mouse around. Letting go of the mouse button will fix it at the new position.

Body Outline

For the body outline we will add dimensions for the x and y dimension as well as the body position relative to the NPTHs in y direction.
In this case we will use the fact that the dimension tool snaps to the endpoints of lines.

So snap to the bottom right corner of the body out line and create a dimension from there to the top right corner. Repeat the same with the distance between the bottom right corner and the NPTH. If necessary move other dimensions out of the way.

Change Layer to Indicate Issues

When making the dimension for the x dimension start with it on the User1 layer as we have done so far. You will however notice that it does represent dimension A from the datasheet without the additional lip of 0.1mm to both sides. This means that the body is too small in this direction. We will want to indicate this by using a different color and therefore a different layer.

However, of course we only know that after we already made the dimension. We can easily switch the layer after adding the dimension. It stays selected after it is placed so all that is needed is to use the hotkey “e” and then change the layer to User2 in the dialog that opens.

Of course one now notices that the default layer colors are less then ideal. Which is why i have my own color profile for doing reviews as shown in the setup section. With my colors profile selected the final resulting drawing looks as follows.

Setup

Activate Snapping to Pad Features

Snapping to pads as well as to graphical elements in pcbnew can also be turned off like in the footprint editor. It is found in the preferences dialog under the editing options for the pcb editor. In this case it is no longer just a tick-box but a drop down menu with 3 options. We want it set to “Always” for both graphics and pads.

Dimension Tool Setup

First we create a new project specifically for verifying footprints. In this project we setup defaults for the dimension tools that allow it to be used for dimensioning small objects like typical footprints (the normal defaults better fit the needs to dimension a full PCB).

This setup is done in the board properties dialog: File -> Board Setup -> Text & Graphics -> Defaults


The settings dialog as used by me for investigating typically sized footprints. For simplicity here my KiCad project file with this setup PR_invest_v6.kicad_pro (5.2 KB)


Alternative setting for larger components. And again the KiCad pro file I setup for my use pr_invest_v6_large_parts.kicad_pro (5.2 KB)

Layer Colors to Identify Correct, Wrong and Note

There is no option to change the color of an object in pcbnew. The color is controlled by the layer color. For this reason i setup the colors of the user layers to fit my needs. In Version 6 one can even have different color profiles for different tasks, so this does not need to be in the way of your normal workflow.

I personally chose a bright red to indicate mistakes, bright green for a correct measurement. In addition to that i also have violet and bright yellow for important remarks as well as a pale blue for helper lines and non-important notes.

I left the colors for layers appearing in footprints at their default to make it easier for contributors to understand what i dimensioned.

Here for simplicity again my color setup (User1=Correct, User2=Error, User8 and User9 for important notes, User6 and User7 for helper lines and additional notes) FootprintReview.json (6.9 KB)

Hotkeys for the Dimension Tool

Dimensioning footprints mostly uses the orthogonal dimension tool. However by default this tool does not come with a hotkey. You can add one via Preferences -> Preferences -> Hotkeys. In the filter field enter the word “dimension” and set a footprint fitting your needs. One option would be to remove the hotkey for the aligned dimension and use it for the orthogonal one.

Known Restrictions

The dimension tools as present in version 6 have certain restrictions.

2 Likes