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!
Hi
Encoder Lines in Kinetis Motor Suite User's Guide
QEIS_readPositionCounter will not give you velocity.
FRDMKV31F_SNSRDVEL_KDS_1_1_0_312
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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.