I printed a new disc for the drive mechanism to step-down the motor rotation a bit more. It came out well, and just a push-fit on the disc shaft it hardly wobbles at all. Very happy with the result. I also came up with a neat idea to spread the changes in PWM values to fractional amounts by writing the motor duty cycle in the 22050Hz interrupt that's playing the video. Then I could have rapid integer values representing fractionals... So, 44 44 44 45 44 44 44 45 44 44 44 45 in other words 44.25. The code is incredibly simple but my first test didn't work. I'll come back to this because it's really elegant. I just wonder if/when I rewrite the duty cycle, if that changes the NEXT square wave's duty, or if it zaps the current one straight away. I need the former, not the latter.
youtu.be/Tnc_aaySTPs
I replaced the PID with some more robust code, and although it's working and more responsive, it also has many problems. I haven't tuned the one seen in the video at all - I just confirmed that it was holding and moved on. Good that I'm learning a lot about PIDs and tuning, though! In the end I may very well abandon the PID concept and put a bit of homebrew algorithm in that has specific knowledge about how to sync a disc (for example, do it like a human would). How would a human do it? Yes, I need to build a mechanical finger to push against the disc to slow it down!