I work on the mobile robot with stm32f429 discovery. I read the quad encoder with TIM3(PA6,PA7).
everything is ok
now I want to calculate the speed of dc motor via the encoder.
I enable the TIM10 for the interrupt in 1khz.
my dc motor PWM in 1khz.
my interrupt code as follow
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
// return speed in mm per second
oldEncoder = Encoder;
Count = Encoder - oldEncoder;
but the Count variable is fixed as 2 or 3 in different PWM speed.
How do I do for calculate the speed correctly?
please answer my question.