Hi Team,
I am using the S32K322 microcontroller and have implemented the encoder interface to obtain the rotor angle from a position sensor.
I have configured the required MCAL modules, including TRGMUX, LCU, and eMIOS, based on the application note. The encoder functionality is operational; however, I have observed unexpected behavior with the CW and CCW counters.
My questions are as follows:
Attached the video for your reference
Regards,
Thiru
Hi,
The CW and CCW outputs from LCn are not position counters by themselves. According to the incremental encoder implementation, used LCn generates pulse streams on the CW or CCW output at every A/B signal edge, depending on the detected quadrature sequence. eMIOS then counts these pulses to accumulate position. This matches the S32K3 quadrature approach where PHA/PHB are processed by LCU and eMIOS acts as the counter for position accumulation. https://community.nxp.com/t5/S32K/Quadrature-decoder-on-S32K344/m-p/1507580
If the rotor is truly static and the encoder A/B inputs are stable, then new CW/CCW pulses should not be continuously generated. So both CW and CCW counters incrementing while the absolute position remains zero is not the expected “ideal” behavior.
A few things are worth checking:
This should help determine whether the issue is caused by encoder signal activity/noise or by an eMIOS configuration issue.
BR, Petr