Precisely positioning parts in pcbnew

This morning I was trying to precisely position a through-hole resistor between a transistor and the board edge. I was trying to move it down just 1.25 mm. I had some difficulties…

First, when moving the component vertically with my mouse after pressing m, the minimum distance that the resistor moved on the board was larger than how much I wanted to move it – 1.25 mm. I thought that by zooming in, that minimum distance would decrease, but it remained the same. Am I wrong to think that by zooming in or out, the minimum distance I can move a component should change ? I found this minimum distance to be 2.5 mm regardless of zoom level (by looking at the mouse X,Y coordinates at the bottom of the viewport).

How do I set this minimum increment to distance in pcbnew ?

Second, I tried positioning the resistor by clicking on it and then doing r to pop up the “Position relative” dialog box.

However, the y offset wouldn’t switch from inches to mm until I had closed kicad and then restarted it from the off state. Yes, I know there’s a button to switch units in this dialog box, but it didn’t work.

After restarting pcbnew, I retried. That allowed me to select mm, finally. Then I set the “Position relative” to 1.25 mm. But the resistor always moved up (into the transistor I was trying to place it under whether I entered -1.25 or 1.25, it always moved to the same place. Both times, I had set the anchor point to the bottom right of the transistor white box by moving the mouse there and clicking once.

Any ideas ?

KiCad snaps to grid. Set the wanted grid from the dropdown menu from the toolbar or from the context menu in the viewport. When you move an item with keyboard arrows it moves one grid point at a time.

In KiCad 5.0 Move Exactly dialog is better for moving certain amount, just use Current position as reference.

The measurement tool can also be of great value (inspect menu or shortcut crtl+shift+m)

If there is no fitting grid setting for you in the list then you can use the user grid. I explained its use as part of my footprint creation tutorial: Tutorial: How to make a footprint in KiCad 5.1.x (From scratch)? (pcb_new has the same interface)

kicad 5.0.2

Thank you, eelik. I had no idea there was snap-to-grid action going on in pcbnew. I reset the grid to 0.05 mm, and that enables good positioning of this resistor. I found the “Move Exactly…” option on the R-mouse-click menu. I verified that it works for all four quadrants wrt current position. BIG HELP! you are.

Thanks so much,

There is an undocumented feature that easily allows this type of movement.
First, ensure that mm (instead of in) is selected as the units.
Left mouse Click on the item to move and then depress the “e” key on the keyboard.
In the Y Position: box make it read “134.58 + 1.25”, then depress the “Enter” key or click “OK”.

Interestingly!!! I could not take a screen grab with the Snipping Tool showing the addition as the tool only allowed showing the final result. For example if “2” was the original number in the box, and “+2” was added, the tool would not show the text in the box that was actually “2 + 2”; instead the snipping tool shows the result of the equation in the box, which would be “4”.

ON EDIT: Note that KiCad does not care if there are spaces in the box. “2+2” works equally well as “2 + 2” and I only added the spaces in this post in an attempt at clarity.

That is probably quirk of wxwidgets and snipping tool interaction. The latter likely triggers refresh of the window under it and the text gets calculated into actual value.

1 Like

With linux screen grab tools you can tell it to take a screenshot after x seconds. I am sure there are tools for other operating systems that do the same.
Using such a tool one can capture things that would normally vanish when pressing the print screen shortcut. (One example is the one presented here. Other typical examples are right click context menus.)

1 Like

@Rene_Poschl The Windoze Snipping Tool is a very simple tool that works good enough most of the time. And, the results scale well when uploaded to this forum.

But, you are very likely correct that other tools may give better results. I just wasn’t ready to spend my time looking for another tool to learn.

Oh yeah, Sprig, that works great! Thank you for showing me that dialog box. Definitely a nice tool to keep in my kicad bag of tricks. Don’t have to pull out a calculator to do it that way. ( BTW, it worked when I appended +(2.5/2) to the y-coordinate and clicked OK button, but only if I did NOT put any spaces in it.) This dialog box also includes a way to place a component at a arbitrary angle that isn’t a multiple of 90deg. (I had been wondering about how to do that with copper traces.)

Does anybody know what
Sheet path:
means in this dialog box?

Thank you so much, Sprig.

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