Best way to align PCB-mount connectors to enclosure panel?

Hello, first time poster here.

I am designing a doohickey and have iteratively selected an enclosure based a few factors, importantly, the necessary PCB dimensions and max component height: https://www.hammfg.com/files/parts/pdf/1593VTBU.pdf

Per the datasheet, I created a vector drawing of the “Max recommended PCB Size” and imported this to KiCad as my board shape.

What I want to know is, are there best practices for aligning connectors on the PCB with the outer edge of the enclosure panels? This information isn’t directly available from the dimenson drawing. Based on my experience level, I’m not as proficient in KiCad as say, Illustrator or Inkscape in terms of dimension drawings. My approach was to use the center of the top-right PCB standoff hole as a reference point, measure the distance to the outer edge of the panel in Inkscape, and transpose that information to KiCad via the User Comments layer:

Then, I just eye-balled lining up the edges of the connectors with this tangent line. Eventually I’ll have to figure out the drill template for the panels. This isn’t the final version of the board; I haven’t even routed the traces yet. Just wanted to create a sketch to get a rough idea of how everything is laid out.

Is there a better way to do this? Thanks in advance!

Edit: simply by re-reading my post and looking at the datasheet again, I’m a little embarassed I didn’t find this much easier way of solving my problem :man_facepalming:

Hello and welcome @vanwerk

Start with the template.
It is much easier to layout the panel and drill holes in the box first.
When that is finalized, place all the socket footprints in appropriate positions on the PCB, then the other footprints, and finally the tracks.

There are several methods for exactly locating your footprints that are accessed through the holes in your enclosure.

  • Place the Grid Origin point and read the X & Y values
  • Use dx & dy.
  • Use Right Mouse Click “Selection” > Positioning Tools.

This Moving the Global Grid thread from just a few days ago will be of use to you.

If you have any questions on using any of these functions, please ask. :slightly_smiling_face:

1 Like

Thanks for the link jmk, I was not aware of these options for changing Grid Origin/Display Origin. This is helpful and will surely aid in precise placement of things!

My logic was because the PCB size and standoff hole locations are fixed, it would be better to start with finding where the components can reasonably fit, then figure out where the holes on the panel will end up. Does that make sense?

1 Like

If you can get the 3D CAD (step file) for the enclosure you could add it as a component to your PCB and check the alignment that way.

I have Solidworks so I would use that for such a task . . . after exporting the PCB as a step file. If you don’t have any 3D cad (you could try FreeCad) this approach with KiCad might give you enough functionality to check things out . . .

As your standoff holes are fixed, your method is better. @RaptorUK 's solution is best, IF you can get the enclosure 3D file.
Otherwise, make sure your standoff holes and the surrounding areas are large enough to allow a bit of “wriggle room” for assembly. :wink:

I understand that you are asking about positioning footprints in one dimension (toward panel front).

For all ‘mechanical’ components I have at F.Fab layer as precision drawing of real dimensions as I can. So by just aligning Fab drawings with line of panel edge I would get everything in line.

For example for USB-C socket I have also (at Fab) a fragment of plug to know where it gets wide. In my case I can’t align this socket with external case surface (case wall too thick) but I can see whether plug will not rest against the box with its plastic.

I put up a plugin for how I do this: GitHub - TheJigsApp/kicad-parts-placer-pcm: KiCAD Plugin for Automatic Parts Placement. Using something like this means its easier to change and check your design.
Getting the height right is always a bit of a trick with extrusions. Worth doing a couple laser cuts, 3d prints, or paper print outs with scissors before ordering anything!