Quadrature Encoder Speed and Distance
Decode direction, speed and distance from a quadrature encoder and detect missed counts.
Learning objective
Decode direction, speed and distance from a quadrature encoder and detect missed counts.
Components and tools
- Development board
- Current-limited low-voltage supply
- Digital multimeter
- Oscilloscope or logic analyser
- Emergency power disconnect
Safety before motion
- Use level shifting or pull-ups appropriate to the encoder.nSecure rotating parts before speed tests.nUse hardware counters for high-rate encoders.
Pin and power connections
| Controller pin | Driver / device pin | Purpose | Voltage / notes |
|---|---|---|---|
| Interrupt A | Encoder A | Quadrature phase A | Logic levelnInterrupt B |
Practical procedure
- Verify encoder voltage and output type.nRotate slowly and inspect A/B phase.nCount one channel, then x2/x4 decoding.nCalculate distance per count.nIncrease speed and check for lost counts.
Measurement checkpoints
| Checkpoint | Expected | Instrument | Safety limit |
|---|---|---|---|
| Phase | A/B approximately 90° apart | Logic analyser | Valid logic levelsnDistance |
Troubleshooting
| Symptom | Check | Corrective action |
|---|---|---|
| Direction wrong | A/B order reversed | Swap in software or wiringnCounts missing |
Engineering sizing tools
Calculate before powering
Mandatory pre-start gate
Machine safety checklist
The simulated enable button remains locked until every item is confirmed.
