Build pathIntermediateA weekend

Build a Pick-and-Place Robot That Knows It Missed

An arm that picks parts from a tray and sorts them into two bins, detects an empty grasp, retries, and logs how many cycles it got right.

Build a Pick-and-Place Robot That Knows It Missed technical schematicTAPER 20°SERVOSPRING kGRASP LINECONE ±31° AT μ 0.6WINDOWCRUSHSLIP0 STEPS FITTHE KNOB IS A POSITION · THE WALLS ARE FORCES

What you are building

An arm that empties a tray. Parts go in one of two bins depending on something you can tell about them — size, colour, which fixture they came from — and the machine runs unattended until the tray is empty or something goes wrong, at which point it stops and says which state it stopped in.

The robot is not the interesting part. Four-DOF arm kits are £40 and the kinematics are a page of trigonometry. The interesting part is that a pick-and-place machine is judged on a percentage, and getting from “it worked on video” to “it did fifty in a row” is a different engineering problem from getting it to move at all.

Two things get you there, and both are in the gripper.

The two decisions that matter

1. The finger must not be stiff

This is the one that surprises people, so it is worth stating plainly before you print anything.

Your gripper’s knob is a position — a servo angle. The object’s limits are forces: a floor below which it falls out, a ceiling above which it is destroyed. The exchange rate between them is the series stiffness k of everything between the horn and the object, so the window you actually have to aim at is

window (mm) = ( min(F_crush, F_servo) − F_slip ) / k

A rigid printed finger is around 25 N/mm. A hobby servo on a 30 mm lever arm resolves about 0.524 mm of jaw travel. Run the numbers for a strawberry and the window is 0.108 mm — five times finer than one step, which means there is no command that works and no amount of tuning finds one.

Finger k Window Servo positions that work
Rigid printed 25 N/mm 0.108 mm 0
Foam pad 4 N/mm 0.677 mm 1
Spring in series 0.8 N/mm 3.386 mm 7
Printed flexure 0.35 N/mm 7.739 mm 15

Put a 40p extension spring between the horn and the finger and the problem goes away. Size yours in the lab with your own object and your own lever arm before committing filament, and read servo gripper force, stall and compliance for the full argument.

2. There has to be a verify step

The cycle is approach, descend, grasp, verify, lift, transfer, place. Without the verify state, every failure is silent: the gripper closes on nothing, the arm carries air across the table and opens over the bin, and the counter says it worked.

A lever microswitch on the inside of one finger costs fifty pence and one input pin, and it is the single highest-value part in this build. Read it after a 300–400 ms dwell — a compliant finger rings after closing and sampling during the ring gives you a coin flip — debounce it across three consecutive readings, and give the state machine a RECOVER state with a bounded retry. The state machine tutorial has the whole thing.

The build, in order

  1. Decide the end effector. If your parts are flat and reachable from above, price a suction cup and a small pump first — it will beat anything you print. Otherwise, two fingers. Gripper types and grip force.
  2. Measure your object. Mass on a kitchen scale, crush force on the same scale with a few sacrificial parts, μ with a luggage scale dragged across the pad material. These three numbers decide the design, and the ones you find online are wrong for your part.
  3. Check force closure. If the faces where the pads land are tapered more than atan(μ), nothing you do with force will hold it, and you need a V-groove or a different grasp point. Friction and force closure.
  4. Size the gripper in the lab. Lever arm from the widest object, then check the window against the servo step. The gripper simulator.
  5. Print the gripper with a flexure or a spring in series, TPU pads, a hard stop, and a microswitch. Servo gripper.
  6. Wire five servos properly. PCA9685 over I²C, separate servo rail, decoupling. Do this before you write firmware or you will spend a day debugging resets that are a power problem.
  7. Write the state machine, non-blocking, with VERIFY and RECOVER. Pick-and-place state machine.
  8. Bound the acceleration with a motion profile, so the grip you sized survives the transfer.
  9. Run fifty and count.

The measurement

Fifty consecutive cycles, unattended, with a counter and a fault log that records which state each failure happened in. That is the deliverable, and it is much more demanding than a video.

Result What it means
Above 95% You have a machine. Move on to sensing the pose rather than hard-coding it
80–95% Usually the approach pose, or not enough settle time before the verify
Below 80% Usually power, or a grip sized without the acceleration term
Fails late in the run only Servo heating, or pads getting dirty. Both are real and both look like ghosts

The failure table in the state machine tutorial maps most symptoms to causes.

What this project is not

It does not do vision, and it does not plan around obstacles. The tray is in a known place, the bins are in known places, and the arm goes where it is told. That is deliberate — the point of this build is that grasping is a separate, harder-than-it-looks problem from positioning, and conflating the two is why first pick-and-place builds stall.

When you want the arm to find the part rather than be told where it is, that is camera calibration and marker pose, and it sits on top of a working pick cycle rather than replacing one.

Project roadmap

The build path

Follow the tech tree from parts to a robot that follows a taped line. Each node unlocks when its prerequisites are done, and your progress saves on this device.

0 / 21 done

100%
Goal

An arm that sorts a tray and knows when it missed

The whole project

Tutorial

Driving five servos without resetting the board

30 min

Learning path

Grasping and end effectors

Learning path

Open path
Build

Sort fifty parts unattended

The measurement

Components

Tutorials in this path

Practise before you wire

Tune it in the live simulator

The build path routes through a browser lab. Find gains that follow the track cleanly here, then transfer them to the real robot.

Frequently asked questions

What is the hardest part of a pick-and-place build?

Not the arm and not the kinematics — it is that the gripper commands a position and the object cares about a force. With stiff printed fingers the usable window between dropping a part and crushing it works out around a tenth of a millimetre, while one step of a hobby servo moves the jaws about half a millimetre. No command lands in the window. The fix is a spring or a flexure in series, which opens the window in proportion to 1/k, and it is the decision that makes or breaks the whole project. Size it in the gripper simulator before you print anything.

Why does my robot arm drop the part when it moves?

Because you sized the grip for the weight and the move needs more. Required grip force is m(g + a)·SF/(μ·n), and on a brisk arm the acceleration term is bigger than gravity. A grasp that holds 58 g standing still at 1.63 N needs 1.93 N through a 250 mm lift in 0.9 s and 2.59 N if you do it in 0.35 s — and it lets go about 40 ms into the move, before the arm has visibly travelled, which is why it reads as the gripper failing rather than as arithmetic. Bound the acceleration with a motion profile or grip harder; usually the profile is the cheaper fix.

How do I know whether the gripper actually picked something up?

A lever microswitch on the inside face of one finger, wired to an input pin with a pull-up. About fifty pence, one wire, and it is a direct digital answer. Put it on the compliant part of the finger so it trips at a repeatable force, debounce it in software (three consecutive readings, not one), and read it after a 300–400 ms dwell so you are not sampling the finger's ring. Current sensing also works and additionally catches a crush, but it needs a calibrated threshold and it drifts as the battery sags.

Do I need inverse kinematics for this?

Not strictly — you can teach poses by hand and store the joint angles, and for a fixed tray and two fixed bins that is genuinely enough. You need IK the moment you want a straight-line approach and retreat, because those are Cartesian moves and hand-taught joint angles will not give you one. Since diving at a part from an angle knocks it over and lifting along a curve drags it, most builds end up wanting the straight segments, and that means IK.

How many servos and how much power?

Five: base, shoulder, elbow, wrist and gripper. That is more channels than an Uno should be timing itself, so use a PCA9685 over I²C. Power is the part people underestimate — five hobby servos moving together pull several amps of inrush, and the board's 5 V regulator will brown out and reset the controller mid-pick. Give the servos their own supply with a common ground and a few hundred microfarads near the board.

What counts as done?

Fifty consecutive cycles with a counter and a fault log, unattended. That is a far better target than a video of one successful pick, because it forces you to build the verify step, the bounded retry and the power supply that does not sag — which are exactly the three things that separate a demo from a machine. Below 95% there is always one specific cause, and the log tells you which state it failed in.