Peg-in-hole

Also known as: peg-in-hole insertion

On this page 7

Peg-in-hole is the benchmark robotic insertion task in which a manipulator must guide a cylindrical or prismatic part into a mating hole whose clearance is smaller than the robot’s positioning error. In robotics and especially in manipulation research, peg-in-hole insertion stands for a whole family of assembly operations, from pressing bearings and dowel pins to plugging connectors and fitting shafts into housings.

The task is difficult not because of its geometry but because of contact uncertainty. A typical industrial arm repeats positions to within 0.02-0.1 mm, while a precision fit may allow only 0.005-0.05 mm of radial clearance, so the part almost never meets the hole perfectly. Success depends on compliance, force sensing and a search strategy that turns contact forces into corrective motion.

How peg-in-hole insertion works

Peg-in-hole insertion proceeds through a sequence of contact phases, each with its own failure modes. The robot first moves the peg near the hole in free space, then establishes contact, finds the hole, aligns the axes and finally pushes the peg to its target depth while the contact state changes several times.

Classical analysis models the peg as a rigid body touching the hole at one or two points. During one-point contact, the peg rim touches the chamfer or the hole edge; during two-point contact, the peg touches opposite walls and can wedge or jam if the applied force points in the wrong direction. The geometry of the chamfer, the friction coefficient and the clearance ratio determine how much angular error the system can tolerate.

The following table summarizes the phases that a controller must handle in order.

PhaseGoalTypical sensing signal
ApproachMove the peg above the hole quicklyJoint positions only
ContactTouch the surface with a bounded forceRising axial force, about 5-20 N
SearchLocate the hole openingSudden drop in axial force
AlignmentReduce tilt between peg and hole axesLateral forces and moments
InsertionReach the target depthSteady friction force and depth
Phases of a peg-in-hole insertion

Clearance, chamfers and the jamming condition

The clearance ratio, defined as the diametral clearance divided by the hole diameter, is the single most important parameter of a peg-in-hole problem. Fits with ratios above roughly 0.01 can often be done by position control alone, while ratios below about 0.001 demand active force feedback or passive compliance.

Jamming occurs when the forces applied to the peg are in the wrong proportion, so the peg stops moving even though the robot keeps pushing. Wedging is worse: the peg locks geometrically between two walls early in the insertion and can only be freed by backing out. The classical jamming diagram shows which ratios of lateral force, moment and axial force allow the peg to slide, and it explains why the point where the compliance acts matters so much.

The table below relates the main design parameters to their effect on insertion difficulty.

ParameterTypical rangeEffect on the task
Radial clearance0.005-0.5 mmSmaller clearance raises jamming risk
Chamfer size0.2-2 mm at 30-45 degreesLarger chamfer widens the capture region
Friction coefficient0.1-0.4 for dry metalsHigher friction narrows the stable force cone
Initial tilt error0.1-2 degreesLarger tilt causes earlier two-point contact
Insertion depth1-5 peg diametersDeeper insertion accumulates friction
Parameters that shape insertion difficulty

Compliance and control strategies

Every successful peg-in-hole system introduces compliance somewhere between the robot and the part, either passively in hardware or actively in software. Compliance lets the peg yield to contact forces instead of fighting them, which converts small misalignments into self-correcting motion.

The remote center compliance device is the classical passive solution: an elastic wrist whose center of compliance lies near the peg tip, so lateral forces translate the peg and moments rotate it about the right point. Active approaches use impedance control or admittance control, which make the end effector behave like a programmable spring-damper, and hybrid force-position control, which regulates force along the insertion axis while controlling position in other directions.

Each family of strategies trades cost, speed and flexibility differently.

StrategyStrengthLimitation
Remote center complianceFast, no sensors, very reliableTuned to one peg length and geometry
Impedance controlProgrammable stiffness per axisNeeds a torque-controlled or sensed arm
Hybrid force-position controlPrecise force regulation on the axisSensitive to contact model errors
Spiral or raster searchFinds holes despite position errorAdds cycle time of seconds
Learned policiesAdapt to varied parts and tolerancesRequire training data and validation
Main strategies for peg-in-hole insertion

A common practical recipe combines a spiral search in the surface plane, a constant downward force of 10-30 N and a compliant wrist. When the axial force suddenly drops, the controller infers that the peg tip has entered the hole and switches to alignment and insertion.

Peg-in-hole in relation to neighboring manipulation tasks

Peg-in-hole is a contact-rich assembly problem, which separates it from tasks dominated by free-space motion. It shares hardware with pick and place and depends on grasp planning, yet the critical decisions happen only after contact begins.

The comparison below places it among related concepts from the same field.

TaskDominant challengeMain tool
Peg-in-holeSmall clearance under uncertaintyCompliance and force feedback
Pick and placeReliable grasping and transportGrasp planning and trajectories
Bin pickingPerception in clutterPose estimation and grasp scoring
In-hand manipulationReorienting objects in the fingersDexterous hands and tactile sensing
Motion planningCollision-free pathsSampling or optimization planners
Peg-in-hole compared with related tasks

Because the task is simple to set up yet hard to master, it serves as a standard benchmark for reinforcement learning, tactile sensing and sim-to-real research, with variants such as square pegs, multi-pin connectors and gear meshing.

Common failure modes and how to avoid them

Most failed insertions trace back to excessive stiffness, poor force limits or a wrong assumption about where the hole is. Practitioners use the following checks when commissioning a cell.

  • Overly stiff control turns micrometer errors into large forces, damaging parts or triggering protective stops.
  • Missing force limits let the robot push through a jam instead of retracting and retrying.
  • Ignoring fixture tolerance shifts the true hole position beyond the search radius.
  • Wrong compliance center amplifies tilt instead of correcting it, which leads directly to wedging.
  • Uncalibrated force sensors drift with temperature and cable load, producing false contact detection.

A robust cell therefore logs force profiles per insertion. A stable profile indicates healthy parts and fixtures, while a growing peak force is an early warning of burrs, worn chamfers or a drifting fixture.

Put simply

Peg-in-hole is the robot version of putting a key into a lock in the dark. A person does not hit the keyhole perfectly at first; they feel the metal, slide the key around until it drops into the opening, then wiggle it straight and push.

A robot faces the same problem because its hand is never exactly where the hole is. The fix is to make the robot feel and give a little instead of pushing rigidly, so that small mistakes correct themselves. Sensing touch matters more than perfect aim.

In practice

An automotive supplier assembles electric power steering units and needs a robot to press a steel shaft of 12 mm diameter into a bearing seat with about 0.02 mm of radial clearance. The six-axis arm repeats its position to only 0.05 mm, and the fixture adds further variation, so pure position control jams in roughly one cycle out of ten.

The integrator mounts a six-axis force-torque sensor at the wrist, adds a 0.5 mm chamfer to the bearing seat and programs an impedance controller with low lateral stiffness. The robot touches down with 15 N, runs a small spiral search of up to 1 mm radius and detects the hole when axial force drops. It then aligns the shaft using the measured moments and presses to depth with a 150 N force limit.

After commissioning, the cell reaches a first-time success rate above 99.5 percent with a cycle time of about 4 seconds. Logged force curves also reveal when a batch of bearings arrives with burrs, allowing quality staff to stop the batch before parts are damaged.