Replicate Layout moving footprints off grid

Hello,

I have a board I’m designing with about 100 relays, each with their own resistor and LED. I have set this up using hierarchical sheets so I can do the layout once, and apply it broadly. The plugin works, however all of the components in the replicated layouts have been moved off of the grid. In order to fix them, I have to manually move each component and trace, which totally defeats the purpose of using this plugin.

I must be missing something simple, as I’m new to KiCad. I’m running version 5.1.10 on Windows.

Thanks!

It could help if we knew how the replicated parts are meant to be positioned. Can you give a screenshot? (As a new forum user you may not have privileges to attach images yet; reading several topics can raise your trust level.)

Are the anchor footprints arranged on the grid? If yes, the plugin should keep the same relative distance between other replicated positions, so if the reference layout which you first do manually has all footprints on the grid, the replicated layouts should have them so, too.

It’s of course possible there’s a bug somewhere, but to confirm that we would probably need an example project with which we can replicate (not sorry for the pun) the problem.

Here’s a screenshot of the reference layout. As you can see, the relay footprint’s anchor is on the grid (I assume that’s what the blue cross on the right hand side is). I start the plugin by clicking on that blue cross, then clicking the replicate layout button.


Here’s a screenshot of a replicated layout, as you can see, everything has been shifted off of the grid.

Welcome derianlebreton,

If all else fails, you can move all your symbols and wires together by placing them in a block, altering the grid to something finer, maybe even 1 mil. (View / Grid settings), then moving the block.

First draw a short wire on the 50 mil. grid as a reference to where the block needs to be moved.

Finally, don’t forget to change the grid back to 50 when you have finished moving.

EDIT:
Sorry, thought you were discussing the schematic, but much the same holds true for the PCB.
Also, once you have one group laid out correctly you can just block it then copy.

I made that relay footprint myself, as one did not exist. Maybe the anchor needs to be in the center? Would that matter for this plugin?

I think it shouldn’t matter. But how comes the other relay is now off-grid? Didn’t you first move those relays into their positions yourself? Do you mean that the positions of the relays were changed by the plugin? That shouldn’t happen if you select the first relay to be the anchor and then start the plugin. Every relay should stay where you put them, and only the other components should be moved.

If there actually is a bug, it may be about handling rotated anchor footprints.

The relay positions were indeed changed by the plugin. They were on the grid before.

I’ll try changing the relay footprint to center the anchor, and skipping the rotation first to see if that changes anything

I adjusted the footprint such that the anchor is in the center, and removed the rotation.

Unfortunately I still have the same problem. The relays are being moved off of the grid by the plugin.

Relay circuit I used to make the reference layout:

Sample relay that has been moved off-grid:

Well, I think I figured it out. It turns out that many of the relays were placed off of the grid to start with! The first few I looked at happened to align. I moved eight of them back onto the grid, ran the plugin, and everything worked.

Edit: Tried it again with 16 relays, it’s fine. My mistake, thanks for the help folks!

1 Like

BTW, don’t forget the flyback diode on your relay coil to save the signaling circuit from inductive kick.

I’m using relay drivers with built-in flyback diodes (ULN2803) that end up being in parallel with the relay coils, but thanks!

1 Like

Do you know that these diodes cause the relay contacts to move away from each other more slowly, which increases the risk of sparking at the contacts?

Yes, I am aware of that.