2020-09-30 05:35 AM
Hi there
I am using a B-G431B-ESC1 board with a BLDC motor with hall sensor.
The project is generated MC Workbench and is working just fine.
Now I need to know the number of revolutions that the motor have taken since it was started (for application purposes). Since the setup is with a hall sensor, this information must be available somewhere but I cannot find this information in the MC_Api.
Any ways to obtain this information?
Solved! Go to Solution.
2020-10-01 12:28 AM
If anybody else wants to know the number of revolutions of the motor here is my approach:
In the header file hall_speed_pos_fdbk.h:
In the c file hall_speed_pos_fdbk.c:
Usage:
2020-09-30 06:11 AM
The IRQ interrupt handler on capture events is HALL_TIMx_CC_IRQHandler.
Do I need to implement my own logic for position count here, or am I missing an already implemented mechanism?
@DB.7ERGANTIN :)
2020-09-30 06:48 AM
Hello,
"Since the setup is with a hall sensor, this information must be available somewhere but I cannot find this information in the MC_Api."
No, number of revolutions is not a useful information for the control algorithm. The information we use is just the time between two pulses.
So yes, you need to implement you own logic.
Regards
Cedric
2020-09-30 06:52 AM
Hello,
If you want to monitor the number of revolutions since the start, then yes you have to implement your own logic. The purpose here is to compute the actual angle and speed that are used later on by the current and speed controller.
Best regards
2020-10-01 12:28 AM
If anybody else wants to know the number of revolutions of the motor here is my approach:
In the header file hall_speed_pos_fdbk.h:
In the c file hall_speed_pos_fdbk.c:
Usage:
2020-10-08 10:05 AM
Thanks @Community member for sharing your solution, very detailed and clear as well. I like it !
Keep it on :thumbs_up: :thumbs_up:
2021-06-21 01:13 PM
The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK).
Best regards
2024-04-07 02:21 AM
That was a great post JA.1. My problem was not the same as yours but your well thought out solution assisted me in solving my problem.