I am taking data from an absolute encoder which is measuring rotation and I need this to stay accurate (e.g. 0 on encoder = 0 degress, 63 on encoder = 180 degrees) but I also need to smooth between the values.
What you do, in part, depends on what the absolute encoder is putting out (0-359?) Typically something like [Scale rotminvalue rotmaxvalue 0 127] in to a line object to perform smoothing should do the trick. Or is it something trickier in which case we may need more info…
The encoder im looking at outputs 0 – 255 actually so I used scale to map this from 0 – 360 but as i am using this to move an image each increment of 1 causes a less than smooth jump in degrees.
Does that make more sense?
Im using scale before line which gives me floats but there are still market leaps in the values.
With that range you won’t of course get the precision to place the image to a single degree, but with that said, it should be possible to have a gradual motion to your destination without ‘marked leaps". I’ve attached an example here, but not sure how you’re going about it with yours. Maybe you could post your patch…
-- Pasted Max Patch, click to expand. --
Copy all of the following text. Then, in Max, select New From Clipboard.