2392415_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2392415_en-US

2392415_en-US

Reg: S32K eMIOS Encoder CW/CCW Counter Behavior in Static Rotor Position

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:

  1. During a static rotor position (i.e., when the rotor is not moving), is it expected for the CW and CCW counters to behave as free-running counters?
    • In my case, both the CW and CCW counters continue to increment, while the absolute position value remains at zero. Is this expected behavior?
  2. If this is expected, what is the reason for the CW and CCW counters incrementing even though the rotor is stationary?
  3. If this is not expected, could you please suggest:
    • Any configuration changes required in the MCAL setup (TRGMUX, LCU, or eMIOS)?
    • Any additional software mechanism or filtering that should be implemented to prevent the CW/CCW counters from incrementing when the rotor is stationary?

Attached the video for your reference

AWS-LIBRARIES-S32K3 


Regards,

Thiru

Re: Reg: S32K eMIOS Encoder CW/CCW Counter Behavior in Static Rotor Position

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:

  • Verify that the eMIOS channel is really counting the CW/CCW input pulses and not an internal clock source.
  • Check the UIN status of the used eMIOS channel in the debugger. If UIN remains constant while the counter increments, the channel may not be using the intended external input.
  • If UIN is toggling while the rotor is stationary, investigate encoder A/B signals, TRGMUX routing, LCU outputs, and input filtering.
  • Also monitor the encoder A/B signals and LCU CW/CCW outputs on a scope to rule out noise or glitches.

This should help determine whether the issue is caused by encoder signal activity/noise or by an eMIOS configuration issue.

BR, Petr

Tags (1)
No ratings
Version history
Last update:
Thursday
Updated by: