Not applicable
Mar 27, 2015
06:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 27, 2015
06:58 AM
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!
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!
- Tags:
- bldc
- dave apps
- encoder
- IFX
- incremental
- interrupt
- overflow
- pos
- posif
- position counter
- posqe001
- underflow
- xmc4500
5 Replies
Not applicable
Mar 30, 2015
03:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 30, 2015
03:28 AM
I found a solution for the first problem now: I just had to activate the required events of the POSQE001-App manually:
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?
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?
Not applicable
Mar 31, 2015
03:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 31, 2015
03:53 AM
Not applicable
Mar 31, 2015
05:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 31, 2015
05:16 AM
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?
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?
Not applicable
Apr 01, 2015
11:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 01, 2015
11:25 PM
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
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
Not applicable
Jun 02, 2015
12:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 02, 2015
12:18 AM
Hi,
I ran into another problem: I am calculating the absolute Position of my quadrature encoder with:
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!
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!