cancel
Showing results for 
Search instead for 
Did you mean: 

stm 32 discovery adc tachometer code for sensorless motor

aman
Associate II
Posted on June 10, 2013 at 17:34

i have a  stm32 discovery kit , and i am sensing  the back emf of sensorless motor which is driven by other kit. i am using adc with one channel and a timer. the main aim to calculate the period while reading the adc->dr register and starting the counter of timer, i am getting the values while debugging but still not able to think the right code which can calculate the period and ultimately the rpm.... i am starting the counter when adc reads non-zero value and stops at zero. am i doing right.........plz help... 

#adc #board #discovery #stm32
1 REPLY 1
raptorhal2
Lead
Posted on June 10, 2013 at 23:12

The ADC reading will have noise and offset, so getting a reliable zero value will be impossible. You need to assess what tolerances need to be applied to ''zero'' and ''non-zero''. And the results may need to be averaged over several cycles to filter noise.

Calculating RPM is simple math based on timer counts per second, EMF transitions per revolution, etc.

Cheers, Hal