Components not Aligning with Grid

I am trying to add a new component but have issues aligning pins to the grid. Each pin is 2.54mm apart from its neighbors. So I right-clicked in the design area and selected Grid-Select 2.54mm (100 mil). I can actually see the dots/grid changing as I change the grid. However, the pins I am trying to place do not snap to grid points. Instead they are all over the place. See the image below. I know it’s just a schematic but I would like the pins to be at an exact 2.54mm distance.

Maybe I got a bit closer understanding this. It appears that when I change the grid and I move existing components they don’t snap to the CURRENT grid. Instead, they seem to remember the grid they were created in and move related to that grid. So in order to have a distance of 2.54mm between each pin I had to delete all pins and recreate all pins but this time using a grid of 2.54mm when creating the pins.

1 Like

Yup, once an item is placed in eeschema or eeschema library editor you can only move them from current location with the current grid step.

To place the item precisely you can also edit the item properties and set x and y position values

This seems to be fixed in nightly.
There moving a component snaps it to the current grid.

1 Like

A snap grid is essential for a schematic capture tool. Your mouse can get you within 10-20 pixels of your desired location but you will never be able to hit the exact pixel that you want. So you set up a snap grid of 100 pixels and you can snap to the nearest grid point for an exact match.

This means that you must create your components with the pin hot spots all on the snap grid with the placement point that anchors your symbol in the schematic. If you don’t do this and have the symbol snap grid match the schematic then you will never be aligned and able to make your connection.

There are two ways to manage a snap grid. You can start with your world view and divide down by a constant to get your snap grid which is what kicad and most tools do. The other way starts with a snap grid and multiplies to get your world view.

If you do it the other way then you don’t have to muck around with alignment problems because it is impossible to create a misaligned component. Your graphics may change but all components use the same snap grid and that never changes.

John Eaton

1 Like

Actually, that only seems to work in my eschema. I realize now that I didn’t use the right terms as I am actually in the part library editor (I am trying to add an Arduino Nano board). There the coordinates of components like pins can’t be modified manually.

If I understand John E correctly, he suggests to select a snap grid small enough so all components can be placed accurately. So let’s say I need to place some components like pins 2.54mm apart but other components 1.27mm then I should use the 1.27mm snap grid and stick with it.

Sounds about right. 50 mill is kinda the recommended for schematic capture. I’ll occasionally go lower for labels but I’ll switch back. It does get more intuitive with use.

Actually my suggestion was to scrap your current system and redo it based on a snap grip rather than the world grid. But that would be a massive disruption and nobody would support doing that.

You could add a field to each symbol that contains the snap grid value for the symbols creation and if you tried to place it in an incompatible schematic then you could warn the user beforehand.

If you really wanted to get fancy you could divide all the symbols position data by its creation snap grid and then multiply by its targets snap grid value. The graphics would look a little weird but all the pins would be on grid.

John Eaton