Quadrature_Decoder

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

Quadrature_Decoder

跳至解决方案
2,384 次查看
erik_ziel
Contributor II

Hello all,

I try to use the Quadrature Decoder Model-Based Design toolbox. 

encoder.PNG

First try doesn't work, but as I changed the prescale factor from 1 to 2 it works more or less as expected.

And is there a better explanation of these module? 

The build in help unfortunately doesn't explain all configurable parameters and what's there influence.

Another thing is the FTM counter counts in one direction, regadless of the turning direction from my rotation sensor.

Am I wrong with the assumption that counter increases and decreases depending from A and B channel?

Thanks for any help.

regards

Erik

0 项奖励
回复
1 解答
2,232 次查看
erik_ziel
Contributor II

Hello Marius,

I used the example to setup my model and now it works, thanks for that.

The only thing is I didn't discover the difference in the moment, but that does not matter, it works now.

regards

Erik

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,232 次查看
mariuslucianand
NXP Employee
NXP Employee

Hello erik.ziel@autoliv.com‌,

With our toolbox we provide a great example called ftm_qd_s32k14x. This example shows how the QD works either in Count and Direction or Phase A and Phase B mode on the S32K144EVB. You need to use the FreeMaster and to connect the pins like in the model description. 

However, the best explanation about the QD module, can be read from the S32K-Reference manual.

Long story short:

Quadrature Decoder – Count and Direction Encoding mode

In this mode, the phase B input value indicates the counting direction, and the phase A input defines the counting rate. The FTM counter is updated when there is a rising edge at phase A input signal.

pastedImage_2.png

Quadrature Decoder – Phase A and Phase B Encoding Mode

In this mode, the relationship between phase A and B signals indicates the counting direction, and phase A and B signals define the counting rate. The FTM counter is updated when there is an edge either at the phase A or phase B signals.

pastedImage_5.png

If you want to use the Count and direction Encoding Mode please also select this in the QD Mask, because in your example it looks like there is a bad setting.

Hope this helps you,

Marius

0 项奖励
回复
2,233 次查看
erik_ziel
Contributor II

Hello Marius,

I used the example to setup my model and now it works, thanks for that.

The only thing is I didn't discover the difference in the moment, but that does not matter, it works now.

regards

Erik

0 项奖励
回复
2,232 次查看
mariuslucianand
NXP Employee
NXP Employee

Hello erik.ziel@autoliv.com‌,

Are you talking about the difference from our example or the difference about the modes?

Best Regards, 

Marius

0 项奖励
回复