Connect quadrature rotary encoder to iMX8M-Plus

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Connect quadrature rotary encoder to iMX8M-Plus

3,064 次查看
vix
Contributor III

I need to conect a quadrature rotary encoder to an iMX8M-Plus processor (Cortex-M core), so that I can detect the position from an electric motor.

I downloaded the reference manual, and I see that there isn't a dedicated hardware peripheral.

Which is the best peripheral to use for this purpose?

GPT, PWM or GPIOs?

Is there any application note or reference design for this?

Thanks

0 项奖励
回复
7 回复数

2,792 次查看
MPUUser
Contributor I

Hi, I would like to revisit this questions. How do we connect quadrature rotary encoder? Or it is not supported by IMX8MPlus?

PWM is output to motor. Quadrature rotary encoder is input from motor to the MPU. Thanks.

0 项奖励
回复

2,744 次查看
vix
Contributor III

You must configure three general purpose inputs (A, B and R) and handle all of them manually.

You can take inspiration from several github projects; as an example this one by DavidAntliff

0 项奖励
回复

2,737 次查看
MPUUser
Contributor I

Hi Vix,

 

Thanks for your suggestion. That looks like a software solution.

That means IMX8MPlus doesn't have a hardware decoder for the encoder.

What about single phase encoder where it only has 1 pulse? Can we use capture input?

Does it support 4 independent capture inputs as I have 4 encoders with 1 phase output?

 

Thanks.

0 项奖励
回复

2,731 次查看
vix
Contributor III

That means IMX8MPlus doesn't have a hardware decoder for the encoder.

Right

 

What about single phase encoder where it only has 1 pulse? Can we use capture input?

You should read the Processo Reference Manual.

As far as I can see, only GPT1 has capture input capabilities (1 or 2 lines).

Not sure if it can be used to implement an encoder.

0 项奖励
回复

3,044 次查看
vix
Contributor III

Hi @joanxie 

PWM is ok for driving DC motors.

But I wonder about the quadrature rotary encoder.

Can you give more details, please?

0 项奖励
回复

3,036 次查看
joanxie
NXP TechSupport
NXP TechSupport

don't have detailed example on imx8mp, but you can refer to this, add by yourself according to the link as below

"http://www.armadeus.org/wiki/index.php?title=Rotary_encoder_with_GPIOs"

"https://www.kernel.org/doc/Documentation/input/devices/rotary-encoder.rst"

0 项奖励
回复

3,053 次查看
joanxie
NXP TechSupport
NXP TechSupport

you can use PWM to connect motor

0 项奖励
回复