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.
Outline
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.
Matt Baker then decided to port the Smoothieware to the STM32 controller inside the CHMT machine. Thanks to Matt this port is available on GitHub: https://github.com/mattthebaker/Smoothieware-CHMT
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.9042311.0.0.27424c4dQBxGzt
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.
Cameras
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).
Up-Looking Camera
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).
Nozzles
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:
Down-Looking Camera
For the down looking camera I ordered this one with a 12 mm lens:
https://www.aliexpress.com/item/32892346870.html
💡 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:
Controller Board
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.
Building Smoothieware
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
Installation
- 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)
Build
- Double-click with the Explorer on BuildShell.cmd in the Smoothiware directory and execute
make clean - Then do the same with:
make all - The resulting image is in Smoothieware\LPC1768
Flashing
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.
Drag Pin
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:
Drag Feeder
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:
Machine Configuration
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
Videos
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.
Summary
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:
- Original firmware: https://youtu.be/TvhZLREQ0PU
- New firmware: https://youtu.be/DskvMlGy1-g
New features and improvements coming from the OpenPnP community :-).
Happy Retrofitting 🙂
Links
- 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)
Pingback: “60 Billion Lights”: 2400 RGB LEDs and 120 Stepper Motors hiding behind Canvas Art | MCU on Eclipse
Pingback: Behind the Canvas: Making of “60 Billion Lights” | MCU on Eclipse
Erich, you have did it yet again with an amazing and detailed post! Well done! I am considering doing an OpenPnP conversion of an older Juki PnP that I have. Before I acquired my Juki I considered some of the newer Overseas PnP machines, but found the overall build quality not to my liking and I could see issues with the feeders. The older Juki, etc machines and feeders are extremely well built and the type and quantity of feeders that can be used simply puts the Overseas machines to shame. For example my older juki can have feeders loaded on all four corners with a max (8mm) of 128 feeders. That being said your write up will be very helpful in my efforts and if I do this anytime soon I will certainly post up and also to express my gratitude for your continuous and excellent posts.
Cheers,
Sam
LikeLike
Sam,
thank you! What type of Juki machine are you talking about? The number of feeders sounds impressive. Indded, the number of feeders is a very limiting thing on the Charmhigh machine: it is very complicated to change a reel, so I try to keep the most common parts on the machine anyway. I had a student working on adding new feeders to the machine, but unfortunately this did not work out because of different reasons. I hope someone else might jump on this, or I’ll do it myself.
LikeLike
Good day Erich,
I have a Juki/Zevatech PM575. It is a great machine in that you can load feeders on all four corners. The number of feeders is the maximum and will depend on the feeder widths. For example 12, 16, 24 mm feeders or shaker tubes take up 2 lanes/feeder slots. In my case I load regular (8/12/16/24mm) feeders front and back and have set up the left and right for shaker tubes and SOIC runway feeder styles. The unit was made in the late 90’s and so it is old. The operating system is Dos 6.22 with a Dos Based programming interface (e.g. part setup, feeder pick position, etc). PnP placement data extraction is done directly from my pcb (Altium) using a 3rd party Windows program called Synergy and it works well. The unit is stand alone and weighs approx 450kg and so it is no slouch… it truly is a tank. The gantry moves 2 metres/second and so it is relatively quick using servos. It also has up/down cameras, teach pendant, and a nozzle gantry (I think it can support 8 or 10 different size pickup nozzles). It also uses a interesting 3d laser scanning mechanism to determine and adjust the component placement orientation on the fly and so it can place components relatively quickly (3000 cph or so). The negatives are that the unit is old and the O/S is more than dated. Secondly, the max component height is 6mm… So for larger components you must use something else or hand place which is what I do. Someone on the OpenPnP forum did migrate another similar Juki machine (PM460 I think) to OpenPnP and so I know it can be done.
It is too bad that Juki does not offer a newer model of the PM575, as the build quality of the machine and the feeders is really impressive and if Juki were to offer a high quality newer machine like the PM575 I think it would really sell well for the maker, lower volume assembler.
Cheers,
Sam
LikeLike
Hi Sam, from the pictures I have found on the internet of that machine: impressive and solid machine. The part height is an issue with the CHMT and OpenPnP too: Yes, I populate first the lower height parts, but the machine/software has currently no way to go around already placed parts: so if there a higher part and a new higher parts gets moved over the board, it might hit a part. I ended up populating heigher parts by hand (anyway, usually there are only a few and easy to place manually).
LikeLike
Hi Erich,
Amazing work you have here!
Thanks to this I was able to to the same to my CHMT36VA.
I just have one question regarding the drag pin, I have noticed that OpenPnP doesn’t use the drag pin sensor to know if it got stuck or not, but in the actuator it reads the sensor correctly.
I also checked that the command to read the sensor is M119 but if I send that in the console it doesn’t return the sensor status. This confuses me even more because I have no idea how the actuator is able to read the sensor.
There’s not even a pin defined in the Smothieware to read that sensor…
I wonder if you have the sensor working in production and if so how can I do the same.
Thanks
LikeLike
I was not aware that there is a drag pin sensor (thanks for mentioning it in the OpenPnP group!).
I’m still away from the machine and cannot check the sensor. I have not used that sensor (was not aware of it) and I think I even do not need it:
I never had problems with the drag pin except if I misconfigured the machine.
If the drag pin is stuck for you: maybe you did not do a small retract in the feeder configuration? I pull the tape, then retract a small distance (say 0.1 mm) to get the pin released in a better way.
LikeLike
Hello, great job you’ve done here. I am considering doing the same. With the camera you chose, what is the largest component that you can fit in the frame? With the existing camera the machine can’t see the outline of a 25x18mm part. I know I could adjust the lens but I don’t know if that would cause too much distortion. Maybe you have picked up some larger parts?
LikeLike
Thanks! The largest part I have used is 8×16 mm, and with my setup that was the boundary. the relevant part is the bottom camera. I just have mounted it with the same distance as the previous one: to have a wider angle of view, I would have to mount it say 5-10 mm lower. I have not done this because I want and need a high resolution and narrow view for smaller 0603 0402 parts because there accuracy is important for me, and I have many more of these parts. The larger parts are few and I would be able to place them by hand if necessary.
I hope this helps.
LikeLike
Pingback: New MetaClockClock V3 finished with 60 Clocks | MCU on Eclipse
Great post as usual – how does this machine compare to the DIY machine you had built couple of years back?
LikeLike
thanks :-). It is faster (about 3 times) and much easier to setup/calibrate: the previous machine needed a calibration every time it was turned on. Additionally I have more feeders available.
LikeLike