X-CUBE-SPN7, speed calculation,counter_ARR_Bemf = __HAL_TIM_GetCounter(&LF_TIMx); The variable counter_ARR_Bemf is step_time ? why El_Speed_Hz = (int32_t)((SIXSTEP_parameters.SYSCLK_frequency)/(prsc))/(__HAL_TIM_GetAutoreload(&LF_TIMx)*6);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-07-02 8:28 PM
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-07-09 2:38 AM
Hi @zquan.1 and welcome to the ST Community.
The variable counter_ARR_Bemf store the last value of Autoreload for Low Frequency timer
With El_Speed_Hz = (int32_t)((SIXSTEP_parameters.SYSCLK_frequency)/(prsc))/(__HAL_TIM_GetAutoreload(&LF_TIMx)*6);
you get the *Eletrical* Motor Speed from ARR value of Commutation / LF TIM
I hope these info can help you; if so, consider to mark it as best answer by clicking the label "Select as Best".
If you feel a post has answered your question, please click "Accept as Solution"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-08-05 2:55 AM
Hi @zquan.1,
my reply solved your doubts?
If you feel a post has answered your question, please click "Accept as Solution"
