Posts Tagged ‘pickplace’

CNC milling custom 40DP timing belt “gears”/pulleys

Woo, it’s been a long time since I messed with pick & place stuff. Bad Tim.

An irritation I have been having is making everything work using reliably sourceable, off-the-shelf parts (not lucky eBay/surplus finds). In particular I’ve found small “tin can” stepper motors are hard to source in small quantities repeatably, and once you do, finding timing belt pulleys to fit the shaft of the motor you’ve just scored is a fresh new challenge. In a previous iteration, I use some steel tubing and superglue to shim a motor shaft up to size(ish), but here is an alternate approach: my “pick & place” machine is just my CNC machine with a vacuum head bolted on, so why not just cut some pulleys on a CNC machine?

14-Tooth 40DP Pulley

14-Tooth 40DP Pulley, carve on a CNC mill using a 1/32″ bit

For reference, here is the existing head in action.

This last attempt used the “40DP” type small timing belts/pulleys* since they seemed to be readily available here. Despite the massive main pulley and tiny one on the motor, the gear ratio works out to only about 5.2:1. This is adequate for a typical 1.8deg/step stepper (~0.35 degrees/step final head resolution), but pretty coarse for a 7.5deg/step tin-can motor. This is the smallest ‘proper’ stepper I can find in hobbyist quantity and pricing, and it seems to work well. The shaft diameter is 4mm. (Sidenote: A note on the product’s page indicates it now comes with a flatted shaft. You may wish to augment the below to take advantage of this.)

Here is what I did to make a 40DP pulley to work with the new motor. Similar process ought to work for other pulley profiles and sizes.

Thingiverse user drofarts has put together a set of parametric pulley design files in OpenSCAD format. These are CAD files, but more like a text scripting language than a traditional CAD package. You need to install OpenSCAD to use these files if you don’t have it already. Open the desired file and tweak parameters as needed, such as the desired profile, number of teeth, shaft diameter, etc. Use Design -> Compile and Render to see what you’re going to get. For best results in the next step, set the ‘no_of_nuts’ parameter to zero to simplify the output. When satisfied, use Design -> Export as STL… to save the file.

OpenSCAD pulley output

If you were planning to make it on a 3D printer, you’re pretty much done! You can output .stl directly. I don’t have one and will be carving it on a CNC mill, so an extra step is necessary. Basically, you’re going to want to carve the 3D model down to a simplified, 2D representation of just the pulley profile, and do any CNC/toolpath-specific monkeying in your favorite CNC software. For this, OpenSCAD’s ‘projection’ feature can be used. I created a separate scad file that simply imports the .stl from the first step and presents a 2D projection of the pulley profile only.

projection(cut=true) translate([0,0,-8.5]) import("C:/data/projects/pickplace/head/pulleys/Pulley_T-MXL-XL-HTD-GT2_N-tooth.stl");

Change the path and filename to the file you generated, of course. The negative Z ‘translate’ parameter lowers the part partially below the ‘floor’ (zero), which, combined with the ‘cut=true’ projection parameter, causes the bottom part of the pulley (large flanged base with setscrew holes we can’t cut on the CNC) to be excluded from the projection. You may need to modify this parameter depending on the height of the pulley you generated.

OpenSCAD pulley output (sliced)

Then save this using Design -> Export as DXF.

I cut this pulley from a piece of flat Delrin stock using a 1/32″ (0.03125 inch / 0.79375mm) router bit. A larger bit may not be able to get in between the teeth for 40DP profile. In my CNC software (CamBam) I added a bottom shoulder by outside pocketing the pulley profile to 1/4″ depth, then carving the rest of the way through the stock at a slightly larger diameter. If needed, a top shoulder can be added by gluing a washer to the top of the newly created pulley.

But does it work?

Yes :-) Below are some comparison images of the homemade pulley vs. a commercially available one. The latter is fine except that it doesn’t come in the shaft diameter I need.

Homemade pulley (right) and commercially available pulley (left)

The quality of the pulley-belt meshing between the two is comparable. The tooth depth on the homemade one could stand to be a bit deeper, but I haven’t noticed a difference in performance so far.

New pulley on motor

New pulley mounted on the new 4mm motor’s shaft. Perfect fit!

* I can’t seem to find any source/documentation on what the various timing belt “standards” are, or what makes one different/better than another. Also, that source seems to have gone out of business. Suggestions for either of these resources welcome.

Motorized SMT tape-and-reel feeder for DIY pick & place

Despite the impact of work, wedding planning and Super Metroid fan-hacks (not necessarily in that order ;-) on my freetime, my scheme to design a DIY-able open pick & place system is starting to come along. So far, there is a proper vacuum placement head, a rough idea of what the software architecture might look like, and this. For those who saw the last post, you probably guessed what it was leading up to.

This is a simple proof-of-concept of a SMT tape-and-reel part feeder design. The main parts are a stepper motor and feed sprocket to advance the tape, two walls with guide slots, and a simple slider mechanism to allow the feeder to accept tapes of varying width. Please note that it does not (yet) include any mechanism for peeling and disposing of the tape covering. Suggestions and innovations in this area (as well as all others) are welcome!

All the parts were cut on a CNC mill – design files and G-code are available here. The .cb files included can be opened with the free version of CamBam. More photos / video and design details are available below.

The Tape Standard
The geometry of the standardized tape that holds SMT parts is documented in EIA-481-2-A, which until very recently was only available at a price too high for mortals (or from your favorite ‘alternative’ source, wink nudge). It appears that EIA disbanded at the end of 2010 and the documents are now public. Regardless, here are the parts of interest to us building a DIY tape-and-reel feeder:

Pitch (distance between sprocket holes): 4mm
Sprocket hole diameter: 1.5mm
Center of sprocket hole to edge of tape: 1.75mm
Center of sprocket hole to edge of component wells: min. 0.75mm??? (seemingly not specified; varies between manufacturers)
On opposite side of tape – ending edge of component wells to edge of tape: 0.6mm min.
Tape thickness: 0.2 ~ 0.4mm, not including covering.

The standard tape widths are 8/12/16/24/32/44/56 mm. For tapes 32mm and wider, a row of slightly elongated (same pitch) sprocket holes is added to the other side. According to various sources, the standard also says the pitch between part wells should be a multiple of 4mm and “Pin 1” (if any) should generally be on the sprocket side and facing forward. A longer explanation of the part orientation rules is that the part should be a) widthwise (its longer dimension, if any, across the tape); b) Pin 1 toward the round sprocket holes (unless this conflicts with the first rule); c) Pin 1 facing in the direction of travel (unless this conflicts with the first 2 rules). How religiously any given vendor adheres to these rules is anybody’s guess. There is also no rule saying the ‘well’ or pocket holding each part has to remotely match the size of the part (except to prevent it being able to flip over or rotate 90 degrees during shipping), so visual positioning correction is occasionally needed for parts from particularly lazy vendors.

Feeder Design Points
With these things in mind, the shown test-design uses the following dimensions, which seem to work well with varying size tape samples I fed through it:

Sprocket thickness of 0.7874mm (.031″) – this is a ‘standard’ stock thickness in the US, so it was an easy first test. I sunk the sprocket so that it lies flush with the inside wall. With these values, the depth of the tape track is cut to 2.14376mm (0.0844 inches) to put the edge of the tape flush with the track when on the sprocket, forcing it to stay straight despite all the feed force being delivered on one side. For the ‘outside’ (non-driven side) wall, the track is cut to a depth of 1mm (0.039 inches). The width of the slot is 0.79375mm (0.03125″), as this is the closest (commonly available in the US) milling bit width that will accommodate both plastic and the slightly thicker paper tapes. To assist loading tape, a wider ‘mouth’ is cut on the input side of both sides’ slot, tapering to the slot width to guide the tape in. In reality, the mouth you see in the photos is not really large enough to be useful (it looked a lot bigger on my monitor!…). Also, the mouth on the non-drive side in the photos is on the wrong side since I completely forgot to account for this half being flipped over :p These are corrected in the downloadable files.

With the sprocket as designed, the tape track radius is 13.6mm (0.536″), and the track makes a 180 degree pass around the sprocket to eject the spent tape at the bottom of the same end it comes in on. In hand-testing some tape around the sprocket, I found it does not always sit flush against the sprocket throughout the entire 180 degrees, so the tape track is widened a bit around the sprocket to accommodate. The ~31mm sprocket diameter / number of teeth (22) was chosen purely for convenience on my part, as this is the tallest that would comfortably fit on the homebrew CNC mill I’m using for testing. In practice, a larger diameter is advisable so as not to limit the size of parts (deepness or length of the ‘wells’ vs. sprocket diameter and bend radius) that can be fed. Also, the reels themselves will be much taller than this anyway. Just keep in mind that as sprocket diameter goes up, so will the required motor torque to advance the sprocket one step, and the linear distance per step. At some point some form of gear reduction will be necessary vs. simply tacking the sprocket directly to the motor shaft.

To handle a wide (pun intended) variety of tape widths, a trio of smooth nylon PCB standoffs (0.250″ dia) are sunk and bolted into the drive side to act as sliding rails for the halves to be pulled apart to the desired width. A rubber band around both halves keeps them tensioned and in contact with the tape edges when loaded. This could definitely stand improvement, but it works for now.

Despite being a quick ‘n dirty test piece, the action of this feeder (by hand) is surprisingly smooth. The nylon spacers are pretty slippery, and the Delrin also provides a smooth, low-friction surface when machined. With the motor is a different story; these tin-can motors are 7.5deg/step and the driver board I’m using right now doesn’t really support microstepping low-current motors.

Tape Sprocket Creator

This is a free (open source) Python script for creating feeder sprockets for e.g. perforated tape or film advance. I wrote it for myself to generate SMD tape-and-reel feed sprockets, but it might also be useful for making replacement sprockets for 8/16/35mm film, microfilm and paper-tape systems whose original reader hardware no longer exists or is difficult to find replacement parts for. The output is a .DXF template suitable for laser cutting, 3D printing or CNC machining. “Documentation” below, but it should be pretty self-explanatory. It should work with any modern version of Python (tested on 2.6).


Sprocket design goals / differences from other sprocket types

The drive sprocket’s dimensions are specified mainly by the number of teeth, width (or diameter) of the sprocket holes, and the pitch (distance between sprocket hole centers). The tape is usually advanced either tangentally to the sprocket, or partially wrapped around the sprocket. Thus the distance between the outside edges of any two teeth at any point, either tangent to the sprocket or along the circumference of the sprocket, should never exceed the distance between the outer edges of any two sprocket holes (the taper of the teeth is computed to counteract the radial splay of the teeth). Additionally, a landing area (flank) is cut at the base of the teeth matching the thickness of the tape, giving it a place to ‘catch’ when pressed against the sprocket’s inner diameter. Unlike e.g. roller chain sprockets or spur gears, no undercut (cuts below the inner diameter) is provided for rollers or a mating gear’s teeth, and no special geometry is needed along the sides of the teeth.

Some Terminology:

Pitch: The center-to-center distance between sprocket holes, and thus the sprocket teeth.

Tooth Face: The tapered portion of the tooth. In this application, the tooth taper is calculated to smoothly slide into the sprocket holes as the sprocket rotates.

Tooth Flank: The ‘upright’ (or slightly concave) base of the tooth. In this application, it should be the same height as (or slightly taller than) the tape thickness so that the tape sprockets rest fully within the flank.

Tooth Land: This is the surface left if the tip of the tooth has been blunted or “cut off”. This might be done to fit the sprocket into a particular diameter. I’m an EE; I don’t know what other dis/advantages pointy vs. blunted teeth would have in this application.

Basic usage:

Fill in all the values called for in ‘Basic Parameters’. Aside from angles, which are in degrees, use any unit of measurement you prefer (inch/mm/etc.), as long as it is consistent; output will be in the same units. If you desire a specific tooth taper angle, enter it, otherwise just press “Compute / auto angle” to suggest an angle and generate the sprocket.

Mostly, the pitch and sprocket hole width are dictated by the tape to be fed, and also drive the important diameters. You can get closer to a desired sprocket diameter by adjusting the number of teeth. The important diameters are:

Inner diameter: This is the diameter at the base of the teeth, where the bottom of the tape rests.

“Design diameter”: This is the most important diameter as far as the program is concerned, and is fully dictated by the pitch and number of teeth. The design diameter is the diameter at the top of the tooth flanks, which is the top of the tape. You could also think of this as the outside diameter of the tape if wrapped around the sprocket.

Outer diameter: This is the diameter at the tips of the teeth. By playing with the tooth angle and cutting off the tips (tooth length %), there is some leeway to constrain the outer diameter to fit the available space.

Note that the angle auto-suggest feature is currently broken (will return incorrect results). It will (usually) calculate an angle that will allow the tape to *wrap around* the sprocket at any radius from the base of the teeth, but what you really want is the tape to fit at an arbitrary angle across the teeth (specifically, the outer edges of whatever teeth it intersects while tangent to the sprocket should not exceed the outsides of the sprocket holes). For now you might have to cut a few gears and experiment, or just set the angle arbitrarily high.

Extra Options:
If you will be cutting out the sprocket on a CNC mill, outside pocketing will leave some material at the base of each tooth flank due to the diameter of the round cutter. Enabling ‘Remove cutter leftovers’ and entering the cutter diameter will add DXF points (drill hits) near the tooth edges to remove this material. Users of other fabrication methods can probably ignore this option.

If designing a sprocket in one measurement system for use in another, you can optionally select a unit conversion to be applied when writing out the DXF file. E.g. if your tape is specced in mm but your CAD/CAM software expects inches, select ‘mm to inches’ before saving the DXF.

I wrote this to solve a very specific need for one of my own projects; so very little time and debugging went into it. There is no idiot-checking. Expect errors or bizarre output if you leave necessary fields blank, mix & match units (inch/mm) arbitrarily, enter a negative number of teeth or any other physically impossible geometry. Even if you do everything correctly, there is no guarantee the output will be correct or meet your needs. Please check the results very carefully before you lay out any $$$ to have anything professionally made by a fabrication service!

Right now the arc between teeth is output as a straight line, not an arc or series of tiny lines approximating one. This should not be a huge problem for a reasonable number of teeth, but something to be aware of.

Other notes:

“Auto angle” calculation is only done if the angle field is blank: if there is a number there (including a previous auto-calculation), it will be left alone. If you have changed any parameters and want to redo “auto angle”, please delete the contents of this box.

The sprocket image shown in the program window is not to scale – it is automatically scaled to fit inside the window. It is not unusual for the sprocket to appear to change size dramatically when parameters are modified.

Square Pegs and Round Holes:
Unless you have some fancy software sweeping the sprocket teeth into 3D, you are probably making a flat gear out of flat stock, and it will have flat edges. If the sprocket holes are round, the tooth edges will contact somewhere earlier than the outside diameter of the hole, and so may need to be tweaked – especially if the material is thick relative to the holes. (See the diagram below for an exaggerated example.) Use this formula to calculate the effective tooth width that will exactly fit the hole:

w = sqrt(d^2 – t^2)

where d is the sprocket hole diameter and t is the stock thickness.

Reversing an aquarium pump

An aquarium air pump can be used as an inexpensive source of low vacuum with a small amount of tweaking. Supplies needed are:

The air pump
Screwdriver (usually) to open the air pump
Hose barb (your favorite size) for vacuum inlet
Glue (e.g. RTV/caulk, epoxy, etc.)

Of course, you could convert one by sealing up the whole thing in a big Tupperware container and punching a port through, but this method is more robust and compact.

Have a gander at the pictures below. The internals shown are pretty typical, and diabolically simple: AC wall power flows through a U-shaped electromagnet, which wiggles a small permanent magnet between the poles rapidly back and forth to pump a rubber bellows. The bellows draws air directly from the inside of the case and forces it through the output port, drawing new air into the case through some small holes or dust filter on the case somewhere. Thus, “reversing” the pump requires simply drilling your own hose barb into the case and sealing up the original vent (plus any other air leakage paths). The converted pump can be used as a vacuum pump by plugging the new port into your vacuum-needing device and letting the original port vent to atmosphere, and can still function normally as a positive-pressure pump as needed.

Common air leakage paths are around the AC cord entry, around the output port and where the screws / rubber feet go (the screws may be hiding under the rubber feet anyway). Probably the easiest thing to do is just run a nice fat bead of RTV around the entire seam between the halves of the case before putting it back together.

The pump shown pulls about 5 inches mercury (~127mmHg); most are probably in that ballpark. If your needs fall somewhere above this but well below a “real” vacuum pump (or even a disembodied fridge compressor), it might be possible to beef up the vacuum or flowrate a bit by putting 2 in series or parallel.

Some “standards”:
In the US at least (don’t know about elsewhere), the common size pumps (for 10 ~ other double digits gallon fish tanks) generally take 3/16″ flex tubing, and unmarked tubing in the fish supplies section of your local pet store is probably this size. Larger pumps with e.g. 1/4″ ports are available for large tanks, but if it doesn’t say what size tubing to use, you can probably assume 3/16. This refers to the tubing inner diameter (or the pump port’s outer diameter); the tubing outer diameter can vary significantly and is often not specced. Since you will be adding your own port, you can really make it any size you want, but sticking with 3/16 means you will have plentiful local sources of matching hose barbs, tee fittings and other parts at most any pet store.

Pick n place head update

This is a quick follow up to the pick & place head article, in which I actually build the darn thing :-) As in, not just fit-test the parts together and take a picture, but actually pick and place some stuff with it. I’ve been busy/lazy, so not too much to show in terms of software yet (the video you see below is running a ‘dumb’ g-code placement script). The parts list has been updated will be updated in the next couple days, along with new CamBam/DXF files.

Live test of the head as currently designed. This is bolted to my ghetto homebrew CNC mill, which is kinda slow. On a more built-for-purpose (or less ghetto) machine, performance should be much better.

The webcam’s weird eyeball-shaped case has been removed, revealing a rectangular board with sanely-spaced mounting holes in its corners. Also, a proper solenoid valve has been bolted to the head and hooked up to a reversed aquarium pump for suction. The rubber nozzles are from a sacrificial el-cheapo SMD vacuum pen ($3USD ,eBay), which comes with three sizes that fit on a standard 16-gauge needle.

Otherwise, it’s pretty much as described in the previous post.

A little bit of guts. This board holds a transistor to drive the 12VDC solenoid valve from a parallel port pin, Pololu microstepping motor driver (Allegro A4983) and 5V regulator. At the top you can make out a simple pressure sensor conditioning circuit that isn’t hooked up yet.

Cubeternet 2MP UVC webcam teardown

For my pick and place project, I picked up a pair of too-good-to-be-true webcams: the Cubeternet no-name UVC webcam. For this project, there is a lot to like: 2MP resolution (claimed, at least), built-in LED ring, cross-platform UVC interface, hand-adjustable focus and a legitimate glass (no polycarbonate) lens…for $16! Alas, my review of this cam is currently mixed, since one of the cameras failed after being plugged in for more than a few minutes. This particular camera – the first I tested – became warm to the touch soon after plugging in; I assumed this was normal operation and that the cam’s solid metal “eyeball” enclosure was the heatsink for a voltage regulator screwed into it. Turns out this is not normal at all; the 2nd camera does not get even slightly warm after running overnight. Now, what to do with a broken webcam? Take it apart!

Teardown photos: In here

Opening the case reveals solid components, but an unfortunately typical “Chinese toy” construction with hand-bent and soldered leads everywhere, a couple stray solder balls and liberal application of hot glue (yes, really) to hold everything in place. If you’ve ever taken apart a cheap electronic toy for soundbending, you probably know what I’m talking about. Of the identifiable ICs, there are:

(Integrated USB2.0 UVC camera controller in 44-pin TQFP; its manufacturer denotes it as VC0342. This is driven by a 12MHz crystal oscillator.)

Turbo IC, Inc.
(64-Kbit I2C EEPROM in SOIC-8. Contains USB descriptor strings referencing “Vimicro Corp. Venus USB2.0 Camera” and “Sirius USB2.0 Camera (Audio)”. The remainder of the data most likely consists of imager-specific register initialization values. Here is a dump of the EEPROM contents in ASCII HEX format, or in raw format.)

Voltage regulator:
Kingbor 6206A
(Ho-hum, 3.3V 3-terminal regulator.)

Typical “big glass plate” CMOS image sensor; this is the partnumber silkscreened on the bottom of it, but the Google turns up very little information and certainly no datasheets. An user on a Chinese message board says it is a 2MP imager made by Micron.

There are six very bright LEDs hand-soldered into the board and bent into position; an electret microphone is also glued into the case. A handful of what appear to be discrete transistors/FETs deliver power to the LEDs and may serve a purpose switching/sequencing power to the imager.

In the images of the controller side, you can see a big solder blob dangling precariously off one of the FETs onto the PCB. While it’s not clear if this one was the culprit, this blob or one of a couple similar ones are the most likely cause of failure. Despite all this, the lens assembly is all glass as claimed, and seems to be of much higher quality relative to the rest of the guts. The minimum focus distance is well below 1 inch. On another bright side (no pun intended), the LEDs are bright as hell, adjustable via an analog thumbwheel on the USB cable, and holes in the four corners of the square board can allow easy attachment to the placement head. The untimely death of one of the cameras is certainly discouraging, and given the internals can’t be cleanly written off as a fluke. Still, even assuming a 50% failure rate, doubling up on these cams is still a good bit cheaper than the nearest name-brand equivalent.

Image segmentation for PnP optical placement

Quick ‘n dirty (but working!) image segmenter for randomly-strewn part identification. About 1 page worth of scripting takes an image of objects on background, determines which part is the background, determines the outside contour of each object and numbers each as a separate object. Now that it’s known where to look for one specific object, the task of identifying that object (or just matching it to another just like it) becomes a whole lot simpler. Combined with the auto-aligner, this reduces a “naive” (bruteforce cross-correlation between needle and haystack images) image matcher to only having to scan against 4 orientations (90-degree rotations) to find which has Pin 1 in the right place (and whether it’s the same part, etc.) Hopefully as I dig deeper into opencv, there is a less-naive algorithm builtin for this that does not rely on contrast/color historgrams: most electronic parts basically consist of a flat black body and shiny reflective metal leads (i.e. appearing the same color as your light source and/or the background, and/or whatever happens to be nearby at the moment). Edge-based stuff still seems like a better approach, though I would welcome being proven wrong if it means not having to write the identifier from scratch myself :-)

Steps in brief:
The first image was taken using the actual webcam that will be attached to the pick n place head, looking at a handful of representative parts on a piece of white paper. This image was dumbly processed using a Sobel edge-detector (it’s builtin to Gimp and I was feeling lazy), Gaussian blur to expand the soon-to-be-resulting mask around the part a little and close any gaps in the edge-detection result, and finally threshold the result to produce the second image. The goal in these steps is to produce a closed-form contour blob for each part that’s at least as wide as the part, while minimizing stray blobs from random noise / dirt specs / etc. (internal, fully-enclosed blobs/noise due to part features/markings is OK). Finally, opencv’s FindContours function is run (mode=CV_RETR_EXTERNAL) on the resulting image, returning a vector that contains a polygonal approximation of each external contour found. Each discrete (non-touching) contour blob is returned separately, that is, every part in the frame is now effectively tagged and numbered!

There are a couple noise points identified in the image above. Better-chosen constants for the initial image operations (threshold, blur radius, …) may help, but I’ll probably end up having it measure the area of the blobs and throw away any that’s too small to possibly contain a valid part. Switching to a more advanced edge-detector, e.g. Canny, may help too. In any case, the full image matcher should figure it out eventually :-)

Code Demo – basically ripped straight from the pyopencv examples
Segmentation example – requires Python (2.6) and opencv 2.1.0 / pyopencv.

Pick ‘n Place Head

This weekend I got some parts in and put together a preliminary placement head for my open-source pick ‘n place project. My requirements are that it be buildable with off-the-shelf parts (ideally same-source, to save on shipping) and no special equipment, allow +/-180 degree rotation while maintaining an undisturbed vacuum, and support interchanging of the “tools” (vacuum needles). All that’s really needed to build this are the discrete parts shown, a bit of drillable plastic (e.g. Delrin) for the base material, and a drill. A drill press would be handy (a CNC mill *really* handy, and not such an out-there thing to have considering you are probably retrofitting this onto one).

This head consists of a hollow rotary shaft with a Luer lock fitting on one end, right-angle flexible tubing barb on the other end, and a large toothbelt (notched belt, timing belt) gear in between. The shaft is held in place but allowed to rotate by a pair of bearings, and the rotation is provided by a small stepper motor at the other end of the toothbelt. The gear ratio is approximately 5.2:1, providing a rotational resolution of about 0.35 degrees/step with a common 200 step/rev stepper motor (if no microstepping is used). Finally, just to the left of it is a 1024×768 Webcam with manually adjustable focus and a ring of built-in LEDs for lighting. The webcam mounting is definitely not ideal, given the camera’s weird eyeball-like shape. Tentative plan is to lash it down with some string, align it nicely with respect to the CNC table, then backfill the opening the camera’s butt sits in with epoxy.

The hardest part was finding a combination of parts that would all fit together nicely. Currently, the fits are mostly exact to “pretty damn good”, but a bit of adhesive is needed to join them permanently.

Parts List
Unless otherwise noted, all of these parts were sourced from Small Parts Inc. in the US due to the large selection and an actually competent parametric search engine, which was a great help in finding combinations of mutually-fittable parts. Accordingly, measures are in Imperial unless noted otherwise (that’s just how they come here).

Partnumber Desc.
3002DSTNTG18 Nice Ball Bearing 3002DS, .250″ bore x .6875″ OD x .250″ width
BFM-250-P Mounted sleeve bearing, .250″ ID, 1 17/32 center-to-center bolt spacing
B00137SITY Steel tubing, 1/4″ OD .152 ID, 12″ long
40DP-14/S-01 Timing Belt Pulley Delrin, 0.0816 Pitch, 40DP, .350″ Diameter, 1/8″ Bore, For up to 1/4″ Wide Belt, 14 teeth
40DP-70/S-01 Timing Belt Pulley Delrin, 0.0816 Pitch, 40DP, 1.806″ Diameter, 1/4″ Bore, For up to 1/4″ Wide Belt, 70 teeth
TB188-090-01 Timing Belt Urethane/Polyester, Single-Sided, 0.0816″ Pitch, 0.1875″ Wide x 7.3440″ Long, 90 Teeth
LCX-LC005 Male Luer Lock to tubing adapter, .145″ OD hose barb (mates well enough with .152″ ID steel tubing)
F1-EL001 Elbow Connector , Classic Barbs for 3/32″ ID Tubing, .145″ OD
HSTA-08-24-10 1.5″ aluminum standoffs, 8-32 thread
B00137UP68 (Optional) 11ga Steel Tubing, .120″OD, .094″ID (for mating 2mm shaft stepper motors, if used, to the 1/8″ pulley

Misc. Parts
2x 2″ x 4.5″, 1/4″ thick pieces of Delrin or similar
4x 1/2″, #4-40 bolts and nuts (assuming 2 bolts for stepper motor)
4x 1/2″, #8-32 bolts for standoffs
1x Webcam, manual focus, hi-res and builtin lighting strongly recommended
1x 3mm shaft stepper motor*
1x Method of attaching to your mill – a bit of aluminum angle bracket, or a dovetail, etc., depending on your mill.
1x 3-way air solenoid valve
1x Vacuum source (see here for a cheap one)
Air tubing and appropriate couplings to your solenoid valve. The head’s air path terminates in a 3/32″ hose barb, so you’ll want a 3/32″ to (whatever) barb adapter, or a 3/32 that screws directly into your solenoid. Those using metric are on your own :-) but will probably have an easier time of it anyway.

* The timing pulleys and stepper motors only come in a handful of diameters (imperial for the pulleys and usually metric for the small motors), so a 3mm (.118″) motor onto a .125″ ID pulley was the closest I could come up with in a reasonable amount of effort. Any small, el-cheapo permanent magnet (“tin can”) stepper motor should work here, but sourcing it may be annoying. Off-the-shelf 3mm-shaft motors I found are Jameco’s ValuePro 42BY48H08, Anaheim Automation’s TSM42 series, and Portescap’s 42/44 series e.g. 42×048 and 42S100. This surplus stepper is also worth a look, but you’ll have to remove a pre-attached plastic(?) gearhead. Beware, many of these smaller motors are 7.5deg/step, so even with the gear reduction, you will probably want to look at microstepping them to ensure adequate rotational resolution. Also, most of the companies selling them have no online click-and-buy ordering; you’ll have to phone up a salesdouche at the least, hope that you are worth their time to buy One Lousy Motor, and possibly haggle (“Request a Quote”). How companies that don’t know what their product costs stay in business is beyond me, but that’s a rant for another day.

If you want to skip that hassle, I’ve taken an alternative approach and simply bodged a surplus 2mm-shaft motor up to a 3mm shaft by gluing a short piece of thicker steel tubing onto the existing shaft (see partlist).

Design Files
CamBam drawings with machining operations for the top and bottom plates. The machining ops assume 1/4″ thick plastic, 1/8″ endmill for most cuts, and .166″ (#19) drill for the #8-32 bolt holes into the standoffs. It’s designed for the Cubeternet webcam (or equivalent eyeball-cam) and a stepper motor with 42mm center-to-center mounting holes. You can get the free CamBam at

Note, I made some small improvements to these files after the above prototype was carved, so what you see in the file will not match it exactly. In particular, the standoffs were moved to more optimal places and a feature has been added allowing the motor to be slid to remove any slack in the belt.

The assembly should be pretty self-explanatory. One bearing on each of the Delrin plates (inset the ball bearing if you can; otherwise gluing it down should be fine). The hollow shaft goes thru the bearings, Luer adapter and hose barb go on either end (use adhesive, just don’t clog the air path with it). The motor shaft center should sit just a hair (50-100 mils?) over 1.75″ from the hollow shaft. On mine, an online calculator produced the 1.75 figure, but the belt turned out to be a bit loose once built this way. If possible, make an elongated hole for one of the motor screws so the motor position can be adjusted to tension the belt. You could probably also insert a peg somewhere in the belt path to push it inward and take up the slack. With the camera focus set such that the largest part you will ever populate can fit in-frame, find the resulting camera height (distance from part) and set the depth of the shaft so that the camera is “in focus” maybe an inch or two above the placement position (i.e. with the needle touching the board). This will allow the head to focus on parts without touching the needle down.

For my build, I used instant glue to attach the Luer adapter to the needle shaft, and hot-melt glue to tack down the large pulley and hose barb. None of these parts should be seeing significant force; if they are, you’re Doing It Wrong and the hot glue should hopefully break loose before something more important does. Using a non-permanent adhesive for the hose barb and pulley also allows this assembly to be disassembled later if needed. The shaft itself is free-floating and the large pulley rests against the ball bearing due to gravity. This will prevent damage due to crashing the needle into the table or too-tall part, but if you experience problems with the shaft riding up on its own, try adding a bit of extra weight or put a dab of adhesive where the shaft passes through the lower bearing.

Suggested “v2” improvements
–Move air valve (if/when one is specified) onto head to minimize air volume between valve and head. Needed? (may be beneficial for reversed aquarium pumps or other weak vacuum sources)
–Bump detect: rather than firmly adhere the shaft into the bearing, allow it to float up and down, normally resting by gravity with the large pulley against the ball bearing. Place a contact switch just above the pulley: if the head/part contacts the surface with more than minimal force (enough to lift the shaft), contact switch is triggered. This could be used to halt the machine if a bump was not expected. If the switch’s trigger position is reliable enough, it could be used intentionally to automatically determine component heights.
–Probe function: There is a conductive metal path from the needlepoint all the way up to and including the bearing outer race, so it would be easy to touch a contact here and use the needle to probe for any conductive objects (e.g. find the tabletop if it is metal, or some capacitive shenanigans for PCBs/etc.). Useful?

Toward an open-source Pick and Place machine

So, there’s some really cool, empowering stuff going down these days with regard to manufacturing. Cartesian machines (i.e. CNC mills) are relatively simple to build from off-the-shelf parts; there are a bajillion people doing this and plenty of ready-made open-source designs available. More recently, hobbyists have gotten in on designing open-source rapid prototypers (3D printers); as a result, designs have now crossed the sub-$1000 threshold off-the-shelf, and you can even build a GPL’ed 3D printer that can almost replicate itself!

One thing that I haven’t seen cross the blood-brain barrier of proprietary commercial systems is pick-and-place machines that can assemble electronics. These things are badass; full of automated win and articulating robotic arms, but they’re also damned expensive: the crap ones start at >$10k and use literally a fishing-lure-and-weight type arrangement to peel back the tape covering tape-and-reel parts, so you have to keep resetting the weights. Those with more advanced / less manual feeders scale skyward from there. And of course, the software end of these things, especially machine vision algorithms to place parts more accurately, is some serious $ecret $auce. So… let’s change this!

Most of the “big stuff” is straightforward: The PCB layout software generates a list of coordinates for each part. A small vacuum needle mounted on a Cartesian head picks up each part from a known location, rotates it 90/180/etc. degrees as needed, and sets it down at its coordinates. It does not even need to be 100% accurate: surface tension of the solder during reflow will pull most minorly misaligned parts back into place.

The big barriers are:

1) Low cost / self-manufacturable feed mechanisms:
Electronic parts are packaged in several different ways, most commonly tape-and-reel, plastic tubes, or in trays. Each has a different, maybe cumbersome, way of knowing the location of the next part in the package and freeing the part from the package. Picking up stuff and putting it down is easy compared to dealing with the wide variety of tape and tube sizes reliably. Oh, and if your board uses 50 unique parts, you need 50 feeders. Hence the emphasis on making them cheap and mass-self-produceable, e.g. by CNC or casting or 3D printing.


2) Machine Vision
For larger parts, once the first part is successfully picked (e.g. by human intervention), it is enough to know how many parts per inch of tape, advance the tape a known amount per pick, then just grab blindly for the part and plant it at its destination coordinates. But for smaller and finer parts, this is not accurate enough: the parts can be slightly off-center or crooked in their tape wells, and this becomes significant as the part size decreases. Professional machines use a set of cameras and image processing algorithms to recognize the part, find its dead center and correct any rotational error. In theory, a suitably good vision system would allow you to peel back the tape and just sprinkle the parts on the table, forgoing feed mechanisms entirely at the expense of some small manual labor. Actually programming this algorithm on the other hand…

Another nice thing to have would be:

3) Automatic needle swapping. Many more advanced CNC mills are able to spit out their current tool, e.g. a specific size drill bit (in a known location in a tool rack) and pick up a different tool. It would be nice for the pick and place machine to be able to change to smaller and larger needles/suction cups to handle large and small parts seamlessly. If not, placements can be sorted, e.g. smallest to largest, so that the needle only has to be manually changed a couple times.

I’ve made some very initial feasibility-study stabs at building such a machine, and begun building a bit of hardware. I created a separate page for this project with more detailed specs/documentation and progress so far:
Pick and Place Project