stm32 servo motor speed calculation method

1. First of all, you must know the HCLK clock frequency, generally the system clock is used hse---->pll

Calculation method: HCLK clock = { [ ( crystal frequency / pllm ) * plln] / pllp } / AHBPrescaler

2. Determine whether the clock used by the timer is APB1 or APB2, and query the corresponding frequency division coefficient to determine the clock frequency of the timer

Calculation method: TCLK = HCLK / ABPPrescaler

Explanation: To view the clock source of the timer clock, you can view the definition in the library function of __HAL_RCC_TIM3_CLK_ENABLE to enable the clock

3. The formula between the motor speed S (rev/min) and the motor resolution Rlu, the timer frequency division coefficient P and the load value R

Calculation formula: S * Rlu * 2 / 60 = TCLK / P / R

explain:

Resolution Rlu, that is, how many pulses the motor makes a circle, usually a pulse is a rising edge or a falling edge, which requires two level periods, so it is multiplied by 2 here

4. If the unit of speed S is revolution/second, the calculation formula is

S * Rlu * 2 = TCLK / P / R


From the above formula, the relationship between speed S and P and R can be deduced for calculation


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325776982&siteId=291194637