中文 :
功能說明 : 設計Z偵測到脈波輸入時,觸發中斷,清除AB向脈波計數值。
問題描述 :
QEI - 當AB相沒有收到任何輸入脈波時,INCNT無法計數。
當AB相有偵測到輸入脈波時,INCNT才會計數。
這現象會導致,編碼器AB 輸入停止時,無法成功清除AB相計數值。
有其他方法可以讓Z 計數獨立計算,不受INGATE(index gating configuration) 影響嗎?
English :
My Function : when Z detect pulse , interrtup will clear AB count value.
Problem :
QEI - when AB encoder no input pulse, INCNT can not count.
when AB encoder detect input pulse, INCANT can count.
lead to " when AB encoder stop, it can not clear AB count value."
have other way? let Z count indepdently. INGATE ( index gating configuration) can not work.
以下是我QEI 設定
--------------------------------
Any updates?
Hi, Yansin,
Can you tell us the part number you are using?
BR
XiangJun Rong
LPC1519JBD64
INXGATE lead to INXCNT can not count independently , when endcoer A / B is stop.
please try it ......and give me some clear answer.
YES -> how to set ?
NO -> NXP not suppurt.
Simplify my question :
INXCNT (RO 0x020 Index count register) . when endcoer A / B is stop. can INXCNT count independently ?
if YES . how to setting?
if NO.........NXP is not suppurt.
Hi, Yansin,
I suppose that Index Counter counts only Index signal from the IDX pin even if A/B signals stop. If you connect a low frequency clock signal to IDX pin, then check the Index counter in debugger, does it change or not?
BR
XiangJun Rong
Frankly speaking, your answer very ambiguous.
I just want to know (yes or no).
INXCNT (RO 0x020 Index count register) . when endcoer A / B is stop. can INXCNT count independently ?
if YES . how to setting?
if NO.........NXP is not suppurt.
Can you tell me what is Z Counter, is it Position counter?
-> my Z is INXCNT RO 0x020 Index count register.
-> when Z(INXCNT) detect pulse , interrtup will clear AB count value(Position counter).
If it is, how do you clear the counter when the rotor does not spin?
->
My goal : when the rotor does not spin, user can send pulse to Z pin. when Z detect pulse, it clear position couner.
My probolem : when the rotor does not spin, user send pulse to Z pin. Z can not detect pulse, so it can not clear position couner.
Hi, Yansin,
Your issue is that you can not generate interrupt when you send pulse to the QEI_IDX pin, if you set the INX_EN bit with your code:LPC_QEI->IES = ((uint32_t)(1 << 0)); I think the interrupt can be triggered.
But as a workaround, I think you can use software interrupt to solve the problem, in other words, you do not need to send pulse to QEI_IDX pin, but the void QEI_IRQHandler(void) can be executed.
After you call NVIC_SetPendingIRQ(QEI_IRQn);, the QEI interrupt will be triggered.
Hope it can help you
BR
Xiangjun Rong
Hi, Yanish,
Frankly speaking, I do not know your question very clearly. Yes, if the rotor does not spin, PhA and PhB keep their logic, Position counter stops counting, the Positioin Counter remains it's value. In the case, you can read the Velocity capture register when velocity Timer times out, it should be zero.
Can you tell me what is Z Counter, is it Position counter? If it is, how do you clear the counter when the rotor does not spin?
BR
XiangJun Rong