Close

An eye shaped mask for round eyes

A project log for Hybrid Disk Encoder

More than 100K CPR, lasercut, Arduino, cheap and easy to make, absolute position? Could it be? Yep.

james-newtonJames Newton 12/17/2024 at 22:530 Comments

If you hold up a card with a square cut into it in front of a wall before the setting sun, you get a square-shaped shadow on the wall. Now if you move the card away from the wall you might expect to get a fuzzy square, but what you actually get is a circle. The sun projects, its shape, a circle, through anything which is relatively small, held a distance from the backdrop. You can see that same circular shadow with a triangle or a rectangle or any other shape. There's a great Veritasium video about this. 

But only if it's held a little distance from the wall. If you want a precise mask that is not fuzzy you have to hold it right against the wall.

We want to pass a square-ish slot over a mask and get a sine wave. If the mask is a square, what we get is actually more like a triangle. If the mask is a circle we get something closer to a sine. But the actual correct shape to produce a sine wave when passing a rectangular slot over the mask, is the shape of a human eye.


See the issue for the proof. 

https://github.com/JamesNewton/HybridDiskEncoder/issues/3

We are combining the sine and cosine waves to form a circle, plotting the cosine on the x-axis and the sine on the y-axis, then drawing a line from the current point on that plot to the center, and taking the angle of that line to calculate the motion from one-sided slot to the other. If the length of that line varies, the advancement of the angle will not be consistent. We need the plot to be as circular as possible to maintain that constant distance. And that means using the correct mask to produce a sine, and cosine, wave.

Discussions