Skip to content
SDB
Sensing & Perception

2 hours

Position, Velocity and Acceleration Sensors

Measuring Motion State in Robotic Systems

Subhendu Datta BhowmikRobotics Tutorials

Rotary Encoders: The Foundation of Joint Sensing

Rotary encoders are the most common sensor for measuring joint angle in robot arms. They convert shaft rotation into electrical signals that a controller can count and interpret as angular position.

Incremental encoders produce a pulse train as the shaft rotates. A counter accumulates pulses from a known reference (home position). They are simple and inexpensive but lose position information on power loss — a homing routine is required at startup.

Absolute encoders output a unique digital code for every shaft position (Gray code or binary). Position is known immediately at power-on with no homing required. They are more expensive but essential for safety-critical applications.

Quadrature encoding uses two signals (A and B channels) offset by 90°. By monitoring which channel leads, the direction of rotation is determined. By counting all edges (four per cycle), the effective resolution is multiplied by four — this is called 4X decoding.

Resolvers are analog sensors using transformer-coupled windings. They output sine and cosine signals proportional to shaft angle: V_sin = V_ref × sin(θ), V_cos = V_ref × cos(θ). Resolvers are highly robust to vibration, temperature, and contamination — preferred in harsh industrial environments.

Hall effect sensors use the magnetic field of a permanent magnet attached to the shaft to produce a digital commutation signal. While lower resolution than encoders, they are compact and used in brushless DC motors for commutation and coarse position sensing.

Encoder Resolution and Velocity Calculation

For a quadrature encoder with N pulses per revolution (PPR), the angular resolution using 4X decoding is:

Resolution = 360° / (N × 4)
Angular velocity is computed by measuring the time between pulses or counting pulses over a fixed interval:

ω = Δθ / Δt = (pulses_counted × 360°) / (N × 4 × Δt)

Linear velocity at end-effector requires application of the robot Jacobian:

v = J(q) × q̇

Higher PPR improves resolution but increases counter frequency requirements. A 2500 PPR encoder with 4X decoding gives 10,000 counts/rev, or 0.036° resolution.

Comparison of Position Sensor Technologies

TypePrincipleTypical ResolutionProsCons
Incremental EncoderOptical grating or magnetic, pulse counting100 – 100,000 PPRLow cost, high speed, simple interfaceLoses position on power loss, needs homing
Absolute EncoderOptical Gray code or multi-turn magnetic12 – 24 bits per revolutionPosition known at power-on, no homingHigher cost, more complex interface (SSI, BiSS)
ResolverTransformer with sin/cos windings12 – 16 bit (via R/D converter)Highly robust, works at high temperatureRequires R/D converter, bulkier than encoder
PotentiometerResistive wiper on a track10 – 12 bit (with ADC)Very simple, inexpensive, absoluteMechanical wear, limited life, lower accuracy
Hall Effect SensorMagnetic field switching3 – 6 positions per revolution (commutation)Compact, no mechanical contact, low costVery coarse resolution, mainly for commutation
Capacitive EncoderCapacitive sensing of graduated scale14 – 20 bitCompact, immune to magnetic interferenceSensitive to contamination, higher cost

Inertial Measurement Units: Measuring Dynamics

An Inertial Measurement Unit (IMU) combines a gyroscope and an accelerometer in a single package, often alongside a magnetometer, to measure the dynamic motion state of a rigid body.

MEMS gyroscopes (Micro-Electro-Mechanical Systems) exploit the Coriolis effect: a vibrating proof mass experiences a force perpendicular to both its velocity and the rotation axis. Capacitive sensing detects the resulting deflection, yielding angular velocity (rad/s). MEMS gyroscopes are compact and inexpensive but exhibit bias drift — the zero-rate output slowly changes with temperature and time.

MEMS accelerometers measure the specific force (acceleration minus gravitational acceleration) on a proof mass suspended by spring-like structures. At rest, they measure gravity — from which tilt angle can be inferred. During motion, they measure the sum of kinematic and gravitational accelerations.

A 9-DoF IMU adds a magnetometer to provide a heading reference relative to Earth's magnetic north, enabling full 3D orientation (roll, pitch, yaw) estimation via sensor fusion algorithms such as the Madgwick or Mahony filter.

Tactical-grade and navigation-grade IMUs (ring-laser gyroscopes, fiber-optic gyroscopes) offer orders-of-magnitude lower drift and are used in aerospace and autonomous vehicles, but cost thousands to tens of thousands of dollars.

IMU Integration and Drift

Velocity is obtained by integrating accelerometer output; position by double integration:

v(t) = v₀ + ∫a(τ)dτ

x(t) = x₀ + ∫v(τ)dτ
Orientation is obtained by integrating gyroscope output:

θ(t) = θ₀ + ∫ω(τ)dτ

Angular acceleration (for torque estimation) can be obtained by differentiating encoder velocity:

α = Δω / Δt

Integration amplifies noise. A constant bias b in the accelerometer reading produces position error growing as ½bt². After 60 seconds, a 1 mg (0.0098 m/s²) bias produces ~17.6 m of position error — illustrating why IMU-only navigation is unsuitable for long durations.

Key Principles of Motion Sensing

  1. 01

    Incremental encoders require homing at startup; absolute encoders provide position immediately — the choice depends on application safety requirements.

  2. 02

    Quadrature decoding (4X) multiplies effective encoder resolution by four by detecting all rising and falling edges of both A and B channels.

  3. 03

    Resolvers are preferred in harsh environments (high temperature, vibration, contamination) despite requiring a Resolver-to-Digital (R/D) converter.

  4. 04

    MEMS IMUs are ubiquitous in robotics due to size and cost, but exhibit bias drift that must be compensated through calibration and sensor fusion.

  5. 05

    Double integration of accelerometer data to obtain position amplifies noise quadratically — IMU-only positioning drifts rapidly and must be corrected by external references.

  6. 06

    Sensor fusion of encoders and IMU provides robust velocity and acceleration estimates that outperform either sensor alone.

  7. 07

    For collaborative robots, joint torque sensors (measuring motor current or using strain gauges) enable safe human-robot interaction by detecting unexpected contact forces.

Sensing & Perception