Retrofitting a Charmhigh CHM-T36VA Machine with OpenPnP

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.

Retrofitted CHM-T36VA

Retrofitted CHM-T36VA

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:

  1. Upgrading the machine hardware (Cameras, Cable Drag Chains)
  2. Building Smoothieware and flashing new the firmware
  3. 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

drag chain

drag chain

3 USB Extension Cables (1.6-2.0m) are recommended to order too. They are used to extend the USB cables from the cameras.

Drag Chains with USB Extension Cords

Drag Chains with USB Extension Cords

The existing drag chains need to be removed and the new ones installed for replacing the top camera USB cable.

cutting off the existing drag chain

cutting off the existing drag chain

Removed existing drag chain

Removed existing drag chain

The advantage of the semi-open one is that it can be easily opened later for adding new cables.

Semi-Closed Drag Chain

Semi-Closed Drag Chain

Closed Semi-Open Drag Chain

Closed Semi-Open Drag Chain

Installed New Drag Chains

Installed New Drag Chains

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

ELP global shutter camera

ELP global shutter camera

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.

ELP Camera

ELP Camera

The up looking camera LED ring is attached to the base with hex screws:

Uplooking Camera LED Ring

Up looking Camera LED Ring

Remove the LED ring:

Removed LED Ring

Removed LED Ring

LED Ring

LED Ring

Remove the 4 screws of the bottom camera:

Hex Screws of bottom Camera

Hex Screws of bottom Camera

Bottom Camera removed

Bottom Camera removed

We need to take out the original camera, so open the four screws in the corners:

Bottom Camera Bottom Side

Bottom Camera Bottom Side

On the side there are hex screws to release:

Camera Enclosure Hex Screw

Camera Enclosure Hex Screw

Original Camera taken out

Original Camera taken out

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.

New camera in the enclosure

New camera in the enclosure

I used black electrical tape make sure the LED ring is isolated from the enclosure:

Electrical Tape for Bottom LED Ring

Electrical Tape for Bottom LED Ring

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:

Painting Nozzles Black

Painting Nozzles Black

💡 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.

SOT-23

SOT-23

Below an example of an 0603-capacitor seen from the bottom vision pipeline:

0603 capacitor

0603 capacitor

Here an example of a WS2812-SIDE LED:

WS2812B-SIDE

WS2812B-SIDE

I’m using the following settings for the bottom camera:

Bottom Camera Settings

Bottom Camera Settings

Down-Looking Camera

For the down looking camera I ordered this one with a 12 mm lens:

https://www.aliexpress.com/item/32892346870.html

Aliexpress Downlooking Camera

Aliexpress Down Looking Camera

💡 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.

Downlooking Camera

Downlooking Camera

12mm Lens on camera

12mm Lens on camera

To remove the original camera, use a small hex tool:

Removing original down camera

Removing original down camera

I did not cut the cable of the original camera immediately, just in case. The camera can be removed after finishing the retrofitting.

Removed camera

Removed camera

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:

New Camera in Park Position

New Camera in Park Position

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:

Ficucial

Fiducucial

Fiducial

Fiducial

Controller Board

To access the internals of the machine, remove the front cover of the machine. The screws are behind the front plate:

CHM-T36VA with Front Cover

CHM-T36VA with Front Cover

Inside the machine there is the controller board. Below a picture with the board detached from the bottom screws:

CHM-T36VA Controller Board

CHM-T36VA Controller Board

Controller Board

Controller Board

The 4pins in the front of the board are the pins of the debug header.

CHM-T36VA Controller Board mit Debug Header

CHM-T36VA Controller Board with 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

  1. Clone https://github.com/mattthebaker/Smoothieware-CHMT into a path without spaces
  2. 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.
  3. run win_install.cmd from the Explorer windows (double-click on it)

Build

  1. Double-click with the Explorer on BuildShell.cmd in the Smoothiware directory and execute
    make clean
  2. Then do the same with:
    make all
  3. The resulting image is in Smoothieware\LPC1768

Flashing

I used a SEGGER J-Link to connect to the target.

J-Link to flash the controller board

J-Link to flash the controller board

I used jumper wires to make the connection:

Debug Connection Part 1

Debug Connection Part 1

Debug Connection Part 2

Debug Connection Part 2

Debug Connection Part 3

Debug Connection Part 3

It is not possible to readout the existing firmware as readout protection is activated:

active write protected STM Device detected

active write protected STM Device detected

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:

Smoothie on CHMT36VA

Smoothie on CHMT36VA

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:

drag Pin Solenoid

drag Pin Solenoid

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:

Charmhigh drag pin

Charmhigh drag pin

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:

drag feeder perforation

drag feeder hole damage

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.

feeder tape holes enforcement

tape hole enforcement

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.

Rotation in Tape

Rotation in Tape

The rotation of the part depends how it is oriented in the layout (e.g. KiCad) program. Below as example the SOT-23:

SOT-23 in KiCad

SOT-23 in KiCad

On a PCB it might be placed like this:

SOT-23 Footprint on PCB

SOT-23 Footprint on PCB

In the position file exported and then imported in OpenPnP it shows with a placement position and 0° rotation:

Placement Rotation

Placement Rotation

In the feeder/tape the part is rotated, so it needs to be configured in the feeder with a (positive) 90° rotation:

Rotation in Feeder

Rotation in Feeder

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:

Pre-Rotate Always On

Pre-Rotate Always On

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:

CHMT Configuration Tree

CHMT Configuration Tree

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:

New features and improvements coming from the OpenPnP community :-).

Happy Retrofitting 🙂

Links

1 thought on “Retrofitting a Charmhigh CHM-T36VA Machine with OpenPnP

  1. Pingback: “60 Billion Lights”: 2400 RGB LEDs and 120 Stepper Motors hiding behind Canvas Art | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.