2015-04-28 07:49 AM
Hello
I am using the STM32F4 interfaced with two hall effect quadrature encoders.Is there a method to generate the signals (A,B) coming from the encoder to validate my work ? because now i don't have the sensor #qei2015-04-28 08:16 AM
Cesar:
That's easy. Just run spare GPIO pins configured as push-pull outputs into the GPIO pins for your encoder inputs. Quadrature repeating pattern is 1st high, then 2nd high, then 1st low, then 2nd low. -Patrick2015-04-28 08:40 AM
Thank youpatrick for your reply
I don't understand your solution. I think that your solution don't give a signal in quadrature, they will be in phase. I attach to you a picture of two signals in quadrature Thank you in advance. ________________ Attachments : encoder-quadrature.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I138&d=%2Fa%2F0X0000000bhM%2F83dYF7V6LYTULxUC1QOookzDMipmwWrs6g7o3Cjq_eI&asPdf=false2015-04-28 10:39 AM
Make sure there is a delay between changing the first simulated phase and the second simulated phase, as described. You can test direction by varying which phase rises first.
Both pins low->delay->phase A pin hi, B lo->delay->phase A hi, B hi -> delay -> phase A lo, phase B hi -> delay -> both pins low will give you one count in one direction. To reverse direction reverse the logic, phase B pin rises first. The delay ensures the signals are out of phase so you get simulated motion. The delay drives your tachometer, how fast the encoder is moving. Jack Peacock2015-04-29 01:35 AM
Thank you Jack , I will test your solution
2015-04-29 05:38 AM
You could generate a quadrature signal using a single TIM, two channels, toggle mode, with the phase shift expressed as the difference in CCR1 vs CCR2 settings.