PCB Editor - Realign components after moving them

I have discovered to my dismay that when I move multiple parts at the same time most of the parts do not realign with the grid. I know of the command in Schematic Editor to realign them but cannot find a similar tool in the PCB Editor. Is there one? I looked through the documentation and could not find anything. I am not a novice. I’ve been using KiCad since 6.0. The project I am working on now has over a 1000 components so this has been quite a challenge to realign them by hand. Any ideas? Look at the X/Y coordinates and you will see what I mean.

Andrew




I can see your footprint locations are not nice rounded numbers, but I can not see how it got to be that way.

When moving footprints, one thing to watch out for is what is used as the origin of the move. This can be either a pad or the footprint anchor point, and the point you grab it with is (usually) placed on the grid. Pitch between pads for passives is often not a “rounded” number, neither in metric, nor in mills, so if you align by a pad, then align by footprint anchor will be off-grid. Footprints can also snap to other objects such as track ends. (you will see a cross with circle if KiCad found a snap point).

Another problem is with making small moves. The “old location” is added as a snap point, and this makes it nearly impossible to move a footprint to the nearest grid point. I’ve complained a few times about this but this did not help. My workaround is to move a footprint a few gridpoints, and then move it back again.

An option is to always work on a relatively coarse grid, and combine that with some house rules. For example, “always put the top left pad of a footprint on a 10mil grid” Putting “pad 1” on grid does not help with aligning because footprints can be rotated in all directions (especially passives such as SMT resistors and capacitors).

It is also an option to just stop caring. The differences are too small to see with the naked eye, or even a regular stereo microscope such as used during soldering. SMT Pick & Place machines don’t care, and neither do the footprints themselves, nor the electrons flowing though the copper care.

It would seem nice to have an option to align footprints (and tracks?) to the grid in the PCB editor similar to the schematic editor, but what if this results in clearance violations?

There is also a thread about “silly numbers” going on at the moment:

Something that can help for your next project are the PCB Editor / Preferences / Preferences / PCB Editor / Grids / Grid Overrides. These can (should?) help to place footprints on a fixed grid, regardless of other grid settings. But again, the problem of pad locations of passives relative to the footprint anchor point.

In the end, a lot of text, but no real solution.

I didn’t noticed such problems with KiCad V5 but noticed them with later versions.
But together with them the right-click and positioning tools appeared.
It’s a good habit to use this when moving an entire selected block, I think.

In general, I think that the existence of selected block on a PCB without a reference point makes little sense. The reference point could be required every time a block is selected and problems with off grid footprints would disappear.

It’s exactly as I thought and pretty much what I figured. If the X is off I move a little left or right then back, the same with Y, just up and down, and then diagonally if both are messed up. My concern was with the Gerbers and how the factory would interpret them. I wasn’t sure if it might cause problems. Most of my projects have been small boards or blank prototype boards. This one has over 1000 parts. Thanks for the insight. I appreciate the help and honesty.

Andrew

One of the things I’ve tried to do to mitigate the issue is create my own footprints and place the achor point in the center and set the center point of the pads on 100mil centers. The pads for the caps and resistors are 200mil apart. The diodes are as well after I offset the pads. Any thoughts?

Distance between pads naturally varies with footprint pitch. Many QFN and BGA’s have a metric pitch, and many SMT passives are far to small to align all pads on a 100mil grid.

While typing my long post yesterday, I also looked into a recent project I did (but have not ordered yet). Rows of passives were visually aligned, but did not have coordinates matching any grid. I am not sure how this happened. I probably have changed grids a few times, may have changed the grid origin too. But I am also suspecting it has something to do with KiCad itself. In your examples the coordinates are too close to gridpoints to be accidents, but yet do not align with the grid, and I wonder how that can happen. What is the pad pitch in those diode footprints?

There is an open feature request for extra snap points in footprints. The main intention is for alignment of footprints such as some connector types that can be connected together for more pins. In that thread there is also the idea to add snap points to the courtyard, so courtyards can be snapped to get both alignment and “maximum density PCB’s”.

Found a V7 project… I had to replace some LEDs and I ran DRC. It is mostly about board edge clearance violations…

Some are actually true, but there are also those 0.299999999 vs 0.3 bugs among them.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.