Hi.
I using the KMS without problem using the "sensorless velocity" mode.
Now I try to use the "position control" mode, but I have problems with encoder (I think...).
I use a magnetic encoder with ABI output connected directly to MKV31, configured to 2048 counts, and a 8 poles motor.
In the motor basic informatión, I put next values:
* pole pairs = 4
* Encoder Lines = 512.
Why "512", because I read:
- PPR, P/R, sometimes notated as C/T = Pulses per revolution
- LPR, L/R = Lines per revolution (same as PPR)
- CPR = Counts per revolution. Usually means encoder resolution after 4X decoding. However, some manufacturers (such as Avago and USdigital) specify PPR value as CPR.
This is an Datasheet Example Quadrature Output for 8 Positions


If I configure the output for 2048 positions, the Encoder Lines may be:
counts/rev 2048
USER_MOTOR_ENCODER_LINES = ------------------- = -------------- = 512 Lines
x4 Decoding 4
It's this OK ??
Allways appears an error:


I try change two phases of motor, and change two signals of encoder by software in qei_sys.c
#define HW_CHAN0 (0U) /* FTM Channel Assignment for PHA */
#define HW_CHAN1 (1U) /* FTM Channel Assignment for PHB */
// #define HW_CHAN0 (1U) /* FTM Channel Assignment for PHA */
// #define HW_CHAN1 (0U) /* FTM Channel Assignment for PHB */
If a read the QEI using "uint16_t QEIS_readPositionCounter(void)" function, the signal is read correctly.
The motor turn one or two seconds and appers the error.
Sometimes, the motor turn in the one side, and next try to turn in another side.
But I can't get to KMS accept the parameters.
What am I doing wrong?
Thank you.