# Symmetric parts placement aid?

I’ve been working on a DMTD for many months now. It consists of two paths of identical circuitry, which performs best when traces are identical between the two paths. The original layout was very tedious, and even now, there are times when I spend more time with a calculator than I do putting things on the board. By symmetrical, I mean that if a board is 50 units in the X dimension and 25 units in the Y dimension, and I place a component at 3, 17 on the top layer, then I am going to place an identical component on the bottom layer at 3, 25-17. Or if I had built it to be symmetrical across the vertical axis, the two locations would be 3,17 on the top and 50-3, 17 on the bottom. When you’re dealing with 6 decimals of precision, it becomes very tedious and error-prone.

So, my question is whether there are any aids to doing this, or is it such a rare activity that it’s not worth developer effort.

Bob

Use replicate layout plugin.

1. Place and route the top layer
2. Replicate the layout also on top.
3. Flip the second circuit to bottom
4. Rotate and move the bottom circuit to its place
1 Like

The Flip function is available with any selection, either with the F shortcut key, or from the popup menu under the right mouse button.

It flips Top & Bottom of the current selection, and the Y movement is dependent on the cursor position. It looks like it uses the current cursor position as the horizontal mirror / flip axis.

If you use a very coarse grid (for example 10mm) during the flip, rotate & move functions, then you have a big chance that either your coordinates are very much off, or all the decimals match.

For block operations (on a selection) there is also a "Move exactly) function, in which you can type in numbers to move the whole block.

Pedro’s step two “Replicate the Layout” is done with the “Replicate Layout script”. This is a quite handy script that works with a basis of hierarchical sheets. Search this forum (and/or Github) for more info on this script and how to use it.

1 Like

Thank you both! Actually, when I was starting the project I saw a similar sort of effort where 4 identical tracks were laid, and I should have asked questions about how they did it. Ah, well.

Bob

What about associations? A copy deletes all the associations, so I’ll have to go through and manually name each part, right? And I guess I’d also have to delete the parts that I imported from the Netlist. Are there any other steps for doing this?

Bob

No, do not use copy. Use hierarchical sheets in schematic. Hierarchical sheets pointing to the same file are identical, each with its own references.
Hierarchical sheets are mandatory for the plugin replicate layout.

1 Like

You really should start with experimenting with the “Replicate Layout” script. I would not be surprised if it can also handle your mirrored version on the bottom of the PCB directly. And if it does not handle this properly, then maybe a request for a bug fix would be in order.

At the current time most extensions are a bit in a limbo. Usually there is not much motivation to change things for the (near the end of life KiCad V5, while most scripts need to be updated for the yet to be released KiCad V6.

2 Likes

The action plugin does not support the mirror/symetric replication by itself. It is not an easy problem to solve as not every design is sutable for mirroring. The ones containing only two pin footrpinta should all be sutable. But if the layout has e.g. SOT23 or SO8 footprint I doubd if it is suitable for mirror replication

As such some manual work will most likely be required. You might get away if you:

1. route the source layout
2. replicate the layout
3. save the layout as a copy
4. flip the layout
5. save the layout
6. by diffing the last saved layout and saved copy you can narrow down which tracks you should change the layer in .kicad_pcb file if you edit it as a text file. You’ll have to flip the footprints manually I think.

I think Bob doesn’t mean symmetric as mirrored on the same layer, but two layers with the same design, when you flip the pcb in your hand you see the same circuit. Otherwise it is not possible if it has components with more than two pins.

1 Like

I just place all my PCBs to have 0,0 coordinate in their middle. I modified the Pcbnew frame to contain only small cross at 0,0. I tried to define just empty frame but if there is nothing in the frame file the default frame is used.

1 Like

@pedro: “I think Bob doesn’t mean symmetric as mirrored on the same layer, but two layers with the same design, when you flip the pcb in your hand you see the same circuit.”

You are exactly correct. When I flip it on the horizontal axis, I see the same thing: parts placement, traces, component labels, everything.

@MitjaN: “The ones containing only two pin footrpinta should all be sutable. But if the layout has e.g. SOT23 or SO8 footprint I doubd if it is suitable for mirror replication”

Exactly the case for mirroring on the same side of the board. Components such as SOT23 and SOIC8 (opamps) cannot simply be relocated on the same surface in a flipped configuration. There are wiring issues that cause you to use vias all over the place. And with something with a noise floor somewhere between 2E-16 and 2E-17 seconds, you can’t have haphazard trace routing. I could have decided to just put two identical traces next to each other, but I didn’t feel that would be the correct solution. I also wanted to separate them as much as possible so that there wasn’t any crosstalk.

This is an implementation of David Allan’s DMTD for the GPS system. In the pdf I have, he discussed the problems of noise being introduced just from removing the top of the case to zero the opamps. In my implementation, I am using a very tiny case by comparison; only about 5" x 6.5". So I figured that it would be best if the components were on the opposite sides of the board. That has worked in the two versions I’ve made so far, but the next version has a small rotary switch attached vertically to the board, as well as having the LDOs being moved onto the board. I’m not ready to send it to the fab yet, but it’s close.

Bob

Then the Replicate layout plugin should work. You’ll just have to flip the replicated section afterwards. Currently the plugin does not support the destination layout to be flipped, so this step is manual. There is a plan to add support for this, but I’d advise against waiting as it is a quite low priority issue.

Piotr,

I’ve been thinking about this since you posted. It sounds like it would benefit my projects. But how do I relocate the red “sheet” so that 0,0 is at some place convenient inside it?

Bob

You can’t relocate sheet, but you can relocate your PCB so the top/left corner of a sheet is inside your PCB.
I don’t need red “sheet” so my idea was to modify it to contain nothing, but I found that I have to left there at least one element so I left small cross at 0,0. I’ve done it in times of 4.0.7. May be in V5 you can make it empty - I didn’t tried.

1 Like

Thanks for the idea! This is definitely an aggravation, and I can’t believe if only affects the two of us.

Bob

Not only us, but…
really the advantage of it is only that you can write coordinates manually without need to calculate anything.
If you don’t need to enter coordinates manually but place element with the mouse you can just look at dx,dy coordinates after previously set your origin with [Space].
In V6 (5.99 now) (as I have heard) you can position coordinate 0,0 whenever you want.

2 Likes

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