HomeRobotics & KinematicsQuadrature Rotary Encoder (2D Disc & Scope)

Quadrature Rotary Encoder (2D Disc & Scope)

Interactive 2D quadrature rotary encoder: a slotted disc turns past two fixed optical read-heads 90 degrees out of phase, decoding A/B square-wave edges into position and velocity — drag the disc to jog the shaft by hand and watch pulse counts, decoded angle and position drift respond live on a scrolling oscilloscope and quadrature state-plane.

Robotics & Kinematics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-robotics-engineering ↗ Open standalone

Every closed-loop robot joint needs to know exactly where it is and how fast it's moving, and the workhorse sensor for that job is the quadrature rotary encoder: a slotted disc spinning past two optical read-heads set a quarter slot-period apart. This 2D simulator drives a top-down encoder disc from a motor-speed slider, decodes the resulting A/B square waves into a pulse count using selectable ×1/×2/×4 quadrature decoding, and derives both a decoded shaft angle and a sampled-window velocity estimate exactly the way a real servo drive would. Drag the disc directly to jog the shaft by hand, watch the scrolling oscilloscope and the A–B state-plane trace the four quadrature states, and use the sensor-noise slider to see position drift accumulate in real time — and why industrial drives re-home against a once-per-revolution index pulse rather than trusting pulse counts forever.

⚙ Under the hood

Interactive 2D quadrature rotary encoder: a slotted disc turns past two fixed optical read-heads 90 degrees out of phase, decoding A/B square-wave edges into position and velocity — drag the disc to jog the shaft by hand and watch pulse counts, decoded angle and position drift respond live on a scrolling oscilloscope and quadrature state-plane.

roboticsencodersensorscontrol-systemskinematicsservo

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)