"Scalar encoder" the number of "w"

I can see Scalar encoder’s parameter of “w” is restricted odd number and w>=21.
Why is this?

1 Like

I remember asking @scott this same question a long time ago, but I don’t remember his answer.

I believe it is so the “center” is absolutely in the middle. The ScalarEncoder deals with a concept called “half width” and another called “padding” where bits to the left and right of the absolute “center” are created in order to establish the radius and resolution.

If you read the code and documentation beginning here it should clear things up a bit…

Cheers,
David

1 Like

Thank you for your reply! I will check it soon!