← All case studiesIn-house R&D · lab

New firmware for our pick & place, and a placement error cut by a factor of five

Our lab started with a closed, imprecise desktop pick & place. We replaced its controller firmware to run it with OpenPnP and calibrated it nozzle by nozzle. It is still the machine we assemble prototypes on.

3D render of a pick-and-place controller board: STM32F4 microcontroller, stepper motor drivers and connectors for axes, vacuum, lights and feeders
0.194 → 0.036 mm
placement error, before and after calibration
0402
passives placed automatically
Architecture after the conversion
Assembly filesBOM and coordinates from CAD
OpenPnP on the PCjobs · fiducials · vision
USB camerastop and bottom
Controller firmwareSTM32F4 bare-metal · G-code over UART
Mechanicsaxes · Z cam · vacuum · feeders

Context

Our lab started with a desktop pick & place. The machine had closed firmware, could only be programmed from its touch screen and had no link to a PC. Every board had to be set up by hand, and the accuracy was not enough for the smallest passives.

The problem

Replacing the firmware of a working machine means touching motors, vacuum and cameras without any documentation from the manufacturer. A mistake can brick the machine or damage the head. And once reprogrammed, accuracy depends on calibration: a motion model off by a few hundredths of a millimetre is enough to move an 0402 off its pads.

Technical choices, and why

Backup first. We saved the original firmware and checked the memory protection before writing anything, so the conversion stayed reversible.

Bare-metal firmware that speaks G-code. We started from an open-source project for the STM32F4 controller and extended it. The machine receives G-code on the serial port that used to drive the display, and a PC running OpenPnP becomes its control panel: jobs come straight from the CAD files.

Cam-driven Z axis handled in firmware. The two nozzles share a single motor that turns a cam. The controller converts between linear height and rotation, so for OpenPnP the axis is an ordinary one.

New cameras and bottom vision. The original cameras processed images on board and could not be accessed. We replaced them with USB cameras: each part is photographed on the nozzle and corrected in position and rotation before it is placed.

Nozzle-by-nozzle calibration. The residual error was not random: the two nozzles shifted parts in opposite directions. We measured it at 12 angles, corrected each nozzle separately, and moved the camera focus to the placement height.

How we verified it

  • Placement error measured with the machine camera after each correction round, on real pads and parts.
  • Repeatability of the fiducial check on the board.
  • A verification pause after each alignment during tuning, with a re-measurement on the same part.

Result

The placement error went from 0.194 to 0.036 mm, below the camera resolution, with passives down to 0402. It is still the machine we assemble prototypes on: jobs start from the design files, with nothing set up by hand.

What we bring to your projects

Bare-metal firmware on STM32, motor and actuator control, serial protocols, and the method we used to find the error: measure, separate the causes and fix them one at a time.

Got a deadline?

Tell us about your project: within 48 hours you get a proposal with phases and dates. If needed, we sign an NDA before seeing your files.