This May Really Be Happening
So today I knew that I needed to finish one of the motor mounts, complete with bearings and opto-switch and make sure that the entire electro-mechanical setup actually works. And yes, it really does!
[vimeo 374277351 w=640 h=564]
So yeah, the video just looks like a motor starting and stopping, and admittedly, that is what it is. But the rotary encoder on the motor is actually used to rotate the motor exactly 0.8 revolutions via a P-regulator. And now, the opto-switch is also conected so the arduino is detecting every time a full revolution is completed.
So next time I sit down and write serious code, I will have to write an init routine to make sure the motor knows its absolute position as well. But that is just a question of lots of lines of code, so that can wait.
Another thing I realized today is that when you try to miniaturize your design, it actually becomes very small. When most of your dimensions are counted in single digit millimeters, things get delicate. I was really worried that the lathe would not be able to actually produce the rotary disk for the opto-switch. But after a few incidents of the part jumping out of the lathe, I finally managed to be careful enough to get a piece of the right size.
So I will end with a close-up of the motor mounting block. Everything snuggly in place with no wasted space. The rotary disk isn’t fastened in a good way which I need to figure out how to do, but the rest feels solid.