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?
Dear Keyshav Mor,
Have a look to this Application note AN4013 , it may help you on TIM configuration in encoder mode and advanced features for motor control applications.You can inspire from an example within Cube firmware package to develop your application which has the "TIM_Encoder" example, like STM32CubeF4: STM32Cube_FW_F4_V1.14.0\Projects\STM324xG_EVAL\Examples\TIM\TIM_Encoder
Hope this helps you.
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.
Retrieving data ...