This article is about a project I have started back in January 2018. As for many of my projects, it took longer than anticipated.But now it is working, and the result is looking very good: a DIY automated pick and place machine to place parts on circuit boards. In the age of cheap PCBs, that machine closes the gap for small series of boards which have to be populated in a time consuming way otherwise.
Outline
This DIY machine can populate circuit boards with SMD/SMT parts. If you are wondering, what this is: it is about putting Surface Mounted Devices (SMD) on a Printed Circuit Board (PCB). I gave a talk at the Embedded Computing Conference 2018 on this subject (ECC18 Styger – PickAndPlace mit OpenPnP).
The following videos give an overview about the current state of that machine:
The motivation of building such a machine is that at the university we are populating boards by hand:
Solder gets placed on the boards (stencils are rarely used):
Then parts get placed on the boards
We do have as well vision support for the manual placing:
And finally they run through a reflow oven:
That’s all working fine. The problem is that this all takes a lot of time. Doing it for one board is one thing, but doing it for 10-50 boards takes too much time. Clearly, for mor than 50 or 100 boards, outsourcing is the logical choice. But for a few boards as we usually have to do, outsourcing is not the best option as it is expensive and takes a lot of time too.
What I wanted is a machine to automate the manual placing of components. Such a machine is called a ‘Pick and Place’ machine: it picks parts and places them on a PCB.
DIY Pick & Place Maschine: OpenPnP
When searching for such Pick&Place machines, I stumbled over the OpenPnP project at http://openpnp.org/: A open source community and project which builds such machines. So I thought: why not building one myself too? And here we go :-).
OpenPnP offers a framework to run such a machine. They have guides and tutorials how to build such a machine. And it is up to you how you build it and what features get added. I did not want to build the fastest or the cheapest machine: my goal was to keep the hardware costs below $1000, and that the machine is able to place parts down to the 0402 size.
All the software and BOM are available on GitHub (see links section at the end of this article).
The machine uses 24V stepper motors for X, Y and Z axis. Two smaller stepper motors on the head (C1, C2) can be rotated. Attached to the head is a down-looking camera.
Integrated in the work area are nozzle changers, a bottom camera and different feeders.
Under the base plate all the other electronics (solenoid, pump, USB Hub, feeder and controller board with LCD and power supply.
CAD (KiCAD, Altium, Eagle) data is loaded on a host PC running OpenPnP.
Below are pictures of the machine under construction with some details. I hope this gives you ideas and an inspiration to build your own machine.
Microcontroller
The heart of the machine is the NXP LPC1769 on the Smoothieboard:
It is responsible for all the sensors and drives all the motors. The picture below shows first tests with a stepper motor:
Frame
The frame is constructed with 20×20 and 20×40 standard aluminum extrusion profiles:
The profiles allow an easy construction of the frame.
Rails
The linear rails arrived very well oiled and in good shape.
The rails get attached to the top of the frame:
It has been an iterative process, and many parts first have been built with a laser cutter and plywood. Below is a picture of an early version:
Vacuum Pump
Actuators in the system are 24V. Below is the diaphragm vacuum pump used for the nozzles:
Terminals of the pump:
The pump together with the two high-speed solenoid on a base plate. To reduce noise, the pump has been placed into a box standing on anti-vibration feet:
Below a first test with three stepper motors:
Power Supply
For the 24V 13.4A Power supply I added an on-off switch with integrated fuse holder:
Flyback Diodes
As flyback diodes for the pump and solenoids I used the Vishay BYV27-200-TAP:
Vacuum Valves
I’m using the STNC TM-06 high frequency valve (24VDC) with 1/8″ pipe connectors:
Below how they are connected to the board with the flyback diodes mounted to the connectors:
For example the M813 G-Gode turns it ON (2-1 connected), and M812 turns it OFF (2-3 connected). The image below shows the air flow:
That means the vacuum pump will be on connection 1 and the nozzle on connection 2, with connection 3 used to release the vacuum.
End Stops
The total of 6 end stops are optical ones:
The first (not ideal) way to mount the end stops:
Second version of end stop mounting with 3D printed holder:
3D printing end stop blades:
Mounted end stopper blade:
In a next step lowered the end stop position:
Pick and Place Head
Very first version of the head:
Holder for the pick stepper motor:
Rails for the pick head steppers:
Frame with first pick head:
Pick head with end stops:
Because the X axis was not rigid enough, 3D printed brackets were added:
X-Y-Rail
T-Nuts on X-Y Rail:
Y Steppers
Two stepper motors wired together are driving the Y axis. It works, but I would not recommend that approach: better use a single motor with an extended shaft and coupling.
Laser cutting the motor and pulley brackets:
Of course it was an iterative process, and many design ideas did not end up in the final machine. The good thing with plywood is that it is cheap and is easy to construct with it.
Second Pick Head Design
The second version of the pick head was more compact and easier to attach to the linear rail.
Below the head attached to the X axis:
Below an early version of the head with no cable chains attached:
I used 3D printed parts to attach the heads with the Z axis belt:
The belt is attached to the linear rails using a press-fit connection, and the connector acts as an end stop the same time:
Here with the rails, belt and endstop mounted:
Here the head with the pick heads:
Downlooking Camera
Below an early design of the downlooking camera integrated into the bottom of the head:
First down camera and light tests:
First Camara and LED ring holder:
A plexiglass with a sheet of whiter paper acts as diffuser:
Pick heads with downlooking camera:
Mounted head with first cable chains:
Metal Pick Head
The next iteration oft the pick&place had is a version built with aluminium profiles. The first step was to use aluminium profiles for the head mounts:
Then the head backplane has been built with aluminium profiles:
That way the head was more sturdy than the one made of plywood.
Below with the hollow shaft stepper motors mounted, plus a cable chain for the end stops, LED ring and camera USB cable on the left:
Nozzle Holder
Nozzle Holder, magnet holds the nozzle:
Improved nozzle holder with 1.5 mm space between the plates and acrylic on the top:
Cut Tape Holder
See 3D Printed SMT Cut Tape Holder for more details.
Feeder
The automatic feeder is designed by Simon Huber. The goal was to create a feeder for SMD parts on rolls.
The feeder uses 3D printed parts:
Each feeder uses a NXP K20DX128 (ARM Cortex-M4) as the controller:
One DC motor moves the tape and one DC motor peels the cover:
A tinyK20 (NXP K22FN512, ARM Cortex-M4) receives M-Codes from OpenPnP and passes them to all feeders:
The feeders are in a daisy chain, and the machine has space for up to 16 feeders.
Nozzles
The first nozzle stepper motors did not work well. The M5 screw did not match the stepper motor hollow shaft. The designed adapter had too much wobble and was not usable.
So I had to put aside the nice and small hollow shaft stepper motors. I ordered new (bigger) ones so I can easier attach the nozzle changes and a vacuum tube connector on the back. The new motors had on both sides an M5 screw so I can attach rotation tube adapters and attach easily the nozzle adapter.
Because the motors were bigger, I had to create new motor holders:
Cable Chains
The first cable chains were too small to hold all the tubing and cables, so a new one has been installed.Below the machine with the first (too tiny) cable chains:
Small cable chain attached to the head:
New cable chains arrived:
That larger (40×15 mm) was able to keep all the cables and tubing.
Below with the new chain attached to the head:
Base Plate
The bottom plate with cutouts for the feeders and the bottom camera:
It gets painted with three layers of magnetic paint:
Bottom Camera
Assembling the bottom camera enclosure:
Assembled bottom camera case:
Testing the camera:
Up camera mounted into base plate:
Bottom Vision
With the bottom camera, OpenPnP can move a part over the camera to correct angle and position with the vision system:
It uses a vision pipeline, below with a blur filter applied:
Masking:
getting the part outline:
Getting the contours:
Detecting part position and angle:
OpenPnP includes a loose part feeder: parts can be put into a bin and the vision system can identify it:
PCB Holder
As the top camera has rather small focus area, I need to keep the feeder pick (see “3D Printed SMT Cut Tape Holder“) height and the PCB surface on the same height. For this I have created 3D printed magnetic PCB board holders.
Graphic LCD
Similar as for my laser cutter (see “Upgrading a Laser Cutter with Cohesion3D Mini and LCD“) I added a graphics LCD to the board.
http://smoothieware.org/rrdglcdadapter describes the settings and installation of a graphics LCD on the Smoothieboard.
I decided to order an adapter board from 3DWare:
Below the bottom side of the board:
Below how the adapter board is installed on the board:
Below the display attached to the board and working :-):
Below the (still messy) electronic parts on a base plate:
Added to the display is an emergency stop button. Below the connection to the controller board:
OpenPnP Software
The OpenPnP software runs on the host PC.
The host PC does all the image processing and sends commands to the machine.
Drop Box
For bad parts or to drop parts, OpenPnP can use a dedicated ‘drop area’. for this I created a custom (laser cut) drop box: It uses 3mm red acrylic on the top:
4mm plywood on the bottom with magnets so it sticks to the machine surface:
Plexiglas Brackets
The motor and belt brackets originally were cut out of plywood: here I replaced the 4mm plywood with 5 mm laser-cut plexiglas ones which looks nicer :-):
The machine mounted on a 16mm plywood base plate:
Summary
It has been a fun project, and the machine works well, but still needs some tuning. I plan to add a solder paste dispenser: that way, if no stencil is available, the machine can add the solder paste to the pads on the board. Another thing is to use pressure sensors to monitor the vacuum for each nozzle. And for the motor auto-feeder I would like to update the design. So there is always something to improve. Currently the machine can place around 500-600 parts per hour down to 0402 size. With this and little setup, we can run small board series successfully.
PS: a big “thank you!” to the OpenPnP community: without all their work and contributions, such a project would not have been possible.
Happy Picking 🙂
Links
- Files of my machine on GitHub: https://github.com/ErichStyger/McuOpenPnP_Machine
- Presentation at the Embedded Computing Conference 2018: http://www.swisst.net/files/swisstnet/de/dokumente/ECC/ECC18/Referate/3C2_Styger_HSLU.PDF
- 3D Printed SMT Cut Tape Holder
- Smoothieboard hardware on GitHub: https://github.com/Smoothieware/Smoothieboard
- Smoothieboard configuration options: http://smoothieware.org/configuration-options
- Smoothieboard supported G and M codes: http://smoothieware.org/supported-g-codes
- Smoothieboard extruder: http://smoothieware.github.io/Webif-pack/documentation/web/html/extruder.html
- LinuxCNC G-Code List: http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#_g_code_quick_reference_table_a_id_quick_reference_table_a
- Reprap G-Code List: http://reprap.org/wiki/G-code
- STNC TM-06 24V valve: https://www.robotdigg.com/product/566/High-frequency-Solenoid-Valve-12-or-24VDC
- GLCD Adapter board: https://www.3dware.ch/Adapter-LCD-s-GLCD-f%C3%BCr-Smoothieboard-De.htm
Hello.
Thanks for the help, your tips have been very helpful.
Now almost everything works, but there is another problem.
I can’t customize Bottom Vision Pipeline,
details aligns but does not center.
How to be, help.
LikeLike
Are you part of the OpenPnP Google group/forum? That would be a good place to post this, as you can post images up there and others can help too.
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/openpnp
LikeLike
What should I do with screenshots and photos to explain? I can also upload videos and share my machine.xml
LikeLike
A picture can say more than one thousand words 🙂
LikeLike
Thank you Erich for your help and advice. Everything worked for me. Very good project, I am satisfied with my work. Thank you again. I add a video. youtu.be/BgPN-ml3-0g
LikeLike
That machine looks great, thanks for showing it in action!
LikeLike
great !!!
I didn’t study electronics but I am passionate about it, I want to do a project like you, can you tell me where to start? can you guide me
email: hauvan018@gmail.com
thank you very much!
LikeLike
Start at http://openpnp.org/, this site points to many articles and information.
Additionally make sure you don’t miss the information on https://groups.google.com/forum/#!forum/openpnp
LikeLike
Pingback: OpenPnP Solder Paste Dispensing Video | MCU on Eclipse
Pingback: Erich Styger Upgrades his OpenPnP Pick-and-Place Machine to Dispense Solder Paste - PC Solution
Pingback: DIY ‘Meta Clock’ with 24 Analog Clocks | MCU on Eclipse
Pingback: Copyright Law for Makers and Educators | MCU on Eclipse
Long time ago now that this machine was built, but I’ve seen your videos and read through this buildlog a couple of times, I’m starting to feel that.. I need a machine like this! 🙂 Really love your documentation here!
Anyhow I’m a little bit puzzled on the size of the machine. Of course, bigger is better as you can fit more feeders and features. But as I have “limited” space, I’m not going to interior decorate a whole room with the PnP machine. I’m trying to figure out a good size and thought that maybe I could ask what size you went for with this machine?
I’ve decided to go with same style of aluminium rails and those hiwin kind of linear guide rails. As far as I can tell the linear guide rails are as long as your aluminium rails, correct?
Hope to hear from you soon.
Thanks for sharing your build and experience Erich!
Best regards from Sweden
Christopher Fredriksson
LikeLike
Hi Christopher,
maybe have a look at the BOM available on https://github.com/ErichStyger/McuOpenPnP_Machine/tree/master/Hardware.
I have used mostly 50 cm rails/profiles, for multiple reasons: up to this size the shipment costs are reasonable. I agree that in general bigger is better, but I would not go beyond 60 cm.
The larger you get, the more inaccuracies you will get. I would say 50×50 cm is about ideal.
And I used 50 cm linear rails on top of the alu profiles.
LikeLike
Pingback: Retrofitting a Charmhigh CHM-T36VA Machine with OpenPnP | MCU on Eclipse
Hi, Are you using 4mm ID tubes for the vacuum pump? Do you have an image of how the pump is connected to the tubes? I have the same pump and it seems the inlet connector is about 6.4mm in diameter.
LikeLike
I’m away from the machine, so I cannot measure and tell for sure, but I think I have used the standard 4mm tubes.
LikeLike
Erich, I just wanted to take a minute to thank you for this excellent log of your project. I’m considering something similar, and your excellent documentation is a real help. Thank you so much for taking the time to put it all together and to answer so many questions!
LikeLike
Hi Malcom,
thank you, really appreciated.
And I very happy to hear that this projects helps so many to build their own machine.
Erich
LikeLike
Thanks for your reply Erich! I was an exchange student in Switzerland when I was in college! I still maintain good relations with my host family there though I haven’t been back in about 8 years.
I guess I do have a couple of questions for you.
What is your computer hardware running OpenPNP? There seems to be no consensus… I understand that separate USB hosts is a necessity for the cameras…
Why did you choose the Samsung nozzles over the more common Jukis?
My machine will have dual Y motors like yours. On my CNC I just ganged the two motors to the same driver. Is there as reason you used a separate driver for the Y motors? Just for more power?
Thank you for your time! -Malcolm
LikeLike
Hi Malcolm,
You definitely should come back for a re-visit then (after all that COVID-19).
I’m using a 5 year old DELL Laptop (quad core, 1.8 MHz) to run OpenPnP. The thing with the USB host is about the cameras and probabaly because of Windows (did not try on Linux): you will need two USB camera connections: and having them combined in a hub seems to create too much traffic and that won’t work. Usually notebooks have two or more USB units and then it works. Probably if you would use a USB3 active hub with a USB3 notebook that would help too.
The other hint I have (although not required) is to use different camera models: having the exact same camera for top and bottom makes it kind of try-and-error in the camera selection if the USB cable is moved to a differnt port.
I have chosen Samsung simply because it was easier for me to get an adapter for it to the motors.
I used separate drivers for the Y motors because of the needed power, you have that correctly found out. But I do *not* recommend (as noted in the article) to use such a combined-motor-thing: while this ‘works’ it requires more calibration and setup whenever the machine gets powered up, and mechanically it makes things much more complex: I highly recommend a single motor solution!
~Erich
LikeLike
Hey Erich!
I’m almost finished with my mechanical build and am currently fighting my way through the confusion of how to set up OpenPNP with a Smoothie board. It seems there are many different firmware/configuration file combinations out there! I’ve looked through your github and I didn’t see mention of which firmware and config file you’ve used in your Smoothie. Is this something you’d share? My machine is similar enough to yours that it would give me a place to start. Your build has been an excellent resource. Thank you! -Malcolm
LikeLike
Hi Malcolm,
You can find the configuration file here:
https://github.com/ErichStyger/McuOpenPnP_Machine/tree/master/Smoothieboard
I’m right now away from the machine, but if I’m right then I used the following fork: https://github.com/openpnp/Smoothieware
I hope this helps,
Erich
LikeLike
I find it a very interesting project that I intend to build shortly. I have two questions about the automatic feeders that you have developed and it is the following:
What is the maximum number of feeders that can be put in series connected to a master?
And.
Can you put more than one master in openpnp ?. How would it be configured?
Thank you
LikeLike
The number of possible feeders is only limited by available space. Realistically it is in the range of around 30.
And you can have any numbers of masters in OpenPnP: simply add a new subdriver for it.
LikeLike
Hi Erich, thanks for the write up of your PNP project. Very interesting.
I am in the middle of my PNP build and mine has a lot of similarities – Smoothieboard, OpenPNP, dual head and even the same Vac pump 😀. I have used a single Y motor.
I am trying to work out how to home the Z axes. I note you home Z to Min and use – 15 as the Min value. Where is your Z limit switch? Top, bottom or middle?
I am trying to home to the top (using hall effect sensor) but I haven’t worked out how to get it to move back to the Middle.
Did you ever add the paste dispenser? I was disappointed to learn that OpenPNP has dropped support for paste dispensers. 😢
Regards DG
LikeLike
Hi David,
thank you! Good that you have a single Y motor (this really was not that intelligent choice on my side. My Z limit switch is on the top, you can see the sensors on https://mcuoneclipse.files.wordpress.com/2018/03/pick-head-with-end-stops.png.
To go back to the middle you have to check the head Z transform function: I had to tweak it too and to do some trial and error.
Paste dispenser: yes, we did it, see https://mcuoneclipse.com/2019/08/15/openpnp-solder-dispenser-sneak-preview/ and https://mcuoneclipse.com/2019/11/26/openpnp-solder-paste-dispensing-video/.
It worked well (not excellent I have to say, the problem is with the temperature of the paste). We used an auger pump which is excellent, but still it is open loop. We wanted to add some close loop with vision, but then OpenPnP dropped the support. And my time is limited, otherwise I would have moved that one forward. So for the moment the past dispensing is on hold.
BR
Erich
LikeLike
Ah yes, I missed noting the limit switches on Z. Why two?
I got something working before I saw your reply. I told Smoothie that the Max value after home is 20 (Gamma_max 20) then I added to the OpenPNP Head Home GCode:
G28 Z ; Home just Z axis
G0 Z 0 ;Move Z back to mid position
G28 XY; Home X & Y axes
It seems to be doing what I want – after an exhaustive series of 6 tests 🙂
I saw an interesting paste dispenser kit from Mexico that could form the basis for my dispenser:
https://www.tindie.com/products/danm/dm-solder-paste-and-adhesive-dispenser/
a bit of a waste though as I don’t really need the controller.
Cheers,
DG
LikeLike
Yes, it would be possible to have just one limit switch, assuming the motor direction is known. If the motor moves, one goes up and the other goes down. With two limit switches I can catch any case.
I looked at such solder paste dispenser: the problem is that the do not use an auger pump, and without it the amount of solder always is different. Without closed loop control this makes things worse.
With an auger pump the amount of fluid at least is much more controlled.
LikeLike
Fair enough. Yet another thing that needs to be tried! I like your magnetic paint BTW – must try that.
I hadn’t thought about the need for a camera on the paste. Is it necessary or just nice to watch?
LikeLike
It is nice to watch. The idea was to have a ‘manual mode’ too: the machine moves to the pad, then the user can manually control the amount of solder paste dispensed.
LikeLike