Connect quadrature rotary encoder to iMX8M-Plus

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Connect quadrature rotary encoder to iMX8M-Plus

1,512件の閲覧回数
vix
Contributor II

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 返答(返信)

1,240件の閲覧回数
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 件の賞賛
返信

1,192件の閲覧回数
vix
Contributor II

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 件の賞賛
返信

1,185件の閲覧回数
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 件の賞賛
返信

1,179件の閲覧回数
vix
Contributor II

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 件の賞賛
返信

1,492件の閲覧回数
vix
Contributor II

Hi @joanxie 

PWM is ok for driving DC motors.

But I wonder about the quadrature rotary encoder.

Can you give more details, please?

0 件の賞賛
返信

1,484件の閲覧回数
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 件の賞賛
返信

1,501件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

you can use PWM to connect motor

0 件の賞賛
返信