OpenPnP is a great open source framework for building a DIY SMT Pick&Place machine. But it does not stop there: It is possible to use OpenPnP with a commercial pick & place machine, for example the Charmhigh CHM-T36VA. This Chinese machine comes with its own controller software which works but is not that great. The good news is that it is possible to hack and retrofit the machine so it can run the much more powerful OpenPnP.
This article describes how to retrofit the Chinese Charmhigh CHM-T36VA machine. That machine is available on AliExpress for around $3300. For that price this is a bargain: a good machine with dual-vision and dual pick&place head. The machine requires an extra host PC (e.g. notebook) (there is the T48 model which can run standalone). While the machine is pretty decent, the software/firmware is not that great. SparkFun is using that machine too and has created a wealth of knowledge and even a translated manual in a git repo (https://github.com/sparkfunX/Desktop-PickAndPlace-CHMT36VA) to overcome most of the issues. The OpenPnP framework is much better and has more features.
💡 Warning: modifying the machine as explained in this article will clearly void the vendor warranty, and cannot be reverted (except buying a new controller board from Charmhigh!). So only do this if you are confident and sure that you want to do it!
CHMT and OpenPnP
The OpenPnP community started looking into using OpenPnP for that CHMT machine back in 2019.
Jason von Nieda (founder of OpenPnP) started a project reverse engineering the protocol (see https://www.gofundme.com/f/help-openpnp-grow) which almost succeeded: except it was not possible to rotate the nozzles with that protocol.
This article describes some of the details how to migrate the CHMT to OpenPnP. Basically, the steps are:
- Upgrading the machine hardware (Cameras, Cable Drag Chains)
- Building Smoothieware and flashing new the firmware
- Machine configuration
The Wiki on https://github.com/openpnp/openpnp/wiki/CharmHigh-CHMT36VA is a good starting point and the reference for such a retrofit.
Cable Drag Chains and USB Extension Cables
I ordered 2m of the 15×20 mm semi-open version: https://www.aliexpress.com/item/32838858814.html?spm=a2g0s.9042322.214.171.124424c4dQBxGzt
3 USB Extension Cables (1.6-2.0m) are recommended to order too. They are used to extend the USB cables from the cameras.
The existing drag chains need to be removed and the new ones installed for replacing the top camera USB cable.
The advantage of the semi-open one is that it can be easily opened later for adding new cables.
Make sure the chains are moving smoothly: they are tied to the bottom guiding plate in the middle.
I decided to update the two cameras (bottom (up looking) and top (down looking) cameras. It should be possible to keep the existing cameras (see https://github.com/openpnp/openpnp/wiki/SwitcherCamera).
For the bottom camera I ordered the ELP global shutter camera, in the 2.8-12 mm lens option: https://www.aliexpress.com/item/33015394467.html
As a ‘global shutter’ version it captures all the pixel in one step which is ideal for moving targets. The camera is greyscale only as no color is needed.
The up looking camera LED ring is attached to the base with hex screws:
Remove the LED ring:
Remove the 4 screws of the bottom camera:
We need to take out the original camera, so open the four screws in the corners:
On the side there are hex screws to release:
You might re-use the lens screws on the side for the new camera as the camera enclosure is tight. Take the new camera and put it into the enclosure. Before putting everything back, make sure the lens is accessible and focused on the right distance.
I used black electrical tape make sure the LED ring is isolated from the enclosure:
Attach the USB extension cable to camera cable and route the cable to the back side of the machine (USB connector).
I had to color the green original nozzle color with a black pen:
💡 I highly recommend to order spare nozzles.
The idea is to have a black background as much as possible and have to ‘shine’ the part and its pads. That way parts got perfectly recognized.
Below an example of an 0603-capacitor seen from the bottom vision pipeline:
Here an example of a WS2812-SIDE LED:
I’m using the following settings for the bottom camera:
For the down looking camera I ordered this one with a 12 mm lens:
💡 If needed, the 8 mm lens from the original camera can be used. I’m using the 12 mm lens, but this makes the view area rather small, so I might switch back to the 8 mm one.
To remove the original camera, use a small hex tool:
I did not cut the cable of the original camera immediately, just in case. The camera can be removed after finishing the retrofitting.
Make sure that the new camera head/lens does not crash into the park position. Make sure it fits above the home position aluminum block:
Use the USB extension cable to extend the cable through the cable chains (or cut the cable and solder a longer one, this is what I did in the end to have more flexible cable chains).
The main job of the top camera is recognizing the fu
iducials on the board to adjust the board position and rotation. Below the views of a 1 mm fiducial with the top camera and 12 mm lens:
To access the internals of the machine, remove the front cover of the machine. The screws are behind the front plate:
Inside the machine there is the controller board. Below a picture with the board detached from the bottom screws:
The 4pins in the front of the board are the pins of the debug header.
Below are the most important steps building Smoothieware on Windows. Detailed information is available on http://smoothieware.org/compiling-smoothie and http://smoothieware.github.io/Webif-pack/documentation/web/html/compiling-smoothie.html
- Clone https://github.com/mattthebaker/Smoothieware-CHMT into a path without spaces
- Make sure there is no sh.exe in path (check with ‘where sh.exe’ in a command prompt window). I had it in c:\program files\Git, so for running the win_install.cmd in the next step I simply renamed the sh.ex so is not found any more.
- run win_install.cmd from the Explorer windows (double-click on it)
- Double-click with the Explorer on BuildShell.cmd in the Smoothiware directory and execute
- Then do the same with:
- The resulting image is in Smoothieware\LPC1768
I used a SEGGER J-Link to connect to the target.
I used jumper wires to make the connection:
It is not possible to readout the existing firmware as readout protection is activated:
Too bad that an article how to bypass readout protection (https://hackaday.com/2020/03/24/breaking-into-a-secure-facility-stm32-flash/) was published after I had erased the firmware.
Using the J-Link FlasherLite was enough to flash the new firmware. The machine will make some strange noise when turning off and on again (don’t worry).
Connect with a terminal/console to the machine and with ‘help’ you should see the Smoothieware respond to it:
Congratulations! The next steps are configuring the machine. I have used OpenPnP V2.
During machine configuration, I made the mistake to pull down the drag pin for several seconds. The coil only has a resistance of around 8 Ohm and can easily burn the wires if turned on for too long and not released. I had to replace one of the coils:
I damaged as well one of the drag pins, but luckily the original machine came with one extra drag pin set. I recommend to have some spare parts available, for example I ordered replacement parts from RobotDigg:
Below a video of the drag feeder in action:
The drag feeder works fine, but as there is only a ‘on-off’ function, the feeder can pull down the needle very hard, causing problems with weaker feeder tapes: the needle can damage the tape holes:
A trick is to enforce the feeder holes with the tape holes of a paper tape: that way I was able to solve the problem.
Rotation in Tape
In OpenPnP the correct orientation of parts in the feeder must be configured. The OpenPnP Wiki explains the steps and are shown here as an example.
The rotation of the part depends how it is oriented in the layout (e.g. KiCad) program. Below as example the SOT-23:
On a PCB it might be placed like this:
In the position file exported and then imported in OpenPnP it shows with a placement position and 0° rotation:
In the feeder/tape the part is rotated, so it needs to be configured in the feeder with a (positive) 90° rotation:
With this the part will be properly rotated for the placement.
For accurate placement on the CHMT, I recommend turning on ‘Pre-Rotate’ for parts:
The OpenPnP Wiki is a good guidance how to setup the machine. It is pretty much a standard configuration with dual head and dual camera, with the extension of vacuum sensing and air blowing:
My current machine configuration (OpenPnP V2) can be found on GitHub as a reference, including all packages, parts and scripts: https://github.com/ErichStyger/McuOpenPnP_Machine/tree/master/CHM36VA_OpenPnP/V2
Below the first but slow board job. The camera was not well tuned, so I used a sheet of paper to shield the lights on the ceiling. With setting camera exposure to lower values this was not an issue anymore.
Video showing the vision system running a job populating WS2812B LEDs:
This shows that the machine is running very well with OpenPnP.
I do NOT recommend such a conversion if you are not familiar with electronics or if warranty is a concern. A conversion of a machine could be done in a full working day or maybe two, depending on experience with OpenPnP. I did it over the course of two weeks, with some of the tweaking afterwards with the first boards running through production. Most of the time was needed to configure the machine with all the settings, but now everyone else has a good starting point with my configuration on GitHub which should save a lot of time :-).
I’m very happy with the accuracy of the machine: it has populated more than 300 PCBs by now with more +7000 parts on it. It accurately places 0603 parts and e.g. QFN with 0.5 mm pitch. It places around 600-700 parts per hour with bottom camera enabled. Speed is not ‘ultra-fast’ and slower than the original, but speed was not the goal. I wanted a machine I can fully configure and have under control. The other good thing is that the machine is not shaking like crazy as it did with the original firmware.
Another thing to mention about the speed and ‘shaking’: Andreas Axelsson is working on a new firmware:
New features and improvements coming from the OpenPnP community :-).
Happy Retrofitting 🙂
- machine configuration: https://github.com/ErichStyger/McuOpenPnP_Machine/tree/master/CHM36VA_OpenPnP/V2
- OpenPnP on CHMT36VA: https://github.com/openpnp/openpnp/wiki/CharmHigh-CHMT36VA
- How to modify machine for OpenPnP: https://github.com/openpnp/openpnp/wiki/Charmhigh-modifications-for-OpenPnP
- General Tips&Tricks for using the machine by SparkFun: https://github.com/sparkfunX/Desktop-PickAndPlace-CHMT36VA/tree/master/Tips-And-Tricks
- SparkFun CHMT36VA git repo: https://github.com/sparkfunX/Desktop-PickAndPlace-CHMT36VA
- Matt Baker about running Smoothieware on CHMT: https://github.com/mattthebaker/Smoothieware-CHMT
- Google Forum: https://groups.google.com/forum/#!msg/desktop-pick-and-place/qaoGrnM7pPw/-2k-5FBHCAAJ
- STM32F407 Discovery board: https://www.st.com/en/evaluation-tools/stm32f4discovery.html
- DIY OpenPnP Machine: Building a DIY SMT Pick&Place Machine with OpenPnP and Smoothieboard (NXP LPC1769)