Grids, Origins, Offsets, and Pitch

Hello, Forum:

I am new to KiCad, and have not used other versions of ‘schematic capture’ and ‘PCB layout’ software.
For the record, I am running KiCad 4.0.7 on a Win7 Pro, 64-bit platform.

KiCad has a ‘workflow’ that is (to the best of my knowledge) the same or very similar to other software of its type.

In each of the workflow steps, there are opportunities to set the Grid spacing via a dialog box. And, it appears that the Grid can be of different spacing (dimension) in each of the various Workflow steps (Eeschema, PCBNew) and in separate Editors (such as the Footprint Editor).

As someone who’s come to PCB-layout software (KiCad) from a 3D mechanical CAD background, my preconception is that grids are drawing tools that may or may not have (as a user preference) snap-to functionality.

In the realm of PC boards, a drawing tool such as a ‘grid’ would seem to be wholly un-related to the Pitch of the board being created, and the Pitch of the components to be laid out on it.

In the existing KiCad documentation, I have yet to find a simple summary discussion of the topic of grids, pitch and how changes to these values are (or are not) carried through from one step of the workflow to another step.

I can imagine that a Table would be one way to convey this information.

In a related Thread (tutorial on creating Solidworks 3d component models) and the Thread (Custom components) I had taken up the challenge of creating my own Solidworks 3d component file—correct dimensions to the manufacturer’s specs---- and saved this as a *.wrl file.

When I imported that *.wrl file into the Footprint for that same component (which I had downloaded from SnapEDA.com, & it is correctly scaled), I find that the *.wrl image is now 2.54x too large (i.e., the ratio of centimeters to the inch).

It’s been suggested that (Tutorial - solidworks to 3D VRML/wrl or STEP/stp component) The safest way to generate a valid wrl file is by using Freecad plus KiCad’s StepUp. (Meaning: export your model as *.STEP from Solidworks; import the *.STEP into Freecad; finally, export valid *.WRL files using StepUp).

Perhaps this is an example of an interaction / conflict of the Grid dimensions set in the different work-flow steps, and the Pitch settings and so forth. If anyone can elaborate on this topic, and nail it down, that’d be great. It’d be a good topic to insert into the Documentation of both V4 and V5

1 Like

In eeschema the whole drawing relies on the grid. Nothing in that software can snap to anything else then the grid. This means you need to make sure that you select the grid such that you can connect all pins of all symbols.

The suggestion is to keep the grid in both the library editor and eeschema permanently on the 50mil grid. That way you can be sure that everything works.


In pcb_new only traces snap to anything else then the grid. (They snap to the center of pads as well as to the grid. The center of pads takes precedence)

Every other thing is grid based. Meaning the position of footprints, the endpoints of graphical elements, the points of a zone, … all only snap to the currently selected grid.

1 Like

Rene:
Thanks again–that helps a lot. You note that

In pcb_new only traces snap to anything else then the grid. (They snap to the center of pads as well as to the grid. The center of pads takes precedence)

I can instantly understand that, if I am drawing traces manually in PCB_New that they’d snap to the grid. But what rules apply when you use FreeRouting and import the routing via a *.SES file? Are the grid settings ignored and over-ridden by the autorouting parameters?

Current grid doesn’t prevent placing things somewhere else than grid points. You can set the absolute coordinates of items in the Properties dialog. Grid is for WYSIWYG editing with mouse (and keyboard). I don’t know about FreeRouting, it necessarily must have some grid (the smallest distance between points, starting from some coordinate origin) but I don’t know how it can be set.

1 Like

Well freerouting will use its own settings :wink: It is after all a separate program.

So, am I to understand that the settings in Freerouting drive the *.SES file…which includes the absolute and/or relative locations of the traces…and that the traces derived from Freerouting ignore (over-ride) whatever the grid and pitch / width / clearance settings are in PCB_New?

The below is valid for the pcb file.

The grid has nothing to do with where something is placed. The file has a separate coordinate system that can not be changed by the user. It has its origin on the top left corner. The coordinates are always in mm nm (Thanks for the correction @Rerouter) .
The y axis increases towards the bottom of the screen and the x axis towards the right.

So the grid is only used for the drawing tools within kicad.


In eeschema it is similar but i think that one stores everything in inches instead of mm

Haha! So KiCad is a classic example of the use of the very popular Metrinch system!

Little bit off. Kicad pcb layout internally uses nanometers, this was chosen to reduce any rounding issues. And probably to allow foward development of silicon layout if a dev ever took interest

While drawing schematics it is very highly recommended to keep your grid at 50mill or 100mill.
Connectons between wires & components are determined by the coordinates of the endpoints and if they do not line up perfectly (For example by using a mm grid in EEschem) then you will get into trouble.

In the KLC (KiCad Library Convention) it is also stated that all pins of all symbols must fit on this 100mill grid.

1 Like

There are exceptions that can use 50mil grid. But it seems this is not really codified in the KLC.

Would anyone care to comment on how my Solidworks model for a component (exported as a *.wrl file), which was created with the correct component dimensions (in this case, 2 legs 0.200 inches apart), is incorrectly scaled when it is initially linked to the Footprint? Initially, it is 2.54 times too large, the ratio of cm per inch. This seems to be very strange behaviour and mildly annoying (as it requires yet another step of scaling the supposedly perfect proportions of the original)

Kicad assumes one wrl unit is one inch.
This is why freecad stepup scales the wrl file down by 1/2.54

The alternative to scaling the wrl file is to use the kicad internal scaling option (3d settings of the footprint)
But this is not a good solution as it will create problems once you also want to get a step model out of your project.

Oi. The road to Hades is paved with assumptions!
Thanks, Rene. Would you please provide a URL where I can find StepUP (and any associated documentation)?

Stepup is a addon for freecad. If you download freecad 0.17 you can install it from within the freecad addon manager.
More details can be found on this forum.
Two examples:

Given the soon-to-be-released V5, I suppose I should ask: will the routine of using StepUp still be relevant? or has this task been incorporated directly into V5?

Stepup is an extension to freecad. It has nothing (directly) to do with kicad. Most of the features provided by stepup will never be included in kicad. The only thing that will be included is to export boards as step files.

Rene: Thanks for that information, it is good to know that the effort to learn this part of the workflow will have lasting benefit.

I am not certain what you mean by “pitch”; for the moment I assume you mean pin spacing on parts.

One of the best pieces of advice I got on this forum is that the Land Pattern data should be thought of as a “serving suggestion”, and to use what works for you personally.

Second thing I can say is that the first thing one should do in PcbNew is to change the design rules to what the fabricator can actually create.

Third is to retain some form of sanity check between what is on the screen and the actual parts. One way to do this is to print the Footprint to scale and place the part on the print.

With these elements in place, there ends up being a “minimum” realistic (grid) spacing for “normal” designs. One should be able to determine fairly quickly how little clearance space they can get away with due to the design settings.

If one wants to reduce trace routing, likely in half, add a filled Zone and tie it to the GND net. If there is enough spacing, KiCad will build the filled Zone automagically and connect all the GNDs together (with the press of the hotkey “b”).

One is not required to place any parts on any particular grid, but I find it tends to reduce how often I have to move parts around.

Yes, Pitch is the regular spacing between repeated physical entities. See https://www.pad2pad.com/pcb-glossary.htm.

Given my perspective (mechanical CAD and mechanisms), and given that use of the term Pitch is already historically and firmly established in the PCB world, it would seem that using Pitch in reference to constraints on physical objects, and reserving the word Grid in reference to virtual-drawing (“layout”) tools, would avoid a lot of un-necessary confusion when having this sort of discussion (Any KiCad developers listening?).