Electronic – How to move the center of a footprint in KiCAD

footprintkicad

I have a custom footprint in KiCAD format.

When I place the footprint on my PCB in the Pcbnew editor,
setting a coarse grid before I place it,
the footprint looks technically correct — it has the right number of pads, and each pad has the right shape and position relative to the silkscreen and other pads in that footprint. (The center of each pad is on a 1.27 mm grid relative to the other pads in this part).

But the pads on this particular footprint currently don't line up with the alignment grid that everything else on the board is lined up with.

Is there a way to edit the footprint to nudge everything in that footprint a certain amount in X and Y,
so that the footprint still looks the same,
but when I place the footprint on my PCB,
the pads line up with the alignment grid the way I expect?

I suppose I could, in the Pcbnew editor, edit the position of each copy of this footprint and change its position on the PCB by the "right amount" in the X and Y direction to get each pad to line up properly.
But then every time I use this footprint I have to manually edit the position of that part.

I'm pretty sure it would be better to edit the footprint in the footprint editor and individually select each piece of silkscreen and each pad, and then for each one, edit its position to the new position.
From then on, every time I use the improved footprint, the pads will naturally line up with the grid.

Is there some way I can somehow select everything in the footprint editor and move the whole thing over in one operation?

Best Answer

One of KiCad's most powerful, but also subtle (and potentially frustrating if you don't notice) features is it's grid and movement system.

When you move a part, which part of it is under the cursor and which thing you select is important. There are multiple possible anchors for any given footprint, and the one you move or place it by will always be aligned to the grid, so be sure to chose which anchor point you move it by wisely.

If you select the center of a footprint, then the center will be moved on the grid, and aligned to the grid. If your grid is 1.27mm, but your part is an 8 pin SOIC, then moving the footprint by the center crosshair (the transparent 'ghost' of the footprint will be locked under the cursor to indicate by which anchor you're moving it by), then because the center of a SOIC falls half way between the two inner pins, all pins will be 0.635mm off the main grid, but the center of the footprint will be properly aligned to the grid. As it should be.

If you want the center of the footprint to be off-alignment, but the pads to be aligned to the grid, simply select any one of the pads, or have your cursor over one of the pads when you hit M for move. The cursor will lock to that pad's center, and now THAT is the anchor point you're using. When you place it, the footprint will now be aligned to that anchor point, which in this case will put all the SOIC's pins in alignment with the 1.27mm grid, at the expense of the center of the footprint being off-alignment. Also as it should be.

You naturally can't do both with a grid size that coarse, though setting your grid to 0.635mm would also solve this. Though, sometimes there are times we want a coarse grid, and that's what makes KiCad's movement system so versatile!

Note: This anchor point selection system is universal. If you are doing rotation, especially finer grained rotation (45 degrees or 30 degrees for example, instead of 90), you'll notice that the axis of rotation is also always the anchor. So you can rotate a part around one of it's pins, or it's center.

It's also universal in the sense that it applies to one footprint or many footprints. If you select a block, any anchor point on any of the selected parts in a block can be used as the movement anchor, and entire groups of parts can likewise be rotated about an anchor as the axis.