POSQE001: Position Counter Underflow Event available in Dave 3?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I want to position-control a BLDC-Motor. I am using a quadrature encoder with 1024 Lines (4096 ticks) and Index-Pulse. To count the absolute position of the motor shaft, I checked the “Enable Position Counter Overflow Event” and programmed a Service Routine to count the number of revolutions. In the clockwise direction everything works fine. But in the other direction there is no Interrupt being triggered.
Is it possible to activate an “counter underflow event” of the Position Counter to trigger Interrupts in this direction as well?

There also is another problem: The index pulse of the encoder is only sometimes detected. What could be the problem? The index pulse width of the Faulhaber IE3-Encoder is 90°.


Thanks for your help!
0 Likes
5 Replies
Not applicable
I found a solution for the first problem now: I just had to activate the required events of the POSQE001-App manually:

Status = POSQE001_EnableEvent((POSQE001_HandleType*)&POSQE001_Handle0, POSQE001_POSITION_COUNTER, POSQE001_CCU_PERIOD_MATCH);
Status = POSQE001_EnableEvent((POSQE001_HandleType*)&POSQE001_Handle0, POSQE001_POSITION_COUNTER, POSQE001_CCU_DOWN_COMPARE_MATCH);
Status = POSQE001_EnableEvent((POSQE001_HandleType*)&POSQE001_Handle0, POSQE001_POSITION_COUNTER, POSQE001_CCU_UP_COMPARE_MATCH);


I also connected the POSQE001 App Signal "Position Counter Compare Match Interrupt" with the NVIC002-App. With this I can count my revolutions in both directions now.

The other problem still remains: The index pulse of the encoder is only sometimes detected, at slow speeds more often than at faster speeds. Is it possible that the width of the index pulse is too short for being detected? Is there a workaround available?
0 Likes
Not applicable
Hi,

Do you aware of "POSIF_AI.001" in "XMC4500_AC_Errata_Sheet_v1_1"?

Best regards,
Sophia
0 Likes
Not applicable
Thanks for your answer, sophia. I checked the Errata Sheet, but how can I connect the Index-Signal to the CCU4-Position Counter directly?

In the meantime I found another solution: I disabled the I-Phase in the POSQE-App and added the ERU-App to trigger an interrupt on the index pulse. Works great.

Is there a way to set the position counter to a specific value?
0 Likes
Not applicable
Hi,

The workaround given in the Errata Sheet is purely from HW point of view. This means that you can feed the Index pin directly to the CCUx input.
If you want to use POSQE001 App, what you did is perfectly fine.
Alternatively, I think you can try to enable the I-Phase, check which CCU4 is used (Resource Mapping Reports) then link the position counter to a GPIO. The CCU4 input selector configuration can be found in MULTIPLEXER.c.

Best regards,
Sophia
0 Likes
Not applicable
Hi,

I ran into another problem: I am calculating the absolute Position of my quadrature encoder with:

AbsolutePosition = NumberOfRounds * 4096 + POSQE001_Position;


At every Over- or Underflow-Event of the POSQE001-App I am increasing or decreasing the NumberOfRounds. The "Counter Overflow Value" of the App is "4096". But here is the problem: When for example the Overflow-Event is triggered, the NumberOfRounds is increased in my Service Routine, BUT the PositionCounter of the POSQE001-App remains for a short moment on "4096" ticks before it overflows to "0". The same thing in the opposite direction. So in fact, the AbsolutePosition "jumps" for a split second over 4096 ticks. My control-loop doesn't like that at all ;).

Does anybody know how to solve this problem? Is it maybe possible to extend the "Counter Overflow Value"-width from 16-bit to 32-bit? With this I could avoid the Over- and Underflow problem....


Thanks!
0 Likes