Home▸Engineering & Materials▸Rotary Encoder: Quadrature Decoding and Speed Estimation by Pulse Counting vs Period Timing

Rotary Encoder: Quadrature Decoding and Speed Estimation by Pulse Counting vs Period Timing

Spin a slotted optical encoder disk and decode its two quadrature channels into position and direction, then estimate the shaft speed either by counting pulses in a fixed gate (M method) or by timing the interval between edges (T method). Change the lines per revolution, speed, gate time and timer clock to see the quantisation error of each method and the crossover speed where one overtakes the other. A Blender-built disk, motor and optical fork sensor, with numerical checks built in.

Engineering & Materials3DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 2D version
Rotary Encoder: Quadrature Decoding and Speed Estimation by Pulse Counting vs Period Timing ↗ Open standalone

Spin a slotted optical encoder disk and decode its two quadrature channels into position and direction, then estimate the shaft speed either by counting pulses in a fixed gate (M method) or by timing the interval between edges (T method). Change the lines per revolution, speed, gate time and timer clock to see the quantisation error of each method and the crossover speed where one overtakes the other. A Blender-built disk, motor and optical fork sensor, with numerical checks built in.

⚙ Under the hood

Spin a slotted optical encoder disk and decode its two quadrature channels into position and direction, then estimate the shaft speed either by counting pulses in a fixed gate (M method) or by timing the interval between edges (T method). Change the lines per revolution, speed, gate time and timer clock to see the quantisation error of each method and the crossover speed where one overtakes the other. A Blender-built disk, motor and optical fork sensor, with numerical checks built in.

Technology SimulationsVirtual RealityWeb DevelopmentRotary EncoderQuadrature DecodingSpeed MeasurementQuantisation ErrorSensors

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)