KiCAD 7.07
I have seen people asking this same question but the answers don’t seem to make sense to me. If I have a part, for example this testpoint is off-grid (grid set to 1mm)
There is no context menu item to Align to Grid, I have heard people say you can “G” grab the part and “M” move it, then it will be on-grid, but this does not align to grid. I guess I am misunderstanding. Can someone answer for me: is there really no “align to grid” function in the layout editor?
Just wondering what I’m missing. I see this functionality exists in the schematic.
In the PCB Editor the G key does not work for footprint, but only for tracks. But just using the M key for Move should work. There is a nasty property in KiCad that is confusing. While the grid snapping is on (this can be turned off too!) the endpoint of a move will be on the grid, but it is not always clear what the start point of a move is. It can be the attachment point of a pad, or the reference point of the footprint. The nasty thing in KiCad is that it does not use the closest point to the mouse cursor, but it first maps the mouse pointer to the closest grid point, and then selects a point in the footprint that is closest to that gridpoint.
To experiment with this, take for example a small part (such as an 0805 resistor, and place one of it’s pads on a very coarse grid (for example 5mm). It is now difficult to put the other pad, or the footrint reference point on the grid, because KiCad has a very strong tendency to always use the pad that is already on grid as the reference.
If this bugs you too, then you can:
Select the footprint.
Right click and use Positioning Tools / Move with Reference from the popup menu.
Select a new reference as the origin of the move.
Move the part, the reference point will now be placed on grid.
Edit I am not sure if the above is your issue (your footprint apparently only has one pad, probably coinciding with the reference point of the footprint). The settings described by mf_ibfeew in his post are a more likely cause. But if the above is your issue, I have an open issue on gitlab for this behavior:
@paulvdh
Thank you. The motivation for writing my question was because these particular parts are intended to be landing pads for pogo-pins and I wanted them to be on the grid. I understand that they are somewhat special because they are single-pad components where the part origin (centroid) is the same as the pad origin. The action does seem a little arbitrary on multi-pad components so I appreciate your gitlab issue.
@mf_ibfeew
Thanks, once I set this option the mouse cursor does jump to the origin when I Move. This does solve my problem on an individual-component basis but I will look for a solution that allows selected components to be adjusted to align to grid.
That is not a special footprint property. It would be common for a lot of footprints that only have one pad. The only special thing here is that the issue I mentioned can not be the issue, because when there is only one selection point (coordinate), then you can not use the wrong one.
The Warp mouse to origin of moved object was apparently the issue here.
With this, do you mean to first select a bunch of footprints, and then align them all individually to the grid similar to the Align Elements to grid in the schematic editor? as mf_ibfeew already mentioned, there is no such function in the PCB Editor. It is probably also not very useful. When the Warp mouse to origin of moved object function is active. A move of a footprint will always result in it ending on the grid, and you always will have to move them for the initial placement.
I don’t know much about your use case, but maybe it’s more effective to just draw an array of footprints?
I have used Expedition and Altium extensively and it seems like the grid features are numerous compared to KiCAD (to be clear I am NOT complaining about KiCAD!) I think that having the ability to select a group of components and align them to the current grid would be a great feature. You can see how doing this per component would be a lot slower than selecting en masse and performing a single operation.
No, not really. I can see it work only if they are already closest to the grid point where you want them to be, but how do you get them there? If you have to move them individually from the initial import / group placement, then you might as well put them in their correct position the first time you move them.
I never used the pcb-action-tools plugin myself. Searching for “grid” in the Plugin and Content Manager also finds a Place Footprints plugin that may be interesting for you.
KiCad is still a very “young” program. It has been around for 32 years (Wikipedia Link ) but it is just in the last few years that KiCad has been both growing and maturing at an impressive rate. You can still “feel” this history in KiCad. KiCad has a lot of very nice or even advanced features, but there are still a bunch of area’s left in which it is a bit weak.
Are you aware of the Align / Distribute function from the popup menu (First make a selection, then right click). It can align a bunch of items (such as footprints) along a horizontal or vertical line, and if you first place the “outermost” footprints on the grid, it can distribute the others also on the grid, if you do some manual pitch calculation compared to the outermost two footprints beforehand. I never found this Align / Distribute very useful. I guess it would be more useful if you could enter a pitch, or align the footprints on grid points.
Well you redefined the problem statement, if they were placed on the grid already it wouldn’t really be a problem would it? When I place components from “Update PCB From Schematic” the parts get placed on arbitrary x/y locations:
My Grid was set to 1mm…
I remember trying out eeschema and pcbnew about 25 years ago… I am delighted at how fast KiCAD has progressed lately and become a real contender for the extremely expensive software I considered purchasing for my sole contractor work (I nearly bought Altium at one point).
In any case, thanks for the discussion and answers to my questions.
@MartinK : If you have some spare time I would recommend to get a gitlab account and look a little through the open gitlab issues (Issues · KiCad / KiCad Source Code / kicad · GitLab). Consider especially open issues with label==feature-request. And if you find interesting proposals give them a thumbs-up, so the developers get a little feedback to judge the weight of the individual issues.
Issue #14251 (Pack and Move footprints: improvement ideas (#14251) · Issues · KiCad / KiCad Source Code / kicad · GitLab) for instance would maybe help you (in your workflow).
You could also play a little bit with the context-menu–>Align/Distribute tools. If you place the first + last footprint on grid (and calculate correctly) then the distribute tool would place all intermediate footprints also on the grid.
Did you make this Test Point yourself, or modify an existing Test Point?
Your crosshairs are on grid but the pad is not. This generally means the footprint anchor was not set in the centre of the footprint.