This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello experts,
the initialization of the encoders:
QDECCTL = 0x0000; //Quadrature Count Mode
QEPCTL[FREE_SOFT] =2;
QEPCTL[PCRM] = 0; //Position Counter Reset on Index Event
QEPCTL[IEI] = 0; //No init of position count on index event
QEPCTL[IEL] = 0x3; //Latch on index event marker
QPOSMAX = 4000-1; //Encoder1
//QPOSMAX = 10000-1; //Encoder2
It was tested on 2 different encoder types (see picture).
The problem:
At each reversal of direction the error "Position Counter Error" (QFLG[PCE]=1) occurs. The phenomenon can be seen on both encoders. Additionally with encoder 2 this error occurs from time to time with the movement direction "Counter Clockwise", although there is no change of the movement direction here. Is it a mistake of my initialization or an error of the two encoders or a general behavior of F2837x?
I also noticed that the interrupt "Index event latch interrupt" (QFLG[IEL]) and latching of QPOSCNT is only possible in the operation mode "Position Counter Reset on Index Event" (QEPCTL[PCRM] = 00). In the other operation modes (QEPCTL[PCRM] = 01, 10, 11) neither the interrupt (QFLG[IEL]) nor the latching of QPOSCNT are possible, no matter how the encoder is initialized. Is what I found correct?
Do you have any hints or tips for me?
Thanks in advance - Bui
Hi Bui,
Can you tell me specifically what encoder you are using and seeing this Position Counter Error. I don't believe I have seen this while interfacing with the LVSERVOMTR. The position-counter error interrupt flag QFLG[PCE] should only be set if the value that is latched on index event is not equal to 0 or the maximum configured position counter. This might occur on the first complete rotation before the position counter is synced with the encoder, but I don't believe it should be happening on direction reversals, specifically since this error must be cleared through software.
Regarding your second question, the QCFL[IEL] should be available in all of the operation mode. Have you configured the index event latch bits (QEPCTZ[IEL])? See the following excerpt from the TRM:
The index event latch bits are ignored in "PC Reset on Index Event" mode, hence why you are able to see it only in 00 mode, but not the others.
Regards,
Peter
Hi Peter,
the encoders used are cheap and no-name. I think it is probably the reason for the erroneous behavior in my test. I want to run the test again, but this time with an encoder from a reputable manufacturer.
All other questions of mine are solved so far. My source code has had several mistakes.
Thank you very much for your support und regards - Bui