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.
Solved! Go to Solution.
I assume it is an instantaneous change issue and not a pure speed issue.
You can bypass the flux id:
I don't have much confidence that this will work, but you can give it a shot.
My advice would be to switch to the other device and start from there.
Sergi,
I've run into issues finding the line count for magnetic encoders in the past. Can you provide the specific part number you are using?
Initially, I would suggest trying 2048 instead of 512, just to see if that works.
The other thing to look into is electrical noise on the encoder wires. The easiest way to test for this is to use an oscilloscope and look at the ABI signals when the motor is running. If those signals are not very clean it can cause encoder issues. Only things you can really do to help with this is to ground the motor body, separate the motor phase wires from encoder wires, and shield the encoder wires.
Hi Adam.
I use the magnetic encoder AS5601, but I will change to AS5047D in the next prototypes.
The ABI signals are OK. And yes, I tried to use 2048 instead of 512, but nothing. I tried all possible combinations.
With 512, is the only configuration that motor turn a few seconds before appear the error window.
This is the ABI signal in the input of MKV31.
Sergi,
Those signals look pretty good.
On reading the datasheet I became concerned about the limited maximum speed of this encoder.
It says here that the maximum speed when using the incremental output is 456 rpm. Also the two notes on the bottom are concerning when operating with a motor. This encoder module may not be suitable for motor operations.
I think you have the encoder lines correct but I don't think this chip is fast enough to work for motor control applications. The other chip you have selected looks like it should work great though.
Yes. I know. This is the reason to change encoder to AS5047D.
But also try to set "Rated speed" of KMS to 400rpm to limit this, but I have same problem.
I assume it is an instantaneous change issue and not a pure speed issue.
You can bypass the flux id:
I don't have much confidence that this will work, but you can give it a shot.
My advice would be to switch to the other device and start from there.