0 Members and 2 Guests are viewing this topic.
I have old milling machine with 3 Heidenhain encoders.Would like to make display that will show position in 3 coordinates and will run some algorithm in background.Ideally some nucleo board will fit perfectly in this project. But I can not find STM32 with more than 2 timers capable to work in quadrature mode decoding.Does someone knows STM micro with such capabilities?I have alternative with small FPGA as interface but prefer everything to be on STM if possible.
Forgot to mention , resolution is few um so 16 bit is quickly overflowed.But anyhow, looking at pin list I can see only two pairs of encode capable pins.
volatile int32_t pos1;volatile int32_t pos2;volatile int32_t pos3;volatile int32_t pos4;void SysTick_Handler(void){ int16_t tm3 = 0; int16_t tm3dif = 0; static int16_t tm3_d = 0; int16_t tm4 = 0; int16_t tm4dif = 0; static int16_t tm4_d = 0; pos1 = TIM2->CNT; pos2 = TIM5->CNT; tm3 = TIM3->CNT; tm3dif = tm3-tm3_d; pos3 += tm3dif; tm3_d = tm3; tm4 = TIM4->CNT; tm4dif = tm4-tm4_d; pos4 += tm4dif; tm4_d = tm4;}