Zero point detection
During some point during the development of a spinny display clock
As you can imagine from my last post, these spinny displays need some way to figure out where the zero position is, by itself. One could imagine solving this in a clock context by letting the user set the time by themselves, as they would in a old watch or clock, thus elimiating the need to figure out a zero point, as long as the tick frequency of the dials are right, the position problem would solve itself on every calibration the user ends up doing. But I wanted to solve this problem in case I want to connect to the internet to get time information; primarily to not have any user futz with Daylight Saving Times. By user I only envision me and my friends, but still.
I had decided to solve this problem with attaching a magnet on the underside of the disk and using a hall effect sensor to detect the middle point.
Took a bath, and eventually got the calibration routine working pretty well. It seems to me, the trick is to sweep clockwise & counterclockwise and read all hall effect values and using both sweep data to figure out the best point in between. This algorithm probably quite unreliable when there is a stray magnetic field nearby, but I probably won't try and detect those situations.
The current calibration routine still has a quirk, if the disc is already very near the zero position, starting the calibration routine ends up with a zero point diametrically opposite to the zero point. I know why this is happening; it's a consequence of how I mapped the rotational positions into a numeric range. But fix for that can wait for tomorrow.
P.S. There's a nagging thought in my head that I should maybe convert these displays into a modular spinny display, runnable from a Raspberry Pi etc.
25-12-2024