Moving parts to an exact place is difficult

I want to put mounting hole exactly to certain place, for instance 3.5mm down and right from upper left corner of the PCB. I have checked grids and coordinates but I have not found an easy way to it. Substacting two large number is not easy.

Use a large grid e.g. 0.5mm to place your holes. When you have placed one, press the space bar to reset the coordinates shown in the bottom bar.

If you have a complex design, it may be easier to draw it in a constrained drawing program e.g. FreeCad and import a dxf file.

1 Like

Working on a coarse grid is indeed a relatively simple way to do exact placement, but there are other ways too.

For example, use Pcbnew / Place / Grid Origin and snap it to some graphical item (Pcbnew / Preferences / Preferences / Pcbnew / Magnetic Points / Snap to Graphical must be “on”) then select your mounting hole, depress the right mouse button and select Position Relative to… [Ctrl + R] from the popup menu. From that menu you can directly enter offsets from either the “Local Origin” “Grid Origin”. You can also enter simple math functions here, as in many other KiCad entry boxes:
image

(You can also add units, such as “200mil” when the units are currently set to mm for example).

Also, if you’ve set the grid origin to some “weird” value by snapping it to some graphics, then do remember to set it back to (0, 0) afterwards with Pcbnew / View / Grid Settings …

If you know what the coordinates of a corner are, you can also select your mounting hole, edit it’s properties and then directly enter some math in it’s “position” entry boxes:

1 Like

for v5.99 there are different ways to achieve this.
a) place the edge of the pcb at 0,0 coordinate system. After that you can directly enter the x,y-coordinates into the property-dialog of the mounting holes

b) place the mounting holes as a first step directly onto the board-edge (or some other reference-point). After that select the hole (or whatever) and use the “Move exactly”-function. This function is not available on the context-menu, but only through hotkey. (for experienced users). Look at preferences->hotkey for your setting of this function (type “exa” into the search-field of the preferences-dialog).

c) With hotkey “S” set the grid-origin to any reference-point (in your case the board-edge, may also be another hole or footprint), set grid-spacing to your wanted distance -> place hole/footprint. Don’t forget to reset grid-origin back to standard-value (hotkey “Z”)

d) there are certainly more ways

Getting better. I could place the hole where I wanted to.
About the dialog box, why isn’t it possible to always refer to some sensible location and the dialog box should show what is in use.

Mechanic designers often give exact places where holes and so on should/must be.
image

Can you elaborate:

What is a “sensible location” to you, and how should KiCad know what you consider a “sensible location” at any point in time?

2 Likes

If you place the auxiliary origin at the corner of your PCB (say bottom left) then the "use local origin " is about that new origin.

If I have stacking card this aux origin is some common datum

1 Like

A sensible location of origin is very close or on the board. A user should be able to choose where that location is.

What do you mean by auxiliary origin? In my previous Cad when I need to to have an exact distance between two points, I have put an origin to the first point and used part properties to shift part where it must be.

“If I have stacking card this aux origin is some common datum” exactly, like mounting holes and board to board connectors.

Already two “sensible locations” have been named in this thread. I mentioned the “grid origin” which you can (ab)-use as an origin point, and mf_ibfeew wrote that you can draw the whole PCB around the absolute origin of (0, 0).

Also note that the Position Relative To Reverence Item window has a few more buttons. With the Select Item you can point at any location to use as an origin (and it remembers that “origin” for the next mounting hole you want to place). In the screenshot below I did:

A. Click on the Select Item and then click on a line on Edge.Cuts to use it as a reference:
B. The dialog shows that the line is used as a reference during placement.
C. Enter offsets for X and Y.
D. Press [OK]
image

There is also an Use Local Origin button and thanks to eelik’s post below I now know that positions stuff relative to the last location where you pressed the [SpaceBar].

1 Like

Local Origin is the spacebar origin. If it doesn’t work it’s a bug.

2 Likes

As I didn’t found in KiCad (4.0.7 those time) the way to move absolute origin when I want it I decided to place my PCB around absolute origin. Many my PCBs are symmetrical (DIN-rail cases) so I place them to have absolute origin exactly in their middle.
I prefer to use absolute origin against auxiliary because I am able to manually write coordinates I need. At least it was such in 4.0.7 when I was starting with KiCad. I modified the frame definition to have only small cross at absolute 0,0 position. I tried to have completely empty frame, but then KiCad used some default. It was true for 4.0.7. As it works for me I didn’t checked if in 5.1.10 something works differently that would allow to easy use auxiliary origin.

“Local Origin is the spacebar origin. .” Does it stay that way?

“I decided to place my PCB around absolute origin.” that may well be a good way to handle this, if nothing else works.

At least in 5.99 “Local origin” is the name of that ad-hoc coordinate origin which is set with spacebar. It may be called by some other name or names in 5.1 but IIRC it should be consistently Local Origin in 5.99. If not, it’s a usability bug and should be reported. I don’t say anything about the documentation, though…

I see. I didn’t see anything about space key in menus and such. Perhaps it is in shortcuts, but I have not studied them.

Yes,
In Commad group Common: “Reset Local Coordinates ---- Space”.

Look at the status bar at the bottom of Pcbnew:

The X and Y values are absolute values of the cursor location, while the “local coordinates” dx and dy are reset to 0.0000 every time you press the spacebar.