Skip to main content
Keyshav Mor
Associate II
January 3, 2017
Question

How to use TIMER in encoder mode for closed loop motor control?

  • January 3, 2017
  • 1 reply
  • 982 views
Posted on January 03, 2017 at 13:00

I am trying to use a potentiometer and an encoder input from the motor to control the motor in closed loop, but I don't know how to go aout it?

Should I compare the encoder with ADC or should I compare it with input pwm signal?

Please Help

#timer #closed-loop #control #motor #encoder
This topic has been closed for replies.

1 reply

Technical Moderator
January 3, 2017
Posted on January 03, 2017 at 14:09

Dear

Mor.Keyshav

‌,

Have a look to this Application note

http://www.st.com/content/ccc/resource/technical/document/application_note/54/0f/67/eb/47/34/45/40/DM000425pdf/files/DM000425pdf/jcr:content/translations/en.DM000425pdf

, it may help you on TIM configuration in encoder mode and advanced features for motor control applications.

You can inspire from an example withinCubefirmware package to develop your application which has the 'TIM_Encoder' example, like STM32CubeF4:STM32Cube_FW_F4_V1.0\Projects\STM324xG_EVAL\Examples\TIM\TIM_Encoder

Hope this helps you.

Best Regards

-Imen-

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Keyshav Mor
Associate II
January 6, 2017
Posted on January 06, 2017 at 08:20

Dear Imen,

Thank you for the help & apologies for the late reply . I tried the example, but unfortunately it is returning a value of zero for the encoder variable. I am really confused about how to use the encoder for the closed loop control. Anywhere on the internet where I can get a stm specific example. I will go through the STM32F4 Example.

Regards,

Keyshav

________________

Attachments :

image001.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyzx&d=%2Fa%2F0X0000000bF7%2FjX0jcgmRPWhO_nDjA47UZM8KziCU7Bg_FWITtuDVnLo&asPdf=false