Open Source Robotics

A curated collection of high-quality open source robotics projects, tools, and software to propel the robotics community forward.

Peg-in-hole insertion

  • Also called: peg insertion, peg-hole assembly
  • Category: Planning & manipulation › Manipulation
  • Tags: assembly, contact-rich-manipulation, force-control, compliance, benchmark

Inserting a part into a closely fitting hole; the standard benchmark for contact-rich assembly, where the clearance is often smaller than the robot's positioning error.

Definition

Peg-in-hole insertion is the assembly task of pushing a part, the peg, into a mating feature, the hole, with a small clearance between them. It stands in for a large share of real assembly operations: shafts into bearings, pins into bores, connectors into sockets and fasteners into holes. Because the task is easy to state but hard to do reliably, it has served for decades as the standard test for robot assembly and force control.

The difficulty is that clearances are usually smaller than the combined error of the robot's positioning, calibration and perception. A purely position-controlled robot that is slightly off either misses the hole or presses hard against its edge. Reliable insertion therefore uses contact: the robot moves until it touches, uses the measured forces and moments to infer how it is misaligned, and corrects. Classical quasi-static analysis, notably by Daniel Whitney, describes the two main failure modes. Jamming occurs when the forces and moments applied to the peg are in the wrong proportion to move it; wedging occurs when the peg touches the hole at two points and friction locks it in place. Chamfers on the peg or hole and compliance at the wrist help guide the peg in. The remote center compliance device, developed at the Charles Stark Draper Laboratory, is a passive wrist that places its center of compliance near the peg tip, so that contact forces correct lateral and angular errors on their own.

A typical active strategy splits the task into phases: approach; search for the hole with a spiral or tilted motion while pressing lightly on the surface; align once the peg drops partly into the hole; and insert under force or impedance control while watching for jams. Vision usually handles coarse alignment and force sensing handles the final fraction of a millimeter. Learning-based methods, including reinforcement learning and residual policies added to a hand-designed controller, are often benchmarked on peg-in-hole, as are category-level methods that must insert parts of varying shape without a model of each one. Connectors and snap-fit parts with near-zero clearance add the need to push through interference while staying aligned.

Why it matters

Insertion is one of the most common operations in assembly and one of the hardest to automate without precise fixtures and calibration. Methods that handle it reliably under uncertainty are a key step toward flexible assembly cells that can switch parts without being reengineered.

Key applications

  • Fitting pins, shafts and bearings in mechanical assembly
  • Plugging cables and connectors in electronics assembly and charging
  • Benchmarking force control and contact-rich learning methods
  • Fastener and screw insertion
  • Category-level manipulation with varying part geometry

In practice

An integrator automating the fitting of steel pins into machined bores has a robot whose positioning error after calibration is larger than the bore clearance. Rather than chase more accuracy, they mount a six-axis force-torque sensor at the wrist and run an impedance controller with low lateral stiffness. A camera locates the part to within a few millimeters. The robot approaches above the hole, presses down lightly and traces a small spiral; when the downward force drops and the measured moment shows the pin has started to enter, it switches to an insertion phase that pushes down while letting the wrist comply sideways. If the axial force rises above a threshold before the target depth is reached, the controller treats it as a jam, backs off slightly, and retries with a small tilt correction based on the measured moments.

Common misconceptions

  • Better calibration makes force sensing unnecessary — tight clearances are usually below what a standard robot and camera can achieve, so contact-based correction is still needed
  • Pushing harder frees a stuck peg — jamming and wedging come from the direction of forces and friction at the contacts, and extra force usually makes them worse
  • Peg-in-hole is a solved toy problem — the simple geometry hides real difficulty with tight clearances, flexible parts, varied materials and unknown part shapes
  • Compliance has to come from the controller — passive wrist compliance, chamfers on the parts and fixture design can do much of the work without active force control

Who should know this

  • Assembly and automation engineers
  • Force-control and manipulation researchers
  • Robot learning researchers working on contact-rich tasks
  • Designers of parts and fixtures for automated assembly

Related technologies

  • Remote Center Compliance Device
  • Six-Axis Force-Torque Sensor
  • Spiral Search Strategies
  • Contact-Rich Reinforcement Learning
  • Chamfered Part Design

Related terms

  • Impedance Control
  • Hybrid Position/Force Control
  • Passive Compliance
  • Force/Torque Sensor
  • Wrench
  • Semantic keypoint

Related projects

  • MuJoCo: DeepMind physics engine for robotics and ML research
  • ManiSkill: GPU-parallelized simulation for generalizable manipulation skills
  • robosuite: Modular MuJoCo simulation framework for robot learning research
  • LIBERO: Lifelong robot learning benchmark with 130 procedural tasks
  • Gymnasium-Robotics: Robotics RL benchmark environments for Gymnasium, from the Farama Foundation
  • MetaWorld: Multi-task and meta RL benchmark for robotic manipulation

This website requires JavaScript to function properly. Please enable JavaScript to explore our collection of open source robotics projects.