Skip to main content
Ehsan Malayjerdi
Visitor II
April 29, 2017
Question

Calculate quad encoder speed in stm32f429 disc

  • April 29, 2017
  • 1 reply
  • 499 views
Posted on April 29, 2017 at 07:52

Hi

I connect the encoder to TIM3 CH1 and CH2

everything fine

my encoder has 9 pulse per round

I want to calculate the speed of encoder to calculate the rpm of motor

but I don't know how?

please help me

    This topic has been closed for replies.

    1 reply

    Vangelis Fortounas
    Associate II
    October 3, 2017
    Posted on October 03, 2017 at 17:03

    Hello!

    To calculate the RPMs use :  Counts*60 / (Time*9)

    Counts= the result from timer.

    Time = 

    the time interval that pulses were measured (in seconds).

    A very simle implementation  is to use a timer to make a time base to have an interrupt every  T time.

    Inside ISR it can calculate the RPMs  with above method.

    Regards

    vf