General PCB Services

Encoder Readings Jump Randomly When Motor Speed Increases

userHead Eva.Green 2026-04-27 02:07:10 245 Views1 Replies

Hi everyone,
I’m working on a motion control prototype using an STM32 to read a quadrature encoder. At low RPM the position count is accurate, but once the motor speed increases, the count occasionally jumps forward or backward by a few steps.

I’m using timer encoder mode, and the encoder cable runs close to the motor phase wires.

Questions:

Is this usually caused by electrical noise or timer input filtering limits?

Should I add hardware line receivers or RC filtering on A/B signals?

On the PCB, is it better to route encoder inputs with ground reference traces and keep them away from power sections?

2026-04-27 18:30:02

Most likely electrical noise first …. encoder cable runs near motor phase wires:

PWM switching and motor current create EMI
Noise can inject false edges on A/B lines
Timer encoder mode then counts extra/missed pulses

 

Hardware line receivers or RC filtering ….. both will work ….. but I would recommend the line recvrs

 

Differential encoder & line receiver (RS422 style) …… best noise immunity
Schmitt-trigger buffer for single-ended signals …. check this dicussion: https://www.reddit.com/r/AskElectronics/comments/16je8ej/schmitt_trigger_how_does_it_work/
Small RC filter only if values are low enough not to distort valid pulses

Use RC carefully, because too much filtering can lose counts at high RPM.

 

PCB routing for encoder inputs …. Route encoder traces with a solid ground reference
Keep them far from MOSFETs, gate drivers, motor phases, and power loops
If possible, route A/B as a pair together
Avoid parallel runs beside high-current switching traces

Use seperate GND and power planes, if possible …. it helps a lot …. https://www.pcbway.com/blog/Engineering_Technical/Routing_Layers_and_Ground_Planes__Power_Planes.html

userHeadPic ahsrab.rifat