Automated bed of nails plugin/ Automate deleting symbols based on designator

I have a few pcbs that have 50+ test points on the bottom of the board, and I would like to make a bed of nails fixture for each board. Ideally, I would only have to:

  1. Delete every symbol on the schematic and PCB that is not a test point.
  2. Change the footprint to a pogo pin footprint. (can use the “edit symbol fields” feature to do this in bulk)
  3. Connect all pogo pins to a header

I would like to follow this process since it will have all of the test points in the correct location, since I’m are starting with the board file that has the test points already placed, and their location should be maintained when running this script.

Is it possible to automate step 1? I have some experience using python to directly manipulate Kicad files but little experience writing actual plugins. I was not able to figure out a simple way to automate this with either method. Any recommendations for plugins or ways to parse the kicad files that could help automate this process?

I understand the issue.
What you forgot to mention, is that you very likely start with a copy of the original project to make your test fixture.

I am not aware of an automated step to delete most of the schematic (but leave the test points). You definitely want to preserve those, because if you generate new schematic symbols, the UUID’s which are the normal links between the schematic symbols and PCB are lost.

But is that a big problem?
Do your test points have special properties, apart from their location?

For example, if your test points just have a RefDes of “TP1” through “TP50”, then you can just annotate new schematic symbols in the schematic, and then use: Options: Re-link footprints to schematic symbols based on their reference designators

If this is good enough for you, then it is a quick fix.
If you also want to preserve other information about those test points then this method may not work.
There is a quite new function though: Pcbnew / Tools / Update Schematic from PCB I have not used this dialog myself yet, but apparently it can also put the values, footprints assignments and Net names back.

And how much time are you trying to save with some scripted approach?
It’s quite easy and quick to move the mouse with one hand, and hold a finger from the other hand on the delete key, and depress it when appropriate. You can mix between deleting blocks of stuff you dragged a box around to select it, or delete individual parts by hovering the mouse over them and then depress [Delete]. You can even keep the [Delete] key depressed constantly and let it repeat while moving the mouse around, and it will draw a path of emptiness through your schematic.

Slightly off-topic, but I’d just like to share my experience.
For most of my boards, I do have designed the bed of nails fixture.
Currently I do use the additional layers (User.Eco) to draw fixture details.
My Testpoint footprints do have additional features on the Eco layer, so it automatically appears on my Eco layer.
For the fixture maker, I just plot (DXF) these ECO layers that keeps all the needed information.

For schematic, just add the Test points (possibly in a separate sheet) and label their nets accordingly. Then you can also put a Header on the same sheet and list the connections. The header should have attribute set to not be exported to PCB. This way you have a sepearate sheet that contains all the information related to test bed wiring included in a common schematic, but which you can easily print separately.

I’ve never made a bed of nails yet.
I do think that it is a good idea to have a bunch of the PCB’s for the fixture manufactured, and then glue them together with some spacers and put the pogo pins (or their holders) through both of them. This way all the pogo pins are aligned vertically with minimal effort. PCB’s are cheap. The costs are mostly in the design of these things. Adding lots of the “spacer material” will make it a very stiff closed box construction. You could also order thicker PCB’s for this. Some manufacturers have 3.2mm thick PCB’s for minimal extra costs.

Thanks for the ideas Paul! I didn’t think of Re-linking based on reference designators. I did have the signal that was connected to the test point available in one of the fields of the test point, but I think It will be easy to make a script that will repopulate the values after the test points were deleted.
In addition, the test points are on the wrong side of the board, which really only effects the silkscreen in this case, but is slightly annoying. I ended up just making a test footprint that had the silkscreen on the “bottom” of the board, which solved the problem.
Either way, the procedure you showed gets me close enough to make a first batch of boards to test, which is very useful.

I don’t think you want to change the schematic at all. That could have negative ripple effects.

You really want a pcb derived from the original. That should be doable using a COPY of the pcb file. Just select and Delete.

Have you seen this project? It is a bit old but might be worth a look.

2 Likes

I do not like the form factor of the tinylabs text fixture much.
The rotating hinge makes pin placement less accurate and is also hard on the pins, as they’re pushed sideways during closing of the fixture.

Some time ago I accidentally bumped into “PCB test fixture jigs” from Aliexpress for small prices.

https://www.aliexpress.com/wholesale?catId=0&SearchText=pcb+test+fixture+jig

I’ve selected few examples, there are many similar offerings and I do not have any affiliation with any of those stores.

1 Like

I agree that the test frames that you have found mostly look better - especially that third one in plexiglass with the red handle as the pin application is normal to the board. The last one doesn’t look any better than the TinyLabs one though. The TinyLabs one looks fairly well supported in fact, and the bending moment, in practice, is probably not huge.

The clever thing about the TinyLabs project is the scripting to generate the pin co-ordinates in the fixture which addresses the op’s original question. However, I would probably use the final Ali-Express design as inspiration and consider making the fixture as two pcbs with a spacer between so you could solder the pins rather than futzing with hot glue.

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