Example footprint Molex Picoblade (From suggested footprint in the datasheet)
To illustrate the points above lets look at an example. We will be making a footprint for the molex picoblade connector 53398-0671. Molex supplies dimensioned drawings with a suggested land pattern.
Getting the necessary dimensions from the datasheet (dimensioned drawing)
The black dimensions are the ones already present in the original drawing. The blue ones are also from the same document but they come from a different drawing.
In red are the things we need to calculate in order to make the footprint. (As we can only enter the center position and sizes of pads.)
To make it easy for us we placed the center such that it aligns in the y direction with the center of the mounting pads.
However this part defines a center for the pick and place machine. (For our part the drawing is on page 4)
This of course makes it a lot more complicated as we then need to do more calculations. (In fact even the calculation of the center position relative to the body outline is quite involved and not shown here.)
For the remaining tutorial we will use the easier drawing as our reference. (Just be aware that this would make live harder if you want to use this footprint for programming a pick and place machine.)
Preparing the footprint editor for creating the footprint
For following this tutorial create a new empty project. Open the footprint editor and create a new footprint library (file->new library) and add it to the project library table. (I suggest to call it tutorial and save it inside the project directory.) More details about how to make a footprint library
You should now be able to find your library in the treeview (scroll down till you find it. You can also use the search field to filter for its name.) Right click on it and select “new footprint” in the context menu. As name for that footprint i would suggest something like “Molex_PicoBlade_53398-0671
”.
The result should look like this.
Adding the mounting pads using the user grid.
To showcase how the user grid can be used for creating footprints we will use that to add the mounting pads.
First we setup the user grid such that grid points are where our two mounting pads should later be. Open the user grid definition from the view menu (In kicad 4 it is found in the Dimensions menu)
Set the x spacing to 5.675mm. (We calculated 5.675mm for xm.)
The y spacing is not critical right now but to reduce the possibility of an error we set it to some large value. (5mm should do the trick.)
Now place the first pad for the mounting pins. Open the pad properties dialog (Press e while hovering above the pad. Also reachable via the right click menu -> preferences)
Set the pad to SMD, rectangular, x size = 2.1mm and y size = 3mm
We give the mounting pads the pin number “MP”. We do that such that it is compatible with the symbols of the official library. (There are symbols that allow connecting the mounting pad from the schematic.) Alternatively you can leave the pin number for the mounting pins empty. That will mean you can not connect them from the schematic. (Depends on your needs.)
The pad settings should look like this:
Now we duplicate the mounting pin. Start the operation with [crtl+d or right click -> duplicate] move the mouse to the right and left-click to place the second mounting pad.
The resulting footprint should now look like this. (I set the grid to be viewed as lines to make it easier to see in the screenshot.)
Adding the “normal” connection pads
We now add the remaining pads to the footprint. To showcase the grid workflow a bit more we will use it again. In a second footprint we will show how the same can be done using the array function of the modern (open gl) canvas.
Now we setup the grid center to be at y=-2.75mm (the y axis increases towards the bottom of the screen. We want to place the pads 2.75mm above the mounting pads so we need to enter a negative value.)
To reduce the possibility for errors we also set the x grid origin to -3.75mm (The origin is then at the position of pad 1)
The grid spacing in x direction is now set to the pin pitch (1.25mm)
Now place the leftmost pad. (At the grid origin = White circled cross mark.) Again edit the pad properties and set the size for the pad as shown in the dimensioned drawing. (Reminder: 0.8x1.3mm) The pin number should already be equal to 1.
Now reactivate the pad placement tool and place 5 more pads using the grid points. Notice that kicad automatically increases the pad number.
The footprint should now look like this:
The most important parts of the footprint are now done. Everything else is mainly for documentation, quality control, …
Adding the part outline on the fab layer, silk layer and courtyard layer
Read this FAQ article to learn what layer is used for what purpose
What should be on these layers can be taken from the kicad library convention. At least a part outline on the fab and silk layer plus pin 1 markers and a simple rectangle defining the courtyard area should be present for a well defined footprint.
Silk and Fab outlines
We will keep using the user grid. The outlines on silk and fab are not critical to the function of the part. It still makes sense to create them as exact as possible. (Some datasheets are missing critical information to define the details of the part outline. In such cases either a physical part can be measured, maybe a 3d model exists that can be used as a reference or one needs to approximate the outline.)
As the molex drawing includes all necessary measurements we can make an exact outline. (Deriving the measurements will be left to the reader as we already detailed that for the pads.)
Lets draw the main body outline together. Try to calculate the grid settings your self and compare them to my results: origin=(x=-4,625mm, y=-2.6mm), size=(x=9.25mm, y=3.7mm)
Set the fabrication layer as the active drawing layer. (Left-click on the F.Fab layer name in the right toolbar. The blue triangle should now point to the F.Fab layer.)
Select the line tool (right toolbar) and left-click on the grid origin. Move the mouse to the next grid point (example to the right) and click again. Repeat this for the remaining 3 lines to get a closed rectangle. Use the ESC key or double-click to end the tool.
The line thickness can be changed using the properties menu of said line. (shortcut e) Sadly there is no way to change multiple lines at once. Setting the default thickness is done in the properties dialog of any line. (The fastest workflow i know of is creating the first line, setting the default thickness and then draw the rest.)
After the main rectangle is drawn the body should look like this.
We can now repeat this process to draw small rectangles around the parts holding the mounting pins. and the body outline is done.
For the silk outline it is enough to set the grid to some small value (example 0.05mm) and just draw it such that it is fully outside the F.Fab outline.
To get it symmetric we first reset the grid origin back to 0,0.
If this is too imprecise for your liking you can continue walking around using the grid and grid origin.
One important thing to note is that it makes sense to avoid putting silk over the area that will be free of mask. So keep a small clearance to pads. (The clearance depends on the manufacturer used. For committing to the official library look at the KLC.)
After adding the silk outline plus a pin 1 marker on both the silk and fab layer the footprint could look something like this. (Note that you can also use other types of pin 1 markers. There are industry standards that give suggestions.)
Courtyard outline
The courtyard outline defines the area where no other part should be placed. It is principally up to the designer to decide how large this area should be. Again the KLC can give beginners some guidance. Another point of reference are industry standards.
KiCad 5 is now able to check for courtyard violations. For this to work the courtyard outline must be a closed polygon (Each segment end point must be with 0.01mm of the next segments start point.)
As this is a footprint for a connector and i use the KLC as my guide, i create the courtyard with 0.5mm clearance all around. (In this case relative to the pads as they protrude the body in all directions.)
In the end the resulting footprint could look like this:
Improving the resulting footprint
If you compare the footprint we created with the one found in the official library you will notice that the one in the library is a lot more complex. The fab outline is a lot more detailed and the silk outline follows it much closer. It should be noted that the footprint found in the official lib is script generated.
Another improvement would be to use the pick and place center point as the footprints origin. And the courtyard outline could follow the outline more closely.