How to design a test jig for your PCB

How to design a test jig for your PCB

The often overlooked test jig plays a crucial role in the manufacturing process. My standard practice has become to design a test jig if I believe a product will have sufficient volume or it will be difficult and time consuming to test manually. 

But what is a test jig? It's a mechanical/electronic apparatus that assesses your product at various levels, ensuring the PCB's functionality aligns with design specifications. This is particularly vital when selling PCBs. Testing each one individually can be time-consuming, especially if you need to hook up a lot components. If  this process takes around 20 minutes per PCB,  imagine a large batch of 1000 PCBs, it becomes a significant challenge, expense and liability. However, a well-designed test jig streamlines this process, reducing testing time to a fraction of manual tests.

Test jigs come in a variety of options, ranging from inexpensive DIY versions on platforms like Aliexpress to high-end automated solutions. However, designing an effective test jig is a complex task that requires expertise across multiple disciplines. To create a reliable jig, you'll need to design a PCB for a bed of nails, develop test code, design a mechanical fixture. 

Building a test jig

In this guide I will not give you some magic files that will give you a working test jig for your PCB, but I will share some knowledge on how to design your test jig and dodge some mistakes and save some money.

Here we have example test jig for our PAROL6 robotic arm mainboard!
As you can see for the first iteration of the jig you can be creative and see what works and what does not. Use 3D printer, wood, and on hand materials to see what works and what not. Later you can use more robust materials and design.

Examples will be our test jigs for the PAROL6 robotic arm mainboard and test jigs for the Spectral BLDC motor controller.

What test jig needs to have? 

bed of nails PCB - usually person that designed a PCB that is being tested will be best suited to design a bed of nails PCB. it is usually identical in size and has holes for nails instead of test pads on the same positions as a PCB we test. bed of nails PCB is used to make contact with your test points on the PCB that you want to test. There are multiple types of pogo pin nails but you will usually use 3 types: needle or crown type for test pads and cups for thru hole components.

- Clamp mechanism - Clamp mechanism will be used to apply pressure on your PCB so that bed of nails can make good contact with your PCB.

 

- Main body of the jig - usually you can buy these from aliexpress, build your own or buy expensive of the shelf solutions. Doing one yourself is the best route since you can customize it to your preferences but that requires and advanced knowledge of CAD design.

Main body of the jig will give it mechanical structure and on top of that you can fit all your wires, and functionalities you want to test inside.

- A computer or microcontroller that runs a testing software.

- Communication or interface devices (Like usb to serial, can adapters…) your pc will usually not have a can bus or uart so you will need either and adapter for that or use an raspberry pi that has some of these features on its gpio.

- Programming adapters (Stlinks for example)

- A display - not needed but good to have to make debugging and logging process more easier. if test is complex it is recommended to have a display for user interface or to print logs or errors.

- A printer of some kind - not needed but also recommended if you want to produce pass or no pass slips, diagnostics or automatic serial numbers.

- User interface (simple buttons, keyboard or mouse…)

Placing TEST POINTS on PCB we want to test

Designers often rush to include test points without careful consideration. To optimize testing efficiency, think modularly and focus on key testing points based on potential failure and key features that need to be tested. For example using a test point to measure current or detect voltage if LED is on or off is not really efficient. LEDS have low failure point and usually you will have bunch of them. Or they will be tied to something for example: if my step down is working my LED will work. So it is much more important to test that step down voltage that will be crucial for many more features than to test a single LED.  Emphasize straightforward tests; for instance, measuring current draw as the initial step for quick Go-No Go verdicts, prioritizing efficiency on the factory floor.


How to place test points:
-Space test points at least 2 mm apart
-Place test points on single side of PCB
-Test points should be at least 1mm diameter. (we usually use 2.5mm)
-Dont stack all test points on one side of board. 

FLASHING

In the current landscape, firmware is typically flashed onto processor-based products directly on the factory floor, integrated into the PCBA. The conventional practice of programming chips independently and then soldering them onto the PCB is now less common. It's crucial to offer a straightforward programming interface on the PCB that is both user-friendly and seamlessly integrates into a test jig. I usually provide 2 solutions one with test points that can be flashed with bed of nails and second one for manual flashing using small holes for pin headers.

WHAT FIRMWARE TO LOAD?

Testing Firmware presents two approaches. One involves loading firmware specifically designed for testing; if the unit passes all tests, the actual firmware is then loaded. The alternative is embedding test routines directly into your firmware, which can be executed by the test jig. The latter approach has two distinct advantages. First, it ensures that no unit leaves the floor with the wrong firmware loaded, acting as an additional fail-safe. Second, incorporating test routines into the firmware contributes to comprehensive firmware testing. Functions our test jigs use can also be used by users so it serves dual purpose. Communication between the PCBA and the jig can be through JTAG, UART or CAN (whatever you have on hand and are comfortable with)

 Test jig examples

Usually, there are a few levels of testing you might want to perform. Testing all the operational functionality of each aspect of your PCB or  testing in more detail by additionally measuring voltages, resistances, and so on. For example, we can measure the resistance of our sense resistors on the BLDC driver and measure the voltages of the phases by placing pogo pins on them and adding complex op amps and circuits. Alternatively, we can simply spin the motor and see if it operates correctly. If it does, we can infer that aspects like phase voltage, sense resistors, drive IC, and more are functioning properly. However, if the motor doesn't spin, we lack precise knowledge of where the problem lies compared to if we measured every single thing.

Let's take two of our jigs as examples. First, we need to flash firmware. We use JTAG pins. This is the Spectral BLDC driver used to drive BLDC motors for robot actuators. What is most important here? We need to test the full FOC algorithm, which, to function properly, needs to measure phase current and rotor angle. We also need to test communication interfaces like CAN and UART. To test the FOC functionality, we have three phases of the motor located in the test jig on the bed of nails. On top of that, the motor has a shaft that passes through the bed of nails PCB, allowing the magnetic encoder on the bottom of the PCB to detect rotor angle. This setup enables us to fully test FOC. For communication, we have CAN pins and UART pins. Using those, we can test other features like EEPROM, VBUS measurement, etc. We let the PCB perform those measurements indirectly and report back the status with UART, as we don't need to have a bunch of bed of nail points to test each one individually.

The next example is much more complex. This PCB is used as a robotic arm motherboard, driving six stepper motors and handling six limit sensors, digital inputs/outputs, CAN bus UART, flash memory, power management circuits, and emergency stops. PCB is used in PAROL6 robotic arm.

Here, we could have taken two routes. Like in the previous example, we could automatically detect if motors are spinning, toggle limit sensors and digital inputs using FETs, and measure voltage levels on digital outputs to detect toggling. However, this would require an extremely complicated PCB that is already complex without that functionality. Instead, we decided to go the manual route, where motors are connected via pogo pins on the PCB, and we can visually inspect if they are spinning. Limits are tested by manually toggling them, and outputs are indicated by basic LEDs. All this information is transmitted via UART and CAN, confirming their functionality. This method also allows us to check if the PCB is measuring correct voltages, if the flash IC is working, and if SPI communication to each motor driver is correct.

 

 

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.