Cannot find Quadrature driver example

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

Cannot find Quadrature driver example

1,237件の閲覧回数
PedroCastro
Contributor III

Hi,

I am using KDS3.2 and KSDK 1.3 with KMS and I need a quadrature driver in order to measure thevelocity of a wheel. There is no examples in KSDK 1.3 examples' folders and the qei_sys.h,created by KMS, is a little bit confusing yet. So, is there any examples regarding quadrature encoders?

If not, regarding qei_sys.h generated by KMS. I have some doubts:
1)  in function: void QEIS_init(uint16_t qeiMaxPosCount){

      ...

      /* set the maximum count value equal to (4 * encoderLines) - 1 */
      FTM_HAL_SetMod(FTM_ENCODER_BASE, qeiMaxPosCount);

}

What do you mean by encoder lines?

2) The function:

uint16_t QEIS_readPositionCounter(void)
{

return FTM_HAL_GetCounter(FTM_ENCODER_BASE);

}

gives me a position counter, that does not represent velocity.

How can I obtain the velocity from this API?

Thanks in advance!

ラベル(1)
タグ(2)
0 件の賞賛
返信
2 返答(返信)

973件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Encoder Lines in Kinetis Motor Suite User's Guide

Encoder Lines.png

QEIS_readPositionCounter will not give you velocity.

QEIS_readPositionCounter.png

FRDMKV31F_SNSRDVEL_KDS_1_1_0_312

SNSRDVEL.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

973件の閲覧回数
linestream-adam
Senior Contributor I

Pedro,

The quadrature encoder interface doesn't contain the velocity calculation.  This is done in the encoder block.  This block is abstracted from the type of encoder and thus can work with any encoder type.

You might be better served by looking at a sensored velocity example project for how to work with the encoder.

0 件の賞賛
返信