cancel
Showing results for 
Search instead for 
Did you mean: 

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

Keyshav Mor
Associate II
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
2 REPLIES 2
Imen.D
ST Employee
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-

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
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