curious_mind
Full Member level 4

I have sine cos data from encoder and have to convert it to digital corresponding to angle and estimate the velocity as well. I need to do this using MCU. any proven methods?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Rather straight forward:How do we deal with infinity (cos90 or cos270)?
Simultaneous sampling of both inputs would be good. Otherwise you have to perform time point interpolation.Secondly I have to also consider time resolution of the incoming data. Input shaft rotates art low rpm (0-60 rpm) for the highest rpm, time resolution 1/4095 or 244 us.
That's why we have atan2() function. It's already handling the atan() discontinuities.you have to be careful with the atan because it's undefined at -π/2 and π/2.
The distortion of signal vanished, however the angle data points are not equidistant as previously posted.
The data was captured during running conditions,
NB: as all the tan value are between -1 and 1, it's easy to use a LUT and fixed point.